@gramps-connect/story 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/embed.js CHANGED
@@ -1,11 +1,11 @@
1
- var d8=Object.create;var sx=Object.defineProperty;var f8=Object.getOwnPropertyDescriptor;var m8=Object.getOwnPropertyNames;var g8=Object.getPrototypeOf,y8=Object.prototype.hasOwnProperty;var tn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var _8=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m8(t))!y8.call(e,n)&&n!==r&&sx(e,n,{get:()=>t[n],enumerable:!(i=f8(t,n))||i.enumerable});return e};var ur=(e,t,r)=>(r=e!=null?d8(g8(e)):{},_8(t||!e||!e.__esModule?sx(r,"default",{value:e,enumerable:!0}):r,e));var vx=tn(Ce=>{"use strict";var Sl=Symbol.for("react.element"),v8=Symbol.for("react.portal"),x8=Symbol.for("react.fragment"),b8=Symbol.for("react.strict_mode"),w8=Symbol.for("react.profiler"),T8=Symbol.for("react.provider"),S8=Symbol.for("react.context"),E8=Symbol.for("react.forward_ref"),C8=Symbol.for("react.suspense"),P8=Symbol.for("react.memo"),D8=Symbol.for("react.lazy"),lx=Symbol.iterator;function A8(e){return e===null||typeof e!="object"?null:(e=lx&&e[lx]||e["@@iterator"],typeof e=="function"?e:null)}var hx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},px=Object.assign,dx={};function qo(e,t,r){this.props=e,this.context=t,this.refs=dx,this.updater=r||hx}qo.prototype.isReactComponent={};qo.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")};qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fx(){}fx.prototype=qo.prototype;function Am(e,t,r){this.props=e,this.context=t,this.refs=dx,this.updater=r||hx}var Mm=Am.prototype=new fx;Mm.constructor=Am;px(Mm,qo.prototype);Mm.isPureReactComponent=!0;var ux=Array.isArray,mx=Object.prototype.hasOwnProperty,Im={current:null},gx={key:!0,ref:!0,__self:!0,__source:!0};function yx(e,t,r){var i,n={},a=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)mx.call(t,i)&&!gx.hasOwnProperty(i)&&(n[i]=t[i]);var s=arguments.length-2;if(s===1)n.children=r;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];n.children=l}if(e&&e.defaultProps)for(i in s=e.defaultProps,s)n[i]===void 0&&(n[i]=s[i]);return{$$typeof:Sl,type:e,key:a,ref:o,props:n,_owner:Im.current}}function M8(e,t){return{$$typeof:Sl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function km(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sl}function I8(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var cx=/\/+/g;function Dm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?I8(""+e.key):t.toString(36)}function rh(e,t,r,i,n){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Sl:case v8:o=!0}}if(o)return o=e,n=n(o),e=i===""?"."+Dm(o,0):i,ux(n)?(r="",e!=null&&(r=e.replace(cx,"$&/")+"/"),rh(n,t,r,"",function(u){return u})):n!=null&&(km(n)&&(n=M8(n,r+(!n.key||o&&o.key===n.key?"":(""+n.key).replace(cx,"$&/")+"/")+e)),t.push(n)),1;if(o=0,i=i===""?".":i+":",ux(e))for(var s=0;s<e.length;s++){a=e[s];var l=i+Dm(a,s);o+=rh(a,t,r,l,n)}else if(l=A8(e),typeof l=="function")for(e=l.call(e),s=0;!(a=e.next()).done;)a=a.value,l=i+Dm(a,s++),o+=rh(a,t,r,l,n);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function th(e,t,r){if(e==null)return e;var i=[],n=0;return rh(e,i,"","",function(a){return t.call(r,a,n++)}),i}function k8(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xr={current:null},ih={transition:null},z8={ReactCurrentDispatcher:xr,ReactCurrentBatchConfig:ih,ReactCurrentOwner:Im};function _x(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:th,forEach:function(e,t,r){th(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return th(e,function(){t++}),t},toArray:function(e){return th(e,function(t){return t})||[]},only:function(e){if(!km(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ce.Component=qo;Ce.Fragment=x8;Ce.Profiler=w8;Ce.PureComponent=Am;Ce.StrictMode=b8;Ce.Suspense=C8;Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z8;Ce.act=_x;Ce.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=px({},e.props),n=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Im.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)mx.call(t,l)&&!gx.hasOwnProperty(l)&&(i[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];i.children=s}return{$$typeof:Sl,type:e.type,key:n,ref:a,props:i,_owner:o}};Ce.createContext=function(e){return e={$$typeof:S8,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:T8,_context:e},e.Consumer=e};Ce.createElement=yx;Ce.createFactory=function(e){var t=yx.bind(null,e);return t.type=e,t};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(e){return{$$typeof:E8,render:e}};Ce.isValidElement=km;Ce.lazy=function(e){return{$$typeof:D8,_payload:{_status:-1,_result:e},_init:k8}};Ce.memo=function(e,t){return{$$typeof:P8,type:e,compare:t===void 0?null:t}};Ce.startTransition=function(e){var t=ih.transition;ih.transition={};try{e()}finally{ih.transition=t}};Ce.unstable_act=_x;Ce.useCallback=function(e,t){return xr.current.useCallback(e,t)};Ce.useContext=function(e){return xr.current.useContext(e)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(e){return xr.current.useDeferredValue(e)};Ce.useEffect=function(e,t){return xr.current.useEffect(e,t)};Ce.useId=function(){return xr.current.useId()};Ce.useImperativeHandle=function(e,t,r){return xr.current.useImperativeHandle(e,t,r)};Ce.useInsertionEffect=function(e,t){return xr.current.useInsertionEffect(e,t)};Ce.useLayoutEffect=function(e,t){return xr.current.useLayoutEffect(e,t)};Ce.useMemo=function(e,t){return xr.current.useMemo(e,t)};Ce.useReducer=function(e,t,r){return xr.current.useReducer(e,t,r)};Ce.useRef=function(e){return xr.current.useRef(e)};Ce.useState=function(e){return xr.current.useState(e)};Ce.useSyncExternalStore=function(e,t,r){return xr.current.useSyncExternalStore(e,t,r)};Ce.useTransition=function(){return xr.current.useTransition()};Ce.version="18.3.1"});var $a=tn((nH,xx)=>{"use strict";xx.exports=vx()});var Mx=tn(Ke=>{"use strict";function Lm(e,t){var r=e.length;e.push(t);e:for(;0<r;){var i=r-1>>>1,n=e[i];if(0<nh(n,t))e[i]=t,e[r]=n,r=i;else break e}}function Mi(e){return e.length===0?null:e[0]}function oh(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var i=0,n=e.length,a=n>>>1;i<a;){var o=2*(i+1)-1,s=e[o],l=o+1,u=e[l];if(0>nh(s,r))l<n&&0>nh(u,s)?(e[i]=u,e[l]=r,i=l):(e[i]=s,e[o]=r,i=o);else if(l<n&&0>nh(u,r))e[i]=u,e[l]=r,i=l;else break e}}return t}function nh(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(bx=performance,Ke.unstable_now=function(){return bx.now()}):(zm=Date,wx=zm.now(),Ke.unstable_now=function(){return zm.now()-wx});var bx,zm,wx,rn=[],Jn=[],F8=1,si=null,cr=3,sh=!1,qa=!1,Cl=!1,Ex=typeof setTimeout=="function"?setTimeout:null,Cx=typeof clearTimeout=="function"?clearTimeout:null,Tx=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Bm(e){for(var t=Mi(Jn);t!==null;){if(t.callback===null)oh(Jn);else if(t.startTime<=e)oh(Jn),t.sortIndex=t.expirationTime,Lm(rn,t);else break;t=Mi(Jn)}}function Om(e){if(Cl=!1,Bm(e),!qa)if(Mi(rn)!==null)qa=!0,Nm(jm);else{var t=Mi(Jn);t!==null&&Vm(Om,t.startTime-e)}}function jm(e,t){qa=!1,Cl&&(Cl=!1,Cx(Pl),Pl=-1),sh=!0;var r=cr;try{for(Bm(t),si=Mi(rn);si!==null&&(!(si.expirationTime>t)||e&&!Ax());){var i=si.callback;if(typeof i=="function"){si.callback=null,cr=si.priorityLevel;var n=i(si.expirationTime<=t);t=Ke.unstable_now(),typeof n=="function"?si.callback=n:si===Mi(rn)&&oh(rn),Bm(t)}else oh(rn);si=Mi(rn)}if(si!==null)var a=!0;else{var o=Mi(Jn);o!==null&&Vm(Om,o.startTime-t),a=!1}return a}finally{si=null,cr=r,sh=!1}}var lh=!1,ah=null,Pl=-1,Px=5,Dx=-1;function Ax(){return!(Ke.unstable_now()-Dx<Px)}function Fm(){if(ah!==null){var e=Ke.unstable_now();Dx=e;var t=!0;try{t=ah(!0,e)}finally{t?El():(lh=!1,ah=null)}}else lh=!1}var El;typeof Tx=="function"?El=function(){Tx(Fm)}:typeof MessageChannel<"u"?(Rm=new MessageChannel,Sx=Rm.port2,Rm.port1.onmessage=Fm,El=function(){Sx.postMessage(null)}):El=function(){Ex(Fm,0)};var Rm,Sx;function Nm(e){ah=e,lh||(lh=!0,El())}function Vm(e,t){Pl=Ex(function(){e(Ke.unstable_now())},t)}Ke.unstable_IdlePriority=5;Ke.unstable_ImmediatePriority=1;Ke.unstable_LowPriority=4;Ke.unstable_NormalPriority=3;Ke.unstable_Profiling=null;Ke.unstable_UserBlockingPriority=2;Ke.unstable_cancelCallback=function(e){e.callback=null};Ke.unstable_continueExecution=function(){qa||sh||(qa=!0,Nm(jm))};Ke.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Px=0<e?Math.floor(1e3/e):5};Ke.unstable_getCurrentPriorityLevel=function(){return cr};Ke.unstable_getFirstCallbackNode=function(){return Mi(rn)};Ke.unstable_next=function(e){switch(cr){case 1:case 2:case 3:var t=3;break;default:t=cr}var r=cr;cr=t;try{return e()}finally{cr=r}};Ke.unstable_pauseExecution=function(){};Ke.unstable_requestPaint=function(){};Ke.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=cr;cr=e;try{return t()}finally{cr=r}};Ke.unstable_scheduleCallback=function(e,t,r){var i=Ke.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?i+r:i):r=i,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=r+n,e={id:F8++,callback:t,priorityLevel:e,startTime:r,expirationTime:n,sortIndex:-1},r>i?(e.sortIndex=r,Lm(Jn,e),Mi(rn)===null&&e===Mi(Jn)&&(Cl?(Cx(Pl),Pl=-1):Cl=!0,Vm(Om,r-i))):(e.sortIndex=n,Lm(rn,e),qa||sh||(qa=!0,Nm(jm))),e};Ke.unstable_shouldYield=Ax;Ke.unstable_wrapCallback=function(e){var t=cr;return function(){var r=cr;cr=t;try{return e.apply(this,arguments)}finally{cr=r}}}});var kx=tn((oH,Ix)=>{"use strict";Ix.exports=Mx()});var L3=tn(Yr=>{"use strict";var R8=$a(),Hr=kx();function V(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var jb=new Set,Yl={};function io(e,t){hs(e,t),hs(e+"Capture",t)}function hs(e,t){for(Yl[e]=t,e=0;e<t.length;e++)jb.add(t[e])}var Dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cg=Object.prototype.hasOwnProperty,L8=/^[: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]*$/,zx={},Fx={};function B8(e){return cg.call(Fx,e)?!0:cg.call(zx,e)?!1:L8.test(e)?Fx[e]=!0:(zx[e]=!0,!1)}function O8(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j8(e,t,r,i){if(t===null||typeof t>"u"||O8(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.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 Tr(e,t,r,i,n,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var tr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tr[e]=new Tr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tr[t]=new Tr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tr[e]=new Tr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tr[e]=new Tr(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){tr[e]=new Tr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tr[e]=new Tr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tr[e]=new Tr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tr[e]=new Tr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tr[e]=new Tr(e,5,!1,e.toLowerCase(),null,!1,!1)});var r0=/[\-:]([a-z])/g;function i0(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(r0,i0);tr[t]=new Tr(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(r0,i0);tr[t]=new Tr(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(r0,i0);tr[t]=new Tr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tr[e]=new Tr(e,1,!1,e.toLowerCase(),null,!1,!1)});tr.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tr[e]=new Tr(e,1,!1,e.toLowerCase(),null,!0,!0)});function n0(e,t,r,i){var n=tr.hasOwnProperty(t)?tr[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(j8(t,r,n,i)&&(r=null),i||n===null?B8(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:"":r:(t=n.attributeName,i=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var kn=R8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,uh=Symbol.for("react.element"),Ho=Symbol.for("react.portal"),Wo=Symbol.for("react.fragment"),a0=Symbol.for("react.strict_mode"),hg=Symbol.for("react.profiler"),Nb=Symbol.for("react.provider"),Vb=Symbol.for("react.context"),o0=Symbol.for("react.forward_ref"),pg=Symbol.for("react.suspense"),dg=Symbol.for("react.suspense_list"),s0=Symbol.for("react.memo"),ta=Symbol.for("react.lazy"),Ub=Symbol.for("react.offscreen"),Rx=Symbol.iterator;function Dl(e){return e===null||typeof e!="object"?null:(e=Rx&&e[Rx]||e["@@iterator"],typeof e=="function"?e:null)}var _t=Object.assign,Um;function Ll(e){if(Um===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Um=t&&t[1]||""}return`
1
+ var d8=Object.create;var sx=Object.defineProperty;var f8=Object.getOwnPropertyDescriptor;var m8=Object.getOwnPropertyNames;var g8=Object.getPrototypeOf,y8=Object.prototype.hasOwnProperty;var tn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var _8=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m8(t))!y8.call(e,n)&&n!==r&&sx(e,n,{get:()=>t[n],enumerable:!(i=f8(t,n))||i.enumerable});return e};var ur=(e,t,r)=>(r=e!=null?d8(g8(e)):{},_8(t||!e||!e.__esModule?sx(r,"default",{value:e,enumerable:!0}):r,e));var vx=tn(Ce=>{"use strict";var Sl=Symbol.for("react.element"),v8=Symbol.for("react.portal"),x8=Symbol.for("react.fragment"),b8=Symbol.for("react.strict_mode"),w8=Symbol.for("react.profiler"),T8=Symbol.for("react.provider"),S8=Symbol.for("react.context"),E8=Symbol.for("react.forward_ref"),C8=Symbol.for("react.suspense"),P8=Symbol.for("react.memo"),D8=Symbol.for("react.lazy"),lx=Symbol.iterator;function A8(e){return e===null||typeof e!="object"?null:(e=lx&&e[lx]||e["@@iterator"],typeof e=="function"?e:null)}var hx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},px=Object.assign,dx={};function qo(e,t,r){this.props=e,this.context=t,this.refs=dx,this.updater=r||hx}qo.prototype.isReactComponent={};qo.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")};qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fx(){}fx.prototype=qo.prototype;function Am(e,t,r){this.props=e,this.context=t,this.refs=dx,this.updater=r||hx}var Mm=Am.prototype=new fx;Mm.constructor=Am;px(Mm,qo.prototype);Mm.isPureReactComponent=!0;var ux=Array.isArray,mx=Object.prototype.hasOwnProperty,Im={current:null},gx={key:!0,ref:!0,__self:!0,__source:!0};function yx(e,t,r){var i,n={},a=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)mx.call(t,i)&&!gx.hasOwnProperty(i)&&(n[i]=t[i]);var s=arguments.length-2;if(s===1)n.children=r;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];n.children=l}if(e&&e.defaultProps)for(i in s=e.defaultProps,s)n[i]===void 0&&(n[i]=s[i]);return{$$typeof:Sl,type:e,key:a,ref:o,props:n,_owner:Im.current}}function M8(e,t){return{$$typeof:Sl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function km(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sl}function I8(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var cx=/\/+/g;function Dm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?I8(""+e.key):t.toString(36)}function rh(e,t,r,i,n){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Sl:case v8:o=!0}}if(o)return o=e,n=n(o),e=i===""?"."+Dm(o,0):i,ux(n)?(r="",e!=null&&(r=e.replace(cx,"$&/")+"/"),rh(n,t,r,"",function(u){return u})):n!=null&&(km(n)&&(n=M8(n,r+(!n.key||o&&o.key===n.key?"":(""+n.key).replace(cx,"$&/")+"/")+e)),t.push(n)),1;if(o=0,i=i===""?".":i+":",ux(e))for(var s=0;s<e.length;s++){a=e[s];var l=i+Dm(a,s);o+=rh(a,t,r,l,n)}else if(l=A8(e),typeof l=="function")for(e=l.call(e),s=0;!(a=e.next()).done;)a=a.value,l=i+Dm(a,s++),o+=rh(a,t,r,l,n);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function th(e,t,r){if(e==null)return e;var i=[],n=0;return rh(e,i,"","",function(a){return t.call(r,a,n++)}),i}function k8(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xr={current:null},ih={transition:null},z8={ReactCurrentDispatcher:xr,ReactCurrentBatchConfig:ih,ReactCurrentOwner:Im};function _x(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:th,forEach:function(e,t,r){th(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return th(e,function(){t++}),t},toArray:function(e){return th(e,function(t){return t})||[]},only:function(e){if(!km(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ce.Component=qo;Ce.Fragment=x8;Ce.Profiler=w8;Ce.PureComponent=Am;Ce.StrictMode=b8;Ce.Suspense=C8;Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z8;Ce.act=_x;Ce.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=px({},e.props),n=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Im.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)mx.call(t,l)&&!gx.hasOwnProperty(l)&&(i[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];i.children=s}return{$$typeof:Sl,type:e.type,key:n,ref:a,props:i,_owner:o}};Ce.createContext=function(e){return e={$$typeof:S8,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:T8,_context:e},e.Consumer=e};Ce.createElement=yx;Ce.createFactory=function(e){var t=yx.bind(null,e);return t.type=e,t};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(e){return{$$typeof:E8,render:e}};Ce.isValidElement=km;Ce.lazy=function(e){return{$$typeof:D8,_payload:{_status:-1,_result:e},_init:k8}};Ce.memo=function(e,t){return{$$typeof:P8,type:e,compare:t===void 0?null:t}};Ce.startTransition=function(e){var t=ih.transition;ih.transition={};try{e()}finally{ih.transition=t}};Ce.unstable_act=_x;Ce.useCallback=function(e,t){return xr.current.useCallback(e,t)};Ce.useContext=function(e){return xr.current.useContext(e)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(e){return xr.current.useDeferredValue(e)};Ce.useEffect=function(e,t){return xr.current.useEffect(e,t)};Ce.useId=function(){return xr.current.useId()};Ce.useImperativeHandle=function(e,t,r){return xr.current.useImperativeHandle(e,t,r)};Ce.useInsertionEffect=function(e,t){return xr.current.useInsertionEffect(e,t)};Ce.useLayoutEffect=function(e,t){return xr.current.useLayoutEffect(e,t)};Ce.useMemo=function(e,t){return xr.current.useMemo(e,t)};Ce.useReducer=function(e,t,r){return xr.current.useReducer(e,t,r)};Ce.useRef=function(e){return xr.current.useRef(e)};Ce.useState=function(e){return xr.current.useState(e)};Ce.useSyncExternalStore=function(e,t,r){return xr.current.useSyncExternalStore(e,t,r)};Ce.useTransition=function(){return xr.current.useTransition()};Ce.version="18.3.1"});var $a=tn((lH,xx)=>{"use strict";xx.exports=vx()});var Mx=tn(Ke=>{"use strict";function Lm(e,t){var r=e.length;e.push(t);e:for(;0<r;){var i=r-1>>>1,n=e[i];if(0<nh(n,t))e[i]=t,e[r]=n,r=i;else break e}}function Mi(e){return e.length===0?null:e[0]}function oh(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var i=0,n=e.length,a=n>>>1;i<a;){var o=2*(i+1)-1,s=e[o],l=o+1,u=e[l];if(0>nh(s,r))l<n&&0>nh(u,s)?(e[i]=u,e[l]=r,i=l):(e[i]=s,e[o]=r,i=o);else if(l<n&&0>nh(u,r))e[i]=u,e[l]=r,i=l;else break e}}return t}function nh(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(bx=performance,Ke.unstable_now=function(){return bx.now()}):(zm=Date,wx=zm.now(),Ke.unstable_now=function(){return zm.now()-wx});var bx,zm,wx,rn=[],Jn=[],F8=1,si=null,cr=3,sh=!1,qa=!1,Cl=!1,Ex=typeof setTimeout=="function"?setTimeout:null,Cx=typeof clearTimeout=="function"?clearTimeout:null,Tx=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Bm(e){for(var t=Mi(Jn);t!==null;){if(t.callback===null)oh(Jn);else if(t.startTime<=e)oh(Jn),t.sortIndex=t.expirationTime,Lm(rn,t);else break;t=Mi(Jn)}}function Om(e){if(Cl=!1,Bm(e),!qa)if(Mi(rn)!==null)qa=!0,Nm(jm);else{var t=Mi(Jn);t!==null&&Vm(Om,t.startTime-e)}}function jm(e,t){qa=!1,Cl&&(Cl=!1,Cx(Pl),Pl=-1),sh=!0;var r=cr;try{for(Bm(t),si=Mi(rn);si!==null&&(!(si.expirationTime>t)||e&&!Ax());){var i=si.callback;if(typeof i=="function"){si.callback=null,cr=si.priorityLevel;var n=i(si.expirationTime<=t);t=Ke.unstable_now(),typeof n=="function"?si.callback=n:si===Mi(rn)&&oh(rn),Bm(t)}else oh(rn);si=Mi(rn)}if(si!==null)var a=!0;else{var o=Mi(Jn);o!==null&&Vm(Om,o.startTime-t),a=!1}return a}finally{si=null,cr=r,sh=!1}}var lh=!1,ah=null,Pl=-1,Px=5,Dx=-1;function Ax(){return!(Ke.unstable_now()-Dx<Px)}function Fm(){if(ah!==null){var e=Ke.unstable_now();Dx=e;var t=!0;try{t=ah(!0,e)}finally{t?El():(lh=!1,ah=null)}}else lh=!1}var El;typeof Tx=="function"?El=function(){Tx(Fm)}:typeof MessageChannel<"u"?(Rm=new MessageChannel,Sx=Rm.port2,Rm.port1.onmessage=Fm,El=function(){Sx.postMessage(null)}):El=function(){Ex(Fm,0)};var Rm,Sx;function Nm(e){ah=e,lh||(lh=!0,El())}function Vm(e,t){Pl=Ex(function(){e(Ke.unstable_now())},t)}Ke.unstable_IdlePriority=5;Ke.unstable_ImmediatePriority=1;Ke.unstable_LowPriority=4;Ke.unstable_NormalPriority=3;Ke.unstable_Profiling=null;Ke.unstable_UserBlockingPriority=2;Ke.unstable_cancelCallback=function(e){e.callback=null};Ke.unstable_continueExecution=function(){qa||sh||(qa=!0,Nm(jm))};Ke.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Px=0<e?Math.floor(1e3/e):5};Ke.unstable_getCurrentPriorityLevel=function(){return cr};Ke.unstable_getFirstCallbackNode=function(){return Mi(rn)};Ke.unstable_next=function(e){switch(cr){case 1:case 2:case 3:var t=3;break;default:t=cr}var r=cr;cr=t;try{return e()}finally{cr=r}};Ke.unstable_pauseExecution=function(){};Ke.unstable_requestPaint=function(){};Ke.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=cr;cr=e;try{return t()}finally{cr=r}};Ke.unstable_scheduleCallback=function(e,t,r){var i=Ke.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?i+r:i):r=i,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=r+n,e={id:F8++,callback:t,priorityLevel:e,startTime:r,expirationTime:n,sortIndex:-1},r>i?(e.sortIndex=r,Lm(Jn,e),Mi(rn)===null&&e===Mi(Jn)&&(Cl?(Cx(Pl),Pl=-1):Cl=!0,Vm(Om,r-i))):(e.sortIndex=n,Lm(rn,e),qa||sh||(qa=!0,Nm(jm))),e};Ke.unstable_shouldYield=Ax;Ke.unstable_wrapCallback=function(e){var t=cr;return function(){var r=cr;cr=t;try{return e.apply(this,arguments)}finally{cr=r}}}});var kx=tn((cH,Ix)=>{"use strict";Ix.exports=Mx()});var L3=tn(Yr=>{"use strict";var R8=$a(),Hr=kx();function V(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var jb=new Set,Yl={};function io(e,t){hs(e,t),hs(e+"Capture",t)}function hs(e,t){for(Yl[e]=t,e=0;e<t.length;e++)jb.add(t[e])}var Dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cg=Object.prototype.hasOwnProperty,L8=/^[: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]*$/,zx={},Fx={};function B8(e){return cg.call(Fx,e)?!0:cg.call(zx,e)?!1:L8.test(e)?Fx[e]=!0:(zx[e]=!0,!1)}function O8(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j8(e,t,r,i){if(t===null||typeof t>"u"||O8(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.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 Tr(e,t,r,i,n,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var tr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tr[e]=new Tr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tr[t]=new Tr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tr[e]=new Tr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tr[e]=new Tr(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){tr[e]=new Tr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tr[e]=new Tr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tr[e]=new Tr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tr[e]=new Tr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tr[e]=new Tr(e,5,!1,e.toLowerCase(),null,!1,!1)});var r0=/[\-:]([a-z])/g;function i0(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(r0,i0);tr[t]=new Tr(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(r0,i0);tr[t]=new Tr(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(r0,i0);tr[t]=new Tr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tr[e]=new Tr(e,1,!1,e.toLowerCase(),null,!1,!1)});tr.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tr[e]=new Tr(e,1,!1,e.toLowerCase(),null,!0,!0)});function n0(e,t,r,i){var n=tr.hasOwnProperty(t)?tr[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(j8(t,r,n,i)&&(r=null),i||n===null?B8(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:"":r:(t=n.attributeName,i=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var kn=R8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,uh=Symbol.for("react.element"),Ho=Symbol.for("react.portal"),Wo=Symbol.for("react.fragment"),a0=Symbol.for("react.strict_mode"),hg=Symbol.for("react.profiler"),Nb=Symbol.for("react.provider"),Vb=Symbol.for("react.context"),o0=Symbol.for("react.forward_ref"),pg=Symbol.for("react.suspense"),dg=Symbol.for("react.suspense_list"),s0=Symbol.for("react.memo"),ta=Symbol.for("react.lazy"),Ub=Symbol.for("react.offscreen"),Rx=Symbol.iterator;function Dl(e){return e===null||typeof e!="object"?null:(e=Rx&&e[Rx]||e["@@iterator"],typeof e=="function"?e:null)}var _t=Object.assign,Um;function Ll(e){if(Um===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Um=t&&t[1]||""}return`
2
2
  `+Um+e}var $m=!1;function qm(e,t){if(!e||$m)return"";$m=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var i=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){i=u}e.call(t.prototype)}else{try{throw Error()}catch(u){i=u}e()}}catch(u){if(u&&i&&typeof u.stack=="string"){for(var n=u.stack.split(`
3
3
  `),a=i.stack.split(`
4
4
  `),o=n.length-1,s=a.length-1;1<=o&&0<=s&&n[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(n[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||n[o]!==a[s]){var l=`
5
5
  `+n[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{$m=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ll(e):""}function N8(e){switch(e.tag){case 5:return Ll(e.type);case 16:return Ll("Lazy");case 13:return Ll("Suspense");case 19:return Ll("SuspenseList");case 0:case 2:case 15:return e=qm(e.type,!1),e;case 11:return e=qm(e.type.render,!1),e;case 1:return e=qm(e.type,!0),e;default:return""}}function fg(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 Wo:return"Fragment";case Ho:return"Portal";case hg:return"Profiler";case a0:return"StrictMode";case pg:return"Suspense";case dg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Vb:return(e.displayName||"Context")+".Consumer";case Nb:return(e._context.displayName||"Context")+".Provider";case o0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case s0:return t=e.displayName||null,t!==null?t:fg(e.type)||"Memo";case ta:t=e._payload,e=e._init;try{return fg(e(t))}catch{}}return null}function V8(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 fg(t);case 8:return t===a0?"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 ma(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $b(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function U8(e){var t=$b(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){i=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ch(e){e._valueTracker||(e._valueTracker=U8(e))}function qb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=$b(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Oh(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 mg(e,t){var r=t.checked;return _t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Lx(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=ma(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gb(e,t){t=t.checked,t!=null&&n0(e,"checked",t,!1)}function gg(e,t){Gb(e,t);var r=ma(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yg(e,t.type,r):t.hasOwnProperty("defaultValue")&&yg(e,t.type,ma(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bx(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function yg(e,t,r){(t!=="number"||Oh(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Bl=Array.isArray;function as(e,t,r,i){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t["$"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty("$"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&i&&(e[r].defaultSelected=!0)}else{for(r=""+ma(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function _g(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return _t({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ox(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(V(92));if(Bl(r)){if(1<r.length)throw Error(V(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:ma(r)}}function Zb(e,t){var r=ma(t.value),i=ma(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function jx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Hb(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function vg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Hb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hh,Wb=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,n){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,n)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(hh=hh||document.createElement("div"),hh.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Nl={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},$8=["Webkit","ms","Moz","O"];Object.keys(Nl).forEach(function(e){$8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Nl[t]=Nl[e]})});function Yb(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Nl.hasOwnProperty(e)&&Nl[e]?(""+t).trim():t+"px"}function Xb(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=Yb(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,n):e[r]=n}}var q8=_t({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 xg(e,t){if(t){if(q8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function bg(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 wg=null;function l0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tg=null,os=null,ss=null;function Nx(e){if(e=fu(e)){if(typeof Tg!="function")throw Error(V(280));var t=e.stateNode;t&&(t=pp(t),Tg(e.stateNode,e.type,t))}}function Kb(e){os?ss?ss.push(e):ss=[e]:os=e}function Qb(){if(os){var e=os,t=ss;if(ss=os=null,Nx(e),t)for(e=0;e<t.length;e++)Nx(t[e])}}function Jb(e,t){return e(t)}function ew(){}var Gm=!1;function tw(e,t,r){if(Gm)return e(t,r);Gm=!0;try{return Jb(e,t,r)}finally{Gm=!1,(os!==null||ss!==null)&&(ew(),Qb())}}function Kl(e,t){var r=e.stateNode;if(r===null)return null;var i=pp(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(V(231,t,typeof r));return r}var Sg=!1;if(Dn)try{Go={},Object.defineProperty(Go,"passive",{get:function(){Sg=!0}}),window.addEventListener("test",Go,Go),window.removeEventListener("test",Go,Go)}catch{Sg=!1}var Go;function G8(e,t,r,i,n,a,o,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(c){this.onError(c)}}var Vl=!1,jh=null,Nh=!1,Eg=null,Z8={onError:function(e){Vl=!0,jh=e}};function H8(e,t,r,i,n,a,o,s,l){Vl=!1,jh=null,G8.apply(Z8,arguments)}function W8(e,t,r,i,n,a,o,s,l){if(H8.apply(this,arguments),Vl){if(Vl){var u=jh;Vl=!1,jh=null}else throw Error(V(198));Nh||(Nh=!0,Eg=u)}}function no(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function rw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Vx(e){if(no(e)!==e)throw Error(V(188))}function Y8(e){var t=e.alternate;if(!t){if(t=no(e),t===null)throw Error(V(188));return t!==e?null:e}for(var r=e,i=t;;){var n=r.return;if(n===null)break;var a=n.alternate;if(a===null){if(i=n.return,i!==null){r=i;continue}break}if(n.child===a.child){for(a=n.child;a;){if(a===r)return Vx(n),e;if(a===i)return Vx(n),t;a=a.sibling}throw Error(V(188))}if(r.return!==i.return)r=n,i=a;else{for(var o=!1,s=n.child;s;){if(s===r){o=!0,r=n,i=a;break}if(s===i){o=!0,i=n,r=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===r){o=!0,r=a,i=n;break}if(s===i){o=!0,i=a,r=n;break}s=s.sibling}if(!o)throw Error(V(189))}}if(r.alternate!==i)throw Error(V(190))}if(r.tag!==3)throw Error(V(188));return r.stateNode.current===r?e:t}function iw(e){return e=Y8(e),e!==null?nw(e):null}function nw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=nw(e);if(t!==null)return t;e=e.sibling}return null}var aw=Hr.unstable_scheduleCallback,Ux=Hr.unstable_cancelCallback,X8=Hr.unstable_shouldYield,K8=Hr.unstable_requestPaint,Dt=Hr.unstable_now,Q8=Hr.unstable_getCurrentPriorityLevel,u0=Hr.unstable_ImmediatePriority,ow=Hr.unstable_UserBlockingPriority,Vh=Hr.unstable_NormalPriority,J8=Hr.unstable_LowPriority,sw=Hr.unstable_IdlePriority,lp=null,sn=null;function eA(e){if(sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(lp,e,void 0,(e.current.flags&128)===128)}catch{}}var Ri=Math.clz32?Math.clz32:iA,tA=Math.log,rA=Math.LN2;function iA(e){return e>>>=0,e===0?32:31-(tA(e)/rA|0)|0}var ph=64,dh=4194304;function Ol(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 Uh(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~n;s!==0?i=Ol(s):(a&=o,a!==0&&(i=Ol(a)))}else o=r&~n,o!==0?i=Ol(o):a!==0&&(i=Ol(a));if(i===0)return 0;if(t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===16&&(a&4194240)!==0))return t;if((i&4)!==0&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-Ri(t),n=1<<r,i|=e[r],t&=~n;return i}function nA(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function aA(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ri(a),s=1<<o,l=n[o];l===-1?((s&r)===0||(s&i)!==0)&&(n[o]=nA(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}function Cg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function lw(){var e=ph;return ph<<=1,(ph&4194240)===0&&(ph=64),e}function Zm(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function pu(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ri(t),e[t]=r}function oA(e,t){var r=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 i=e.eventTimes;for(e=e.expirationTimes;0<r;){var n=31-Ri(r),a=1<<n;t[n]=0,i[n]=-1,e[n]=-1,r&=~a}}function c0(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Ri(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}var Ge=0;function uw(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var cw,h0,hw,pw,dw,Pg=!1,fh=[],sa=null,la=null,ua=null,Ql=new Map,Jl=new Map,ia=[],sA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function $x(e,t){switch(e){case"focusin":case"focusout":sa=null;break;case"dragenter":case"dragleave":la=null;break;case"mouseover":case"mouseout":ua=null;break;case"pointerover":case"pointerout":Ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jl.delete(t.pointerId)}}function Al(e,t,r,i,n,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:a,targetContainers:[n]},t!==null&&(t=fu(t),t!==null&&h0(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function lA(e,t,r,i,n){switch(t){case"focusin":return sa=Al(sa,e,t,r,i,n),!0;case"dragenter":return la=Al(la,e,t,r,i,n),!0;case"mouseover":return ua=Al(ua,e,t,r,i,n),!0;case"pointerover":var a=n.pointerId;return Ql.set(a,Al(Ql.get(a)||null,e,t,r,i,n)),!0;case"gotpointercapture":return a=n.pointerId,Jl.set(a,Al(Jl.get(a)||null,e,t,r,i,n)),!0}return!1}function fw(e){var t=Ha(e.target);if(t!==null){var r=no(t);if(r!==null){if(t=r.tag,t===13){if(t=rw(r),t!==null){e.blockedOn=t,dw(e.priority,function(){hw(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Dg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);wg=i,r.target.dispatchEvent(i),wg=null}else return t=fu(r),t!==null&&h0(t),e.blockedOn=r,!1;t.shift()}return!0}function qx(e,t,r){Dh(e)&&r.delete(t)}function uA(){Pg=!1,sa!==null&&Dh(sa)&&(sa=null),la!==null&&Dh(la)&&(la=null),ua!==null&&Dh(ua)&&(ua=null),Ql.forEach(qx),Jl.forEach(qx)}function Ml(e,t){e.blockedOn===t&&(e.blockedOn=null,Pg||(Pg=!0,Hr.unstable_scheduleCallback(Hr.unstable_NormalPriority,uA)))}function eu(e){function t(n){return Ml(n,e)}if(0<fh.length){Ml(fh[0],e);for(var r=1;r<fh.length;r++){var i=fh[r];i.blockedOn===e&&(i.blockedOn=null)}}for(sa!==null&&Ml(sa,e),la!==null&&Ml(la,e),ua!==null&&Ml(ua,e),Ql.forEach(t),Jl.forEach(t),r=0;r<ia.length;r++)i=ia[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<ia.length&&(r=ia[0],r.blockedOn===null);)fw(r),r.blockedOn===null&&ia.shift()}var ls=kn.ReactCurrentBatchConfig,$h=!0;function cA(e,t,r,i){var n=Ge,a=ls.transition;ls.transition=null;try{Ge=1,p0(e,t,r,i)}finally{Ge=n,ls.transition=a}}function hA(e,t,r,i){var n=Ge,a=ls.transition;ls.transition=null;try{Ge=4,p0(e,t,r,i)}finally{Ge=n,ls.transition=a}}function p0(e,t,r,i){if($h){var n=Dg(e,t,r,i);if(n===null)Jm(e,t,i,qh,r),$x(e,i);else if(lA(n,e,t,r,i))i.stopPropagation();else if($x(e,i),t&4&&-1<sA.indexOf(e)){for(;n!==null;){var a=fu(n);if(a!==null&&cw(a),a=Dg(e,t,r,i),a===null&&Jm(e,t,i,qh,r),a===n)break;n=a}n!==null&&i.stopPropagation()}else Jm(e,t,i,null,r)}}var qh=null;function Dg(e,t,r,i){if(qh=null,e=l0(i),e=Ha(e),e!==null)if(t=no(e),t===null)e=null;else if(r=t.tag,r===13){if(e=rw(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qh=e,null}function mw(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Q8()){case u0:return 1;case ow:return 4;case Vh:case J8:return 16;case sw:return 536870912;default:return 16}default:return 16}}var aa=null,d0=null,Ah=null;function gw(){if(Ah)return Ah;var e,t=d0,r=t.length,i,n="value"in aa?aa.value:aa.textContent,a=n.length;for(e=0;e<r&&t[e]===n[e];e++);var o=r-e;for(i=1;i<=o&&t[r-i]===n[a-i];i++);return Ah=n.slice(e,1<i?1-i:void 0)}function Mh(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mh(){return!0}function Gx(){return!1}function Wr(e){function t(r,i,n,a,o){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?mh:Gx,this.isPropagationStopped=Gx,this}return _t(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=mh)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=mh)},persist:function(){},isPersistent:mh}),t}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},f0=Wr(_s),du=_t({},_s,{view:0,detail:0}),pA=Wr(du),Hm,Wm,Il,up=_t({},du,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:m0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Il&&(Il&&e.type==="mousemove"?(Hm=e.screenX-Il.screenX,Wm=e.screenY-Il.screenY):Wm=Hm=0,Il=e),Hm)},movementY:function(e){return"movementY"in e?e.movementY:Wm}}),Zx=Wr(up),dA=_t({},up,{dataTransfer:0}),fA=Wr(dA),mA=_t({},du,{relatedTarget:0}),Ym=Wr(mA),gA=_t({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),yA=Wr(gA),_A=_t({},_s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vA=Wr(_A),xA=_t({},_s,{data:0}),Hx=Wr(xA),bA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wA={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},TA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SA(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=TA[e])?!!t[e]:!1}function m0(){return SA}var EA=_t({},du,{key:function(e){if(e.key){var t=bA[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wA[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:m0,charCode:function(e){return e.type==="keypress"?Mh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),CA=Wr(EA),PA=_t({},up,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wx=Wr(PA),DA=_t({},du,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:m0}),AA=Wr(DA),MA=_t({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),IA=Wr(MA),kA=_t({},up,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),zA=Wr(kA),FA=[9,13,27,32],g0=Dn&&"CompositionEvent"in window,Ul=null;Dn&&"documentMode"in document&&(Ul=document.documentMode);var RA=Dn&&"TextEvent"in window&&!Ul,yw=Dn&&(!g0||Ul&&8<Ul&&11>=Ul),Yx=" ",Xx=!1;function _w(e,t){switch(e){case"keyup":return FA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yo=!1;function LA(e,t){switch(e){case"compositionend":return vw(t);case"keypress":return t.which!==32?null:(Xx=!0,Yx);case"textInput":return e=t.data,e===Yx&&Xx?null:e;default:return null}}function BA(e,t){if(Yo)return e==="compositionend"||!g0&&_w(e,t)?(e=gw(),Ah=d0=aa=null,Yo=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return yw&&t.locale!=="ko"?null:t.data;default:return null}}var OA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!OA[e.type]:t==="textarea"}function xw(e,t,r,i){Kb(i),t=Gh(t,"onChange"),0<t.length&&(r=new f0("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var $l=null,tu=null;function jA(e){Iw(e,0)}function cp(e){var t=Qo(e);if(qb(t))return e}function NA(e,t){if(e==="change")return t}var bw=!1;Dn&&(Dn?(yh="oninput"in document,yh||(Xm=document.createElement("div"),Xm.setAttribute("oninput","return;"),yh=typeof Xm.oninput=="function"),gh=yh):gh=!1,bw=gh&&(!document.documentMode||9<document.documentMode));var gh,yh,Xm;function Qx(){$l&&($l.detachEvent("onpropertychange",ww),tu=$l=null)}function ww(e){if(e.propertyName==="value"&&cp(tu)){var t=[];xw(t,tu,e,l0(e)),tw(jA,t)}}function VA(e,t,r){e==="focusin"?(Qx(),$l=t,tu=r,$l.attachEvent("onpropertychange",ww)):e==="focusout"&&Qx()}function UA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cp(tu)}function $A(e,t){if(e==="click")return cp(t)}function qA(e,t){if(e==="input"||e==="change")return cp(t)}function GA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bi=typeof Object.is=="function"?Object.is:GA;function ru(e,t){if(Bi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var n=r[i];if(!cg.call(t,n)||!Bi(e[n],t[n]))return!1}return!0}function Jx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eb(e,t){var r=Jx(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jx(r)}}function Tw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sw(){for(var e=window,t=Oh();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Oh(e.document)}return t}function y0(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 ZA(e){var t=Sw(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Tw(r.ownerDocument.documentElement,r)){if(i!==null&&y0(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=r.textContent.length,a=Math.min(i.start,n);i=i.end===void 0?a:Math.min(i.end,n),!e.extend&&a>i&&(n=i,i=a,a=n),n=eb(r,a);var o=eb(r,i);n&&o&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),a>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var HA=Dn&&"documentMode"in document&&11>=document.documentMode,Xo=null,Ag=null,ql=null,Mg=!1;function tb(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mg||Xo==null||Xo!==Oh(i)||(i=Xo,"selectionStart"in i&&y0(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ql&&ru(ql,i)||(ql=i,i=Gh(Ag,"onSelect"),0<i.length&&(t=new f0("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Xo)))}function _h(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ko={animationend:_h("Animation","AnimationEnd"),animationiteration:_h("Animation","AnimationIteration"),animationstart:_h("Animation","AnimationStart"),transitionend:_h("Transition","TransitionEnd")},Km={},Ew={};Dn&&(Ew=document.createElement("div").style,"AnimationEvent"in window||(delete Ko.animationend.animation,delete Ko.animationiteration.animation,delete Ko.animationstart.animation),"TransitionEvent"in window||delete Ko.transitionend.transition);function hp(e){if(Km[e])return Km[e];if(!Ko[e])return e;var t=Ko[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ew)return Km[e]=t[r];return e}var Cw=hp("animationend"),Pw=hp("animationiteration"),Dw=hp("animationstart"),Aw=hp("transitionend"),Mw=new Map,rb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ya(e,t){Mw.set(e,t),io(t,[e])}for(vh=0;vh<rb.length;vh++)xh=rb[vh],ib=xh.toLowerCase(),nb=xh[0].toUpperCase()+xh.slice(1),ya(ib,"on"+nb);var xh,ib,nb,vh;ya(Cw,"onAnimationEnd");ya(Pw,"onAnimationIteration");ya(Dw,"onAnimationStart");ya("dblclick","onDoubleClick");ya("focusin","onFocus");ya("focusout","onBlur");ya(Aw,"onTransitionEnd");hs("onMouseEnter",["mouseout","mouseover"]);hs("onMouseLeave",["mouseout","mouseover"]);hs("onPointerEnter",["pointerout","pointerover"]);hs("onPointerLeave",["pointerout","pointerover"]);io("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));io("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));io("onBeforeInput",["compositionend","keypress","textInput","paste"]);io("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));io("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));io("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),WA=new Set("cancel close invalid load scroll toggle".split(" ").concat(jl));function ab(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,W8(i,t,void 0,e),e.currentTarget=null}function Iw(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],n=i.event;i=i.listeners;e:{var a=void 0;if(t)for(var o=i.length-1;0<=o;o--){var s=i[o],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==a&&n.isPropagationStopped())break e;ab(n,s,u),a=l}else for(o=0;o<i.length;o++){if(s=i[o],l=s.instance,u=s.currentTarget,s=s.listener,l!==a&&n.isPropagationStopped())break e;ab(n,s,u),a=l}}}if(Nh)throw e=Eg,Nh=!1,Eg=null,e}function it(e,t){var r=t[Rg];r===void 0&&(r=t[Rg]=new Set);var i=e+"__bubble";r.has(i)||(kw(t,e,2,!1),r.add(i))}function Qm(e,t,r){var i=0;t&&(i|=4),kw(r,e,i,t)}var bh="_reactListening"+Math.random().toString(36).slice(2);function iu(e){if(!e[bh]){e[bh]=!0,jb.forEach(function(r){r!=="selectionchange"&&(WA.has(r)||Qm(r,!1,e),Qm(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bh]||(t[bh]=!0,Qm("selectionchange",!1,t))}}function kw(e,t,r,i){switch(mw(t)){case 1:var n=cA;break;case 4:n=hA;break;default:n=p0}r=n.bind(null,t,r,e),n=void 0,!Sg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),i?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function Jm(e,t,r,i,n){var a=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var s=i.stateNode.containerInfo;if(s===n||s.nodeType===8&&s.parentNode===n)break;if(o===4)for(o=i.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===n||l.nodeType===8&&l.parentNode===n))return;o=o.return}for(;s!==null;){if(o=Ha(s),o===null)return;if(l=o.tag,l===5||l===6){i=a=o;continue e}s=s.parentNode}}i=i.return}tw(function(){var u=a,c=l0(r),h=[];e:{var p=Mw.get(e);if(p!==void 0){var d=f0,f=e;switch(e){case"keypress":if(Mh(r)===0)break e;case"keydown":case"keyup":d=CA;break;case"focusin":f="focus",d=Ym;break;case"focusout":f="blur",d=Ym;break;case"beforeblur":case"afterblur":d=Ym;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=Zx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=fA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=AA;break;case Cw:case Pw:case Dw:d=yA;break;case Aw:d=IA;break;case"scroll":d=pA;break;case"wheel":d=zA;break;case"copy":case"cut":case"paste":d=vA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=Wx}var m=(t&4)!==0,_=!m&&e==="scroll",g=m?p!==null?p+"Capture":null:p;m=[];for(var y=u,v;y!==null;){v=y;var x=v.stateNode;if(v.tag===5&&x!==null&&(v=x,g!==null&&(x=Kl(y,g),x!=null&&m.push(nu(y,x,v)))),_)break;y=y.return}0<m.length&&(p=new d(p,f,null,r,c),h.push({event:p,listeners:m}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",p&&r!==wg&&(f=r.relatedTarget||r.fromElement)&&(Ha(f)||f[An]))break e;if((d||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,d?(f=r.relatedTarget||r.toElement,d=u,f=f?Ha(f):null,f!==null&&(_=no(f),f!==_||f.tag!==5&&f.tag!==6)&&(f=null)):(d=null,f=u),d!==f)){if(m=Zx,x="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=Wx,x="onPointerLeave",g="onPointerEnter",y="pointer"),_=d==null?p:Qo(d),v=f==null?p:Qo(f),p=new m(x,y+"leave",d,r,c),p.target=_,p.relatedTarget=v,x=null,Ha(c)===u&&(m=new m(g,y+"enter",f,r,c),m.target=v,m.relatedTarget=_,x=m),_=x,d&&f)t:{for(m=d,g=f,y=0,v=m;v;v=Zo(v))y++;for(v=0,x=g;x;x=Zo(x))v++;for(;0<y-v;)m=Zo(m),y--;for(;0<v-y;)g=Zo(g),v--;for(;y--;){if(m===g||g!==null&&m===g.alternate)break t;m=Zo(m),g=Zo(g)}m=null}else m=null;d!==null&&ob(h,p,d,m,!1),f!==null&&_!==null&&ob(h,_,f,m,!0)}}e:{if(p=u?Qo(u):window,d=p.nodeName&&p.nodeName.toLowerCase(),d==="select"||d==="input"&&p.type==="file")var b=NA;else if(Kx(p))if(bw)b=qA;else{b=UA;var w=VA}else(d=p.nodeName)&&d.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(b=$A);if(b&&(b=b(e,u))){xw(h,b,r,c);break e}w&&w(e,p,u),e==="focusout"&&(w=p._wrapperState)&&w.controlled&&p.type==="number"&&yg(p,"number",p.value)}switch(w=u?Qo(u):window,e){case"focusin":(Kx(w)||w.contentEditable==="true")&&(Xo=w,Ag=u,ql=null);break;case"focusout":ql=Ag=Xo=null;break;case"mousedown":Mg=!0;break;case"contextmenu":case"mouseup":case"dragend":Mg=!1,tb(h,r,c);break;case"selectionchange":if(HA)break;case"keydown":case"keyup":tb(h,r,c)}var T;if(g0)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Yo?_w(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(yw&&r.locale!=="ko"&&(Yo||S!=="onCompositionStart"?S==="onCompositionEnd"&&Yo&&(T=gw()):(aa=c,d0="value"in aa?aa.value:aa.textContent,Yo=!0)),w=Gh(u,S),0<w.length&&(S=new Hx(S,e,null,r,c),h.push({event:S,listeners:w}),T?S.data=T:(T=vw(r),T!==null&&(S.data=T)))),(T=RA?LA(e,r):BA(e,r))&&(u=Gh(u,"onBeforeInput"),0<u.length&&(c=new Hx("onBeforeInput","beforeinput",null,r,c),h.push({event:c,listeners:u}),c.data=T))}Iw(h,t)})}function nu(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Gh(e,t){for(var r=t+"Capture",i=[];e!==null;){var n=e,a=n.stateNode;n.tag===5&&a!==null&&(n=a,a=Kl(e,r),a!=null&&i.unshift(nu(e,a,n)),a=Kl(e,t),a!=null&&i.push(nu(e,a,n))),e=e.return}return i}function Zo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ob(e,t,r,i,n){for(var a=t._reactName,o=[];r!==null&&r!==i;){var s=r,l=s.alternate,u=s.stateNode;if(l!==null&&l===i)break;s.tag===5&&u!==null&&(s=u,n?(l=Kl(r,a),l!=null&&o.unshift(nu(r,l,s))):n||(l=Kl(r,a),l!=null&&o.push(nu(r,l,s)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var YA=/\r\n?/g,XA=/\u0000|\uFFFD/g;function sb(e){return(typeof e=="string"?e:""+e).replace(YA,`
6
6
  `).replace(XA,"")}function wh(e,t,r){if(t=sb(t),sb(e)!==t&&r)throw Error(V(425))}function Zh(){}var Ig=null,kg=null;function zg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fg=typeof setTimeout=="function"?setTimeout:void 0,KA=typeof clearTimeout=="function"?clearTimeout:void 0,lb=typeof Promise=="function"?Promise:void 0,QA=typeof queueMicrotask=="function"?queueMicrotask:typeof lb<"u"?function(e){return lb.resolve(null).then(e).catch(JA)}:Fg;function JA(e){setTimeout(function(){throw e})}function eg(e,t){var r=t,i=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(i===0){e.removeChild(n),eu(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=n}while(r);eu(t)}function ca(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ub(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var vs=Math.random().toString(36).slice(2),on="__reactFiber$"+vs,au="__reactProps$"+vs,An="__reactContainer$"+vs,Rg="__reactEvents$"+vs,eM="__reactListeners$"+vs,tM="__reactHandles$"+vs;function Ha(e){var t=e[on];if(t)return t;for(var r=e.parentNode;r;){if(t=r[An]||r[on]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=ub(e);e!==null;){if(r=e[on])return r;e=ub(e)}return t}e=r,r=e.parentNode}return null}function fu(e){return e=e[on]||e[An],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function pp(e){return e[au]||null}var Lg=[],Jo=-1;function _a(e){return{current:e}}function nt(e){0>Jo||(e.current=Lg[Jo],Lg[Jo]=null,Jo--)}function Qe(e,t){Jo++,Lg[Jo]=e.current,e.current=t}var ga={},fr=_a(ga),zr=_a(!1),Qa=ga;function ps(e,t){var r=e.type.contextTypes;if(!r)return ga;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var n={},a;for(a in r)n[a]=t[a];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function Fr(e){return e=e.childContextTypes,e!=null}function Hh(){nt(zr),nt(fr)}function cb(e,t,r){if(fr.current!==ga)throw Error(V(168));Qe(fr,t),Qe(zr,r)}function zw(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in t))throw Error(V(108,V8(e)||"Unknown",n));return _t({},r,i)}function Wh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ga,Qa=fr.current,Qe(fr,e),Qe(zr,zr.current),!0}function hb(e,t,r){var i=e.stateNode;if(!i)throw Error(V(169));r?(e=zw(e,t,Qa),i.__reactInternalMemoizedMergedChildContext=e,nt(zr),nt(fr),Qe(fr,e)):nt(zr),Qe(zr,r)}var Sn=null,dp=!1,tg=!1;function Fw(e){Sn===null?Sn=[e]:Sn.push(e)}function rM(e){dp=!0,Fw(e)}function va(){if(!tg&&Sn!==null){tg=!0;var e=0,t=Ge;try{var r=Sn;for(Ge=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Sn=null,dp=!1}catch(n){throw Sn!==null&&(Sn=Sn.slice(e+1)),aw(u0,va),n}finally{Ge=t,tg=!1}}return null}var es=[],ts=0,Yh=null,Xh=0,li=[],ui=0,Ja=null,En=1,Cn="";function Ga(e,t){es[ts++]=Xh,es[ts++]=Yh,Yh=e,Xh=t}function Rw(e,t,r){li[ui++]=En,li[ui++]=Cn,li[ui++]=Ja,Ja=e;var i=En;e=Cn;var n=32-Ri(i)-1;i&=~(1<<n),r+=1;var a=32-Ri(t)+n;if(30<a){var o=n-n%5;a=(i&(1<<o)-1).toString(32),i>>=o,n-=o,En=1<<32-Ri(t)+n|r<<n|i,Cn=a+e}else En=1<<a|r<<n|i,Cn=e}function _0(e){e.return!==null&&(Ga(e,1),Rw(e,1,0))}function v0(e){for(;e===Yh;)Yh=es[--ts],es[ts]=null,Xh=es[--ts],es[ts]=null;for(;e===Ja;)Ja=li[--ui],li[ui]=null,Cn=li[--ui],li[ui]=null,En=li[--ui],li[ui]=null}var Zr=null,Gr=null,lt=!1,Fi=null;function Lw(e,t){var r=ci(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function pb(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Zr=e,Gr=ca(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Zr=e,Gr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ja!==null?{id:En,overflow:Cn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ci(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Zr=e,Gr=null,!0):!1;default:return!1}}function Bg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Og(e){if(lt){var t=Gr;if(t){var r=t;if(!pb(e,t)){if(Bg(e))throw Error(V(418));t=ca(r.nextSibling);var i=Zr;t&&pb(e,t)?Lw(i,r):(e.flags=e.flags&-4097|2,lt=!1,Zr=e)}}else{if(Bg(e))throw Error(V(418));e.flags=e.flags&-4097|2,lt=!1,Zr=e}}}function db(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Zr=e}function Th(e){if(e!==Zr)return!1;if(!lt)return db(e),lt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!zg(e.type,e.memoizedProps)),t&&(t=Gr)){if(Bg(e))throw Bw(),Error(V(418));for(;t;)Lw(e,t),t=ca(t.nextSibling)}if(db(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Gr=ca(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Gr=null}}else Gr=Zr?ca(e.stateNode.nextSibling):null;return!0}function Bw(){for(var e=Gr;e;)e=ca(e.nextSibling)}function ds(){Gr=Zr=null,lt=!1}function x0(e){Fi===null?Fi=[e]:Fi.push(e)}var iM=kn.ReactCurrentBatchConfig;function kl(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(V(309));var i=r.stateNode}if(!i)throw Error(V(147,e));var n=i,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var s=n.refs;o===null?delete s[a]:s[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(V(284));if(!r._owner)throw Error(V(290,e))}return e}function Sh(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fb(e){var t=e._init;return t(e._payload)}function Ow(e){function t(g,y){if(e){var v=g.deletions;v===null?(g.deletions=[y],g.flags|=16):v.push(y)}}function r(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function i(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function n(g,y){return g=fa(g,y),g.index=0,g.sibling=null,g}function a(g,y,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<y?(g.flags|=2,y):v):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function s(g,y,v,x){return y===null||y.tag!==6?(y=lg(v,g.mode,x),y.return=g,y):(y=n(y,v),y.return=g,y)}function l(g,y,v,x){var b=v.type;return b===Wo?c(g,y,v.props.children,x,v.key):y!==null&&(y.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===ta&&fb(b)===y.type)?(x=n(y,v.props),x.ref=kl(g,y,v),x.return=g,x):(x=Bh(v.type,v.key,v.props,null,g.mode,x),x.ref=kl(g,y,v),x.return=g,x)}function u(g,y,v,x){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=ug(v,g.mode,x),y.return=g,y):(y=n(y,v.children||[]),y.return=g,y)}function c(g,y,v,x,b){return y===null||y.tag!==7?(y=Ka(v,g.mode,x,b),y.return=g,y):(y=n(y,v),y.return=g,y)}function h(g,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=lg(""+y,g.mode,v),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case uh:return v=Bh(y.type,y.key,y.props,null,g.mode,v),v.ref=kl(g,null,y),v.return=g,v;case Ho:return y=ug(y,g.mode,v),y.return=g,y;case ta:var x=y._init;return h(g,x(y._payload),v)}if(Bl(y)||Dl(y))return y=Ka(y,g.mode,v,null),y.return=g,y;Sh(g,y)}return null}function p(g,y,v,x){var b=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return b!==null?null:s(g,y,""+v,x);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case uh:return v.key===b?l(g,y,v,x):null;case Ho:return v.key===b?u(g,y,v,x):null;case ta:return b=v._init,p(g,y,b(v._payload),x)}if(Bl(v)||Dl(v))return b!==null?null:c(g,y,v,x,null);Sh(g,v)}return null}function d(g,y,v,x,b){if(typeof x=="string"&&x!==""||typeof x=="number")return g=g.get(v)||null,s(y,g,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case uh:return g=g.get(x.key===null?v:x.key)||null,l(y,g,x,b);case Ho:return g=g.get(x.key===null?v:x.key)||null,u(y,g,x,b);case ta:var w=x._init;return d(g,y,v,w(x._payload),b)}if(Bl(x)||Dl(x))return g=g.get(v)||null,c(y,g,x,b,null);Sh(y,x)}return null}function f(g,y,v,x){for(var b=null,w=null,T=y,S=y=0,E=null;T!==null&&S<v.length;S++){T.index>S?(E=T,T=null):E=T.sibling;var P=p(g,T,v[S],x);if(P===null){T===null&&(T=E);break}e&&T&&P.alternate===null&&t(g,T),y=a(P,y,S),w===null?b=P:w.sibling=P,w=P,T=E}if(S===v.length)return r(g,T),lt&&Ga(g,S),b;if(T===null){for(;S<v.length;S++)T=h(g,v[S],x),T!==null&&(y=a(T,y,S),w===null?b=T:w.sibling=T,w=T);return lt&&Ga(g,S),b}for(T=i(g,T);S<v.length;S++)E=d(T,g,S,v[S],x),E!==null&&(e&&E.alternate!==null&&T.delete(E.key===null?S:E.key),y=a(E,y,S),w===null?b=E:w.sibling=E,w=E);return e&&T.forEach(function(D){return t(g,D)}),lt&&Ga(g,S),b}function m(g,y,v,x){var b=Dl(v);if(typeof b!="function")throw Error(V(150));if(v=b.call(v),v==null)throw Error(V(151));for(var w=b=null,T=y,S=y=0,E=null,P=v.next();T!==null&&!P.done;S++,P=v.next()){T.index>S?(E=T,T=null):E=T.sibling;var D=p(g,T,P.value,x);if(D===null){T===null&&(T=E);break}e&&T&&D.alternate===null&&t(g,T),y=a(D,y,S),w===null?b=D:w.sibling=D,w=D,T=E}if(P.done)return r(g,T),lt&&Ga(g,S),b;if(T===null){for(;!P.done;S++,P=v.next())P=h(g,P.value,x),P!==null&&(y=a(P,y,S),w===null?b=P:w.sibling=P,w=P);return lt&&Ga(g,S),b}for(T=i(g,T);!P.done;S++,P=v.next())P=d(T,g,S,P.value,x),P!==null&&(e&&P.alternate!==null&&T.delete(P.key===null?S:P.key),y=a(P,y,S),w===null?b=P:w.sibling=P,w=P);return e&&T.forEach(function(F){return t(g,F)}),lt&&Ga(g,S),b}function _(g,y,v,x){if(typeof v=="object"&&v!==null&&v.type===Wo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case uh:e:{for(var b=v.key,w=y;w!==null;){if(w.key===b){if(b=v.type,b===Wo){if(w.tag===7){r(g,w.sibling),y=n(w,v.props.children),y.return=g,g=y;break e}}else if(w.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===ta&&fb(b)===w.type){r(g,w.sibling),y=n(w,v.props),y.ref=kl(g,w,v),y.return=g,g=y;break e}r(g,w);break}else t(g,w);w=w.sibling}v.type===Wo?(y=Ka(v.props.children,g.mode,x,v.key),y.return=g,g=y):(x=Bh(v.type,v.key,v.props,null,g.mode,x),x.ref=kl(g,y,v),x.return=g,g=x)}return o(g);case Ho:e:{for(w=v.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){r(g,y.sibling),y=n(y,v.children||[]),y.return=g,g=y;break e}else{r(g,y);break}else t(g,y);y=y.sibling}y=ug(v,g.mode,x),y.return=g,g=y}return o(g);case ta:return w=v._init,_(g,y,w(v._payload),x)}if(Bl(v))return f(g,y,v,x);if(Dl(v))return m(g,y,v,x);Sh(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(r(g,y.sibling),y=n(y,v),y.return=g,g=y):(r(g,y),y=lg(v,g.mode,x),y.return=g,g=y),o(g)):r(g,y)}return _}var fs=Ow(!0),jw=Ow(!1),Kh=_a(null),Qh=null,rs=null,b0=null;function w0(){b0=rs=Qh=null}function T0(e){var t=Kh.current;nt(Kh),e._currentValue=t}function jg(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function us(e,t){Qh=e,b0=rs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(kr=!0),e.firstContext=null)}function pi(e){var t=e._currentValue;if(b0!==e)if(e={context:e,memoizedValue:t,next:null},rs===null){if(Qh===null)throw Error(V(308));rs=e,Qh.dependencies={lanes:0,firstContext:e}}else rs=rs.next=e;return t}var Wa=null;function S0(e){Wa===null?Wa=[e]:Wa.push(e)}function Nw(e,t,r,i){var n=t.interleaved;return n===null?(r.next=r,S0(t)):(r.next=n.next,n.next=r),t.interleaved=r,Mn(e,i)}function Mn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ra=!1;function E0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ha(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(ze&2)!==0){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,Mn(e,r)}return n=i.interleaved,n===null?(t.next=t,S0(i)):(t.next=n.next,n.next=t),i.interleaved=t,Mn(e,r)}function Ih(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,c0(e,r)}}function mb(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var n=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?n=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?n=a=t:a=a.next=t}else n=a=t;r={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:a,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Jh(e,t,r,i){var n=e.updateQueue;ra=!1;var a=n.firstBaseUpdate,o=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(a!==null){var h=n.baseState;o=0,c=u=l=null,s=a;do{var p=s.lane,d=s.eventTime;if((i&p)===p){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var f=e,m=s;switch(p=t,d=r,m.tag){case 1:if(f=m.payload,typeof f=="function"){h=f.call(d,h,p);break e}h=f;break e;case 3:f.flags=f.flags&-65537|128;case 0:if(f=m.payload,p=typeof f=="function"?f.call(d,h,p):f,p==null)break e;h=_t({},h,p);break e;case 2:ra=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=n.effects,p===null?n.effects=[s]:p.push(s))}else d={eventTime:d,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=h):c=c.next=d,o|=p;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;p=s,s=p.next,p.next=null,n.lastBaseUpdate=p,n.shared.pending=null}}while(!0);if(c===null&&(l=h),n.baseState=l,n.firstBaseUpdate=u,n.lastBaseUpdate=c,t=n.shared.interleaved,t!==null){n=t;do o|=n.lane,n=n.next;while(n!==t)}else a===null&&(n.shared.lanes=0);to|=o,e.lanes=o,e.memoizedState=h}}function gb(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],n=i.callback;if(n!==null){if(i.callback=null,i=r,typeof n!="function")throw Error(V(191,n));n.call(i)}}}var mu={},ln=_a(mu),ou=_a(mu),su=_a(mu);function Ya(e){if(e===mu)throw Error(V(174));return e}function C0(e,t){switch(Qe(su,t),Qe(ou,e),Qe(ln,mu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vg(t,e)}nt(ln),Qe(ln,t)}function ms(){nt(ln),nt(ou),nt(su)}function Uw(e){Ya(su.current);var t=Ya(ln.current),r=vg(t,e.type);t!==r&&(Qe(ou,e),Qe(ln,r))}function P0(e){ou.current===e&&(nt(ln),nt(ou))}var gt=_a(0);function ep(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 rg=[];function D0(){for(var e=0;e<rg.length;e++)rg[e]._workInProgressVersionPrimary=null;rg.length=0}var kh=kn.ReactCurrentDispatcher,ig=kn.ReactCurrentBatchConfig,eo=0,yt=null,jt=null,$t=null,tp=!1,Gl=!1,lu=0,nM=0;function hr(){throw Error(V(321))}function A0(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Bi(e[r],t[r]))return!1;return!0}function M0(e,t,r,i,n,a){if(eo=a,yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,kh.current=e===null||e.memoizedState===null?lM:uM,e=r(i,n),Gl){a=0;do{if(Gl=!1,lu=0,25<=a)throw Error(V(301));a+=1,$t=jt=null,t.updateQueue=null,kh.current=cM,e=r(i,n)}while(Gl)}if(kh.current=rp,t=jt!==null&&jt.next!==null,eo=0,$t=jt=yt=null,tp=!1,t)throw Error(V(300));return e}function I0(){var e=lu!==0;return lu=0,e}function an(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?yt.memoizedState=$t=e:$t=$t.next=e,$t}function di(){if(jt===null){var e=yt.alternate;e=e!==null?e.memoizedState:null}else e=jt.next;var t=$t===null?yt.memoizedState:$t.next;if(t!==null)$t=t,jt=e;else{if(e===null)throw Error(V(310));jt=e,e={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},$t===null?yt.memoizedState=$t=e:$t=$t.next=e}return $t}function uu(e,t){return typeof t=="function"?t(e):t}function ng(e){var t=di(),r=t.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=e;var i=jt,n=i.baseQueue,a=r.pending;if(a!==null){if(n!==null){var o=n.next;n.next=a.next,a.next=o}i.baseQueue=n=a,r.pending=null}if(n!==null){a=n.next,i=i.baseState;var s=o=null,l=null,u=a;do{var c=u.lane;if((eo&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var h={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=h,o=i):l=l.next=h,yt.lanes|=c,to|=c}u=u.next}while(u!==null&&u!==a);l===null?o=i:l.next=s,Bi(i,t.memoizedState)||(kr=!0),t.memoizedState=i,t.baseState=o,t.baseQueue=l,r.lastRenderedState=i}if(e=r.interleaved,e!==null){n=e;do a=n.lane,yt.lanes|=a,to|=a,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ag(e){var t=di(),r=t.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=e;var i=r.dispatch,n=r.pending,a=t.memoizedState;if(n!==null){r.pending=null;var o=n=n.next;do a=e(a,o.action),o=o.next;while(o!==n);Bi(a,t.memoizedState)||(kr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,i]}function $w(){}function qw(e,t){var r=yt,i=di(),n=t(),a=!Bi(i.memoizedState,n);if(a&&(i.memoizedState=n,kr=!0),i=i.queue,k0(Hw.bind(null,r,i,e),[e]),i.getSnapshot!==t||a||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,cu(9,Zw.bind(null,r,i,n,t),void 0,null),qt===null)throw Error(V(349));(eo&30)!==0||Gw(r,t,n)}return n}function Gw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Zw(e,t,r,i){t.value=r,t.getSnapshot=i,Ww(t)&&Yw(e)}function Hw(e,t,r){return r(function(){Ww(t)&&Yw(e)})}function Ww(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Bi(e,r)}catch{return!0}}function Yw(e){var t=Mn(e,1);t!==null&&Li(t,e,1,-1)}function yb(e){var t=an();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:uu,lastRenderedState:e},t.queue=e,e=e.dispatch=sM.bind(null,yt,e),[t.memoizedState,e]}function cu(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Xw(){return di().memoizedState}function zh(e,t,r,i){var n=an();yt.flags|=e,n.memoizedState=cu(1|t,r,void 0,i===void 0?null:i)}function fp(e,t,r,i){var n=di();i=i===void 0?null:i;var a=void 0;if(jt!==null){var o=jt.memoizedState;if(a=o.destroy,i!==null&&A0(i,o.deps)){n.memoizedState=cu(t,r,a,i);return}}yt.flags|=e,n.memoizedState=cu(1|t,r,a,i)}function _b(e,t){return zh(8390656,8,e,t)}function k0(e,t){return fp(2048,8,e,t)}function Kw(e,t){return fp(4,2,e,t)}function Qw(e,t){return fp(4,4,e,t)}function Jw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function e3(e,t,r){return r=r!=null?r.concat([e]):null,fp(4,4,Jw.bind(null,t,e),r)}function z0(){}function t3(e,t){var r=di();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&A0(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function r3(e,t){var r=di();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&A0(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function i3(e,t,r){return(eo&21)===0?(e.baseState&&(e.baseState=!1,kr=!0),e.memoizedState=r):(Bi(r,t)||(r=lw(),yt.lanes|=r,to|=r,e.baseState=!0),t)}function aM(e,t){var r=Ge;Ge=r!==0&&4>r?r:4,e(!0);var i=ig.transition;ig.transition={};try{e(!1),t()}finally{Ge=r,ig.transition=i}}function n3(){return di().memoizedState}function oM(e,t,r){var i=da(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},a3(e))o3(t,r);else if(r=Nw(e,t,r,i),r!==null){var n=wr();Li(r,e,i,n),s3(r,t,i)}}function sM(e,t,r){var i=da(e),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(a3(e))o3(t,n);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(n.hasEagerState=!0,n.eagerState=s,Bi(s,o)){var l=t.interleaved;l===null?(n.next=n,S0(t)):(n.next=l.next,l.next=n),t.interleaved=n;return}}catch{}r=Nw(e,t,n,i),r!==null&&(n=wr(),Li(r,e,i,n),s3(r,t,i))}}function a3(e){var t=e.alternate;return e===yt||t!==null&&t===yt}function o3(e,t){Gl=tp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function s3(e,t,r){if((r&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,c0(e,r)}}var rp={readContext:pi,useCallback:hr,useContext:hr,useEffect:hr,useImperativeHandle:hr,useInsertionEffect:hr,useLayoutEffect:hr,useMemo:hr,useReducer:hr,useRef:hr,useState:hr,useDebugValue:hr,useDeferredValue:hr,useTransition:hr,useMutableSource:hr,useSyncExternalStore:hr,useId:hr,unstable_isNewReconciler:!1},lM={readContext:pi,useCallback:function(e,t){return an().memoizedState=[e,t===void 0?null:t],e},useContext:pi,useEffect:_b,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,zh(4194308,4,Jw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return zh(4194308,4,e,t)},useInsertionEffect:function(e,t){return zh(4,2,e,t)},useMemo:function(e,t){var r=an();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=an();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=oM.bind(null,yt,e),[i.memoizedState,e]},useRef:function(e){var t=an();return e={current:e},t.memoizedState=e},useState:yb,useDebugValue:z0,useDeferredValue:function(e){return an().memoizedState=e},useTransition:function(){var e=yb(!1),t=e[0];return e=aM.bind(null,e[1]),an().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=yt,n=an();if(lt){if(r===void 0)throw Error(V(407));r=r()}else{if(r=t(),qt===null)throw Error(V(349));(eo&30)!==0||Gw(i,t,r)}n.memoizedState=r;var a={value:r,getSnapshot:t};return n.queue=a,_b(Hw.bind(null,i,a,e),[e]),i.flags|=2048,cu(9,Zw.bind(null,i,a,r,t),void 0,null),r},useId:function(){var e=an(),t=qt.identifierPrefix;if(lt){var r=Cn,i=En;r=(i&~(1<<32-Ri(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=lu++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=nM++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},uM={readContext:pi,useCallback:t3,useContext:pi,useEffect:k0,useImperativeHandle:e3,useInsertionEffect:Kw,useLayoutEffect:Qw,useMemo:r3,useReducer:ng,useRef:Xw,useState:function(){return ng(uu)},useDebugValue:z0,useDeferredValue:function(e){var t=di();return i3(t,jt.memoizedState,e)},useTransition:function(){var e=ng(uu)[0],t=di().memoizedState;return[e,t]},useMutableSource:$w,useSyncExternalStore:qw,useId:n3,unstable_isNewReconciler:!1},cM={readContext:pi,useCallback:t3,useContext:pi,useEffect:k0,useImperativeHandle:e3,useInsertionEffect:Kw,useLayoutEffect:Qw,useMemo:r3,useReducer:ag,useRef:Xw,useState:function(){return ag(uu)},useDebugValue:z0,useDeferredValue:function(e){var t=di();return jt===null?t.memoizedState=e:i3(t,jt.memoizedState,e)},useTransition:function(){var e=ag(uu)[0],t=di().memoizedState;return[e,t]},useMutableSource:$w,useSyncExternalStore:qw,useId:n3,unstable_isNewReconciler:!1};function ki(e,t){if(e&&e.defaultProps){t=_t({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ng(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:_t({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var mp={isMounted:function(e){return(e=e._reactInternals)?no(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=wr(),n=da(e),a=Pn(i,n);a.payload=t,r!=null&&(a.callback=r),t=ha(e,a,n),t!==null&&(Li(t,e,n,i),Ih(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=wr(),n=da(e),a=Pn(i,n);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=ha(e,a,n),t!==null&&(Li(t,e,n,i),Ih(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=wr(),i=da(e),n=Pn(r,i);n.tag=2,t!=null&&(n.callback=t),t=ha(e,n,i),t!==null&&(Li(t,e,i,r),Ih(t,e,i))}};function vb(e,t,r,i,n,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,a,o):t.prototype&&t.prototype.isPureReactComponent?!ru(r,i)||!ru(n,a):!0}function l3(e,t,r){var i=!1,n=ga,a=t.contextType;return typeof a=="object"&&a!==null?a=pi(a):(n=Fr(t)?Qa:fr.current,i=t.contextTypes,a=(i=i!=null)?ps(e,n):ga),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=mp,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=a),t}function xb(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&mp.enqueueReplaceState(t,t.state,null)}function Vg(e,t,r,i){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs={},E0(e);var a=t.contextType;typeof a=="object"&&a!==null?n.context=pi(a):(a=Fr(t)?Qa:fr.current,n.context=ps(e,a)),n.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ng(e,t,a,r),n.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(t=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),t!==n.state&&mp.enqueueReplaceState(n,n.state,null),Jh(e,r,n,i),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function gs(e,t){try{var r="",i=t;do r+=N8(i),i=i.return;while(i);var n=r}catch(a){n=`
7
7
  Error generating stack: `+a.message+`
8
- `+a.stack}return{value:e,source:t,stack:n,digest:null}}function og(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ug(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var hM=typeof WeakMap=="function"?WeakMap:Map;function u3(e,t,r){r=Pn(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){np||(np=!0,Qg=i),Ug(e,t)},r}function c3(e,t,r){r=Pn(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var n=t.value;r.payload=function(){return i(n)},r.callback=function(){Ug(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Ug(e,t),typeof i!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function bb(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new hM;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(n.add(r),e=EM.bind(null,e,t,r),t.then(e,e))}function wb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Tb(e,t,r,i,n){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Pn(-1,1),t.tag=2,ha(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=n,e)}var pM=kn.ReactCurrentOwner,kr=!1;function br(e,t,r,i){t.child=e===null?jw(t,null,r,i):fs(t,e.child,r,i)}function Sb(e,t,r,i,n){r=r.render;var a=t.ref;return us(t,n),i=M0(e,t,r,i,a,n),r=I0(),e!==null&&!kr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,In(e,t,n)):(lt&&r&&_0(t),t.flags|=1,br(e,t,i,n),t.child)}function Eb(e,t,r,i,n){if(e===null){var a=r.type;return typeof a=="function"&&!V0(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,h3(e,t,a,i,n)):(e=Bh(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&n)===0){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:ru,r(o,i)&&e.ref===t.ref)return In(e,t,n)}return t.flags|=1,e=fa(a,i),e.ref=t.ref,e.return=t,t.child=e}function h3(e,t,r,i,n){if(e!==null){var a=e.memoizedProps;if(ru(a,i)&&e.ref===t.ref)if(kr=!1,t.pendingProps=i=a,(e.lanes&n)!==0)(e.flags&131072)!==0&&(kr=!0);else return t.lanes=e.lanes,In(e,t,n)}return $g(e,t,r,i,n)}function p3(e,t,r){var i=t.pendingProps,n=i.children,a=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(ns,qr),qr|=r;else{if((r&1073741824)===0)return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Qe(ns,qr),qr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=a!==null?a.baseLanes:r,Qe(ns,qr),qr|=i}else a!==null?(i=a.baseLanes|r,t.memoizedState=null):i=r,Qe(ns,qr),qr|=i;return br(e,t,n,r),t.child}function d3(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function $g(e,t,r,i,n){var a=Fr(r)?Qa:fr.current;return a=ps(t,a),us(t,n),r=M0(e,t,r,i,a,n),i=I0(),e!==null&&!kr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,In(e,t,n)):(lt&&i&&_0(t),t.flags|=1,br(e,t,r,n),t.child)}function Cb(e,t,r,i,n){if(Fr(r)){var a=!0;Wh(t)}else a=!1;if(us(t,n),t.stateNode===null)Fh(e,t),l3(t,r,i),Vg(t,r,i,n),i=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=pi(u):(u=Fr(r)?Qa:fr.current,u=ps(t,u));var c=r.getDerivedStateFromProps,h=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==i||l!==u)&&xb(t,o,i,u),ra=!1;var p=t.memoizedState;o.state=p,Jh(t,i,o,n),l=t.memoizedState,s!==i||p!==l||zr.current||ra?(typeof c=="function"&&(Ng(t,r,c,i),l=t.memoizedState),(s=ra||vb(t,r,s,i,p,l,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),o.props=i,o.state=l,o.context=u,i=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Vw(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:ki(t.type,s),o.props=u,h=t.pendingProps,p=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=pi(l):(l=Fr(r)?Qa:fr.current,l=ps(t,l));var d=r.getDerivedStateFromProps;(c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==h||p!==l)&&xb(t,o,i,l),ra=!1,p=t.memoizedState,o.state=p,Jh(t,i,o,n);var f=t.memoizedState;s!==h||p!==f||zr.current||ra?(typeof d=="function"&&(Ng(t,r,d,i),f=t.memoizedState),(u=ra||vb(t,r,u,i,p,f,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,f,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,f,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=f),o.props=i,o.state=f,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),i=!1)}return qg(e,t,r,i,a,n)}function qg(e,t,r,i,n,a){d3(e,t);var o=(t.flags&128)!==0;if(!i&&!o)return n&&hb(t,r,!1),In(e,t,a);i=t.stateNode,pM.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&o?(t.child=fs(t,e.child,null,a),t.child=fs(t,null,s,a)):br(e,t,s,a),t.memoizedState=i.state,n&&hb(t,r,!0),t.child}function f3(e){var t=e.stateNode;t.pendingContext?cb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cb(e,t.context,!1),C0(e,t.containerInfo)}function Pb(e,t,r,i,n){return ds(),x0(n),t.flags|=256,br(e,t,r,i),t.child}var Gg={dehydrated:null,treeContext:null,retryLane:0};function Zg(e){return{baseLanes:e,cachePool:null,transitions:null}}function m3(e,t,r){var i=t.pendingProps,n=gt.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(n&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),Qe(gt,n&1),e===null)return Og(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(o=i.children,e=i.fallback,a?(i=t.mode,a=t.child,o={mode:"hidden",children:o},(i&1)===0&&a!==null?(a.childLanes=0,a.pendingProps=o):a=_p(o,i,0,null),e=Ka(e,i,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Zg(r),t.memoizedState=Gg,e):F0(t,o));if(n=e.memoizedState,n!==null&&(s=n.dehydrated,s!==null))return dM(e,t,o,i,s,n,r);if(a){a=i.fallback,o=t.mode,n=e.child,s=n.sibling;var l={mode:"hidden",children:i.children};return(o&1)===0&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=l,t.deletions=null):(i=fa(n,l),i.subtreeFlags=n.subtreeFlags&14680064),s!==null?a=fa(s,a):(a=Ka(a,o,r,null),a.flags|=2),a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,o=e.child.memoizedState,o=o===null?Zg(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Gg,i}return a=e.child,e=a.sibling,i=fa(a,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function F0(e,t){return t=_p({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Eh(e,t,r,i){return i!==null&&x0(i),fs(t,e.child,null,r),e=F0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dM(e,t,r,i,n,a,o){if(r)return t.flags&256?(t.flags&=-257,i=og(Error(V(422))),Eh(e,t,o,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=i.fallback,n=t.mode,i=_p({mode:"visible",children:i.children},n,0,null),a=Ka(a,n,o,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,(t.mode&1)!==0&&fs(t,e.child,null,o),t.child.memoizedState=Zg(o),t.memoizedState=Gg,a);if((t.mode&1)===0)return Eh(e,t,o,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var s=i.dgst;return i=s,a=Error(V(419)),i=og(a,i,void 0),Eh(e,t,o,i)}if(s=(o&e.childLanes)!==0,kr||s){if(i=qt,i!==null){switch(o&-o){case 4:n=2;break;case 16:n=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=(n&(i.suspendedLanes|o))!==0?0:n,n!==0&&n!==a.retryLane&&(a.retryLane=n,Mn(e,n),Li(i,e,n,-1))}return N0(),i=og(Error(V(421))),Eh(e,t,o,i)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=CM.bind(null,e),n._reactRetry=t,null):(e=a.treeContext,Gr=ca(n.nextSibling),Zr=t,lt=!0,Fi=null,e!==null&&(li[ui++]=En,li[ui++]=Cn,li[ui++]=Ja,En=e.id,Cn=e.overflow,Ja=t),t=F0(t,i.children),t.flags|=4096,t)}function Db(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),jg(e.return,t,r)}function sg(e,t,r,i,n){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=r,a.tailMode=n)}function g3(e,t,r){var i=t.pendingProps,n=i.revealOrder,a=i.tail;if(br(e,t,i.children,r),i=gt.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Db(e,r,t);else if(e.tag===19)Db(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Qe(gt,i),(t.mode&1)===0)t.memoizedState=null;else switch(n){case"forwards":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&ep(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),sg(t,!1,n,r,a);break;case"backwards":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&ep(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}sg(t,!0,r,null,a);break;case"together":sg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fh(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function In(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),to|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,r=fa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=fa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function fM(e,t,r){switch(t.tag){case 3:f3(t),ds();break;case 5:Uw(t);break;case 1:Fr(t.type)&&Wh(t);break;case 4:C0(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;Qe(Kh,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Qe(gt,gt.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?m3(e,t,r):(Qe(gt,gt.current&1),e=In(e,t,r),e!==null?e.sibling:null);Qe(gt,gt.current&1);break;case 19:if(i=(r&t.childLanes)!==0,(e.flags&128)!==0){if(i)return g3(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Qe(gt,gt.current),i)break;return null;case 22:case 23:return t.lanes=0,p3(e,t,r)}return In(e,t,r)}var y3,Hg,_3,v3;y3=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Hg=function(){};_3=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,Ya(ln.current);var a=null;switch(r){case"input":n=mg(e,n),i=mg(e,i),a=[];break;case"select":n=_t({},n,{value:void 0}),i=_t({},i,{value:void 0}),a=[];break;case"textarea":n=_g(e,n),i=_g(e,i),a=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Zh)}xg(r,i);var o;r=null;for(u in n)if(!i.hasOwnProperty(u)&&n.hasOwnProperty(u)&&n[u]!=null)if(u==="style"){var s=n[u];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yl.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in i){var l=i[u];if(s=n?.[u],i.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(a||(a=[]),a.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&it("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};v3=function(e,t,r,i){r!==i&&(t.flags|=4)};function zl(e,t){if(!lt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function pr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function mM(e,t,r){var i=t.pendingProps;switch(v0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pr(t),null;case 1:return Fr(t.type)&&Hh(),pr(t),null;case 3:return i=t.stateNode,ms(),nt(zr),nt(fr),D0(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Th(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Fi!==null&&(t0(Fi),Fi=null))),Hg(e,t),pr(t),null;case 5:P0(t);var n=Ya(su.current);if(r=t.type,e!==null&&t.stateNode!=null)_3(e,t,r,i,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(V(166));return pr(t),null}if(e=Ya(ln.current),Th(t)){i=t.stateNode,r=t.type;var a=t.memoizedProps;switch(i[on]=t,i[au]=a,e=(t.mode&1)!==0,r){case"dialog":it("cancel",i),it("close",i);break;case"iframe":case"object":case"embed":it("load",i);break;case"video":case"audio":for(n=0;n<jl.length;n++)it(jl[n],i);break;case"source":it("error",i);break;case"img":case"image":case"link":it("error",i),it("load",i);break;case"details":it("toggle",i);break;case"input":Lx(i,a),it("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!a.multiple},it("invalid",i);break;case"textarea":Ox(i,a),it("invalid",i)}xg(r,a),n=null;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="children"?typeof s=="string"?i.textContent!==s&&(a.suppressHydrationWarning!==!0&&wh(i.textContent,s,e),n=["children",s]):typeof s=="number"&&i.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&wh(i.textContent,s,e),n=["children",""+s]):Yl.hasOwnProperty(o)&&s!=null&&o==="onScroll"&&it("scroll",i)}switch(r){case"input":ch(i),Bx(i,a,!0);break;case"textarea":ch(i),jx(i);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(i.onclick=Zh)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{o=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Hb(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(r,{is:i.is}):(e=o.createElement(r),r==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,r),e[on]=t,e[au]=i,y3(e,t,!1,!1),t.stateNode=e;e:{switch(o=bg(r,i),r){case"dialog":it("cancel",e),it("close",e),n=i;break;case"iframe":case"object":case"embed":it("load",e),n=i;break;case"video":case"audio":for(n=0;n<jl.length;n++)it(jl[n],e);n=i;break;case"source":it("error",e),n=i;break;case"img":case"image":case"link":it("error",e),it("load",e),n=i;break;case"details":it("toggle",e),n=i;break;case"input":Lx(e,i),n=mg(e,i),it("invalid",e);break;case"option":n=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},n=_t({},i,{value:void 0}),it("invalid",e);break;case"textarea":Ox(e,i),n=_g(e,i),it("invalid",e);break;default:n=i}xg(r,n),s=n;for(a in s)if(s.hasOwnProperty(a)){var l=s[a];a==="style"?Xb(e,l):a==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Wb(e,l)):a==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Xl(e,l):typeof l=="number"&&Xl(e,""+l):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Yl.hasOwnProperty(a)?l!=null&&a==="onScroll"&&it("scroll",e):l!=null&&n0(e,a,l,o))}switch(r){case"input":ch(e),Bx(e,i,!1);break;case"textarea":ch(e),jx(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ma(i.value));break;case"select":e.multiple=!!i.multiple,a=i.value,a!=null?as(e,!!i.multiple,a,!1):i.defaultValue!=null&&as(e,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=Zh)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pr(t),null;case 6:if(e&&t.stateNode!=null)v3(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(V(166));if(r=Ya(su.current),Ya(ln.current),Th(t)){if(i=t.stateNode,r=t.memoizedProps,i[on]=t,(a=i.nodeValue!==r)&&(e=Zr,e!==null))switch(e.tag){case 3:wh(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&wh(i.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[on]=t,t.stateNode=i}return pr(t),null;case 13:if(nt(gt),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(lt&&Gr!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Bw(),ds(),t.flags|=98560,a=!1;else if(a=Th(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(V(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(V(317));a[on]=t}else ds(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pr(t),a=!1}else Fi!==null&&(t0(Fi),Fi=null),a=!0;if(!a)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(gt.current&1)!==0?Nt===0&&(Nt=3):N0())),t.updateQueue!==null&&(t.flags|=4),pr(t),null);case 4:return ms(),Hg(e,t),e===null&&iu(t.stateNode.containerInfo),pr(t),null;case 10:return T0(t.type._context),pr(t),null;case 17:return Fr(t.type)&&Hh(),pr(t),null;case 19:if(nt(gt),a=t.memoizedState,a===null)return pr(t),null;if(i=(t.flags&128)!==0,o=a.rendering,o===null)if(i)zl(a,!1);else{if(Nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ep(e),o!==null){for(t.flags|=128,zl(a,!1),i=o.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)a=r,e=i,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Qe(gt,gt.current&1|2),t.child}e=e.sibling}a.tail!==null&&Dt()>ys&&(t.flags|=128,i=!0,zl(a,!1),t.lanes=4194304)}else{if(!i)if(e=ep(o),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),zl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!lt)return pr(t),null}else 2*Dt()-a.renderingStartTime>ys&&r!==1073741824&&(t.flags|=128,i=!0,zl(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Dt(),t.sibling=null,r=gt.current,Qe(gt,i?r&1|2:r&1),t):(pr(t),null);case 22:case 23:return j0(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(qr&1073741824)!==0&&(pr(t),t.subtreeFlags&6&&(t.flags|=8192)):pr(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function gM(e,t){switch(v0(t),t.tag){case 1:return Fr(t.type)&&Hh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),nt(zr),nt(fr),D0(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return P0(t),null;case 13:if(nt(gt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(gt),null;case 4:return ms(),null;case 10:return T0(t.type._context),null;case 22:case 23:return j0(),null;case 24:return null;default:return null}}var Ch=!1,dr=!1,yM=typeof WeakSet=="function"?WeakSet:Set,K=null;function is(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){xt(e,t,i)}else r.current=null}function Wg(e,t,r){try{r()}catch(i){xt(e,t,i)}}var Ab=!1;function _M(e,t){if(Ig=$h,e=Sw(),y0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,c=0,h=e,p=null;t:for(;;){for(var d;h!==r||n!==0&&h.nodeType!==3||(s=o+n),h!==a||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)p=h,h=d;for(;;){if(h===e)break t;if(p===r&&++u===n&&(s=o),p===a&&++c===i&&(l=o),(d=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(kg={focusedElem:e,selectionRange:r},$h=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var f=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var m=f.memoizedProps,_=f.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:ki(t.type,m),_);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(x){xt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return f=Ab,Ab=!1,f}function Zl(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&e)===e){var a=n.destroy;n.destroy=void 0,a!==void 0&&Wg(t,r,a)}n=n.next}while(n!==i)}}function gp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Yg(e){var t=e.ref;if(t!==null){var r=e.stateNode;e.tag,e=r,typeof t=="function"?t(e):t.current=e}}function x3(e){var t=e.alternate;t!==null&&(e.alternate=null,x3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[on],delete t[au],delete t[Rg],delete t[eM],delete t[tM])),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 b3(e){return e.tag===5||e.tag===3||e.tag===4}function Mb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||b3(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 Xg(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Zh));else if(i!==4&&(e=e.child,e!==null))for(Xg(e,t,r),e=e.sibling;e!==null;)Xg(e,t,r),e=e.sibling}function Kg(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Kg(e,t,r),e=e.sibling;e!==null;)Kg(e,t,r),e=e.sibling}var Jt=null,zi=!1;function ea(e,t,r){for(r=r.child;r!==null;)w3(e,t,r),r=r.sibling}function w3(e,t,r){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(lp,r)}catch{}switch(r.tag){case 5:dr||is(r,t);case 6:var i=Jt,n=zi;Jt=null,ea(e,t,r),Jt=i,zi=n,Jt!==null&&(zi?(e=Jt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Jt.removeChild(r.stateNode));break;case 18:Jt!==null&&(zi?(e=Jt,r=r.stateNode,e.nodeType===8?eg(e.parentNode,r):e.nodeType===1&&eg(e,r),eu(e)):eg(Jt,r.stateNode));break;case 4:i=Jt,n=zi,Jt=r.stateNode.containerInfo,zi=!0,ea(e,t,r),Jt=i,zi=n;break;case 0:case 11:case 14:case 15:if(!dr&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var a=n,o=a.destroy;a=a.tag,o!==void 0&&((a&2)!==0||(a&4)!==0)&&Wg(r,t,o),n=n.next}while(n!==i)}ea(e,t,r);break;case 1:if(!dr&&(is(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(s){xt(r,t,s)}ea(e,t,r);break;case 21:ea(e,t,r);break;case 22:r.mode&1?(dr=(i=dr)||r.memoizedState!==null,ea(e,t,r),dr=i):ea(e,t,r);break;default:ea(e,t,r)}}function Ib(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new yM),t.forEach(function(i){var n=PM.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function Ii(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i];try{var a=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 5:Jt=s.stateNode,zi=!1;break e;case 3:Jt=s.stateNode.containerInfo,zi=!0;break e;case 4:Jt=s.stateNode.containerInfo,zi=!0;break e}s=s.return}if(Jt===null)throw Error(V(160));w3(a,o,n),Jt=null,zi=!1;var l=n.alternate;l!==null&&(l.return=null),n.return=null}catch(u){xt(n,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)T3(t,e),t=t.sibling}function T3(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ii(t,e),nn(e),i&4){try{Zl(3,e,e.return),gp(3,e)}catch(m){xt(e,e.return,m)}try{Zl(5,e,e.return)}catch(m){xt(e,e.return,m)}}break;case 1:Ii(t,e),nn(e),i&512&&r!==null&&is(r,r.return);break;case 5:if(Ii(t,e),nn(e),i&512&&r!==null&&is(r,r.return),e.flags&32){var n=e.stateNode;try{Xl(n,"")}catch(m){xt(e,e.return,m)}}if(i&4&&(n=e.stateNode,n!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&Gb(n,a),bg(s,o);var u=bg(s,a);for(o=0;o<l.length;o+=2){var c=l[o],h=l[o+1];c==="style"?Xb(n,h):c==="dangerouslySetInnerHTML"?Wb(n,h):c==="children"?Xl(n,h):n0(n,c,h,u)}switch(s){case"input":gg(n,a);break;case"textarea":Zb(n,a);break;case"select":var p=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!a.multiple;var d=a.value;d!=null?as(n,!!a.multiple,d,!1):p!==!!a.multiple&&(a.defaultValue!=null?as(n,!!a.multiple,a.defaultValue,!0):as(n,!!a.multiple,a.multiple?[]:"",!1))}n[au]=a}catch(m){xt(e,e.return,m)}}break;case 6:if(Ii(t,e),nn(e),i&4){if(e.stateNode===null)throw Error(V(162));n=e.stateNode,a=e.memoizedProps;try{n.nodeValue=a}catch(m){xt(e,e.return,m)}}break;case 3:if(Ii(t,e),nn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{eu(t.containerInfo)}catch(m){xt(e,e.return,m)}break;case 4:Ii(t,e),nn(e);break;case 13:Ii(t,e),nn(e),n=e.child,n.flags&8192&&(a=n.memoizedState!==null,n.stateNode.isHidden=a,!a||n.alternate!==null&&n.alternate.memoizedState!==null||(B0=Dt())),i&4&&Ib(e);break;case 22:if(c=r!==null&&r.memoizedState!==null,e.mode&1?(dr=(u=dr)||c,Ii(t,e),dr=u):Ii(t,e),nn(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&(e.mode&1)!==0)for(K=e,c=e.child;c!==null;){for(h=K=c;K!==null;){switch(p=K,d=p.child,p.tag){case 0:case 11:case 14:case 15:Zl(4,p,p.return);break;case 1:is(p,p.return);var f=p.stateNode;if(typeof f.componentWillUnmount=="function"){i=p,r=p.return;try{t=i,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(m){xt(i,r,m)}}break;case 5:is(p,p.return);break;case 22:if(p.memoizedState!==null){zb(h);continue}}d!==null?(d.return=p,K=d):zb(h)}c=c.sibling}e:for(c=null,h=e;;){if(h.tag===5){if(c===null){c=h;try{n=h.stateNode,u?(a=n.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=Yb("display",o))}catch(m){xt(e,e.return,m)}}}else if(h.tag===6){if(c===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){xt(e,e.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;c===h&&(c=null),h=h.return}c===h&&(c=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ii(t,e),nn(e),i&4&&Ib(e);break;case 21:break;default:Ii(t,e),nn(e)}}function nn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(b3(r)){var i=r;break e}r=r.return}throw Error(V(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(Xl(n,""),i.flags&=-33);var a=Mb(e);Kg(e,a,n);break;case 3:case 4:var o=i.stateNode.containerInfo,s=Mb(e);Xg(e,s,o);break;default:throw Error(V(161))}}catch(l){xt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vM(e,t,r){K=e,S3(e,t,r)}function S3(e,t,r){for(var i=(e.mode&1)!==0;K!==null;){var n=K,a=n.child;if(n.tag===22&&i){var o=n.memoizedState!==null||Ch;if(!o){var s=n.alternate,l=s!==null&&s.memoizedState!==null||dr;s=Ch;var u=dr;if(Ch=o,(dr=l)&&!u)for(K=n;K!==null;)o=K,l=o.child,o.tag===22&&o.memoizedState!==null?Fb(n):l!==null?(l.return=o,K=l):Fb(n);for(;a!==null;)K=a,S3(a,t,r),a=a.sibling;K=n,Ch=s,dr=u}kb(e,t,r)}else(n.subtreeFlags&8772)!==0&&a!==null?(a.return=n,K=a):kb(e,t,r)}}function kb(e){for(;K!==null;){var t=K;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:dr||gp(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!dr)if(r===null)i.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:ki(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&gb(t,a,i);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}gb(t,o,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var h=c.dehydrated;h!==null&&eu(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}dr||t.flags&512&&Yg(t)}catch(p){xt(t,t.return,p)}}if(t===e){K=null;break}if(r=t.sibling,r!==null){r.return=t.return,K=r;break}K=t.return}}function zb(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var r=t.sibling;if(r!==null){r.return=t.return,K=r;break}K=t.return}}function Fb(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{gp(4,t)}catch(l){xt(t,r,l)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var n=t.return;try{i.componentDidMount()}catch(l){xt(t,n,l)}}var a=t.return;try{Yg(t)}catch(l){xt(t,a,l)}break;case 5:var o=t.return;try{Yg(t)}catch(l){xt(t,o,l)}}}catch(l){xt(t,t.return,l)}if(t===e){K=null;break}var s=t.sibling;if(s!==null){s.return=t.return,K=s;break}K=t.return}}var xM=Math.ceil,ip=kn.ReactCurrentDispatcher,R0=kn.ReactCurrentOwner,hi=kn.ReactCurrentBatchConfig,ze=0,qt=null,zt=null,er=0,qr=0,ns=_a(0),Nt=0,hu=null,to=0,yp=0,L0=0,Hl=null,Ir=null,B0=0,ys=1/0,Tn=null,np=!1,Qg=null,pa=null,Ph=!1,oa=null,ap=0,Wl=0,Jg=null,Rh=-1,Lh=0;function wr(){return(ze&6)!==0?Dt():Rh!==-1?Rh:Rh=Dt()}function da(e){return(e.mode&1)===0?1:(ze&2)!==0&&er!==0?er&-er:iM.transition!==null?(Lh===0&&(Lh=lw()),Lh):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:mw(e.type)),e)}function Li(e,t,r,i){if(50<Wl)throw Wl=0,Jg=null,Error(V(185));pu(e,r,i),((ze&2)===0||e!==qt)&&(e===qt&&((ze&2)===0&&(yp|=r),Nt===4&&na(e,er)),Rr(e,i),r===1&&ze===0&&(t.mode&1)===0&&(ys=Dt()+500,dp&&va()))}function Rr(e,t){var r=e.callbackNode;aA(e,t);var i=Uh(e,e===qt?er:0);if(i===0)r!==null&&Ux(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Ux(r),t===1)e.tag===0?rM(Rb.bind(null,e)):Fw(Rb.bind(null,e)),QA(function(){(ze&6)===0&&va()}),r=null;else{switch(uw(i)){case 1:r=u0;break;case 4:r=ow;break;case 16:r=Vh;break;case 536870912:r=sw;break;default:r=Vh}r=k3(r,E3.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function E3(e,t){if(Rh=-1,Lh=0,(ze&6)!==0)throw Error(V(327));var r=e.callbackNode;if(cs()&&e.callbackNode!==r)return null;var i=Uh(e,e===qt?er:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=op(e,i);else{t=i;var n=ze;ze|=2;var a=P3();(qt!==e||er!==t)&&(Tn=null,ys=Dt()+500,Xa(e,t));do try{TM();break}catch(s){C3(e,s)}while(!0);w0(),ip.current=a,ze=n,zt!==null?t=0:(qt=null,er=0,t=Nt)}if(t!==0){if(t===2&&(n=Cg(e),n!==0&&(i=n,t=e0(e,n))),t===1)throw r=hu,Xa(e,0),na(e,i),Rr(e,Dt()),r;if(t===6)na(e,i);else{if(n=e.current.alternate,(i&30)===0&&!bM(n)&&(t=op(e,i),t===2&&(a=Cg(e),a!==0&&(i=a,t=e0(e,a))),t===1))throw r=hu,Xa(e,0),na(e,i),Rr(e,Dt()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error(V(345));case 2:Za(e,Ir,Tn);break;case 3:if(na(e,i),(i&130023424)===i&&(t=B0+500-Dt(),10<t)){if(Uh(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){wr(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=Fg(Za.bind(null,e,Ir,Tn),t);break}Za(e,Ir,Tn);break;case 4:if(na(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var o=31-Ri(i);a=1<<o,o=t[o],o>n&&(n=o),i&=~a}if(i=n,i=Dt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xM(i/1960))-i,10<i){e.timeoutHandle=Fg(Za.bind(null,e,Ir,Tn),i);break}Za(e,Ir,Tn);break;case 5:Za(e,Ir,Tn);break;default:throw Error(V(329))}}}return Rr(e,Dt()),e.callbackNode===r?E3.bind(null,e):null}function e0(e,t){var r=Hl;return e.current.memoizedState.isDehydrated&&(Xa(e,t).flags|=256),e=op(e,t),e!==2&&(t=Ir,Ir=r,t!==null&&t0(t)),e}function t0(e){Ir===null?Ir=e:Ir.push.apply(Ir,e)}function bM(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var n=r[i],a=n.getSnapshot;n=n.value;try{if(!Bi(a(),n))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function na(e,t){for(t&=~L0,t&=~yp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ri(t),i=1<<r;e[r]=-1,t&=~i}}function Rb(e){if((ze&6)!==0)throw Error(V(327));cs();var t=Uh(e,0);if((t&1)===0)return Rr(e,Dt()),null;var r=op(e,t);if(e.tag!==0&&r===2){var i=Cg(e);i!==0&&(t=i,r=e0(e,i))}if(r===1)throw r=hu,Xa(e,0),na(e,t),Rr(e,Dt()),r;if(r===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Za(e,Ir,Tn),Rr(e,Dt()),null}function O0(e,t){var r=ze;ze|=1;try{return e(t)}finally{ze=r,ze===0&&(ys=Dt()+500,dp&&va())}}function ro(e){oa!==null&&oa.tag===0&&(ze&6)===0&&cs();var t=ze;ze|=1;var r=hi.transition,i=Ge;try{if(hi.transition=null,Ge=1,e)return e()}finally{Ge=i,hi.transition=r,ze=t,(ze&6)===0&&va()}}function j0(){qr=ns.current,nt(ns)}function Xa(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,KA(r)),zt!==null)for(r=zt.return;r!==null;){var i=r;switch(v0(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Hh();break;case 3:ms(),nt(zr),nt(fr),D0();break;case 5:P0(i);break;case 4:ms();break;case 13:nt(gt);break;case 19:nt(gt);break;case 10:T0(i.type._context);break;case 22:case 23:j0()}r=r.return}if(qt=e,zt=e=fa(e.current,null),er=qr=t,Nt=0,hu=null,L0=yp=to=0,Ir=Hl=null,Wa!==null){for(t=0;t<Wa.length;t++)if(r=Wa[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,a=r.pending;if(a!==null){var o=a.next;a.next=n,i.next=o}r.pending=i}Wa=null}return e}function C3(e,t){do{var r=zt;try{if(w0(),kh.current=rp,tp){for(var i=yt.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}tp=!1}if(eo=0,$t=jt=yt=null,Gl=!1,lu=0,R0.current=null,r===null||r.return===null){Nt=1,hu=t,zt=null;break}e:{var a=e,o=r.return,s=r,l=t;if(t=er,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,h=c.tag;if((c.mode&1)===0&&(h===0||h===11||h===15)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var d=wb(o);if(d!==null){d.flags&=-257,Tb(d,o,s,a,t),d.mode&1&&bb(a,u,t),t=d,l=u;var f=t.updateQueue;if(f===null){var m=new Set;m.add(l),t.updateQueue=m}else f.add(l);break e}else{if((t&1)===0){bb(a,u,t),N0();break e}l=Error(V(426))}}else if(lt&&s.mode&1){var _=wb(o);if(_!==null){(_.flags&65536)===0&&(_.flags|=256),Tb(_,o,s,a,t),x0(gs(l,s));break e}}a=l=gs(l,s),Nt!==4&&(Nt=2),Hl===null?Hl=[a]:Hl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=u3(a,l,t);mb(a,g);break e;case 1:s=l;var y=a.type,v=a.stateNode;if((a.flags&128)===0&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(pa===null||!pa.has(v)))){a.flags|=65536,t&=-t,a.lanes|=t;var x=c3(a,s,t);mb(a,x);break e}}a=a.return}while(a!==null)}A3(r)}catch(b){t=b,zt===r&&r!==null&&(zt=r=r.return);continue}break}while(!0)}function P3(){var e=ip.current;return ip.current=rp,e===null?rp:e}function N0(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),qt===null||(to&268435455)===0&&(yp&268435455)===0||na(qt,er)}function op(e,t){var r=ze;ze|=2;var i=P3();(qt!==e||er!==t)&&(Tn=null,Xa(e,t));do try{wM();break}catch(n){C3(e,n)}while(!0);if(w0(),ze=r,ip.current=i,zt!==null)throw Error(V(261));return qt=null,er=0,Nt}function wM(){for(;zt!==null;)D3(zt)}function TM(){for(;zt!==null&&!X8();)D3(zt)}function D3(e){var t=I3(e.alternate,e,qr);e.memoizedProps=e.pendingProps,t===null?A3(e):zt=t,R0.current=null}function A3(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=mM(r,t,qr),r!==null){zt=r;return}}else{if(r=gM(r,t),r!==null){r.flags&=32767,zt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Nt=6,zt=null;return}}if(t=t.sibling,t!==null){zt=t;return}zt=t=e}while(t!==null);Nt===0&&(Nt=5)}function Za(e,t,r){var i=Ge,n=hi.transition;try{hi.transition=null,Ge=1,SM(e,t,r,i)}finally{hi.transition=n,Ge=i}return null}function SM(e,t,r,i){do cs();while(oa!==null);if((ze&6)!==0)throw Error(V(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(oA(e,a),e===qt&&(zt=qt=null,er=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Ph||(Ph=!0,k3(Vh,function(){return cs(),null})),a=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||a){a=hi.transition,hi.transition=null;var o=Ge;Ge=1;var s=ze;ze|=4,R0.current=null,_M(e,r),T3(r,e),ZA(kg),$h=!!Ig,kg=Ig=null,e.current=r,vM(r,e,n),K8(),ze=s,Ge=o,hi.transition=a}else e.current=r;if(Ph&&(Ph=!1,oa=e,ap=n),a=e.pendingLanes,a===0&&(pa=null),eA(r.stateNode,i),Rr(e,Dt()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],i(n.value,{componentStack:n.stack,digest:n.digest});if(np)throw np=!1,e=Qg,Qg=null,e;return(ap&1)!==0&&e.tag!==0&&cs(),a=e.pendingLanes,(a&1)!==0?e===Jg?Wl++:(Wl=0,Jg=e):Wl=0,va(),null}function cs(){if(oa!==null){var e=uw(ap),t=hi.transition,r=Ge;try{if(hi.transition=null,Ge=16>e?16:e,oa===null)var i=!1;else{if(e=oa,oa=null,ap=0,(ze&6)!==0)throw Error(V(331));var n=ze;for(ze|=4,K=e.current;K!==null;){var a=K,o=a.child;if((K.flags&16)!==0){var s=a.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(K=u;K!==null;){var c=K;switch(c.tag){case 0:case 11:case 15:Zl(8,c,a)}var h=c.child;if(h!==null)h.return=c,K=h;else for(;K!==null;){c=K;var p=c.sibling,d=c.return;if(x3(c),c===u){K=null;break}if(p!==null){p.return=d,K=p;break}K=d}}}var f=a.alternate;if(f!==null){var m=f.child;if(m!==null){f.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}K=a}}if((a.subtreeFlags&2064)!==0&&o!==null)o.return=a,K=o;else e:for(;K!==null;){if(a=K,(a.flags&2048)!==0)switch(a.tag){case 0:case 11:case 15:Zl(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,K=g;break e}K=a.return}}var y=e.current;for(K=y;K!==null;){o=K;var v=o.child;if((o.subtreeFlags&2064)!==0&&v!==null)v.return=o,K=v;else e:for(o=y;K!==null;){if(s=K,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:gp(9,s)}}catch(b){xt(s,s.return,b)}if(s===o){K=null;break e}var x=s.sibling;if(x!==null){x.return=s.return,K=x;break e}K=s.return}}if(ze=n,va(),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(lp,e)}catch{}i=!0}return i}finally{Ge=r,hi.transition=t}}return!1}function Lb(e,t,r){t=gs(r,t),t=u3(e,t,1),e=ha(e,t,1),t=wr(),e!==null&&(pu(e,1,t),Rr(e,t))}function xt(e,t,r){if(e.tag===3)Lb(e,e,r);else for(;t!==null;){if(t.tag===3){Lb(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(pa===null||!pa.has(i))){e=gs(r,e),e=c3(t,e,1),t=ha(t,e,1),e=wr(),t!==null&&(pu(t,1,e),Rr(t,e));break}}t=t.return}}function EM(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=wr(),e.pingedLanes|=e.suspendedLanes&r,qt===e&&(er&r)===r&&(Nt===4||Nt===3&&(er&130023424)===er&&500>Dt()-B0?Xa(e,0):L0|=r),Rr(e,t)}function M3(e,t){t===0&&((e.mode&1)===0?t=1:(t=dh,dh<<=1,(dh&130023424)===0&&(dh=4194304)));var r=wr();e=Mn(e,t),e!==null&&(pu(e,t,r),Rr(e,r))}function CM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),M3(e,r)}function PM(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(V(314))}i!==null&&i.delete(t),M3(e,r)}var I3;I3=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||zr.current)kr=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return kr=!1,fM(e,t,r);kr=(e.flags&131072)!==0}else kr=!1,lt&&(t.flags&1048576)!==0&&Rw(t,Xh,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Fh(e,t),e=t.pendingProps;var n=ps(t,fr.current);us(t,r),n=M0(null,t,i,e,n,r);var a=I0();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Fr(i)?(a=!0,Wh(t)):a=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,E0(t),n.updater=mp,t.stateNode=n,n._reactInternals=t,Vg(t,i,e,r),t=qg(null,t,i,!0,a,r)):(t.tag=0,lt&&a&&_0(t),br(null,t,n,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Fh(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=AM(i),e=ki(i,e),n){case 0:t=$g(null,t,i,e,r);break e;case 1:t=Cb(null,t,i,e,r);break e;case 11:t=Sb(null,t,i,e,r);break e;case 14:t=Eb(null,t,i,ki(i.type,e),r);break e}throw Error(V(306,i,""))}return t;case 0:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),$g(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),Cb(e,t,i,n,r);case 3:e:{if(f3(t),e===null)throw Error(V(387));i=t.pendingProps,a=t.memoizedState,n=a.element,Vw(e,t),Jh(t,i,null,r);var o=t.memoizedState;if(i=o.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){n=gs(Error(V(423)),t),t=Pb(e,t,i,r,n);break e}else if(i!==n){n=gs(Error(V(424)),t),t=Pb(e,t,i,r,n);break e}else for(Gr=ca(t.stateNode.containerInfo.firstChild),Zr=t,lt=!0,Fi=null,r=jw(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ds(),i===n){t=In(e,t,r);break e}br(e,t,i,r)}t=t.child}return t;case 5:return Uw(t),e===null&&Og(t),i=t.type,n=t.pendingProps,a=e!==null?e.memoizedProps:null,o=n.children,zg(i,n)?o=null:a!==null&&zg(i,a)&&(t.flags|=32),d3(e,t),br(e,t,o,r),t.child;case 6:return e===null&&Og(t),null;case 13:return m3(e,t,r);case 4:return C0(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=fs(t,null,i,r):br(e,t,i,r),t.child;case 11:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),Sb(e,t,i,n,r);case 7:return br(e,t,t.pendingProps,r),t.child;case 8:return br(e,t,t.pendingProps.children,r),t.child;case 12:return br(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,n=t.pendingProps,a=t.memoizedProps,o=n.value,Qe(Kh,i._currentValue),i._currentValue=o,a!==null)if(Bi(a.value,o)){if(a.children===n.children&&!zr.current){t=In(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===i){if(a.tag===1){l=Pn(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),jg(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(V(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),jg(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}br(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,us(t,r),n=pi(n),i=i(n),t.flags|=1,br(e,t,i,r),t.child;case 14:return i=t.type,n=ki(i,t.pendingProps),n=ki(i.type,n),Eb(e,t,i,n,r);case 15:return h3(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),Fh(e,t),t.tag=1,Fr(i)?(e=!0,Wh(t)):e=!1,us(t,r),l3(t,i,n),Vg(t,i,n,r),qg(null,t,i,!0,e,r);case 19:return g3(e,t,r);case 22:return p3(e,t,r)}throw Error(V(156,t.tag))};function k3(e,t){return aw(e,t)}function DM(e,t,r,i){this.tag=e,this.key=r,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,t,r,i){return new DM(e,t,r,i)}function V0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function AM(e){if(typeof e=="function")return V0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===o0)return 11;if(e===s0)return 14}return 2}function fa(e,t){var r=e.alternate;return r===null?(r=ci(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Bh(e,t,r,i,n,a){var o=2;if(i=e,typeof e=="function")V0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Wo:return Ka(r.children,n,a,t);case a0:o=8,n|=8;break;case hg:return e=ci(12,r,t,n|2),e.elementType=hg,e.lanes=a,e;case pg:return e=ci(13,r,t,n),e.elementType=pg,e.lanes=a,e;case dg:return e=ci(19,r,t,n),e.elementType=dg,e.lanes=a,e;case Ub:return _p(r,n,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nb:o=10;break e;case Vb:o=9;break e;case o0:o=11;break e;case s0:o=14;break e;case ta:o=16,i=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=ci(o,r,t,n),t.elementType=e,t.type=i,t.lanes=a,t}function Ka(e,t,r,i){return e=ci(7,e,i,t),e.lanes=r,e}function _p(e,t,r,i){return e=ci(22,e,i,t),e.elementType=Ub,e.lanes=r,e.stateNode={isHidden:!1},e}function lg(e,t,r){return e=ci(6,e,null,t),e.lanes=r,e}function ug(e,t,r){return t=ci(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function MM(e,t,r,i,n){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=Zm(0),this.expirationTimes=Zm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zm(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function U0(e,t,r,i,n,a,o,s,l){return e=new MM(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ci(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},E0(a),e}function IM(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ho,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function z3(e){if(!e)return ga;e=e._reactInternals;e:{if(no(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Fr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var r=e.type;if(Fr(r))return zw(e,r,t)}return t}function F3(e,t,r,i,n,a,o,s,l){return e=U0(r,i,!0,e,n,a,o,s,l),e.context=z3(null),r=e.current,i=wr(),n=da(r),a=Pn(i,n),a.callback=t??null,ha(r,a,n),e.current.lanes=n,pu(e,n,i),Rr(e,i),e}function vp(e,t,r,i){var n=t.current,a=wr(),o=da(n);return r=z3(r),t.context===null?t.context=r:t.pendingContext=r,t=Pn(a,o),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=ha(n,t,o),e!==null&&(Li(e,n,o,a),Ih(e,n,o)),o}function sp(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Bb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function $0(e,t){Bb(e,t),(e=e.alternate)&&Bb(e,t)}function kM(){return null}var R3=typeof reportError=="function"?reportError:function(e){console.error(e)};function q0(e){this._internalRoot=e}xp.prototype.render=q0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));vp(e,t,null,null)};xp.prototype.unmount=q0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ro(function(){vp(null,e,null,null)}),t[An]=null}};function xp(e){this._internalRoot=e}xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=pw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ia.length&&t!==0&&t<ia[r].priority;r++);ia.splice(r,0,e),r===0&&fw(e)}};function G0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ob(){}function zM(e,t,r,i,n){if(n){if(typeof i=="function"){var a=i;i=function(){var u=sp(o);a.call(u)}}var o=F3(t,i,e,0,null,!1,!1,"",Ob);return e._reactRootContainer=o,e[An]=o.current,iu(e.nodeType===8?e.parentNode:e),ro(),o}for(;n=e.lastChild;)e.removeChild(n);if(typeof i=="function"){var s=i;i=function(){var u=sp(l);s.call(u)}}var l=U0(e,0,!1,null,null,!1,!1,"",Ob);return e._reactRootContainer=l,e[An]=l.current,iu(e.nodeType===8?e.parentNode:e),ro(function(){vp(t,l,r,i)}),l}function wp(e,t,r,i,n){var a=r._reactRootContainer;if(a){var o=a;if(typeof n=="function"){var s=n;n=function(){var l=sp(o);s.call(l)}}vp(t,o,e,n)}else o=zM(r,t,e,n,i);return sp(o)}cw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ol(t.pendingLanes);r!==0&&(c0(t,r|1),Rr(t,Dt()),(ze&6)===0&&(ys=Dt()+500,va()))}break;case 13:ro(function(){var i=Mn(e,1);if(i!==null){var n=wr();Li(i,e,1,n)}}),$0(e,1)}};h0=function(e){if(e.tag===13){var t=Mn(e,134217728);if(t!==null){var r=wr();Li(t,e,134217728,r)}$0(e,134217728)}};hw=function(e){if(e.tag===13){var t=da(e),r=Mn(e,t);if(r!==null){var i=wr();Li(r,e,t,i)}$0(e,t)}};pw=function(){return Ge};dw=function(e,t){var r=Ge;try{return Ge=e,t()}finally{Ge=r}};Tg=function(e,t,r){switch(t){case"input":if(gg(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var n=pp(i);if(!n)throw Error(V(90));qb(i),gg(i,n)}}}break;case"textarea":Zb(e,r);break;case"select":t=r.value,t!=null&&as(e,!!r.multiple,t,!1)}};Jb=O0;ew=ro;var FM={usingClientEntryPoint:!1,Events:[fu,Qo,pp,Kb,Qb,O0]},Fl={findFiberByHostInstance:Ha,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},RM={bundleType:Fl.bundleType,version:Fl.version,rendererPackageName:Fl.rendererPackageName,rendererConfig:Fl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=iw(e),e===null?null:e.stateNode},findFiberByHostInstance:Fl.findFiberByHostInstance||kM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Rl.isDisabled&&Rl.supportsFiber))try{lp=Rl.inject(RM),sn=Rl}catch{}var Rl;Yr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FM;Yr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!G0(t))throw Error(V(200));return IM(e,t,null,r)};Yr.createRoot=function(e,t){if(!G0(e))throw Error(V(299));var r=!1,i="",n=R3;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=U0(e,1,!1,null,null,r,!1,i,n),e[An]=t.current,iu(e.nodeType===8?e.parentNode:e),new q0(t)};Yr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=iw(t),e=e===null?null:e.stateNode,e};Yr.flushSync=function(e){return ro(e)};Yr.hydrate=function(e,t,r){if(!bp(t))throw Error(V(200));return wp(null,e,t,!0,r)};Yr.hydrateRoot=function(e,t,r){if(!G0(e))throw Error(V(405));var i=r!=null&&r.hydratedSources||null,n=!1,a="",o=R3;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=F3(t,null,e,1,r??null,n,!1,a,o),e[An]=t.current,iu(e),i)for(e=0;e<i.length;e++)r=i[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new xp(t)};Yr.render=function(e,t,r){if(!bp(t))throw Error(V(200));return wp(null,e,t,!1,r)};Yr.unmountComponentAtNode=function(e){if(!bp(e))throw Error(V(40));return e._reactRootContainer?(ro(function(){wp(null,null,e,!1,function(){e._reactRootContainer=null,e[An]=null})}),!0):!1};Yr.unstable_batchedUpdates=O0;Yr.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!bp(r))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return wp(e,t,r,!1,i)};Yr.version="18.3.1-next-f1338f8080-20240426"});var j3=tn((lH,O3)=>{"use strict";function B3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(B3)}catch(e){console.error(e)}}B3(),O3.exports=L3()});var V3=tn(Z0=>{"use strict";var N3=j3();Z0.createRoot=N3.createRoot,Z0.hydrateRoot=N3.hydrateRoot;var uH});var UD=tn((ree,f2)=>{var Yf="maplibre_gl_dates";function d2(e,t){let r=BD(t);e.getStyle().layers.map(function(i){if(!("source-layer"in i))return;let n=jD(e.getFilter(i.id),r);e.setFilter(i.id,n)})}function BD(e){let t;if(typeof e=="string")t=OD(e);else if(e instanceof Date&&!isNaN(e)){let r=Kf(e),i=e.toISOString().split("T")[0];t={startDate:e,startDecimalYear:r,startISODate:i,endDate:e,endDecimalYear:r,endISODate:i}}return t}function OD(e){if(!e||!/^-?\d{1,4}(?:-\d\d){0,2}$/.test(e))return;let t=e.split("-");t[0]===""&&(t.shift(),t[0]*=-1);let i=+t[0],n=+t[0],a,o;t[1]?a=o=+t[1]-1:(n++,a=o=0);let s,l;t[2]?s=l=+t[2]:t[1]&&(o++,s=l=1);let u=Xf(i,a,s),c=Xf(n,o,l);return{startDate:!isNaN(u)&&u,startDecimalYear:!isNaN(u)&&Kf(u),startISODate:!isNaN(u)&&u.toISOString().split("T")[0],endDate:!isNaN(c)&&c,endDecimalYear:!isNaN(c)&&Kf(c),endISODate:!isNaN(c)&&c.toISOString().split("T")[0]}}function Xf(e,t,r){let i=new Date(Date.UTC(e,t,r));return i.setUTCFullYear(e),i}function Kf(e){let t=e.getUTCFullYear(),r=Xf(t+1,0,1).getTime(),i=Xf(t,0,1).getTime();return t+(e.getTime()-i)/(r-i)}function jD(e,t){return typeof e<"u"&&m2(e)?ND(e,t):VD(e,t)}function ND(e,t){return e[0]==="all"&&e[2]&&e[1][0]==="any"&&e[2][0]==="any"?(e[1][1]&&e[1][1][0]==="all"&&e[1][1][2]&&e[1][1][2][0]==="<"&&e[1][1][2][1]==="start_decdate"&&(e[1][1][2][2]=t.endDecimalYear),e[1][2]&&e[1][2][0]==="all"&&e[1][2][2]&&e[1][2][2][0]==="<"&&e[1][2][2][2]==="start_date"&&(e[1][2][2][3]=t.endISODate),e[2][1]&&e[2][1][0]==="all"&&e[2][1][2]&&e[2][1][2][0]===">="&&e[2][1][2][1]==="end_decdate"&&(e[2][1][2][2]=t.startDecimalYear),e[2][2]&&e[2][2][0]==="all"&&e[2][2][2]&&e[2][2][2][0]===">="&&e[2][2][2][2]==="end_date"&&(e[2][2][2][3]=t.startISODate),e):["all",["any",["all",["has","start_decdate"],["<","start_decdate",t.endDecimalYear]],["all",["!has","start_decdate"],["has","start_date"],["<","start_date",t.endISODate]],["all",["!has","start_decdate"],["!has","start_date"]]],["any",["all",["has","end_decdate"],[">=","end_decdate",t.startDecimalYear]],["all",["!has","end_decdate"],["has","end_date"],[">=","end_date",t.startISODate]],["all",["!has","end_decdate"],["!has","end_date"]]],e]}function VD(e,t){let r=`${Yf}__startDecimalYear`,i=`${Yf}__startISODate`,n=`${Yf}__endDecimalYear`,a=`${Yf}__endISODate`;if(Array.isArray(e)&&e[0]==="let")return kc(e,r,t.startDecimalYear),kc(e,i,t.startISODate),kc(e,n,t.endDecimalYear),kc(e,a,t.endISODate),e;let o=["all",["any",["all",["has","start_decdate"],["<",["get","start_decdate"],["var",n]]],["all",["!",["has","start_decdate"]],["has","start_date"],["<",["get","start_date"],["var",a]]],["all",["!",["has","start_decdate"]],["!",["has","start_date"]]]],["any",["all",["has","end_decdate"],[">=",["get","end_decdate"],["var",r]]],["all",["!",["has","end_decdate"]],["has","end_date"],[">=",["get","end_date"],["var",i]]],["all",["!",["has","end_decdate"]],["!",["has","end_date"]]]]];return e&&o.push(e),["let",r,t.startDecimalYear,i,t.startISODate,n,t.endDecimalYear,a,t.endISODate,o]}function m2(e){if(!Array.isArray(e)||e.length<2)return!1;let t=e.slice(1);switch(e[0]){case"!has":case"!in":case"none":return!0;case"has":return t[0]==="$id"||t[0]==="$type";case"in":return t.length>2||t[0]==="$id"||t[0]==="$type"||typeof t[1]=="number"||typeof t[1]=="boolean"||typeof t[0]=="string"&&typeof t[1]=="string";case"==":case"!=":case">":case">=":case"<":case"<=":return typeof t[0]=="string"&&!Array.isArray(t[1]);case"all":case"any":return t.some(m2);default:return!1}}function kc(e,t,r){if(e[0]!=="let")return;let i=e.indexOf(t);i!==-1&&i%2===1?e[i+1]=r:e.splice(-1,0,t,r)}typeof window<"u"&&("maplibregl"in window||"mapboxgl"in window)?("maplibregl"in window&&(maplibregl.Map.prototype.filterByDate=function(e){d2(this,e)}),"mapboxgl"in window&&(mapboxgl.Map.prototype.filterByDate=function(e){d2(this,e)})):typeof f2<"u"&&(f2.exports={filterByDate:d2,dateRangeFromDate:BD,decimalYearFromDate:Kf,dateRangeFromISODate:OD,constrainFilterByDateRange:jD,constrainLegacyFilterByDateRange:ND,constrainExpressionFilterByDateRange:VD,isLegacyFilter:m2,updateVariable:kc})});var WD=tn(Jf=>{"use strict";var MZ=$a(),IZ=Symbol.for("react.element"),kZ=Symbol.for("react.fragment"),zZ=Object.prototype.hasOwnProperty,FZ=MZ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RZ={key:!0,ref:!0,__self:!0,__source:!0};function HD(e,t,r){var i,n={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(i in t)zZ.call(t,i)&&!RZ.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)n[i]===void 0&&(n[i]=t[i]);return{$$typeof:IZ,type:e,key:a,ref:o,props:n,_owner:FZ.current}}Jf.Fragment=kZ;Jf.jsx=HD;Jf.jsxs=HD});var Xi=tn((oee,YD)=>{"use strict";YD.exports=WD()});var tm=ur($a(),1),o8=ur(V3(),1);var LM=Object.create,cT=Object.defineProperty,BM=Object.getOwnPropertyDescriptor,OM=Object.getOwnPropertyNames,jM=Object.getPrototypeOf,hT=Object.prototype.hasOwnProperty,A_=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),NM=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=OM(t),a=0,o=n.length,s;a<o;a++)s=n[a],!hT.call(e,s)&&s!==r&&cT(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(i=BM(t,s))||i.enumerable});return e},VM=(e,t,r)=>(r=e==null?{}:LM(jM(e)),NM(t||!e||!e.__esModule||!hT.call(e,"default")?cT(r,"default",{value:e,enumerable:!0}):r,e)),pT="6.15.0";function k(e,t){this.x=e,this.y=t}k.prototype={clone(){return new k(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),i=t*this.x-r*this.y,n=r*this.x+t*this.y;return this.x=i,this.y=n,this},_rotateAround(e,t){let r=Math.cos(e),i=Math.sin(e),n=t.x+r*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:k},k.convert=function(e){if(e instanceof k)return e;if(Array.isArray(e))return new k(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new k(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};function UM(e,t,r,i){let n=3*e,a=3*(r-e)-n,o=1-n-a,s=3*t,l=3*(i-t)-s,u=1-s-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let m=0;m<8;m++){let _=((o*p+a)*p+n)*p-c;if(Math.abs(_)<h)return((u*p+l)*p+s)*p;let g=(3*o*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=_/g}let d=0,f=1;p=c;for(let m=0;m<20;m++){let _=((o*p+a)*p+n)*p;if(Math.abs(_-c)<h)break;c>_?d=p:f=p,p=(d+f)*.5}return((u*p+l)*p+s)*p}}var H0;function M_(){return H0??(H0=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),H0}var Tp;function dT(){if(Tp==null&&(Tp=!1,M_())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;r<25;r++){let i=r*4;e.fillStyle=`rgb(${i},${i+1},${i+2})`,e.fillRect(r%5,Math.floor(r/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&t[r]!==r){Tp=!0;break}}}return Tp||!1}var Yt=typeof Float32Array<"u"?Float32Array:Array;function fT(){var e=new Yt(4);return Yt!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function $M(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*a-n*i;return o?(o=1/o,e[0]=a*o,e[1]=-i*o,e[2]=-n*o,e[3]=r*o,e):null}function qM(e){return e[0]*e[3]-e[2]*e[1]}function GM(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=n*l+o*s,e[2]=i*-s+a*l,e[3]=n*-s+o*l,e}function mT(){var e=new Yt(9);return Yt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ZM(e){var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*(u*a-o*l)+r*(-u*n+o*s)+i*(l*n-a*s)}function HM(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function WM(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r+r,s=i+i,l=n+n,u=r*o,c=i*o,h=i*s,p=n*o,d=n*s,f=n*l,m=a*o,_=a*s,g=a*l;return e[0]=1-h-f,e[3]=c-g,e[6]=p+_,e[1]=c+g,e[4]=1-u-f,e[7]=d-m,e[2]=p-_,e[5]=d+m,e[8]=1-u-h,e}function Do(){var e=new Yt(16);return Yt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function H1(e){var t=new Yt(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function YM(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Gi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _d(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],_=t[14],g=t[15],y=r*s-i*o,v=r*l-n*o,x=r*u-a*o,b=i*l-n*s,w=i*u-a*s,T=n*u-a*l,S=c*m-h*f,E=c*_-p*f,P=c*g-d*f,D=h*_-p*m,F=h*g-d*m,I=p*g-d*_,C=y*I-v*F+x*D+b*P-w*E+T*S;return C?(C=1/C,e[0]=(s*I-l*F+u*D)*C,e[1]=(n*F-i*I-a*D)*C,e[2]=(m*T-_*w+g*b)*C,e[3]=(p*w-h*T-d*b)*C,e[4]=(l*P-o*I-u*E)*C,e[5]=(r*I-n*P+a*E)*C,e[6]=(_*x-f*T-g*v)*C,e[7]=(c*T-p*x+d*v)*C,e[8]=(o*F-s*P+u*S)*C,e[9]=(i*P-r*F-a*S)*C,e[10]=(f*w-m*x+g*y)*C,e[11]=(h*x-c*w-d*y)*C,e[12]=(s*E-o*D-l*S)*C,e[13]=(r*D-i*E+n*S)*C,e[14]=(m*v-f*b-_*y)*C,e[15]=(c*b-h*v+p*y)*C,e):null}function Es(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],_=t[13],g=t[14],y=t[15],v=r[0],x=r[1],b=r[2],w=r[3];return e[0]=v*i+x*s+b*h+w*m,e[1]=v*n+x*l+b*p+w*_,e[2]=v*a+x*u+b*d+w*g,e[3]=v*o+x*c+b*f+w*y,v=r[4],x=r[5],b=r[6],w=r[7],e[4]=v*i+x*s+b*h+w*m,e[5]=v*n+x*l+b*p+w*_,e[6]=v*a+x*u+b*d+w*g,e[7]=v*o+x*c+b*f+w*y,v=r[8],x=r[9],b=r[10],w=r[11],e[8]=v*i+x*s+b*h+w*m,e[9]=v*n+x*l+b*p+w*_,e[10]=v*a+x*u+b*d+w*g,e[11]=v*o+x*c+b*f+w*y,v=r[12],x=r[13],b=r[14],w=r[15],e[12]=v*i+x*s+b*h+w*m,e[13]=v*n+x*l+b*p+w*_,e[14]=v*a+x*u+b*d+w*g,e[15]=v*o+x*c+b*f+w*y,e}function At(e,t,r){var i=r[0],n=r[1],a=r[2],o,s,l,u,c,h,p,d,f,m,_,g;return t===e?(e[12]=t[0]*i+t[4]*n+t[8]*a+t[12],e[13]=t[1]*i+t[5]*n+t[9]*a+t[13],e[14]=t[2]*i+t[6]*n+t[10]*a+t[14],e[15]=t[3]*i+t[7]*n+t[11]*a+t[15]):(o=t[0],s=t[1],l=t[2],u=t[3],c=t[4],h=t[5],p=t[6],d=t[7],f=t[8],m=t[9],_=t[10],g=t[11],e[0]=o,e[1]=s,e[2]=l,e[3]=u,e[4]=c,e[5]=h,e[6]=p,e[7]=d,e[8]=f,e[9]=m,e[10]=_,e[11]=g,e[12]=o*i+c*n+f*a+t[12],e[13]=s*i+h*n+m*a+t[13],e[14]=l*i+p*n+_*a+t[14],e[15]=u*i+d*n+g*a+t[15]),e}function gr(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function qs(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=o*n+c*i,e[6]=s*n+h*i,e[7]=l*n+p*i,e[8]=u*n-a*i,e[9]=c*n-o*i,e[10]=h*n-s*i,e[11]=p*n-l*i,e}function gT(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-u*i,e[1]=o*n-c*i,e[2]=s*n-h*i,e[3]=l*n-p*i,e[8]=a*i+u*n,e[9]=o*i+c*n,e[10]=s*i+h*n,e[11]=l*i+p*n,e}function Pa(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+u*i,e[1]=o*n+c*i,e[2]=s*n+h*i,e[3]=l*n+p*i,e[4]=u*n-a*i,e[5]=c*n-o*i,e[6]=h*n-s*i,e[7]=p*n-l*i,e}function XM(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function KM(e,t,r,i,n){var a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0){var o=1/(i-n);e[10]=(n+i)*o,e[14]=2*n*i*o}else e[10]=-1,e[14]=-2*i;return e}var W1=KM;function QM(e,t,r,i,n,a,o){var s=1/(t-r),l=1/(i-n),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(o+a)*u,e[15]=1,e}var Ln=QM;function JM(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function eI(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],_=e[14],g=e[15],y=t[0],v=t[1],x=t[2],b=t[3],w=t[4],T=t[5],S=t[6],E=t[7],P=t[8],D=t[9],F=t[10],I=t[11],C=t[12],A=t[13],M=t[14],L=t[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-v)<=1e-6*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-x)<=1e-6*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(o-w)<=1e-6*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=1e-6*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-S)<=1e-6*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-P)<=1e-6*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(h-D)<=1e-6*Math.max(1,Math.abs(h),Math.abs(D))&&Math.abs(p-F)<=1e-6*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(d-I)<=1e-6*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(f-C)<=1e-6*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(m-A)<=1e-6*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(_-M)<=1e-6*Math.max(1,Math.abs(_),Math.abs(M))&&Math.abs(g-L)<=1e-6*Math.max(1,Math.abs(g),Math.abs(L))}function yT(){var e=new Yt(3);return Yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Y1(e){var t=new Yt(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ui(e){var t=e[0],r=e[1],i=e[2];return Math.sqrt(t*t+r*r+i*i)}function U3(e,t,r){var i=new Yt(3);return i[0]=e,i[1]=t,i[2]=r,i}function vi(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function I_(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Xe(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function vd(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e}function k_(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+i*i+n*n)}function tI(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function Cr(e,t){var r=t[0],i=t[1],n=t[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Mt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function jr(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=n*l-a*s,e[1]=a*o-i*l,e[2]=i*s-n*o,e}function rI(e,t,r,i){var n=t[0],a=t[1],o=t[2];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=o+i*(r[2]-o),e}function iI(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[3]*i+r[7]*n+r[11]*a+r[15];return o||(o=1),e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/o,e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/o,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/o,e}function nI(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e}function W0(e,t,r){var i=r[0],n=r[1],a=r[2],o=r[3],s=t[0],l=t[1],u=t[2],c=n*u-a*l,h=a*s-i*u,p=i*l-n*s;return c+=c,h+=h,p+=p,e[0]=s+o*c+n*p-a*h,e[1]=l+o*h+a*c-i*p,e[2]=u+o*p+i*h-n*c,e}function gu(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function xs(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function Y0(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function aI(e){return e[0]=0,e[1]=0,e[2]=0,e}var $n=I_,xd=Ui;(function(){var e=yT();return function(t,r,i,n,a,o){var s,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}})();function oI(){var e=new Yt(4);return Yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function sI(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function lI(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function uI(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function cI(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*r+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=i*o,e[2]=n*o,e[3]=a*o,e}function nr(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,e}var hI=lI;(function(){var e=oI();return function(t,r,i,n,a,o){var s,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}})();function $3(){var e=new Yt(4);return Yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function pI(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function dI(e,t,r){r*=.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function fI(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=r[0],l=r[1],u=r[2],c=r[3];return e[0]=i*c+o*s+n*u-a*l,e[1]=n*c+o*l+a*s-i*u,e[2]=a*c+o*u+i*l-n*s,e[3]=o*c-i*s-n*l-a*u,e}function rd(e,t,r,i){var n=t[0],a=t[1],o=t[2],s=t[3],l=r[0],u=r[1],c=r[2],h=r[3],p,d=n*l+a*u+o*c+s*h,f,m,_;return d<0&&(d=-d,l=-l,u=-u,c=-c,h=-h),1-d>1e-6?(p=Math.acos(d),f=Math.sin(p),m=Math.sin((1-i)*p)/f,_=Math.sin(i*p)/f):(m=1-i,_=i),e[0]=m*n+_*l,e[1]=m*a+_*u,e[2]=m*o+_*c,e[3]=m*s+_*h,e}function mI(e,t){var r=t[0]+t[4]+t[8],i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);var a=(n+1)%3,o=(n+2)%3;i=Math.sqrt(t[n*3+n]-t[a*3+a]-t[o*3+o]+1),e[n]=.5*i,i=.5/i,e[3]=(t[a*3+o]-t[o*3+a])*i,e[a]=(t[a*3+n]+t[n*3+a])*i,e[o]=(t[o*3+n]+t[n*3+o])*i}return e}function z_(e,t,r,i){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",a=Math.PI/360;t*=a,i*=a,r*=a;var o=Math.sin(t),s=Math.cos(t),l=Math.sin(r),u=Math.cos(r),c=Math.sin(i),h=Math.cos(i);switch(n){case"xyz":e[0]=o*u*h+s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h-o*l*c;break;case"xzy":e[0]=o*u*h-s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h+o*l*c;break;case"yxz":e[0]=o*u*h+s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h+o*l*c;break;case"yzx":e[0]=o*u*h+s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h-o*l*c;break;case"zxy":e[0]=o*u*h-s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h-o*l*c;break;case"zyx":e[0]=o*u*h-s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h+o*l*c;break;default:throw Error("Unknown angle order "+n)}return e}var gI=sI,q3=cI;(function(){var e=yT(),t=U3(1,0,0),r=U3(0,1,0);return function(i,n,a){var o=Mt(n,a);return o<-.999999?(jr(e,t,n),xd(e)<1e-6&&jr(e,r,n),Cr(e,e),dI(i,e,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(jr(e,n,a),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+o,q3(i,i))}})(),(function(){var e=$3(),t=$3();return function(r,i,n,a,o,s){return rd(e,i,o,s),rd(t,n,a,s),rd(r,e,t,2*s*(1-s)),r}})(),(function(){var e=mT();return function(t,r,i,n){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],q3(t,mI(t,e))}})();function X1(){var e=new Yt(2);return Yt!=Float32Array&&(e[0]=0,e[1]=0),e}function G3(e,t){var r=new Yt(2);return r[0]=e,r[1]=t,r}function Z3(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function H3(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function yI(e){var t=e[0],r=e[1];return t*t+r*r}function _I(e,t){return e[0]*t[0]+e[1]*t[1]}function W3(e){return e[0]=0,e[1]=0,e}var vI=yI;(function(){var e=X1();return function(t,r,i,n,a,o){var s,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}})();var R=8192;function ii(e,t,r){return t*(R/(e.tileSize*2**(r-e.tileID.overscaledZ)))}function Xt(e){return e instanceof Error?e:Error(typeof e=="string"?e:String(e))}function On(){return new Float64Array(4)}function Fe(){return new Float64Array(3)}function uo(){return new Float64Array(16)}function Sp(){let e=new Float64Array(16);return Gi(e),e}function _T(){let e=new Float32Array(16);return Gi(e),e}function Fa(e,t,r,i,n=!1){if(!r[0]&&!r[1])return[0,0];let a=n?i==="map"?-e.bearingInRadians:0:i==="viewport"?e.bearingInRadians:0;if(a){let o=Math.sin(a),s=Math.cos(a);r=[r[0]*s-r[1]*o,r[0]*o+r[1]*s]}return[n?r[0]:ii(t,r[0],e.zoom),n?r[1]:ii(t,r[1],e.zoom)]}function K1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]}function fi(e,t,r){let i=ZM([e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2]]);if(i===0)return null;let n=jr([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),a=jr([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),o=jr([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),s=Xe([],n,-e[3]);return vi(s,s,Xe([],a,-t[3])),vi(s,s,Xe([],o,-r[3])),Xe(s,s,1/i),s}function xI(e,t,r){let i=e[0]*r[0]+e[1]*r[1]+e[2]*r[2],n=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];return n===0?null:(-i-r[3])/n}function Ep(e,t,r,i){let n=Math.sqrt(e*e+t*t),a=Math.sqrt(r*r+i*i);e/=n,t/=n,r/=a,i/=a;let o=e*r+t*i,s=Math.acos(o);return-t*r+e*i>0?s:-s}function Lr(e,t){let r=xo(e,360),i=xo(t,360),n=i-r,a=i>r?n-360:n+360;return Math.abs(n)<Math.abs(a)?n:a}function Cp(e,t){let r=xo(e,Math.PI*2),i=xo(t,Math.PI*2);return Math.min(Math.abs(r-i),Math.abs(r-i+Math.PI*2),Math.abs(r-i-Math.PI*2))}function xo(e,t){return(e%t+t)%t}function Fu(e,t,r,i,n){return Ma(i,n,Q((e-t)/(r-t),0,1))}function Ma(e,t,r){return e*(1-r)+t*r}function bI(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y);return[t,r,i,n]}function wI(e){if(!e.length)return new Set;let t=Math.max(...e.map(l=>l.canonical.z)),r=1/0,i=-1/0,n=1/0,a=-1/0,o=[];for(let l of e){let{x:u,y:c,z:h}=l.canonical,p=2**(t-h),d=u*p,f=c*p;o.push({id:l,x:d,y:f}),d<r&&(r=d),d>i&&(i=d),f<n&&(n=f),f>a&&(a=f)}let s=new Set;for(let l of o)(l.x===r||l.x===i||l.y===n||l.y===a)&&s.add(l.id);return s}function TI(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function F_(e,t,r,i){return UM(e,t,r,i)}var Q1=F_(.25,.1,.25,1);function Q(e,t,r){return Math.min(r,Math.max(t,e))}function xi(e,t,r){let i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function J(e,...t){for(let r of t)for(let i in r)e[i]=r[i];return e}function Qd(e,t){let r={};for(let i of t)i in e&&(r[i]=e[i]);return r}var SI=1;function vT(){return SI++}function EI(e){return Math.log(e)/Math.LN2%1==0}function CI(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function Bt(e){return 2**e}function Ut(e){return Math.log(e)/Math.LN2}function Jr(e,t,r){if(t<=0)return e;let i=1/t;return r===void 0||Math.abs(r)<1e-10?Math.round(e*i)/i:(r>0?Math.ceil(e*i-1e-9):Math.floor(e*i+1e-10))/i}function R_(e,t,r){let i={};for(let n in e)i[n]=t.call(r||this,e[n],n,e);return i}function xT(e,t,r){let i={};for(let n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function un(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!un(e[r],t[r]))return!1;return!0}if(typeof e=="object"&&e&&t!==null){if(typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!un(e[r],t[r]))return!1;return!0}return e===t}function Or(e){return Array.isArray(e)?e.map(Or):typeof e=="object"&&e?R_(e,Or):e}var Y3={};function we(e){Y3[e]||(typeof console<"u"&&console.warn(e),Y3[e]=!0)}function Da(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function PI(e,t,r,i){let n=t.y-e.y,a=t.x-e.x,o=i.y-r.y,s=i.x-r.x,l=o*a-s*n;if(l===0)return null;let u=e.y-r.y,c=e.x-r.x,h=(s*u-o*c)/l;return new k(e.x+h*a,e.y+h*n)}function bT([e,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,[e*Math.cos(t)*Math.sin(r),e*Math.sin(t)*Math.sin(r),e*Math.cos(r)]}function Gs(e){return typeof WorkerGlobalScope<"u"&&e!==void 0&&e instanceof WorkerGlobalScope}function DI(e){let t=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(e.replace(t,(i,n,a,o)=>{let s=a||o;return r[n]=!s||s.toLowerCase(),""}),r["max-age"]){let i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}var X0=null;function AI(e){if(X0==null){let t=e.navigator?e.navigator.userAgent:null;X0=!!e.safari||!!(t&&(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return X0}function fo(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}var MI=async(e,t)=>{let r=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(r,t)}catch(i){throw Error(`Could not load image because of ${Xt(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},II=e=>new Promise((t,r)=>{let i=new Image;i.onload=()=>{t(i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame(()=>i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},i.onerror=()=>r(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."));let n=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=URL.createObjectURL(n)});function kI(e,t,r,i,n){let a=Math.max(-t,0)*4,o=(Math.max(0,r)-r)*i*4+a,s=i*4,l=Math.max(0,t),u=Math.max(0,r),c=Math.min(e.width,t+i),h=Math.min(e.height,r+n);return{rect:{x:l,y:u,width:c-l,height:h-u},layout:[{offset:o,stride:s}]}}async function zI(e,t,r,i,n){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(e,{timestamp:0});try{let o=a?.format;if(!o||!(o.startsWith("BGR")||o.startsWith("RGB")))throw Error(`Unrecognized format ${o}`);let s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(await a.copyTo(l,kI(e,t,r,i,n)),s)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{a.close()}}function bd(e,t,r,i){return e.addEventListener(t,r,i),{unsubscribe:()=>{e.removeEventListener(t,r,i)}}}function Je(e){return e*Math.PI/180}function Ni(e){return e/Math.PI*180}function wT(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing}function FI(e){let t=new Float64Array(9);WM(t,e);let r=Ni(-Math.asin(Q(t[2],-1,1))),i,n;return Math.hypot(t[5],t[8])<.001?(i=0,n=-Ni(Math.atan2(t[3],t[4]))):(i=Ni(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),n=Ni(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:i,pitch:r+90,bearing:n}}function RI(e,t,r){let i=G3(t.x-r.x,t.y-r.y),n=G3(e.x-r.x,e.y-r.y),a=i[0]*n[1]-i[1]*n[0];return Ni(Math.atan2(a,_I(i,n)))}function X3(e,t,r){let i=new Float64Array(4);return z_(i,e,t-90,r),i}var Zi=85.051129,TT={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},ST={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0};function LI(e,t){return TT[t]&&"touches"in e}function BI(e,t){if(!ST[t])return!1;let r=e,i=r?.target?.ownerDocument?.defaultView||window;return r instanceof i.MouseEvent||r instanceof i.WheelEvent}function OI(e){return TT[e]||ST[e]}var K3="AbortError",pc=class extends Error{constructor(e=K3){super(e instanceof Error?e.message:e),this.name=K3,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function Ra(e){return e instanceof Error&&e.name==="AbortError"}function L_(e){if(e.aborted)throw new pc(e.reason)}var Pp,K0,Q0,Nr={frame(e,t,r,i){let n=i||window,a=n.requestAnimationFrame(s=>{o(),t(s)}),{unsubscribe:o}=bd(e.signal,"abort",()=>{o(),n.cancelAnimationFrame(a),r(new pc(e.signal.reason))},!1)},frameAsync(e,t){return new Promise((r,i)=>{this.frame(e,r,i,t)})},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t;if(M_()&&!dT())t=new OffscreenCanvas(e.width,e.height).getContext("2d",{willReadFrequently:!0});else{let r=window.document.createElement("canvas");r.width=e.width,r.height=e.height,t=r.getContext("2d",{willReadFrequently:!0})}if(!t)throw Error("failed to create canvas 2d context");return t.drawImage(e,0,0,e.width,e.height),t},resolveURL(e){return Pp||(Pp=document.createElement("a")),Pp.href=e,Pp.href},get hardwareConcurrency(){return typeof navigator<"u"&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return Q0===void 0?matchMedia?(K0??(K0=matchMedia("(prefers-reduced-motion: reduce)")),K0.matches):!1:Q0},set prefersReducedMotion(e){Q0=e}},jI=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function Be(){return jI.getCurrentTime()}var NI=new Set("a.abbr.b.bdi.bdo.br.cite.code.del.div.em.i.img.ins.kbd.li.mark.ol.p.q.s.samp.small.span.strong.sub.sup.time.u.ul.var.wbr".split(".")),VI=new Set(["alt","class","datetime","dir","height","href","hreflang","lang","referrerpolicy","rel","role","src","target","title","translate","type","width"]),UI=new Set(["href","src"]),$I=new Set(["http:","https:","mailto:"]),J0;function e1(){return J0??(J0={getAttribute:Element.prototype.getAttribute,getAttributeNames:Element.prototype.getAttributeNames,querySelectorAll:Element.prototype.querySelectorAll,remove:Element.prototype.remove,removeAttribute:Element.prototype.removeAttribute,localName:Object.getOwnPropertyDescriptor(Element.prototype,"localName").get,namespaceURI:Object.getOwnPropertyDescriptor(Element.prototype,"namespaceURI").get}),J0}var Ne,ht=(Ne=class{static create(t,r,i){let n=window.document.createElement(t);return r!==void 0&&(n.className=r),i&&i.appendChild(n),n}static createNS(t,r){return window.document.createElementNS(t,r)}static disableDrag(){Ne.docStyle&&Ne.selectProp&&(Ne.userSelect=Ne.docStyle[Ne.selectProp],Ne.docStyle[Ne.selectProp]="none")}static enableDrag(){Ne.docStyle&&Ne.selectProp&&(Ne.docStyle[Ne.selectProp]=Ne.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",Ne.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Ne.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",Ne.suppressClickInternal,!0)},0)}static getScale(t){let r=t.getBoundingClientRect();return{x:r.width/t.offsetWidth||1,y:r.height/t.offsetHeight||1,boundingClientRect:r}}static getPoint(t,r,i){let n=r.boundingClientRect;return new k((i.clientX-n.left)/r.x-t.clientLeft,(i.clientY-n.top)/r.y-t.clientTop)}static mousePos(t,r){let i=Ne.getScale(t);return Ne.getPoint(t,i,r)}static touchPos(t,r){let i=[],n=Ne.getScale(t);for(let a of r)i.push(Ne.getPoint(t,n,a));return i}static sanitize(t){let r=new DOMParser().parseFromString(t,"text/html").body,{querySelectorAll:i,remove:n}=e1();for(let o of Array.from(i.call(r,"*")))Ne.isAllowedElement(o)?Ne.removeDisallowedAttributes(o):n.call(o);let a=document.createDocumentFragment();return a.append(...r.childNodes),a}static isAllowedElement(t){let{namespaceURI:r,localName:i}=e1();return r.call(t)==="http://www.w3.org/1999/xhtml"&&NI.has(i.call(t))}static removeDisallowedAttributes(t){let{getAttributeNames:r,getAttribute:i,removeAttribute:n}=e1();for(let a of r.call(t))Ne.isAllowedAttribute(a,i.call(t,a))||n.call(t,a)}static isAllowedAttribute(t,r){if(!VI.has(t)&&!t.startsWith("aria-"))return!1;if(!UI.has(t))return!0;try{return $I.has(new URL(r,"https://maplibre.invalid/").protocol)}catch{return!1}}},Ne.docStyle=typeof window<"u"&&window.document?.documentElement.style,Ne.selectProp=!Ne.docStyle||"userSelect"in Ne.docStyle?"userSelect":"webkitUserSelect",Ne),bo={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ET(e){return bo.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}var J1="global-dispatcher",wd=class extends Error{constructor(e,t,r,i){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=i}};function B_(){if(Gs(self))return self.worker?.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}var qI=e=>e.startsWith("file:")||B_()?.startsWith("file:")&&!/^\w+:/.test(e);async function GI(e,t){let r=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:B_(),referrerPolicy:e.referrerPolicy,signal:t.signal});e.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=await fetch(r)}catch(o){throw Ra(o)?o:new wd(0,Xt(o).message,e.url,new Blob)}if(!i.ok){let o=await i.blob();throw new wd(i.status,i.statusText,e.url,o)}let n;n=e.type==="arrayBuffer"||e.type==="image"?i.arrayBuffer():e.type==="json"?i.json():i.text();let a=await n;return L_(t.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}}function ZI(e,t){return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open(e.method||"GET",e.url,!0),(e.type==="arrayBuffer"||e.type==="image")&&(n.responseType="arraybuffer");for(let a in e.headers)n.setRequestHeader(a,e.headers[a]);e.type==="json"&&(n.responseType="text",e.headers?.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=e.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!t.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(e.type==="json")try{a=JSON.parse(n.response)}catch(o){i(o);return}r({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let a=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new wd(n.status,n.statusText,e.url,a))}},t.signal.addEventListener("abort",()=>{n.abort(),i(new pc(t.signal.reason))}),n.send(e.body)})}var Jd=async function(e,t){if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let r=ET(e.url);if(r){let i=await r(e,t);return!i.data&&e.type==="arrayBuffer"?J(i,{data:new ArrayBuffer(0)}):i}if(Gs(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:J1},t)}if(!qI(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return GI(e,t);if(Gs(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:J1},t)}return ZI(e,t)},ef=(e,t)=>Jd(J(e,{type:"json"}),t),CT=(e,t)=>Jd(J(e,{type:"arrayBuffer"}),t);function PT(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5),e.startsWith("null")))return!1;if(e.indexOf("://")<=0)return!0;let t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}var HI=e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{t.onloadstart=()=>{r(t)};for(let i of e){let n=window.document.createElement("source");PT(i)||(t.crossOrigin="Anonymous"),n.src=i,t.appendChild(n)}})},Vi;(function(e){let t,r,i,n;e.resetRequestQueue=()=>{t=[],r=0,i=0,n={}},e.addThrottleControl=h=>{let p=i++;return n[p]=h,p},e.removeThrottleControl=h=>{delete n[h],u()};let a=()=>{for(let h of Object.keys(n))if(n[h]())return!0;return!1};async function o(h,p,d,f,m=!0,_){let g=await h.transformRequest(p,d);return L_(f.signal),Vi.getImage(g,f,m,_)}e.transformAndGetImage=o,e.getImage=(h,p,d=!0,f)=>new Promise((m,_)=>{h.headers||(h.headers={}),h.headers.accept="image/webp,*/*",J(h,{type:"image"});let g={abortController:p,requestParameters:h,supportImageRefresh:d,imageBitmapOptions:f,state:"queued",onError:y=>{_(y)},onSuccess:y=>{m(y)}};t.push(g),u()});let s=(h,p)=>typeof createImageBitmap=="function"?MI(h,p):II(h),l=async h=>{h.state="running";let{requestParameters:p,supportImageRefresh:d,imageBitmapOptions:f,onError:m,onSuccess:_,abortController:g}=h,y=d===!1&&!f&&!Gs(self)&&!ET(p.url)&&(!p.headers||Object.keys(p.headers).reduce((x,b)=>x&&b==="accept",!0));r++;let v=y?c(p,g):Jd(p,g);try{let x=await v;delete h.abortController,h.state="completed",x.data instanceof HTMLImageElement||fo(x.data)?_(x):!x.data||x.data.byteLength===0?_({data:null,cacheControl:x.cacheControl,expires:x.expires}):_({data:await s(x.data,f),cacheControl:x.cacheControl,expires:x.expires})}catch(x){delete h.abortController,m(Xt(x))}finally{r--,u()}},u=()=>{let h=a()?bo.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:bo.MAX_PARALLEL_IMAGE_REQUESTS;for(let p=r;p<h&&t.length>0;p++){let d=t.shift();d.abortController.signal.aborted?p--:l(d)}},c=(h,p)=>new Promise((d,f)=>{let m=new Image,_=h.url,g=h.credentials;g&&g==="include"?m.crossOrigin="use-credentials":(g&&g==="same-origin"||!PT(_))&&(m.crossOrigin="anonymous"),p.signal.addEventListener("abort",()=>{m.src="",f(new pc(p.signal.reason))}),m.fetchPriority="high",m.onload=()=>{m.onerror=m.onload=null,d({data:m})},m.onerror=()=>{m.onerror=m.onload=null,!p.signal.aborted&&f(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."))},m.src=_})})(Vi||(Vi={})),Vi.resetRequestQueue();var WI=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}};function Q3(e,t,r){r[e]?.includes(t)||(r[e]||(r[e]=[]),r[e].push(t))}function t1(e,t,r){if(r?.[e]){let i=r[e].indexOf(t);i!==-1&&r[e].splice(i,1)}}var Ao=class{constructor(e,t={}){J(this,t),this.type=e}},ee=class extends Ao{constructor(e,t={}){super("error",J({error:e},t))}},lr=class{on(e,t){return this._listeners||(this._listeners={}),Q3(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return t1(e,t,this._listeners),t1(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||(this._oneTimeListeners={}),Q3(e,t,this._oneTimeListeners),this):new Promise(r=>this.once(e,r))}fire(e,t){let r=typeof e=="string"?new Ao(e,t||{}):e,i=r.type;if(this.listens(i)){r.target=this;let n=this._listeners?.[i]?.slice()??[];for(let s of n)s.call(this,r);let a=this._oneTimeListeners?.[i]?.slice()??[];for(let s of a)t1(i,s,this._oneTimeListeners),s.call(this,r);let o=this._eventedParent;o&&(J(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),o.fire(r))}else r instanceof ee&&console.error(r.error);return this}listens(e){return!!(this._listeners?.[e]?.length||this._oneTimeListeners?.[e]?.length||this._eventedParent?.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}},Wt=class extends Ao{},ne=class extends Wt{},J3=class extends Wt{constructor(e={}){super("style.load",e)}},ji=class extends Wt{constructor(e,t={}){super(e,t),this.dataType="style"}},et=class extends Wt{constructor(e,t={}){super(e,t),this.dataType="source"}},ei=class extends Wt{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r,i={}){r=r instanceof MouseEvent?r:new MouseEvent(e,r);let n=ht.mousePos(t.getCanvas(),r),a=t.unproject(n);super(e,J({point:n,lngLat:a,originalEvent:r},i)),this._defaultPrevented=!1,this.target=t}},Dp=class extends Wt{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){let i=e==="touchend"?r.changedTouches:r.touches,n=ht.touchPos(t.getCanvasContainer(),i),a=n.map(l=>t.unproject(l)),o=n.reduce((l,u,c,h)=>l.add(u.div(h.length)),new k(0,0)),s=t.unproject(o);super(e,{points:n,point:o,lngLats:a,lngLat:s,originalEvent:r}),this._defaultPrevented=!1}},YI=class extends Wt{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}},e5=class extends Wt{},XI=class extends Wt{constructor(e={}){super("terrain",e)}},KI=class extends Wt{constructor(e={}){super("projectiontransition",e)}},r1=class extends Wt{},QI=class extends Wt{constructor(e={}){super("styleimagemissing",e)}},DT={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},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:{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:{},"color-relief":{},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_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,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,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default: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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"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","feature"]},"property-type":"cross-faded-data-driven"},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},z=DT,JI=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ek(e,t){let r={};for(let i in e)i!=="ref"&&(r[i]=e[i]);return JI.forEach(i=>{i in t&&(r[i]=t[i])}),r}function t5(e){e=e.slice();let t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=ek(e[r],t[e[r].ref]));return e}function Le(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Le(e[r],t[r]))return!1;return!0}if(typeof e=="object"&&e&&t!==null){if(typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!Le(e[r],t[r]))return!1;return!0}return e===t}function Qr(e,t){e.push(t)}function AT(e,t,r){Qr(r,{command:"addSource",args:[e,t[e]]})}function MT(e,t,r){Qr(t,{command:"removeSource",args:[e]}),r[e]=!0}function tk(e,t,r,i){MT(e,r,i),AT(e,t,r)}function rk(e,t,r){let i;for(i in e[r])if(Object.prototype.hasOwnProperty.call(e[r],i)&&i!=="data"&&!Le(e[r][i],t[r][i]))return!1;for(i in t[r])if(Object.prototype.hasOwnProperty.call(t[r],i)&&i!=="data"&&!Le(e[r][i],t[r][i]))return!1;return!0}function ik(e,t,r,i){e||(e={}),t||(t={});let n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)||MT(n,r,i));for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)?Le(e[n],t[n])||(e[n].type==="geojson"&&t[n].type==="geojson"&&rk(e,t,n)?Qr(r,{command:"setGeoJSONSourceData",args:[n,t[n].data]}):tk(n,t,r,i)):AT(n,t,r))}function r5(e,t,r,i,n){Qr(t,{command:n,args:[r,i,e[i]]})}function Ap(e,t,r,i,n){e||(e={}),t||(t={});for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&(Le(e[a],t[a])||r5(t,r,i,a,n));for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&!Object.prototype.hasOwnProperty.call(e,a)&&(Le(e[a],t[a])||r5(t,r,i,a,n))}function i5(e){return e.id}function n5(e,t){return e[t.id]=t,e}function nk(e,t,r){e||(e=[]),t||(t=[]);let i=e.map(i5),n=t.map(i5),a=e.reduce(n5,{}),o=t.reduce(n5,{}),s=i.slice(),l=Object.create(null),u,c,h,p,d;for(let f=0,m=0;f<i.length;f++)u=i[f],Object.prototype.hasOwnProperty.call(o,u)?m++:(Qr(r,{command:"removeLayer",args:[u]}),s.splice(s.indexOf(u,m),1));for(let f=0,m=0;f<n.length;f++)u=n[n.length-1-f],s[s.length-1-f]!==u&&(Object.prototype.hasOwnProperty.call(a,u)?(Qr(r,{command:"removeLayer",args:[u]}),s.splice(s.lastIndexOf(u,s.length-m),1)):m++,p=s[s.length-f],Qr(r,{command:"addLayer",args:[o[u],p]}),s.splice(s.length-f,0,u),l[u]=!0);for(let f=0;f<n.length;f++)if(u=n[f],c=a[u],h=o[u],!(l[u]||Le(c,h)))if(!Le(c.source,h.source)||!Le(c["source-layer"],h["source-layer"])||!Le(c.type,h.type))Qr(r,{command:"removeLayer",args:[u]}),p=s[s.lastIndexOf(u)+1],Qr(r,{command:"addLayer",args:[h,p]});else{for(d in Ap(c.layout,h.layout,r,u,"setLayoutProperty"),Ap(c.paint,h.paint,r,u,"setPaintProperty"),Le(c.filter,h.filter)||Qr(r,{command:"setFilter",args:[u,h.filter]}),(!Le(c.minzoom,h.minzoom)||!Le(c.maxzoom,h.maxzoom))&&Qr(r,{command:"setLayerZoomRange",args:[u,h.minzoom,h.maxzoom]}),c)Object.prototype.hasOwnProperty.call(c,d)&&d!=="layout"&&d!=="paint"&&d!=="filter"&&d!=="metadata"&&d!=="minzoom"&&d!=="maxzoom"&&(d.indexOf("paint.")===0?Ap(c[d],h[d],r,u,"setPaintProperty"):Le(c[d],h[d])||Qr(r,{command:"setLayerProperty",args:[u,d,h[d]]}));for(d in h)Object.prototype.hasOwnProperty.call(h,d)&&!Object.prototype.hasOwnProperty.call(c,d)&&d!=="layout"&&d!=="paint"&&d!=="filter"&&d!=="metadata"&&d!=="minzoom"&&d!=="maxzoom"&&(d.indexOf("paint.")===0?Ap(c[d],h[d],r,u,"setPaintProperty"):Le(c[d],h[d])||Qr(r,{command:"setLayerProperty",args:[u,d,h[d]]}))}}function ak(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!Le(e.version,t.version))return[{command:"setStyle",args:[t]}];Le(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),Le(e.state,t.state)||r.push({command:"setGlobalState",args:[t.state]}),Le(e.centerAltitude,t.centerAltitude)||r.push({command:"setCenterAltitude",args:[t.centerAltitude]}),Le(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),Le(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),Le(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),Le(e.roll,t.roll)||r.push({command:"setRoll",args:[t.roll]}),Le(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),Le(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),Le(e["font-faces"],t["font-faces"])||r.push({command:"setFontFaces",args:[t["font-faces"]]}),Le(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),Le(e.light,t.light)||r.push({command:"setLight",args:[t.light]});let i=!Le(e.terrain,t.terrain);i&&!t.terrain&&r.push({command:"setTerrain",args:[void 0]}),Le(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),Le(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});let n={},a=[];ik(e.sources,t.sources,a,n);let o=[];e.layers&&e.layers.forEach(s=>{"source"in s&&n[s.source]?r.push({command:"removeLayer",args:[s.id]}):o.push(s)}),r=r.concat(a),nk(o,t.layers,r),i&&t.terrain&&r.push({command:"setTerrain",args:[t.terrain]})}catch(i){console.warn("Unable to compute style diff:",i),r=[{command:"setStyle",args:[t]}]}return r}var B=class{constructor(e,t,r,i,n="error"){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),this.severity=n,t!=null&&t.__line__&&(this.line=t.__line__)}},dc={kind:"null"},U={kind:"number"},fe={kind:"string"},xe={kind:"boolean"},$i={kind:"color"},tf={kind:"projectionDefinition"},mo={kind:"object"},ge={kind:"value"},ok={kind:"error"},rf={kind:"collator"},fc={kind:"formatted"},nf={kind:"padding"},Zu={kind:"colorArray"},af={kind:"numberArray"},mc={kind:"resolvedImage"},of={kind:"variableAnchorOffsetCollection"};function mr(e,t){return{kind:"array",itemType:e,N:t}}function pt(e){if(e.kind==="array"){let t=pt(e.itemType);return typeof e.N=="number"?`array<${t}, ${e.N}>`:e.itemType.kind==="value"?"array":`array<${t}>`}return e.kind}var sk=[dc,U,fe,xe,$i,tf,fc,mo,mr(ge),nf,af,Zu,mc,of];function Hu(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Hu(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(let r of sk)if(!Hu(r,t))return null}}return`Expected ${pt(e)} but found ${pt(t)} instead.`}function O_(e,t){return t.some(r=>r.kind===e.kind)}function go(e,t){return t.some(r=>r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e)}function xa(e,t){return e.kind==="array"&&t.kind==="array"?e.itemType.kind===t.itemType.kind&&typeof e.N=="number":e.kind===t.kind}var IT=.96422,kT=.82521,zT=4/29,ey=6/29,FT=3*ey*ey,lk=Math.PI/180,uk=180/Math.PI;function RT(e){return e%=360,e<0&&(e+=360),e}function LT([e,t,r,i]){e=i1(e),t=i1(t),r=i1(r);let n,a,o=n1((.2225045*e+.7168786*t+.0606169*r)/1);e===t&&t===r?n=a=o:(n=n1((.4360747*e+.3850649*t+.1430804*r)/IT),a=n1((.0139322*e+.0971045*t+.7141733*r)/kT));let s=116*o-16;return[s<0?0:s,500*(n-o),200*(o-a),i]}function i1(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function n1(e){return e>.008856451679035631?e**(1/3):e/FT+zT}function BT([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,o=isNaN(r)?n:n-r/200;return n=1*o1(n),a=IT*o1(a),o=kT*o1(o),[a1(3.1338561*a-1.6168667*n-.4906146*o),a1(-.9787684*a+1.9161415*n+.033454*o),a1(.0719453*a-.2289914*n+1.4052427*o),i]}function a1(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function o1(e){return e>ey?e*e*e:FT*(e-zT)}function ck(e){let[t,r,i,n]=LT(e),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?RT(Math.atan2(i,r)*uk):NaN,a,t,n]}function hk([e,t,r,i]){return e=isNaN(e)?0:e*lk,BT([r,Math.cos(e)*t,Math.sin(e)*t,i])}function pk([e,t,r,i]){e=RT(e),t/=100,r/=100;function n(a){let o=(a+e/30)%12,s=t*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(o-3,9-o,1))}return[n(0),n(8),n(4),i]}var dk=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Ru(e,t){return dk(e,t)?e[t]:void 0}function fk(e){if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t=Ru(mk,e);if(t){let[i,n,a]=t;return[i/255,n/255,a/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let i=e.length<6?1:2,n=1;return[Mp(e.slice(n,n+=i)),Mp(e.slice(n,n+=i)),Mp(e.slice(n,n+=i)),Mp(e.slice(n,n+i)||"ff")]}if(e.startsWith("rgb")){let i=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[n,a,o,s,l,u,c,h,p,d,f,m]=i,_=[s||" ",c||" ",d].join("");if(_===" "||_===" /"||_===",,"||_===",,,"){let g=[o,u,p].join(""),y=g==="%%%"?100:g===""?255:0;if(y){let v=[Cs(+a/y,0,1),Cs(+l/y,0,1),Cs(+h/y,0,1),f?a5(+f,m):1];if(o5(v))return v}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[i,n,a,o,s,l,u,c,h]=r,p=[a||" ",s||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let d=[+n,Cs(+o,0,100),Cs(+l,0,100),c?a5(+c,h):1];if(o5(d))return pk(d)}}}function Mp(e){return parseInt(e.padEnd(2,e),16)/255}function a5(e,t){return Cs(t?e/100:e,0,1)}function Cs(e,t,r){return Math.min(Math.max(t,e),r)}function o5(e){return!e.some(Number.isNaN)}var mk={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ia(e,t,r){return e+r*(t-e)}function Zs(e,t,r){return e.map((i,n)=>Ia(i,t[n],r))}function gk(e){return e==="rgb"||e==="hcl"||e==="lab"}var Zt,he=(Zt=class{constructor(t,r,i,n=1,a=!0){this.r=t,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,r,i,n]))}static parse(t){if(t instanceof Zt)return t;if(typeof t!="string")return;let r=fk(t);if(r)return new Zt(...r,!1)}get rgb(){let{r:t,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[t/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",ck(this.rgb))}get lab(){return this.overwriteGetter("lab",LT(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,i,n]=this.rgb;return`rgba(${[t,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(t,r,i,n="rgb"){switch(n){case"rgb":{let[a,o,s,l]=Zs(t.rgb,r.rgb,i);return new Zt(a,o,s,l,!1)}case"hcl":{let[a,o,s,l]=t.hcl,[u,c,h,p]=r.hcl,d,f;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u<a&&a-u>180&&(v+=360),d=a+i*v}else isNaN(a)?isNaN(u)?d=NaN:(d=u,(s===1||s===0)&&(f=c)):(d=a,(h===1||h===0)&&(f=o));let[m,_,g,y]=hk([d,f??Ia(o,c,i),Ia(s,h,i),Ia(l,p,i)]);return new Zt(m,_,g,y,!1)}case"lab":{let[a,o,s,l]=BT(Zs(t.lab,r.lab,i));return new Zt(a,o,s,l,!1)}}}},Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1),Zt),yk=["bottom","center","top"],ty=class{constructor(e,t,r,i,n,a){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},qn=class id{constructor(t){this.sections=t}static fromString(t){return new id([new ty(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof id?t:id.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}},_n=class Pu{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Pu)return t;if(typeof t=="number")return new Pu([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Pu(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new Pu(Zs(t.values,r.values,i))}},vn=class Du{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Du)return t;if(typeof t=="number")return new Du([t]);if(Array.isArray(t)){for(let r of t)if(typeof r!="number")return;return new Du(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new Du(Zs(t.values,r.values,i))}},Ti=class Au{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Au)return t;if(typeof t=="string"){let i=he.parse(t);return i?new Au([i]):void 0}if(!Array.isArray(t))return;let r=[];for(let i of t){if(typeof i!="string")return;let n=he.parse(i);if(!n)return;r.push(n)}return new Au(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n="rgb"){let a=[];if(t.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let o=0;o<t.values.length;o++)a.push(he.interpolate(t.values[o],r.values[o],i,n));return new Au(a)}},at=class extends Error{constructor(e,t){super(e),this.name="RuntimeError",this.path=t}toJSON(){return this.message}},_k=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),mn=class nd{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof nd)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let r=0;r<t.length;r+=2){let i=t[r],n=t[r+1];if(typeof i!="string"||!_k.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")return}return new nd(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n){let a=t.values,o=r.values;if(a.length!==o.length)throw new at(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`,n);let s=[];for(let l=0;l<a.length;l+=2){if(a[l]!==o[l])throw new at(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${a[l]}, to[${l}]: ${o[l]}`,n);s.push(a[l]);let[u,c]=a[l+1],[h,p]=o[l+1];s.push([Ia(u,h,i),Ia(c,p,i)])}return new nd(s)}},gn=class OT{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new OT({name:t,available:!1}):null}},ja=class Ps{constructor(t,r,i){this.from=t,this.to=r,this.transition=i}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,r,i){return new Ps(t,r,i)}static parse(t){if(t instanceof Ps)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number")return new Ps(t[0],t[1],t[2]);if(typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number")return new Ps(t.from,t.to,t.transition);if(typeof t=="string")return new Ps(t,t,1)}},j_=class{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};function jT(e,t,r,i){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Hs(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof ja||e instanceof he||e instanceof j_||e instanceof qn||e instanceof _n||e instanceof vn||e instanceof Ti||e instanceof mn||e instanceof gn)return!0;if(Array.isArray(e)){for(let t of e)if(!Hs(t))return!1;return!0}if(typeof e=="object"){for(let t in e)if(!Hs(e[t]))return!1;return!0}return!1}function St(e){if(e===null)return dc;if(typeof e=="string")return fe;if(typeof e=="boolean")return xe;if(typeof e=="number")return U;if(e instanceof he)return $i;if(e instanceof ja)return tf;if(e instanceof j_)return rf;if(e instanceof qn)return fc;if(e instanceof _n)return nf;if(e instanceof vn)return af;if(e instanceof Ti)return Zu;if(e instanceof mn)return of;if(e instanceof gn)return mc;if(Array.isArray(e)){let t=e.length,r;for(let i of e){let n=St(i);if(!r)r=n;else{if(r===n)continue;r=ge;break}}return mr(r||ge,t)}return mo}function Lu(e){let t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof he||e instanceof ja||e instanceof qn||e instanceof _n||e instanceof vn||e instanceof Ti||e instanceof mn||e instanceof gn?e.toString():JSON.stringify(e)}var Ws=class NT{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Hs(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let i=t[1],n=St(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new NT(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},vk=["Unknown","Point","LineString","Polygon"],VT=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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"?vk[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=he.parse(e),this._parseColorCache.set(e,t)),t}};function sf(e,t,r){let i=e.length-1,n=0,a=i,o=0,s,l;for(;n<=a;)if(o=Math.floor((n+a)/2),s=e[o],l=e[o+1],s<=t){if(o===i||t<l)return o;n=o+1}else if(s>t)a=o-1;else throw new at("Input is not a number.",r);return 0}var N_=class UT{constructor(t,r,i,n){this.type=t,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,o]of i)this.labels.push(a),this.outputs.push(o)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(t[1],1,U);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let o=1;o<t.length;o+=2){let s=o===1?-1/0:t[o],l=t[o+1],u=o,c=o+1;if(typeof s!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let h=r.parse(l,c,a);if(!h)return null;a||(a=h.type),n.push([s,h])}return new UT(a,i,n,r.key)}evaluate(t){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(t):i[sf(r,n,this.key)].evaluate(t)}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function xk(e,t,r,i){let n=3*e,a=3*(r-e)-n,o=1-n-a,s=3*t,l=3*(i-t)-s,u=1-s-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let m=0;m<8;m++){let _=((o*p+a)*p+n)*p-c;if(Math.abs(_)<h)return((u*p+l)*p+s)*p;let g=(3*o*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=_/g}let d=0,f=1;p=c;for(let m=0;m<20;m++){let _=((o*p+a)*p+n)*p;if(Math.abs(_-c)<h)break;c>_?d=p:f=p,p=(d+f)*.5}return((u*p+l)*p+s)*p}}var Si=class ry{constructor(t,r,i,n,a,o){this.type=t,this.operator=r,this.interpolation=i,this.input=n,this.key=o,this.labels=[],this.outputs=[];for(let[s,l]of a)this.labels.push(s),this.outputs.push(l)}static interpolationFactor(t,r,i,n){let a=0;if(t.name==="exponential")a=s1(r,t.base,i,n);else if(t.name==="linear")a=s1(r,1,i,n);else if(t.name==="cubic-bezier"){let o=t.controlPoints;a=xk(o[0],o[1],o[2],o[3])(s1(r,1,i,n))}return a}static parse(t,r){let[i,n,a,...o]=t;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,U),!a)return null;let s=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=Zu?l=$i:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<o.length;u+=2){let c=o[u],h=o[u+1],p=u+3,d=u+4;if(typeof c!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(s.length&&s[s.length-1][0]>=c)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);let f=r.parse(h,d,l);if(!f)return null;l||(l=f.type),s.push([c,f])}return!xa(l,U)&&!xa(l,tf)&&!xa(l,$i)&&!xa(l,nf)&&!xa(l,af)&&!xa(l,Zu)&&!xa(l,of)&&!xa(l,mr(U))?r.error(`Type ${pt(l)} is not interpolatable.`):new ry(l,i,n,a,s,r.key)}evaluate(t){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);let o=sf(r,n,this.key),s=r[o],l=r[o+1],u=ry.interpolationFactor(this.interpolation,n,s,l),c=i[o].evaluate(t),h=i[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ia(c,h,u);case"color":return he.interpolate(c,h,u);case"padding":return _n.interpolate(c,h,u);case"colorArray":return Ti.interpolate(c,h,u);case"numberArray":return vn.interpolate(c,h,u);case"variableAnchorOffsetCollection":return mn.interpolate(c,h,u,this.key);case"array":return Zs(c,h,u);case"projectionDefinition":return ja.interpolate(c,h,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return he.interpolate(c,h,u,"hcl");case"colorArray":return Ti.interpolate(c,h,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return he.interpolate(c,h,u,"lab");case"colorArray":return Ti.interpolate(c,h,u,"lab")}}}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function s1(e,t,r,i){let n=i-r,a=e-r;return n===0?0:t===1?a/n:(t**+a-1)/(t**+n-1)}var ot={color:he.interpolate,number:Ia,padding:_n.interpolate,numberArray:vn.interpolate,colorArray:Ti.interpolate,variableAnchorOffsetCollection:mn.interpolate,array:Zs},$T=class qT{constructor(t){this.type=fc,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let o=1;o<=t.length-1;++o){let s=t[o];if(a&&typeof s=="object"&&!Array.isArray(s)){a=!1;let l=null;if(s["font-scale"]&&(l=r.parse(s["font-scale"],1,U),!l))return null;let u=null;if(s["text-font"]&&(u=r.parse(s["text-font"],1,mr(fe)),!u))return null;let c=null;if(s["text-color"]&&(c=r.parse(s["text-color"],1,$i),!c))return null;let h=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!yk.includes(s["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);if(h=r.parse(s["vertical-align"],1,fe),!h)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=c,p.verticalAlign=h}else{let l=r.parse(t[o],1,ge);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new qT(n)}evaluate(t){return new qn(this.sections.map(r=>{let i=r.content.evaluate(t);return St(i)===mc?new ty("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new ty(Lu(i),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)}))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}};function GT(e,t,r=0,i=e.length-1,n=bk){for(;i>r;){if(i-r>600){let l=i-r+1,u=t-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);GT(e,t,Math.max(r,Math.floor(t-u*h/l+p)),Math.min(i,Math.floor(t+(l-u)*h/l+p)),n)}let a=e[t],o=r,s=i;for(yu(e,r,t),n(e[i],a)>0&&yu(e,r,i);o<s;){for(yu(e,o,s),o++,s--;n(e[o],a)<0;)o++;for(;n(e[s],a)>0;)s--}n(e[r],a)===0?yu(e,r,s):(s++,yu(e,s,i)),s<=t&&(r=s+1),t<=s&&(i=s-1)}}function yu(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function bk(e,t){return e<t?-1:+(e>t)}function lf(e,t){if(e.length<=1)return[e];let r=[],i,n;for(let a of e){let o=Tk(a);o!==0&&(a.area=Math.abs(o),n===void 0&&(n=o<0),n===o<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),t>1)for(let a=0;a<r.length;a++)r[a].length<=t||(GT(r[a],t,1,r[a].length-1,wk),r[a]=r[a].slice(0,t));return r}function wk(e,t){return t.area-e.area}function Tk(e){let t=0;for(let r=0,i=e.length,n=i-1,a,o;r<i;n=r++)a=e[r],o=e[n],t+=(o.x-a.x)*(a.y+o.y);return t}var Ip={string:fe,number:U,boolean:xe,object:mo},Bn=class ZT{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=1,n,a=t[0];if(a==="array"){let s;if(t.length>2){let u=t[1];if(typeof u!="string"||!(u in Ip)||u==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=Ip[u],i++}else s=ge;let l;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);l=t[2],i++}n=mr(s,l)}else{if(!Ip[a])throw Error(`Types doesn't contain name = ${a}`);n=Ip[a]}let o=[];for(;i<t.length;i++){let s=r.parse(t[i],i,ge);if(!s)return null;o.push(s)}return new ZT(n,o,r.key)}evaluate(t){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(t);if(!Hu(this.type,St(i)))return i;if(r===this.args.length-1)throw new at(`Expected value to be of type ${pt(this.type)}, but found ${pt(St(i))} instead.`,this.key)}throw Error()}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},s5={"to-boolean":xe,"to-color":$i,"to-number":U,"to-string":fe},ks=class HT{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[0];if(!s5[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&t.length!==2)return r.error("Expected one argument.");let n=s5[i],a=[];for(let o=1;o<t.length;o++){let s=r.parse(t[o],o,ge);if(!s)return null;a.push(s)}return new HT(n,a,r.key)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,i;for(let n of this.args){if(r=n.evaluate(t),i=null,r instanceof he)return r;if(typeof r=="string"){let a=t.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(i=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:jT(r[0],r[1],r[2],r[3]),!i))return new he(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new at(i||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(t);let n=_n.parse(r);if(n)return n}throw new at(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=vn.parse(r);if(n)return n}throw new at(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=Ti.parse(r);if(n)return n}throw new at(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(t);let n=mn.parse(r);if(n)return n}throw new at(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(t),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new at(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return qn.fromString(Lu(this.args[0].evaluate(t)));case"resolvedImage":return gn.fromString(Lu(this.args[0].evaluate(t)));case"projectionDefinition":{let r=this.args[0].evaluate(t);if(ja.parse(r))return r;throw new at(`Could not parse projectionDefinition from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}default:return Lu(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},WT=class YT{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let i=[];for(let a=1;a<t.length-1;a+=2){let o=t[a];if(typeof o!="string")return r.error(`Expected string, but found ${typeof o} instead.`,a);if(/[^a-zA-Z0-9_]/.test(o))return r.error("Variable names must contain only alphanumeric characters or '_'.",a);let s=r.parse(t[a+1],a+1);if(!s)return null;i.push([o,s])}let n=r.parse(t[t.length-1],t.length-1,r.expectedType,i);return n?new YT(i,n):null}outputDefined(){return this.result.outputDefined()}},XT=class KT{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let i=t[1];return r.scope.has(i)?new KT(i,r.scope.get(i)):r.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}},Sk=class QT{constructor(t,r,i,n){this.type=t,this.index=r,this.input=i,this.key=n}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,U),n=r.parse(t[2],2,mr(r.expectedType||ge));if(!i||!n)return null;let a=n.type;return new QT(a.itemType,i,n,r.key)}evaluate(t){let r=this.index.evaluate(t),i=this.input.evaluate(t);if(r<0)throw new at(`Array index out of bounds: ${r} < 0.`,this.key);if(r>=i.length)throw new at(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new at(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}},Ek=class JT{constructor(t,r,i){this.needle=t,this.haystack=r,this.key=i,this.type=xe}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,ge),n=r.parse(t[2],2,ge);return!i||!n?null:O_(i.type,[xe,fe,U,dc,ge])?new JT(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${pt(i.type)} instead`)}evaluate(t){let r=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!go(r,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${pt(St(r))} instead.`,this.key);if(!go(i,["string","array"]))throw new at(`Expected second argument to be of type array or string, but found ${pt(St(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}},Ck=class iy{constructor(t,r,i,n){this.needle=t,this.haystack=r,this.key=i,this.fromIndex=n,this.type=U}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,ge),n=r.parse(t[2],2,ge);if(!i||!n)return null;if(!O_(i.type,[xe,fe,U,dc,ge]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${pt(i.type)} instead`);if(t.length===4){let a=r.parse(t[3],3,U);return a?new iy(i,n,r.key,a):null}return new iy(i,n,r.key)}evaluate(t){let r=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!go(r,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${pt(St(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),go(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(go(i,["array"]))return i.indexOf(r,n);throw new at(`Expected second argument to be of type array or string, but found ${pt(St(i))} instead.`,this.key)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}},Pk=class eS{constructor(t,r,i,n,a,o){this.inputType=t,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=o}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},o=[];for(let u=2;u<t.length-1;u+=2){let c=t[u],h=t[u+1];Array.isArray(c)||(c=[c]);let p=r.concat(u);if(c.length===0)return p.error("Expected at least one branch label.");for(let f of c){if(typeof f!="number"&&typeof f!="string")return p.error("Branch labels must be numbers or strings.");if(typeof f=="number"&&Math.abs(f)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof f=="number"&&Math.floor(f)!==f)return p.error("Numeric branch labels must be integer values.");if(!i)i=St(f);else if(p.checkSubtype(i,St(f)))return null;if(a[String(f)]!==void 0)return p.error("Branch labels must be unique.");a[String(f)]=o.length}let d=r.parse(h,u,n);if(!d)return null;n||(n=d.type),o.push(d)}let s=r.parse(t[1],1,ge);if(!s)return null;let l=r.parse(t[t.length-1],t.length-1,n);return!l||s.type.kind!=="value"&&r.concat(1).checkSubtype(i,s.type)?null:new eS(i,n,s,a,o,l)}evaluate(t){let r=this.input.evaluate(t);return(St(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}},Dk=class tS{constructor(t,r,i){this.type=t,this.branches=r,this.otherwise=i}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let o=1;o<t.length-1;o+=2){let s=r.parse(t[o],o,xe);if(!s)return null;let l=r.parse(t[o+1],o+1,i);if(!l)return null;n.push([s,l]),i||(i=l.type)}let a=r.parse(t[t.length-1],t.length-1,i);if(!a)return null;if(!i)throw Error("Can't infer output type");return new tS(i,n,a)}evaluate(t){for(let[r,i]of this.branches)if(r.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[r,i]of this.branches)t(r),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},Ak=class ny{constructor(t,r,i,n,a){this.type=t,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,ge),n=r.parse(t[2],2,U);if(!i||!n)return null;if(!O_(i.type,[mr(ge),fe,ge]))return r.error(`Expected first argument to be of type array or string, but found ${pt(i.type)} instead`);if(t.length===4){let a=r.parse(t[3],3,U);return a?new ny(i.type,i,n,r.key,a):null}return new ny(i.type,i,n,r.key)}evaluate(t){let r=this.input.evaluate(t),i=this.beginIndex.evaluate(t),n;if(this.endIndex&&(n=this.endIndex.evaluate(t)),go(r,["string"]))return[...r].slice(i,n).join("");if(go(r,["array"]))return r.slice(i,n);throw new at(`Expected first argument to be of type array or string, but found ${pt(St(r))} instead.`,this.key)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}},rS=class ay{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let o of t.slice(1)){let s=r.parse(o,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!s)return null;i||(i=s.type),a.push(s)}if(!i)throw Error("No output type");return n&&a.some(o=>Hu(n,o.type))?new ay(ge,a):new ay(i,a)}evaluate(t){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(t),r&&r instanceof gn&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}};function l5(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Mk(e,t,r){return t===r}function Ik(e,t,r){return t!==r}function kk(e,t,r){return t<r}function zk(e,t,r){return t>r}function Fk(e,t,r){return t<=r}function Rk(e,t,r){return t>=r}function iS(e,t,r,i){return i.compare(t,r)===0}function Lk(e,t,r,i){return!iS(e,t,r,i)}function Bk(e,t,r,i){return i.compare(t,r)<0}function Ok(e,t,r,i){return i.compare(t,r)>0}function jk(e,t,r,i){return i.compare(t,r)<=0}function Nk(e,t,r,i){return i.compare(t,r)>=0}function rl(e,t,r){let i=e!=="=="&&e!=="!=";return class nS{constructor(a,o,s,l){this.lhs=a,this.rhs=o,this.key=s,this.collator=l,this.type=xe,this.hasUntypedArgument=a.type.kind==="value"||o.type.kind==="value"}static parse(a,o){if(a.length!==3&&a.length!==4)return o.error("Expected two or three arguments.");let s=a[0],l=o.parse(a[1],1,ge);if(!l)return null;if(!l5(s,l.type))return o.concat(1).error(`"${s}" comparisons are not supported for type '${pt(l.type)}'.`);let u=o.parse(a[2],2,ge);if(!u)return null;if(!l5(s,u.type))return o.concat(2).error(`"${s}" comparisons are not supported for type '${pt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error(`Cannot compare types '${pt(l.type)}' and '${pt(u.type)}'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Bn(u.type,[l],o.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Bn(l.type,[u],o.key)));let c=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(c=o.parse(a[3],3,rf),!c)return null}return new nS(l,u,o.key,c)}evaluate(a){let o=this.lhs.evaluate(a),s=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=St(o),u=St(s);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new at(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=St(o),u=St(s);if(l.kind!=="string"||u.kind!=="string")return t(a,o,s)}return this.collator?r(a,o,s,this.collator.evaluate(a)):t(a,o,s)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var Vk=rl("==",Mk,iS),Uk=rl("!=",Ik,Lk),$k=rl("<",kk,Bk),qk=rl(">",zk,Ok),Gk=rl("<=",Fk,jk),Zk=rl(">=",Rk,Nk),aS=class oS{constructor(t,r,i){this.type=rf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");let i=t[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,xe);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,xe);if(!a)return null;let o=null;return i.locale&&(o=r.parse(i.locale,1,fe),!o)?null:new oS(n,a,o)}evaluate(t){return new j_(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}},Hk=class sS{constructor(t,r,i,n,a,o){this.type=fe,this.number=t,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=o}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");let i=r.parse(t[1],1,U);if(!i)return null;let n=t[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,fe),!a))return null;let o=null;if(n.currency&&(o=r.parse(n.currency,1,fe),!o))return null;let s=null;if(n.unit&&(s=r.parse(n.unit,1,fe),!s))return null;if(o&&s)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,U),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,U),!u)?null:new sS(i,a,o,s,l,u)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}},Wk=class lS{constructor(t){this.type=mc,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");let i=r.parse(t[1],1,fe);return i?new lS(i):r.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),i=gn.fromString(r);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(r)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}},Yk=class uS{constructor(t,r){this.input=t,this.key=r,this.type=U}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=r.parse(t[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${pt(i.type)} instead.`):new uS(i,r.key):null}evaluate(t){let r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new at(`Expected value to be of type string or array, but found ${pt(St(r))} instead.`,this.key)}eachChild(t){t(this.input)}outputDefined(){return!1}},fn=8192;function Xk(e,t){let r=Kk(e[0]),i=Jk(e[1]),n=2**t.z;return[Math.round(r*n*fn),Math.round(i*n*fn)]}function V_(e,t){let r=2**t.z,i=(e[0]/fn+t.x)/r,n=(e[1]/fn+t.y)/r;return[Qk(i),e7(n)]}function Kk(e){return(180+e)/360}function Qk(e){return e*360-180}function Jk(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function e7(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function gc(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Wu(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function t7(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function r7(e,t,r){let i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return i*o-a*n===0&&i*a<=0&&n*o<=0}function uf(e,t,r,i){let n=[t[0]-e[0],t[1]-e[1]];return o7([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(u5(e,t,r,i)&&u5(r,i,e,t))}function i7(e,t,r){for(let i of r)for(let n=0;n<i.length-1;++n)if(uf(e,t,i[n],i[n+1]))return!0;return!1}function il(e,t,r=!1){let i=!1;for(let n of t)for(let a=0;a<n.length-1;a++){if(r7(e,n[a],n[a+1]))return r;t7(e,n[a],n[a+1])&&(i=!i)}return i}function n7(e,t){for(let r of t)if(il(e,r))return!0;return!1}function cS(e,t){for(let r of e)if(!il(r,t))return!1;for(let r=0;r<e.length-1;++r)if(i7(e[r],e[r+1],t))return!1;return!0}function a7(e,t){for(let r of t)if(cS(e,r))return!0;return!1}function o7(e,t){return e[0]*t[1]-e[1]*t[0]}function u5(e,t,r,i){let n=e[0]-r[0],a=e[1]-r[1],o=t[0]-r[0],s=t[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],c=n*u-l*a,h=o*u-l*s;return c>0&&h<0||c<0&&h>0}function U_(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=[];for(let o=0;o<e[n].length;o++){let s=Xk(e[n][o],r);gc(t,s),a.push(s)}i.push(a)}return i}function hS(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=U_(e[n],t,r);i.push(a)}return i}function pS(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){let n=i*.5,a=e[0]-r[0]>n?-i:r[0]-e[0]>n?i:0;a===0&&(a=e[0]-r[2]>n?-i:r[2]-e[0]>n?i:0),e[0]+=a}gc(t,e)}function s7(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function c5(e,t,r,i){let n=2**i.z*fn,a=[i.x*fn,i.y*fn],o=[];for(let s of e)for(let l of s){let u=[l.x+a[0],l.y+a[1]];pS(u,t,r,n),o.push(u)}return o}function h5(e,t,r,i){let n=2**i.z*fn,a=[i.x*fn,i.y*fn],o=[];for(let s of e){let l=[];for(let u of s){let c=[u.x+a[0],u.y+a[1]];gc(t,c),l.push(c)}o.push(l)}if(t[2]-t[0]<=n/2){s7(t);for(let s of o)for(let l of s)pS(l,t,r,n)}return o}function l7(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(t.type==="Polygon"){let a=U_(t.coordinates,i,n),o=c5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!il(s,a))return!1}if(t.type==="MultiPolygon"){let a=hS(t.coordinates,i,n),o=c5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!n7(s,a))return!1}return!0}function u7(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(t.type==="Polygon"){let a=U_(t.coordinates,i,n),o=h5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!cS(s,a))return!1}if(t.type==="MultiPolygon"){let a=hS(t.coordinates,i,n),o=h5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!a7(s,a))return!1}return!0}var $_=class ad{constructor(t,r){this.type=xe,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hs(t[1])){let i=t[1];if(i.type==="FeatureCollection"){let n=[];for(let a of i.features){let{type:o,coordinates:s}=a.geometry;o==="Polygon"&&n.push(s),o==="MultiPolygon"&&n.push(...s)}if(n.length)return new ad(i,{type:"MultiPolygon",coordinates:n})}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new ad(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new ad(i,i)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return l7(t,this.geometries);if(t.geometryType()==="LineString")return u7(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},dS=class{constructor(e=[],t=(r,i)=>r<i?-1:+(r>i)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let a=(e<<1)+1,o=a+1;if(o<this.length&&r(t[o],t[a])<0&&(a=o),r(t[a],n)>=0)break;t[e]=t[a],e=a}t[e]=n}},p5=Math.PI/180,q_=class{constructor(e){let t=p5*6378.137*1e3,r=Math.cos(e*p5),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=t*n*r,this.ky=t*n*i*.9933056200098587}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(e,t){let r=1/0,i,n,a,o;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],c=this.wrap(e[s+1][0]-l)*this.kx,h=(e[s+1][1]-u)*this.ky,p=0;(c!==0||h!==0)&&(p=(this.wrap(t[0]-l)*this.kx*c+(t[1]-u)*this.ky*h)/(c*c+h*h),p>1?(l=e[s+1][0],u=e[s+1][1]):p>0&&(l+=c/this.kx*p,u+=h/this.ky*p)),c=this.wrap(t[0]-l)*this.kx,h=(t[1]-u)*this.ky;let d=c*c+h*h;d<r&&(r=d,i=l,n=u,a=s,o=p)}return{point:[i,n],index:a,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function fS(e,t){return t[0]-e[0]}function Td(e){return e[1]-e[0]+1}function Gn(e,t){return e[1]>=e[0]&&e[1]<t}function oy(e,t){if(e[0]>e[1])return[null,null];let r=Td(e);if(t){if(r===2)return[e,null];let n=Math.floor(r/2);return[[e[0],e[0]+n],[e[0]+n,e[1]]]}if(r===1)return[e,null];let i=Math.floor(r/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function sy(e,t){if(!Gn(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=t[0];i<=t[1];++i)gc(r,e[i]);return r}function ly(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let i of r)gc(t,i);return t}function d5(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function G_(e,t,r){if(!d5(e)||!d5(t))return NaN;let i=0,n=0;return e[2]<t[0]&&(i=t[0]-e[2]),e[0]>t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]<t[1]&&(n=t[1]-e[3]),r.distance([0,0],[i,n])}function co(e,t,r){let i=r.pointOnLine(t,e);return r.distance(e,i.point)}function Z_(e,t,r,i,n){let a=Math.min(co(e,[r,i],n),co(t,[r,i],n)),o=Math.min(co(r,[e,t],n),co(i,[e,t],n));return Math.min(a,o)}function c7(e,t,r,i,n){if(!(Gn(t,e.length)&&Gn(i,r.length)))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let s=e[o],l=e[o+1];for(let u=i[0];u<i[1];++u){let c=r[u],h=r[u+1];if(uf(s,l,c,h))return 0;a=Math.min(a,Z_(s,l,c,h,n))}}return a}function h7(e,t,r,i,n){if(!(Gn(t,e.length)&&Gn(i,r.length)))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let s=i[0];s<=i[1];++s)if(a=Math.min(a,n.distance(e[o],r[s])),a===0)return a;return a}function p7(e,t,r){if(il(e,t,!0))return 0;let i=1/0;for(let n of t){let a=n[0],o=n[n.length-1];if(a!==o&&(i=Math.min(i,co(e,[o,a],r)),i===0))return i;let s=r.pointOnLine(n,e);if(i=Math.min(i,r.distance(e,s.point)),i===0)return i}return i}function d7(e,t,r,i){if(!Gn(t,e.length))return NaN;for(let a=t[0];a<=t[1];++a)if(il(e[a],r,!0))return 0;let n=1/0;for(let a=t[0];a<t[1];++a){let o=e[a],s=e[a+1];for(let l of r)for(let u=0,c=l.length,h=c-1;u<c;h=u++){let p=l[h],d=l[u];if(uf(o,s,p,d))return 0;n=Math.min(n,Z_(o,s,p,d,i))}}return n}function f5(e,t){for(let r of e)for(let i of r)if(il(i,t,!0))return!0;return!1}function f7(e,t,r,i=1/0){let n=ly(e),a=ly(t);if(i!==1/0&&G_(n,a,r)>=i)return i;if(Wu(n,a)){if(f5(e,t))return 0}else if(f5(t,e))return 0;let o=1/0;for(let s of e)for(let l=0,u=s.length,c=u-1;l<u;c=l++){let h=s[c],p=s[l];for(let d of t)for(let f=0,m=d.length,_=m-1;f<m;_=f++){let g=d[_],y=d[f];if(uf(h,p,g,y))return 0;o=Math.min(o,Z_(h,p,g,y,r))}}return o}function m5(e,t,r,i,n,a){if(!a)return;let o=G_(sy(i,a),n,r);o<t&&e.push([o,a,[0,0]])}function kp(e,t,r,i,n,a,o){if(!a||!o)return;let s=G_(sy(i,a),sy(n,o),r);s<t&&e.push([s,a,o])}function Sd(e,t,r,i,n=1/0){let a=Math.min(i.distance(e[0],r[0][0]),n);if(a===0)return a;let o=new dS([[0,[0,e.length-1],[0,0]]],fS),s=ly(r);for(;o.length>0;){let l=o.pop();if(l[0]>=a)continue;let u=l[1],c=t?50:100;if(Td(u)<=c){if(!Gn(u,e.length))return NaN;if(t){let h=d7(e,u,r,i);if(isNaN(h)||h===0)return h;a=Math.min(a,h)}else for(let h=u[0];h<=u[1];++h){let p=p7(e[h],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let h=oy(u,t);m5(o,a,i,e,s,h[0]),m5(o,a,i,e,s,h[1])}}return a}function Ed(e,t,r,i,n,a=1/0){let o=Math.min(a,n.distance(e[0],r[0]));if(o===0)return o;let s=new dS([[0,[0,e.length-1],[0,r.length-1]]],fS);for(;s.length>0;){let l=s.pop();if(l[0]>=o)continue;let u=l[1],c=l[2],h=t?50:100,p=i?50:100;if(Td(u)<=h&&Td(c)<=p){if(!Gn(u,e.length)&&Gn(c,r.length))return NaN;let d;if(t&&i)d=c7(e,u,r,c,n),o=Math.min(o,d);else if(t&&!i){let f=e.slice(u[0],u[1]+1);for(let m=c[0];m<=c[1];++m)if(d=co(r[m],f,n),o=Math.min(o,d),o===0)return o}else if(!t&&i){let f=r.slice(c[0],c[1]+1);for(let m=u[0];m<=u[1];++m)if(d=co(e[m],f,n),o=Math.min(o,d),o===0)return o}else d=h7(e,u,r,c,n),o=Math.min(o,d)}else{let d=oy(u,t),f=oy(c,i);kp(s,o,n,e,r,d[0],f[0]),kp(s,o,n,e,r,d[0],f[1]),kp(s,o,n,e,r,d[1],f[0]),kp(s,o,n,e,r,d[1],f[1])}}return o}function m7(e,t){let r=e.geometry(),i=r.flat().map(o=>V_([o.x,o.y],e.canonical));if(r.length===0)return NaN;let n=new q_(i[0][1]),a=1/0;for(let o of t){switch(o.type){case"Point":a=Math.min(a,Ed(i,!1,[o.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ed(i,!1,o.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Sd(i,!1,o.coordinates,n,a))}if(a===0)return a}return a}function g7(e,t){let r=e.geometry(),i=r.flat().map(o=>V_([o.x,o.y],e.canonical));if(r.length===0)return NaN;let n=new q_(i[0][1]),a=1/0;for(let o of t){switch(o.type){case"Point":a=Math.min(a,Ed(i,!0,[o.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ed(i,!0,o.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Sd(i,!0,o.coordinates,n,a))}if(a===0)return a}return a}function y7(e,t){let r=e.geometry();if(r.length===0||r[0].length===0)return NaN;let i=lf(r,0).map(o=>o.map(s=>s.map(l=>V_([l.x,l.y],e.canonical)))),n=new q_(i[0][0][0][1]),a=1/0;for(let o of t)for(let s of i){switch(o.type){case"Point":a=Math.min(a,Sd([o.coordinates],!1,s,n,a));break;case"LineString":a=Math.min(a,Sd(o.coordinates,!0,s,n,a));break;case"Polygon":a=Math.min(a,f7(s,o.coordinates,n,a))}if(a===0)return a}return a}function l1(e){return e.type==="MultiPolygon"?e.coordinates.map(t=>({type:"Polygon",coordinates:t})):e.type==="MultiLineString"?e.coordinates.map(t=>({type:"LineString",coordinates:t})):e.type==="MultiPoint"?e.coordinates.map(t=>({type:"Point",coordinates:t})):[e]}var H_=class od{constructor(t,r){this.type=U,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hs(t[1])){let i=t[1];if(i.type==="FeatureCollection")return new od(i,i.features.map(n=>l1(n.geometry)).flat());if(i.type==="Feature")return new od(i,l1(i.geometry));if("type"in i&&"coordinates"in i)return new od(i,l1(i))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return m7(t,this.geometries);if(t.geometryType()==="LineString")return g7(t,this.geometries);if(t.geometryType()==="Polygon")return y7(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},_7=class mS{constructor(t){let r=null;for(let i of t)if(!r)r=i.type;else{if(r===i.type)continue;r=ge;break}this.type=mr(r??ge,t.length),this.arr=t}static parse(t,r){if(t.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Hs(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let i=t[1],n=St(i);if(n.kind==="array"){let a=i,o=r.concat(1),s=[];for(let l=0;l<a.length;l++){let u=o.parse(a[l],l,ge);if(!u)return null;s.push(u)}return new mS(s)}return new Ws(n,i)}evaluate(t){return this.arr.map(r=>r.evaluate(t))}eachChild(t){this.arr.forEach(t)}outputDefined(){return this.arr.every(t=>t.outputDefined())}},W_=class gS{constructor(t){this.key=t,this.type=ge}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=t[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new gS(i):r.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(t){let r=t.globals?.globalState;return!r||Object.keys(r).length===0?null:Ru(r,this.key)??null}eachChild(){}outputDefined(){return!1}},Ls={"==":Vk,"!=":Uk,">":qk,"<":$k,">=":Zk,"<=":Gk,array:Bn,at:Sk,boolean:Bn,case:Dk,coalesce:rS,collator:aS,format:$T,image:Wk,in:Ek,"index-of":Ck,interpolate:Si,"interpolate-hcl":Si,"interpolate-lab":Si,length:Yk,let:WT,literal:Ws,match:Pk,number:Bn,"number-format":Hk,object:Bn,semiliteral:_7,slice:Ak,step:N_,string:Bn,"to-boolean":ks,"to-color":ks,"to-number":ks,"to-string":ks,var:XT,within:$_,distance:H_,"global-state":W_},cn=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},v7=class yS{constructor(t,r=[]){this.parent=t,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(t){return new yS(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw Error(`${t} not found in scope.`)}has(t){return this.bindings[t]?!0:this.parent?this.parent.has(t):!1}},_S=class vS{constructor(t,r,i=[],n,a=new v7,o=[]){this.registry=t,this.path=i,this.key=i.map(s=>`[${s}]`).join(""),this.scope=a,this.errors=o,this.expectedType=n,this._isConstant=r}parse(t,r,i,n,a={}){return r==null?this._parse(t,a):this.concat(r,i,n)._parse(t,a)}_parse(t,r){(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number")&&(t=["literal",t]);let i=this.key;function n(a,o,s){return s==="assert"?new Bn(o,[a],i):s==="coerce"?new ks(o,[a],i):a}if(Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let a=t[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[a];if(o){let s=o.parse(t,this);if(!s)return null;if(this.expectedType){let l=this.expectedType,u=s.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")s=n(s,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))s=n(s,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(s instanceof Ws)&&s.type.kind!=="resolvedImage"&&this._isConstant(s)){let l=new VT;try{s=new Ws(s.type,s.evaluate(l))}catch(u){return this.error(u.message),null}}return s}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return t===void 0?this.error("'undefined' value invalid. Use null instead."):typeof t=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,r,i){let n=typeof t=="number"?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new vS(this.registry,this._isConstant,n,r||null,a,this.errors)}error(t,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new cn(i,t))}checkSubtype(t,r){let i=Hu(t,r);return i&&this.error(i),i}},Mo=class Mu{constructor(t,r,i,n,a){this.name=t,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(t){return this._evaluate(t,this.args,this.key)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){let i=t[0],n=Mu.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(([u])=>!Array.isArray(u)||u.length===t.length-1),l=null;for(let[u,c]of s){l=new _S(r.registry,Cd,r.path,null,r.scope);let h=[],p=!1;for(let d=1;d<t.length;d++){let f=t[d],m=Array.isArray(u)?u[d-1]:u.type,_=l.parse(f,1+h.length,m);if(!_){p=!0;break}h.push(_)}if(!p)if(Array.isArray(u)&&u.length!==h.length)l.error(`Expected ${u.length} arguments, but found ${h.length} instead.`);else{for(let d=0;d<h.length;d++){let f=Array.isArray(u)?u[d]:u.type,m=h[d];l.concat(d+1).checkSubtype(f,m.type)}if(l.errors.length===0)return new Mu(i,a,c,h,r.key)}}if(s.length===1)r.errors.push(...l.errors);else{let u=(s.length?s:o).map(([h])=>b7(h)).join(" | "),c=[];for(let h=1;h<t.length;h++){let p=r.parse(t[h],1+c.length);if(!p)return null;c.push(pt(p.type))}r.error(`Expected arguments of type ${u}, but found (${c.join(", ")}) instead.`)}return null}static register(t,r){Mu.definitions=r;for(let i in r)t[i]=Mu}};function g5(e,[t,r,i,n],a){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let o=n?n.evaluate(e):1,s=jT(t,r,i,o);if(s)throw new at(s,a);return new he(t/255,r/255,i/255,o,!1)}function y5(e,t){return e in t&&t[e]!==void 0}function u1(e,t){let r=t[e];return r===void 0?null:r}function x7(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}function ao(e){return{type:e}}Mo.register(Ls,{error:[ok,[fe],(e,[t],r)=>{throw new at(t.evaluate(e),r)}],typeof:[fe,[ge],(e,[t])=>pt(St(t.evaluate(e)))],"to-rgba":[mr(U,4),[$i],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[r*255,i*255,n*255,a]}],rgb:[$i,[U,U,U],g5],rgba:[$i,[U,U,U,U],g5],has:{type:xe,overloads:[[[fe],(e,[t])=>y5(t.evaluate(e),e.properties())],[[fe,mo],(e,[t,r])=>y5(t.evaluate(e),r.evaluate(e))]]},get:{type:ge,overloads:[[[fe],(e,[t])=>u1(t.evaluate(e),e.properties())],[[fe,mo],(e,[t,r])=>u1(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ge,[fe],(e,[t])=>u1(t.evaluate(e),e.featureState||{})],properties:[mo,[],e=>e.properties()],"geometry-type":[fe,[],e=>e.geometryType()],id:[ge,[],e=>e.id()],zoom:[U,[],e=>e.globals.zoom],"heatmap-density":[U,[],e=>e.globals.heatmapDensity||0],elevation:[U,[],e=>e.globals.elevation||0],"line-progress":[U,[],e=>e.globals.lineProgress||0],accumulated:[ge,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[U,ao(U),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[U,ao(U),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:U,overloads:[[[U,U],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[U],(e,[t])=>-t.evaluate(e)]]},"/":[U,[U,U],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[U,[U,U],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[U,[],()=>Math.LN2],pi:[U,[],()=>Math.PI],e:[U,[],()=>Math.E],"^":[U,[U,U],(e,[t,r])=>t.evaluate(e)**+r.evaluate(e)],sqrt:[U,[U],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[U,[U],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[U,[U],(e,[t])=>Math.log(t.evaluate(e))],log2:[U,[U],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[U,[U],(e,[t])=>Math.sin(t.evaluate(e))],cos:[U,[U],(e,[t])=>Math.cos(t.evaluate(e))],tan:[U,[U],(e,[t])=>Math.tan(t.evaluate(e))],asin:[U,[U],(e,[t])=>Math.asin(t.evaluate(e))],acos:[U,[U],(e,[t])=>Math.acos(t.evaluate(e))],atan:[U,[U],(e,[t])=>Math.atan(t.evaluate(e))],min:[U,ao(U),(e,t)=>Math.min(...t.map(r=>r.evaluate(e)))],max:[U,ao(U),(e,t)=>Math.max(...t.map(r=>r.evaluate(e)))],abs:[U,[U],(e,[t])=>Math.abs(t.evaluate(e))],round:[U,[U],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[U,[U],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[U,[U],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[xe,[fe,ge],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[xe,[ge],(e,[t])=>e.id()===t.value],"filter-type-==":[xe,[fe],(e,[t])=>e.geometryType()===t.value],"filter-<":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[xe,[ge],(e,[t])=>{let r=t.value,i=e.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[xe,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[xe,[mr(fe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[xe,[mr(ge)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[xe,[fe,mr(ge)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[xe,[fe,mr(ge)],(e,[t,r])=>x7(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:xe,overloads:[[[xe,xe],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[ao(xe),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:xe,overloads:[[[xe,xe],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[ao(xe),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[xe,[xe],(e,[t])=>!t.evaluate(e)],"is-supported-script":[xe,[fe],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[fe,[fe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[fe,[fe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[fe,ao(ge),(e,t)=>t.map(r=>Lu(r.evaluate(e))).join("")],split:[mr(fe),[fe,fe],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[fe,[mr(fe),fe],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[fe,[rf],(e,[t])=>t.evaluate(e).resolvedLocale()]});function b7(e){return Array.isArray(e)?`(${e.map(pt).join(", ")})`:`(${pt(e.type)}...)`}function Cd(e){if(e instanceof XT)return Cd(e.boundExpression);if(e instanceof Mo&&e.name==="error"||e instanceof aS||e instanceof $_||e instanceof H_||e instanceof W_)return!1;let t=e instanceof ks||e instanceof Bn,r=!0;return e.eachChild(i=>{r&&(r=t?Cd(i):i instanceof Ws)}),r?cf(e)&&hf(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function cf(e){if(e instanceof Mo&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof $_||e instanceof H_)return!1;let t=!0;return e.eachChild(r=>{t&&!cf(r)&&(t=!1)}),t}function Yu(e){if(e instanceof Mo&&e.name==="feature-state")return!1;let t=!0;return e.eachChild(r=>{t&&!Yu(r)&&(t=!1)}),t}function hf(e,t){if(e instanceof Mo&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(i=>{r&&!hf(i,t)&&(r=!1)}),r}function Ys(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function xS(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Y_(e){return!!e.expression&&e.expression.interpolated}var X_=/^(.*)-transition$/;function Xu(e,...t){for(let r of t)for(let i in r)e[i]=r[i];return e}function ve(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function pf(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&St(e)===mo}function w7(e){return e}function T7(e){switch(e.type){case"color":return he.parse;case"padding":return _n.parse;case"numberArray":return vn.parse;case"colorArray":return Ti.parse;default:return null}}function S7(e){switch(e){case"exponential":return wS;case"interval":return C7;case"categorical":return E7;case"identity":return P7;default:throw Error(`Unknown function type "${e}"`)}}function bS(e,t){let r=e.stops&&typeof e.stops[0][0]=="object",i=r||e.property!==void 0,n=r||!i,a=e.type||(Y_(t)?"exponential":"interval"),o=T7(t);if(o&&(e=Xu({},e),e.stops&&(e.stops=e.stops.map(c=>[c[0],o(c[1])])),e.default?e.default=o(e.default):e.default=o(t.default)),e.colorSpace&&!gk(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let s=S7(a),l,u;if(a==="categorical"){l=Object.create(null);for(let c of e.stops)l[c[0]]=c[1];u=typeof e.stops[0][0]}if(r){let c={},h=[];for(let f=0;f<e.stops.length;f++){let m=e.stops[f],_=m[0].zoom;c[_]===void 0&&(c[_]={zoom:_,type:e.type,property:e.property,default:e.default,stops:[]},h.push(_)),c[_].stops.push([m[0].value,m[1]])}let p=[];for(let f of h)p.push([c[f].zoom,bS(c[f],t)]);let d={name:"linear"};return{kind:"composite",interpolationType:d,interpolationFactor:Si.interpolationFactor.bind(void 0,d),zoomStops:p.map(f=>f[0]),evaluate({zoom:f},m){return wS({stops:p,base:e.base},t,f).evaluate(f,m)}}}if(n){let c=a==="exponential"?{name:"exponential",base:e.base===void 0?1:e.base}:null;return{kind:"camera",interpolationType:c,interpolationFactor:Si.interpolationFactor.bind(void 0,c),zoomStops:e.stops.map(h=>h[0]),evaluate:({zoom:h})=>s(e,t,h,l,u)}}return{kind:"source",evaluate(c,h){let p=h&&h.properties?h.properties[e.property]:void 0;return p===void 0?yc(e.default,t.default):s(e,t,p,l,u)}}}function yc(e,t,r){if(e!==void 0)return e;if(t!==void 0)return t;if(r!==void 0)return r}function E7(e,t,r,i,n){return yc(typeof r===n?i[r]:void 0,e.default,t.default)}function C7(e,t,r){if(ve(r)!=="number")return yc(e.default,t.default);let i=e.stops.length;if(i===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=sf(e.stops.map(a=>a[0]),r,"");return e.stops[n][1]}function wS(e,t,r){let i=e.base===void 0?1:e.base;if(ve(r)!=="number")return yc(e.default,t.default);let n=e.stops.length;if(n===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let a=sf(e.stops.map(c=>c[0]),r,""),o=D7(r,i,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],u=ot[t.type]||w7;return typeof s.evaluate=="function"?{evaluate(...c){let h=s.evaluate.apply(void 0,c),p=l.evaluate.apply(void 0,c);if(h!==void 0&&p!==void 0)return u(h,p,o,e.colorSpace)}}:u(s,l,o,e.colorSpace)}function P7(e,t,r){switch(t.type){case"color":r=he.parse(r);break;case"formatted":r=qn.fromString(r.toString());break;case"resolvedImage":r=gn.fromString(r.toString());break;case"padding":r=_n.parse(r);break;case"colorArray":r=Ti.parse(r);break;case"numberArray":r=vn.parse(r);break;default:ve(r)!==t.type&&(t.type!=="enum"||!t.values[r])&&(r=void 0)}return yc(r,e.default,t.default)}function D7(e,t,r,i){let n=i-r,a=e-r;return n===0?0:t===1?a/n:(t**+a-1)/(t**+n-1)}function uy(e){return{result:"success",value:e}}function Ds(e){return{result:"error",value:e}}var K_=class{constructor(e,t,r,i){this.expression=e,this._warningHistory={},this._evaluator=new VT,this._defaultValue=r?DS(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=t}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._globalState&&(e=Xs(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let o=this.expression.evaluate(this._evaluator);if(o==null||typeof o=="number"&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new at(`Expected value to be one of ${Object.keys(this._enumValues).map(s=>JSON.stringify(s)).join(", ")}, but found ${JSON.stringify(o)} instead.`,"");return o}catch(o){let s=o instanceof at?o.path:"",l=`${s}|${o.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(TS(this._rootKey,s,o.message,this._defaultValue))),this._defaultValue}}};function TS(e,t,r,i){return`${e}${t}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function SS(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function df(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Ls}function ff(e,t,r,i){SS(t);let n=new _S(Ls,Cd,[],r?I7(r):void 0),a=n.parse(e,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?uy(new K_(a,t,r,i)):Ds(n.errors)}var Ku=class{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Yu(t.expression),this.globalStateRefs=_c(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}},Pd=class{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Yu(t.expression),this.globalStateRefs=_c(t.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?Si.interpolationFactor(this.interpolationType,e,t,r):0}};function A7(e){return e._styleExpression!==void 0}function ES(e,t,r,i){let n=ff(e,t,r,i);if(n.result==="error")return n;let a=n.value.expression,o=cf(a);if(!o&&!Ys(r))return Ds([new cn("","data expressions not supported")]);let s=hf(a,["zoom"]);if(!s&&!xS(r))return Ds([new cn("","zoom expressions not supported")]);let l=sd(a);if(!l&&!s)return Ds([new cn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof cn)return Ds([l]);if(l instanceof Si&&!Y_(r))return Ds([new cn("",'"interpolate" expressions cannot be used with this property')]);if(!l)return uy(o?new Ku("constant",n.value,i):new Ku("source",n.value,i));let u=l instanceof Si?l.interpolation:void 0;return uy(o?new Pd("camera",n.value,l.labels,u,i):new Pd("composite",n.value,l.labels,u,i))}var CS=class PS{constructor(t,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,SS(r),this._parameters=t,this._specification=i,this._rootKey=r,this._defaultValue=DS(i),this._warningHistory={};let n=bS(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(t,r){try{return this._innerEvaluate(t,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(TS(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(t){return new PS(t._parameters,t._rootKey,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification,_rootKey:t._rootKey}}};function M7(e,t,r,i){if(pf(e))return new CS(e,t,r);if(df(e)){let n=ES(e,t,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=e;return r.type==="color"&&typeof e=="string"?n=he.parse(e):r.type==="padding"&&(typeof e=="number"||Array.isArray(e))?n=_n.parse(e):r.type==="numberArray"&&(typeof e=="number"||Array.isArray(e))?n=vn.parse(e):r.type==="colorArray"&&(typeof e=="string"||Array.isArray(e))?n=Ti.parse(e):r.type==="variableAnchorOffsetCollection"&&Array.isArray(e)?n=mn.parse(e):r.type==="projectionDefinition"&&typeof e=="string"&&(n=ja.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function sd(e){let t=null;if(e instanceof WT)t=sd(e.result);else if(e instanceof rS){for(let r of e.args)if(t=sd(r),t)break}else(e instanceof N_||e instanceof Si)&&e.input instanceof Mo&&e.input.name==="zoom"&&(t=e);return t instanceof cn||e.eachChild(r=>{let i=sd(r);i instanceof cn?t=i:!t&&i?t=new cn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&i&&t!==i&&(t=new cn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function _c(e,t=new Set){return e instanceof W_&&t.add(e.key),e.eachChild(r=>{_c(r,t)}),t}function I7(e){let t={color:$i,string:fe,number:U,enum:fe,boolean:xe,formatted:fc,padding:nf,numberArray:af,colorArray:Zu,projectionDefinition:tf,resolvedImage:mc,variableAnchorOffsetCollection:of};return e.type==="array"?mr(t[e.value]||ge,e.length):t[e.type]}function DS(e){if(e.type==="color"&&pf(e.default))return new he(0,0,0,0);switch(e.type){case"color":return he.parse(e.default)||null;case"padding":return _n.parse(e.default)||null;case"numberArray":return vn.parse(e.default)||null;case"colorArray":return Ti.parse(e.default)||null;case"variableAnchorOffsetCollection":return mn.parse(e.default)||null;case"projectionDefinition":return ja.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function Xs(e,t){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s}=e??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s,globalState:t}}function k7(e){let t=!1;for(let r of e){let i=AS(r);if(i==="expression")return"expression";i==="legacy"&&(t=!0)}return t?"legacy":"neutral"}function AS(e){if(typeof e=="boolean")return"neutral";if(!Array.isArray(e)||e.length===0)return"legacy";switch(e[0]){case"has":return e.length<2||e[1]==="$id"||e[1]==="$type"?"legacy":e.length===2?"neutral":"expression";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return k7(e.slice(1));default:return"expression"}}function Q_(e){return AS(e)!=="legacy"}function _5(e){return e==="$type"?["geometry-type"]:e==="$id"?["id"]:["get",e]}function z7(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return e.length!==3||typeof e[1]!="string"?null:[e[0],_5(e[1]),e[2]];case"in":case"!in":{if(e.length<2||typeof e[1]!="string")return null;let t=["in",_5(e[1]),["literal",e.slice(2)]];return e[0]==="!in"?["!",t]:t}case"has":case"!has":{if(e.length!==2||typeof e[1]!="string"||e[1]==="$type"||e[1]==="$id")return null;let t=["has",e[1]];return e[0]==="!has"?["!",t]:t}default:return null}}function MS(e){if((e[0]==="<"||e[0]==="<="||e[0]===">"||e[0]===">=")&&e[1]==="$type")return`"$type" cannot be use with operator "${e[0]}"`;let t=z7(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function c1(e,t,r){let i=r[e];return Array.isArray(i)?Q_(i)?J_(i,t.concat(e)):{path:t.concat(e),legacyFilter:i}:null}function J_(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let r=1;r<e.length;r++){let i=c1(r,t,e);if(i)return i}break;case"!":{let r=c1(1,t,e);if(r)return r;break}case"case":for(let r=1;r<e.length-1;r+=2){let i=c1(r,t,e);if(i)return i}}return null}function F7(e,t){let r=J_(e);if(!r||typeof console>"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${t}${i}: ${MS(r.legacyFilter)}`)}var R7={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Qu(e,t,r){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Q_(e)?F7(e,t):e=Dd(e);let i=ff(e,t,R7,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,o)=>i.value.evaluate(n,a,{},o),needGeometry:IS(e),getGlobalStateRefs:()=>_c(i.value.expression)}}function L7(e,t){return e<t?-1:+(e>t)}function IS(e){if(!Array.isArray(e))return!1;if(e[0]==="within"||e[0]==="distance")return!0;for(let t=1;t<e.length;t++)if(IS(e[t]))return!0;return!1}function Dd(e){if(!e)return!0;let t=e[0];return e.length<=1?t!=="any":t==="=="?h1(e[1],e[2],"=="):t==="!="?zp(h1(e[1],e[2],"==")):t==="<"||t===">"||t==="<="||t===">="?h1(e[1],e[2],t):t==="any"?B7(e.slice(1)):t==="all"?["all"].concat(e.slice(1).map(Dd)):t==="none"?["all"].concat(e.slice(1).map(Dd).map(zp)):t==="in"?v5(e[1],e.slice(2)):t==="!in"?zp(v5(e[1],e.slice(2))):t==="has"?x5(e[1]):t!=="!has"||zp(x5(e[1]))}function h1(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function B7(e){return["any"].concat(e.map(Dd))}function v5(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",e,["literal",t.sort(L7)]]:["filter-in-small",e,["literal",t]]}}function x5(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function zp(e){return["!",e]}function O7(){let e={},t=z.$version;for(let r in z.$root){let i=z.$root[r];if(i.required){let n=null;n=r==="version"?t:i.type==="array"?[]:{},n!=null&&(e[r]=n)}}return e}function kS(e){let t=e.key,r=e.value;return r?[new B(t,r,"constants have been deprecated as of v8")]:[]}function wt(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function wo(e){if(Array.isArray(e))return e.map(wo);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=wo(e[r]);return t}return wt(e)}function ti(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,l=[],u=ve(r);if(u!=="object")return[new B(t,r,`object expected, ${u} found`)];for(let c in r){let h=c.split(".")[0],p=Ru(i,h)||i["*"],d;if(Ru(n,h))d=n[h];else if(Ru(i,h)){if(r[c]===void 0)continue;d=s}else if(n["*"])d=n["*"];else if(i["*"])d=s;else{l.push(new B(t,r[c],`unknown property "${c}"`));continue}l=l.concat(d({key:(t&&`${t}.`)+c,value:r[c],valueSpec:p,style:a,styleSpec:o,object:r,objectKey:c,validateSpec:s},r))}for(let c in i)n[c]||i[c].required&&i[c].default===void 0&&r[c]===void 0&&l.push(new B(t,r,`missing required property "${c}"`));return l}function ev(e){let t=e.value,r=e.valueSpec,i=e.validateSpec,n=e.style,a=e.styleSpec,o=e.key,s=e.arrayElementValidator||i;if(ve(t)!=="array")return[new B(o,t,`array expected, ${ve(t)} found`)];if(r.length&&t.length!==r.length)return[new B(o,t,`array length ${r.length} expected, length ${t.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),ve(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<t.length;c++)u=u.concat(s({array:t,arrayIndex:c,value:t[c],valueSpec:l,validateSpec:e.validateSpec,style:n,styleSpec:a,key:`${o}[${c}]`}));return u}function mf(e){let t=e.key,r=e.value,i=e.valueSpec,n=ve(r);return n==="number"&&r!==r&&(n="NaN"),n==="number"?"minimum"in i&&r<i.minimum?[new B(t,r,`${r} is less than the minimum value ${i.minimum}`)]:"maximum"in i&&r>i.maximum?[new B(t,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new B(t,r,`number expected, ${n} found`)]}function zS(e){let t=e.valueSpec,r=wt(e.value.type),i,n={},a,o,s=r!=="categorical"&&e.value.property===void 0,l=!s,u=ve(e.value.stops)==="array"&&ve(e.value.stops[0])==="array"&&ve(e.value.stops[0][0])==="object",c=ti({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:h,default:f}});return r==="identity"&&s&&c.push(new B(e.key,e.value,'missing required property "property"')),r!=="identity"&&!e.value.stops&&c.push(new B(e.key,e.value,'missing required property "stops"')),r==="exponential"&&e.valueSpec.expression&&!Y_(e.valueSpec)&&c.push(new B(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Ys(e.valueSpec)?c.push(new B(e.key,e.value,"property functions not supported")):s&&!xS(e.valueSpec)&&c.push(new B(e.key,e.value,"zoom functions not supported"))),(r==="categorical"||u)&&e.value.property===void 0&&c.push(new B(e.key,e.value,'"property" property is required')),c;function h(m){if(r==="identity")return[new B(m.key,m.value,'identity function may not have a "stops" property')];let _=[],g=m.value;return _=_.concat(ev({key:m.key,value:g,valueSpec:m.valueSpec,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,arrayElementValidator:p})),ve(g)==="array"&&g.length===0&&_.push(new B(m.key,g,"array must have at least one stop")),_}function p(m){let _=[],g=m.value,y=m.key;if(ve(g)!=="array")return[new B(y,g,`array expected, ${ve(g)} found`)];if(g.length!==2)return[new B(y,g,`array length 2 expected, length ${g.length} found`)];if(u){if(ve(g[0])!=="object")return[new B(y,g,`object expected, ${ve(g[0])} found`)];if(g[0].zoom===void 0)return[new B(y,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new B(y,g,"object stop key must have value")];if(o&&o>wt(g[0].zoom))return[new B(y,g[0].zoom,"stop zoom values must appear in ascending order")];wt(g[0].zoom)!==o&&(o=wt(g[0].zoom),a=void 0,n={}),_=_.concat(ti({key:`${y}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,objectElementValidators:{zoom:mf,value:d}}))}else _=_.concat(d({key:`${y}[0]`,value:g[0],valueSpec:{},validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec},g));return df(wo(g[1]))?_.concat([new B(`${y}[1]`,g[1],"expressions are not allowed in function stops.")]):_.concat(m.validateSpec({key:`${y}[1]`,value:g[1],valueSpec:t,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec}))}function d(m,_){let g=ve(m.value),y=wt(m.value),v=m.value===null?_:m.value;if(!i)i=g;else if(g!==i)return[new B(m.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new B(m.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let x=`number expected, ${g} found`;return Ys(t)&&r===void 0&&(x+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new B(m.key,v,x)]}return r==="categorical"&&g==="number"&&(!isFinite(y)||Math.floor(y)!==y)?[new B(m.key,v,`integer expected, found ${y}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&y<a?[new B(m.key,v,"stop domain values must appear in ascending order")]:(a=y,r==="categorical"&&y in n?[new B(m.key,v,"stop domain values must be unique")]:(n[y]=!0,[]))}function f(m){return m.validateSpec({key:m.key,value:m.value,valueSpec:t,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec})}}function Ks(e){let t=(e.expressionContext==="property"?ES:ff)(wo(e.value),e.key,e.valueSpec);if(t.result==="error")return t.value.map(i=>new B(`${e.key}${i.key}`,e.value,i.message));let r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new B(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Yu(r))return[new B(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Yu(r))return[new B(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!hf(r,["zoom","feature-state"]))return[new B(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!cf(r))return[new B(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function j7(e){let t=e.value,r=e.key,i=ve(t);return i==="boolean"?[]:[new B(r,t,`boolean expected, ${i} found`)]}function cy(e){let t=e.key,r=e.value,i=ve(r);return i==="string"?he.parse(String(r))?[]:[new B(t,r,`color expected, "${r}" found`)]:[new B(t,r,`color expected, ${i} found`)]}function Ju(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(wt(r))===-1&&n.push(new B(t,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(wt(r))===-1&&n.push(new B(t,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function N7(e,t){let r=e;for(let i of t)r=r[i];return r}function V7(e,t){let r=J_(t);return r?[new B(`${e.key}${r.path.map(i=>`[${i}]`).join("")}`,N7(e.value,r.path),MS(r.legacyFilter),null,"warning")]:[]}function tv(e){let t=wo(e.value);return Q_(t)?[...V7(e,t),...Ks(Xu({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:FS(e)}function FS(e){let t=e.value,r=e.key;if(ve(t)!=="array")return[new B(r,t,`array expected, ${ve(t)} found`)];let i=e.styleSpec,n,a=[];if(t.length<1)return[new B(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Ju({key:`${r}[0]`,value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),wt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&wt(t[1])==="$type"&&a.push(new B(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&a.push(new B(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(n=ve(t[1]),n!=="string"&&a.push(new B(`${r}[1]`,t[1],`string expected, ${n} found`)));for(let o=2;o<t.length;o++)n=ve(t[o]),wt(t[1])==="$type"?a=a.concat(Ju({key:`${r}[${o}]`,value:t[o],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):n!=="string"&&n!=="number"&&n!=="boolean"&&a.push(new B(`${r}[${o}]`,t[o],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let o=1;o<t.length;o++)a=a.concat(FS({key:`${r}[${o}]`,value:t[o],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=ve(t[1]),t.length===2?n!=="string"&&a.push(new B(`${r}[1]`,t[1],`string expected, ${n} found`)):a.push(new B(r,t,`filter array for "${t[0]}" operator must have 2 elements`))}return a}function RS(e,t){let r=e.key,i=e.validateSpec,n=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,l=a[`${t}_${e.layerType}`];if(!l)return[];let u=s.match(X_);if(t==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:o,valueSpec:a.transition,style:n,styleSpec:a});let c=e.valueSpec||l[s];if(!c)return[new B(r,o,`unknown property "${s}"`)];let h;if(ve(o)==="string"&&Ys(c)&&!c.tokens&&(h=/^{([^}]+)}$/.exec(o)))return[new B(r,o,`"${s}" does not support interpolation syntax
8
+ `+a.stack}return{value:e,source:t,stack:n,digest:null}}function og(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ug(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var hM=typeof WeakMap=="function"?WeakMap:Map;function u3(e,t,r){r=Pn(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){np||(np=!0,Qg=i),Ug(e,t)},r}function c3(e,t,r){r=Pn(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var n=t.value;r.payload=function(){return i(n)},r.callback=function(){Ug(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Ug(e,t),typeof i!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function bb(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new hM;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(n.add(r),e=EM.bind(null,e,t,r),t.then(e,e))}function wb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Tb(e,t,r,i,n){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Pn(-1,1),t.tag=2,ha(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=n,e)}var pM=kn.ReactCurrentOwner,kr=!1;function br(e,t,r,i){t.child=e===null?jw(t,null,r,i):fs(t,e.child,r,i)}function Sb(e,t,r,i,n){r=r.render;var a=t.ref;return us(t,n),i=M0(e,t,r,i,a,n),r=I0(),e!==null&&!kr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,In(e,t,n)):(lt&&r&&_0(t),t.flags|=1,br(e,t,i,n),t.child)}function Eb(e,t,r,i,n){if(e===null){var a=r.type;return typeof a=="function"&&!V0(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,h3(e,t,a,i,n)):(e=Bh(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&n)===0){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:ru,r(o,i)&&e.ref===t.ref)return In(e,t,n)}return t.flags|=1,e=fa(a,i),e.ref=t.ref,e.return=t,t.child=e}function h3(e,t,r,i,n){if(e!==null){var a=e.memoizedProps;if(ru(a,i)&&e.ref===t.ref)if(kr=!1,t.pendingProps=i=a,(e.lanes&n)!==0)(e.flags&131072)!==0&&(kr=!0);else return t.lanes=e.lanes,In(e,t,n)}return $g(e,t,r,i,n)}function p3(e,t,r){var i=t.pendingProps,n=i.children,a=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(ns,qr),qr|=r;else{if((r&1073741824)===0)return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Qe(ns,qr),qr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=a!==null?a.baseLanes:r,Qe(ns,qr),qr|=i}else a!==null?(i=a.baseLanes|r,t.memoizedState=null):i=r,Qe(ns,qr),qr|=i;return br(e,t,n,r),t.child}function d3(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function $g(e,t,r,i,n){var a=Fr(r)?Qa:fr.current;return a=ps(t,a),us(t,n),r=M0(e,t,r,i,a,n),i=I0(),e!==null&&!kr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,In(e,t,n)):(lt&&i&&_0(t),t.flags|=1,br(e,t,r,n),t.child)}function Cb(e,t,r,i,n){if(Fr(r)){var a=!0;Wh(t)}else a=!1;if(us(t,n),t.stateNode===null)Fh(e,t),l3(t,r,i),Vg(t,r,i,n),i=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=pi(u):(u=Fr(r)?Qa:fr.current,u=ps(t,u));var c=r.getDerivedStateFromProps,h=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==i||l!==u)&&xb(t,o,i,u),ra=!1;var p=t.memoizedState;o.state=p,Jh(t,i,o,n),l=t.memoizedState,s!==i||p!==l||zr.current||ra?(typeof c=="function"&&(Ng(t,r,c,i),l=t.memoizedState),(s=ra||vb(t,r,s,i,p,l,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),o.props=i,o.state=l,o.context=u,i=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Vw(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:ki(t.type,s),o.props=u,h=t.pendingProps,p=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=pi(l):(l=Fr(r)?Qa:fr.current,l=ps(t,l));var d=r.getDerivedStateFromProps;(c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==h||p!==l)&&xb(t,o,i,l),ra=!1,p=t.memoizedState,o.state=p,Jh(t,i,o,n);var f=t.memoizedState;s!==h||p!==f||zr.current||ra?(typeof d=="function"&&(Ng(t,r,d,i),f=t.memoizedState),(u=ra||vb(t,r,u,i,p,f,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,f,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,f,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=f),o.props=i,o.state=f,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),i=!1)}return qg(e,t,r,i,a,n)}function qg(e,t,r,i,n,a){d3(e,t);var o=(t.flags&128)!==0;if(!i&&!o)return n&&hb(t,r,!1),In(e,t,a);i=t.stateNode,pM.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&o?(t.child=fs(t,e.child,null,a),t.child=fs(t,null,s,a)):br(e,t,s,a),t.memoizedState=i.state,n&&hb(t,r,!0),t.child}function f3(e){var t=e.stateNode;t.pendingContext?cb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cb(e,t.context,!1),C0(e,t.containerInfo)}function Pb(e,t,r,i,n){return ds(),x0(n),t.flags|=256,br(e,t,r,i),t.child}var Gg={dehydrated:null,treeContext:null,retryLane:0};function Zg(e){return{baseLanes:e,cachePool:null,transitions:null}}function m3(e,t,r){var i=t.pendingProps,n=gt.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(n&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),Qe(gt,n&1),e===null)return Og(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(o=i.children,e=i.fallback,a?(i=t.mode,a=t.child,o={mode:"hidden",children:o},(i&1)===0&&a!==null?(a.childLanes=0,a.pendingProps=o):a=_p(o,i,0,null),e=Ka(e,i,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Zg(r),t.memoizedState=Gg,e):F0(t,o));if(n=e.memoizedState,n!==null&&(s=n.dehydrated,s!==null))return dM(e,t,o,i,s,n,r);if(a){a=i.fallback,o=t.mode,n=e.child,s=n.sibling;var l={mode:"hidden",children:i.children};return(o&1)===0&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=l,t.deletions=null):(i=fa(n,l),i.subtreeFlags=n.subtreeFlags&14680064),s!==null?a=fa(s,a):(a=Ka(a,o,r,null),a.flags|=2),a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,o=e.child.memoizedState,o=o===null?Zg(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Gg,i}return a=e.child,e=a.sibling,i=fa(a,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function F0(e,t){return t=_p({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Eh(e,t,r,i){return i!==null&&x0(i),fs(t,e.child,null,r),e=F0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dM(e,t,r,i,n,a,o){if(r)return t.flags&256?(t.flags&=-257,i=og(Error(V(422))),Eh(e,t,o,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=i.fallback,n=t.mode,i=_p({mode:"visible",children:i.children},n,0,null),a=Ka(a,n,o,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,(t.mode&1)!==0&&fs(t,e.child,null,o),t.child.memoizedState=Zg(o),t.memoizedState=Gg,a);if((t.mode&1)===0)return Eh(e,t,o,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var s=i.dgst;return i=s,a=Error(V(419)),i=og(a,i,void 0),Eh(e,t,o,i)}if(s=(o&e.childLanes)!==0,kr||s){if(i=qt,i!==null){switch(o&-o){case 4:n=2;break;case 16:n=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=(n&(i.suspendedLanes|o))!==0?0:n,n!==0&&n!==a.retryLane&&(a.retryLane=n,Mn(e,n),Li(i,e,n,-1))}return N0(),i=og(Error(V(421))),Eh(e,t,o,i)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=CM.bind(null,e),n._reactRetry=t,null):(e=a.treeContext,Gr=ca(n.nextSibling),Zr=t,lt=!0,Fi=null,e!==null&&(li[ui++]=En,li[ui++]=Cn,li[ui++]=Ja,En=e.id,Cn=e.overflow,Ja=t),t=F0(t,i.children),t.flags|=4096,t)}function Db(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),jg(e.return,t,r)}function sg(e,t,r,i,n){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=r,a.tailMode=n)}function g3(e,t,r){var i=t.pendingProps,n=i.revealOrder,a=i.tail;if(br(e,t,i.children,r),i=gt.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Db(e,r,t);else if(e.tag===19)Db(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Qe(gt,i),(t.mode&1)===0)t.memoizedState=null;else switch(n){case"forwards":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&ep(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),sg(t,!1,n,r,a);break;case"backwards":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&ep(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}sg(t,!0,r,null,a);break;case"together":sg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fh(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function In(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),to|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,r=fa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=fa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function fM(e,t,r){switch(t.tag){case 3:f3(t),ds();break;case 5:Uw(t);break;case 1:Fr(t.type)&&Wh(t);break;case 4:C0(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;Qe(Kh,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Qe(gt,gt.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?m3(e,t,r):(Qe(gt,gt.current&1),e=In(e,t,r),e!==null?e.sibling:null);Qe(gt,gt.current&1);break;case 19:if(i=(r&t.childLanes)!==0,(e.flags&128)!==0){if(i)return g3(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Qe(gt,gt.current),i)break;return null;case 22:case 23:return t.lanes=0,p3(e,t,r)}return In(e,t,r)}var y3,Hg,_3,v3;y3=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Hg=function(){};_3=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,Ya(ln.current);var a=null;switch(r){case"input":n=mg(e,n),i=mg(e,i),a=[];break;case"select":n=_t({},n,{value:void 0}),i=_t({},i,{value:void 0}),a=[];break;case"textarea":n=_g(e,n),i=_g(e,i),a=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Zh)}xg(r,i);var o;r=null;for(u in n)if(!i.hasOwnProperty(u)&&n.hasOwnProperty(u)&&n[u]!=null)if(u==="style"){var s=n[u];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yl.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in i){var l=i[u];if(s=n?.[u],i.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(a||(a=[]),a.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&it("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};v3=function(e,t,r,i){r!==i&&(t.flags|=4)};function zl(e,t){if(!lt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function pr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function mM(e,t,r){var i=t.pendingProps;switch(v0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pr(t),null;case 1:return Fr(t.type)&&Hh(),pr(t),null;case 3:return i=t.stateNode,ms(),nt(zr),nt(fr),D0(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Th(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Fi!==null&&(t0(Fi),Fi=null))),Hg(e,t),pr(t),null;case 5:P0(t);var n=Ya(su.current);if(r=t.type,e!==null&&t.stateNode!=null)_3(e,t,r,i,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(V(166));return pr(t),null}if(e=Ya(ln.current),Th(t)){i=t.stateNode,r=t.type;var a=t.memoizedProps;switch(i[on]=t,i[au]=a,e=(t.mode&1)!==0,r){case"dialog":it("cancel",i),it("close",i);break;case"iframe":case"object":case"embed":it("load",i);break;case"video":case"audio":for(n=0;n<jl.length;n++)it(jl[n],i);break;case"source":it("error",i);break;case"img":case"image":case"link":it("error",i),it("load",i);break;case"details":it("toggle",i);break;case"input":Lx(i,a),it("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!a.multiple},it("invalid",i);break;case"textarea":Ox(i,a),it("invalid",i)}xg(r,a),n=null;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="children"?typeof s=="string"?i.textContent!==s&&(a.suppressHydrationWarning!==!0&&wh(i.textContent,s,e),n=["children",s]):typeof s=="number"&&i.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&wh(i.textContent,s,e),n=["children",""+s]):Yl.hasOwnProperty(o)&&s!=null&&o==="onScroll"&&it("scroll",i)}switch(r){case"input":ch(i),Bx(i,a,!0);break;case"textarea":ch(i),jx(i);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(i.onclick=Zh)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{o=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Hb(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(r,{is:i.is}):(e=o.createElement(r),r==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,r),e[on]=t,e[au]=i,y3(e,t,!1,!1),t.stateNode=e;e:{switch(o=bg(r,i),r){case"dialog":it("cancel",e),it("close",e),n=i;break;case"iframe":case"object":case"embed":it("load",e),n=i;break;case"video":case"audio":for(n=0;n<jl.length;n++)it(jl[n],e);n=i;break;case"source":it("error",e),n=i;break;case"img":case"image":case"link":it("error",e),it("load",e),n=i;break;case"details":it("toggle",e),n=i;break;case"input":Lx(e,i),n=mg(e,i),it("invalid",e);break;case"option":n=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},n=_t({},i,{value:void 0}),it("invalid",e);break;case"textarea":Ox(e,i),n=_g(e,i),it("invalid",e);break;default:n=i}xg(r,n),s=n;for(a in s)if(s.hasOwnProperty(a)){var l=s[a];a==="style"?Xb(e,l):a==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Wb(e,l)):a==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Xl(e,l):typeof l=="number"&&Xl(e,""+l):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Yl.hasOwnProperty(a)?l!=null&&a==="onScroll"&&it("scroll",e):l!=null&&n0(e,a,l,o))}switch(r){case"input":ch(e),Bx(e,i,!1);break;case"textarea":ch(e),jx(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ma(i.value));break;case"select":e.multiple=!!i.multiple,a=i.value,a!=null?as(e,!!i.multiple,a,!1):i.defaultValue!=null&&as(e,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=Zh)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pr(t),null;case 6:if(e&&t.stateNode!=null)v3(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(V(166));if(r=Ya(su.current),Ya(ln.current),Th(t)){if(i=t.stateNode,r=t.memoizedProps,i[on]=t,(a=i.nodeValue!==r)&&(e=Zr,e!==null))switch(e.tag){case 3:wh(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&wh(i.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[on]=t,t.stateNode=i}return pr(t),null;case 13:if(nt(gt),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(lt&&Gr!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Bw(),ds(),t.flags|=98560,a=!1;else if(a=Th(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(V(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(V(317));a[on]=t}else ds(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pr(t),a=!1}else Fi!==null&&(t0(Fi),Fi=null),a=!0;if(!a)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(gt.current&1)!==0?Nt===0&&(Nt=3):N0())),t.updateQueue!==null&&(t.flags|=4),pr(t),null);case 4:return ms(),Hg(e,t),e===null&&iu(t.stateNode.containerInfo),pr(t),null;case 10:return T0(t.type._context),pr(t),null;case 17:return Fr(t.type)&&Hh(),pr(t),null;case 19:if(nt(gt),a=t.memoizedState,a===null)return pr(t),null;if(i=(t.flags&128)!==0,o=a.rendering,o===null)if(i)zl(a,!1);else{if(Nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ep(e),o!==null){for(t.flags|=128,zl(a,!1),i=o.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)a=r,e=i,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Qe(gt,gt.current&1|2),t.child}e=e.sibling}a.tail!==null&&Dt()>ys&&(t.flags|=128,i=!0,zl(a,!1),t.lanes=4194304)}else{if(!i)if(e=ep(o),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),zl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!lt)return pr(t),null}else 2*Dt()-a.renderingStartTime>ys&&r!==1073741824&&(t.flags|=128,i=!0,zl(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Dt(),t.sibling=null,r=gt.current,Qe(gt,i?r&1|2:r&1),t):(pr(t),null);case 22:case 23:return j0(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(qr&1073741824)!==0&&(pr(t),t.subtreeFlags&6&&(t.flags|=8192)):pr(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function gM(e,t){switch(v0(t),t.tag){case 1:return Fr(t.type)&&Hh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),nt(zr),nt(fr),D0(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return P0(t),null;case 13:if(nt(gt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(gt),null;case 4:return ms(),null;case 10:return T0(t.type._context),null;case 22:case 23:return j0(),null;case 24:return null;default:return null}}var Ch=!1,dr=!1,yM=typeof WeakSet=="function"?WeakSet:Set,K=null;function is(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){xt(e,t,i)}else r.current=null}function Wg(e,t,r){try{r()}catch(i){xt(e,t,i)}}var Ab=!1;function _M(e,t){if(Ig=$h,e=Sw(),y0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,c=0,h=e,p=null;t:for(;;){for(var d;h!==r||n!==0&&h.nodeType!==3||(s=o+n),h!==a||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)p=h,h=d;for(;;){if(h===e)break t;if(p===r&&++u===n&&(s=o),p===a&&++c===i&&(l=o),(d=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(kg={focusedElem:e,selectionRange:r},$h=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var f=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var m=f.memoizedProps,_=f.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:ki(t.type,m),_);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(x){xt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return f=Ab,Ab=!1,f}function Zl(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&e)===e){var a=n.destroy;n.destroy=void 0,a!==void 0&&Wg(t,r,a)}n=n.next}while(n!==i)}}function gp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Yg(e){var t=e.ref;if(t!==null){var r=e.stateNode;e.tag,e=r,typeof t=="function"?t(e):t.current=e}}function x3(e){var t=e.alternate;t!==null&&(e.alternate=null,x3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[on],delete t[au],delete t[Rg],delete t[eM],delete t[tM])),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 b3(e){return e.tag===5||e.tag===3||e.tag===4}function Mb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||b3(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 Xg(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Zh));else if(i!==4&&(e=e.child,e!==null))for(Xg(e,t,r),e=e.sibling;e!==null;)Xg(e,t,r),e=e.sibling}function Kg(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Kg(e,t,r),e=e.sibling;e!==null;)Kg(e,t,r),e=e.sibling}var Jt=null,zi=!1;function ea(e,t,r){for(r=r.child;r!==null;)w3(e,t,r),r=r.sibling}function w3(e,t,r){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(lp,r)}catch{}switch(r.tag){case 5:dr||is(r,t);case 6:var i=Jt,n=zi;Jt=null,ea(e,t,r),Jt=i,zi=n,Jt!==null&&(zi?(e=Jt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Jt.removeChild(r.stateNode));break;case 18:Jt!==null&&(zi?(e=Jt,r=r.stateNode,e.nodeType===8?eg(e.parentNode,r):e.nodeType===1&&eg(e,r),eu(e)):eg(Jt,r.stateNode));break;case 4:i=Jt,n=zi,Jt=r.stateNode.containerInfo,zi=!0,ea(e,t,r),Jt=i,zi=n;break;case 0:case 11:case 14:case 15:if(!dr&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var a=n,o=a.destroy;a=a.tag,o!==void 0&&((a&2)!==0||(a&4)!==0)&&Wg(r,t,o),n=n.next}while(n!==i)}ea(e,t,r);break;case 1:if(!dr&&(is(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(s){xt(r,t,s)}ea(e,t,r);break;case 21:ea(e,t,r);break;case 22:r.mode&1?(dr=(i=dr)||r.memoizedState!==null,ea(e,t,r),dr=i):ea(e,t,r);break;default:ea(e,t,r)}}function Ib(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new yM),t.forEach(function(i){var n=PM.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function Ii(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i];try{var a=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 5:Jt=s.stateNode,zi=!1;break e;case 3:Jt=s.stateNode.containerInfo,zi=!0;break e;case 4:Jt=s.stateNode.containerInfo,zi=!0;break e}s=s.return}if(Jt===null)throw Error(V(160));w3(a,o,n),Jt=null,zi=!1;var l=n.alternate;l!==null&&(l.return=null),n.return=null}catch(u){xt(n,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)T3(t,e),t=t.sibling}function T3(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ii(t,e),nn(e),i&4){try{Zl(3,e,e.return),gp(3,e)}catch(m){xt(e,e.return,m)}try{Zl(5,e,e.return)}catch(m){xt(e,e.return,m)}}break;case 1:Ii(t,e),nn(e),i&512&&r!==null&&is(r,r.return);break;case 5:if(Ii(t,e),nn(e),i&512&&r!==null&&is(r,r.return),e.flags&32){var n=e.stateNode;try{Xl(n,"")}catch(m){xt(e,e.return,m)}}if(i&4&&(n=e.stateNode,n!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&Gb(n,a),bg(s,o);var u=bg(s,a);for(o=0;o<l.length;o+=2){var c=l[o],h=l[o+1];c==="style"?Xb(n,h):c==="dangerouslySetInnerHTML"?Wb(n,h):c==="children"?Xl(n,h):n0(n,c,h,u)}switch(s){case"input":gg(n,a);break;case"textarea":Zb(n,a);break;case"select":var p=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!a.multiple;var d=a.value;d!=null?as(n,!!a.multiple,d,!1):p!==!!a.multiple&&(a.defaultValue!=null?as(n,!!a.multiple,a.defaultValue,!0):as(n,!!a.multiple,a.multiple?[]:"",!1))}n[au]=a}catch(m){xt(e,e.return,m)}}break;case 6:if(Ii(t,e),nn(e),i&4){if(e.stateNode===null)throw Error(V(162));n=e.stateNode,a=e.memoizedProps;try{n.nodeValue=a}catch(m){xt(e,e.return,m)}}break;case 3:if(Ii(t,e),nn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{eu(t.containerInfo)}catch(m){xt(e,e.return,m)}break;case 4:Ii(t,e),nn(e);break;case 13:Ii(t,e),nn(e),n=e.child,n.flags&8192&&(a=n.memoizedState!==null,n.stateNode.isHidden=a,!a||n.alternate!==null&&n.alternate.memoizedState!==null||(B0=Dt())),i&4&&Ib(e);break;case 22:if(c=r!==null&&r.memoizedState!==null,e.mode&1?(dr=(u=dr)||c,Ii(t,e),dr=u):Ii(t,e),nn(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&(e.mode&1)!==0)for(K=e,c=e.child;c!==null;){for(h=K=c;K!==null;){switch(p=K,d=p.child,p.tag){case 0:case 11:case 14:case 15:Zl(4,p,p.return);break;case 1:is(p,p.return);var f=p.stateNode;if(typeof f.componentWillUnmount=="function"){i=p,r=p.return;try{t=i,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(m){xt(i,r,m)}}break;case 5:is(p,p.return);break;case 22:if(p.memoizedState!==null){zb(h);continue}}d!==null?(d.return=p,K=d):zb(h)}c=c.sibling}e:for(c=null,h=e;;){if(h.tag===5){if(c===null){c=h;try{n=h.stateNode,u?(a=n.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=Yb("display",o))}catch(m){xt(e,e.return,m)}}}else if(h.tag===6){if(c===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){xt(e,e.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;c===h&&(c=null),h=h.return}c===h&&(c=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ii(t,e),nn(e),i&4&&Ib(e);break;case 21:break;default:Ii(t,e),nn(e)}}function nn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(b3(r)){var i=r;break e}r=r.return}throw Error(V(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(Xl(n,""),i.flags&=-33);var a=Mb(e);Kg(e,a,n);break;case 3:case 4:var o=i.stateNode.containerInfo,s=Mb(e);Xg(e,s,o);break;default:throw Error(V(161))}}catch(l){xt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vM(e,t,r){K=e,S3(e,t,r)}function S3(e,t,r){for(var i=(e.mode&1)!==0;K!==null;){var n=K,a=n.child;if(n.tag===22&&i){var o=n.memoizedState!==null||Ch;if(!o){var s=n.alternate,l=s!==null&&s.memoizedState!==null||dr;s=Ch;var u=dr;if(Ch=o,(dr=l)&&!u)for(K=n;K!==null;)o=K,l=o.child,o.tag===22&&o.memoizedState!==null?Fb(n):l!==null?(l.return=o,K=l):Fb(n);for(;a!==null;)K=a,S3(a,t,r),a=a.sibling;K=n,Ch=s,dr=u}kb(e,t,r)}else(n.subtreeFlags&8772)!==0&&a!==null?(a.return=n,K=a):kb(e,t,r)}}function kb(e){for(;K!==null;){var t=K;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:dr||gp(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!dr)if(r===null)i.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:ki(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&gb(t,a,i);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}gb(t,o,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var h=c.dehydrated;h!==null&&eu(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}dr||t.flags&512&&Yg(t)}catch(p){xt(t,t.return,p)}}if(t===e){K=null;break}if(r=t.sibling,r!==null){r.return=t.return,K=r;break}K=t.return}}function zb(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var r=t.sibling;if(r!==null){r.return=t.return,K=r;break}K=t.return}}function Fb(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{gp(4,t)}catch(l){xt(t,r,l)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var n=t.return;try{i.componentDidMount()}catch(l){xt(t,n,l)}}var a=t.return;try{Yg(t)}catch(l){xt(t,a,l)}break;case 5:var o=t.return;try{Yg(t)}catch(l){xt(t,o,l)}}}catch(l){xt(t,t.return,l)}if(t===e){K=null;break}var s=t.sibling;if(s!==null){s.return=t.return,K=s;break}K=t.return}}var xM=Math.ceil,ip=kn.ReactCurrentDispatcher,R0=kn.ReactCurrentOwner,hi=kn.ReactCurrentBatchConfig,ze=0,qt=null,zt=null,er=0,qr=0,ns=_a(0),Nt=0,hu=null,to=0,yp=0,L0=0,Hl=null,Ir=null,B0=0,ys=1/0,Tn=null,np=!1,Qg=null,pa=null,Ph=!1,oa=null,ap=0,Wl=0,Jg=null,Rh=-1,Lh=0;function wr(){return(ze&6)!==0?Dt():Rh!==-1?Rh:Rh=Dt()}function da(e){return(e.mode&1)===0?1:(ze&2)!==0&&er!==0?er&-er:iM.transition!==null?(Lh===0&&(Lh=lw()),Lh):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:mw(e.type)),e)}function Li(e,t,r,i){if(50<Wl)throw Wl=0,Jg=null,Error(V(185));pu(e,r,i),((ze&2)===0||e!==qt)&&(e===qt&&((ze&2)===0&&(yp|=r),Nt===4&&na(e,er)),Rr(e,i),r===1&&ze===0&&(t.mode&1)===0&&(ys=Dt()+500,dp&&va()))}function Rr(e,t){var r=e.callbackNode;aA(e,t);var i=Uh(e,e===qt?er:0);if(i===0)r!==null&&Ux(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Ux(r),t===1)e.tag===0?rM(Rb.bind(null,e)):Fw(Rb.bind(null,e)),QA(function(){(ze&6)===0&&va()}),r=null;else{switch(uw(i)){case 1:r=u0;break;case 4:r=ow;break;case 16:r=Vh;break;case 536870912:r=sw;break;default:r=Vh}r=k3(r,E3.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function E3(e,t){if(Rh=-1,Lh=0,(ze&6)!==0)throw Error(V(327));var r=e.callbackNode;if(cs()&&e.callbackNode!==r)return null;var i=Uh(e,e===qt?er:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=op(e,i);else{t=i;var n=ze;ze|=2;var a=P3();(qt!==e||er!==t)&&(Tn=null,ys=Dt()+500,Xa(e,t));do try{TM();break}catch(s){C3(e,s)}while(!0);w0(),ip.current=a,ze=n,zt!==null?t=0:(qt=null,er=0,t=Nt)}if(t!==0){if(t===2&&(n=Cg(e),n!==0&&(i=n,t=e0(e,n))),t===1)throw r=hu,Xa(e,0),na(e,i),Rr(e,Dt()),r;if(t===6)na(e,i);else{if(n=e.current.alternate,(i&30)===0&&!bM(n)&&(t=op(e,i),t===2&&(a=Cg(e),a!==0&&(i=a,t=e0(e,a))),t===1))throw r=hu,Xa(e,0),na(e,i),Rr(e,Dt()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error(V(345));case 2:Za(e,Ir,Tn);break;case 3:if(na(e,i),(i&130023424)===i&&(t=B0+500-Dt(),10<t)){if(Uh(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){wr(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=Fg(Za.bind(null,e,Ir,Tn),t);break}Za(e,Ir,Tn);break;case 4:if(na(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var o=31-Ri(i);a=1<<o,o=t[o],o>n&&(n=o),i&=~a}if(i=n,i=Dt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xM(i/1960))-i,10<i){e.timeoutHandle=Fg(Za.bind(null,e,Ir,Tn),i);break}Za(e,Ir,Tn);break;case 5:Za(e,Ir,Tn);break;default:throw Error(V(329))}}}return Rr(e,Dt()),e.callbackNode===r?E3.bind(null,e):null}function e0(e,t){var r=Hl;return e.current.memoizedState.isDehydrated&&(Xa(e,t).flags|=256),e=op(e,t),e!==2&&(t=Ir,Ir=r,t!==null&&t0(t)),e}function t0(e){Ir===null?Ir=e:Ir.push.apply(Ir,e)}function bM(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var n=r[i],a=n.getSnapshot;n=n.value;try{if(!Bi(a(),n))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function na(e,t){for(t&=~L0,t&=~yp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ri(t),i=1<<r;e[r]=-1,t&=~i}}function Rb(e){if((ze&6)!==0)throw Error(V(327));cs();var t=Uh(e,0);if((t&1)===0)return Rr(e,Dt()),null;var r=op(e,t);if(e.tag!==0&&r===2){var i=Cg(e);i!==0&&(t=i,r=e0(e,i))}if(r===1)throw r=hu,Xa(e,0),na(e,t),Rr(e,Dt()),r;if(r===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Za(e,Ir,Tn),Rr(e,Dt()),null}function O0(e,t){var r=ze;ze|=1;try{return e(t)}finally{ze=r,ze===0&&(ys=Dt()+500,dp&&va())}}function ro(e){oa!==null&&oa.tag===0&&(ze&6)===0&&cs();var t=ze;ze|=1;var r=hi.transition,i=Ge;try{if(hi.transition=null,Ge=1,e)return e()}finally{Ge=i,hi.transition=r,ze=t,(ze&6)===0&&va()}}function j0(){qr=ns.current,nt(ns)}function Xa(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,KA(r)),zt!==null)for(r=zt.return;r!==null;){var i=r;switch(v0(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Hh();break;case 3:ms(),nt(zr),nt(fr),D0();break;case 5:P0(i);break;case 4:ms();break;case 13:nt(gt);break;case 19:nt(gt);break;case 10:T0(i.type._context);break;case 22:case 23:j0()}r=r.return}if(qt=e,zt=e=fa(e.current,null),er=qr=t,Nt=0,hu=null,L0=yp=to=0,Ir=Hl=null,Wa!==null){for(t=0;t<Wa.length;t++)if(r=Wa[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,a=r.pending;if(a!==null){var o=a.next;a.next=n,i.next=o}r.pending=i}Wa=null}return e}function C3(e,t){do{var r=zt;try{if(w0(),kh.current=rp,tp){for(var i=yt.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}tp=!1}if(eo=0,$t=jt=yt=null,Gl=!1,lu=0,R0.current=null,r===null||r.return===null){Nt=1,hu=t,zt=null;break}e:{var a=e,o=r.return,s=r,l=t;if(t=er,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,h=c.tag;if((c.mode&1)===0&&(h===0||h===11||h===15)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var d=wb(o);if(d!==null){d.flags&=-257,Tb(d,o,s,a,t),d.mode&1&&bb(a,u,t),t=d,l=u;var f=t.updateQueue;if(f===null){var m=new Set;m.add(l),t.updateQueue=m}else f.add(l);break e}else{if((t&1)===0){bb(a,u,t),N0();break e}l=Error(V(426))}}else if(lt&&s.mode&1){var _=wb(o);if(_!==null){(_.flags&65536)===0&&(_.flags|=256),Tb(_,o,s,a,t),x0(gs(l,s));break e}}a=l=gs(l,s),Nt!==4&&(Nt=2),Hl===null?Hl=[a]:Hl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=u3(a,l,t);mb(a,g);break e;case 1:s=l;var y=a.type,v=a.stateNode;if((a.flags&128)===0&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(pa===null||!pa.has(v)))){a.flags|=65536,t&=-t,a.lanes|=t;var x=c3(a,s,t);mb(a,x);break e}}a=a.return}while(a!==null)}A3(r)}catch(b){t=b,zt===r&&r!==null&&(zt=r=r.return);continue}break}while(!0)}function P3(){var e=ip.current;return ip.current=rp,e===null?rp:e}function N0(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),qt===null||(to&268435455)===0&&(yp&268435455)===0||na(qt,er)}function op(e,t){var r=ze;ze|=2;var i=P3();(qt!==e||er!==t)&&(Tn=null,Xa(e,t));do try{wM();break}catch(n){C3(e,n)}while(!0);if(w0(),ze=r,ip.current=i,zt!==null)throw Error(V(261));return qt=null,er=0,Nt}function wM(){for(;zt!==null;)D3(zt)}function TM(){for(;zt!==null&&!X8();)D3(zt)}function D3(e){var t=I3(e.alternate,e,qr);e.memoizedProps=e.pendingProps,t===null?A3(e):zt=t,R0.current=null}function A3(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=mM(r,t,qr),r!==null){zt=r;return}}else{if(r=gM(r,t),r!==null){r.flags&=32767,zt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Nt=6,zt=null;return}}if(t=t.sibling,t!==null){zt=t;return}zt=t=e}while(t!==null);Nt===0&&(Nt=5)}function Za(e,t,r){var i=Ge,n=hi.transition;try{hi.transition=null,Ge=1,SM(e,t,r,i)}finally{hi.transition=n,Ge=i}return null}function SM(e,t,r,i){do cs();while(oa!==null);if((ze&6)!==0)throw Error(V(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(oA(e,a),e===qt&&(zt=qt=null,er=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Ph||(Ph=!0,k3(Vh,function(){return cs(),null})),a=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||a){a=hi.transition,hi.transition=null;var o=Ge;Ge=1;var s=ze;ze|=4,R0.current=null,_M(e,r),T3(r,e),ZA(kg),$h=!!Ig,kg=Ig=null,e.current=r,vM(r,e,n),K8(),ze=s,Ge=o,hi.transition=a}else e.current=r;if(Ph&&(Ph=!1,oa=e,ap=n),a=e.pendingLanes,a===0&&(pa=null),eA(r.stateNode,i),Rr(e,Dt()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],i(n.value,{componentStack:n.stack,digest:n.digest});if(np)throw np=!1,e=Qg,Qg=null,e;return(ap&1)!==0&&e.tag!==0&&cs(),a=e.pendingLanes,(a&1)!==0?e===Jg?Wl++:(Wl=0,Jg=e):Wl=0,va(),null}function cs(){if(oa!==null){var e=uw(ap),t=hi.transition,r=Ge;try{if(hi.transition=null,Ge=16>e?16:e,oa===null)var i=!1;else{if(e=oa,oa=null,ap=0,(ze&6)!==0)throw Error(V(331));var n=ze;for(ze|=4,K=e.current;K!==null;){var a=K,o=a.child;if((K.flags&16)!==0){var s=a.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(K=u;K!==null;){var c=K;switch(c.tag){case 0:case 11:case 15:Zl(8,c,a)}var h=c.child;if(h!==null)h.return=c,K=h;else for(;K!==null;){c=K;var p=c.sibling,d=c.return;if(x3(c),c===u){K=null;break}if(p!==null){p.return=d,K=p;break}K=d}}}var f=a.alternate;if(f!==null){var m=f.child;if(m!==null){f.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}K=a}}if((a.subtreeFlags&2064)!==0&&o!==null)o.return=a,K=o;else e:for(;K!==null;){if(a=K,(a.flags&2048)!==0)switch(a.tag){case 0:case 11:case 15:Zl(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,K=g;break e}K=a.return}}var y=e.current;for(K=y;K!==null;){o=K;var v=o.child;if((o.subtreeFlags&2064)!==0&&v!==null)v.return=o,K=v;else e:for(o=y;K!==null;){if(s=K,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:gp(9,s)}}catch(b){xt(s,s.return,b)}if(s===o){K=null;break e}var x=s.sibling;if(x!==null){x.return=s.return,K=x;break e}K=s.return}}if(ze=n,va(),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(lp,e)}catch{}i=!0}return i}finally{Ge=r,hi.transition=t}}return!1}function Lb(e,t,r){t=gs(r,t),t=u3(e,t,1),e=ha(e,t,1),t=wr(),e!==null&&(pu(e,1,t),Rr(e,t))}function xt(e,t,r){if(e.tag===3)Lb(e,e,r);else for(;t!==null;){if(t.tag===3){Lb(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(pa===null||!pa.has(i))){e=gs(r,e),e=c3(t,e,1),t=ha(t,e,1),e=wr(),t!==null&&(pu(t,1,e),Rr(t,e));break}}t=t.return}}function EM(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=wr(),e.pingedLanes|=e.suspendedLanes&r,qt===e&&(er&r)===r&&(Nt===4||Nt===3&&(er&130023424)===er&&500>Dt()-B0?Xa(e,0):L0|=r),Rr(e,t)}function M3(e,t){t===0&&((e.mode&1)===0?t=1:(t=dh,dh<<=1,(dh&130023424)===0&&(dh=4194304)));var r=wr();e=Mn(e,t),e!==null&&(pu(e,t,r),Rr(e,r))}function CM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),M3(e,r)}function PM(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(V(314))}i!==null&&i.delete(t),M3(e,r)}var I3;I3=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||zr.current)kr=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return kr=!1,fM(e,t,r);kr=(e.flags&131072)!==0}else kr=!1,lt&&(t.flags&1048576)!==0&&Rw(t,Xh,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Fh(e,t),e=t.pendingProps;var n=ps(t,fr.current);us(t,r),n=M0(null,t,i,e,n,r);var a=I0();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Fr(i)?(a=!0,Wh(t)):a=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,E0(t),n.updater=mp,t.stateNode=n,n._reactInternals=t,Vg(t,i,e,r),t=qg(null,t,i,!0,a,r)):(t.tag=0,lt&&a&&_0(t),br(null,t,n,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Fh(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=AM(i),e=ki(i,e),n){case 0:t=$g(null,t,i,e,r);break e;case 1:t=Cb(null,t,i,e,r);break e;case 11:t=Sb(null,t,i,e,r);break e;case 14:t=Eb(null,t,i,ki(i.type,e),r);break e}throw Error(V(306,i,""))}return t;case 0:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),$g(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),Cb(e,t,i,n,r);case 3:e:{if(f3(t),e===null)throw Error(V(387));i=t.pendingProps,a=t.memoizedState,n=a.element,Vw(e,t),Jh(t,i,null,r);var o=t.memoizedState;if(i=o.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){n=gs(Error(V(423)),t),t=Pb(e,t,i,r,n);break e}else if(i!==n){n=gs(Error(V(424)),t),t=Pb(e,t,i,r,n);break e}else for(Gr=ca(t.stateNode.containerInfo.firstChild),Zr=t,lt=!0,Fi=null,r=jw(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ds(),i===n){t=In(e,t,r);break e}br(e,t,i,r)}t=t.child}return t;case 5:return Uw(t),e===null&&Og(t),i=t.type,n=t.pendingProps,a=e!==null?e.memoizedProps:null,o=n.children,zg(i,n)?o=null:a!==null&&zg(i,a)&&(t.flags|=32),d3(e,t),br(e,t,o,r),t.child;case 6:return e===null&&Og(t),null;case 13:return m3(e,t,r);case 4:return C0(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=fs(t,null,i,r):br(e,t,i,r),t.child;case 11:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),Sb(e,t,i,n,r);case 7:return br(e,t,t.pendingProps,r),t.child;case 8:return br(e,t,t.pendingProps.children,r),t.child;case 12:return br(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,n=t.pendingProps,a=t.memoizedProps,o=n.value,Qe(Kh,i._currentValue),i._currentValue=o,a!==null)if(Bi(a.value,o)){if(a.children===n.children&&!zr.current){t=In(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===i){if(a.tag===1){l=Pn(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),jg(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(V(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),jg(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}br(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,us(t,r),n=pi(n),i=i(n),t.flags|=1,br(e,t,i,r),t.child;case 14:return i=t.type,n=ki(i,t.pendingProps),n=ki(i.type,n),Eb(e,t,i,n,r);case 15:return h3(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ki(i,n),Fh(e,t),t.tag=1,Fr(i)?(e=!0,Wh(t)):e=!1,us(t,r),l3(t,i,n),Vg(t,i,n,r),qg(null,t,i,!0,e,r);case 19:return g3(e,t,r);case 22:return p3(e,t,r)}throw Error(V(156,t.tag))};function k3(e,t){return aw(e,t)}function DM(e,t,r,i){this.tag=e,this.key=r,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,t,r,i){return new DM(e,t,r,i)}function V0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function AM(e){if(typeof e=="function")return V0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===o0)return 11;if(e===s0)return 14}return 2}function fa(e,t){var r=e.alternate;return r===null?(r=ci(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Bh(e,t,r,i,n,a){var o=2;if(i=e,typeof e=="function")V0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Wo:return Ka(r.children,n,a,t);case a0:o=8,n|=8;break;case hg:return e=ci(12,r,t,n|2),e.elementType=hg,e.lanes=a,e;case pg:return e=ci(13,r,t,n),e.elementType=pg,e.lanes=a,e;case dg:return e=ci(19,r,t,n),e.elementType=dg,e.lanes=a,e;case Ub:return _p(r,n,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nb:o=10;break e;case Vb:o=9;break e;case o0:o=11;break e;case s0:o=14;break e;case ta:o=16,i=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=ci(o,r,t,n),t.elementType=e,t.type=i,t.lanes=a,t}function Ka(e,t,r,i){return e=ci(7,e,i,t),e.lanes=r,e}function _p(e,t,r,i){return e=ci(22,e,i,t),e.elementType=Ub,e.lanes=r,e.stateNode={isHidden:!1},e}function lg(e,t,r){return e=ci(6,e,null,t),e.lanes=r,e}function ug(e,t,r){return t=ci(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function MM(e,t,r,i,n){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=Zm(0),this.expirationTimes=Zm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zm(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function U0(e,t,r,i,n,a,o,s,l){return e=new MM(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ci(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},E0(a),e}function IM(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ho,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function z3(e){if(!e)return ga;e=e._reactInternals;e:{if(no(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Fr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var r=e.type;if(Fr(r))return zw(e,r,t)}return t}function F3(e,t,r,i,n,a,o,s,l){return e=U0(r,i,!0,e,n,a,o,s,l),e.context=z3(null),r=e.current,i=wr(),n=da(r),a=Pn(i,n),a.callback=t??null,ha(r,a,n),e.current.lanes=n,pu(e,n,i),Rr(e,i),e}function vp(e,t,r,i){var n=t.current,a=wr(),o=da(n);return r=z3(r),t.context===null?t.context=r:t.pendingContext=r,t=Pn(a,o),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=ha(n,t,o),e!==null&&(Li(e,n,o,a),Ih(e,n,o)),o}function sp(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Bb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function $0(e,t){Bb(e,t),(e=e.alternate)&&Bb(e,t)}function kM(){return null}var R3=typeof reportError=="function"?reportError:function(e){console.error(e)};function q0(e){this._internalRoot=e}xp.prototype.render=q0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));vp(e,t,null,null)};xp.prototype.unmount=q0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ro(function(){vp(null,e,null,null)}),t[An]=null}};function xp(e){this._internalRoot=e}xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=pw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ia.length&&t!==0&&t<ia[r].priority;r++);ia.splice(r,0,e),r===0&&fw(e)}};function G0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ob(){}function zM(e,t,r,i,n){if(n){if(typeof i=="function"){var a=i;i=function(){var u=sp(o);a.call(u)}}var o=F3(t,i,e,0,null,!1,!1,"",Ob);return e._reactRootContainer=o,e[An]=o.current,iu(e.nodeType===8?e.parentNode:e),ro(),o}for(;n=e.lastChild;)e.removeChild(n);if(typeof i=="function"){var s=i;i=function(){var u=sp(l);s.call(u)}}var l=U0(e,0,!1,null,null,!1,!1,"",Ob);return e._reactRootContainer=l,e[An]=l.current,iu(e.nodeType===8?e.parentNode:e),ro(function(){vp(t,l,r,i)}),l}function wp(e,t,r,i,n){var a=r._reactRootContainer;if(a){var o=a;if(typeof n=="function"){var s=n;n=function(){var l=sp(o);s.call(l)}}vp(t,o,e,n)}else o=zM(r,t,e,n,i);return sp(o)}cw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ol(t.pendingLanes);r!==0&&(c0(t,r|1),Rr(t,Dt()),(ze&6)===0&&(ys=Dt()+500,va()))}break;case 13:ro(function(){var i=Mn(e,1);if(i!==null){var n=wr();Li(i,e,1,n)}}),$0(e,1)}};h0=function(e){if(e.tag===13){var t=Mn(e,134217728);if(t!==null){var r=wr();Li(t,e,134217728,r)}$0(e,134217728)}};hw=function(e){if(e.tag===13){var t=da(e),r=Mn(e,t);if(r!==null){var i=wr();Li(r,e,t,i)}$0(e,t)}};pw=function(){return Ge};dw=function(e,t){var r=Ge;try{return Ge=e,t()}finally{Ge=r}};Tg=function(e,t,r){switch(t){case"input":if(gg(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var n=pp(i);if(!n)throw Error(V(90));qb(i),gg(i,n)}}}break;case"textarea":Zb(e,r);break;case"select":t=r.value,t!=null&&as(e,!!r.multiple,t,!1)}};Jb=O0;ew=ro;var FM={usingClientEntryPoint:!1,Events:[fu,Qo,pp,Kb,Qb,O0]},Fl={findFiberByHostInstance:Ha,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},RM={bundleType:Fl.bundleType,version:Fl.version,rendererPackageName:Fl.rendererPackageName,rendererConfig:Fl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=iw(e),e===null?null:e.stateNode},findFiberByHostInstance:Fl.findFiberByHostInstance||kM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Rl.isDisabled&&Rl.supportsFiber))try{lp=Rl.inject(RM),sn=Rl}catch{}var Rl;Yr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FM;Yr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!G0(t))throw Error(V(200));return IM(e,t,null,r)};Yr.createRoot=function(e,t){if(!G0(e))throw Error(V(299));var r=!1,i="",n=R3;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=U0(e,1,!1,null,null,r,!1,i,n),e[An]=t.current,iu(e.nodeType===8?e.parentNode:e),new q0(t)};Yr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=iw(t),e=e===null?null:e.stateNode,e};Yr.flushSync=function(e){return ro(e)};Yr.hydrate=function(e,t,r){if(!bp(t))throw Error(V(200));return wp(null,e,t,!0,r)};Yr.hydrateRoot=function(e,t,r){if(!G0(e))throw Error(V(405));var i=r!=null&&r.hydratedSources||null,n=!1,a="",o=R3;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=F3(t,null,e,1,r??null,n,!1,a,o),e[An]=t.current,iu(e),i)for(e=0;e<i.length;e++)r=i[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new xp(t)};Yr.render=function(e,t,r){if(!bp(t))throw Error(V(200));return wp(null,e,t,!1,r)};Yr.unmountComponentAtNode=function(e){if(!bp(e))throw Error(V(40));return e._reactRootContainer?(ro(function(){wp(null,null,e,!1,function(){e._reactRootContainer=null,e[An]=null})}),!0):!1};Yr.unstable_batchedUpdates=O0;Yr.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!bp(r))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return wp(e,t,r,!1,i)};Yr.version="18.3.1-next-f1338f8080-20240426"});var j3=tn((pH,O3)=>{"use strict";function B3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(B3)}catch(e){console.error(e)}}B3(),O3.exports=L3()});var V3=tn(Z0=>{"use strict";var N3=j3();Z0.createRoot=N3.createRoot,Z0.hydrateRoot=N3.hydrateRoot;var dH});var UD=tn((oee,f2)=>{var Yf="maplibre_gl_dates";function d2(e,t){let r=BD(t);e.getStyle().layers.map(function(i){if(!("source-layer"in i))return;let n=jD(e.getFilter(i.id),r);e.setFilter(i.id,n)})}function BD(e){let t;if(typeof e=="string")t=OD(e);else if(e instanceof Date&&!isNaN(e)){let r=Kf(e),i=e.toISOString().split("T")[0];t={startDate:e,startDecimalYear:r,startISODate:i,endDate:e,endDecimalYear:r,endISODate:i}}return t}function OD(e){if(!e||!/^-?\d{1,4}(?:-\d\d){0,2}$/.test(e))return;let t=e.split("-");t[0]===""&&(t.shift(),t[0]*=-1);let i=+t[0],n=+t[0],a,o;t[1]?a=o=+t[1]-1:(n++,a=o=0);let s,l;t[2]?s=l=+t[2]:t[1]&&(o++,s=l=1);let u=Xf(i,a,s),c=Xf(n,o,l);return{startDate:!isNaN(u)&&u,startDecimalYear:!isNaN(u)&&Kf(u),startISODate:!isNaN(u)&&u.toISOString().split("T")[0],endDate:!isNaN(c)&&c,endDecimalYear:!isNaN(c)&&Kf(c),endISODate:!isNaN(c)&&c.toISOString().split("T")[0]}}function Xf(e,t,r){let i=new Date(Date.UTC(e,t,r));return i.setUTCFullYear(e),i}function Kf(e){let t=e.getUTCFullYear(),r=Xf(t+1,0,1).getTime(),i=Xf(t,0,1).getTime();return t+(e.getTime()-i)/(r-i)}function jD(e,t){return typeof e<"u"&&m2(e)?ND(e,t):VD(e,t)}function ND(e,t){return e[0]==="all"&&e[2]&&e[1][0]==="any"&&e[2][0]==="any"?(e[1][1]&&e[1][1][0]==="all"&&e[1][1][2]&&e[1][1][2][0]==="<"&&e[1][1][2][1]==="start_decdate"&&(e[1][1][2][2]=t.endDecimalYear),e[1][2]&&e[1][2][0]==="all"&&e[1][2][2]&&e[1][2][2][0]==="<"&&e[1][2][2][2]==="start_date"&&(e[1][2][2][3]=t.endISODate),e[2][1]&&e[2][1][0]==="all"&&e[2][1][2]&&e[2][1][2][0]===">="&&e[2][1][2][1]==="end_decdate"&&(e[2][1][2][2]=t.startDecimalYear),e[2][2]&&e[2][2][0]==="all"&&e[2][2][2]&&e[2][2][2][0]===">="&&e[2][2][2][2]==="end_date"&&(e[2][2][2][3]=t.startISODate),e):["all",["any",["all",["has","start_decdate"],["<","start_decdate",t.endDecimalYear]],["all",["!has","start_decdate"],["has","start_date"],["<","start_date",t.endISODate]],["all",["!has","start_decdate"],["!has","start_date"]]],["any",["all",["has","end_decdate"],[">=","end_decdate",t.startDecimalYear]],["all",["!has","end_decdate"],["has","end_date"],[">=","end_date",t.startISODate]],["all",["!has","end_decdate"],["!has","end_date"]]],e]}function VD(e,t){let r=`${Yf}__startDecimalYear`,i=`${Yf}__startISODate`,n=`${Yf}__endDecimalYear`,a=`${Yf}__endISODate`;if(Array.isArray(e)&&e[0]==="let")return kc(e,r,t.startDecimalYear),kc(e,i,t.startISODate),kc(e,n,t.endDecimalYear),kc(e,a,t.endISODate),e;let o=["all",["any",["all",["has","start_decdate"],["<",["get","start_decdate"],["var",n]]],["all",["!",["has","start_decdate"]],["has","start_date"],["<",["get","start_date"],["var",a]]],["all",["!",["has","start_decdate"]],["!",["has","start_date"]]]],["any",["all",["has","end_decdate"],[">=",["get","end_decdate"],["var",r]]],["all",["!",["has","end_decdate"]],["has","end_date"],[">=",["get","end_date"],["var",i]]],["all",["!",["has","end_decdate"]],["!",["has","end_date"]]]]];return e&&o.push(e),["let",r,t.startDecimalYear,i,t.startISODate,n,t.endDecimalYear,a,t.endISODate,o]}function m2(e){if(!Array.isArray(e)||e.length<2)return!1;let t=e.slice(1);switch(e[0]){case"!has":case"!in":case"none":return!0;case"has":return t[0]==="$id"||t[0]==="$type";case"in":return t.length>2||t[0]==="$id"||t[0]==="$type"||typeof t[1]=="number"||typeof t[1]=="boolean"||typeof t[0]=="string"&&typeof t[1]=="string";case"==":case"!=":case">":case">=":case"<":case"<=":return typeof t[0]=="string"&&!Array.isArray(t[1]);case"all":case"any":return t.some(m2);default:return!1}}function kc(e,t,r){if(e[0]!=="let")return;let i=e.indexOf(t);i!==-1&&i%2===1?e[i+1]=r:e.splice(-1,0,t,r)}typeof window<"u"&&("maplibregl"in window||"mapboxgl"in window)?("maplibregl"in window&&(maplibregl.Map.prototype.filterByDate=function(e){d2(this,e)}),"mapboxgl"in window&&(mapboxgl.Map.prototype.filterByDate=function(e){d2(this,e)})):typeof f2<"u"&&(f2.exports={filterByDate:d2,dateRangeFromDate:BD,decimalYearFromDate:Kf,dateRangeFromISODate:OD,constrainFilterByDateRange:jD,constrainLegacyFilterByDateRange:ND,constrainExpressionFilterByDateRange:VD,isLegacyFilter:m2,updateVariable:kc})});var WD=tn(Jf=>{"use strict";var MZ=$a(),IZ=Symbol.for("react.element"),kZ=Symbol.for("react.fragment"),zZ=Object.prototype.hasOwnProperty,FZ=MZ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RZ={key:!0,ref:!0,__self:!0,__source:!0};function HD(e,t,r){var i,n={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(i in t)zZ.call(t,i)&&!RZ.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)n[i]===void 0&&(n[i]=t[i]);return{$$typeof:IZ,type:e,key:a,ref:o,props:n,_owner:FZ.current}}Jf.Fragment=kZ;Jf.jsx=HD;Jf.jsxs=HD});var Xi=tn((cee,YD)=>{"use strict";YD.exports=WD()});var tm=ur($a(),1),o8=ur(V3(),1);var LM=Object.create,cT=Object.defineProperty,BM=Object.getOwnPropertyDescriptor,OM=Object.getOwnPropertyNames,jM=Object.getPrototypeOf,hT=Object.prototype.hasOwnProperty,A_=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),NM=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=OM(t),a=0,o=n.length,s;a<o;a++)s=n[a],!hT.call(e,s)&&s!==r&&cT(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(i=BM(t,s))||i.enumerable});return e},VM=(e,t,r)=>(r=e==null?{}:LM(jM(e)),NM(t||!e||!e.__esModule||!hT.call(e,"default")?cT(r,"default",{value:e,enumerable:!0}):r,e)),pT="6.15.0";function k(e,t){this.x=e,this.y=t}k.prototype={clone(){return new k(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),i=t*this.x-r*this.y,n=r*this.x+t*this.y;return this.x=i,this.y=n,this},_rotateAround(e,t){let r=Math.cos(e),i=Math.sin(e),n=t.x+r*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:k},k.convert=function(e){if(e instanceof k)return e;if(Array.isArray(e))return new k(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new k(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};function UM(e,t,r,i){let n=3*e,a=3*(r-e)-n,o=1-n-a,s=3*t,l=3*(i-t)-s,u=1-s-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let m=0;m<8;m++){let _=((o*p+a)*p+n)*p-c;if(Math.abs(_)<h)return((u*p+l)*p+s)*p;let g=(3*o*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=_/g}let d=0,f=1;p=c;for(let m=0;m<20;m++){let _=((o*p+a)*p+n)*p;if(Math.abs(_-c)<h)break;c>_?d=p:f=p,p=(d+f)*.5}return((u*p+l)*p+s)*p}}var H0;function M_(){return H0??(H0=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),H0}var Tp;function dT(){if(Tp==null&&(Tp=!1,M_())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;r<25;r++){let i=r*4;e.fillStyle=`rgb(${i},${i+1},${i+2})`,e.fillRect(r%5,Math.floor(r/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&t[r]!==r){Tp=!0;break}}}return Tp||!1}var Yt=typeof Float32Array<"u"?Float32Array:Array;function fT(){var e=new Yt(4);return Yt!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function $M(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*a-n*i;return o?(o=1/o,e[0]=a*o,e[1]=-i*o,e[2]=-n*o,e[3]=r*o,e):null}function qM(e){return e[0]*e[3]-e[2]*e[1]}function GM(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=n*l+o*s,e[2]=i*-s+a*l,e[3]=n*-s+o*l,e}function mT(){var e=new Yt(9);return Yt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ZM(e){var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*(u*a-o*l)+r*(-u*n+o*s)+i*(l*n-a*s)}function HM(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function WM(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r+r,s=i+i,l=n+n,u=r*o,c=i*o,h=i*s,p=n*o,d=n*s,f=n*l,m=a*o,_=a*s,g=a*l;return e[0]=1-h-f,e[3]=c-g,e[6]=p+_,e[1]=c+g,e[4]=1-u-f,e[7]=d-m,e[2]=p-_,e[5]=d+m,e[8]=1-u-h,e}function Do(){var e=new Yt(16);return Yt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function H1(e){var t=new Yt(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function YM(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Gi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _d(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],_=t[14],g=t[15],y=r*s-i*o,v=r*l-n*o,x=r*u-a*o,b=i*l-n*s,w=i*u-a*s,T=n*u-a*l,S=c*m-h*f,E=c*_-p*f,P=c*g-d*f,D=h*_-p*m,F=h*g-d*m,I=p*g-d*_,C=y*I-v*F+x*D+b*P-w*E+T*S;return C?(C=1/C,e[0]=(s*I-l*F+u*D)*C,e[1]=(n*F-i*I-a*D)*C,e[2]=(m*T-_*w+g*b)*C,e[3]=(p*w-h*T-d*b)*C,e[4]=(l*P-o*I-u*E)*C,e[5]=(r*I-n*P+a*E)*C,e[6]=(_*x-f*T-g*v)*C,e[7]=(c*T-p*x+d*v)*C,e[8]=(o*F-s*P+u*S)*C,e[9]=(i*P-r*F-a*S)*C,e[10]=(f*w-m*x+g*y)*C,e[11]=(h*x-c*w-d*y)*C,e[12]=(s*E-o*D-l*S)*C,e[13]=(r*D-i*E+n*S)*C,e[14]=(m*v-f*b-_*y)*C,e[15]=(c*b-h*v+p*y)*C,e):null}function Es(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],_=t[13],g=t[14],y=t[15],v=r[0],x=r[1],b=r[2],w=r[3];return e[0]=v*i+x*s+b*h+w*m,e[1]=v*n+x*l+b*p+w*_,e[2]=v*a+x*u+b*d+w*g,e[3]=v*o+x*c+b*f+w*y,v=r[4],x=r[5],b=r[6],w=r[7],e[4]=v*i+x*s+b*h+w*m,e[5]=v*n+x*l+b*p+w*_,e[6]=v*a+x*u+b*d+w*g,e[7]=v*o+x*c+b*f+w*y,v=r[8],x=r[9],b=r[10],w=r[11],e[8]=v*i+x*s+b*h+w*m,e[9]=v*n+x*l+b*p+w*_,e[10]=v*a+x*u+b*d+w*g,e[11]=v*o+x*c+b*f+w*y,v=r[12],x=r[13],b=r[14],w=r[15],e[12]=v*i+x*s+b*h+w*m,e[13]=v*n+x*l+b*p+w*_,e[14]=v*a+x*u+b*d+w*g,e[15]=v*o+x*c+b*f+w*y,e}function At(e,t,r){var i=r[0],n=r[1],a=r[2],o,s,l,u,c,h,p,d,f,m,_,g;return t===e?(e[12]=t[0]*i+t[4]*n+t[8]*a+t[12],e[13]=t[1]*i+t[5]*n+t[9]*a+t[13],e[14]=t[2]*i+t[6]*n+t[10]*a+t[14],e[15]=t[3]*i+t[7]*n+t[11]*a+t[15]):(o=t[0],s=t[1],l=t[2],u=t[3],c=t[4],h=t[5],p=t[6],d=t[7],f=t[8],m=t[9],_=t[10],g=t[11],e[0]=o,e[1]=s,e[2]=l,e[3]=u,e[4]=c,e[5]=h,e[6]=p,e[7]=d,e[8]=f,e[9]=m,e[10]=_,e[11]=g,e[12]=o*i+c*n+f*a+t[12],e[13]=s*i+h*n+m*a+t[13],e[14]=l*i+p*n+_*a+t[14],e[15]=u*i+d*n+g*a+t[15]),e}function gr(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function qs(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=o*n+c*i,e[6]=s*n+h*i,e[7]=l*n+p*i,e[8]=u*n-a*i,e[9]=c*n-o*i,e[10]=h*n-s*i,e[11]=p*n-l*i,e}function gT(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-u*i,e[1]=o*n-c*i,e[2]=s*n-h*i,e[3]=l*n-p*i,e[8]=a*i+u*n,e[9]=o*i+c*n,e[10]=s*i+h*n,e[11]=l*i+p*n,e}function Pa(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+u*i,e[1]=o*n+c*i,e[2]=s*n+h*i,e[3]=l*n+p*i,e[4]=u*n-a*i,e[5]=c*n-o*i,e[6]=h*n-s*i,e[7]=p*n-l*i,e}function XM(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function KM(e,t,r,i,n){var a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,n!=null&&n!==1/0){var o=1/(i-n);e[10]=(n+i)*o,e[14]=2*n*i*o}else e[10]=-1,e[14]=-2*i;return e}var W1=KM;function QM(e,t,r,i,n,a,o){var s=1/(t-r),l=1/(i-n),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(o+a)*u,e[15]=1,e}var Ln=QM;function JM(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function eI(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],_=e[14],g=e[15],y=t[0],v=t[1],x=t[2],b=t[3],w=t[4],T=t[5],S=t[6],E=t[7],P=t[8],D=t[9],F=t[10],I=t[11],C=t[12],A=t[13],M=t[14],L=t[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-v)<=1e-6*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-x)<=1e-6*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(o-w)<=1e-6*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=1e-6*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-S)<=1e-6*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-P)<=1e-6*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(h-D)<=1e-6*Math.max(1,Math.abs(h),Math.abs(D))&&Math.abs(p-F)<=1e-6*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(d-I)<=1e-6*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(f-C)<=1e-6*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(m-A)<=1e-6*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(_-M)<=1e-6*Math.max(1,Math.abs(_),Math.abs(M))&&Math.abs(g-L)<=1e-6*Math.max(1,Math.abs(g),Math.abs(L))}function yT(){var e=new Yt(3);return Yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Y1(e){var t=new Yt(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ui(e){var t=e[0],r=e[1],i=e[2];return Math.sqrt(t*t+r*r+i*i)}function U3(e,t,r){var i=new Yt(3);return i[0]=e,i[1]=t,i[2]=r,i}function vi(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function I_(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Xe(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function vd(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e}function k_(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+i*i+n*n)}function tI(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function Cr(e,t){var r=t[0],i=t[1],n=t[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Mt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function jr(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=n*l-a*s,e[1]=a*o-i*l,e[2]=i*s-n*o,e}function rI(e,t,r,i){var n=t[0],a=t[1],o=t[2];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=o+i*(r[2]-o),e}function iI(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[3]*i+r[7]*n+r[11]*a+r[15];return o||(o=1),e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/o,e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/o,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/o,e}function nI(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e}function W0(e,t,r){var i=r[0],n=r[1],a=r[2],o=r[3],s=t[0],l=t[1],u=t[2],c=n*u-a*l,h=a*s-i*u,p=i*l-n*s;return c+=c,h+=h,p+=p,e[0]=s+o*c+n*p-a*h,e[1]=l+o*h+a*c-i*p,e[2]=u+o*p+i*h-n*c,e}function gu(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function xs(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function Y0(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function aI(e){return e[0]=0,e[1]=0,e[2]=0,e}var $n=I_,xd=Ui;(function(){var e=yT();return function(t,r,i,n,a,o){var s,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}})();function oI(){var e=new Yt(4);return Yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function sI(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function lI(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function uI(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function cI(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*r+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=i*o,e[2]=n*o,e[3]=a*o,e}function nr(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,e}var hI=lI;(function(){var e=oI();return function(t,r,i,n,a,o){var s,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}})();function $3(){var e=new Yt(4);return Yt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function pI(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function dI(e,t,r){r*=.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function fI(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=r[0],l=r[1],u=r[2],c=r[3];return e[0]=i*c+o*s+n*u-a*l,e[1]=n*c+o*l+a*s-i*u,e[2]=a*c+o*u+i*l-n*s,e[3]=o*c-i*s-n*l-a*u,e}function rd(e,t,r,i){var n=t[0],a=t[1],o=t[2],s=t[3],l=r[0],u=r[1],c=r[2],h=r[3],p,d=n*l+a*u+o*c+s*h,f,m,_;return d<0&&(d=-d,l=-l,u=-u,c=-c,h=-h),1-d>1e-6?(p=Math.acos(d),f=Math.sin(p),m=Math.sin((1-i)*p)/f,_=Math.sin(i*p)/f):(m=1-i,_=i),e[0]=m*n+_*l,e[1]=m*a+_*u,e[2]=m*o+_*c,e[3]=m*s+_*h,e}function mI(e,t){var r=t[0]+t[4]+t[8],i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);var a=(n+1)%3,o=(n+2)%3;i=Math.sqrt(t[n*3+n]-t[a*3+a]-t[o*3+o]+1),e[n]=.5*i,i=.5/i,e[3]=(t[a*3+o]-t[o*3+a])*i,e[a]=(t[a*3+n]+t[n*3+a])*i,e[o]=(t[o*3+n]+t[n*3+o])*i}return e}function z_(e,t,r,i){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",a=Math.PI/360;t*=a,i*=a,r*=a;var o=Math.sin(t),s=Math.cos(t),l=Math.sin(r),u=Math.cos(r),c=Math.sin(i),h=Math.cos(i);switch(n){case"xyz":e[0]=o*u*h+s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h-o*l*c;break;case"xzy":e[0]=o*u*h-s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h+o*l*c;break;case"yxz":e[0]=o*u*h+s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h+o*l*c;break;case"yzx":e[0]=o*u*h+s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h-o*l*c;break;case"zxy":e[0]=o*u*h-s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h-o*l*c;break;case"zyx":e[0]=o*u*h-s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h+o*l*c;break;default:throw Error("Unknown angle order "+n)}return e}var gI=sI,q3=cI;(function(){var e=yT(),t=U3(1,0,0),r=U3(0,1,0);return function(i,n,a){var o=Mt(n,a);return o<-.999999?(jr(e,t,n),xd(e)<1e-6&&jr(e,r,n),Cr(e,e),dI(i,e,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(jr(e,n,a),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+o,q3(i,i))}})(),(function(){var e=$3(),t=$3();return function(r,i,n,a,o,s){return rd(e,i,o,s),rd(t,n,a,s),rd(r,e,t,2*s*(1-s)),r}})(),(function(){var e=mT();return function(t,r,i,n){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],q3(t,mI(t,e))}})();function X1(){var e=new Yt(2);return Yt!=Float32Array&&(e[0]=0,e[1]=0),e}function G3(e,t){var r=new Yt(2);return r[0]=e,r[1]=t,r}function Z3(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function H3(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function yI(e){var t=e[0],r=e[1];return t*t+r*r}function _I(e,t){return e[0]*t[0]+e[1]*t[1]}function W3(e){return e[0]=0,e[1]=0,e}var vI=yI;(function(){var e=X1();return function(t,r,i,n,a,o){var s,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}})();var R=8192;function ii(e,t,r){return t*(R/(e.tileSize*2**(r-e.tileID.overscaledZ)))}function Xt(e){return e instanceof Error?e:Error(typeof e=="string"?e:String(e))}function On(){return new Float64Array(4)}function Fe(){return new Float64Array(3)}function uo(){return new Float64Array(16)}function Sp(){let e=new Float64Array(16);return Gi(e),e}function _T(){let e=new Float32Array(16);return Gi(e),e}function Fa(e,t,r,i,n=!1){if(!r[0]&&!r[1])return[0,0];let a=n?i==="map"?-e.bearingInRadians:0:i==="viewport"?e.bearingInRadians:0;if(a){let o=Math.sin(a),s=Math.cos(a);r=[r[0]*s-r[1]*o,r[0]*o+r[1]*s]}return[n?r[0]:ii(t,r[0],e.zoom),n?r[1]:ii(t,r[1],e.zoom)]}function K1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]}function fi(e,t,r){let i=ZM([e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2]]);if(i===0)return null;let n=jr([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),a=jr([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),o=jr([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),s=Xe([],n,-e[3]);return vi(s,s,Xe([],a,-t[3])),vi(s,s,Xe([],o,-r[3])),Xe(s,s,1/i),s}function xI(e,t,r){let i=e[0]*r[0]+e[1]*r[1]+e[2]*r[2],n=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];return n===0?null:(-i-r[3])/n}function Ep(e,t,r,i){let n=Math.sqrt(e*e+t*t),a=Math.sqrt(r*r+i*i);e/=n,t/=n,r/=a,i/=a;let o=e*r+t*i,s=Math.acos(o);return-t*r+e*i>0?s:-s}function Lr(e,t){let r=xo(e,360),i=xo(t,360),n=i-r,a=i>r?n-360:n+360;return Math.abs(n)<Math.abs(a)?n:a}function Cp(e,t){let r=xo(e,Math.PI*2),i=xo(t,Math.PI*2);return Math.min(Math.abs(r-i),Math.abs(r-i+Math.PI*2),Math.abs(r-i-Math.PI*2))}function xo(e,t){return(e%t+t)%t}function Fu(e,t,r,i,n){return Ma(i,n,Q((e-t)/(r-t),0,1))}function Ma(e,t,r){return e*(1-r)+t*r}function bI(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y);return[t,r,i,n]}function wI(e){if(!e.length)return new Set;let t=Math.max(...e.map(l=>l.canonical.z)),r=1/0,i=-1/0,n=1/0,a=-1/0,o=[];for(let l of e){let{x:u,y:c,z:h}=l.canonical,p=2**(t-h),d=u*p,f=c*p;o.push({id:l,x:d,y:f}),d<r&&(r=d),d>i&&(i=d),f<n&&(n=f),f>a&&(a=f)}let s=new Set;for(let l of o)(l.x===r||l.x===i||l.y===n||l.y===a)&&s.add(l.id);return s}function TI(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function F_(e,t,r,i){return UM(e,t,r,i)}var Q1=F_(.25,.1,.25,1);function Q(e,t,r){return Math.min(r,Math.max(t,e))}function xi(e,t,r){let i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function J(e,...t){for(let r of t)for(let i in r)e[i]=r[i];return e}function Qd(e,t){let r={};for(let i of t)i in e&&(r[i]=e[i]);return r}var SI=1;function vT(){return SI++}function EI(e){return Math.log(e)/Math.LN2%1==0}function CI(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function Bt(e){return 2**e}function Ut(e){return Math.log(e)/Math.LN2}function Jr(e,t,r){if(t<=0)return e;let i=1/t;return r===void 0||Math.abs(r)<1e-10?Math.round(e*i)/i:(r>0?Math.ceil(e*i-1e-9):Math.floor(e*i+1e-10))/i}function R_(e,t,r){let i={};for(let n in e)i[n]=t.call(r||this,e[n],n,e);return i}function xT(e,t,r){let i={};for(let n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function un(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!un(e[r],t[r]))return!1;return!0}if(typeof e=="object"&&e&&t!==null){if(typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!un(e[r],t[r]))return!1;return!0}return e===t}function Or(e){return Array.isArray(e)?e.map(Or):typeof e=="object"&&e?R_(e,Or):e}var Y3={};function we(e){Y3[e]||(typeof console<"u"&&console.warn(e),Y3[e]=!0)}function Da(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function PI(e,t,r,i){let n=t.y-e.y,a=t.x-e.x,o=i.y-r.y,s=i.x-r.x,l=o*a-s*n;if(l===0)return null;let u=e.y-r.y,c=e.x-r.x,h=(s*u-o*c)/l;return new k(e.x+h*a,e.y+h*n)}function bT([e,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,[e*Math.cos(t)*Math.sin(r),e*Math.sin(t)*Math.sin(r),e*Math.cos(r)]}function Gs(e){return typeof WorkerGlobalScope<"u"&&e!==void 0&&e instanceof WorkerGlobalScope}function DI(e){let t=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(e.replace(t,(i,n,a,o)=>{let s=a||o;return r[n]=!s||s.toLowerCase(),""}),r["max-age"]){let i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}var X0=null;function AI(e){if(X0==null){let t=e.navigator?e.navigator.userAgent:null;X0=!!e.safari||!!(t&&(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return X0}function fo(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}var MI=async(e,t)=>{let r=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(r,t)}catch(i){throw Error(`Could not load image because of ${Xt(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},II=e=>new Promise((t,r)=>{let i=new Image;i.onload=()=>{t(i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame(()=>i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},i.onerror=()=>r(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."));let n=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=URL.createObjectURL(n)});function kI(e,t,r,i,n){let a=Math.max(-t,0)*4,o=(Math.max(0,r)-r)*i*4+a,s=i*4,l=Math.max(0,t),u=Math.max(0,r),c=Math.min(e.width,t+i),h=Math.min(e.height,r+n);return{rect:{x:l,y:u,width:c-l,height:h-u},layout:[{offset:o,stride:s}]}}async function zI(e,t,r,i,n){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(e,{timestamp:0});try{let o=a?.format;if(!o||!(o.startsWith("BGR")||o.startsWith("RGB")))throw Error(`Unrecognized format ${o}`);let s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(await a.copyTo(l,kI(e,t,r,i,n)),s)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{a.close()}}function bd(e,t,r,i){return e.addEventListener(t,r,i),{unsubscribe:()=>{e.removeEventListener(t,r,i)}}}function Je(e){return e*Math.PI/180}function Ni(e){return e/Math.PI*180}function wT(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing}function FI(e){let t=new Float64Array(9);WM(t,e);let r=Ni(-Math.asin(Q(t[2],-1,1))),i,n;return Math.hypot(t[5],t[8])<.001?(i=0,n=-Ni(Math.atan2(t[3],t[4]))):(i=Ni(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),n=Ni(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:i,pitch:r+90,bearing:n}}function RI(e,t,r){let i=G3(t.x-r.x,t.y-r.y),n=G3(e.x-r.x,e.y-r.y),a=i[0]*n[1]-i[1]*n[0];return Ni(Math.atan2(a,_I(i,n)))}function X3(e,t,r){let i=new Float64Array(4);return z_(i,e,t-90,r),i}var Zi=85.051129,TT={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},ST={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0};function LI(e,t){return TT[t]&&"touches"in e}function BI(e,t){if(!ST[t])return!1;let r=e,i=r?.target?.ownerDocument?.defaultView||window;return r instanceof i.MouseEvent||r instanceof i.WheelEvent}function OI(e){return TT[e]||ST[e]}var K3="AbortError",pc=class extends Error{constructor(e=K3){super(e instanceof Error?e.message:e),this.name=K3,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function Ra(e){return e instanceof Error&&e.name==="AbortError"}function L_(e){if(e.aborted)throw new pc(e.reason)}var Pp,K0,Q0,Nr={frame(e,t,r,i){let n=i||window,a=n.requestAnimationFrame(s=>{o(),t(s)}),{unsubscribe:o}=bd(e.signal,"abort",()=>{o(),n.cancelAnimationFrame(a),r(new pc(e.signal.reason))},!1)},frameAsync(e,t){return new Promise((r,i)=>{this.frame(e,r,i,t)})},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t;if(M_()&&!dT())t=new OffscreenCanvas(e.width,e.height).getContext("2d",{willReadFrequently:!0});else{let r=window.document.createElement("canvas");r.width=e.width,r.height=e.height,t=r.getContext("2d",{willReadFrequently:!0})}if(!t)throw Error("failed to create canvas 2d context");return t.drawImage(e,0,0,e.width,e.height),t},resolveURL(e){return Pp||(Pp=document.createElement("a")),Pp.href=e,Pp.href},get hardwareConcurrency(){return typeof navigator<"u"&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return Q0===void 0?matchMedia?(K0??(K0=matchMedia("(prefers-reduced-motion: reduce)")),K0.matches):!1:Q0},set prefersReducedMotion(e){Q0=e}},jI=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function Be(){return jI.getCurrentTime()}var NI=new Set("a.abbr.b.bdi.bdo.br.cite.code.del.div.em.i.img.ins.kbd.li.mark.ol.p.q.s.samp.small.span.strong.sub.sup.time.u.ul.var.wbr".split(".")),VI=new Set(["alt","class","datetime","dir","height","href","hreflang","lang","referrerpolicy","rel","role","src","target","title","translate","type","width"]),UI=new Set(["href","src"]),$I=new Set(["http:","https:","mailto:"]),J0;function e1(){return J0??(J0={getAttribute:Element.prototype.getAttribute,getAttributeNames:Element.prototype.getAttributeNames,querySelectorAll:Element.prototype.querySelectorAll,remove:Element.prototype.remove,removeAttribute:Element.prototype.removeAttribute,localName:Object.getOwnPropertyDescriptor(Element.prototype,"localName").get,namespaceURI:Object.getOwnPropertyDescriptor(Element.prototype,"namespaceURI").get}),J0}var Ne,ht=(Ne=class{static create(t,r,i){let n=window.document.createElement(t);return r!==void 0&&(n.className=r),i&&i.appendChild(n),n}static createNS(t,r){return window.document.createElementNS(t,r)}static disableDrag(){Ne.docStyle&&Ne.selectProp&&(Ne.userSelect=Ne.docStyle[Ne.selectProp],Ne.docStyle[Ne.selectProp]="none")}static enableDrag(){Ne.docStyle&&Ne.selectProp&&(Ne.docStyle[Ne.selectProp]=Ne.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",Ne.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Ne.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",Ne.suppressClickInternal,!0)},0)}static getScale(t){let r=t.getBoundingClientRect();return{x:r.width/t.offsetWidth||1,y:r.height/t.offsetHeight||1,boundingClientRect:r}}static getPoint(t,r,i){let n=r.boundingClientRect;return new k((i.clientX-n.left)/r.x-t.clientLeft,(i.clientY-n.top)/r.y-t.clientTop)}static mousePos(t,r){let i=Ne.getScale(t);return Ne.getPoint(t,i,r)}static touchPos(t,r){let i=[],n=Ne.getScale(t);for(let a of r)i.push(Ne.getPoint(t,n,a));return i}static sanitize(t){let r=new DOMParser().parseFromString(t,"text/html").body,{querySelectorAll:i,remove:n}=e1();for(let o of Array.from(i.call(r,"*")))Ne.isAllowedElement(o)?Ne.removeDisallowedAttributes(o):n.call(o);let a=document.createDocumentFragment();return a.append(...r.childNodes),a}static isAllowedElement(t){let{namespaceURI:r,localName:i}=e1();return r.call(t)==="http://www.w3.org/1999/xhtml"&&NI.has(i.call(t))}static removeDisallowedAttributes(t){let{getAttributeNames:r,getAttribute:i,removeAttribute:n}=e1();for(let a of r.call(t))Ne.isAllowedAttribute(a,i.call(t,a))||n.call(t,a)}static isAllowedAttribute(t,r){if(!VI.has(t)&&!t.startsWith("aria-"))return!1;if(!UI.has(t))return!0;try{return $I.has(new URL(r,"https://maplibre.invalid/").protocol)}catch{return!1}}},Ne.docStyle=typeof window<"u"&&window.document?.documentElement.style,Ne.selectProp=!Ne.docStyle||"userSelect"in Ne.docStyle?"userSelect":"webkitUserSelect",Ne),bo={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ET(e){return bo.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}var J1="global-dispatcher",wd=class extends Error{constructor(e,t,r,i){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=i}};function B_(){if(Gs(self))return self.worker?.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}var qI=e=>e.startsWith("file:")||B_()?.startsWith("file:")&&!/^\w+:/.test(e);async function GI(e,t){let r=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:B_(),referrerPolicy:e.referrerPolicy,signal:t.signal});e.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=await fetch(r)}catch(o){throw Ra(o)?o:new wd(0,Xt(o).message,e.url,new Blob)}if(!i.ok){let o=await i.blob();throw new wd(i.status,i.statusText,e.url,o)}let n;n=e.type==="arrayBuffer"||e.type==="image"?i.arrayBuffer():e.type==="json"?i.json():i.text();let a=await n;return L_(t.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}}function ZI(e,t){return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open(e.method||"GET",e.url,!0),(e.type==="arrayBuffer"||e.type==="image")&&(n.responseType="arraybuffer");for(let a in e.headers)n.setRequestHeader(a,e.headers[a]);e.type==="json"&&(n.responseType="text",e.headers?.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=e.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!t.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(e.type==="json")try{a=JSON.parse(n.response)}catch(o){i(o);return}r({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let a=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new wd(n.status,n.statusText,e.url,a))}},t.signal.addEventListener("abort",()=>{n.abort(),i(new pc(t.signal.reason))}),n.send(e.body)})}var Jd=async function(e,t){if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let r=ET(e.url);if(r){let i=await r(e,t);return!i.data&&e.type==="arrayBuffer"?J(i,{data:new ArrayBuffer(0)}):i}if(Gs(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:J1},t)}if(!qI(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return GI(e,t);if(Gs(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:J1},t)}return ZI(e,t)},ef=(e,t)=>Jd(J(e,{type:"json"}),t),CT=(e,t)=>Jd(J(e,{type:"arrayBuffer"}),t);function PT(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5),e.startsWith("null")))return!1;if(e.indexOf("://")<=0)return!0;let t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}var HI=e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{t.onloadstart=()=>{r(t)};for(let i of e){let n=window.document.createElement("source");PT(i)||(t.crossOrigin="Anonymous"),n.src=i,t.appendChild(n)}})},Vi;(function(e){let t,r,i,n;e.resetRequestQueue=()=>{t=[],r=0,i=0,n={}},e.addThrottleControl=h=>{let p=i++;return n[p]=h,p},e.removeThrottleControl=h=>{delete n[h],u()};let a=()=>{for(let h of Object.keys(n))if(n[h]())return!0;return!1};async function o(h,p,d,f,m=!0,_){let g=await h.transformRequest(p,d);return L_(f.signal),Vi.getImage(g,f,m,_)}e.transformAndGetImage=o,e.getImage=(h,p,d=!0,f)=>new Promise((m,_)=>{h.headers||(h.headers={}),h.headers.accept="image/webp,*/*",J(h,{type:"image"});let g={abortController:p,requestParameters:h,supportImageRefresh:d,imageBitmapOptions:f,state:"queued",onError:y=>{_(y)},onSuccess:y=>{m(y)}};t.push(g),u()});let s=(h,p)=>typeof createImageBitmap=="function"?MI(h,p):II(h),l=async h=>{h.state="running";let{requestParameters:p,supportImageRefresh:d,imageBitmapOptions:f,onError:m,onSuccess:_,abortController:g}=h,y=d===!1&&!f&&!Gs(self)&&!ET(p.url)&&(!p.headers||Object.keys(p.headers).reduce((x,b)=>x&&b==="accept",!0));r++;let v=y?c(p,g):Jd(p,g);try{let x=await v;delete h.abortController,h.state="completed",x.data instanceof HTMLImageElement||fo(x.data)?_(x):!x.data||x.data.byteLength===0?_({data:null,cacheControl:x.cacheControl,expires:x.expires}):_({data:await s(x.data,f),cacheControl:x.cacheControl,expires:x.expires})}catch(x){delete h.abortController,m(Xt(x))}finally{r--,u()}},u=()=>{let h=a()?bo.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:bo.MAX_PARALLEL_IMAGE_REQUESTS;for(let p=r;p<h&&t.length>0;p++){let d=t.shift();d.abortController.signal.aborted?p--:l(d)}},c=(h,p)=>new Promise((d,f)=>{let m=new Image,_=h.url,g=h.credentials;g&&g==="include"?m.crossOrigin="use-credentials":(g&&g==="same-origin"||!PT(_))&&(m.crossOrigin="anonymous"),p.signal.addEventListener("abort",()=>{m.src="",f(new pc(p.signal.reason))}),m.fetchPriority="high",m.onload=()=>{m.onerror=m.onload=null,d({data:m})},m.onerror=()=>{m.onerror=m.onload=null,!p.signal.aborted&&f(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."))},m.src=_})})(Vi||(Vi={})),Vi.resetRequestQueue();var WI=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}};function Q3(e,t,r){r[e]?.includes(t)||(r[e]||(r[e]=[]),r[e].push(t))}function t1(e,t,r){if(r?.[e]){let i=r[e].indexOf(t);i!==-1&&r[e].splice(i,1)}}var Ao=class{constructor(e,t={}){J(this,t),this.type=e}},ee=class extends Ao{constructor(e,t={}){super("error",J({error:e},t))}},lr=class{on(e,t){return this._listeners||(this._listeners={}),Q3(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return t1(e,t,this._listeners),t1(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||(this._oneTimeListeners={}),Q3(e,t,this._oneTimeListeners),this):new Promise(r=>this.once(e,r))}fire(e,t){let r=typeof e=="string"?new Ao(e,t||{}):e,i=r.type;if(this.listens(i)){r.target=this;let n=this._listeners?.[i]?.slice()??[];for(let s of n)s.call(this,r);let a=this._oneTimeListeners?.[i]?.slice()??[];for(let s of a)t1(i,s,this._oneTimeListeners),s.call(this,r);let o=this._eventedParent;o&&(J(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),o.fire(r))}else r instanceof ee&&console.error(r.error);return this}listens(e){return!!(this._listeners?.[e]?.length||this._oneTimeListeners?.[e]?.length||this._eventedParent?.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}},Wt=class extends Ao{},ne=class extends Wt{},J3=class extends Wt{constructor(e={}){super("style.load",e)}},ji=class extends Wt{constructor(e,t={}){super(e,t),this.dataType="style"}},et=class extends Wt{constructor(e,t={}){super(e,t),this.dataType="source"}},ei=class extends Wt{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r,i={}){r=r instanceof MouseEvent?r:new MouseEvent(e,r);let n=ht.mousePos(t.getCanvas(),r),a=t.unproject(n);super(e,J({point:n,lngLat:a,originalEvent:r},i)),this._defaultPrevented=!1,this.target=t}},Dp=class extends Wt{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){let i=e==="touchend"?r.changedTouches:r.touches,n=ht.touchPos(t.getCanvasContainer(),i),a=n.map(l=>t.unproject(l)),o=n.reduce((l,u,c,h)=>l.add(u.div(h.length)),new k(0,0)),s=t.unproject(o);super(e,{points:n,point:o,lngLats:a,lngLat:s,originalEvent:r}),this._defaultPrevented=!1}},YI=class extends Wt{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}},e5=class extends Wt{},XI=class extends Wt{constructor(e={}){super("terrain",e)}},KI=class extends Wt{constructor(e={}){super("projectiontransition",e)}},r1=class extends Wt{},QI=class extends Wt{constructor(e={}){super("styleimagemissing",e)}},DT={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},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:{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:{},"color-relief":{},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_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,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,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default: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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"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","feature"]},"property-type":"cross-faded-data-driven"},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},z=DT,JI=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ek(e,t){let r={};for(let i in e)i!=="ref"&&(r[i]=e[i]);return JI.forEach(i=>{i in t&&(r[i]=t[i])}),r}function t5(e){e=e.slice();let t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=ek(e[r],t[e[r].ref]));return e}function Le(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Le(e[r],t[r]))return!1;return!0}if(typeof e=="object"&&e&&t!==null){if(typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!Le(e[r],t[r]))return!1;return!0}return e===t}function Qr(e,t){e.push(t)}function AT(e,t,r){Qr(r,{command:"addSource",args:[e,t[e]]})}function MT(e,t,r){Qr(t,{command:"removeSource",args:[e]}),r[e]=!0}function tk(e,t,r,i){MT(e,r,i),AT(e,t,r)}function rk(e,t,r){let i;for(i in e[r])if(Object.prototype.hasOwnProperty.call(e[r],i)&&i!=="data"&&!Le(e[r][i],t[r][i]))return!1;for(i in t[r])if(Object.prototype.hasOwnProperty.call(t[r],i)&&i!=="data"&&!Le(e[r][i],t[r][i]))return!1;return!0}function ik(e,t,r,i){e||(e={}),t||(t={});let n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)||MT(n,r,i));for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)?Le(e[n],t[n])||(e[n].type==="geojson"&&t[n].type==="geojson"&&rk(e,t,n)?Qr(r,{command:"setGeoJSONSourceData",args:[n,t[n].data]}):tk(n,t,r,i)):AT(n,t,r))}function r5(e,t,r,i,n){Qr(t,{command:n,args:[r,i,e[i]]})}function Ap(e,t,r,i,n){e||(e={}),t||(t={});for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&(Le(e[a],t[a])||r5(t,r,i,a,n));for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&!Object.prototype.hasOwnProperty.call(e,a)&&(Le(e[a],t[a])||r5(t,r,i,a,n))}function i5(e){return e.id}function n5(e,t){return e[t.id]=t,e}function nk(e,t,r){e||(e=[]),t||(t=[]);let i=e.map(i5),n=t.map(i5),a=e.reduce(n5,{}),o=t.reduce(n5,{}),s=i.slice(),l=Object.create(null),u,c,h,p,d;for(let f=0,m=0;f<i.length;f++)u=i[f],Object.prototype.hasOwnProperty.call(o,u)?m++:(Qr(r,{command:"removeLayer",args:[u]}),s.splice(s.indexOf(u,m),1));for(let f=0,m=0;f<n.length;f++)u=n[n.length-1-f],s[s.length-1-f]!==u&&(Object.prototype.hasOwnProperty.call(a,u)?(Qr(r,{command:"removeLayer",args:[u]}),s.splice(s.lastIndexOf(u,s.length-m),1)):m++,p=s[s.length-f],Qr(r,{command:"addLayer",args:[o[u],p]}),s.splice(s.length-f,0,u),l[u]=!0);for(let f=0;f<n.length;f++)if(u=n[f],c=a[u],h=o[u],!(l[u]||Le(c,h)))if(!Le(c.source,h.source)||!Le(c["source-layer"],h["source-layer"])||!Le(c.type,h.type))Qr(r,{command:"removeLayer",args:[u]}),p=s[s.lastIndexOf(u)+1],Qr(r,{command:"addLayer",args:[h,p]});else{for(d in Ap(c.layout,h.layout,r,u,"setLayoutProperty"),Ap(c.paint,h.paint,r,u,"setPaintProperty"),Le(c.filter,h.filter)||Qr(r,{command:"setFilter",args:[u,h.filter]}),(!Le(c.minzoom,h.minzoom)||!Le(c.maxzoom,h.maxzoom))&&Qr(r,{command:"setLayerZoomRange",args:[u,h.minzoom,h.maxzoom]}),c)Object.prototype.hasOwnProperty.call(c,d)&&d!=="layout"&&d!=="paint"&&d!=="filter"&&d!=="metadata"&&d!=="minzoom"&&d!=="maxzoom"&&(d.indexOf("paint.")===0?Ap(c[d],h[d],r,u,"setPaintProperty"):Le(c[d],h[d])||Qr(r,{command:"setLayerProperty",args:[u,d,h[d]]}));for(d in h)Object.prototype.hasOwnProperty.call(h,d)&&!Object.prototype.hasOwnProperty.call(c,d)&&d!=="layout"&&d!=="paint"&&d!=="filter"&&d!=="metadata"&&d!=="minzoom"&&d!=="maxzoom"&&(d.indexOf("paint.")===0?Ap(c[d],h[d],r,u,"setPaintProperty"):Le(c[d],h[d])||Qr(r,{command:"setLayerProperty",args:[u,d,h[d]]}))}}function ak(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!Le(e.version,t.version))return[{command:"setStyle",args:[t]}];Le(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),Le(e.state,t.state)||r.push({command:"setGlobalState",args:[t.state]}),Le(e.centerAltitude,t.centerAltitude)||r.push({command:"setCenterAltitude",args:[t.centerAltitude]}),Le(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),Le(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),Le(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),Le(e.roll,t.roll)||r.push({command:"setRoll",args:[t.roll]}),Le(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),Le(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),Le(e["font-faces"],t["font-faces"])||r.push({command:"setFontFaces",args:[t["font-faces"]]}),Le(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),Le(e.light,t.light)||r.push({command:"setLight",args:[t.light]});let i=!Le(e.terrain,t.terrain);i&&!t.terrain&&r.push({command:"setTerrain",args:[void 0]}),Le(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),Le(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});let n={},a=[];ik(e.sources,t.sources,a,n);let o=[];e.layers&&e.layers.forEach(s=>{"source"in s&&n[s.source]?r.push({command:"removeLayer",args:[s.id]}):o.push(s)}),r=r.concat(a),nk(o,t.layers,r),i&&t.terrain&&r.push({command:"setTerrain",args:[t.terrain]})}catch(i){console.warn("Unable to compute style diff:",i),r=[{command:"setStyle",args:[t]}]}return r}var B=class{constructor(e,t,r,i,n="error"){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),this.severity=n,t!=null&&t.__line__&&(this.line=t.__line__)}},dc={kind:"null"},U={kind:"number"},fe={kind:"string"},xe={kind:"boolean"},$i={kind:"color"},tf={kind:"projectionDefinition"},mo={kind:"object"},ge={kind:"value"},ok={kind:"error"},rf={kind:"collator"},fc={kind:"formatted"},nf={kind:"padding"},Zu={kind:"colorArray"},af={kind:"numberArray"},mc={kind:"resolvedImage"},of={kind:"variableAnchorOffsetCollection"};function mr(e,t){return{kind:"array",itemType:e,N:t}}function pt(e){if(e.kind==="array"){let t=pt(e.itemType);return typeof e.N=="number"?`array<${t}, ${e.N}>`:e.itemType.kind==="value"?"array":`array<${t}>`}return e.kind}var sk=[dc,U,fe,xe,$i,tf,fc,mo,mr(ge),nf,af,Zu,mc,of];function Hu(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Hu(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(let r of sk)if(!Hu(r,t))return null}}return`Expected ${pt(e)} but found ${pt(t)} instead.`}function O_(e,t){return t.some(r=>r.kind===e.kind)}function go(e,t){return t.some(r=>r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e)}function xa(e,t){return e.kind==="array"&&t.kind==="array"?e.itemType.kind===t.itemType.kind&&typeof e.N=="number":e.kind===t.kind}var IT=.96422,kT=.82521,zT=4/29,ey=6/29,FT=3*ey*ey,lk=Math.PI/180,uk=180/Math.PI;function RT(e){return e%=360,e<0&&(e+=360),e}function LT([e,t,r,i]){e=i1(e),t=i1(t),r=i1(r);let n,a,o=n1((.2225045*e+.7168786*t+.0606169*r)/1);e===t&&t===r?n=a=o:(n=n1((.4360747*e+.3850649*t+.1430804*r)/IT),a=n1((.0139322*e+.0971045*t+.7141733*r)/kT));let s=116*o-16;return[s<0?0:s,500*(n-o),200*(o-a),i]}function i1(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function n1(e){return e>.008856451679035631?e**(1/3):e/FT+zT}function BT([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,o=isNaN(r)?n:n-r/200;return n=1*o1(n),a=IT*o1(a),o=kT*o1(o),[a1(3.1338561*a-1.6168667*n-.4906146*o),a1(-.9787684*a+1.9161415*n+.033454*o),a1(.0719453*a-.2289914*n+1.4052427*o),i]}function a1(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function o1(e){return e>ey?e*e*e:FT*(e-zT)}function ck(e){let[t,r,i,n]=LT(e),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?RT(Math.atan2(i,r)*uk):NaN,a,t,n]}function hk([e,t,r,i]){return e=isNaN(e)?0:e*lk,BT([r,Math.cos(e)*t,Math.sin(e)*t,i])}function pk([e,t,r,i]){e=RT(e),t/=100,r/=100;function n(a){let o=(a+e/30)%12,s=t*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(o-3,9-o,1))}return[n(0),n(8),n(4),i]}var dk=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Ru(e,t){return dk(e,t)?e[t]:void 0}function fk(e){if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t=Ru(mk,e);if(t){let[i,n,a]=t;return[i/255,n/255,a/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let i=e.length<6?1:2,n=1;return[Mp(e.slice(n,n+=i)),Mp(e.slice(n,n+=i)),Mp(e.slice(n,n+=i)),Mp(e.slice(n,n+i)||"ff")]}if(e.startsWith("rgb")){let i=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[n,a,o,s,l,u,c,h,p,d,f,m]=i,_=[s||" ",c||" ",d].join("");if(_===" "||_===" /"||_===",,"||_===",,,"){let g=[o,u,p].join(""),y=g==="%%%"?100:g===""?255:0;if(y){let v=[Cs(+a/y,0,1),Cs(+l/y,0,1),Cs(+h/y,0,1),f?a5(+f,m):1];if(o5(v))return v}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[i,n,a,o,s,l,u,c,h]=r,p=[a||" ",s||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let d=[+n,Cs(+o,0,100),Cs(+l,0,100),c?a5(+c,h):1];if(o5(d))return pk(d)}}}function Mp(e){return parseInt(e.padEnd(2,e),16)/255}function a5(e,t){return Cs(t?e/100:e,0,1)}function Cs(e,t,r){return Math.min(Math.max(t,e),r)}function o5(e){return!e.some(Number.isNaN)}var mk={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ia(e,t,r){return e+r*(t-e)}function Zs(e,t,r){return e.map((i,n)=>Ia(i,t[n],r))}function gk(e){return e==="rgb"||e==="hcl"||e==="lab"}var Zt,he=(Zt=class{constructor(t,r,i,n=1,a=!0){this.r=t,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,r,i,n]))}static parse(t){if(t instanceof Zt)return t;if(typeof t!="string")return;let r=fk(t);if(r)return new Zt(...r,!1)}get rgb(){let{r:t,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[t/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",ck(this.rgb))}get lab(){return this.overwriteGetter("lab",LT(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,i,n]=this.rgb;return`rgba(${[t,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(t,r,i,n="rgb"){switch(n){case"rgb":{let[a,o,s,l]=Zs(t.rgb,r.rgb,i);return new Zt(a,o,s,l,!1)}case"hcl":{let[a,o,s,l]=t.hcl,[u,c,h,p]=r.hcl,d,f;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u<a&&a-u>180&&(v+=360),d=a+i*v}else isNaN(a)?isNaN(u)?d=NaN:(d=u,(s===1||s===0)&&(f=c)):(d=a,(h===1||h===0)&&(f=o));let[m,_,g,y]=hk([d,f??Ia(o,c,i),Ia(s,h,i),Ia(l,p,i)]);return new Zt(m,_,g,y,!1)}case"lab":{let[a,o,s,l]=BT(Zs(t.lab,r.lab,i));return new Zt(a,o,s,l,!1)}}}},Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1),Zt),yk=["bottom","center","top"],ty=class{constructor(e,t,r,i,n,a){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},qn=class id{constructor(t){this.sections=t}static fromString(t){return new id([new ty(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof id?t:id.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}},_n=class Pu{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Pu)return t;if(typeof t=="number")return new Pu([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Pu(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new Pu(Zs(t.values,r.values,i))}},vn=class Du{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Du)return t;if(typeof t=="number")return new Du([t]);if(Array.isArray(t)){for(let r of t)if(typeof r!="number")return;return new Du(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new Du(Zs(t.values,r.values,i))}},Ti=class Au{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Au)return t;if(typeof t=="string"){let i=he.parse(t);return i?new Au([i]):void 0}if(!Array.isArray(t))return;let r=[];for(let i of t){if(typeof i!="string")return;let n=he.parse(i);if(!n)return;r.push(n)}return new Au(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n="rgb"){let a=[];if(t.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let o=0;o<t.values.length;o++)a.push(he.interpolate(t.values[o],r.values[o],i,n));return new Au(a)}},at=class extends Error{constructor(e,t){super(e),this.name="RuntimeError",this.path=t}toJSON(){return this.message}},_k=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),mn=class nd{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof nd)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let r=0;r<t.length;r+=2){let i=t[r],n=t[r+1];if(typeof i!="string"||!_k.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")return}return new nd(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n){let a=t.values,o=r.values;if(a.length!==o.length)throw new at(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`,n);let s=[];for(let l=0;l<a.length;l+=2){if(a[l]!==o[l])throw new at(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${a[l]}, to[${l}]: ${o[l]}`,n);s.push(a[l]);let[u,c]=a[l+1],[h,p]=o[l+1];s.push([Ia(u,h,i),Ia(c,p,i)])}return new nd(s)}},gn=class OT{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new OT({name:t,available:!1}):null}},ja=class Ps{constructor(t,r,i){this.from=t,this.to=r,this.transition=i}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,r,i){return new Ps(t,r,i)}static parse(t){if(t instanceof Ps)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number")return new Ps(t[0],t[1],t[2]);if(typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number")return new Ps(t.from,t.to,t.transition);if(typeof t=="string")return new Ps(t,t,1)}},j_=class{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};function jT(e,t,r,i){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Hs(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof ja||e instanceof he||e instanceof j_||e instanceof qn||e instanceof _n||e instanceof vn||e instanceof Ti||e instanceof mn||e instanceof gn)return!0;if(Array.isArray(e)){for(let t of e)if(!Hs(t))return!1;return!0}if(typeof e=="object"){for(let t in e)if(!Hs(e[t]))return!1;return!0}return!1}function St(e){if(e===null)return dc;if(typeof e=="string")return fe;if(typeof e=="boolean")return xe;if(typeof e=="number")return U;if(e instanceof he)return $i;if(e instanceof ja)return tf;if(e instanceof j_)return rf;if(e instanceof qn)return fc;if(e instanceof _n)return nf;if(e instanceof vn)return af;if(e instanceof Ti)return Zu;if(e instanceof mn)return of;if(e instanceof gn)return mc;if(Array.isArray(e)){let t=e.length,r;for(let i of e){let n=St(i);if(!r)r=n;else{if(r===n)continue;r=ge;break}}return mr(r||ge,t)}return mo}function Lu(e){let t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof he||e instanceof ja||e instanceof qn||e instanceof _n||e instanceof vn||e instanceof Ti||e instanceof mn||e instanceof gn?e.toString():JSON.stringify(e)}var Ws=class NT{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Hs(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let i=t[1],n=St(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new NT(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},vk=["Unknown","Point","LineString","Polygon"],VT=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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"?vk[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=he.parse(e),this._parseColorCache.set(e,t)),t}};function sf(e,t,r){let i=e.length-1,n=0,a=i,o=0,s,l;for(;n<=a;)if(o=Math.floor((n+a)/2),s=e[o],l=e[o+1],s<=t){if(o===i||t<l)return o;n=o+1}else if(s>t)a=o-1;else throw new at("Input is not a number.",r);return 0}var N_=class UT{constructor(t,r,i,n){this.type=t,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,o]of i)this.labels.push(a),this.outputs.push(o)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(t[1],1,U);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let o=1;o<t.length;o+=2){let s=o===1?-1/0:t[o],l=t[o+1],u=o,c=o+1;if(typeof s!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let h=r.parse(l,c,a);if(!h)return null;a||(a=h.type),n.push([s,h])}return new UT(a,i,n,r.key)}evaluate(t){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(t):i[sf(r,n,this.key)].evaluate(t)}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function xk(e,t,r,i){let n=3*e,a=3*(r-e)-n,o=1-n-a,s=3*t,l=3*(i-t)-s,u=1-s-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let m=0;m<8;m++){let _=((o*p+a)*p+n)*p-c;if(Math.abs(_)<h)return((u*p+l)*p+s)*p;let g=(3*o*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=_/g}let d=0,f=1;p=c;for(let m=0;m<20;m++){let _=((o*p+a)*p+n)*p;if(Math.abs(_-c)<h)break;c>_?d=p:f=p,p=(d+f)*.5}return((u*p+l)*p+s)*p}}var Si=class ry{constructor(t,r,i,n,a,o){this.type=t,this.operator=r,this.interpolation=i,this.input=n,this.key=o,this.labels=[],this.outputs=[];for(let[s,l]of a)this.labels.push(s),this.outputs.push(l)}static interpolationFactor(t,r,i,n){let a=0;if(t.name==="exponential")a=s1(r,t.base,i,n);else if(t.name==="linear")a=s1(r,1,i,n);else if(t.name==="cubic-bezier"){let o=t.controlPoints;a=xk(o[0],o[1],o[2],o[3])(s1(r,1,i,n))}return a}static parse(t,r){let[i,n,a,...o]=t;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,U),!a)return null;let s=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=Zu?l=$i:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<o.length;u+=2){let c=o[u],h=o[u+1],p=u+3,d=u+4;if(typeof c!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(s.length&&s[s.length-1][0]>=c)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);let f=r.parse(h,d,l);if(!f)return null;l||(l=f.type),s.push([c,f])}return!xa(l,U)&&!xa(l,tf)&&!xa(l,$i)&&!xa(l,nf)&&!xa(l,af)&&!xa(l,Zu)&&!xa(l,of)&&!xa(l,mr(U))?r.error(`Type ${pt(l)} is not interpolatable.`):new ry(l,i,n,a,s,r.key)}evaluate(t){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);let o=sf(r,n,this.key),s=r[o],l=r[o+1],u=ry.interpolationFactor(this.interpolation,n,s,l),c=i[o].evaluate(t),h=i[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ia(c,h,u);case"color":return he.interpolate(c,h,u);case"padding":return _n.interpolate(c,h,u);case"colorArray":return Ti.interpolate(c,h,u);case"numberArray":return vn.interpolate(c,h,u);case"variableAnchorOffsetCollection":return mn.interpolate(c,h,u,this.key);case"array":return Zs(c,h,u);case"projectionDefinition":return ja.interpolate(c,h,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return he.interpolate(c,h,u,"hcl");case"colorArray":return Ti.interpolate(c,h,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return he.interpolate(c,h,u,"lab");case"colorArray":return Ti.interpolate(c,h,u,"lab")}}}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function s1(e,t,r,i){let n=i-r,a=e-r;return n===0?0:t===1?a/n:(t**+a-1)/(t**+n-1)}var ot={color:he.interpolate,number:Ia,padding:_n.interpolate,numberArray:vn.interpolate,colorArray:Ti.interpolate,variableAnchorOffsetCollection:mn.interpolate,array:Zs},$T=class qT{constructor(t){this.type=fc,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let o=1;o<=t.length-1;++o){let s=t[o];if(a&&typeof s=="object"&&!Array.isArray(s)){a=!1;let l=null;if(s["font-scale"]&&(l=r.parse(s["font-scale"],1,U),!l))return null;let u=null;if(s["text-font"]&&(u=r.parse(s["text-font"],1,mr(fe)),!u))return null;let c=null;if(s["text-color"]&&(c=r.parse(s["text-color"],1,$i),!c))return null;let h=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!yk.includes(s["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);if(h=r.parse(s["vertical-align"],1,fe),!h)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=c,p.verticalAlign=h}else{let l=r.parse(t[o],1,ge);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new qT(n)}evaluate(t){return new qn(this.sections.map(r=>{let i=r.content.evaluate(t);return St(i)===mc?new ty("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new ty(Lu(i),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)}))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}};function GT(e,t,r=0,i=e.length-1,n=bk){for(;i>r;){if(i-r>600){let l=i-r+1,u=t-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);GT(e,t,Math.max(r,Math.floor(t-u*h/l+p)),Math.min(i,Math.floor(t+(l-u)*h/l+p)),n)}let a=e[t],o=r,s=i;for(yu(e,r,t),n(e[i],a)>0&&yu(e,r,i);o<s;){for(yu(e,o,s),o++,s--;n(e[o],a)<0;)o++;for(;n(e[s],a)>0;)s--}n(e[r],a)===0?yu(e,r,s):(s++,yu(e,s,i)),s<=t&&(r=s+1),t<=s&&(i=s-1)}}function yu(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function bk(e,t){return e<t?-1:+(e>t)}function lf(e,t){if(e.length<=1)return[e];let r=[],i,n;for(let a of e){let o=Tk(a);o!==0&&(a.area=Math.abs(o),n===void 0&&(n=o<0),n===o<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),t>1)for(let a=0;a<r.length;a++)r[a].length<=t||(GT(r[a],t,1,r[a].length-1,wk),r[a]=r[a].slice(0,t));return r}function wk(e,t){return t.area-e.area}function Tk(e){let t=0;for(let r=0,i=e.length,n=i-1,a,o;r<i;n=r++)a=e[r],o=e[n],t+=(o.x-a.x)*(a.y+o.y);return t}var Ip={string:fe,number:U,boolean:xe,object:mo},Bn=class ZT{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=1,n,a=t[0];if(a==="array"){let s;if(t.length>2){let u=t[1];if(typeof u!="string"||!(u in Ip)||u==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=Ip[u],i++}else s=ge;let l;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);l=t[2],i++}n=mr(s,l)}else{if(!Ip[a])throw Error(`Types doesn't contain name = ${a}`);n=Ip[a]}let o=[];for(;i<t.length;i++){let s=r.parse(t[i],i,ge);if(!s)return null;o.push(s)}return new ZT(n,o,r.key)}evaluate(t){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(t);if(!Hu(this.type,St(i)))return i;if(r===this.args.length-1)throw new at(`Expected value to be of type ${pt(this.type)}, but found ${pt(St(i))} instead.`,this.key)}throw Error()}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},s5={"to-boolean":xe,"to-color":$i,"to-number":U,"to-string":fe},ks=class HT{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[0];if(!s5[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&t.length!==2)return r.error("Expected one argument.");let n=s5[i],a=[];for(let o=1;o<t.length;o++){let s=r.parse(t[o],o,ge);if(!s)return null;a.push(s)}return new HT(n,a,r.key)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,i;for(let n of this.args){if(r=n.evaluate(t),i=null,r instanceof he)return r;if(typeof r=="string"){let a=t.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(i=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:jT(r[0],r[1],r[2],r[3]),!i))return new he(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new at(i||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(t);let n=_n.parse(r);if(n)return n}throw new at(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=vn.parse(r);if(n)return n}throw new at(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=Ti.parse(r);if(n)return n}throw new at(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(t);let n=mn.parse(r);if(n)return n}throw new at(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(t),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new at(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return qn.fromString(Lu(this.args[0].evaluate(t)));case"resolvedImage":return gn.fromString(Lu(this.args[0].evaluate(t)));case"projectionDefinition":{let r=this.args[0].evaluate(t);if(ja.parse(r))return r;throw new at(`Could not parse projectionDefinition from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}default:return Lu(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},WT=class YT{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let i=[];for(let a=1;a<t.length-1;a+=2){let o=t[a];if(typeof o!="string")return r.error(`Expected string, but found ${typeof o} instead.`,a);if(/[^a-zA-Z0-9_]/.test(o))return r.error("Variable names must contain only alphanumeric characters or '_'.",a);let s=r.parse(t[a+1],a+1);if(!s)return null;i.push([o,s])}let n=r.parse(t[t.length-1],t.length-1,r.expectedType,i);return n?new YT(i,n):null}outputDefined(){return this.result.outputDefined()}},XT=class KT{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let i=t[1];return r.scope.has(i)?new KT(i,r.scope.get(i)):r.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}},Sk=class QT{constructor(t,r,i,n){this.type=t,this.index=r,this.input=i,this.key=n}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,U),n=r.parse(t[2],2,mr(r.expectedType||ge));if(!i||!n)return null;let a=n.type;return new QT(a.itemType,i,n,r.key)}evaluate(t){let r=this.index.evaluate(t),i=this.input.evaluate(t);if(r<0)throw new at(`Array index out of bounds: ${r} < 0.`,this.key);if(r>=i.length)throw new at(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new at(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}},Ek=class JT{constructor(t,r,i){this.needle=t,this.haystack=r,this.key=i,this.type=xe}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,ge),n=r.parse(t[2],2,ge);return!i||!n?null:O_(i.type,[xe,fe,U,dc,ge])?new JT(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${pt(i.type)} instead`)}evaluate(t){let r=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!go(r,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${pt(St(r))} instead.`,this.key);if(!go(i,["string","array"]))throw new at(`Expected second argument to be of type array or string, but found ${pt(St(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}},Ck=class iy{constructor(t,r,i,n){this.needle=t,this.haystack=r,this.key=i,this.fromIndex=n,this.type=U}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,ge),n=r.parse(t[2],2,ge);if(!i||!n)return null;if(!O_(i.type,[xe,fe,U,dc,ge]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${pt(i.type)} instead`);if(t.length===4){let a=r.parse(t[3],3,U);return a?new iy(i,n,r.key,a):null}return new iy(i,n,r.key)}evaluate(t){let r=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!go(r,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${pt(St(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),go(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(go(i,["array"]))return i.indexOf(r,n);throw new at(`Expected second argument to be of type array or string, but found ${pt(St(i))} instead.`,this.key)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}},Pk=class eS{constructor(t,r,i,n,a,o){this.inputType=t,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=o}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},o=[];for(let u=2;u<t.length-1;u+=2){let c=t[u],h=t[u+1];Array.isArray(c)||(c=[c]);let p=r.concat(u);if(c.length===0)return p.error("Expected at least one branch label.");for(let f of c){if(typeof f!="number"&&typeof f!="string")return p.error("Branch labels must be numbers or strings.");if(typeof f=="number"&&Math.abs(f)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof f=="number"&&Math.floor(f)!==f)return p.error("Numeric branch labels must be integer values.");if(!i)i=St(f);else if(p.checkSubtype(i,St(f)))return null;if(a[String(f)]!==void 0)return p.error("Branch labels must be unique.");a[String(f)]=o.length}let d=r.parse(h,u,n);if(!d)return null;n||(n=d.type),o.push(d)}let s=r.parse(t[1],1,ge);if(!s)return null;let l=r.parse(t[t.length-1],t.length-1,n);return!l||s.type.kind!=="value"&&r.concat(1).checkSubtype(i,s.type)?null:new eS(i,n,s,a,o,l)}evaluate(t){let r=this.input.evaluate(t);return(St(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}},Dk=class tS{constructor(t,r,i){this.type=t,this.branches=r,this.otherwise=i}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let o=1;o<t.length-1;o+=2){let s=r.parse(t[o],o,xe);if(!s)return null;let l=r.parse(t[o+1],o+1,i);if(!l)return null;n.push([s,l]),i||(i=l.type)}let a=r.parse(t[t.length-1],t.length-1,i);if(!a)return null;if(!i)throw Error("Can't infer output type");return new tS(i,n,a)}evaluate(t){for(let[r,i]of this.branches)if(r.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[r,i]of this.branches)t(r),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},Ak=class ny{constructor(t,r,i,n,a){this.type=t,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,ge),n=r.parse(t[2],2,U);if(!i||!n)return null;if(!O_(i.type,[mr(ge),fe,ge]))return r.error(`Expected first argument to be of type array or string, but found ${pt(i.type)} instead`);if(t.length===4){let a=r.parse(t[3],3,U);return a?new ny(i.type,i,n,r.key,a):null}return new ny(i.type,i,n,r.key)}evaluate(t){let r=this.input.evaluate(t),i=this.beginIndex.evaluate(t),n;if(this.endIndex&&(n=this.endIndex.evaluate(t)),go(r,["string"]))return[...r].slice(i,n).join("");if(go(r,["array"]))return r.slice(i,n);throw new at(`Expected first argument to be of type array or string, but found ${pt(St(r))} instead.`,this.key)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}},rS=class ay{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let o of t.slice(1)){let s=r.parse(o,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!s)return null;i||(i=s.type),a.push(s)}if(!i)throw Error("No output type");return n&&a.some(o=>Hu(n,o.type))?new ay(ge,a):new ay(i,a)}evaluate(t){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(t),r&&r instanceof gn&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}};function l5(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Mk(e,t,r){return t===r}function Ik(e,t,r){return t!==r}function kk(e,t,r){return t<r}function zk(e,t,r){return t>r}function Fk(e,t,r){return t<=r}function Rk(e,t,r){return t>=r}function iS(e,t,r,i){return i.compare(t,r)===0}function Lk(e,t,r,i){return!iS(e,t,r,i)}function Bk(e,t,r,i){return i.compare(t,r)<0}function Ok(e,t,r,i){return i.compare(t,r)>0}function jk(e,t,r,i){return i.compare(t,r)<=0}function Nk(e,t,r,i){return i.compare(t,r)>=0}function rl(e,t,r){let i=e!=="=="&&e!=="!=";return class nS{constructor(a,o,s,l){this.lhs=a,this.rhs=o,this.key=s,this.collator=l,this.type=xe,this.hasUntypedArgument=a.type.kind==="value"||o.type.kind==="value"}static parse(a,o){if(a.length!==3&&a.length!==4)return o.error("Expected two or three arguments.");let s=a[0],l=o.parse(a[1],1,ge);if(!l)return null;if(!l5(s,l.type))return o.concat(1).error(`"${s}" comparisons are not supported for type '${pt(l.type)}'.`);let u=o.parse(a[2],2,ge);if(!u)return null;if(!l5(s,u.type))return o.concat(2).error(`"${s}" comparisons are not supported for type '${pt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error(`Cannot compare types '${pt(l.type)}' and '${pt(u.type)}'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Bn(u.type,[l],o.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Bn(l.type,[u],o.key)));let c=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(c=o.parse(a[3],3,rf),!c)return null}return new nS(l,u,o.key,c)}evaluate(a){let o=this.lhs.evaluate(a),s=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=St(o),u=St(s);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new at(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=St(o),u=St(s);if(l.kind!=="string"||u.kind!=="string")return t(a,o,s)}return this.collator?r(a,o,s,this.collator.evaluate(a)):t(a,o,s)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var Vk=rl("==",Mk,iS),Uk=rl("!=",Ik,Lk),$k=rl("<",kk,Bk),qk=rl(">",zk,Ok),Gk=rl("<=",Fk,jk),Zk=rl(">=",Rk,Nk),aS=class oS{constructor(t,r,i){this.type=rf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");let i=t[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,xe);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,xe);if(!a)return null;let o=null;return i.locale&&(o=r.parse(i.locale,1,fe),!o)?null:new oS(n,a,o)}evaluate(t){return new j_(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}},Hk=class sS{constructor(t,r,i,n,a,o){this.type=fe,this.number=t,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=o}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");let i=r.parse(t[1],1,U);if(!i)return null;let n=t[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,fe),!a))return null;let o=null;if(n.currency&&(o=r.parse(n.currency,1,fe),!o))return null;let s=null;if(n.unit&&(s=r.parse(n.unit,1,fe),!s))return null;if(o&&s)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,U),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,U),!u)?null:new sS(i,a,o,s,l,u)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}},Wk=class lS{constructor(t){this.type=mc,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");let i=r.parse(t[1],1,fe);return i?new lS(i):r.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),i=gn.fromString(r);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(r)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}},Yk=class uS{constructor(t,r){this.input=t,this.key=r,this.type=U}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=r.parse(t[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${pt(i.type)} instead.`):new uS(i,r.key):null}evaluate(t){let r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new at(`Expected value to be of type string or array, but found ${pt(St(r))} instead.`,this.key)}eachChild(t){t(this.input)}outputDefined(){return!1}},fn=8192;function Xk(e,t){let r=Kk(e[0]),i=Jk(e[1]),n=2**t.z;return[Math.round(r*n*fn),Math.round(i*n*fn)]}function V_(e,t){let r=2**t.z,i=(e[0]/fn+t.x)/r,n=(e[1]/fn+t.y)/r;return[Qk(i),e7(n)]}function Kk(e){return(180+e)/360}function Qk(e){return e*360-180}function Jk(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function e7(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function gc(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Wu(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function t7(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function r7(e,t,r){let i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return i*o-a*n===0&&i*a<=0&&n*o<=0}function uf(e,t,r,i){let n=[t[0]-e[0],t[1]-e[1]];return o7([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(u5(e,t,r,i)&&u5(r,i,e,t))}function i7(e,t,r){for(let i of r)for(let n=0;n<i.length-1;++n)if(uf(e,t,i[n],i[n+1]))return!0;return!1}function il(e,t,r=!1){let i=!1;for(let n of t)for(let a=0;a<n.length-1;a++){if(r7(e,n[a],n[a+1]))return r;t7(e,n[a],n[a+1])&&(i=!i)}return i}function n7(e,t){for(let r of t)if(il(e,r))return!0;return!1}function cS(e,t){for(let r of e)if(!il(r,t))return!1;for(let r=0;r<e.length-1;++r)if(i7(e[r],e[r+1],t))return!1;return!0}function a7(e,t){for(let r of t)if(cS(e,r))return!0;return!1}function o7(e,t){return e[0]*t[1]-e[1]*t[0]}function u5(e,t,r,i){let n=e[0]-r[0],a=e[1]-r[1],o=t[0]-r[0],s=t[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],c=n*u-l*a,h=o*u-l*s;return c>0&&h<0||c<0&&h>0}function U_(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=[];for(let o=0;o<e[n].length;o++){let s=Xk(e[n][o],r);gc(t,s),a.push(s)}i.push(a)}return i}function hS(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=U_(e[n],t,r);i.push(a)}return i}function pS(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){let n=i*.5,a=e[0]-r[0]>n?-i:r[0]-e[0]>n?i:0;a===0&&(a=e[0]-r[2]>n?-i:r[2]-e[0]>n?i:0),e[0]+=a}gc(t,e)}function s7(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function c5(e,t,r,i){let n=2**i.z*fn,a=[i.x*fn,i.y*fn],o=[];for(let s of e)for(let l of s){let u=[l.x+a[0],l.y+a[1]];pS(u,t,r,n),o.push(u)}return o}function h5(e,t,r,i){let n=2**i.z*fn,a=[i.x*fn,i.y*fn],o=[];for(let s of e){let l=[];for(let u of s){let c=[u.x+a[0],u.y+a[1]];gc(t,c),l.push(c)}o.push(l)}if(t[2]-t[0]<=n/2){s7(t);for(let s of o)for(let l of s)pS(l,t,r,n)}return o}function l7(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(t.type==="Polygon"){let a=U_(t.coordinates,i,n),o=c5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!il(s,a))return!1}if(t.type==="MultiPolygon"){let a=hS(t.coordinates,i,n),o=c5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!n7(s,a))return!1}return!0}function u7(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(t.type==="Polygon"){let a=U_(t.coordinates,i,n),o=h5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!cS(s,a))return!1}if(t.type==="MultiPolygon"){let a=hS(t.coordinates,i,n),o=h5(e.geometry(),r,i,n);if(!Wu(r,i))return!1;for(let s of o)if(!a7(s,a))return!1}return!0}var $_=class ad{constructor(t,r){this.type=xe,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hs(t[1])){let i=t[1];if(i.type==="FeatureCollection"){let n=[];for(let a of i.features){let{type:o,coordinates:s}=a.geometry;o==="Polygon"&&n.push(s),o==="MultiPolygon"&&n.push(...s)}if(n.length)return new ad(i,{type:"MultiPolygon",coordinates:n})}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new ad(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new ad(i,i)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return l7(t,this.geometries);if(t.geometryType()==="LineString")return u7(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},dS=class{constructor(e=[],t=(r,i)=>r<i?-1:+(r>i)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let a=(e<<1)+1,o=a+1;if(o<this.length&&r(t[o],t[a])<0&&(a=o),r(t[a],n)>=0)break;t[e]=t[a],e=a}t[e]=n}},p5=Math.PI/180,q_=class{constructor(e){let t=p5*6378.137*1e3,r=Math.cos(e*p5),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=t*n*r,this.ky=t*n*i*.9933056200098587}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(e,t){let r=1/0,i,n,a,o;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],c=this.wrap(e[s+1][0]-l)*this.kx,h=(e[s+1][1]-u)*this.ky,p=0;(c!==0||h!==0)&&(p=(this.wrap(t[0]-l)*this.kx*c+(t[1]-u)*this.ky*h)/(c*c+h*h),p>1?(l=e[s+1][0],u=e[s+1][1]):p>0&&(l+=c/this.kx*p,u+=h/this.ky*p)),c=this.wrap(t[0]-l)*this.kx,h=(t[1]-u)*this.ky;let d=c*c+h*h;d<r&&(r=d,i=l,n=u,a=s,o=p)}return{point:[i,n],index:a,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function fS(e,t){return t[0]-e[0]}function Td(e){return e[1]-e[0]+1}function Gn(e,t){return e[1]>=e[0]&&e[1]<t}function oy(e,t){if(e[0]>e[1])return[null,null];let r=Td(e);if(t){if(r===2)return[e,null];let n=Math.floor(r/2);return[[e[0],e[0]+n],[e[0]+n,e[1]]]}if(r===1)return[e,null];let i=Math.floor(r/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function sy(e,t){if(!Gn(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=t[0];i<=t[1];++i)gc(r,e[i]);return r}function ly(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let i of r)gc(t,i);return t}function d5(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function G_(e,t,r){if(!d5(e)||!d5(t))return NaN;let i=0,n=0;return e[2]<t[0]&&(i=t[0]-e[2]),e[0]>t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]<t[1]&&(n=t[1]-e[3]),r.distance([0,0],[i,n])}function co(e,t,r){let i=r.pointOnLine(t,e);return r.distance(e,i.point)}function Z_(e,t,r,i,n){let a=Math.min(co(e,[r,i],n),co(t,[r,i],n)),o=Math.min(co(r,[e,t],n),co(i,[e,t],n));return Math.min(a,o)}function c7(e,t,r,i,n){if(!(Gn(t,e.length)&&Gn(i,r.length)))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let s=e[o],l=e[o+1];for(let u=i[0];u<i[1];++u){let c=r[u],h=r[u+1];if(uf(s,l,c,h))return 0;a=Math.min(a,Z_(s,l,c,h,n))}}return a}function h7(e,t,r,i,n){if(!(Gn(t,e.length)&&Gn(i,r.length)))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let s=i[0];s<=i[1];++s)if(a=Math.min(a,n.distance(e[o],r[s])),a===0)return a;return a}function p7(e,t,r){if(il(e,t,!0))return 0;let i=1/0;for(let n of t){let a=n[0],o=n[n.length-1];if(a!==o&&(i=Math.min(i,co(e,[o,a],r)),i===0))return i;let s=r.pointOnLine(n,e);if(i=Math.min(i,r.distance(e,s.point)),i===0)return i}return i}function d7(e,t,r,i){if(!Gn(t,e.length))return NaN;for(let a=t[0];a<=t[1];++a)if(il(e[a],r,!0))return 0;let n=1/0;for(let a=t[0];a<t[1];++a){let o=e[a],s=e[a+1];for(let l of r)for(let u=0,c=l.length,h=c-1;u<c;h=u++){let p=l[h],d=l[u];if(uf(o,s,p,d))return 0;n=Math.min(n,Z_(o,s,p,d,i))}}return n}function f5(e,t){for(let r of e)for(let i of r)if(il(i,t,!0))return!0;return!1}function f7(e,t,r,i=1/0){let n=ly(e),a=ly(t);if(i!==1/0&&G_(n,a,r)>=i)return i;if(Wu(n,a)){if(f5(e,t))return 0}else if(f5(t,e))return 0;let o=1/0;for(let s of e)for(let l=0,u=s.length,c=u-1;l<u;c=l++){let h=s[c],p=s[l];for(let d of t)for(let f=0,m=d.length,_=m-1;f<m;_=f++){let g=d[_],y=d[f];if(uf(h,p,g,y))return 0;o=Math.min(o,Z_(h,p,g,y,r))}}return o}function m5(e,t,r,i,n,a){if(!a)return;let o=G_(sy(i,a),n,r);o<t&&e.push([o,a,[0,0]])}function kp(e,t,r,i,n,a,o){if(!a||!o)return;let s=G_(sy(i,a),sy(n,o),r);s<t&&e.push([s,a,o])}function Sd(e,t,r,i,n=1/0){let a=Math.min(i.distance(e[0],r[0][0]),n);if(a===0)return a;let o=new dS([[0,[0,e.length-1],[0,0]]],fS),s=ly(r);for(;o.length>0;){let l=o.pop();if(l[0]>=a)continue;let u=l[1],c=t?50:100;if(Td(u)<=c){if(!Gn(u,e.length))return NaN;if(t){let h=d7(e,u,r,i);if(isNaN(h)||h===0)return h;a=Math.min(a,h)}else for(let h=u[0];h<=u[1];++h){let p=p7(e[h],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let h=oy(u,t);m5(o,a,i,e,s,h[0]),m5(o,a,i,e,s,h[1])}}return a}function Ed(e,t,r,i,n,a=1/0){let o=Math.min(a,n.distance(e[0],r[0]));if(o===0)return o;let s=new dS([[0,[0,e.length-1],[0,r.length-1]]],fS);for(;s.length>0;){let l=s.pop();if(l[0]>=o)continue;let u=l[1],c=l[2],h=t?50:100,p=i?50:100;if(Td(u)<=h&&Td(c)<=p){if(!Gn(u,e.length)&&Gn(c,r.length))return NaN;let d;if(t&&i)d=c7(e,u,r,c,n),o=Math.min(o,d);else if(t&&!i){let f=e.slice(u[0],u[1]+1);for(let m=c[0];m<=c[1];++m)if(d=co(r[m],f,n),o=Math.min(o,d),o===0)return o}else if(!t&&i){let f=r.slice(c[0],c[1]+1);for(let m=u[0];m<=u[1];++m)if(d=co(e[m],f,n),o=Math.min(o,d),o===0)return o}else d=h7(e,u,r,c,n),o=Math.min(o,d)}else{let d=oy(u,t),f=oy(c,i);kp(s,o,n,e,r,d[0],f[0]),kp(s,o,n,e,r,d[0],f[1]),kp(s,o,n,e,r,d[1],f[0]),kp(s,o,n,e,r,d[1],f[1])}}return o}function m7(e,t){let r=e.geometry(),i=r.flat().map(o=>V_([o.x,o.y],e.canonical));if(r.length===0)return NaN;let n=new q_(i[0][1]),a=1/0;for(let o of t){switch(o.type){case"Point":a=Math.min(a,Ed(i,!1,[o.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ed(i,!1,o.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Sd(i,!1,o.coordinates,n,a))}if(a===0)return a}return a}function g7(e,t){let r=e.geometry(),i=r.flat().map(o=>V_([o.x,o.y],e.canonical));if(r.length===0)return NaN;let n=new q_(i[0][1]),a=1/0;for(let o of t){switch(o.type){case"Point":a=Math.min(a,Ed(i,!0,[o.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ed(i,!0,o.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Sd(i,!0,o.coordinates,n,a))}if(a===0)return a}return a}function y7(e,t){let r=e.geometry();if(r.length===0||r[0].length===0)return NaN;let i=lf(r,0).map(o=>o.map(s=>s.map(l=>V_([l.x,l.y],e.canonical)))),n=new q_(i[0][0][0][1]),a=1/0;for(let o of t)for(let s of i){switch(o.type){case"Point":a=Math.min(a,Sd([o.coordinates],!1,s,n,a));break;case"LineString":a=Math.min(a,Sd(o.coordinates,!0,s,n,a));break;case"Polygon":a=Math.min(a,f7(s,o.coordinates,n,a))}if(a===0)return a}return a}function l1(e){return e.type==="MultiPolygon"?e.coordinates.map(t=>({type:"Polygon",coordinates:t})):e.type==="MultiLineString"?e.coordinates.map(t=>({type:"LineString",coordinates:t})):e.type==="MultiPoint"?e.coordinates.map(t=>({type:"Point",coordinates:t})):[e]}var H_=class od{constructor(t,r){this.type=U,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hs(t[1])){let i=t[1];if(i.type==="FeatureCollection")return new od(i,i.features.map(n=>l1(n.geometry)).flat());if(i.type==="Feature")return new od(i,l1(i.geometry));if("type"in i&&"coordinates"in i)return new od(i,l1(i))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return m7(t,this.geometries);if(t.geometryType()==="LineString")return g7(t,this.geometries);if(t.geometryType()==="Polygon")return y7(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},_7=class mS{constructor(t){let r=null;for(let i of t)if(!r)r=i.type;else{if(r===i.type)continue;r=ge;break}this.type=mr(r??ge,t.length),this.arr=t}static parse(t,r){if(t.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Hs(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let i=t[1],n=St(i);if(n.kind==="array"){let a=i,o=r.concat(1),s=[];for(let l=0;l<a.length;l++){let u=o.parse(a[l],l,ge);if(!u)return null;s.push(u)}return new mS(s)}return new Ws(n,i)}evaluate(t){return this.arr.map(r=>r.evaluate(t))}eachChild(t){this.arr.forEach(t)}outputDefined(){return this.arr.every(t=>t.outputDefined())}},W_=class gS{constructor(t){this.key=t,this.type=ge}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=t[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new gS(i):r.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(t){let r=t.globals?.globalState;return!r||Object.keys(r).length===0?null:Ru(r,this.key)??null}eachChild(){}outputDefined(){return!1}},Ls={"==":Vk,"!=":Uk,">":qk,"<":$k,">=":Zk,"<=":Gk,array:Bn,at:Sk,boolean:Bn,case:Dk,coalesce:rS,collator:aS,format:$T,image:Wk,in:Ek,"index-of":Ck,interpolate:Si,"interpolate-hcl":Si,"interpolate-lab":Si,length:Yk,let:WT,literal:Ws,match:Pk,number:Bn,"number-format":Hk,object:Bn,semiliteral:_7,slice:Ak,step:N_,string:Bn,"to-boolean":ks,"to-color":ks,"to-number":ks,"to-string":ks,var:XT,within:$_,distance:H_,"global-state":W_},cn=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},v7=class yS{constructor(t,r=[]){this.parent=t,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(t){return new yS(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw Error(`${t} not found in scope.`)}has(t){return this.bindings[t]?!0:this.parent?this.parent.has(t):!1}},_S=class vS{constructor(t,r,i=[],n,a=new v7,o=[]){this.registry=t,this.path=i,this.key=i.map(s=>`[${s}]`).join(""),this.scope=a,this.errors=o,this.expectedType=n,this._isConstant=r}parse(t,r,i,n,a={}){return r==null?this._parse(t,a):this.concat(r,i,n)._parse(t,a)}_parse(t,r){(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number")&&(t=["literal",t]);let i=this.key;function n(a,o,s){return s==="assert"?new Bn(o,[a],i):s==="coerce"?new ks(o,[a],i):a}if(Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let a=t[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[a];if(o){let s=o.parse(t,this);if(!s)return null;if(this.expectedType){let l=this.expectedType,u=s.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")s=n(s,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))s=n(s,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(s instanceof Ws)&&s.type.kind!=="resolvedImage"&&this._isConstant(s)){let l=new VT;try{s=new Ws(s.type,s.evaluate(l))}catch(u){return this.error(u.message),null}}return s}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return t===void 0?this.error("'undefined' value invalid. Use null instead."):typeof t=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,r,i){let n=typeof t=="number"?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new vS(this.registry,this._isConstant,n,r||null,a,this.errors)}error(t,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new cn(i,t))}checkSubtype(t,r){let i=Hu(t,r);return i&&this.error(i),i}},Mo=class Mu{constructor(t,r,i,n,a){this.name=t,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(t){return this._evaluate(t,this.args,this.key)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){let i=t[0],n=Mu.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(([u])=>!Array.isArray(u)||u.length===t.length-1),l=null;for(let[u,c]of s){l=new _S(r.registry,Cd,r.path,null,r.scope);let h=[],p=!1;for(let d=1;d<t.length;d++){let f=t[d],m=Array.isArray(u)?u[d-1]:u.type,_=l.parse(f,1+h.length,m);if(!_){p=!0;break}h.push(_)}if(!p)if(Array.isArray(u)&&u.length!==h.length)l.error(`Expected ${u.length} arguments, but found ${h.length} instead.`);else{for(let d=0;d<h.length;d++){let f=Array.isArray(u)?u[d]:u.type,m=h[d];l.concat(d+1).checkSubtype(f,m.type)}if(l.errors.length===0)return new Mu(i,a,c,h,r.key)}}if(s.length===1)r.errors.push(...l.errors);else{let u=(s.length?s:o).map(([h])=>b7(h)).join(" | "),c=[];for(let h=1;h<t.length;h++){let p=r.parse(t[h],1+c.length);if(!p)return null;c.push(pt(p.type))}r.error(`Expected arguments of type ${u}, but found (${c.join(", ")}) instead.`)}return null}static register(t,r){Mu.definitions=r;for(let i in r)t[i]=Mu}};function g5(e,[t,r,i,n],a){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let o=n?n.evaluate(e):1,s=jT(t,r,i,o);if(s)throw new at(s,a);return new he(t/255,r/255,i/255,o,!1)}function y5(e,t){return e in t&&t[e]!==void 0}function u1(e,t){let r=t[e];return r===void 0?null:r}function x7(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}function ao(e){return{type:e}}Mo.register(Ls,{error:[ok,[fe],(e,[t],r)=>{throw new at(t.evaluate(e),r)}],typeof:[fe,[ge],(e,[t])=>pt(St(t.evaluate(e)))],"to-rgba":[mr(U,4),[$i],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[r*255,i*255,n*255,a]}],rgb:[$i,[U,U,U],g5],rgba:[$i,[U,U,U,U],g5],has:{type:xe,overloads:[[[fe],(e,[t])=>y5(t.evaluate(e),e.properties())],[[fe,mo],(e,[t,r])=>y5(t.evaluate(e),r.evaluate(e))]]},get:{type:ge,overloads:[[[fe],(e,[t])=>u1(t.evaluate(e),e.properties())],[[fe,mo],(e,[t,r])=>u1(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ge,[fe],(e,[t])=>u1(t.evaluate(e),e.featureState||{})],properties:[mo,[],e=>e.properties()],"geometry-type":[fe,[],e=>e.geometryType()],id:[ge,[],e=>e.id()],zoom:[U,[],e=>e.globals.zoom],"heatmap-density":[U,[],e=>e.globals.heatmapDensity||0],elevation:[U,[],e=>e.globals.elevation||0],"line-progress":[U,[],e=>e.globals.lineProgress||0],accumulated:[ge,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[U,ao(U),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[U,ao(U),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:U,overloads:[[[U,U],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[U],(e,[t])=>-t.evaluate(e)]]},"/":[U,[U,U],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[U,[U,U],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[U,[],()=>Math.LN2],pi:[U,[],()=>Math.PI],e:[U,[],()=>Math.E],"^":[U,[U,U],(e,[t,r])=>t.evaluate(e)**+r.evaluate(e)],sqrt:[U,[U],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[U,[U],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[U,[U],(e,[t])=>Math.log(t.evaluate(e))],log2:[U,[U],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[U,[U],(e,[t])=>Math.sin(t.evaluate(e))],cos:[U,[U],(e,[t])=>Math.cos(t.evaluate(e))],tan:[U,[U],(e,[t])=>Math.tan(t.evaluate(e))],asin:[U,[U],(e,[t])=>Math.asin(t.evaluate(e))],acos:[U,[U],(e,[t])=>Math.acos(t.evaluate(e))],atan:[U,[U],(e,[t])=>Math.atan(t.evaluate(e))],min:[U,ao(U),(e,t)=>Math.min(...t.map(r=>r.evaluate(e)))],max:[U,ao(U),(e,t)=>Math.max(...t.map(r=>r.evaluate(e)))],abs:[U,[U],(e,[t])=>Math.abs(t.evaluate(e))],round:[U,[U],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[U,[U],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[U,[U],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[xe,[fe,ge],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[xe,[ge],(e,[t])=>e.id()===t.value],"filter-type-==":[xe,[fe],(e,[t])=>e.geometryType()===t.value],"filter-<":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[xe,[fe,ge],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[xe,[ge],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[xe,[ge],(e,[t])=>{let r=t.value,i=e.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[xe,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[xe,[mr(fe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[xe,[mr(ge)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[xe,[fe,mr(ge)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[xe,[fe,mr(ge)],(e,[t,r])=>x7(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:xe,overloads:[[[xe,xe],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[ao(xe),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:xe,overloads:[[[xe,xe],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[ao(xe),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[xe,[xe],(e,[t])=>!t.evaluate(e)],"is-supported-script":[xe,[fe],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[fe,[fe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[fe,[fe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[fe,ao(ge),(e,t)=>t.map(r=>Lu(r.evaluate(e))).join("")],split:[mr(fe),[fe,fe],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[fe,[mr(fe),fe],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[fe,[rf],(e,[t])=>t.evaluate(e).resolvedLocale()]});function b7(e){return Array.isArray(e)?`(${e.map(pt).join(", ")})`:`(${pt(e.type)}...)`}function Cd(e){if(e instanceof XT)return Cd(e.boundExpression);if(e instanceof Mo&&e.name==="error"||e instanceof aS||e instanceof $_||e instanceof H_||e instanceof W_)return!1;let t=e instanceof ks||e instanceof Bn,r=!0;return e.eachChild(i=>{r&&(r=t?Cd(i):i instanceof Ws)}),r?cf(e)&&hf(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function cf(e){if(e instanceof Mo&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof $_||e instanceof H_)return!1;let t=!0;return e.eachChild(r=>{t&&!cf(r)&&(t=!1)}),t}function Yu(e){if(e instanceof Mo&&e.name==="feature-state")return!1;let t=!0;return e.eachChild(r=>{t&&!Yu(r)&&(t=!1)}),t}function hf(e,t){if(e instanceof Mo&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(i=>{r&&!hf(i,t)&&(r=!1)}),r}function Ys(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function xS(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Y_(e){return!!e.expression&&e.expression.interpolated}var X_=/^(.*)-transition$/;function Xu(e,...t){for(let r of t)for(let i in r)e[i]=r[i];return e}function ve(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function pf(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&St(e)===mo}function w7(e){return e}function T7(e){switch(e.type){case"color":return he.parse;case"padding":return _n.parse;case"numberArray":return vn.parse;case"colorArray":return Ti.parse;default:return null}}function S7(e){switch(e){case"exponential":return wS;case"interval":return C7;case"categorical":return E7;case"identity":return P7;default:throw Error(`Unknown function type "${e}"`)}}function bS(e,t){let r=e.stops&&typeof e.stops[0][0]=="object",i=r||e.property!==void 0,n=r||!i,a=e.type||(Y_(t)?"exponential":"interval"),o=T7(t);if(o&&(e=Xu({},e),e.stops&&(e.stops=e.stops.map(c=>[c[0],o(c[1])])),e.default?e.default=o(e.default):e.default=o(t.default)),e.colorSpace&&!gk(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let s=S7(a),l,u;if(a==="categorical"){l=Object.create(null);for(let c of e.stops)l[c[0]]=c[1];u=typeof e.stops[0][0]}if(r){let c={},h=[];for(let f=0;f<e.stops.length;f++){let m=e.stops[f],_=m[0].zoom;c[_]===void 0&&(c[_]={zoom:_,type:e.type,property:e.property,default:e.default,stops:[]},h.push(_)),c[_].stops.push([m[0].value,m[1]])}let p=[];for(let f of h)p.push([c[f].zoom,bS(c[f],t)]);let d={name:"linear"};return{kind:"composite",interpolationType:d,interpolationFactor:Si.interpolationFactor.bind(void 0,d),zoomStops:p.map(f=>f[0]),evaluate({zoom:f},m){return wS({stops:p,base:e.base},t,f).evaluate(f,m)}}}if(n){let c=a==="exponential"?{name:"exponential",base:e.base===void 0?1:e.base}:null;return{kind:"camera",interpolationType:c,interpolationFactor:Si.interpolationFactor.bind(void 0,c),zoomStops:e.stops.map(h=>h[0]),evaluate:({zoom:h})=>s(e,t,h,l,u)}}return{kind:"source",evaluate(c,h){let p=h&&h.properties?h.properties[e.property]:void 0;return p===void 0?yc(e.default,t.default):s(e,t,p,l,u)}}}function yc(e,t,r){if(e!==void 0)return e;if(t!==void 0)return t;if(r!==void 0)return r}function E7(e,t,r,i,n){return yc(typeof r===n?i[r]:void 0,e.default,t.default)}function C7(e,t,r){if(ve(r)!=="number")return yc(e.default,t.default);let i=e.stops.length;if(i===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=sf(e.stops.map(a=>a[0]),r,"");return e.stops[n][1]}function wS(e,t,r){let i=e.base===void 0?1:e.base;if(ve(r)!=="number")return yc(e.default,t.default);let n=e.stops.length;if(n===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let a=sf(e.stops.map(c=>c[0]),r,""),o=D7(r,i,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],u=ot[t.type]||w7;return typeof s.evaluate=="function"?{evaluate(...c){let h=s.evaluate.apply(void 0,c),p=l.evaluate.apply(void 0,c);if(h!==void 0&&p!==void 0)return u(h,p,o,e.colorSpace)}}:u(s,l,o,e.colorSpace)}function P7(e,t,r){switch(t.type){case"color":r=he.parse(r);break;case"formatted":r=qn.fromString(r.toString());break;case"resolvedImage":r=gn.fromString(r.toString());break;case"padding":r=_n.parse(r);break;case"colorArray":r=Ti.parse(r);break;case"numberArray":r=vn.parse(r);break;default:ve(r)!==t.type&&(t.type!=="enum"||!t.values[r])&&(r=void 0)}return yc(r,e.default,t.default)}function D7(e,t,r,i){let n=i-r,a=e-r;return n===0?0:t===1?a/n:(t**+a-1)/(t**+n-1)}function uy(e){return{result:"success",value:e}}function Ds(e){return{result:"error",value:e}}var K_=class{constructor(e,t,r,i){this.expression=e,this._warningHistory={},this._evaluator=new VT,this._defaultValue=r?DS(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=t}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._globalState&&(e=Xs(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let o=this.expression.evaluate(this._evaluator);if(o==null||typeof o=="number"&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new at(`Expected value to be one of ${Object.keys(this._enumValues).map(s=>JSON.stringify(s)).join(", ")}, but found ${JSON.stringify(o)} instead.`,"");return o}catch(o){let s=o instanceof at?o.path:"",l=`${s}|${o.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(TS(this._rootKey,s,o.message,this._defaultValue))),this._defaultValue}}};function TS(e,t,r,i){return`${e}${t}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function SS(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function df(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Ls}function ff(e,t,r,i){SS(t);let n=new _S(Ls,Cd,[],r?I7(r):void 0),a=n.parse(e,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?uy(new K_(a,t,r,i)):Ds(n.errors)}var Ku=class{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Yu(t.expression),this.globalStateRefs=_c(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}},Pd=class{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Yu(t.expression),this.globalStateRefs=_c(t.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=Xs(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?Si.interpolationFactor(this.interpolationType,e,t,r):0}};function A7(e){return e._styleExpression!==void 0}function ES(e,t,r,i){let n=ff(e,t,r,i);if(n.result==="error")return n;let a=n.value.expression,o=cf(a);if(!o&&!Ys(r))return Ds([new cn("","data expressions not supported")]);let s=hf(a,["zoom"]);if(!s&&!xS(r))return Ds([new cn("","zoom expressions not supported")]);let l=sd(a);if(!l&&!s)return Ds([new cn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof cn)return Ds([l]);if(l instanceof Si&&!Y_(r))return Ds([new cn("",'"interpolate" expressions cannot be used with this property')]);if(!l)return uy(o?new Ku("constant",n.value,i):new Ku("source",n.value,i));let u=l instanceof Si?l.interpolation:void 0;return uy(o?new Pd("camera",n.value,l.labels,u,i):new Pd("composite",n.value,l.labels,u,i))}var CS=class PS{constructor(t,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,SS(r),this._parameters=t,this._specification=i,this._rootKey=r,this._defaultValue=DS(i),this._warningHistory={};let n=bS(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(t,r){try{return this._innerEvaluate(t,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(TS(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(t){return new PS(t._parameters,t._rootKey,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification,_rootKey:t._rootKey}}};function M7(e,t,r,i){if(pf(e))return new CS(e,t,r);if(df(e)){let n=ES(e,t,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=e;return r.type==="color"&&typeof e=="string"?n=he.parse(e):r.type==="padding"&&(typeof e=="number"||Array.isArray(e))?n=_n.parse(e):r.type==="numberArray"&&(typeof e=="number"||Array.isArray(e))?n=vn.parse(e):r.type==="colorArray"&&(typeof e=="string"||Array.isArray(e))?n=Ti.parse(e):r.type==="variableAnchorOffsetCollection"&&Array.isArray(e)?n=mn.parse(e):r.type==="projectionDefinition"&&typeof e=="string"&&(n=ja.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function sd(e){let t=null;if(e instanceof WT)t=sd(e.result);else if(e instanceof rS){for(let r of e.args)if(t=sd(r),t)break}else(e instanceof N_||e instanceof Si)&&e.input instanceof Mo&&e.input.name==="zoom"&&(t=e);return t instanceof cn||e.eachChild(r=>{let i=sd(r);i instanceof cn?t=i:!t&&i?t=new cn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&i&&t!==i&&(t=new cn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function _c(e,t=new Set){return e instanceof W_&&t.add(e.key),e.eachChild(r=>{_c(r,t)}),t}function I7(e){let t={color:$i,string:fe,number:U,enum:fe,boolean:xe,formatted:fc,padding:nf,numberArray:af,colorArray:Zu,projectionDefinition:tf,resolvedImage:mc,variableAnchorOffsetCollection:of};return e.type==="array"?mr(t[e.value]||ge,e.length):t[e.type]}function DS(e){if(e.type==="color"&&pf(e.default))return new he(0,0,0,0);switch(e.type){case"color":return he.parse(e.default)||null;case"padding":return _n.parse(e.default)||null;case"numberArray":return vn.parse(e.default)||null;case"colorArray":return Ti.parse(e.default)||null;case"variableAnchorOffsetCollection":return mn.parse(e.default)||null;case"projectionDefinition":return ja.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function Xs(e,t){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s}=e??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s,globalState:t}}function k7(e){let t=!1;for(let r of e){let i=AS(r);if(i==="expression")return"expression";i==="legacy"&&(t=!0)}return t?"legacy":"neutral"}function AS(e){if(typeof e=="boolean")return"neutral";if(!Array.isArray(e)||e.length===0)return"legacy";switch(e[0]){case"has":return e.length<2||e[1]==="$id"||e[1]==="$type"?"legacy":e.length===2?"neutral":"expression";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return k7(e.slice(1));default:return"expression"}}function Q_(e){return AS(e)!=="legacy"}function _5(e){return e==="$type"?["geometry-type"]:e==="$id"?["id"]:["get",e]}function z7(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return e.length!==3||typeof e[1]!="string"?null:[e[0],_5(e[1]),e[2]];case"in":case"!in":{if(e.length<2||typeof e[1]!="string")return null;let t=["in",_5(e[1]),["literal",e.slice(2)]];return e[0]==="!in"?["!",t]:t}case"has":case"!has":{if(e.length!==2||typeof e[1]!="string"||e[1]==="$type"||e[1]==="$id")return null;let t=["has",e[1]];return e[0]==="!has"?["!",t]:t}default:return null}}function MS(e){if((e[0]==="<"||e[0]==="<="||e[0]===">"||e[0]===">=")&&e[1]==="$type")return`"$type" cannot be use with operator "${e[0]}"`;let t=z7(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function c1(e,t,r){let i=r[e];return Array.isArray(i)?Q_(i)?J_(i,t.concat(e)):{path:t.concat(e),legacyFilter:i}:null}function J_(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let r=1;r<e.length;r++){let i=c1(r,t,e);if(i)return i}break;case"!":{let r=c1(1,t,e);if(r)return r;break}case"case":for(let r=1;r<e.length-1;r+=2){let i=c1(r,t,e);if(i)return i}}return null}function F7(e,t){let r=J_(e);if(!r||typeof console>"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${t}${i}: ${MS(r.legacyFilter)}`)}var R7={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Qu(e,t,r){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Q_(e)?F7(e,t):e=Dd(e);let i=ff(e,t,R7,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,o)=>i.value.evaluate(n,a,{},o),needGeometry:IS(e),getGlobalStateRefs:()=>_c(i.value.expression)}}function L7(e,t){return e<t?-1:+(e>t)}function IS(e){if(!Array.isArray(e))return!1;if(e[0]==="within"||e[0]==="distance")return!0;for(let t=1;t<e.length;t++)if(IS(e[t]))return!0;return!1}function Dd(e){if(!e)return!0;let t=e[0];return e.length<=1?t!=="any":t==="=="?h1(e[1],e[2],"=="):t==="!="?zp(h1(e[1],e[2],"==")):t==="<"||t===">"||t==="<="||t===">="?h1(e[1],e[2],t):t==="any"?B7(e.slice(1)):t==="all"?["all"].concat(e.slice(1).map(Dd)):t==="none"?["all"].concat(e.slice(1).map(Dd).map(zp)):t==="in"?v5(e[1],e.slice(2)):t==="!in"?zp(v5(e[1],e.slice(2))):t==="has"?x5(e[1]):t!=="!has"||zp(x5(e[1]))}function h1(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function B7(e){return["any"].concat(e.map(Dd))}function v5(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",e,["literal",t.sort(L7)]]:["filter-in-small",e,["literal",t]]}}function x5(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function zp(e){return["!",e]}function O7(){let e={},t=z.$version;for(let r in z.$root){let i=z.$root[r];if(i.required){let n=null;n=r==="version"?t:i.type==="array"?[]:{},n!=null&&(e[r]=n)}}return e}function kS(e){let t=e.key,r=e.value;return r?[new B(t,r,"constants have been deprecated as of v8")]:[]}function wt(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function wo(e){if(Array.isArray(e))return e.map(wo);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=wo(e[r]);return t}return wt(e)}function ti(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,l=[],u=ve(r);if(u!=="object")return[new B(t,r,`object expected, ${u} found`)];for(let c in r){let h=c.split(".")[0],p=Ru(i,h)||i["*"],d;if(Ru(n,h))d=n[h];else if(Ru(i,h)){if(r[c]===void 0)continue;d=s}else if(n["*"])d=n["*"];else if(i["*"])d=s;else{l.push(new B(t,r[c],`unknown property "${c}"`));continue}l=l.concat(d({key:(t&&`${t}.`)+c,value:r[c],valueSpec:p,style:a,styleSpec:o,object:r,objectKey:c,validateSpec:s},r))}for(let c in i)n[c]||i[c].required&&i[c].default===void 0&&r[c]===void 0&&l.push(new B(t,r,`missing required property "${c}"`));return l}function ev(e){let t=e.value,r=e.valueSpec,i=e.validateSpec,n=e.style,a=e.styleSpec,o=e.key,s=e.arrayElementValidator||i;if(ve(t)!=="array")return[new B(o,t,`array expected, ${ve(t)} found`)];if(r.length&&t.length!==r.length)return[new B(o,t,`array length ${r.length} expected, length ${t.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),ve(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<t.length;c++)u=u.concat(s({array:t,arrayIndex:c,value:t[c],valueSpec:l,validateSpec:e.validateSpec,style:n,styleSpec:a,key:`${o}[${c}]`}));return u}function mf(e){let t=e.key,r=e.value,i=e.valueSpec,n=ve(r);return n==="number"&&r!==r&&(n="NaN"),n==="number"?"minimum"in i&&r<i.minimum?[new B(t,r,`${r} is less than the minimum value ${i.minimum}`)]:"maximum"in i&&r>i.maximum?[new B(t,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new B(t,r,`number expected, ${n} found`)]}function zS(e){let t=e.valueSpec,r=wt(e.value.type),i,n={},a,o,s=r!=="categorical"&&e.value.property===void 0,l=!s,u=ve(e.value.stops)==="array"&&ve(e.value.stops[0])==="array"&&ve(e.value.stops[0][0])==="object",c=ti({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:h,default:f}});return r==="identity"&&s&&c.push(new B(e.key,e.value,'missing required property "property"')),r!=="identity"&&!e.value.stops&&c.push(new B(e.key,e.value,'missing required property "stops"')),r==="exponential"&&e.valueSpec.expression&&!Y_(e.valueSpec)&&c.push(new B(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Ys(e.valueSpec)?c.push(new B(e.key,e.value,"property functions not supported")):s&&!xS(e.valueSpec)&&c.push(new B(e.key,e.value,"zoom functions not supported"))),(r==="categorical"||u)&&e.value.property===void 0&&c.push(new B(e.key,e.value,'"property" property is required')),c;function h(m){if(r==="identity")return[new B(m.key,m.value,'identity function may not have a "stops" property')];let _=[],g=m.value;return _=_.concat(ev({key:m.key,value:g,valueSpec:m.valueSpec,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,arrayElementValidator:p})),ve(g)==="array"&&g.length===0&&_.push(new B(m.key,g,"array must have at least one stop")),_}function p(m){let _=[],g=m.value,y=m.key;if(ve(g)!=="array")return[new B(y,g,`array expected, ${ve(g)} found`)];if(g.length!==2)return[new B(y,g,`array length 2 expected, length ${g.length} found`)];if(u){if(ve(g[0])!=="object")return[new B(y,g,`object expected, ${ve(g[0])} found`)];if(g[0].zoom===void 0)return[new B(y,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new B(y,g,"object stop key must have value")];if(o&&o>wt(g[0].zoom))return[new B(y,g[0].zoom,"stop zoom values must appear in ascending order")];wt(g[0].zoom)!==o&&(o=wt(g[0].zoom),a=void 0,n={}),_=_.concat(ti({key:`${y}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,objectElementValidators:{zoom:mf,value:d}}))}else _=_.concat(d({key:`${y}[0]`,value:g[0],valueSpec:{},validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec},g));return df(wo(g[1]))?_.concat([new B(`${y}[1]`,g[1],"expressions are not allowed in function stops.")]):_.concat(m.validateSpec({key:`${y}[1]`,value:g[1],valueSpec:t,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec}))}function d(m,_){let g=ve(m.value),y=wt(m.value),v=m.value===null?_:m.value;if(!i)i=g;else if(g!==i)return[new B(m.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new B(m.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let x=`number expected, ${g} found`;return Ys(t)&&r===void 0&&(x+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new B(m.key,v,x)]}return r==="categorical"&&g==="number"&&(!isFinite(y)||Math.floor(y)!==y)?[new B(m.key,v,`integer expected, found ${y}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&y<a?[new B(m.key,v,"stop domain values must appear in ascending order")]:(a=y,r==="categorical"&&y in n?[new B(m.key,v,"stop domain values must be unique")]:(n[y]=!0,[]))}function f(m){return m.validateSpec({key:m.key,value:m.value,valueSpec:t,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec})}}function Ks(e){let t=(e.expressionContext==="property"?ES:ff)(wo(e.value),e.key,e.valueSpec);if(t.result==="error")return t.value.map(i=>new B(`${e.key}${i.key}`,e.value,i.message));let r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new B(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Yu(r))return[new B(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Yu(r))return[new B(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!hf(r,["zoom","feature-state"]))return[new B(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!cf(r))return[new B(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function j7(e){let t=e.value,r=e.key,i=ve(t);return i==="boolean"?[]:[new B(r,t,`boolean expected, ${i} found`)]}function cy(e){let t=e.key,r=e.value,i=ve(r);return i==="string"?he.parse(String(r))?[]:[new B(t,r,`color expected, "${r}" found`)]:[new B(t,r,`color expected, ${i} found`)]}function Ju(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(wt(r))===-1&&n.push(new B(t,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(wt(r))===-1&&n.push(new B(t,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function N7(e,t){let r=e;for(let i of t)r=r[i];return r}function V7(e,t){let r=J_(t);return r?[new B(`${e.key}${r.path.map(i=>`[${i}]`).join("")}`,N7(e.value,r.path),MS(r.legacyFilter),null,"warning")]:[]}function tv(e){let t=wo(e.value);return Q_(t)?[...V7(e,t),...Ks(Xu({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:FS(e)}function FS(e){let t=e.value,r=e.key;if(ve(t)!=="array")return[new B(r,t,`array expected, ${ve(t)} found`)];let i=e.styleSpec,n,a=[];if(t.length<1)return[new B(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Ju({key:`${r}[0]`,value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),wt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&wt(t[1])==="$type"&&a.push(new B(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&a.push(new B(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(n=ve(t[1]),n!=="string"&&a.push(new B(`${r}[1]`,t[1],`string expected, ${n} found`)));for(let o=2;o<t.length;o++)n=ve(t[o]),wt(t[1])==="$type"?a=a.concat(Ju({key:`${r}[${o}]`,value:t[o],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):n!=="string"&&n!=="number"&&n!=="boolean"&&a.push(new B(`${r}[${o}]`,t[o],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let o=1;o<t.length;o++)a=a.concat(FS({key:`${r}[${o}]`,value:t[o],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=ve(t[1]),t.length===2?n!=="string"&&a.push(new B(`${r}[1]`,t[1],`string expected, ${n} found`)):a.push(new B(r,t,`filter array for "${t[0]}" operator must have 2 elements`))}return a}function RS(e,t){let r=e.key,i=e.validateSpec,n=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,l=a[`${t}_${e.layerType}`];if(!l)return[];let u=s.match(X_);if(t==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:o,valueSpec:a.transition,style:n,styleSpec:a});let c=e.valueSpec||l[s];if(!c)return[new B(r,o,`unknown property "${s}"`)];let h;if(ve(o)==="string"&&Ys(c)&&!c.tokens&&(h=/^{([^}]+)}$/.exec(o)))return[new B(r,o,`"${s}" does not support interpolation syntax
9
9
  Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(h[1])} }\`.`)];let p=[];return e.layerType==="symbol"&&s==="text-font"&&pf(wo(o))&&wt(o.type)==="identity"&&p.push(new B(r,o,'"text-font" does not support identity functions')),p.concat(i({key:e.key,value:o,valueSpec:c,style:n,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:s}))}function LS(e){return RS(e,"paint")}function BS(e){return RS(e,"layout")}function OS(e){let t=[],r=e.value,i=e.key,n=e.style,a=e.styleSpec;if(ve(r)!=="object")return[new B(i,r,`object expected, ${ve(r)} found`)];!r.type&&!r.ref&&t.push(new B(i,r,'either "type" or "ref" is required'));let o=wt(r.type),s=wt(r.ref);if(r.id){let l=wt(r.id);for(let u=0;u<e.arrayIndex;u++){let c=n.layers[u];wt(c.id)===l&&t.push(new B(i,r.id,`duplicate layer id "${r.id}", previously used at line ${c.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&t.push(new B(i,r[u],`"${u}" is prohibited for ref layers`))});let l;n.layers.forEach(u=>{wt(u.id)===s&&(l=u)}),l?l.ref?t.push(new B(i,r.ref,"ref cannot reference another ref layer")):o=wt(l.type):t.push(new B(i,r.ref,`ref layer "${s}" not found`))}else if(o!=="background")if(!r.source)t.push(new B(i,r,'missing required property "source"'));else{let l=n.sources&&n.sources[r.source],u=l&&wt(l.type);l?u==="vector"&&o==="raster"?t.push(new B(i,r.source,`layer "${r.id}" requires a raster source`)):u!=="raster-dem"&&o==="hillshade"||u!=="raster-dem"&&o==="color-relief"?t.push(new B(i,r.source,`layer "${r.id}" requires a raster-dem source`)):u==="raster"&&o!=="raster"?t.push(new B(i,r.source,`layer "${r.id}" requires a vector source`)):u==="vector"&&!r["source-layer"]?t.push(new B(i,r,`layer "${r.id}" must specify a "source-layer"`)):u==="raster-dem"&&o!=="hillshade"&&o!=="color-relief"?t.push(new B(i,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):o==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&t.push(new B(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new B(i,r.source,`source "${r.source}" not found`))}return o==="raster"&&r.paint?.resampling&&r.paint?.["raster-resampling"]&&t.push(new B(i,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),t=t.concat(ti({key:i,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"})},filter:tv,layout(l){return ti({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return BS(Xu({layerType:o},u))}}})},paint(l){return ti({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return LS(Xu({layerType:o},u))}}})}}})),t}function La(e){let t=e.value,r=e.key,i=ve(t);return i==="string"?[]:[new B(r,t,`string expected, ${i} found`)]}function U7(e){let t=e.sourceName??"",r=e.value,i=e.styleSpec,n=i.source_raster_dem,a=e.style,o=[],s=ve(r);if(r===void 0)return o;if(s!=="object")return o.push(new B("source_raster_dem",r,`object expected, ${s} found`)),o;let l=wt(r.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],c=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let h in r)!l&&u.includes(h)?o.push(new B(h,r[h],`In "${t}": "${h}" is only valid when "encoding" is set to "custom". ${c} encoding found`)):n[h]?o=o.concat(e.validateSpec({key:h,value:r[h],valueSpec:n[h],validateSpec:e.validateSpec,style:a,styleSpec:i})):o.push(new B(h,r[h],`unknown property "${h}"`));return o}var b5={promoteId:$7};function jS(e){let t=e.value,r=e.key,i=e.styleSpec,n=e.style,a=e.validateSpec;if(!t.type)return[new B(r,t,'"type" is required')];let o=wt(t.type),s;switch(o){case"vector":case"raster":return s=ti({key:r,value:t,valueSpec:i[`source_${o.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:b5,validateSpec:a}),s;case"raster-dem":return s=U7({sourceName:r,value:t,style:e.style,styleSpec:i,validateSpec:a}),s;case"geojson":if(s=ti({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:b5}),t.cluster)for(let l in t.clusterProperties){let[u,c]=t.clusterProperties[l],h=typeof u=="string"?[u,["accumulated"],["get",l]]:u;s.push(...Ks({key:`${r}.${l}.map`,value:c,validateSpec:a,expressionContext:"cluster-map"})),s.push(...Ks({key:`${r}.${l}.reduce`,value:h,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return ti({key:r,value:t,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return ti({key:r,value:t,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new B(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ju({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function $7({key:e,value:t}){if(ve(t)==="string")return La({key:e,value:t});{let r=[];for(let i in t)r.push(...La({key:`${e}.${i}`,value:t[i]}));return r}}function NS(e){let t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],o=ve(t);if(t===void 0)return a;if(o!=="object")return a=a.concat([new B("light",t,`object expected, ${o} found`)]),a;for(let s in t){let l=s.match(X_);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:n,styleSpec:r})):i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new B(s,t[s],`unknown property "${s}"`)])}return a}function VS(e){let t=e.value,r=e.styleSpec,i=r.sky,n=e.style,a=ve(t);if(t===void 0)return[];if(a!=="object")return[new B("sky",t,`object expected, ${a} found`)];let o=[];for(let s in t){let l=s.match(X_);o=l&&i[l[1]]&&i[l[1]].transition?o.concat(e.validateSpec({key:s,value:t[s],valueSpec:r.transition,style:n,styleSpec:r})):i[s]?o.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],style:n,styleSpec:r})):o.concat([new B(s,t[s],`unknown property "${s}"`)])}return o}function US(e){let t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],o=ve(t);if(t===void 0)return a;if(o!=="object")return a=a.concat([new B("terrain",t,`object expected, ${o} found`)]),a;for(let s in t)a=i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new B(s,t[s],`unknown property "${s}"`)]);return a}function q7(e){return La(e).length===0?[]:Ks(e)}function G7(e){return La(e).length===0?[]:Ks(e)}function Z7(e){let t=e.key,r=e.value;if(ve(r)==="array"){if(r.length<1||r.length>4)return[new B(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return mf({key:t,value:r,valueSpec:{}})}function H7(e){let t=e.key,r=e.value;if(ve(r)==="array"){let i={type:"number"};if(r.length<1)return[new B(t,r,"array length at least 1 expected, length 0 found")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return mf({key:t,value:r,valueSpec:{}})}function W7(e){let t=e.key,r=e.value;if(ve(r)==="array"){if(r.length<1)return[new B(t,r,"array length at least 1 expected, length 0 found")];let i=[];for(let n=0;n<r.length;n++)i=i.concat(cy({key:`${t}[${n}]`,value:r[n],valueSpec:{}}));return i}return cy({key:t,value:r,valueSpec:{}})}function Y7(e){let t=e.key,r=e.value,i=ve(r),n=e.styleSpec;if(i!=="array"||r.length<1||r.length%2!=0)return[new B(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let o=0;o<r.length;o+=2)a=a.concat(Ju({key:`${t}[${o}]`,value:r[o],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat(ev({key:`${t}[${o+1}]`,value:r[o+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:n}));return a}function $S(e){let t=[],r=e.value,i=e.key;if(Array.isArray(r)){let n=[],a=[];for(let o in r)r[o].id&&n.includes(r[o].id)&&t.push(new B(i,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),n.push(r[o].id),r[o].url&&a.includes(r[o].url)&&t.push(new B(i,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),t=t.concat(ti({key:`${i}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return La({key:i,value:r})}function X7(e){let t=e.value,r=e.styleSpec,i=r.projection,n=e.style,a=ve(t);if(t===void 0)return[];if(a!=="object")return[new B("projection",t,`object expected, ${a} found`)];let o=[];for(let s in t)o=i[s]?o.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],style:n,styleSpec:r})):o.concat([new B(s,t[s],`unknown property "${s}"`)]);return o}function K7(e){let t=e.key,r=e.value;r=r instanceof String?r.valueOf():r;let i=ve(r);return i==="array"&&!J7(r)&&!Q7(r)?[new B(t,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:["array","string"].includes(i)?[]:[new B(t,r,`projection expected, invalid type "${i}" found`)]}function Q7(e){return!!["interpolate","step","literal"].includes(e[0])}function J7(e){return Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"}function hy(e){return!!e&&e.constructor===Object}function qS(e){return hy(e.value)?[]:[new B(e.key,e.value,`object expected, ${ve(e.value)} found`)]}var w5=1114111,ez=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i;function tz(e,t){if(ve(t)!=="string")return[];let r=`${t}`,i=()=>[new B(e,t,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],n=r.match(ez);if(!n)return i();let[,a,o,s]=n;if(s!==void 0)return s.length>6?i():[];let l=parseInt(a,16),u=o===void 0?l:parseInt(o,16);return l>w5||u>w5?[new B(e,t,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new B(e,t,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function GS(e){let t=e.key??"font-faces",r=e.value,i=e.validateSpec,n=e.styleSpec??DT,a=e.style;if(!hy(r))return[new B(t,r,`object expected, ${ve(r)} found`)];let o=[];for(let s in r){let l=r[s],u=ve(l);if(u==="string")o.push(...La({key:`${t}.${s}`,value:l}));else if(u==="array"){let c={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[h,p]of l.entries()){let d=`${t}.${s}[${h}]`;o.push(...ti({key:d,value:p,valueSpec:c,styleSpec:n,style:a,validateSpec:i}));let f=hy(p)?p["unicode-range"]:void 0;if(ve(f)==="array")for(let[m,_]of f.entries())o.push(...tz(`${d}.unicode-range[${m}]`,_))}}else o.push(new B(`${t}.${s}`,l,`string or array expected, ${u} found`))}return o}var T5={"*"(){return[]},array:ev,boolean:j7,number:mf,color:cy,constants:kS,enum:Ju,filter:tv,function:zS,layer:OS,object:ti,source:jS,light:NS,sky:VS,terrain:US,projection:X7,projectionDefinition:K7,string:La,formatted:q7,resolvedImage:G7,padding:Z7,numberArray:H7,colorArray:W7,variableAnchorOffsetCollection:Y7,sprite:$S,state:qS,fontFaces:GS};function Bu(e){let t=e.value,r=e.valueSpec,i=e.styleSpec;return e.validateSpec=Bu,r.expression&&pf(wt(t))?zS(e):r.expression&&df(wo(t))?Ks(e):r.type&&T5[r.type]?T5[r.type](e):ti(Xu({},e,{valueSpec:r.type?i[r.type]:r}))}function ZS(e){let t=e.value,r=e.key,i=La(e);return i.length||(t.indexOf("{fontstack}")===-1&&i.push(new B(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&i.push(new B(r,t,'"glyphs" url must include a "{range}" token'))),i}function Xr(e,t=z){let r=[];return r=r.concat(Bu({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:Bu,objectElementValidators:{glyphs:ZS,"*"(){return[]}}})),e.constants&&(r=r.concat(kS({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:Bu}))),HS(r)}Xr.source=gi(mi(jS)),Xr.sprite=gi(mi($S)),Xr.glyphs=gi(mi(ZS)),Xr.fontFaces=gi(mi(GS)),Xr.light=gi(mi(NS)),Xr.sky=gi(mi(VS)),Xr.terrain=gi(mi(US)),Xr.state=gi(mi(qS)),Xr.layer=gi(mi(OS)),Xr.filter=gi(mi(tv)),Xr.paintProperty=gi(mi(LS)),Xr.layoutProperty=gi(mi(BS));function mi(e){return function(t){return e(Object.assign({},t,{validateSpec:Bu}))}}function HS(e){return[].concat(e).sort((t,r)=>t.line-r.line)}function gi(e){return function(...t){return HS(e.apply(this,t))}}var rz={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},iz=class{constructor(e,t,r){this._rootKey=t,this._globalState=r,this.setValue(e)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none"){this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let t=ff(e,this._rootKey,rz,this._globalState);if(t.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=_c(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function nz(e,t,r){return new iz(e,t,r)}var Br=Xr,WS=new Set(Object.keys(z).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-")));function az(e){return Object.entries(e.sources??{}).filter(([,t])=>!WS.has(t.type)).map(([t])=>`sources.${t}`)}function S5(e,t){let r=az(t);return rv(e,Br(t).filter(({message:i})=>!r.some(n=>i.startsWith(`${n}:`)||i.startsWith(`${n}.`))))}function rv(e,t){let r=!1;for(let i of t)i.severity==="warning"?we(i.message):(e.fire(new ee(Error(i.message))),r=!0);return r}function vc(e,t,r,i){return i?.validate!==!1&&rv(e,t({styleSpec:z,...r}))}var py=class YS{constructor(t,r,i){let n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let o=new Int32Array(this.arrayBuffer);t=o[0],r=o[1],i=o[2],this.d=r+2*i;for(let u=0;u<this.d*this.d;u++){let c=o[3+u],h=o[3+u+1];n.push(c===h?null:o.subarray(c,h))}let s=o[3+n.length],l=o[3+n.length+1];this.keys=o.subarray(s,l),this.bboxes=o.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*i;for(let o=0;o<this.d*this.d;o++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=i,this.scale=r/t,this.uid=0;let a=i/r*t;this.min=-a,this.max=t+a}insert(t,r,i,n,a){this._forEachCell(r,i,n,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,r,i,n,a,o){this.cells[a].push(o)}query(t,r,i,n,a){let o=this.min,s=this.max;if(t<=o&&r<=o&&s<=i&&s<=n&&!a)return[...this.keys];{let l=[];return this._forEachCell(t,r,i,n,this._queryCell,l,{},a),l}}_queryCell(t,r,i,n,a,o,s,l){let u=this.cells[a];if(u!==null){let c=this.keys,h=this.bboxes;for(let p of u)if(s[p]===void 0){let d=p*4;(l?l(h[d+0],h[d+1],h[d+2],h[d+3]):t<=h[d+2]&&r<=h[d+3]&&i>=h[d+0]&&n>=h[d+1])?(s[p]=!0,o.push(c[p])):s[p]=!1}}}_forEachCell(t,r,i,n,a,o,s,l){let u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let d=u;d<=h;d++)for(let f=c;f<=p;f++){let m=this.d*f+d;if((!l||l(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&a.call(this,t,r,i,n,m,o,s,l))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,r=3+this.cells.length+1+1,i=0;for(let o of this.cells)i+=o.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let o=0;o<t.length;o++){let s=t[o];n[3+o]=a,n.set(s,a),a+=s.length}return n[3+t.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+t.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}static serialize(t,r){let i=t.toArrayBuffer();return r&&r.push(i),{buffer:i}}static deserialize(t){return new YS(t.buffer)}},jn={};function G(e,t,r={}){if(jn[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),jn[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}G("Object",Object),G("Set",Set),G("TransferableGridIndex",py),G("Color",he),G("Error",Error),G("AJAXError",wd),G("ResolvedImage",gn),G("StylePropertyFunction",CS),G("StyleExpression",K_,{omit:["_evaluator"]}),G("ZoomDependentExpression",Pd),G("ZoomConstantExpression",Ku),G("CompoundExpression",Mo,{omit:["_evaluate"]});for(let e in Ls)Ls[e]._classRegistryKey||G(`Expression_${e}`,Ls[e]);function XS(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor?.name==="ArrayBuffer")}function iv(e){let t=e.constructor;return e.$name||t._classRegistryKey}function oz(e){if(typeof e!="object"||!e)return!1;let t=iv(e);return t&&t!=="Object"}function KS(e){return!oz(e)&&(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||XS(e)||fo(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function Ou(e,t){if(KS(e))return(XS(e)||fo(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let a=[];for(let o of e)a.push(Ou(o,t));return a}if(typeof e!="object")throw Error(`can't serialize object of type ${typeof e}`);let r=iv(e);if(!r)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!jn[r])throw Error(`${r} is not registered.`);let{klass:i}=jn[r],n=i.serialize?i.serialize(e,t):{};if(i.serialize){if(n===t?.[t.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let a in e){if(!e.hasOwnProperty(a)||jn[r].omit.includes(a))continue;let o=e[a];o!==void 0&&(n[a]=jn[r].shallow.includes(a)?o:Ou(o,t))}e instanceof Error&&(n.message=e.message)}if(n.$name)throw Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(n.$name=r),n}function ju(e){if(KS(e))return e;if(Array.isArray(e))return e.map(ju);if(typeof e!="object")throw Error(`can't deserialize object of type ${typeof e}`);let t=iv(e)||"Object";if(!jn[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:r}=jn[t];if(!r)throw Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);let i=Object.create(r.prototype);for(let n of Object.keys(e)){if(n==="$name")continue;let a=e[n];i[n]=jn[t].shallow.includes(n)?a:ju(a)}return i}var dy=class{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}},Re=class{constructor(e,t){this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new dy,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new dy,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}},ec=class{constructor(e,t,r,i){this.property=e,this.value=t,this.expression=M7(t===void 0?e.specification.default:t,r,e.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}readsGlobalState(e){let t=this.getGlobalStateRefs();return e.some(r=>t.has(r))}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}},fy=class{constructor(e,t,r){this.property=e,this.value=new ec(e,void 0,t,r)}transitioned(e,t){return t.value===this.value?t:new E5(this.property,this.value,t,J({},e.transition,this.transition),e.now)}untransitioned(){return new E5(this.property,this.value,null,{},0)}},gf=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return Or(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new fy(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new ec(this._values[e].property,t===null?void 0:Or(t),this._propertyRootKey(e),this._globalState)}setValues(e){for(let t in e){let r=e[t];t.endsWith("-transition")?this.setTransition(t.slice(0,-11),r):un(this._values[t].value.value,r)||this.setValue(t,r)}}getTransition(e){return Or(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new fy(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=Or(t)||void 0}retainPriorGlobalState(e,t,r){for(let i of Object.keys(r._values))for(let n=r._values[i];n;n=n.prior){let{value:a}=n;a.property.specification.transition&&!a.isDataDriven()&&a.expression._globalState===this._globalState&&a.readsGlobalState(e)&&(n.value=new ec(a.property,a.value,this._propertyRootKey(i),t))}}applyGlobalStateChange(e,t,r,i){this.retainPriorGlobalState(e,t,r);let n=!1;for(let a of Object.keys(this._values)){let{value:o}=this._values[a];o.readsGlobalState(e)&&(this.setValue(a,o.value),n=!0)}return n?this.transitioned(i,r):r}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);r!==void 0&&(e[t]=r);let i=this.getTransition(t);i!==void 0&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){let r=new C5(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){let e=new C5(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}},E5=class{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(e,t,r);{let o=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),n,TI(o))}}},C5=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let i=new yf(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},sz=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return Or(this._values[e].value)}setValue(e,t){this._values[e]=new ec(this._values[e].property,t===null?void 0:Or(t),this._propertyRootKey(e),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);r!==void 0&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let i=new yf(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}},bi=class{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}},yf=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};function P5(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function QS(e,t){let r=P5(e),i=P5(t);return r!==void 0&&i!==void 0&&r!==i}var $=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){if(QS(e,t))return we(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=this.specification.type,n=ot[i];return n?n(e,t,r):e}},re=class{constructor(e,t,r){this.specification=e,this.name=t,this.overrides=r}possiblyEvaluate(e,t,r,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new bi(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)},t):new bi(this,e.expression,t)}interpolate(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new bi(this,{kind:"constant",value:void 0},e.parameters);if(QS(e.value.value,t.value.value))return we(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=this.specification.type,n=ot[i];if(n){let a=n(e.value.value,t.value.value,r);return new bi(this,{kind:"constant",value:a},e.parameters)}return e}evaluate(e,t,r,i,n,a){return e.kind==="constant"?e.value:e.evaluate(t,r,i,n,a)}},tc=class extends re{possiblyEvaluate(e,t,r,i){if(e.value===void 0)return new bi(this,{kind:"constant",value:void 0},t);if(e.expression.kind==="constant"){let n=e.expression.evaluate(t,null,{},r,i),a=e.property.specification.type==="resolvedImage"&&typeof n!="string"?n.name:n,o=this._calculate(a,a,a,t);return new bi(this,{kind:"constant",value:o},t)}if(e.expression.kind==="camera"){let n=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new bi(this,{kind:"constant",value:n},t)}return new bi(this,e.expression,t)}evaluate(e,t,r,i,n,a){if(e.kind==="source"){let o=e.evaluate(t,r,i,n,a);return this._calculate(o,o,o,t)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},JS=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){if(e.value!==void 0){if(e.expression.kind==="constant"){let n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new Re(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Re(Math.floor(t.zoom),t)),e.expression.evaluate(new Re(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},_f=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}},Kt=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new ec(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[t]=new fy(r,r.name,void 0);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}};G("DataDrivenProperty",re),G("DataConstantProperty",$),G("CrossFadedDataDrivenProperty",tc),G("CrossFadedProperty",JS),G("ColorRampProperty",_f);var D5=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",p1=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",Yi=class extends lr{constructor(e,t,r){if(super(),this.id=e.id,this.type=e.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=nz(this.visibility,`layers[${this.id}].layout.visibility`,r),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Qu(e.filter,`layers[${this.id}].filter`,r)),t.layout&&(this._unevaluatedLayout=new sz(t.layout,`layers[${this.id}].layout`,r)),t.paint)){this._transitionablePaint=new gf(t.paint,`layers[${this.id}].paint`,r);for(let i in e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(let i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new yf(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=Qu(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){if(e==="visibility")return this.visibility;if(this._transitionablePaint?.hasProperty(e))throw Error(e+D5);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[t];for(let i of r.getGlobalStateRefs())e.add(i)}for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){let e=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let r=this._transitionablePaint._values[t].value;for(let i of r.getGlobalStateRefs()){let n=e.get(i)??[];n.push({name:t,value:r.value}),e.set(i,n)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,r={}){e==="visibility"?(this.visibility=t,this._visibilityExpression.setValue(t),this.recalculateVisibility()):this._transitionablePaint?.hasProperty(e)?this.fire(new ee(Error(e+D5))):t!=null&&this._validate(Br.layoutProperty,`layers.${this.id}.layout.${e}`,e,t,r)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){if(e.endsWith("-transition")){let t=e.slice(0,-11);if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))throw Error(e+p1);return this._transitionablePaint.getTransition(t)}if(e==="visibility"||this._unevaluatedLayout?.hasProperty(e))throw Error(e+p1);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(e==="visibility"||this._unevaluatedLayout?.hasProperty(e))return this.fire(new ee(Error(e+p1))),!1;if(t!=null&&this._validate(Br.paintProperty,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let i=this._transitionablePaint._values[e],n=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let s=this._transitionablePaint._values[e].value;return s.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(e,o,s)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e=this.minzoom,t=!1){return this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&e>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}retainPriorGlobalState(e,t){this._transitionablePaint?.retainPriorGlobalState(e,t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(e.layout||(e.layout={}),e.layout.visibility=this.visibility),xT(e,(t,r)=>t!==void 0&&!(r==="layout"&&!Object.keys(t).length)&&!(r==="paint"&&!Object.keys(t).length))}_validate(e,t,r,i,n={}){return vc(this,e,{key:t,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof bi&&Ys(t.property.specification)&&(t.value.kind==="source"||t.value.kind==="composite")&&t.value.isStateDependent)return!0}return!1}},A5,lz=()=>A5||(A5=new Kt({"raster-opacity":new $(z.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new $(z.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new $(z.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new $(z.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new $(z.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new $(z.paint_raster["raster-contrast"],"raster-contrast"),resampling:new $(z.paint_raster.resampling,"resampling"),"raster-resampling":new $(z.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new $(z.paint_raster["raster-fade-duration"],"raster-fade-duration")})),uz={get paint(){return lz()}},my=e=>e.type==="raster",cz=class extends Yi{constructor(e,t){super(e,uz,t)}},hz={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},xc=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},ft=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function dt(e,t=1){let r=0,i=0;return{members:e.map(n=>{let a=pz(n.type),o=r=M5(r,Math.max(t,a)),s=n.components||1;return i=Math.max(i,a),r+=a*s,{name:n.name,type:n.type,components:s,offset:o}}),size:M5(r,Math.max(i,t)),alignment:t}}function pz(e){return hz[e].BYTES_PER_ELEMENT}function M5(e,t){return Math.ceil(e/t)*t}var rc=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=e*2;return this.int16[i+0]=t,this.int16[i+1]=r,e}};rc.prototype.bytesPerElement=4,G("StructArrayLayout2i4",rc);var Ad=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*3;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}};Ad.prototype.bytesPerElement=6,G("StructArrayLayout3i6",Ad);var gy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=e*4;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}};gy.prototype.bytesPerElement=8,G("StructArrayLayout4i8",gy);var yy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,o){let s=e*6;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,e}};yy.prototype.bytesPerElement=12,G("StructArrayLayout2i4i12",yy);var _y=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.int8=new Int8Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,i,n,a,o,s)}emplace(e,t,r,i,n,a,o,s,l){let u=e*5,c=e*10;return this.int16[u+0]=t,this.int16[u+1]=r,this.uint8[c+4]=i,this.uint8[c+5]=n,this.uint8[c+6]=a,this.uint8[c+7]=o,this.int8[c+8]=s,this.int8[c+9]=l,e}};_y.prototype.bytesPerElement=10,G("StructArrayLayout2i4ub2b10",_y);var ic=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=e*2;return this.float32[i+0]=t,this.float32[i+1]=r,e}};ic.prototype.bytesPerElement=8,G("StructArrayLayout2f8",ic);var vy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,i,n,a,o,s,l,u)}emplace(e,t,r,i,n,a,o,s,l,u,c){let h=e*10;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,e}};vy.prototype.bytesPerElement=20,G("StructArrayLayout10ui20",vy);var xy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,i,n,a,o,s)}emplace(e,t,r,i,n,a,o,s,l){let u=e*8;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,e}};xy.prototype.bytesPerElement=16,G("StructArrayLayout8ui16",xy);var by=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u,c,h,p){let d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,i,n,a,o,s,l,u,c,h,p)}emplace(e,t,r,i,n,a,o,s,l,u,c,h,p,d){let f=e*14,m=e*7;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=i,this.int16[f+3]=n,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,this.float32[m+6]=d,e}};by.prototype.bytesPerElement=28,G("StructArrayLayout4i4ui4i1f28",by);var wy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*3;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}};wy.prototype.bytesPerElement=12,G("StructArrayLayout3f12",wy);var Ty=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=e*1;return this.uint32[r+0]=t,e}};Ty.prototype.bytesPerElement=4,G("StructArrayLayout1ul4",Ty);var Sy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,a,o,s,l)}emplace(e,t,r,i,n,a,o,s,l,u){let c=e*10,h=e*5;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[h+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,e}};Sy.prototype.bytesPerElement=20,G("StructArrayLayout6i1ul2ui20",Sy);var Ey=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,o){let s=e*6;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,e}};Ey.prototype.bytesPerElement=12,G("StructArrayLayout2i2i2i12",Ey);var Cy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}emplace(e,t,r,i,n,a){let o=e*4,s=e*8;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=i,this.int16[s+6]=n,this.int16[s+7]=a,e}};Cy.prototype.bytesPerElement=16,G("StructArrayLayout2f1f2i16",Cy);var Py=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,o){let s=e*16,l=e*4,u=e*8;return this.uint8[s+0]=t,this.uint8[s+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=o,e}};Py.prototype.bytesPerElement=16,G("StructArrayLayout2ub2f2i16",Py);var Md=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*3;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}};Md.prototype.bytesPerElement=6,G("StructArrayLayout3ui6",Md);var Dy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g){let y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g)}emplace(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y){let v=e*26,x=e*13,b=e*52;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[x+7]=h,this.float32[x+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=_,this.int16[v+22]=g,this.float32[x+12]=y,e}};Dy.prototype.bytesPerElement=52,G("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",Dy);var Ay=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y,v,x,b,w,T,S,E,P,D,F){let I=this.length;return this.resize(I+1),this.emplace(I,e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y,v,x,b,w,T,S,E,P,D,F)}emplace(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y,v,x,b,w,T,S,E,P,D,F,I){let C=e*34,A=e*17;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=i,this.int16[C+3]=n,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=m,this.uint16[C+15]=_,this.uint16[C+16]=g,this.uint16[C+17]=y,this.uint16[C+18]=v,this.uint16[C+19]=x,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[A+12]=S,this.float32[A+13]=E,this.float32[A+14]=P,this.uint16[C+30]=D,this.uint16[C+31]=F,this.float32[A+16]=I,e}};Ay.prototype.bytesPerElement=68,G("StructArrayLayout8i15ui1ul2f2ui1f68",Ay);var Id=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=e*1;return this.float32[r+0]=t,e}};Id.prototype.bytesPerElement=4,G("StructArrayLayout1f4",Id);var My=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*6,a=e*3;return this.uint16[n+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,e}};My.prototype.bytesPerElement=12,G("StructArrayLayout1ui2f12",My);var Iy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*2,a=e*4;return this.uint32[n+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=i,e}};Iy.prototype.bytesPerElement=8,G("StructArrayLayout1ul2ui8",Iy);var ky=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=e*2;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}};ky.prototype.bytesPerElement=4,G("StructArrayLayout2ui4",ky);var zy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=e*1;return this.uint16[r+0]=t,e}};zy.prototype.bytesPerElement=2,G("StructArrayLayout1ui2",zy);var Fy=class extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=e*4;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}};Fy.prototype.bytesPerElement=16,G("StructArrayLayout4f16",Fy);var eE=class extends xc{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 k(this.anchorPointX,this.anchorPointY)}};eE.prototype.size=20;var tE=class extends Sy{get(e){return new eE(this,e)}};G("CollisionBoxArray",tE);var rE=class extends xc{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};rE.prototype.size=52;var iE=class extends Dy{get(e){return new rE(this,e)}};G("PlacedSymbolArray",iE);var nE=class extends xc{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};nE.prototype.size=68;var aE=class extends Ay{get(e){return new nE(this,e)}};G("SymbolInstanceArray",aE);var oE=class extends Id{getoffsetX(e){return this.float32[e*1+0]}};G("GlyphOffsetArray",oE);var sE=class extends Ad{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};G("SymbolLineVertexArray",sE);var lE=class extends xc{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};lE.prototype.size=12;var uE=class extends My{get(e){return new lE(this,e)}};G("TextAnchorOffsetArray",uE);var cE=class extends xc{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]}};cE.prototype.size=8;var hE=class extends Iy{get(e){return new cE(this,e)}};G("FeatureIndexArray",hE);var ho=class extends rc{},dz=class extends Ad{},fz=class extends gy{},mz=class extends rc{},gz=class extends rc{},yz=class extends yy{},_z=class extends _y{},vz=class extends ic{},bs=class extends vy{},I5=class extends xy{},xz=class extends by{},bz=class extends wy{},wz=class extends Ty{},k5=class extends Ey{},Tz=class extends Cy{},Sz=class extends Py{},Ez=class extends Md{},yn=class extends Md{},Ry=class extends ky{},Cz=class extends zy{},Ly=dt([{name:"a_pos",components:2,type:"Int16"}],4),Pz=Ly.members;Ly.size,Ly.alignment;var ct=class As{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,r,i,n){let a=this.segments[this.segments.length-1];return t>As.MAX_VERTEX_ARRAY_LENGTH&&we(`Max vertices per segment is ${As.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${As.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+t>As.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(t,r,i){let n={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(t,r,i){return this.prepareSegment(0,t,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let t of this.segments)for(let r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,i,n){return new As([{vertexOffset:t,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};ct.MAX_VERTEX_ARRAY_LENGTH=2**16-1,G("SegmentVector",ct);function z5(e,t){return e=Q(Math.floor(e),0,255),t=Q(Math.floor(t),0,255),256*e+t}var Dz=dt([{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"}]),Az=dt([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),Mz=A_(((e,t)=>{function r(i,n){for(var a=i.length&3,o=i.length-a,s=n,l,u=3432918353,c=461845907,h,p=0;p<o;)h=i.charCodeAt(p)&255|(i.charCodeAt(++p)&255)<<8|(i.charCodeAt(++p)&255)<<16|(i.charCodeAt(++p)&255)<<24,++p,h=(h&65535)*u+(((h>>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,s^=h,s=s<<13|s>>>19,l=(s&65535)*5+(((s>>>16)*5&65535)<<16)|0,s=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(h=0,a){case 3:h^=(i.charCodeAt(p+2)&255)<<16;case 2:h^=(i.charCodeAt(p+1)&255)<<8;case 1:h^=i.charCodeAt(p)&255,h=(h&65535)*u+(((h>>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,s^=h}return s^=i.length,s^=s>>>16,s=(s&65535)*2246822507+(((s>>>16)*2246822507&65535)<<16)|0,s^=s>>>13,s=(s&65535)*3266489909+(((s>>>16)*3266489909&65535)<<16)|0,s^=s>>>16,s>>>0}t!==void 0&&(t.exports=r)})),Iz=A_(((e,t)=>{function r(i,n){for(var a=i.length,o=n^a,s=0,l;a>=4;)l=i.charCodeAt(s)&255|(i.charCodeAt(++s)&255)<<8|(i.charCodeAt(++s)&255)<<16|(i.charCodeAt(++s)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16)^l,a-=4,++s;switch(a){case 3:o^=(i.charCodeAt(s+2)&255)<<16;case 2:o^=(i.charCodeAt(s+1)&255)<<8;case 1:o^=i.charCodeAt(s)&255,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16)}return o^=o>>>13,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>15,o>>>0}t.exports=r})),kd=VM(A_(((e,t)=>{var r=Mz(),i=Iz();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=i}))(),1),pE=class dE{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,i,n){this.ids.push(F5(t)),this.positions.push(r,i,n)}getPositions(t){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=F5(t),i=0,n=this.ids.length-1;for(;i<n;){let o=i+n>>1;this.ids[o]>=r?n=o:i=o+1}let a=[];for(;this.ids[i]===r;){let o=this.positions[3*i],s=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:o,start:s,end:l}),i++}return a}static serialize(t,r){let i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return By(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(t){let r=new dE;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}};function F5(e){let t=+e;return!isNaN(t)&&t<=2**53-1?t:(0,kd.default)(String(e))}function By(e,t,r,i){for(;r<i;){let n=e[r+i>>1],a=r-1,o=i+1;for(;;){do a++;while(e[a]<n);do o--;while(e[o]>n);if(a>=o)break;Fp(e,a,o),Fp(t,3*a,3*o),Fp(t,3*a+1,3*o+1),Fp(t,3*a+2,3*o+2)}o-r<i-o?(By(e,t,r,o),r=o+1):(By(e,t,o+1,i),i=o)}}function Fp(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}G("FeaturePositionMap",pE);var Hn=class{constructor(e,t){this.gl=e.gl,this.location=t}},te=class extends Hn{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},q=class extends Hn{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},_e=class extends Hn{constructor(e,t){super(e,t),this.current=[0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},Pr=class extends Hn{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},Qs=class extends Hn{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},Ba=class extends Hn{constructor(e,t){super(e,t),this.current=he.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},R5=class extends Hn{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e.length*4);for(let r=0;r<e.length;r++)t[4*r]=e[r].r,t[4*r+1]=e[r].g,t[4*r+2]=e[r].b,t[4*r+3]=e[r].a;this.gl.uniform4fv(this.location,t)}}},L5=class extends Hn{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e);this.gl.uniform1fv(this.location,t)}}},kz=new Float32Array(16),Hi=class extends Hn{constructor(e,t){super(e,t),this.current=kz}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);else for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}};function Oy(e){return[z5(255*e.r,255*e.g),z5(255*e.b,255*e.a)]}var Iu=class{constructor(e,t,r){this.value=e,this.uniformNames=t.map(i=>`u_${i}`),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return this.type==="color"?new Ba(e,t):new q(e,t)}},lo=class{constructor(e,t){this.uniformNames=t.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,r,i){let n=null;i==="u_pattern_to"?n=this.patternTo:i==="u_pattern_from"?n=this.patternFrom:i==="u_dasharray_to"?n=this.dashTo:i==="u_dasharray_from"?n=this.dashFrom:i==="u_pixel_ratio_to"?n=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(n=this.pixelRatioFrom),n!==null&&e.set(n)}getBinding(e,t,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new Qs(e,t):new q(e,t)}},zn=class{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,t,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new Re(0,r),t,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(i,e,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Re(0,n),r,i);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if(this.type==="color"){let i=Oy(r);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},Oi=class{constructor(e,t,r,i,n,a){this.expression=e,this.uniformNames=t.map(o=>`u_${o}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map(o=>({name:`a_${o}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,r){let i=this.expression.evaluate(new Re(this.zoom,r),t,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new Re(this.zoom+1,r),t,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,i,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Re(this.zoom,n),r,i),o=this.expression.evaluate(new Re(this.zoom+1,n),r,i);this._setPaintValue(e,t,a,o)}_setPaintValue(e,t,r,i){if(this.type==="color"){let n=Oy(r),a=Oy(i);for(let o=e;o<t;o++)this.paintVertexArray.emplace(o,n[0],n[1],a[0],a[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=Q(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,r){return new q(e,t)}},Ta=class{constructor(e,t,r,i,n,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(e,t,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,this.getPositionIds(t),r)}updatePaintArray(e,t,r,i,n){this._setPaintValues(e,t,this.getPositionIds(r),n)}_setPaintValues(e,t,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],o=n[r.mid],s=n[r.max];if(a&&o&&s)for(let l=e;l<t;l++)this.emplace(this.zoomInPaintVertexArray,l,a,o),this.emplace(this.zoomOutPaintVertexArray,l,s,o)}upload(e){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},fE=class extends Ta{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns?.[this.layerId]}getVertexAttributes(){return Dz.members}emplace(e,t,r,i){e.emplace(t,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}},mE=class extends Ta{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes?.[this.layerId]}getVertexAttributes(){return Az.members}emplace(e,t,r,i){e.emplace(t,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}},gE=class{constructor(e,t,r){this.binders={},this._buffers=[];let i=[];for(let n in e.paint._values){if(!r(n))continue;let a=e.paint.get(n);if(!(a instanceof bi)||!Ys(a.property.specification))continue;let o=zz(n,e.type),s=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,c=a.property.specification["property-type"],h=c==="cross-faded"||c==="cross-faded-data-driven";if(s.kind==="constant")this.binders[n]=h?new lo(s.value,o):new Iu(s.value,o,l),i.push(`/u_${n}`);else if(s.kind==="source"||h){let p=B5(n,l,"source");this.binders[n]=h?n==="line-dasharray"?new mE(s,l,u,t,p,e.id):new fE(s,l,u,t,p,e.id):new zn(s,o,l,p),i.push(`/a_${n}`)}else{let p=B5(n,l,"composite");this.binders[n]=new Oi(s,o,l,u,t,p),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof zn||t instanceof Oi?t.maxValue:0}populatePaintArrays(e,t,r){for(let i in this.binders){let n=this.binders[i];(n instanceof zn||n instanceof Oi||n instanceof Ta)&&n.populatePaintArray(e,t,r)}}setConstantPatternPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof lo&&i.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof lo&&i.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,r,i,n){let a=!1;for(let o of e){let s=t.getPositions(o.id);for(let l of s){let u=r.feature(l.index);for(let c in this.binders){let h=this.binders[c];(h instanceof zn||h instanceof Oi||h instanceof Ta)&&h.expression.isStateDependent===!0&&(h.expression=i.paint.get(c).value,h.updatePaintArray(l.start,l.end,u,o.state,n),a=!0)}}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof Iu||r instanceof lo)&&e.push(...r.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof zn||r instanceof Oi)for(let i of r.paintVertexAttributes)e.push(i.name);else if(r instanceof Ta){let i=r.getVertexAttributes();for(let n of i)e.push(n.name)}}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Iu||r instanceof lo||r instanceof Oi)for(let i of r.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof Iu||n instanceof lo||n instanceof Oi){for(let a of n.uniformNames)if(t[a]){let o=n.getBinding(e,t[a],a);r.push({name:a,property:i,binding:o})}}}return r}setUniforms(e,t,r,i){for(let{name:n,property:a,binding:o}of t)this.binders[a].setUniform(o,i,r.get(a),n)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let r=this.binders[t];if(e&&r instanceof Ta){let i=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof zn||r instanceof Oi)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof zn||r instanceof Oi||r instanceof Ta)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof zn||t instanceof Oi||t instanceof Ta)&&t.destroy()}}},To=class{constructor(e,t,r=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new gE(i,t,r);this.needsUpload=!1,this._featureMap=new pE,this._bufferOffset=0}populatePaintArrays(e,t,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(e,t,i);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function zz(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function Fz(e){return{"line-pattern":{source:bs,composite:bs},"fill-pattern":{source:bs,composite:bs},"fill-extrusion-pattern":{source:bs,composite:bs},"line-dasharray":{source:I5,composite:I5}}[e]}function B5(e,t,r){let i={color:{source:ic,composite:Fy},number:{source:Id,composite:ic}};return Fz(e)?.[r]||i[t][r]}G("ConstantBinder",Iu),G("CrossFadedConstantBinder",lo),G("SourceExpressionBinder",zn),G("CrossFadedPatternBinder",fE),G("CrossFadedDasharrayBinder",mE),G("CompositeExpressionBinder",Oi),G("ProgramConfiguration",gE,{omit:["_buffers"]}),G("ProgramConfigurationSet",To);var jy=2**14-1,O5=-jy-1;function Io(e){let t=R/e.extent,r=e.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*t),o=Math.round(n.y*t);n.x=Q(a,O5,jy),n.y=Q(o,O5,jy),(a<n.x||a>n.x+1||o<n.y||o>n.y+1)&&we("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function ko(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Io(e):[]}}var qi=class Ny{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){let r=new Ny;return r.extend(t(new k(this.minX,this.minY))),r.extend(t(new k(this.maxX,this.minY))),r.extend(t(new k(this.minX,this.maxY))),r.extend(t(new k(this.maxX,this.maxY))),r}static fromPoints(t){let r=new Ny;for(let i of t)r.extend(i);return r}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}},Rz=qi.fromPoints([new k(0,0),new k(R,R)]);function zd(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function j5(e){return e.every(t=>t.x<0)||e.every(t=>t.x>8192)||e.every(t=>t.y<0)||e.every(t=>t.y>8192)}function nv(e){return e.x<0||e.x>=8192||e.y<0||e.y>=8192}var N5=-32768;function Lz(e,t,r,i,n){e.emplaceBack(N5+t*8+i,N5+r*8+n)}var av=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new mz,this.indexArray=new yn,this.segments=new ct,this.programConfigurations=new To(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){let i=this.layers[0],n=[],a=null,o=!1,s=i.type==="heatmap";if(i.type==="circle"){let h=i;a=h.layout.get("circle-sort-key"),o=!a.isConstant(),s||(s=h.paint.get("circle-pitch-alignment")==="map")}let l=s?t.subdivisionGranularity.circle:1,u=new Re(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:h,id:p,index:d,sourceLayerIndex:f}of e){let m=ko(h,c);if(!this.layers[0]._featureFilter.filter(u,m,r))continue;let _=o?a.evaluate(m,{},r):void 0,g={id:p,properties:h.properties,type:h.type,sourceLayerIndex:f,index:d,geometry:c?m.geometry:Io(h),patterns:{},sortKey:_};n.push(g)}o&&n.sort((h,p)=>h.sortKey-p.sortKey);for(let h of n){let{geometry:p,index:d,sourceLayerIndex:f}=h,m=e[d].feature;this.addFeature(h,p,d,r,l),t.featureIndex.insert(m,p,d,f,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures(e){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Pz),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let o=a.length;for(let s of t)for(let l of s){let u=l.x,c=l.y;if(nv(l))continue;let h=this.segments.prepareSegment(o*o,this.layoutVertexArray,this.indexArray,e.sortKey),p=h.vertexLength;for(let d=0;d<o;d++)for(let f=0;f<o;f++)Lz(this.layoutVertexArray,u,c,a[f],a[d]);for(let d=0;d<o-1;d++)for(let f=0;f<o-1;f++){let m=p+d*o+f,_=p+(d+1)*o+f;this.indexArray.emplaceBack(m,_+1,m+1),this.indexArray.emplaceBack(m,_,_+1)}h.vertexLength+=o*o,h.primitiveLength+=(o-1)*(o-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:{},canonical:i})}};G("CircleBucket",av,{omit:["layers"]});function yE(e,t){for(let r of e)if(Js(t,r))return!0;for(let r of t)if(Js(e,r))return!0;return ov(e,t)}function vf(e,t,r){return Js(e,t)?!0:Vy(t,e,r)}function _E(e,t){if(e.length===1)return V5(t,e[0]);for(let r of t)for(let i of r)if(Js(e,i))return!0;for(let r of e)if(V5(t,r))return!0;for(let r of t)if(ov(e,r))return!0;return!1}function Bz(e,t,r){for(let i of t){if(e.length>=3){for(let n of i)if(Js(e,n))return!0}if(Oz(e,i,r))return!0}return!1}function Oz(e,t,r){if(e.length>1){if(ov(e,t))return!0;for(let i of t)if(Vy(i,e,r))return!0}for(let i of e)if(Vy(i,t,r))return!0;return!1}function ov(e,t){if(e.length===0||t.length===0)return!1;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1];for(let a=0;a<t.length-1;a++){let o=t[a],s=t[a+1];if(jz(i,n,o,s))return!0}}return!1}function jz(e,t,r,i){return Da(e,r,i)!==Da(t,r,i)&&Da(e,t,r)!==Da(e,t,i)}function Vy(e,t,r){let i=r*r;if(t.length===1)return e.distSqr(t[0])<i;for(let n=1;n<t.length;n++){let a=t[n-1],o=t[n];if(vE(e,a,o)<i)return!0}return!1}function vE(e,t,r){let i=t.distSqr(r);if(i===0)return e.distSqr(t);let n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return n<0?e.distSqr(t):n>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(n)._add(t))}function V5(e,t){let r=!1,i,n,a;for(let o of e){i=o;for(let s=0,l=i.length-1;s<i.length;l=s++)n=i[s],a=i[l],n.y>t.y!=a.y>t.y&&t.x<(a.x-n.x)*(t.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function Js(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){let a=e[i],o=e[n];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Nz(e,t,r,i,n){for(let o of e)if(t<=o.x&&r<=o.y&&i>=o.x&&n>=o.y)return!0;let a=[new k(t,r),new k(t,n),new k(i,n),new k(i,r)];if(e.length>2){for(let o of a)if(Js(e,o))return!0}for(let o=0;o<e.length-1;o++){let s=e[o],l=e[o+1];if(Vz(s,l,a))return!0}return!1}function Vz(e,t,r){let i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;let a=Da(e,t,r[0]);return a!==Da(e,t,r[1])||a!==Da(e,t,r[2])||a!==Da(e,t,r[3])}function Bs(e,t,r){let i=t.paint.get(e).value;return i.kind==="constant"?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function xf(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function bf(e,t,r,i,n){if(!t[0]&&!t[1])return e;let a=k.convert(t)._mult(n);r==="viewport"&&a._rotate(-i);let o=[];for(let s of e)o.push(s.sub(a));return o}function Uz(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],n=t.at(-1);(r===0||n&&!i.equals(n))&&t.push(i)}return t}function $z(e,t){let r=[];for(let i of e){let n=Uz(i),a=[];for(let o=0;o<n.length;o++){let s=n[o],l=n[o-1],u=n[o+1],c=o===0?new k(0,0):s.sub(l)._unit()._perp(),h=o===n.length-1?new k(0,0):u.sub(s)._unit()._perp(),p=c._add(h)._unit(),d=p.x*h.x+p.y*h.y;d!==0&&p._mult(1/d),a.push(p._mult(t)._add(s))}r.push(a)}return r}function qz({queryGeometry:e,size:t},r){return vf(e,r,t)}function Gz({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return vf(e,a,t*(r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function Zz({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){let o=r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera,s=t*(r.cameraToCenterDistance/o);return vf(e,sv(a,r,i,n),s)}function Hz({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return vf(e,sv(a,r,i,n),t)}function xE({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a="map",pitchScale:o="map"},s){let l=a==="map"?o==="map"?qz:Gz:o==="map"?Zz:Hz,u={queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n};for(let c of s)for(let h of c)if(l(u,h))return!0;return!1}function sv(e,t,r,i){let n=t.projectTileCoordinates(e.x,e.y,r,i?.(e.x,e.y)).point;return new k((n.x*.5+.5)*t.width,(-n.y*.5+.5)*t.height)}function Wz(e,t,r,i){return e.map(n=>sv(n,t,r,i))}var U5,Yz=()=>U5||(U5=new Kt({"circle-sort-key":new re(z.layout_circle["circle-sort-key"],"circle-sort-key")})),$5,Xz=()=>$5||($5=new Kt({"circle-radius":new re(z.paint_circle["circle-radius"],"circle-radius"),"circle-color":new re(z.paint_circle["circle-color"],"circle-color"),"circle-blur":new re(z.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new re(z.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new $(z.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new $(z.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new $(z.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new $(z.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new re(z.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new re(z.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new re(z.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),Kz={get paint(){return Xz()},get layout(){return Yz()}},Qz=e=>e.type==="circle",Jz=class extends Yi{constructor(e,t){super(e,Kz,t)}createBucket(e){return new av(e)}queryRadius(e){let t=e;return Bs("circle-radius",this,t)+Bs("circle-stroke-width",this,t)+xf(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){let l=bf(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c=this.paint.get("circle-pitch-scale"),h=this.paint.get("circle-pitch-alignment"),p,d;return h==="map"?(p=l,d=u*a):(p=Wz(l,n,o,s),d=u),xE({queryGeometry:p,size:d,transform:n,unwrappedTileID:o,getElevation:s,pitchAlignment:h,pitchScale:c},i)}},bE=class extends av{};G("HeatmapBucket",bE,{omit:["layers"]});var q5,e9=()=>q5||(q5=new Kt({"heatmap-radius":new re(z.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new re(z.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new $(z.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new _f(z.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new $(z.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),t9={get paint(){return e9()}};function lv(e,{width:t,height:r},i,n){if(!n)n=new Uint8Array(t*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${t*r*i}`);return e.width=t,e.height=r,e.data=n,e}function wE(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;let n=lv({},{width:t,height:r},i);uv(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function uv(e,t,r,i,n,a){if(n.width===0||n.height===0)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw RangeError("out of range destination coordinates for image copy");let o=e.data,s=t.data;if(o===s)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let u=((r.y+l)*e.width+r.x)*a,c=((i.y+l)*t.width+i.x)*a;for(let h=0;h<n.width*a;h++)s[c+h]=o[u+h]}return t}var cv=class TE{constructor(t,r){lv(this,t,1,r)}resize(t){wE(this,t,1)}clone(){return new TE({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,i,n,a){uv(t,r,i,n,a,1)}},Ye=class SE{constructor(t,r){lv(this,t,4,r)}resize(t){wE(this,t,4)}replace(t,r){r?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new SE({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,i,n,a){uv(t,r,i,n,a,4)}setPixel(t,r,i){let n=(t*this.width+r)*4;this.data[n+0]=Math.round(i.r*255/i.a),this.data[n+1]=Math.round(i.g*255/i.a),this.data[n+2]=Math.round(i.b*255/i.a),this.data[n+3]=Math.round(i.a*255)}};function d1(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=4){let i=e[r+3];t[r+0]=Math.round(e[r+0]*i/255),t[r+1]=Math.round(e[r+1]*i/255),t[r+2]=Math.round(e[r+2]*i/255),t[r+3]=i}return t}G("AlphaImage",cv),G("RGBAImage",Ye);function EE(e){let t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new Ye({width:r,height:i});if(!EI(r))throw Error(`width is not a power of 2 - ${r}`);let a=(o,s,l)=>{t[e.evaluationKey]=l;let u=e.expression.evaluate(t);n.setPixel(o/4/r,s/4,u)};if(e.clips)for(let o=0,s=0;o<i;++o,s+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let c=l/(r-1),{start:h,end:p}=e.clips[o],d=h*(1-c)+p*c;a(s,u,d)}else for(let o=0,s=0;o<r;o++,s+=4){let l=o/(r-1);a(0,s,l)}return n}var Fd="big-fb",r9=e=>e.type==="heatmap",i9=class extends Yi{createBucket(e){return new bE(e)}constructor(e,t){super(e,t9,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=EE({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(Fd)}queryRadius(e){return Bs("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){return xE({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(t,r)*a,transform:n,unwrappedTileID:o,getElevation:s},i)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}},G5,n9=()=>G5||(G5=new Kt({"hillshade-illumination-direction":new $(z.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new $(z.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new $(z.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new $(z.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new $(z.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new $(z.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new $(z.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new $(z.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new $(z.paint_hillshade.resampling,"resampling")})),a9={get paint(){return n9()}},o9=e=>e.type==="hillshade",s9=class extends Yi{constructor(e,t){super(e,a9,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(e.length,t.length,r.length,i.length);e=e.concat(Array(n-e.length).fill(e.at(-1))),t=t.concat(Array(n-t.length).fill(t.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=t.map(Je);return{directionRadians:e.map(Je),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},Z5,l9=()=>Z5||(Z5=new Kt({"color-relief-opacity":new $(z["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new _f(z["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new $(z["paint_color-relief"].resampling,"resampling")})),u9={get paint(){return l9()}};function Rp(e){return"data"in e}var Ot=class{constructor(e,t,r,i){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,i)}update(e,t,r){let{width:i,height:n}=e,a=(this.size?.[0]!==i||this.size[1]!==n)&&!r,{context:o}=this,{gl:s}=o;this.useMipmap=!!t?.useMipmap,a&&this.size&&this.format===s.RGBA&&(s.deleteTexture(this.texture),this.texture=s.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1);let l=this.format===s.RGBA&&t?.premultiply!==!1;if(a)if(this.size=[i,n],this.format===s.RGBA&&i>0&&n>0){let u=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(s.texStorage2D(s.TEXTURE_2D,u,s.RGBA8,i,n),Rp(e)){o.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=e;l&&c&&(c=d1(c)),c&&s.texSubImage2D(s.TEXTURE_2D,0,0,0,i,n,s.RGBA,s.UNSIGNED_BYTE,c)}else o.pixelStoreUnpackPremultiplyAlpha.set(l),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,e)}else Rp(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,l,i,n,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(e,s));else{let{x:u,y:c}=r||{x:0,y:0};Rp(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,l,u,c,i,n,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(e,u,c,s))}this.useMipmap&&!(Rp(e)&&e.data===null)&&s.generateMipmap(s.TEXTURE_2D),o.pixelStoreUnpackFlipY.setDefault(),o.pixelStoreUnpack.setDefault(),o.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,r,i,n){let{data:a}=e;t&&a&&(a=d1(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(e,t,r,i){i.texSubImage2D(i.TEXTURE_2D,0,t,r,i.RGBA,i.UNSIGNED_BYTE,e)}_updateRawData(e,t,r,i,n,a,o){let{data:s}=e;t&&s&&(s=d1(s)),o.texSubImage2D(o.TEXTURE_2D,0,r,i,n,a,o.RGBA,o.UNSIGNED_BYTE,s)}bind(e,t,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||e;e!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),this.magFilter=e),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)}generateMipmap(){if(!this.useMipmap)return;let{gl:e}=this.context;e.bindTexture(e.TEXTURE_2D,this.texture),e.generateMipmap(e.TEXTURE_2D)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Vn,c9=(Vn=class{constructor(t,r,i,n=1,a=1,o=1,s=0){if(this.uid=t,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){we(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Vn.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=o,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let c=-2;c<l+2;c++){let h=this._idx(0,Math.max(0,Math.min(l-1,c)));(c<0||c>=l)&&this.data.copyWithin(this._idx(0,c),h,h+l),this.data.fill(this.data[h],this._idx(-2,c),this._idx(0,c)),this.data.fill(this.data[h+l-1],this._idx(l,c),this._idx(l+1,c)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let c=0;c<l;c++)for(let h=0;h<l;h++){let p=this._idx(c,h)*4,d=this._unpackAtIndex(u,p);d>this.max&&(this.max=d),d<this.min&&(this.min=d)}}get(t,r){let i=this._getByteView(),n=this._idx(t,r)*4;return this._unpackAtIndex(i,n)}sampleBilinear(t,r){let i=Math.floor(t),n=Math.floor(r);if(i<-1||i>=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),o=((n+2)*this.stride+i+2)*4,s=this.stride*4,l=t-i,u=r-n,c=this._unpackAtIndex(a,o),h=this._unpackAtIndex(a,o+4),p=this._unpackAtIndex(a,o+s),d=this._unpackAtIndex(a,o+s+4);return c*(1-l)*(1-u)+h*l*(1-u)+p*(1-l)*u+d*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,r){if(t<-2||t>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(t+2)}unpack(t,r,i){return t*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(t){return CE(t,this.getUnpackVector())}getPixels(){return new Ye({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(t,r,i){if(this.dim!==t.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:o=s-2;break;case 1:s=o+2}let l=-r*this.dim,u=-i*this.dim;for(let c=o;c<s;c++)for(let h=n;h<a;h++)this.data[this._idx(h,c)]=t.data[this._idx(h+l,c+u)]}_getByteView(){let t=Vn.byteViewCache.get(this);return t?.buffer!==this.data.buffer&&(t=new Uint8Array(this.data.buffer),Vn.byteViewCache.set(this,t)),t}_unpackAtIndex(t,r){return this.unpack(t[r],t[r+1],t[r+2])}},Vn.byteViewCache=new WeakMap,Vn);function CE(e,t){let r=t[0],i=t[1],n=t[2],a=t[3],o=[r,i,n].filter(c=>c!==0);if(o.length===0)return{r:0,g:0,b:0};let s=Math.min(...o),l=Math.round((e+a)/s),u=c=>c===0?0:Math.floor(l*s/c)%256;return{r:u(r),g:u(i),b:u(n)}}G("DEMData",c9);var h9=e=>e.type==="color-relief",p9=class extends Yi{constructor(e,t){super(e,u9,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof Ku&&r._styleExpression.expression instanceof Si){this.colorRampExpression=r;let a=r._styleExpression.expression;t.elevationStops=a.labels,t.colorStops=[];for(let o of t.elevationStops)t.colorStops.push(a.evaluate({globals:{elevation:o}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[he.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let i={elevationStops:[],colorStops:[]},n=(t.elevationStops.length-1)/(e-1);for(let a=0;a<t.elevationStops.length-.5;a+=n)i.elevationStops.push(t.elevationStops[Math.round(a)]),i.colorStops.push(t.colorStops[Math.round(a)]);return we(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${t.elevationStops.length}`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,t,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(t),n=new Ye({width:i.colorStops.length,height:1}),a=new Ye({width:i.colorStops.length,height:1});for(let o=0;o<i.elevationStops.length;o++){let s=CE(i.elevationStops[o],r);a.setPixel(0,o,new he(s.r/255,s.g/255,s.b/255,1)),n.setPixel(0,o,i.colorStops[o])}return this.colorRampTextures={elevationTexture:new Ot(e,a,e.gl.RGBA),colorTexture:new Ot(e,n,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},Uy=dt([{name:"a_pos",components:2,type:"Int16"}],4),d9=Uy.members;Uy.size,Uy.alignment;function Rd(e,t,r){let i=r.patternDependencies,n=!1;for(let a of t){let o=a.paint.get(`${e}-pattern`);o.isConstant()||(n=!0);let s=o.constantOr(null);s&&(n=!0,i[s.to]=!0,i[s.from]=!0)}return n}function hv(e,t,r,i,n){let{zoom:a}=i,o=n.patternDependencies;for(let s of t){let l=s.paint.get(`${e}-pattern`).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:a-1},r,{},n.availableImages),c=l.evaluate({zoom:a},r,{},n.availableImages),h=l.evaluate({zoom:a+1},r,{},n.availableImages);u=u?.name?u.name:u,c=c?.name?c.name:c,h=h?.name?h.name:h,o[u]=!0,o[c]=!0,o[h]=!0,r.patterns[s.id]={min:u,mid:c,max:h}}}return r}var nc=new Set,$y=!1;function f9(e,t,r=2){let i=t&&t.length,n=i?t[0]*r:e.length;nc.size&&nc.clear();let a=PE(e,0,n,r,!0),o=[];if(!a||a.next===a.prev)return o;let s=0,l=0,u=0;if(i&&(a=v9(e,t,a,r)),e.length>80*r){s=e[0],l=e[1];let c=s,h=l;for(let p=r;p<n;p+=r){let d=e[p],f=e[p+1];d<s&&(s=d),f<l&&(l=f),d>c&&(c=d),f>h&&(h=f)}u=Math.max(c-s,h-l),u=u===0?0:32767/u}return qy(a,o,s,l,u),o}function PE(e,t,r,i,n){let a=null;if(n===k9(e,t,r,i)>0)for(let o=t;o<r;o+=i)a=Y5(o/i|0,e[o],e[o+1],a);else for(let o=r-i;o>=t;o-=i)a=Y5(o/i|0,e[o],e[o+1],a);return a&&ac(a,a.next)&&(sc(a),a=a.next),a}function So(e,t=e){let r=t===e,i=e,n;do n=!1,i!==i.next&&(nc.size===0||!nc.has(i))&&(ac(i,i.next)||Lt(i.prev,i,i.next)===0)?((r||i===t)&&(t=i.prev),$y=!0,sc(i),i=i.prev,n=!0):(r||i!==t)&&(i=i.next,n=!r);while(n||i!==t);return t}function qy(e,t,r,i,n){n&&C9(e,r,i,n);let a=e,o=!1;for(;e.prev!==e.next;){let s=e.prev,l=e.next;if(Lt(s,e,l)<0&&(n?g9(e,r,i,n):m9(e)))t.push(s.i,e.i,l.i),sc(e),e=l,a=l;else if(e=l,e===a){if($y=!1,e=So(e),$y){a=e;continue}if(!o){e=y9(e,t),a=e,o=!0;continue}_9(e,t,r,i,n);break}}}function m9(e){let t=e.prev,r=e,i=e.next,n=t.x,a=r.x,o=i.x,s=t.y,l=r.y,u=i.y,c=Math.min(n,a,o),h=Math.min(s,l,u),p=Math.max(n,a,o),d=Math.max(s,l,u),f=i.next;for(;f!==t;){if(f.x>=c&&f.x<=p&&f.y>=h&&f.y<=d&&(n!==f.x||s!==f.y)&&Bd(n,s,a,l,o,u,f.x,f.y)&&Lt(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function g9(e,t,r,i){let n=e.prev,a=e,o=e.next,s=n.x,l=a.x,u=o.x,c=n.y,h=a.y,p=o.y,d=Math.min(s,l,u),f=Math.min(c,h,p),m=Math.max(s,l,u),_=Math.max(c,h,p),g=Wy(d,f,t,r,i),y=Wy(m,_,t,r,i),v=e.prevZ;for(;v&&v.z>=g;){if(v.x>=d&&v.x<=m&&v.y>=f&&v.y<=_&&v!==o&&(s!==v.x||c!==v.y)&&Bd(s,c,l,h,u,p,v.x,v.y)&&Lt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let x=e.nextZ;for(;x&&x.z<=y;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=_&&x!==o&&(s!==x.x||c!==x.y)&&Bd(s,c,l,h,u,p,x.x,x.y)&&Lt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function y9(e,t){let r=e,i=!1;do{let n=r.prev,a=r.next.next;AE(n,r,r.next,a,!1)&&oc(n,a)&&oc(a,n)&&(t.push(n.i,r.i,a.i),sc(r),sc(r.next),r=e=a,i=!0),r=r.next}while(r!==e);return i?So(r):r}function _9(e,t,r,i,n){let a=e;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&A9(a,o)){let s=ME(a,o);a=So(a,a.next),s=So(s,s.next),qy(a,t,r,i,n),qy(s,t,r,i,n);return}o=o.next}a=a.next}while(a!==e)}var Gy=!1;function v9(e,t,r,i){let n=[];for(let a=0,o=t.length;a<o;a++){let s=PE(e,t[a]*i,a<o-1?t[a+1]*i:e.length,i,!1);s===s.next&&nc.add(s),n.push(D9(s))}n.sort(x9),w9(e.length/i,t.length),DE(r,r),Gy=!0;for(let a=0;a<n.length;a++)r=b9(n[a],r);return Gy=!1,So(r)}function x9(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function b9(e,t){let r=S9(e,t);if(!r)return t;let i=ME(r,e),n=i.next;return DE(r,n.next),So(i,i.next),So(r,r.next)}var bt=new Float64Array,Ld=0,Zy=[],Hy=[];function w9(e,t){let r=Math.ceil((e+2*t)/16)+t+2;bt.length<r*4&&(bt=new Float64Array(r*4)),Ld=0}function DE(e,t){let r=e;do{let i=Ld++;Zy[i]=r;let n=r.x,a=r.y,o=r.x,s=r.y,l=0;do{let c=r.next;r.z=i,c.x<n&&(n=c.x),c.x>o&&(o=c.x),c.y<a&&(a=c.y),c.y>s&&(s=c.y),r=c}while(++l<16&&r!==t);Hy[i]=r;let u=i*4;bt[u]=n,bt[u+1]=a,bt[u+2]=o,bt[u+3]=s}while(r!==t)}function T9(e,t){let r=e.z*4;t.x<bt[r]&&(bt[r]=t.x),t.y<bt[r+1]&&(bt[r+1]=t.y),t.x>bt[r+2]&&(bt[r+2]=t.x),t.y>bt[r+3]&&(bt[r+3]=t.y)}function H5(e){let t=Hy[e];for(;t.prev.next!==t;)t=t.next;return Hy[e]=t,t}function W5(e){let t=Zy[e];for(;t.prev.next!==t;)t=t.next;return Zy[e]=t,t}function S9(e,t){let r=t,i=e.x,n=e.y,a=-1/0,o;if(ac(e,r))return r;for(let p=0,d=0;p<Ld;p++,d+=4){if(n<bt[d+1]||n>bt[d+3]||bt[d]>i||bt[d+2]<=a)continue;let f=H5(p);r=W5(p);do{if(r.prev.next===r){if(ac(e,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let m=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(m<=i&&m>a&&(a=m,o=r.x<r.next.x?r:r.next,m===i))return o}}r=r.next}while(r!==f)}if(!o)return null;let s=o.x,l=o.y,u=Math.min(n,l),c=Math.max(n,l),h=1/0;for(let p=0,d=0;p<Ld;p++,d+=4){if(bt[d+2]<s||bt[d]>i||bt[d+3]<u||bt[d+1]>c)continue;let f=H5(p);r=W5(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=s&&i!==r.x&&Bd(n<l?i:a,n,s,l,n<l?a:i,n,r.x,r.y)){let m=Math.abs(n-r.y)/(i-r.x);(oc(r,e)||r.y===n&&r.next.y===n&&r.next.x>i)&&(m<h||m===h&&(r.x>o.x||r.x===o.x&&E9(o,r)))&&(o=r,h=m)}r=r.next}while(r!==f)}return o}function E9(e,t){return Lt(e.prev,e,t.prev)<0&&Lt(t.next,e,e.next)<0}var Kr=[],Ms=[],oo=new Uint32Array,_u=new Uint32Array,vu=new Uint32Array(256);function C9(e,t,r,i){let n=e,a=0;do n.z=Wy(n.x,n.y,t,r,i),Kr[a++]=n,n=n.next;while(n!==e);P9(a);let o=null;for(let s=0;s<a;s++){let l=Kr[s];l.prevZ=o,o&&(o.nextZ=l),o=l}o.nextZ=null,Kr.fill(null,0,a),Ms.fill(null,0,a)}function P9(e){if(e<=32)for(let t=1;t<e;t++){let r=Kr[t],i=r.z,n=t-1;for(;n>=0&&Kr[n].z>i;)Kr[n+1]=Kr[n],n--;Kr[n+1]=r}else{oo.length<e&&(oo=new Uint32Array(e),_u=new Uint32Array(e),Ms=Array(e));for(let t=0;t<e;t++)oo[t]=Kr[t].z;Lp(e,Kr,oo,Ms,_u,0),Lp(e,Ms,_u,Kr,oo,8),Lp(e,Kr,oo,Ms,_u,16),Lp(e,Ms,_u,Kr,oo,24)}}function Lp(e,t,r,i,n,a){vu.fill(0);for(let s=0;s<e;s++)vu[r[s]>>>a&255]++;let o=0;for(let s=0;s<256;s++){let l=vu[s];vu[s]=o,o+=l}for(let s=0;s<e;s++){let l=r[s],u=vu[l>>>a&255]++;i[u]=t[s],n[u]=l}}function Wy(e,t,r,i,n){return e=(e-r)*n|0,t=(t-i)*n|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function D9(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Bd(e,t,r,i,n,a,o,s){return(n-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(i-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(n-o)*(i-s)}function A9(e,t){let r=ac(e,t)&&Lt(e.prev,e,e.next)>0&&Lt(t.prev,t,t.next)>0;return e.next.i!==t.i&&(r||oc(e,t)&&oc(t,e)&&(Lt(e.prev,e,t.prev)!==0||Lt(e,t.prev,t)!==0))&&!M9(e,t)&&(r||I9(e,t))}function Lt(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function ac(e,t){return e.x===t.x&&e.y===t.y}function AE(e,t,r,i,n=!0){let a=Lt(e,t,r),o=Lt(e,t,i),s=Lt(r,i,e),l=Lt(r,i,t);return(a>0&&o<0||a<0&&o>0)&&(s>0&&l<0||s<0&&l>0)?!0:n?!!(a===0&&Bp(e,r,t)||o===0&&Bp(e,i,t)||s===0&&Bp(r,e,i)||l===0&&Bp(r,t,i)):!1}function Bp(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function M9(e,t){let r=Math.min(e.x,t.x),i=Math.max(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.y,t.y),o=e;do{let s=o.next;if(o.x>i&&s.x>i||o.x<r&&s.x<r||o.y>a&&s.y>a||o.y<n&&s.y<n)o=s;else{if(o.i!==e.i&&s.i!==e.i&&o.i!==t.i&&s.i!==t.i&&AE(o,s,e,t))return!0;o=s}}while(o!==e);return!1}function oc(e,t){return Lt(e.prev,e,e.next)<0?Lt(e,t,e.next)>=0&&Lt(e,e.prev,t)>=0:Lt(e,t,e.prev)<0||Lt(e,e.next,t)<0}function I9(e,t){let r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{let o=r.next;r.y>a!=o.y>a&&n<(o.x-r.x)*(a-r.y)/(o.y-r.y)+r.x&&(i=!i),r=o}while(r!==e);return i}function ME(e,t){let r=Yy(e.i,e.x,e.y),i=Yy(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function Y5(e,t,r,i){let n=Yy(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function sc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),Gy&&T9(e.prev,e.next)}function Yy(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function k9(e,t,r,i){let n=0;for(let a=t,o=r-i;a<r;a+=i)n+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return n}var Nn=class{constructor(e,t){if(t>e)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){let t=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/t),this._minGranularity,1)}},_o,pv=(_o=class{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}},_o.noSubdivision=new _o({fill:new Nn(0,0),line:new Nn(0,0),tile:new Nn(0,0),stencil:new Nn(0,0),circle:1}),_o);G("SubdivisionGranularityExpression",Nn),G("SubdivisionGranularitySetting",pv);var Nu=-32768,Vu=32767,z9=class{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=R/e,this._canonical=t}_getKey(e,t){return e+=32768,t+=32768,e<<16|t}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(e)|0,i=Math.round(t)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let o=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,o),this._vertexBuffer.push(r,i),o}_subdivideTrianglesScanline(e,t){if(this._granularity<2)return L9(this._vertexBuffer,R9(e,t));let r=[],i=e.length;for(let n=0;n<i;n+=3){let a=[t[e[n+0]],t[e[n+1]],t[e[n+2]]],o=[this._vertexBuffer[a[0]*2+0],this._vertexBuffer[a[0]*2+1],this._vertexBuffer[a[1]*2+0],this._vertexBuffer[a[1]*2+1],this._vertexBuffer[a[2]*2+0],this._vertexBuffer[a[2]*2+1]],s=1/0,l=1/0,u=-1/0,c=-1/0;for(let m=0;m<3;m++){let _=o[m*2],g=o[m*2+1];s=Math.min(s,_),u=Math.max(u,_),l=Math.min(l,g),c=Math.max(c,g)}if(s===u||l===c)continue;let h=Math.floor(s/this._granularityCellSize),p=Math.ceil(u/this._granularityCellSize),d=Math.floor(l/this._granularityCellSize),f=Math.ceil(c/this._granularityCellSize);if(h===p&&d===f)r.push(...a);else for(let m=d;m<f;m++){let _=this._scanlineGenerateVertexRingForCellRow(m,o,a);B9(this._vertexBuffer,_,r)}}return r}_scanlineGenerateVertexRingForCellRow(e,t,r){let i=e*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let o=0;o<3;o++){let s=t[o*2],l=t[o*2+1],u=t[(o+1)*2%6],c=t[((o+1)*2+1)%6],h=t[(o+2)*2%6],p=t[((o+2)*2+1)%6],d=u-s,f=c-l,m=d===0,_=f===0,g=(i-l)/f,y=(n-l)/f,v=Math.min(g,y),x=Math.max(g,y);if(!_&&(v>=1||x<=0)||_&&(l<i||l>n)){c>=i&&c<=n&&a.push(r[(o+1)%3]);continue}if(!_&&v>0){let T=s+d*v,S=l+f*v;a.push(this._vertexToIndex(T,S))}let b=s+d*Math.max(v,0),w=s+d*Math.min(x,1);if(m||this._generateIntraEdgeVertices(a,s,l,u,c,b,w),!_&&x<1){let T=s+d*x,S=l+f*x;a.push(this._vertexToIndex(T,S))}(_||c>=i&&c<=n)&&a.push(r[(o+1)%3]),!_&&(c<=i||c>=n)&&this._generateInterEdgeVertices(a,s,l,u,c,h,p,w,i,n)}return a}_generateIntraEdgeVertices(e,t,r,i,n,a,o){let s=i-t,l=n-r,u=l===0,c=u?Math.min(t,i):Math.min(a,o),h=u?Math.max(t,i):Math.max(a,o),p=Math.floor(c/this._granularityCellSize)+1,d=Math.ceil(h/this._granularityCellSize)-1;if(u?t<i:a<o)for(let f=p;f<=d;f++){let m=f*this._granularityCellSize,_=r+l*(m-t)/s;e.push(this._vertexToIndex(m,_))}else for(let f=d;f>=p;f--){let m=f*this._granularityCellSize,_=r+l*(m-t)/s;e.push(this._vertexToIndex(m,_))}}_generateInterEdgeVertices(e,t,r,i,n,a,o,s,l,u){let c=n-r,h=a-i,p=o-n,d=(l-n)/p,f=(u-n)/p,m=Math.min(d,f),_=Math.max(d,f),g=i+h*m,y=Math.floor(Math.min(g,s)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,s)/this._granularityCellSize)-1,x=s<g,b=p===0;if(b&&(o===l||o===u))return;if(b||m>=1||_<=0){let T=t-a,S=r-o,E=(l-o)/S,P=(u-o)/S,D=a+T*Math.min(E,P);y=Math.floor(Math.min(D,s)/this._granularityCellSize)+1,v=Math.ceil(Math.max(D,s)/this._granularityCellSize)-1,x=s<D}let w=c>0?u:l;if(x)for(let T=y;T<=v;T++){let S=T*this._granularityCellSize;e.push(this._vertexToIndex(S,w))}else for(let T=v;T>=y;T--){let S=T*this._granularityCellSize;e.push(this._vertexToIndex(S,w))}}_generateOutline(e,t){let r=[],i=0;for(let n of e){let a=this._granularity<2?this._ringPathIndices(n,i,t):this._pointArrayToIndices(po(n,this._granularity,!0));i+=n.length;let o=[];for(let s=1;s<a.length;s++)o.push(a[s-1]),o.push(a[s]);r.push(o)}return r}_ringPathIndices(e,t,r){let i=r.slice(t,t+e.length);return i.length>=2&&kE(e)&&i.push(i[0]),i}_handlePoles(e){let t=!1,r=!1;this._canonical&&(this._canonical.y===0&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(t||r)&&this._fillPoles(e,t,r)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let r=e[t+1];r===-32768&&(e[t+1]=-32767),r===32767&&(e[t+1]=32766)}}_generatePoleQuad(e,t,r,i,n,a){i>n==(a===-32768)?(e.push(r),e.push(t),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(n,a)),e.push(r),e.push(this._vertexToIndex(i,a))):(e.push(t),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(r),e.push(this._vertexToIndex(n,a)),e.push(this._vertexToIndex(i,a)))}_fillPoles(e,t,r){let i=this._vertexBuffer,n=R,a=e.length;for(let o=2;o<a;o+=3){let s=e[o-2],l=e[o-1],u=e[o],c=i[s*2],h=i[s*2+1],p=i[l*2],d=i[l*2+1],f=i[u*2],m=i[u*2+1];t&&(h===0&&d===0&&this._generatePoleQuad(e,s,l,c,p,Nu),d===0&&m===0&&this._generatePoleQuad(e,l,u,p,f,Nu),m===0&&h===0&&this._generatePoleQuad(e,u,s,f,c,Nu)),r&&(h===n&&d===n&&this._generatePoleQuad(e,s,l,c,p,Vu),d===n&&m===n&&this._generatePoleQuad(e,l,u,p,f,Vu),m===n&&h===n&&this._generatePoleQuad(e,u,s,f,c,Vu))}}_initializeVertices(e){let t=[];for(let r=0;r<e.length;r+=2)t.push(this._vertexToIndex(e[r],e[r+1]));return t}subdividePolygonInternal(e,t){if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:r,holeIndices:i}=F9(e),n=this._initializeVertices(r),a;try{let s=f9(r,i);a=this._subdivideTrianglesScanline(s,n)}catch(s){console.error(s)}let o=[];return t&&(o=this._generateOutline(e,n)),this._ensureNoPoleVertices(),this._handlePoles(a),this._granularity>=2&&this._canonical?.z===0&&(a=this._removeTrianglesOutsideTileX(a),o=o.map(s=>this._removeLinesOutsideTileX(s))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:o}}_vertexOutsideTileX(e){let t=this._vertexBuffer[e*2];return t<0||t>8192}_removeTrianglesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=3)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||this._vertexOutsideTileX(e[r+2])||t.push(e[r],e[r+1],e[r+2]);return t}_removeLinesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=2)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||t.push(e[r],e[r+1]);return t}_pointArrayToIndices(e){let t=[];for(let r of e)t.push(this._vertexToIndex(r.x,r.y));return t}};function IE(e,t,r,i=!0){return new z9(r,t).subdividePolygonInternal(e,i)}function po(e,t,r=!1){if(!e||e.length<1||e.length<2)return[];let i=r&&kE(e);if(t<2)return i?[...e,e[0]]:[...e];let n=Math.floor(R/t),a=[];a.push(new k(e[0].x,e[0].y));let o=e.length,s=i?o:o-1;for(let l=0;l<s;l++){let u=e[l],c=l<o-1?e[l+1]:e[0],h=u.x,p=u.y,d=c.x,f=c.y,m=h!==d,_=p!==f;if(!m&&!_)continue;let g=d-h,y=f-p,v=Math.abs(g),x=Math.abs(y),b=h,w=p;for(;;){let S=g>0?(Math.floor(b/n)+1)*n:(Math.ceil(b/n)-1)*n,E=y>0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,P=Math.abs(b-S),D=Math.abs(w-E),F=Math.abs(b-d),I=Math.abs(w-f),C=m?P/v:1/0,A=_?D/x:1/0;if((F<=P||!m)&&(I<=D||!_))break;if(C<A&&m||!_){b=S,w+=y*C;let M=new k(b,Math.round(w));(a[a.length-1].x!==M.x||a[a.length-1].y!==M.y)&&a.push(M)}else{b+=g*A,w=E;let M=new k(Math.round(b),w);(a[a.length-1].x!==M.x||a[a.length-1].y!==M.y)&&a.push(M)}}let T=new k(d,f);(a[a.length-1].x!==T.x||a[a.length-1].y!==T.y)&&a.push(T)}return a}function kE(e){return!e[0].equals(e[e.length-1])}function F9(e){let t=[],r=[];for(let i of e)if(i.length!==0){i!==e[0]&&t.push(r.length/2);for(let n of i)r.push(n.x),r.push(n.y)}return{flattened:r,holeIndices:t}}function R9(e,t){let r=Array(e.length);for(let i=0;i<e.length;i++)r[i]=t[e[i]];return r}function L9(e,t){let r=[];for(let i=0;i<t.length;i+=3){let n=t[i],a=t[i+1],o=t[i+2],s=e[n*2],l=e[n*2+1],u=e[a*2],c=e[a*2+1],h=e[o*2],p=e[o*2+1],d=u-s,f=c-l,m=h-s;d*(p-l)-f*m>0?(r.push(n),r.push(o),r.push(a)):(r.push(n),r.push(a),r.push(o))}return r}function B9(e,t,r){if(t.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,n=e[t[0]*2];for(let l=1;l<t.length;l++){let u=e[t[l]*2];u<n&&(n=u,i=l)}let a=t.length,o=i,s=(o+1)%a;for(;;){let l=o-1>=0?o-1:a-1,u=(s+1)%a,c=e[t[l]*2],h=e[t[l]*2+1],p=e[t[u]*2],d=e[t[u]*2+1],f=e[t[o]*2],m=e[t[o]*2+1],_=e[t[s]*2],g=e[t[s]*2+1],y=!1;if(c<p)y=!0;else if(c>p)y=!1;else{let v=g-m,x=-(_-f),b=m<g?1:-1;((c-f)*v+(h-m)*x)*b>((p-f)*v+(d-m)*x)*b&&(y=!0)}if(y){let v=t[l],x=t[o],b=t[s];v!==x&&v!==b&&x!==b&&r.push(b,x,v),o--,o<0&&(o=a-1)}else{let v=t[u],x=t[o],b=t[s];v!==x&&v!==b&&x!==b&&r.push(b,x,v),s++,s>=a&&(s=0)}if(l===u)break}}function zE(e,t,r,i,n,a,o,s,l){let u=n.length/2,c=o&&s&&l;if(u<ct.MAX_VERTEX_ARRAY_LENGTH){let h=t.prepareSegment(u,r,i),p=h.vertexLength;for(let m=0;m<a.length;m+=3)i.emplaceBack(p+a[m],p+a[m+1],p+a[m+2]);h.vertexLength+=u,h.primitiveLength+=a.length/3;let d,f;c&&(f=o.prepareSegment(u,r,s),d=f.vertexLength,f.vertexLength+=u);for(let m=0;m<n.length;m+=2)e(n[m],n[m+1]);if(c)for(let m of l){for(let _=1;_<m.length;_+=2)s.emplaceBack(d+m[_-1],d+m[_]);f.primitiveLength+=m.length/2}}else O9(t,r,i,n,a,e),c&&j9(o,r,s,n,l,e),t.forceNewSegmentOnNextPrepare(),o?.forceNewSegmentOnNextPrepare()}function Uu(e,t,r,i,n,a,o){if(a){let s=i.count;return r(t[n*2],t[n*2+1]),e[n]=i.count,i.count++,o.vertexLength++,s}return e[n]}function O9(e,t,r,i,n,a){let o=[];for(let h=0;h<i.length/2;h++)o.push(-1);let s={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),c=u.vertexLength;for(let h=2;h<n.length;h+=3){let p=n[h-2],d=n[h-1],f=n[h],m=o[p]<l,_=o[d]<l,g=o[f]<l,y=+!!m+ +!!_+ +!!g;u.vertexLength+y>ct.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=s.count,m=!0,_=!0,g=!0,c=0);let v=Uu(o,i,a,s,p,m,u),x=Uu(o,i,a,s,d,_,u),b=Uu(o,i,a,s,f,g,u);r.emplaceBack(c+v-l,c+x-l,c+b-l),u.primitiveLength++}}function j9(e,t,r,i,n,a){let o=[];for(let h=0;h<i.length/2;h++)o.push(-1);let s={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),c=u.vertexLength;for(let h of n)for(let p=1;p<h.length;p+=2){let d=h[p-1],f=h[p],m=o[d]<l,_=o[f]<l,g=+!!m+ +!!_;u.vertexLength+g>ct.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=s.count,m=!0,_=!0,c=0);let y=Uu(o,i,a,s,d,m,u),v=Uu(o,i,a,s,f,_,u);r.emplaceBack(c+y-l,c+v-l),u.primitiveLength++}}var FE=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new gz,this.indexArray=new yn,this.indexArray2=new Ry,this.programConfigurations=new To(e.layers,e.zoom),this.segments=new ct,this.segments2=new ct,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){this.hasDependencies=Rd("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],o=new Re(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of e){let p=ko(l,s);if(!this.layers[0]._featureFilter.filter(o,p,r))continue;let d=n?i.evaluate(p,{},r,t.availableImages):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:s?p.geometry:Io(l),patterns:{},sortKey:d};a.push(f)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;if(this.hasDependencies){let d=hv("fill",this.layers,l,{zoom:this.zoom},t);this.patternFeatures.push(d)}else this.addFeature(l,u,c,r,{},t.subdivisionGranularity);let p=e[c].feature;t.featureIndex.insert(p,u,c,h,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:e,canonical:t,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r,e.subdivisionGranularity)}detectSdfPatterns(e){for(let t of this.patternFeatures)for(let r in t.patterns){let i=t.patterns[r];this.recordSdfPattern(r,e[i.min]),this.recordSdfPattern(r,e[i.mid]),this.recordSdfPattern(r,e[i.max])}for(let t of this.layers){let r=t.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(t.id,e[r.from.toString()]),this.recordSdfPattern(t.id,e[r.to.toString()]))}}recordSdfPattern(e,t){if(!t)return;let r=t.sdf===!0,i=this.sdfPatterns[e];i===void 0?this.sdfPatterns[e]=r:i!==r&&we(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${e}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,d9),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n,a){for(let o of lf(t,500)){let s=IE(o,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;zE((u,c)=>{l.emplaceBack(u,c)},this.segments,this.layoutVertexArray,this.indexArray,s.verticesFlattened,s.indicesTriangles,this.segments2,this.indexArray2,s.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}};G("FillBucket",FE,{omit:["layers","patternFeatures"]});var X5,N9=()=>X5||(X5=new Kt({"fill-sort-key":new re(z.layout_fill["fill-sort-key"],"fill-sort-key")})),K5,V9=()=>K5||(K5=new Kt({"fill-antialias":new $(z.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new re(z.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new $(z.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new re(z.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new re(z.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new $(z.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new $(z.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new tc(z.paint_fill["fill-pattern"],"fill-pattern")})),U9={get paint(){return V9()},get layout(){return N9()}},$9=e=>e.type==="fill",q9=class extends Yi{constructor(e,t){super(e,U9,t)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new FE(e)}queryRadius(){return xf(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:r,pixelsToTileUnits:i}){return _E(bf(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),t)}isTileClipped(){return!0}},Xy=dt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),G9=dt([{name:"a_centroid",components:2,type:"Int16"}],4),Z9=Xy.members;Xy.size,Xy.alignment;var bc=class{constructor(e,t,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n;e.pos<t;){let a=e.readVarint();if(a===8)this.id=e.readVarint();else if(a===18){let o=e.readVarint()+e.pos;for(;e.pos<o;){let s=i[e.readVarint()],l=n[e.readVarint()];this.properties[s]=l}}else a===24?this.type=e.readVarint():(a===34&&(this._geometry=e.pos),e.skip(a))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=[],i,n=1,a=0,o=0,s=0;for(;e.pos<t;){if(a<=0){let l=e.readVarint();if(n=l&7,a=l>>3,a===0)continue}if(a--,n===1)o+=e.readSVarint(),s+=e.readSVarint(),i&&r.push(i),i=[new k(o,s)];else if(n===2)o+=e.readSVarint(),s+=e.readSVarint(),i&&i.push(new k(o,s));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;for(;e.pos<t;){if(i<=0){let c=e.readVarint();if(r=c&7,i=c>>3,i===0)continue}if(i--,r===1||r===2)n+=e.readSVarint(),a+=e.readSVarint(),n<o&&(o=n),n>s&&(s=n),a<l&&(l=a),a>u&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[o,l,s,u]}toGeoJSON(e,t,r){let i=this.extent*2**r,n=this.extent*e,a=this.extent*t,o=this.loadGeometry();function s(h){return[(h.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(h.y+a)*2/i)*Math.PI))-90]}function l(h){return h.map(s)}let u;if(this.type===1){let h=[];for(let d of o)h.push(d[0]);let p=l(h);u=h.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){let h=o.map(l);u=h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h}}else if(this.type===3){let h=RE(o),p=[];for(let d of h)p.push(d.map(l));u=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw Error("unknown feature type");let c={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(c.id=this.id),c}};bc.types=["Unknown","Point","LineString","Polygon"];function RE(e){let t=e.length;if(t<=1)return[e];let r=[],i,n;for(let a=0;a<t;a++){let o=H9(e[a]);o!==0&&(n===void 0&&(n=o<0),n===o<0?(i&&r.push(i),i=[e[a]]):i&&i.push(e[a]))}return i&&r.push(i),r}function H9(e){let t=0;for(let r=0,i=e.length,n=i-1,a,o;r<i;n=r++)a=e[r],o=e[n],t+=(o.x-a.x)*(a.y+o.y);return t}var W9=class{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],t===void 0&&(t=e.length);e.pos<t;){let r=e.readVarint();r===10?this.name=e.readString():r===18?(this._features.push(e.pos),e.skip(r)):r===26?this._keys.push(e.readString()):r===34?this._values.push(Y9(e)):r===40?this.extent=e.readVarint():r===120?this.version=e.readVarint():e.skip(r)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new bc(this._pbf,t,this.extent,this._keys,this._values)}};function Y9(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let i=e.readVarint();t=i===10?e.readString():i===21?e.readFloat():i===25?e.readDouble():i===32?e.readVarint(!0):i===40?e.readVarint():i===48?e.readSVarint():i===56?e.readBoolean():(e.skip(i),null)}if(t==null)throw Error("unknown feature value");return t}var X9=class{constructor(e,t=e.length){let r=Object.create(null);for(;e.pos<t;){let i=e.readVarint();if(i===26){let n=new W9(e,e.readVarint()+e.pos);n.length&&(r[n.name]=n)}else e.skip(i)}this.layers=r}},Er=63710088e-1,H=class ku{constructor(t,r){if(isNaN(t)||isNaN(r))throw Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ku(xi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let r=Math.PI/180,i=this.lat*r,n=t.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*r);return Er*Math.acos(Math.min(a,1))}static convert(t){if(t instanceof ku)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new ku(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t)return new ku(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}},f1=6378137,Ky={origin:[-Math.PI*f1,Math.PI*f1],extentAtZoom0:2*Math.PI*f1},dv=2*Math.PI*Er;function LE(e){return dv*Math.cos(e*Math.PI/180)}function Od(e){return(180+e)/360}function jd(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Qy(e,t){return e/LE(t)}function BE(e){return e*360-180}function lc(e){let t=180-e*360;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function K9(e,t){return e*LE(lc(t))}function OE(e){return 1/Math.cos(e*Math.PI/180)}var sr=class jE{constructor(t,r,i=0){this.x=+t,this.y=+r,this.z=+i}static fromLngLat(t,r=0){let i=H.convert(t);return new jE(Od(i.lng),jd(i.lat),Qy(r,i.lat))}toLngLat(){return new H(BE(this.x),lc(this.y))}toAltitude(){return K9(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/dv*OE(lc(this.y))}},nl=new class{constructor(){this.name="mercator",this.wraps=!0,this.tileMatrixSet=Ky}worldFromLngLat(e,t,r){return new sr(Od(e),jd(t),r===void 0?0:Qy(r,t))}lngLatFromWorld(e,t){return new H(BE(e),lc(t))}hasLngLat(e,t){return!0}metersPerWorldUnit(e,t){return 1/(1/dv*OE(lc(t)))}worldZFromAltitude(e,t){return Qy(e,t.lat)}},Os=89.25;function NE(e,t,r){let i=1/(1<<r.z);return new sr(e/R*i+r.x*i,t/R*i+r.y*i)}function Q9(e,t,r){return NE(e,t,r).toLngLat()}function wi(e,t,r){let i=r.wraps?Q(t.lat,-85.051129,Zi):t.lat,{x:n,y:a}=r.worldFromLngLat(t.lng,i);return new k(n*e,a*e)}function Ea(e,t,r){return r.lngLatFromWorld(t.x/e,t.y/e)}function $u(e){return e.cameraToCenterDistance*Math.min(Math.tan(Je(90-e.pitch))*.85,Math.tan(Je(Os-e.pitch)))}function m1(e,t){let r=e.canonical,i=t/Bt(r.z),n=r.x+2**r.z*e.wrap,a=new Float64Array(16);return Gi(a),At(a,a,[n*i,r.y*i,0]),gr(a,a,[i/R,i/R,1]),a}function VE(e,t,r,i){let{x:n,y:a,z:o}=Jy(t,r),s=i*-n,l=i*-a,u=i*o;return new sr(e.x+s,e.y+l,e.z+u)}function J9(e,t=e.center){let r=e.worldCoordinateHelper,i=r.worldZFromAltitude(1,t),n=i*e.worldSize,a=e.cameraToCenterDistance/n;return VE(r.worldFromLngLat(t.lng,t.lat,e.elevation),e.pitch,e.bearing,a*i)}function Jy(e,t){let r=Je(e),i=Je(t),n=Math.cos(-r),a=Math.sin(r);return{x:a*Math.sin(i),y:-a*Math.cos(i),z:n}}function UE(e,t,r,i,n){let a=(h,p)=>{let{x:d,y:f}=e.worldFromLngLat(h,p);return new k(d,f)},o=h=>h===16?i:t+(i-t)*h/16,s=h=>h===16?r:n+(r-n)*h/16,l=[];for(let h=0;h<=16;h++)for(let p=0;p<=16;p++)l.push(a(o(p),s(h)));let u=(h,p)=>l[h*17+p],c=0;for(let h=0;h<16;h++){let p=(o(h)+o(h+1))/2,d=(s(h)+s(h+1))/2,f=[[u(0,h),u(0,h+1),a(p,n)],[u(16,h),u(16,h+1),a(p,r)],[u(h,0),u(h+1,0),a(t,d)],[u(h,16),u(h+1,16),a(i,d)]];for(let[m,_,g]of f){let y=_.sub(m),v=g.sub(m),x=y.mag(),b=x>0?Math.abs(y.x*v.y-y.y*v.x)/x:v.mag();b>c&&(c=b)}}return{points:l,bulge:c}}function $E(e,t,r,i,n){let{points:a,bulge:o}=UE(e,t,r,i,n),s=1/0,l=1/0,u=-1/0,c=-1/0;for(let{x:h,y:p}of a)h<s&&(s=h),p<l&&(l=p),h>u&&(u=h),p>c&&(c=p);return{minX:s-o,minY:l-o,maxX:u+o,maxY:c+o}}function eF(e,t,r,i,n){let a=[e.lngLatFromWorld(t,r),e.lngLatFromWorld(i,r),e.lngLatFromWorld(i,n),e.lngLatFromWorld(t,n)];return{west:Math.min(a[0].lng,a[1].lng,a[2].lng,a[3].lng),south:Math.min(a[0].lat,a[1].lat,a[2].lat,a[3].lat),east:Math.max(a[0].lng,a[1].lng,a[2].lng,a[3].lng),north:Math.max(a[0].lat,a[1].lat,a[2].lat,a[3].lat)}}var g1=1e-4;function tF(e,t){if(e.wraps)return 360;let r=t.lat>0?-1e-4:g1,i=e.worldFromLngLat(t.lng,t.lat),n=e.worldFromLngLat(t.lng+g1,t.lat),a=e.worldFromLngLat(t.lng,t.lat+r),o=Math.max(Math.hypot(n.x-i.x,n.y-i.y),Math.hypot(a.x-i.x,a.y-i.y));return g1/o}function rF(e,t){return t<=0||!e||e.length===0?e:e.map(r=>oF(r,t))}function iF(e,t){let r=Q9(R/2,R/2,t),i=sr.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<<t.z)*R;return e*i*n}var nF=Math.cos(35*Math.PI/180);function aF(e){let t=[null];for(let a=1;a<e.length;a++){let o=e[a].sub(e[a-1]),s=!zd(e[a],e[a-1])&&o.mag()>0;t.push(s?o._perp():null)}let r=e.length-1,i=r>1&&e[0].equals(e[r]),n=[null];for(let a=1;a<=r;a++){let o=t[a];if(!o){n.push(null);continue}let s=i&&a===1?t[r]:t[a-1],l=i&&a===r?t[1]:t[a+1];n.push({start:Q5(o,s),end:Q5(o,l)})}return n}function Q5(e,t){if(!t)return e.unit();let r=e.mag(),i=t.mag();return e.x*t.x+e.y*t.y<nF*r*i||r>=2*i?e.unit():i>=2*r?t.unit():e.add(t)._unit()}function oF(e,t){if(!e||e.length<3)return e;let r=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,i=r?e.length-1:e.length;if(i<3)return e;let n=[],a=zd(e[i-1],e[0]);for(let s=0;s<i;s++){let l=e[(s-1+i)%i],u=e[s],c=e[(s+1)%i],h=zd(u,c);a||h?n.push(u.clone()):lF(n,l,u,c,t),a=h}let o=sF(n);return o.length<3?e:(r&&o.push(o[0].clone()),o)}function sF(e){let t=[];for(let r of e){let i=r.round(),n=t[t.length-1];(n?.x!==i.x||n?.y!==i.y)&&t.push(i)}for(;t.length>1&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y;)t.pop();return t}function lF(e,t,r,i,n){let a=t.sub(r),o=i.sub(r),s=a.mag(),l=o.mag();if(s<1e-6||l<1e-6){e.push(r.clone());return}a._div(s),o._div(l);let u=a.x*o.x+a.y*o.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){e.push(r.clone());return}let c=.2,h=Math.min(n,s*c,l*c),p=r.add(a.mult(h)),d=r.add(o.mult(h)),f=Math.sqrt((1+u)/2),m=r.add(a.add(o)._unit()._mult(h/f)),_=p.sub(m).angleWith(d.sub(m)),g=Math.max(2,Math.ceil(Math.abs(_)/(Math.PI/6)-1e-6));for(let y=0;y<=g;y++)e.push(p.rotateAround(y/g*_,m))}var y1=8192;function xu(e,t,r,i,n,a,o,s){e.emplaceBack(t,r,Math.floor(i*y1)*2+o,n*y1*2,a*y1*2,Math.round(s))}var qE=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new yz,this.centroidVertexArray=new ho,this.indexArray=new yn,this.programConfigurations=new To(e.layers,e.zoom),this.segments=new ct,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){this.features=[],this.hasDependencies=Rd("fill-extrusion",this.layers,t);let i=new Re(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),o=a>0?iF(a,r):0,s=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of e){let p=ko(l,s);if(!n._featureFilter.filter(i,p,r))continue;let d={id:u,sourceLayerIndex:h,index:c,geometry:rF(s?p.geometry:Io(l),o),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(hv("fill-extrusion",this.layers,d,{zoom:this.zoom},t)):this.addFeature(d,d.geometry,c,r,{},t.subdivisionGranularity),t.featureIndex.insert(l,d.geometry,c,h,this.index,!0)}}addFeatures({options:e,canonical:t,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,t,r,e.subdivisionGranularity)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Z9),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,G9.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n,a){for(let o of lf(t,500)){let s={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(s,i,e,o,a);let u=this.layoutVertexArray.length-l,c=Math.floor(s.x/s.sampleCount),h=Math.floor(s.y/s.sampleCount);for(let p=0;p<u;p++)this.centroidVertexArray.emplaceBack(c,h)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}processPolygon(e,t,r,i,n){if(i.length<1||j5(i[0]))return;for(let c of i)c.length!==0&&uF(e,c);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},o=n.fill.getGranularityForZoomLevel(t.z),s=bc.types[r.type]==="Polygon";for(let c of i){if(c.length===0||j5(c))continue;let h=po(c,o,s);this._generateSideFaces(h,a)}if(!s)return;let l=IE(i,t,o,!1),u=this.layoutVertexArray;zE((c,h)=>{xu(u,c,h,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(e,t){let r=0,i=this.layers[0].layout.get("fill-extrusion-rounded-corner-distance")>0?aF(e):null;for(let n=1;n<e.length;n++){let a=e[n],o=e[n-1];if(zd(a,o)||i&&!i[n])continue;t.segment.vertexLength+4>ct.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=a.sub(o)._perp()._unit(),{start:l,end:u}=i?i[n]:{start:s,end:s},c=o.dist(a);r+c>32768&&(r=0),xu(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,0,r),xu(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,1,r),r+=c,xu(this.layoutVertexArray,o.x,o.y,l.x,l.y,0,0,r),xu(this.layoutVertexArray,o.x,o.y,l.x,l.y,0,1,r);let h=t.segment.vertexLength;this.indexArray.emplaceBack(h,h+2,h+1),this.indexArray.emplaceBack(h+1,h+2,h+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}};function uF(e,t){for(let r=0;r<t.length;r++){let i=t[r];(r!==t.length-1||t[0].x!==i.x||t[0].y!==i.y)&&(e.x+=i.x,e.y+=i.y,e.sampleCount++)}}G("FillExtrusionBucket",qE,{omit:["layers","features"]});var J5,cF=()=>J5||(J5=new Kt({"fill-extrusion-rounded-corner-distance":new $(z["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),e4,hF=()=>e4||(e4=new Kt({"fill-extrusion-opacity":new $(z["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new re(z["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new $(z["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new $(z["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new tc(z["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new re(z["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new re(z["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new $(z["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),pF={get paint(){return hF()},get layout(){return cF()}},dF=e=>e.type==="fill-extrusion",fF=class extends Yi{constructor(e,t){super(e,pF,t)}createBucket(e){return new qE(e)}queryRadius(){return xf(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:o}){let s=bf(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),c=yF(s,o,0),h=gF(i,u,l,o),p=h[0],d=h[1];return mF(p,d,c)}};function bu(e,t){return e.x*t.x+e.y*t.y}function t4(e,t){if(e.length===1){let r=0,i=t[r++],n;for(;!n||i.equals(n);)if(n=t[r++],!n)return 1/0;for(;r<t.length;r++){let a=t[r],o=e[0],s=n.sub(i),l=a.sub(i),u=o.sub(i),c=bu(s,s),h=bu(s,l),p=bu(l,l),d=bu(u,s),f=bu(u,l),m=c*p-h*h,_=(p*d-h*f)/m,g=(c*f-h*d)/m,y=1-_-g,v=i.z*y+n.z*_+a.z*g;if(isFinite(v))return v}return 1/0}{let r=1/0;for(let i of t)r=Math.min(r,i.z);return r}}function mF(e,t,r){let i=1/0;_E(r,t)&&(i=t4(r,t[0]));for(let n=0;n<t.length;n++){let a=t[n],o=e[n];for(let s=0;s<a.length-1;s++){let l=a[s],u=a[s+1],c=o[s],h=[l,u,o[s+1],c,l];yE(r,h)&&(i=Math.min(i,t4(r,h)))}}return i!==1/0&&i}function gF(e,t,r,i){let n=[],a=[],o=i[8]*t,s=i[9]*t,l=i[10]*t,u=i[11]*t,c=i[8]*r,h=i[9]*r,p=i[10]*r,d=i[11]*r;for(let f of e){let m=[],_=[];for(let g of f){let y=g.x,v=g.y,x=i[0]*y+i[4]*v+i[12],b=i[1]*y+i[5]*v+i[13],w=i[2]*y+i[6]*v+i[14],T=i[3]*y+i[7]*v+i[15],S=x+o,E=b+s,P=w+l,D=T+u,F=x+c,I=b+h,C=w+p,A=T+d,M=new k(S/D,E/D);M.z=P/D,m.push(M);let L=new k(F/A,I/A);L.z=C/A,_.push(L)}n.push(m),a.push(_)}return[n,a]}function yF(e,t,r){let i=[];for(let n of e){let a=[n.x,n.y,r,1];nr(a,a,t),i.push(new k(a[0]/a[3],a[1]/a[3]))}return i}var _F=class{projectX(e){return e/360+.5}projectY(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}unprojectX(e){return(e-.5)*360}unprojectY(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}},vF=class{projectX(e){return e}projectY(e){return e}unprojectX(e){return e}unprojectY(e){return e}};new _F,new vF;var e_=dt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_offset_normal",components:2,type:"Int8"}],2),xF=e_.members;e_.size,e_.alignment;var t_=dt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),bF=t_.members;t_.size,t_.alignment;var wF=Math.cos(75/2*(Math.PI/180)),GE=1/2,r4=2**14/GE,ZE=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let t of this.layers)this.gradients[t.id]={};this.layoutVertexArray=new _z,this.layoutVertexArray2=new vz,this.indexArray=new yn,this.programConfigurations=new To(e.layers,e.zoom),this.segments=new ct,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){this.hasDependencies=Rd("line",this.layers,t)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],o=new Re(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of e){let p=ko(l,s);if(!this.layers[0]._featureFilter.filter(o,p,r))continue;let d=n?i.evaluate(p,{},r):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:s?p.geometry:Io(l),patterns:{},dashes:{},sortKey:d};a.push(f)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;this.hasDependencies?(Rd("line",this.layers,t)?hv("line",this.layers,l,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,t),this.patternFeatures.push(l)):this.addFeature(l,u,c,r,{},{},t.subdivisionGranularity);let p=e[c].feature;t.featureIndex.insert(p,u,c,h,this.index)}}update(e,t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:e,canonical:t,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r,i,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,bF)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,xF),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties.geojsonvt_clip_start,end:+e.properties.geojsonvt_clip_end}}addFeature(e,t,r,i,n,a,o){let s=this.layers[0].layout,l=s.get("line-join").evaluate(e,{}),u=s.get("line-cap").evaluate(e,{}),c=s.get("line-miter-limit").evaluate(e,{}),h=s.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let p of t)this.addLine(p,e,l,u,c,h,i,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(e,t,r,i,n,a,o,s){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=o?s.line.getGranularityForZoomLevel(o.z):1;if(e=po(e,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v<e.length-1;v++)this.totalDistance+=e[v].dist(e[v+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=bc.types[t.type]==="Polygon",c=e.length;for(;c>=2&&e[c-1].equals(e[c-2]);)c--;let h=0;for(;h<c-1&&e[h].equals(e[h+1]);)h++;if(c-h<(u?3:2))return;r==="bevel"&&(n=1.05);let p=this.overscaling<=16?15*R/(512*this.overscaling):0,d=this.segments.prepareSegment(c*10,this.layoutVertexArray,this.indexArray),f,m,_,g,y;this.e1=this.e2=-1,u&&(f=e[c-2],y=e[h].sub(f)._unit()._perp());for(let v=h;v<c;v++){if(_=v===c-1?u?e[h+1]:void 0:e[v+1],_&&e[v].equals(_))continue;y&&(g=y),f&&(m=f),f=e[v],y=_?_.sub(f)._unit()._perp():g,g||(g=y);let x=g.add(y);(x.x!==0||x.y!==0)&&x._unit();let b=g.x*y.x+g.y*y.y,w=x.x*y.x+x.y*y.y,T=w===0?1/0:1/w,S=2*Math.sqrt(2-2*w),E=w<wF&&m&&_,P=g.x*y.y-g.y*y.x>0,D=x.mult(Math.min(T,2)),F=Q((T-3)/5,0,1);if(E&&v>h){let A=f.dist(m);if(A>2*p){let M=f.sub(f.sub(m)._mult(p/A)._round());this.updateDistance(m,M),this.addCurrentVertex(M,g,0,0,d),m=M}}let I=m&&_,C=I?r:u?"butt":i;if(I&&C==="round"&&(T<a?C="miter":T<=2&&(C="fakeround")),C==="miter"&&T>n&&(C="bevel"),C==="bevel"&&(T>2&&(C="flipbevel"),T<n&&(C="miter")),m&&this.updateDistance(m,f),C==="miter")x._mult(T),this.addCurrentVertex(f,x,0,0,d,!1,D);else if(C==="flipbevel"){if(T>100)x=y.mult(-1);else{let A=T*g.add(y).mag()/g.sub(y).mag();x._perp()._mult(A*(P?-1:1))}this.addCurrentVertex(f,x,0,0,d,!1,D,F),this.addCurrentVertex(f,x.mult(-1),0,0,d,!1,D,F)}else if(C==="bevel"||C==="fakeround"){let A=-Math.sqrt(T*T-1),M=P?A:0,L=P?0:A;if(m&&this.addCurrentVertex(f,g,M,L,d,!1,D),C==="fakeround"){let j=Math.round(S*180/Math.PI/20);for(let O=1;O<j;O++){let Y=O/j;if(Y!==.5){let pe=Y-.5,de=1.0904+b*(-3.2452+b*(3.55645-b*1.43519)),je=.848013+b*(-1.06021+b*.215638);Y+=Y*pe*(Y-1)*(de*pe*pe+je)}let ue=y.sub(g)._mult(Y)._add(g)._unit()._mult(P?-1:1);this.addHalfVertex(f,ue.x,ue.y,P?-D.x:D.x,P?-D.y:D.y,!1,P,d)}}_&&this.addCurrentVertex(f,y,-M,-L,d,!1,D)}else if(C==="butt")this.addCurrentVertex(f,x,0,0,d,!1,D);else if(C==="square"){let A=m?1:-1;this.addCurrentVertex(f,x,A,A,d,!1,D)}else C==="round"&&(m&&(this.addCurrentVertex(f,g,0,0,d,!1,D,F),this.addCurrentVertex(f,g,1,1,d,!0,D,F)),_&&(this.addCurrentVertex(f,y,-1,-1,d,!0,D,F),this.addCurrentVertex(f,y,0,0,d,!1,D,F)));if(E&&v<c-1){let A=f.dist(_);if(A>2*p){let M=f.add(_.sub(f)._mult(p/A)._round());this.updateDistance(f,M),this.addCurrentVertex(M,y,0,0,d),f=M}}}}addCurrentVertex(e,t,r,i,n,a=!1,o=t,s=0){let l=t.x+t.y*r,u=t.y-t.x*r,c=-t.x+t.y*i,h=-t.y-t.x*i,p=o.x+(t.x-o.x)*s,d=o.y+(t.y-o.y)*s;this.addHalfVertex(e,l,u,p,d,a,!1,n),this.addHalfVertex(e,c,h,-p,-d,a,!0,n),this.distance>r4/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,i,n,a,o,s))}addHalfVertex({x:e,y:t},r,i,n,a,o,s,l){let u=(this.lineClips?this.scaledDistance*(r4-1):this.scaledDistance)*GE;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!o,(t<<1)+ +!!s,Math.round(63*r)+128,Math.round(63*i)+128,(u&63)<<2,u>>6,Math.round(63*n),Math.round(63*a)),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let c=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,c,this.e2),l.primitiveLength++),s?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let r=t.paint.get("line-dasharray");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(e,t,r,i){for(let n of e){let a=n.paint.get("line-dasharray");if(!a||a.value.kind==="constant")continue;let o=n.layout.get("line-cap").evaluate(t,{})==="round",s={dasharray:a.value.evaluate({zoom:r-1},t,{}),round:o},l={dasharray:a.value.evaluate({zoom:r},t,{}),round:o},u={dasharray:a.value.evaluate({zoom:r+1},t,{}),round:o},c=`${s.dasharray.join(",")},${s.round}`,h=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[c]=s,i.dashDependencies[h]=l,i.dashDependencies[p]=u,t.dashes[n.id]={min:c,mid:h,max:p}}}};G("LineBucket",ZE,{omit:["layers","patternFeatures"]});var i4,TF=()=>i4||(i4=new Kt({"line-cap":new re(z.layout_line["line-cap"],"line-cap"),"line-join":new re(z.layout_line["line-join"],"line-join"),"line-miter-limit":new re(z.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new re(z.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new re(z.layout_line["line-sort-key"],"line-sort-key")})),n4,SF=()=>n4||(n4=new Kt({"line-opacity":new re(z.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new $(z.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new re(z.paint_line["line-color"],"line-color"),"line-translate":new $(z.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new $(z.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new re(z.paint_line["line-width"],"line-width"),"line-gap-width":new re(z.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new re(z.paint_line["line-offset"],"line-offset"),"line-blur":new re(z.paint_line["line-blur"],"line-blur"),"line-dasharray":new tc(z.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new tc(z.paint_line["line-pattern"],"line-pattern"),"line-gradient":new _f(z.paint_line["line-gradient"],"line-gradient")})),a4={get paint(){return SF()},get layout(){return TF()}},EF=class extends re{possiblyEvaluate(e,t){return t=new Re(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=J({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}},Op,CF=e=>e.type==="line",PF=class extends Yi{constructor(e,t){super(e,a4,t),this.gradientVersion=0,Op||(Op=new EF(a4.paint.properties["line-width"].specification,"line-floorwidth"),Op.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let t=this.gradientExpression();this.stepInterpolant=A7(t)?t._styleExpression.expression instanceof N_:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Op.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new ZE(e)}queryRadius(e){let t=e,r=o4(Bs("line-width",this,t),Bs("line-gap-width",this,t)),i=Bs("line-offset",this,t);return r/2+Math.abs(i)+xf(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let o=bf(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),s=a/2*o4(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),l=this.paint.get("line-offset").evaluate(t,r);return l&&(i=$z(i,l*a)),Bz(o,i,s)}isTileClipped(){return!0}};function o4(e,t){return t>0?t+2*e:e}var DF=dt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),AF=dt([{name:"a_projected_pos",components:3,type:"Float32"}],4);dt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var MF=dt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);dt([{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"}]);var s4=dt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),IF=dt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);dt([{name:"triangle",components:3,type:"Uint16"}]),dt([{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"},{type:"Float32",name:"heightOffset"}]);var kF=dt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]);dt([{type:"Float32",name:"offsetX"}]),dt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),dt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var Nd=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Nd.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,t){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let r=e.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(await t(r),await Promise.race([i,n]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};function zF(e){return/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function FF(e){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function RF(e){return/[\u0900-\u109F\u1700-\u17FF\u1900-\u194F\u19E0-\u1AAF\u1B00-\u1C4F\u1CC0-\u1CCF\uA800-\uA82F\uA880-\uA8FF\uA930-\uA95F\uA980-\uAAFF\uABC0-\uABFF]|\uD802[\uDE00-\uDE5F]|\uD804[\uDC00-\uDCCF\uDD00-\uDD4F\uDD80-\uDE4F\uDEB0-\uDFFF]|\uD805[\uDC00-\uDCDF\uDD80-\uDE5F\uDE80-\uDF4F]|\uD806[\uDC00-\uDC4F\uDD00-\uDD5F\uDDA0-\uDEAF\uDF00-\uDF7F]|\uD807[\uDC00-\uDCBF\uDD00-\uDDAF\uDEE0-\uDF5F\uDFC0-\uDFFF]|\uD818[\uDD00-\uDD3F]/gim.test(String.fromCodePoint(e))}function LF(e){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function BF(e){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function wc(e){return/[\u02EA\u02EB\u1100-\u11FF\u1401-\u167F\u18B0-\u18FF\u2065\u20DD-\u20E0\u20E2-\u20E4\u2B97\u2BF0-\u2BFF\u2E50\u2E51\u2E80-\u3007\u3012\u3013\u3020-\u302F\u3031-\u30FB\u30FD-\uA4CF\uA960-\uA97F\uAC00-\uD7FF\uF900-\uFAFF\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7\uFFF0-\uFFF8]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|[\uD80C-\uD810\uD81C-\uD822\uD83C\uD83D\uD840-\uD87E\uD880-\uD8BE][\uDC00-\uDFFF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFFF]|\uD823[\uDC00-\uDDFF]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFF]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83E[\uDD00-\uDEFF]|[\uD87F\uD8BF][\uDC00-\uDFFD]/gim.test(String.fromCodePoint(e))}function OF(e){return/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))}function jF(e){return/[\r\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0600-\u0605\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DD\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0890\u0891\u0897-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E33-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB3-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1037\u1039-\u103E\u1056-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1084-\u1086\u108D\u109D\u1100-\u11FF\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60\u1A62\u1A65-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA960-\uA97C\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCBD\uDCC2\uDCCD\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC2\uDDC3\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF1F\uDF22-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE84-\uDE99\uDF60-\uDF67]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00-\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD2F]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDD63\uDD67-\uDD6A\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF\uDDEE\uDDEF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDDE6-\uDDFF\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF]/.test(e)}function l4(e){return/[\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA\u1000-\u103F\u1050-\u108F\u109A-\u109F\u1780-\u17D3\u17D7\u17DC\u17DD\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19DE\u19DF\u1A20-\u1A5E\u1A60-\u1A7C\u1AA0-\u1AAD\u1B00-\u1B4C\u1B4E-\u1B7F\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE-\uA9EF\uA9FA-\uA9FE\uAA60-\uAAC2\uAADB-\uAADF]|\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF3A\uDF3B\uDF3F-\uDF46]/gim.test(String.fromCodePoint(e))}function NF(e,t){return/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(e)||/^\p{gc=Mc}/u.test(t)}var VF={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},UF={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},$F={\u0644\u0622:[65269,65270],\u0644\u0623:[65271,65272],\u0644\u0625:[65273,65274],\u0644\u0627:[65275,65276]},u4=1604,qF=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/;function GF(e,t,r){let i=0;for(let n of e.split(";")){let[a,o]=n.split(",").map(l=>parseInt(l,36)),s=i+a;for(let l=s;l<s+o;l++)r.set(l,t);i=s+o}}var HE=new Map;for(let[e,t]of Object.entries(VF))GF(t,e,HE);function ZF(e){return HE.get(e)??"U"}function HF(e){return e==="D"||e==="L"||e==="C"}function WF(e){return e==="D"||e==="R"||e==="C"}function YF(e,t,r){return e==="D"?t&&r?3:t?1:r?2:0:e==="R"?+!!t:e==="L"?r?2:0:null}function XF(e){return[...e].map(t=>{let r=t.codePointAt(0);return{codePoint:r,type:ZF(r),form:null}})}function KF(e){let t=e.filter(r=>r.type!=="T");for(let r=0;r<t.length;r++){let i=t[r],n=r>0&&HF(t[r-1].type),a=r+1<t.length&&WF(t[r+1].type);i.form=YF(i.type,n,a)}}function QF(e){let t=!1;for(let r of e)r.type==="T"?r.form=t?3:0:t=r.form===2||r.form===3}function JF(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(i.codePoint!==u4){t.push(i);continue}let n=r+1;for(;n<e.length&&e[n].type==="T";)n++;let a=e[n],o=a&&$F[String.fromCodePoint(u4,a.codePoint)];if(!o){t.push(i);continue}let s=i.form===3||i.form===1;t.push({codePoint:o[+!!s],type:"R",form:0}),t.push(...e.slice(r+1,n)),r=n}return t}function eR(e){if(e.form===null)return e.codePoint;let t=UF[e.codePoint];return t&&(t[e.form]||t[0])||e.codePoint}function tR(e){if(!qF.test(e))return e;let t=XF(e);return KF(t),QF(t),JF(t).map(r=>String.fromCodePoint(eR(r))).join("")}function rR(e,t,r){let i=t.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?e=e.toLocaleUpperCase():i==="lowercase"&&(e=e.toLocaleLowerCase()),(Nd.applyArabicShaping??tR)(e)}function iR(e,t,r){for(let i of e.sections)i.text=rR(i.text,t,r);return e}function _1(e,t,r){let i=r?t.last.points:t.first.points,n=r?i[i.length-1]:i[0];return`${e}:${n.x}:${n.y}`}function nR(e){let t=e.first.points,r=t.length;for(let a=e.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a<t.length;a++)i[a]=t[a];let n=t.length;for(let a=e.first.next;a;a=a.next){let o=a.points;for(let s=1;s<o.length;s++)i[n++]=o[s]}return i}function c4(e,t,r,i,n){let a=t[r];delete t[r],t[i]=a;let o=e[a];return o.last.next=n.first,o.last=n.last,a}function h4(e,t,r,i,n){let a=t[i];delete t[i],t[r]=a;let o=e[a];return n.last.next=o.first,o.first=n.first,a}function aR(e){let t={},r={},i=[];for(let a of e){let o=a.text?a.text.toString():null,s={points:a.geometry[0],next:null},l={feature:a,first:s,last:s};if(!o){i.push(l);continue}let u=_1(o,l),c=_1(o,l,!0);if(u in r&&c in t&&r[u]!==t[c]){let h=h4(i,t,u,c,l),p=c4(i,r,u,c,i[h]);delete t[u],delete r[c],r[_1(o,i[p],!0)]=p,i[h].feature.geometry=null}else if(u in r)c4(i,r,u,c,l);else if(c in t)h4(i,t,u,c,l);else{let h=i.push(l)-1;t[u]=h,r[c]=h}}let n=[];for(let a of i){let o=a.feature;o.geometry&&(a.first.next&&(o.geometry[0]=nR(a)),n.push(o))}return n}var WE=typeof Intl<"u"&&"Segmenter"in Intl,v1,x1;function r_(e){if(!WE||!jF(e))return[...e];v1??(v1=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let t=[];for(let{segment:r}of v1.segment(e)){let i=t.length-1;i>=0&&NF(t[i],r)?t[i]+=r:t.push(r)}return t}function oR(e){let t=new Set;if(WE){x1??(x1=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:i}of x1.segment(e))t.add(i);return t}let r=0;for(let i of e.split(/\b|(?=\p{Ideo})/u))t.add(r),r+=i.length;return t}function uc(e){let t=e.codePointAt(0);return e.length>(t>65535?2:1)}function cc(e){return/\s/u.test(String.fromCodePoint(e))}function wf(e){return/[\p{P}\p{S}]/u.test(String.fromCodePoint(e))}function i_(e){for(let t of e)if(wc(t.codePointAt(0)))return!0;return!1}function sR(e){for(let t of e)if(!lR(t.codePointAt(0)))return!1;return!0}function lR(e){return!zF(e)}function el(e){return!(wc(e)||OF(e))}function YE(e){return/\p{sc=Arab}/u.test(String.fromCodePoint(e))}function XE(e){return FF(e)}function KE(e){for(let t of e)if(XE(t.codePointAt(0)))return!0;return!1}var zs={"!":"\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","\u22EF":"\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"};function uR(e){let t="",r={premature:!0,value:void 0},i=e[Symbol.iterator](),n=i.next(),a=e[Symbol.iterator]();a.next();let o=a.next();for(;!n.done;)(o.done||!el(o.value.codePointAt(0))||zs[o.value])&&(r.premature||!el(r.value.codePointAt(0))||zs[r.value])&&zs[n.value]?t+=zs[n.value]:t+=n.value,r={value:n.value,premature:!1},n=i.next(),o=a.next();return t}var cR={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},hR={40:!0};function p4(e,t,r,i,n,a){if("fontStack"in t){let o=r[t.fontStack]?.default,s=o?.[e];if(s)return s.metrics.advance*t.scale+n;let l=0;for(let u of e){let c=o?.[u];c&&(l+=c.metrics.advance*t.scale+n)}return l}{let o=i[t.imageName];return o?o.displaySize[0]*t.scale*24/a+n:0}}function d4(e,t,r,i){let n=(e-t)**2;return i?e<t?n/2:n*2:n+Math.abs(r)*r}function f4(e){return/^\s+$/u.test(e)}function pR(e,t,r){let i=0;return(e===10||e===13)&&(i-=1e4),r&&(i+=150),(e===40||e===65288)&&(i+=50),(t===41||t===65289)&&(i+=50),i}function m4(e,t,r,i,n,a){let o=null,s=d4(t,r,n,a);for(let l of i){let u=d4(t-l.x,r,n,a)+l.badness;u<=s&&(o=l,s=u)}return{index:e,x:t,priorBreak:o,badness:s}}function QE(e){return e?QE(e.priorBreak).concat(e.index):[]}var fv=class n_{constructor(t="",r=[],i=[]){this.text=t,this.sections=r,this.sectionIndex=i,this.imageSectionID=null,this.cachedGraphemes=null}graphemes(){return this.cachedGraphemes??(this.cachedGraphemes=r_(this.text)),this.cachedGraphemes}static fromFeature(t,r,i,n){let a=new n_;for(let o of t.sections)o.image?a.addImageSection(o):a.addTextSection(o,r);return i&&a.verticalizePunctuation(n),a}length(){return this.graphemes().length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}verticalizePunctuation(t={},r){let i=uR(this.text),n=0;this.cachedGraphemes=this.graphemes().map((a,o)=>{let s=i.slice(n,n+a.length);n+=a.length;let l=this.getSection(o);return r?.[o]!==!1&&"fontStack"in l&&t[l.fontStack]?.vertical?.[a]?a:s}),this.text=this.cachedGraphemes.join("")}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let t=this.graphemes(),r=0;for(;r<t.length&&f4(t[r]);)r++;let i=t.length;for(;i>r&&f4(t[i-1]);)i--;this.text=t.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this.cachedGraphemes=null}substring(t,r){let i=this.graphemes().slice(t,r).join(""),n=this.sectionIndex.slice(t,r);return new n_(i,this.sections,n)}toCodeUnitIndex(t){return this.graphemes().slice(0,t).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}getMaxImageSize(t){let r=0,i=0;for(let n=0;n<this.length();n++){let a=this.getSection(n);if("imageName"in a){let o=t[a.imageName];if(!o)continue;let s=o.displaySize;r=Math.max(r,s[0]),i=Math.max(i,s[1])}}return{maxImageWidth:r,maxImageHeight:i}}_appendSection(t,r){let i=this.graphemes(),n=i.length>0?i[i.length-1]:"",a=r_(n+t);this.text+=t,this.cachedGraphemes=i.slice(0,n?-1:void 0).concat(a);let o=a.length-+!!n;for(let s=0;s<o;s++)this.sectionIndex.push(r)}addTextSection(t,r){this.sections.push({scale:t.scale||1,verticalAlign:t.verticalAlign||"bottom",fontStack:t.fontStack||r}),this._appendSection(t.text,this.sections.length-1)}addImageSection(t){let r=t.image?t.image.name:"";if(r.length===0){we("Can't add FormattedSection with an empty image.");return}let i=this.getNextImageSectionCharCode();i?(this.sections.push({scale:1,verticalAlign:t.verticalAlign||"bottom",imageName:r}),this._appendSection(String.fromCharCode(i),this.sections.length-1)):we("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(t,r,i,n,a){let o=this.determineTotalWidth(t,i,n,a);if(t>=0&&o>0&&o<=r&&!/[\n\r]/.test(this.text))return[this.length()];let s=[],l=o/Math.max(1,Math.ceil(o/r)),u=this.hasZeroWidthSpaces(),c=this.graphemes(),h=null,p=0,d=0;for(let f=0;f<c.length;f++){let m=c[f];if(f>0){let _=c[f-1].codePointAt(0),g=m.codePointAt(0),y=BF(_),v=l4(_)&&l4(g);(cR[_]||y||"imageName"in this.getSection(f-1)||c[f+1]!==void 0&&hR[g]||v&&(h??(h=oR(this.text))).has(d))&&s.push(m4(f,p,l,s,pR(_,g,y&&u),!1))}cc(m.codePointAt(0))||(p+=p4(m,this.getSection(f),i,n,t,a)),d+=m.length}return QE(m4(this.length(),p,l,s,0,!0))}determineTotalWidth(t,r,i,n){let a=0,o=0;for(let s of this.graphemes()){let l=this.getSection(o);a+=p4(s,l,r,i,t,n),o++}return a}};function dR(){return(function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(t).forEach(function(W,ye){r[W]=1<<ye+1,i[r[W]]=W}),Object.freeze(r);var n=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,o=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,s=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|n|r.PDI|s,u=null;function c(){if(!u){u=new Map;var W=0;for(var ye in t)if(t.hasOwnProperty(ye))for(var se=t[ye],N="",De=void 0,X=!1,ie=0,Z=0;Z<=se.length+1;Z+=1){var Ee=se[Z];if(Ee!==","&&Z!==se.length)Ee==="+"?(X=!0,ie=W=ie+parseInt(N,36),N=""):N+=Ee;else{X?De=W+parseInt(N,36):(ie=W=ie+parseInt(N,36),De=W),X=!1,N="",ie=De;for(var Ze=W;Ze<De+1;Ze+=1)u.set(Ze,r[ye])}}}}function h(W){return c(),u.get(W.codePointAt(0))||r.L}function p(W){return i[h(W)]}var d={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function f(W,ye){var se=0,N=new Map,De=ye&&new Map,X;return W.split(",").forEach(function ie(Z){if(Z.indexOf("+")!==-1)for(var Ee=+Z;Ee--;)ie(X);else{X=Z;var Ze=Z.split(">"),Ae=Ze[0],Ct=Ze[1];Ae=String.fromCodePoint(se+=parseInt(Ae,36)),Ct=String.fromCodePoint(se+=parseInt(Ct,36)),N.set(Ae,Ct),ye&&De.set(Ct,Ae)}}),{map:N,reverseMap:De}}var m,_,g;function y(){if(!m){var W=f(d.pairs,!0),ye=W.map,se=W.reverseMap;m=ye,_=se,g=f(d.canonical,!1).map}}function v(W){return y(),m.get(W)||null}function x(W){return y(),_.get(W)||null}function b(W){return y(),g.get(W)||null}var w=r.L,T=r.R,S=r.EN,E=r.ES,P=r.ET,D=r.AN,F=r.CS,I=r.B,C=r.S,A=r.ON,M=r.BN,L=r.NSM,j=r.AL,O=r.LRO,Y=r.RLO,ue=r.LRE,pe=r.RLE,de=r.PDF,je=r.LRI,Se=r.RLI,ae=r.FSI,oe=r.PDI;function $e(W,ye){for(var se=125,N=new Uint32Array(W.length),De=0;De<W.length;De++)N[De]=h(W[De]);var X=new Map;function ie(Ar,Ai){var Mr=N[Ar];N[Ar]=Ai,X.set(Mr,X.get(Mr)-1),Mr&o&&X.set(o,X.get(o)-1),X.set(Ai,(X.get(Ai)||0)+1),Ai&o&&X.set(o,(X.get(o)||0)+1)}for(var Z=new Uint8Array(W.length),Ee=new Map,Ze=[],Ae=null,Ct=0;Ct<W.length;Ct++)Ae||Ze.push(Ae={start:Ct,end:W.length-1,level:ye==="rtl"?1:ye==="ltr"?0:ax(Ct,!1)}),N[Ct]&I&&(Ae.end=Ct,Ae=null);for(var Va=pe|ue|Y|O|n|oe|de|I,wn=function(Ar){return Ar+(Ar&1?1:2)},Ki=function(Ar){return Ar+(Ar&1?2:1)},vr=0;vr<Ze.length;vr++){Ae=Ze[vr];var Ue=[{_level:Ae.level,_override:0,_isolate:0}],rt=void 0,ai=0,oi=0,Bo=0;X.clear();for(var Pt=Ae.start;Pt<=Ae.end;Pt++){var Qt=N[Pt];if(rt=Ue[Ue.length-1],X.set(Qt,(X.get(Qt)||0)+1),Qt&o&&X.set(o,(X.get(o)||0)+1),Qt&Va)if(Qt&(pe|ue)){Z[Pt]=rt._level;var z2=(Qt===pe?Ki:wn)(rt._level);z2<=se&&!ai&&!oi?Ue.push({_level:z2,_override:0,_isolate:0}):ai||oi++}else if(Qt&(Y|O)){Z[Pt]=rt._level;var F2=(Qt===Y?Ki:wn)(rt._level);F2<=se&&!ai&&!oi?Ue.push({_level:F2,_override:Qt&Y?T:w,_isolate:0}):ai||oi++}else if(Qt&n){Qt&ae&&(Qt=ax(Pt+1,!0)===1?Se:je),Z[Pt]=rt._level,rt._override&&ie(Pt,rt._override);var R2=(Qt===Se?Ki:wn)(rt._level);R2<=se&&ai===0&&oi===0?(Bo++,Ue.push({_level:R2,_override:0,_isolate:1,_isolInitIndex:Pt})):ai++}else if(Qt&oe){if(ai>0)ai--;else if(Bo>0){for(oi=0;!Ue[Ue.length-1]._isolate;)Ue.pop();var im=Ue[Ue.length-1]._isolInitIndex;im!=null&&(Ee.set(im,Pt),Ee.set(Pt,im)),Ue.pop(),Bo--}rt=Ue[Ue.length-1],Z[Pt]=rt._level,rt._override&&ie(Pt,rt._override)}else Qt&de?(ai===0&&(oi>0?oi--:!rt._isolate&&Ue.length>1&&(Ue.pop(),rt=Ue[Ue.length-1])),Z[Pt]=rt._level):Qt&I&&(Z[Pt]=Ae.level);else Z[Pt]=rt._level,rt._override&&Qt!==M&&ie(Pt,rt._override)}for(var Oo=[],Qi=null,Ua=Ae.start;Ua<=Ae.end;Ua++){var nm=N[Ua];if(!(nm&s)){var L2=Z[Ua],B2=nm&n,s8=nm===oe;Qi&&L2===Qi._level?(Qi._end=Ua,Qi._endsWithIsolInit=B2):Oo.push(Qi={_start:Ua,_end:Ua,_level:L2,_startsWithPDI:s8,_endsWithIsolInit:B2})}}for(var am=[],jc=0;jc<Oo.length;jc++){var Nc=Oo[jc];if(!Nc._startsWithPDI||Nc._startsWithPDI&&!Ee.has(Nc._start)){for(var om=[Qi=Nc],O2=void 0;Qi&&Qi._endsWithIsolInit&&(O2=Ee.get(Qi._end))!=null;)for(var Vc=jc+1;Vc<Oo.length;Vc++)if(Oo[Vc]._start===O2){om.push(Qi=Oo[Vc]);break}for(var jo=[],sm=0;sm<om.length;sm++)for(var j2=om[sm],lm=j2._start;lm<=j2._end;lm++)jo.push(lm);for(var l8=Z[jo[0]],N2=Ae.level,Uc=jo[0]-1;Uc>=0;Uc--)if(!(N[Uc]&s)){N2=Z[Uc];break}var um=jo[jo.length-1],u8=Z[um],V2=Ae.level;if(!(N[um]&n)){for(var $c=um+1;$c<=Ae.end;$c++)if(!(N[$c]&s)){V2=Z[$c];break}}am.push({_seqIndices:jo,_sosType:Math.max(N2,l8)%2?T:w,_eosType:Math.max(V2,u8)%2?T:w})}}for(var cm=0;cm<am.length;cm++){var hm=am[cm],le=hm._seqIndices,fl=hm._sosType,c8=hm._eosType,No=Z[le[0]]&1?T:w;if(X.get(L))for(var qc=0;qc<le.length;qc++){var U2=le[qc];if(N[U2]&L){for(var pm=fl,Gc=qc-1;Gc>=0;Gc--)if(!(N[le[Gc]]&s)){pm=N[le[Gc]];break}ie(U2,pm&(n|oe)?A:pm)}}if(X.get(S))for(var Zc=0;Zc<le.length;Zc++){var $2=le[Zc];if(N[$2]&S)for(var Hc=Zc-1;Hc>=-1;Hc--){var q2=Hc===-1?fl:N[le[Hc]];if(q2&a){q2===j&&ie($2,D);break}}}if(X.get(j))for(var dm=0;dm<le.length;dm++){var G2=le[dm];N[G2]&j&&ie(G2,T)}if(X.get(E)||X.get(F))for(var ml=1;ml<le.length-1;ml++){var fm=le[ml];if(N[fm]&(E|F)){for(var Vo=0,mm=0,gm=ml-1;gm>=0&&(Vo=N[le[gm]],Vo&s);gm--);for(var ym=ml+1;ym<le.length&&(mm=N[le[ym]],mm&s);ym++);Vo===mm&&(N[fm]===E?Vo===S:Vo&(S|D))&&ie(fm,Vo)}}if(X.get(S)){for(var Ji=0;Ji<le.length;Ji++)if(N[le[Ji]]&S){for(var Wc=Ji-1;Wc>=0&&N[le[Wc]]&(P|s);Wc--)ie(le[Wc],S);for(Ji++;Ji<le.length&&N[le[Ji]]&(P|s|S);Ji++)N[le[Ji]]!==S&&ie(le[Ji],S)}}if(X.get(P)||X.get(E)||X.get(F))for(var gl=0;gl<le.length;gl++){var Z2=le[gl];if(N[Z2]&(P|E|F)){ie(Z2,A);for(var Yc=gl-1;Yc>=0&&N[le[Yc]]&s;Yc--)ie(le[Yc],A);for(var Xc=gl+1;Xc<le.length&&N[le[Xc]]&s;Xc++)ie(le[Xc],A)}}if(X.get(S))for(var _m=0,H2=fl;_m<le.length;_m++){var W2=le[_m],vm=N[W2];vm&S?H2===w&&ie(W2,w):vm&a&&(H2=vm)}if(X.get(o)){for(var yl=T|S|D,Y2=yl|w,Kc=[],Uo=[],$o=0;$o<le.length;$o++)if(N[le[$o]]&o){var _l=W[le[$o]],X2=void 0;if(v(_l)!==null)if(Uo.length<63)Uo.push({char:_l,seqIndex:$o});else break;else if((X2=x(_l))!==null)for(var vl=Uo.length-1;vl>=0;vl--){var xm=Uo[vl].char;if(xm===X2||xm===x(b(_l))||v(b(xm))===_l){Kc.push([Uo[vl].seqIndex,$o]),Uo.length=vl;break}}}Kc.sort(function(Ar,Ai){return Ar[0]-Ai[0]});for(var bm=0;bm<Kc.length;bm++){for(var K2=Kc[bm],Qc=K2[0],wm=K2[1],Q2=!1,en=0,Tm=Qc+1;Tm<wm;Tm++){var J2=le[Tm];if(N[J2]&Y2){Q2=!0;var ex=N[J2]&yl?T:w;if(ex===No){en=ex;break}}}if(Q2&&!en){en=fl;for(var Sm=Qc-1;Sm>=0;Sm--){var tx=le[Sm];if(N[tx]&Y2){var rx=N[tx]&yl?T:w;en=rx===No?No:rx;break}}}if(en){if(N[le[Qc]]=N[le[wm]]=en,en!==No){for(var xl=Qc+1;xl<le.length;xl++)if(!(N[le[xl]]&s)){h(W[le[xl]])&L&&(N[le[xl]]=en);break}}if(en!==No){for(var bl=wm+1;bl<le.length;bl++)if(!(N[le[bl]]&s)){h(W[le[bl]])&L&&(N[le[bl]]=en);break}}}}for(var Kn=0;Kn<le.length;Kn++)if(N[le[Kn]]&o){for(var ix=Kn,Em=Kn,Cm=fl,wl=Kn-1;wl>=0;wl--)if(N[le[wl]]&s)ix=wl;else{Cm=N[le[wl]]&yl?T:w;break}for(var nx=c8,Tl=Kn+1;Tl<le.length;Tl++)if(N[le[Tl]]&(o|s))Em=Tl;else{nx=N[le[Tl]]&yl?T:w;break}for(var Pm=ix;Pm<=Em;Pm++)N[le[Pm]]=Cm===nx?Cm:No;Kn=Em}}}for(var $r=Ae.start;$r<=Ae.end;$r++){var h8=Z[$r],Jc=N[$r];if(h8&1?Jc&(w|S|D)&&Z[$r]++:Jc&T?Z[$r]++:Jc&(D|S)&&(Z[$r]+=2),Jc&s&&(Z[$r]=$r===0?Ae.level:Z[$r-1]),$r===Ae.end||h(W[$r])&(C|I))for(var eh=$r;eh>=0&&h(W[eh])&l;eh--)Z[eh]=Ae.level}}return{levels:Z,paragraphs:Ze};function ax(Ar,Ai){for(var Mr=Ar;Mr<W.length;Mr++){var Qn=N[Mr];if(Qn&(T|j))return 1;if(Qn&(I|w)||Ai&&Qn===oe)return 0;if(Qn&n){var ox=p8(Mr);Mr=ox===-1?W.length:ox}}return 0}function p8(Ar){for(var Ai=1,Mr=Ar+1;Mr<W.length;Mr++){var Qn=N[Mr];if(Qn&I)break;if(Qn&oe){if(--Ai===0)return Mr}else Qn&n&&Ai++}return-1}}var qe="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",mt;function Et(){if(!mt){var W=f(qe,!0),ye=W.map;W.reverseMap.forEach(function(se,N){ye.set(N,se)}),mt=ye}}function kt(W){return Et(),mt.get(W)||null}function st(W,ye,se,N){var De=W.length;se=Math.max(0,se==null?0:+se),N=Math.min(De-1,N==null?De-1:+N);for(var X=new Map,ie=se;ie<=N;ie++)if(ye[ie]&1){var Z=kt(W[ie]);Z!==null&&X.set(ie,Z)}return X}function Ur(W,ye,se,N){var De=W.length;se=Math.max(0,se==null?0:+se),N=Math.min(De-1,N==null?De-1:+N);var X=[];return ye.paragraphs.forEach(function(ie){var Z=Math.max(se,ie.start),Ee=Math.min(N,ie.end);if(Z<Ee){for(var Ze=ye.levels.slice(Z,Ee+1),Ae=Ee;Ae>=Z&&h(W[Ae])&l;Ae--)Ze[Ae]=ie.level;for(var Ct=ie.level,Va=1/0,wn=0;wn<Ze.length;wn++){var Ki=Ze[wn];Ki>Ct&&(Ct=Ki),Ki<Va&&(Va=Ki|1)}for(var vr=Ct;vr>=Va;vr--)for(var Ue=0;Ue<Ze.length;Ue++)if(Ze[Ue]>=vr){for(var rt=Ue;Ue+1<Ze.length&&Ze[Ue+1]>=vr;)Ue++;Ue>rt&&X.push([rt+Z,Ue+Z])}}}),X}function Di(W,ye,se,N){var De=ni(W,ye,se,N),X=[].concat(W);return De.forEach(function(ie,Z){X[Z]=(ye.levels[ie]&1?kt(W[ie]):null)||W[ie]}),X.join("")}function ni(W,ye,se,N){for(var De=Ur(W,ye,se,N),X=[],ie=0;ie<W.length;ie++)X[ie]=ie;return De.forEach(function(Z){for(var Ee=Z[0],Ze=Z[1],Ae=X.slice(Ee,Ze+1),Ct=Ae.length;Ct--;)X[Ze-Ct]=Ae[Ct]}),X}return e.closingToOpeningBracket=x,e.getBidiCharType=h,e.getBidiCharTypeName=p,e.getCanonicalBracket=b,e.getEmbeddingLevels=$e,e.getMirroredCharacter=kt,e.getMirroredCharactersMap=st,e.getReorderSegments=Ur,e.getReorderedIndices=ni,e.getReorderedString=Di,e.openingToClosingBracket=v,Object.defineProperty(e,"__esModule",{value:!0}),e})({})}var mv=dR(),fR=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/,mR=new Set(["WS","FSI","LRI","RLI","PDI"]),gR=new Set(["S","B"]);function yR(e,t,r,i){let n=[],a=r;for(let o of r_(e.slice(r,i)))n.push({index:a,text:o,level:t[a]}),a+=o.length;return n}function _R(e,t){let r=!0;for(let i=e.length-1;i>=0;i--){let n=mv.getBidiCharTypeName(e[i].text[0]);gR.has(n)?(e[i].level=t,r=!0):r&&mR.has(n)?e[i].level=t:r=!1}}function vR(e,t){let r=t,i=1/0;for(let{level:a}of e)a>r&&(r=a),(a|1)<i&&(i=a|1);let n=e.slice();for(let a=r;a>=i;a--)for(let o=0;o<n.length;o++){if(n[o].level<a)continue;let s=o;for(;s+1<n.length&&n[s+1].level>=a;)s++;for(let l=o,u=s;l<u;l++,u--)[n[l],n[u]]=[n[u],n[l]];o=s}return n}function xR(e){return e.level%2==0?e.text:mv.getMirroredCharacter(e.text)??e.text}function bR(e,t){return e.find(r=>t>=r.start&&t<=r.end)?.level??0}function wR(e,t,r,i,n){let a=yR(e,t,i,n);_R(a,r);let o="",s=[];for(let l of vR(a,r)){if(fR.test(l.text))continue;let u=xR(l);o+=u,s.push(...Array(u.length).fill(l.index))}return{text:o,sourceIndices:s}}function TR(e,t){let r=t.filter(a=>a>0&&a<e.length),i=[...new Set([0,...r,e.length])].sort((a,o)=>a-o),n=[];for(let a=0;a+1<i.length;a++)n.push([i[a],i[a+1]]);return n}function JE(e,t){let{levels:r,paragraphs:i}=mv.getEmbeddingLevels(e);return TR(e,t.concat(i.map(n=>n.start))).map(([n,a])=>wR(e,r,bR(i,n),n,a))}function SR(e,t){return JE(e,t).map(r=>r.text)}function ER(e,t,r){return JE(e,r).map(i=>[i.text,i.sourceIndices.map(n=>t[n]??0)])}var g4=4294967296,y4=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),eC=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,r=this.length){let i;for(;i=this.nextField(r);)e(i,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*g4;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*g4;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,r=t[this.pos++];if(r<128)return r;let i=r&127,n;return n=t[this.pos++],i|=(n&127)<<7,n<128||(n=t[this.pos++],i|=(n&127)<<14,n<128)||(n=t[this.pos++],i|=(n&127)<<21,n<128)?i:(n=t[this.pos],i|=(n&15)<<28,CR(i,e,this))}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&y4?y4.decode(this.buf.subarray(t,e)):DR(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;let t=this.readVarint();return this.type=t&7,this._valueStart=this.pos,t>>>3}skip(e){let t=e&7;if(t===0)for(;this.buf[this.pos++]>127;);else if(t===2)this.pos=this.readVarint()+this.pos;else if(t===5)this.pos+=4;else if(t===1)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}};function CR(e,t,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return PR(e,n,t);throw Error("Expected varint not more than 10 bytes")}function PR(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function DR(e,t,r){let i="",n=t;for(;n<r;){let a=e[n],o=null,s=a>239?4:a>223?3:a>191?2:1;if(n+s>r)break;let l,u,c;s===1?a<128&&(o=a):s===2?(l=e[n+1],(l&192)==128&&(o=(a&31)<<6|l&63,o<=127&&(o=null))):s===3?(l=e[n+1],u=e[n+2],(l&192)==128&&(u&192)==128&&(o=(a&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(l=e[n+1],u=e[n+2],c=e[n+3],(l&192)==128&&(u&192)==128&&(c&192)==128&&(o=(a&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),n+=s}return i}function AR(e,t,r){e===1&&r.readMessage(MR,t)}function MR(e,t,r){if(e===3){let{id:i,bitmap:n,width:a,height:o,left:s,top:l,advance:u}=r.readMessage(IR,{});t.push({id:i,bitmap:new cv({width:a+6,height:o+6},n),metrics:{width:a,height:o,left:s,top:l,advance:u}})}}function IR(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function kR(e){return new eC(e).readFields(AR,[])}function Vd(e){return typeof e?.renderWithWebGL=="function"}function zR(e){let{userImage:t}=e;return!t?.render||!t.render()?!1:(Vd(t.data)||e.data.replace(new Uint8Array(t.data.buffer)),!0)}function tC(e){let t=0,r=0;for(let o of e)t+=o.w*o.h,r=Math.max(r,o.w);e.sort((o,s)=>s.h-o.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],n=0,a=0;for(let o of e)for(let s=i.length-1;s>=0;s--){let l=i[s];if(!(o.w>l.w||o.h>l.h)){if(o.x=l.x,o.y=l.y,a=Math.max(a,o.y+o.h),n=Math.max(n,o.x+o.w),o.w===l.w&&o.h===l.h){let u=i.pop();u&&s<i.length&&(i[s]=u)}else o.h===l.h?(l.x+=o.w,l.w-=o.w):o.w===l.w?(l.y+=o.h,l.h-=o.h):(i.push({x:l.x+o.w,y:l.y,w:l.w-o.w,h:o.h}),l.y+=o.h,l.h-=o.h);break}}return{w:n,h:a,fill:t/(n*a)||0}}var gv=class{constructor(e,{pixelRatio:t,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=a,this.content=o,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=s,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},FR=class{constructor(e,t){let r={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let n=[];this.addImages(e,r,n),this.addImages(t,i,n);let{w:a,h:o}=tC(n),s=new Ye({width:a||1,height:o||1});for(let l in e){let u=e[l];if(u.isWebGLImage)continue;let c=r[l].paddedRect;Ye.copy(u.data,s,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(let l in t){let u=t[l],c=i[l].paddedRect,h=c.x+1,p=c.y+1,d=u.data.width,f=u.data.height;Ye.copy(u.data,s,{x:0,y:0},{x:h,y:p},u.data),Ye.copy(u.data,s,{x:0,y:f-1},{x:h,y:p-1},{width:d,height:1}),Ye.copy(u.data,s,{x:0,y:0},{x:h,y:p+f},{width:d,height:1}),Ye.copy(u.data,s,{x:d-1,y:0},{x:h-1,y:p},{width:1,height:f}),Ye.copy(u.data,s,{x:0,y:0},{x:h+d,y:p},{width:1,height:f})}this.image=s,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(let i in e){let n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new gv(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){if(e.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==e.updateVersion){this.patchedUpdateVersion=e.updateVersion;for(let r in this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}}patchUpdatedImage(e,t,r){if(!e||!t||!e.needsFirstWebGLRender&&e.version===t.version)return;e.needsFirstWebGLRender=!1,e.version=t.version;let[i,n]=e.tl,a=t.userImage?.data;if(!Vd(a)){r.update(t.data,void 0,{x:i,y:n});return}let{width:o,height:s}=t.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:i,y:n,width:o,height:s}),r.context.setDirty()}};G("ImagePosition",gv),G("ImageAtlas",FR);var rC=(function(e){return e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.horizontalOnly=3]="horizontalOnly",e})(rC||{});function RR(e){for(let t of e)if(t.positionedGlyphs.length!==0)return!1;return!0}function LR(e,t){let r=[],i=0;for(let n of t)r.push(e.substring(i,n)),i=n;return i<e.length()&&r.push(e.substring(i,e.length())),r}var _4=/^\p{gc=M}$/u;function BR(e){let t=[],r=0;for(;r<e.length;){if(!_4.test(e[r])){t.push(r),r++;continue}let i=r;for(;i<e.length&&_4.test(e[i]);)i++;let n=e[i];if(n!==void 0&&XE(n.codePointAt(0))){t.push(i);for(let a=i-1;a>=r;a--)t.push(a);r=i+1}else{for(let a=r;a<i;a++)t.push(a);r=i}}return t}function OR(e){let t=[],r=0;for(let i of e.graphemes())t.push(...Array(i.length).fill(e.sectionIndex[r])),r++;return t}function jR(e,t){let r=t.map(a=>e.toCodeUnitIndex(a)),i=Nd.isParsed()?Nd:null;if(e.sections.length===1)return i?i.processBidirectionalText(e.toString(),r).map(a=>v4(a,e.sections,[...a].map(()=>0))):SR(e.toString(),r).map(a=>a_([...a],e.sections,[...a].map(()=>0)));let n=OR(e);return i?i.processStyledBidirectionalText(e.text,n,r).map(([a,o])=>v4(a,e.sections,o)):ER(e.text,n,r).map(([a,o])=>{let s=[...a];return a_(s,e.sections,iC(s).map(l=>o[l]??0))})}function a_(e,t,r){let i=new fv(e.join(""),t,[]),n=0;for(let a of i.graphemes())i.sectionIndex.push(r[n]??0),n+=[...a].length;return i}function iC(e){let t=[],r=0;for(let i of e)t.push(r),r+=i.length;return t}function v4(e,t,r){let i=[...e],n=iC(i),a=BR(i);return a_(a.map(o=>i[o]),t,a.map(o=>r[n[o]]??0))}function jp(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f){let m=fv.fromFeature(e,n,h===2,t),_=m.determineLineBreaks(u,a,t,i,d),g=KE(m.text)?jR(m,_):LR(m,_),y=[],v={positionedLines:y,text:m.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return qR(v,t,r,i,g,o,s,l,h,u,p,f),!RR(y)&&v}function Tf(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function NR(e,t,r){let i=t.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=t.getMaxImageSize(e),o=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:o}}function nC(e){switch(e){case"top":return 0;case"center":return .5;default:return 1}}function VR(e,t){return e?.rect?e:t?{rect:null,metrics:t.metrics}:null}function aC(e,t,r){return!(e===1||!t&&!wc(r)||t&&(cc(r)||YE(r)))}function ld(e){return/\p{Nd}/u.test(String.fromCodePoint(e))}function oC(e){return/\p{Lu}/u.test(String.fromCodePoint(e))}function sC(e){let t=e.some(ld)&&e.every(i=>ld(i)||wf(i)),r=e.length<=3&&e.every(i=>oC(i)||ld(i));return t||r}function lC(e){return(ld(e)||oC(e))&&!YE(e)}function UR(e,t){return t?aC(2,!0,e):!el(e)||lC(e)||wf(e)}function $R(e,t,r){let i=!1;for(let n=0;n<e.length;n++){if(t[n])continue;let a=zs[e[n]];if(a&&(n===0||t[n-1])&&(n===e.length-1||t[n+1])){if(t[n]=!0,r[n])continue;e[n]=a,i=!0}}return i}function x4(e,t,r){for(;t>=0&&t<e.length&&cc(e[t]);)t+=r;let i=[];for(;t>=0&&t<e.length&&!wc(e[t])&&!cc(e[t]);)i.push(e[t]),t+=r;return!sC(i)&&!i.every(wf)&&i.some(el)}function uC(e,t){let r=e.graphemes().slice(),i=r.map(s=>s.codePointAt(0)),n=r.map((s,l)=>{let u=e.getSection(l);return"fontStack"in u&&!!t[u.fontStack]?.vertical?.[s]}),a=i.map(wc),o=s=>!a[s]&&!cc(i[s])&&!("imageName"in e.getSection(s));for(let s=0;s<i.length;s++){if(!o(s))continue;let l=s;for(;l+1<i.length&&o(l+1);)l++;let u=i.slice(s,l+1),c=sC(u),h=u.every(wf),p=h&&(x4(i,s-1,-1)||x4(i,l+1,1)),d=!c&&u.some(el);for(let f=s;f<=l;f++)a[f]=c&&lC(i[f])||n[f]&&!p&&(h||!d&&!el(i[f]));s=l}if(n.some((s,l)=>s&&!a[l])){let s=e.text;if(e.verticalizePunctuation(t,a),e.text!==s)return uC(e,t)}return $R(r,a,n)&&(e.text=r.join(""),e.cachedGraphemes=r),a}function qR(e,t,r,i,n,a,o,s,l,u,c,h){let p=0,d=0,f=0,m=0,_=s==="right"?1:s==="left"?0:.5,g=24/h,y=0;for(let b of n){b.trim();let w=b.getMaxScale(),T={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=T;let S=T.positionedGlyphs,E=0;if(!b.length()){d+=a,++y;continue}let P=NR(i,b,g),D=l===2&&!c?uC(b,t):null,F=b.graphemes();for(let A=0;A<F.length;A++){let M=b.getSection(A),L=F[A],j=L.codePointAt(0),O=D?D[A]:aC(l,c,j),Y="fontStack"in M&&uc(L)&&!t[M.fontStack]?.default?.[L]?[...L]:[L];for(let ue of Y){let pe={glyph:ue.codePointAt(0),grapheme:ue,imageName:null,x:p,y:d+-17,vertical:O,scale:1,fontStack:"",sectionIndex:b.getSectionIndex(A),metrics:null,rect:null},de;if("fontStack"in M){if(de=GR(M,ue,O,P,t,r),!de)continue;pe.fontStack=M.fontStack}else{if(e.iconsInText=!0,M.scale*=g,de=ZR(M,O,w,P,i),!de)continue;E=Math.max(E,de.imageOffset),pe.imageName=M.imageName}let{rect:je,metrics:Se,baselineOffset:ae}=de;if(pe.y+=ae,pe.scale=M.scale,pe.metrics=Se,pe.rect=je,S.push(pe),!O)p+=Se.advance*M.scale+u;else{e.verticalizable=!0;let oe="imageName"in M?Se.advance:24;p+=oe*M.scale+u}}}if(S.length!==0){let A=p-u;f=Math.max(A,f),HR(S,0,S.length-1,_)}p=0;let I=(w-1)*24;T.lineOffset=Math.max(E,I);let C=a*w+E;d+=C,m=Math.max(C,m),++y}let{horizontalAlign:v,verticalAlign:x}=Tf(o);WR(e.positionedLines,_,v,x,f,m,a,d,n.length),e.top+=-x*d,e.bottom=e.top+d,e.left+=-v*f,e.right=e.left+f}function GR(e,t,r,i,n,a){let o=r&&n[e.fontStack]?.vertical?.[t]?"vertical":"default",s=a[e.fontStack]?.[o]?.[t],l=n[e.fontStack]?.[o]?.[t],u=VR(s,l);if(u===null)return null;let c;if(r)c=i.verticalLineContentWidth-e.scale*24;else{let h=nC(e.verticalAlign);c=(i.horizontalLineContentHeight-e.scale*24)*h}return{rect:u.rect,metrics:u.metrics,baselineOffset:c}}function ZR(e,t,r,i,n){let a=n[e.imageName];if(!a)return null;let o=a.paddedRect,s=a.displaySize,l={width:s[0],height:s[1],left:1,top:-3,advance:t?s[1]:s[0]},u;if(t)u=i.verticalLineContentWidth-s[1]*e.scale;else{let h=nC(e.verticalAlign);u=(i.horizontalLineContentHeight-s[1]*e.scale)*h}let c=(t?s[0]:s[1])*e.scale-24*r;return{rect:o,metrics:l,baselineOffset:u,imageOffset:c}}function HR(e,t,r,i){if(i===0)return;let n=e[r],a=n.metrics.advance*n.scale,o=(e[r].x+a)*i;for(let s=t;s<=r;s++)e[s].x-=o}function WR(e,t,r,i,n,a,o,s,l){let u=(t-r)*n,c=0;c=a===o?-i*l*o+.5*o:-s*i- -17;for(let h of e)for(let p of h.positionedGlyphs)p.x+=u,p.y+=c}function YR(e,t,r){let{horizontalAlign:i,verticalAlign:n}=Tf(r),a=t[0],o=t[1],s=a-e.displaySize[0]*i,l=s+e.displaySize[0],u=o-e.displaySize[1]*n;return{image:e,top:u,bottom:u+e.displaySize[1],left:s,right:l}}function cC(e){let t=e.left,r=e.top,i=e.right-t,n=e.bottom-r,a=e.image.content[2]-e.image.content[0],o=e.image.content[3]-e.image.content[1],s=e.image.textFitWidth??"stretchOrShrink",l=e.image.textFitHeight??"stretchOrShrink",u=a/o;if(l==="proportional"){if(s==="stretchOnly"&&i/n<u||s==="proportional"){let c=Math.ceil(n*u);t*=c/i,i=c}}else if(s==="proportional"&&l==="stretchOnly"&&u!==0&&i/n>u){let c=Math.ceil(i/u);r*=c/n,n=c}return{x1:t,y1:r,x2:t+i,y2:r+n}}function b4(e,t,r,i,n,a){let o=e.image,s;if(o.content){let _=o.content,g=o.pixelRatio||1;s=[_[0]/g,_[1]/g,o.displaySize[0]-_[2]/g,o.displaySize[1]-_[3]/g]}let l=t.left*a,u=t.right*a,c,h,p,d;r==="width"||r==="both"?(d=n[0]+l-i[3],h=n[0]+u+i[1]):(d=n[0]+(l+u-o.displaySize[0])/2,h=d+o.displaySize[0]);let f=t.top*a,m=t.bottom*a;return r==="height"||r==="both"?(c=n[1]+f-i[0],p=n[1]+m+i[2]):(c=n[1]+(f+m-o.displaySize[1])/2,p=c+o.displaySize[1]),{image:o,top:c,right:h,bottom:p,left:d,collisionPadding:s}}var w4=32640;function T4(e,t){let{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Re(e+1))};if(r.kind==="source")return{kind:"source"};if(r.kind==="composite"){let{minZoom:i,maxZoom:n}=XR(r.zoomStops,e);return{kind:"composite",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=KR(r),n=r.evaluate(new Re(e+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function XR(e,t){let r=0;for(;r<e.length&&e[r]<=t;)r++;r=Math.max(0,r-1);let i=r;for(;i<e.length&&e[i]<t+1;)i++;return i=Math.min(e.length-1,i),{minZoom:e[r],maxZoom:e[i]}}function KR(e){return e.zoomStops.map(t=>e.evaluate(new Re(t===-1/0?e.zoomStops[1]-1:t)))}function yv(e,{uSize:t,uSizeT:r},{lowerSize:i,upperSize:n}){return e.kind==="source"?i/128:e.kind==="composite"?ot.number(i/128,n/128,r):t}function Sf(e,t){let r=0,i=0;return e.kind==="constant"?i=e.layoutSize:e.kind==="camera"?i=QR(e,t):e.kind==="composite"&&(r=JR(e,t)),{uSizeT:r,uSize:i}}function QR({zoomStops:e,sizes:t,layoutSize:r,interpolationType:i},n){let a=e.length-1;for(;a>0&&e[a]>n;)a--;let o=Math.min(a+1,e.length-1),s=i?Q(Si.interpolationFactor(i,n,e[a],e[o]),0,1):0;return Math.min(ot.number(t[a],t[o],s),r)}function JR({interpolationType:e,minZoom:t,maxZoom:r},i){return e?Q(Si.interpolationFactor(e,i,t,r),0,1):0}var js=class hC extends k{constructor(t,r,i,n){super(t,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new hC(this.x,this.y,this.angle,this.segment)}};G("Anchor",js);function pC(e,t,r,i,n){if(t.segment===void 0||r===0)return!0;let a=t,o=t.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;let l=[],u=0;for(;s<r/2;){let c=e[o-1],h=e[o],p=e[o+1];if(!p)return!1;let d=c.angleTo(h)-h.angleTo(p);for(d=Math.abs((d+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:s,angleDelta:d}),u+=d;s-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;o++,s+=h.dist(p)}return!0}function dC(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function fC(e,t,r){return e?3/5*t*r:0}function mC(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function eL(e,t,r,i,n,a){let o=fC(r,n,a),s=mC(r,i)*a,l=0,u=dC(e)/2;for(let c=0;c<e.length-1;c++){let h=e[c],p=e[c+1],d=h.dist(p);if(l+d>u){let f=(u-l)/d,m=new js(ot.number(h.x,p.x,f),ot.number(h.y,p.y,f),p.angleTo(h),c);return m._round(),!o||pC(e,m,s,o,t)?m:void 0}l+=d}}function tL(e,t,r,i,n,a,o,s,l){let u=fC(i,a,o),c=mC(i,n),h=c*o,p=e[0].x===0||e[0].x===l||e[0].y===0||e[0].y===l;t-h<t/4&&(t=h+t/4);let d=a*2;return gC(e,p?t/2*s%t:(c/2+d)*o*s%t,t,u,r,h,p,!1,l)}function gC(e,t,r,i,n,a,o,s,l){let u=a/2,c=dC(e),h=0,p=t-r,d=[];for(let f=0;f<e.length-1;f++){let m=e[f],_=e[f+1],g=m.dist(_),y=_.angleTo(m);for(;p+r<h+g;){p+=r;let v=(p-h)/g,x=ot.number(m.x,_.x,v),b=ot.number(m.y,_.y,v);if(x>=0&&x<l&&b>=0&&b<l&&p-u>=0&&p+u<=c){let w=new js(x,b,y,f);w._round(),(!i||pC(e,w,a,i,n))&&d.push(w)}}h+=g}return!s&&!d.length&&!o&&(d=gC(e,h/2,r,i,n,a,o,!0,l)),d}function yC(e,t,r,i,n){let a=[];for(let o of e){let s;for(let l=0;l<o.length-1;l++){let u=o[l],c=o[l+1];u.x<t&&c.x<t||(u.x<t?u=new k(t,u.y+(c.y-u.y)*((t-u.x)/(c.x-u.x)))._round():c.x<t&&(c=new k(t,u.y+(c.y-u.y)*((t-u.x)/(c.x-u.x)))._round()),!(u.y<r&&c.y<r)&&(u.y<r?u=new k(u.x+(c.x-u.x)*((r-u.y)/(c.y-u.y)),r)._round():c.y<r&&(c=new k(u.x+(c.x-u.x)*((r-u.y)/(c.y-u.y)),r)._round()),!(u.x>=i&&c.x>=i)&&(u.x>=i?u=new k(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round():c.x>=i&&(c=new k(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round()),!(u.y>=n&&c.y>=n)&&(u.y>=n?u=new k(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round():c.y>=n&&(c=new k(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round()),(!s||!u.equals(s[s.length-1]))&&(s=[u],a.push(s)),s.push(c)))))}}return a}function S4(e,t,r,i){let n=[],a=e.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},c=a.stretchX||[[0,s]],h=a.stretchY||[[0,l]],p=(C,A)=>C+A[1]-A[0],d=c.reduce(p,0),f=h.reduce(p,0),m=s-d,_=l-f,g=0,y=d,v=0,x=f,b=0,w=m,T=0,S=_;if(a.content&&i){let C=a.content,A=C[2]-C[0],M=C[3]-C[1];(a.textFitWidth||a.textFitHeight)&&(u=cC(e)),g=Np(c,0,C[0]),v=Np(h,0,C[1]),y=Np(c,C[0],C[2]),x=Np(h,C[1],C[3]),b=C[0]-g,T=C[1]-v,w=A-y,S=M-x}let E=u.x1,P=u.y1,D=u.x2-E,F=u.y2-P,I=(C,A,M,L)=>{let j=Vp(C.stretch-g,y,D,E),O=Up(C.fixed-b,w,C.stretch,d),Y=Vp(A.stretch-v,x,F,P),ue=Up(A.fixed-T,S,A.stretch,f),pe=Vp(M.stretch-g,y,D,E),de=Up(M.fixed-b,w,M.stretch,d),je=Vp(L.stretch-v,x,F,P),Se=Up(L.fixed-T,S,L.stretch,f),ae=new k(j,Y),oe=new k(pe,Y),$e=new k(pe,je),qe=new k(j,je),mt=new k(O/o,ue/o),Et=new k(de/o,Se/o),kt=t*Math.PI/180;if(kt){let W=Math.sin(kt),ye=Math.cos(kt),se=[ye,-W,W,ye];ae._matMult(se),oe._matMult(se),qe._matMult(se),$e._matMult(se)}let st=C.stretch+C.fixed,Ur=M.stretch+M.fixed,Di=A.stretch+A.fixed,ni=L.stretch+L.fixed;return{tl:ae,tr:oe,bl:qe,br:$e,tex:{x:a.paddedRect.x+1+st,y:a.paddedRect.y+1+Di,w:Ur-st,h:ni-Di},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:mt,pixelOffsetBR:Et,minFontScaleX:w/o/D,minFontScaleY:S/o/F,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));else{let C=E4(c,m,d),A=E4(h,_,f);for(let M=0;M<C.length-1;M++){let L=C[M],j=C[M+1];for(let O=0;O<A.length-1;O++){let Y=A[O],ue=A[O+1];n.push(I(L,Y,j,ue))}}}return n}function Np(e,t,r){let i=0;for(let n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function E4(e,t,r){let i=[{fixed:-1,stretch:0}];for(let[n,a]of e){let o=i[i.length-1];i.push({fixed:n-o.stretch,stretch:o.stretch}),i.push({fixed:n-o.stretch,stretch:o.stretch+(a-n)})}return i.push({fixed:t+1,stretch:r}),i}function Vp(e,t,r,i){return e/t*r+i}function Up(e,t,r,i){return e-t*r/i}function rL(e,t,r,i,n,a,o,s){let l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let c of t.positionedLines)for(let h of c.positionedGlyphs){if(!h.rect)continue;let p=h.rect||{},d=4,f=!0,m=1,_=0,g=(n||s)&&h.vertical,y=h.metrics.advance*h.scale/2;if(s&&t.verticalizable){let L=(h.scale-1)*24,j=(24-h.metrics.width*h.scale)/2;_=c.lineOffset/2-(h.imageName?-j:L)}if(h.imageName){let L=o[h.imageName];f=L.sdf,m=L.pixelRatio,d=1/m}let v=n?[h.x+y,h.y]:[0,0],x=n?[0,0]:[h.x+y+r[0],h.y+r[1]-_],b=[0,0];g&&(b=x,x=[0,0]);let w=h.metrics.isDoubleResolution?2:1,T=(h.metrics.left-d)*h.scale-y+x[0],S=(-h.metrics.top-d)*h.scale+x[1],E=T+p.w/w*h.scale/m,P=S+p.h/w*h.scale/m,D=new k(T,S),F=new k(E,S),I=new k(T,P),C=new k(E,P);if(g){let L=new k(-y,y- -17),j=-Math.PI/2,O=12-y,Y=h.imageName?O:0,ue=new k(22-O,-Y),pe=new k(...b);D._rotateAround(j,L)._add(ue)._add(pe),F._rotateAround(j,L)._add(ue)._add(pe),I._rotateAround(j,L)._add(ue)._add(pe),C._rotateAround(j,L)._add(ue)._add(pe)}if(l){let L=Math.sin(l),j=Math.cos(l),O=[j,-L,L,j];D._matMult(O),F._matMult(O),I._matMult(O),C._matMult(O)}let A=new k(0,0),M=new k(0,0);u.push({tl:D,tr:F,bl:I,br:C,tex:p,writingMode:t.writingMode,glyphOffset:v,sectionIndex:h.sectionIndex,isSDF:f,pixelOffsetTL:A,pixelOffsetBR:M,minFontScaleX:0,minFontScaleY:0})}return u}var $p=class{constructor(e,t,r,i,n,a,o,s,l,u){if(this.boxStartIndex=e.length,l){let c=a.top,h=a.bottom,p=a.collisionPadding;p&&(c-=p[1],h+=p[3]);let d=h-c;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let c=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?cC(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*o-s[0],c.y2=c.y2*o+s[2],c.x1=c.x1*o-s[3],c.x2=c.x2*o+s[1];let h=a.collisionPadding;if(h&&(c.x1-=h[0]*o,c.y1-=h[1]*o,c.x2+=h[2]*o,c.y2+=h[3]*o),u){let p=new k(c.x1,c.y1),d=new k(c.x2,c.y1),f=new k(c.x1,c.y2),m=new k(c.x2,c.y2),_=u*Math.PI/180;p._rotate(_),d._rotate(_),f._rotate(_),m._rotate(_),c.x1=Math.min(p.x,d.x,f.x,m.x),c.x2=Math.max(p.x,d.x,f.x,m.x),c.y1=Math.min(p.y,d.y,f.y,m.y),c.y2=Math.max(p.y,d.y,f.y,m.y)}e.emplaceBack(t.x,t.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=e.length}},iL=class{constructor(e=[],t=(r,i)=>r<i?-1:+(r>i)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let a=(e<<1)+1,o=a+1;if(o<this.length&&r(t[o],t[a])<0&&(a=o),r(t[a],n)>=0)break;t[e]=t[a],e=a}t[e]=n}};function nL(e,t=1){let r=qi.fromPoints(e[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new iL([],aL),{minX:o,minY:s,maxX:l,maxY:u}=r;if(i===0)return new k(o,s);for(let p=o;p<l;p+=i)for(let d=s;d<u;d+=i)a.push(new Is(p+n,d+n,n,e));let c=sL(e),h=c;for(;a.length;){let p=a.pop();(p.d>h.d||!h.d)&&(h=p),!(p.max-h.d<=t)&&(n=p.h/2,a.push(new Is(p.p.x-n,p.p.y-n,n,e)),a.push(new Is(p.p.x+n,p.p.y-n,n,e)),a.push(new Is(p.p.x-n,p.p.y+n,n,e)),a.push(new Is(p.p.x+n,p.p.y+n,n,e)))}return c.d>0&&h.d-c.d<=t?c.p:h.p}function aL(e,t){return t.max-e.max}var Is=class{constructor(e,t,r,i){this.p=new k(e,t),this.h=r,this.d=oL(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function oL(e,t){let r=!1,i=1/0;for(let n of t)for(let a=0,o=n.length,s=o-1;a<o;s=a++){let l=n[a],u=n[s];l.y>e.y!=u.y>e.y&&e.x<(u.x-l.x)*(e.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,vE(e,l,u))}return(r?1:-1)*Math.sqrt(i)}function sL(e){let t=0,r=0,i=0,n=e[0];for(let a=0,o=n.length,s=o-1;a<o;s=a++){let l=n[a],u=n[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,i+=(l.y+u.y)*c,t+=c*3}return new Is(r/t,i/t,0,e)}var o_=(function(e){return e[e.center=1]="center",e[e.left=2]="left",e[e.right=3]="right",e[e.top=4]="top",e[e.bottom=5]="bottom",e[e["top-left"]=6]="top-left",e[e["top-right"]=7]="top-right",e[e["bottom-left"]=8]="bottom-left",e[e["bottom-right"]=9]="bottom-right",e})({}),_v=1/0;function _C(e,t){function r(n,a){let o=0,s=0;a<0&&(a=0);let l=a/Math.SQRT2;switch(n){case"top-right":case"top-left":s=l-7;break;case"bottom-right":case"bottom-left":s=-l+7;break;case"bottom":s=-a+7;break;case"top":s=a-7}switch(n){case"top-right":case"bottom-right":o=-l;break;case"top-left":case"bottom-left":o=l;break;case"left":o=a;break;case"right":o=-a}return[o,s]}function i(n,a,o){let s=0,l=0;switch(a=Math.abs(a),o=Math.abs(o),n){case"top-right":case"top-left":case"top":l=o-7;break;case"bottom-right":case"bottom-left":case"bottom":l=-o+7}switch(n){case"top-right":case"bottom-right":case"right":s=-a;break;case"top-left":case"bottom-left":case"left":s=a}return[s,l]}return t[1]===_v?r(e,t[0]):i(e,t[0],t[1])}function vC(e,t,r){let i=e.layout,n=i.get("text-variable-anchor-offset")?.evaluate(t,{},r);if(n){let o=n.values,s=[];for(let l=0;l<o.length;l+=2){let u=s[l]=o[l],c=o[l+1].map(h=>h*24);u.startsWith("top")?c[1]-=7:u.startsWith("bottom")&&(c[1]+=7),s[l+1]=c}return new mn(s)}let a=i.get("text-variable-anchor");if(a){let o;o=e._unevaluatedLayout.getValue("text-radial-offset")===void 0?i.get("text-offset").evaluate(t,{},r).map(l=>l*24):[i.get("text-radial-offset").evaluate(t,{},r)*24,_v];let s=[];for(let l of a)s.push(l,_C(l,o));return new mn(s)}return null}function lL(e){var c;e.bucket.createArrays();let t=512*e.bucket.overscaling;e.bucket.tilePixelRatio=R/t,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new Re(e.bucket.zoom+1),e.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new Re(e.bucket.zoom+1),e.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new Re(18))};if(e.bucket.textSizeData.kind==="composite"){let{minZoom:h,maxZoom:p}=e.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new Re(h),e.canonical),n["text-size"].possiblyEvaluate(new Re(p),e.canonical)]}if(e.bucket.iconSizeData.kind==="composite"){let{minZoom:h,maxZoom:p}=e.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new Re(h),e.canonical),n["icon-size"].possiblyEvaluate(new Re(p),e.canonical)]}let o=i.get("text-line-height")*24,s=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",l=i.get("text-keep-upright"),u=i.get("text-size");for(let h of e.bucket.features){let p=i.get("text-font").evaluate(h,{},e.canonical).join(","),d=u.evaluate(h,{},e.canonical),f=a.layoutTextSize.evaluate(h,{},e.canonical),m=a.layoutIconSize.evaluate(h,{},e.canonical),_={horizontal:{},vertical:void 0},g=h.text,y=[0,0];if(g){let w=g.toString(),T=i.get("text-letter-spacing").evaluate(h,{},e.canonical)*24,S=sR(w)?T:0,E=i.get("text-anchor").evaluate(h,{},e.canonical),P=vC(r,h,e.canonical);if(!P){let C=i.get("text-radial-offset").evaluate(h,{},e.canonical);y=C?_C(E,[C*24,_v]):i.get("text-offset").evaluate(h,{},e.canonical).map(A=>A*24)}let D=s?"center":i.get("text-justify").evaluate(h,{},e.canonical),F=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(h,{},e.canonical)*24:1/0,I=()=>{e.bucket.allowVerticalPlacement&&i_(w)&&(_.vertical=jp(g,e.glyphMap,e.glyphPositions,e.imagePositions,p,F,o,E,"left",S,y,2,!0,f,d))};if(!s&&P){let C=new Set;if(D==="auto")for(let M=0;M<P.values.length;M+=2)C.add(s_(P.values[M]));else C.add(D);let A=!1;for(let M of C)if(!_.horizontal[M])if(A)_.horizontal[M]=_.horizontal[0];else{let L=jp(g,e.glyphMap,e.glyphPositions,e.imagePositions,p,F,o,"center",M,S,y,1,!1,f,d);L&&(_.horizontal[M]=L,A=L.positionedLines.length===1)}I()}else{D==="auto"&&(D=s_(E));let C=jp(g,e.glyphMap,e.glyphPositions,e.imagePositions,p,F,o,E,D,S,y,1,!1,f,d);C&&(_.horizontal[D]=C),I(),i_(w)&&s&&l&&(_.vertical=jp(g,e.glyphMap,e.glyphPositions,e.imagePositions,p,F,o,E,D,S,y,2,!1,f,d))}}let v,x=!1;if(h.icon?.name){let w=e.imageMap[h.icon.name];w&&(v=YR(e.imagePositions[h.icon.name],i.get("icon-offset").evaluate(h,{},e.canonical),i.get("icon-anchor").evaluate(h,{},e.canonical)),x=!!w.sdf,e.bucket.sdfIcons===void 0?e.bucket.sdfIcons=x:e.bucket.sdfIcons!==x&&we("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),w.pixelRatio===e.bucket.pixelRatio?i.get("icon-rotate").constantOr(1)!==0&&(e.bucket.iconsNeedLinear=!0):e.bucket.iconsNeedLinear=!0)}let b=xC(_.horizontal)||_.vertical;(c=e.bucket).iconsInText||(c.iconsInText=b?b.iconsInText:!1),(b||v)&&uL(e.bucket,h,_,v,e.imageMap,a,f,m,y,x,e.canonical,e.subdivisionGranularity,e.hasPromoteId)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}function s_(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function uL(e,t,r,i,n,a,o,s,l,u,c,h,p){let d=a.textMaxSize.evaluate(t,{});d===void 0&&(d=o);let f=e.layers[0].layout,m=f.get("icon-offset").evaluate(t,{},c),_=xC(r.horizontal),g=o/24,y=e.tilePixelRatio*g,v=e.tilePixelRatio*d/24,x=e.tilePixelRatio*s,b=e.tilePixelRatio*f.get("symbol-spacing"),w=f.get("text-padding")*e.tilePixelRatio,T=bL(f,t,c,e.tilePixelRatio),S=f.get("text-max-angle")/180*Math.PI,E=f.get("text-rotation-alignment")!=="viewport"&&f.get("symbol-placement")!=="point",P=f.get("icon-rotation-alignment").constantOr("viewport")==="map"&&f.get("symbol-placement")!=="point",D=f.get("symbol-placement"),F=b/2,I=f.get("icon-text-fit"),C;i&&I!=="none"&&(e.allowVerticalPlacement&&r.vertical&&(C=b4(i,r.vertical,I,f.get("icon-text-fit-padding"),m,g)),_&&(i=b4(i,_,I,f.get("icon-text-fit-padding"),m,g)));let A=c?h.line.getGranularityForZoomLevel(c.z):1,M=(L,j)=>{nv(j)||hL(e,j,L,r,i,n,C,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,y,[w,w,w,w],E,l,x,T,P,m,t,a,u,c,o,p)};if(D==="line")for(let L of yC(t.geometry,0,0,R,R)){let j=po(L,A),O=tL(j,b,S,r.vertical||_,i,24,v,e.overscaling,R);for(let Y of O){let ue=_;(!ue||!pL(e,ue.text,F,Y))&&M(j,Y)}}else if(D==="line-center"){for(let L of t.geometry)if(L.length>1){let j=po(L,A),O=eL(j,S,r.vertical||_,i,24,v);O&&M(j,O)}}else if(t.type==="Polygon")for(let L of lf(t.geometry,0)){let j=nL(L,16);M(po(L[0],A,!0),new js(j.x,j.y,0))}else if(t.type==="LineString")for(let L of t.geometry){let j=po(L,A);M(j,new js(j[0].x,j[0].y,0))}else if(t.type==="Point")for(let L of t.geometry)for(let j of L)M([j],new js(j.x,j.y,0))}function cL(e,t){let r=e.length,i=t?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let a=o_[i[n]],o=i[n+1];e.emplaceBack(a,o[0],o[1])}return[r,e.length]}function C4(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m){let _=rL(t,r,s,n,a,o,i,e.allowVerticalPlacement),g=e.textSizeData,y=null;g.kind==="source"?(y=[128*n.layout.get("text-size").evaluate(o,{})],y[0]>32640&&we(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):g.kind==="composite"&&(y=[128*f.compositeTextSizes[0].evaluate(o,{},m),128*f.compositeTextSizes[1].evaluate(o,{},m)],(y[0]>32640||y[1]>32640)&&we(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,_,y,s,a,o,c,t,u.lineStartIndex,u.lineLength,d,m,l);for(let v of h)p[v]=e.text.placedSymbolArray.length-1;return _.length*4}function xC(e){for(let t in e)return e[t];return null}function hL(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y,v,x,b,w,T,S,E){let P=e.addToLineVertexArray(t,r),D=s.layout.get("symbol-height-offset").evaluate(x,{},T);D>e.maxHeightOffset&&(e.maxHeightOffset=D);let F,I,C,A,M=0,L=0,j=0,O=0,Y=-1,ue=-1,pe={},de=(0,kd.default)("");if(e.allowVerticalPlacement&&i.vertical){let se=s.layout.get("text-rotate").evaluate(x,{},T)+90,N=i.vertical;C=new $p(l,t,u,c,h,N,p,d,f,se),o&&(A=new $p(l,t,u,c,h,o,_,g,f,se))}if(n){let se=s.layout.get("icon-rotate").evaluate(x,{}),N=s.layout.get("icon-text-fit")!=="none",De=S4(n,se,w,N),X=o?S4(o,se,w,N):void 0;I=new $p(l,t,u,c,h,n,_,g,!1,se),M=De.length*4;let ie=e.iconSizeData,Z=null;ie.kind==="source"?(Z=[128*s.layout.get("icon-size").evaluate(x,{})],Z[0]>32640&&we(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):ie.kind==="composite"&&(Z=[128*b.compositeIconSizes[0].evaluate(x,{},T),128*b.compositeIconSizes[1].evaluate(x,{},T)],(Z[0]>32640||Z[1]>32640)&&we(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,De,Z,v,y,x,0,t,P.lineStartIndex,P.lineLength,-1,T,D),Y=e.icon.placedSymbolArray.length-1,X&&(L=X.length*4,e.addSymbols(e.icon,X,Z,v,y,x,2,t,P.lineStartIndex,P.lineLength,-1,T,D),ue=e.icon.placedSymbolArray.length-1)}let je=Object.keys(i.horizontal);for(let se of je){let N=i.horizontal[se];F||(F=(de=(0,kd.default)(N.text),new $p(l,t,u,c,h,N,p,d,f,s.layout.get("text-rotate").evaluate(x,{},T))));let De=N.positionedLines.length===1;if(j+=C4(e,t,N,a,s,f,x,m,D,P,i.vertical?1:3,De?je:[se],pe,Y,b,T),De)break}i.vertical&&(O+=C4(e,t,i.vertical,a,s,f,x,m,D,P,2,["vertical"],pe,ue,b,T));let Se=F?F.boxStartIndex:e.collisionBoxArray.length,ae=F?F.boxEndIndex:e.collisionBoxArray.length,oe=C?C.boxStartIndex:e.collisionBoxArray.length,$e=C?C.boxEndIndex:e.collisionBoxArray.length,qe=I?I.boxStartIndex:e.collisionBoxArray.length,mt=I?I.boxEndIndex:e.collisionBoxArray.length,Et=A?A.boxStartIndex:e.collisionBoxArray.length,kt=A?A.boxEndIndex:e.collisionBoxArray.length,st=-1,Ur=(se,N)=>se?.circleDiameter?Math.max(se.circleDiameter,N):N;st=Ur(F,st),st=Ur(C,st),st=Ur(I,st),st=Ur(A,st);let Di=+(st>-1);Di&&(st*=S/24),e.glyphOffsetArray.length>=e.maxGlyphs&&we("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),x.sortKey!==void 0&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey);let ni=vC(s,x,T),[W,ye]=cL(e.textAnchorOffsets,ni);E&&(de=dL(de,x)),e.symbolInstances.emplaceBack(t.x,t.y,pe.right>=0?pe.right:-1,pe.center>=0?pe.center:-1,pe.left>=0?pe.left:-1,pe.vertical||-1,Y,ue,de,Se,ae,oe,$e,qe,mt,Et,kt,u,j,O,M,L,Di,0,p,st,W,ye,D)}function pL(e,t,r,i){let n=e.compareText;if(!(t in n))n[t]=[];else{let a=n[t];for(let o=a.length-1;o>=0;o--)if(i.dist(a[o])<r)return!0}return n[t].push(i),!1}function dL(e,t){return t.id==null||t.properties?.cluster?e:(0,kd.default)(String(t.id),e)}function Ud(e,t,r){let i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}var fL=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function qp(e,t,r,i,n,a,o,s,l,u,c,h,p,d){let f=s?Math.min(w4,Math.round(s[0])):0,m=s?Math.min(w4,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(i*32),Math.round(n*32),a,o,(f<<1)+ +!!l,m,u*16,c*16,h*256,p*256,d)}function $d(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function mL(e){for(let t of e.sections)if(KE(t.text))return!0;return!1}var l_=class{constructor(e){this.layoutVertexArray=new xz,this.indexArray=new yn,this.programConfigurations=e,this.segments=new ct,this.dynamicLayoutVertexArray=new bz,this.opacityVertexArray=new wz,this.hasVisibleVertices=!1,this.placedSymbolArray=new iE}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,DF.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,AF.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,fL,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};G("SymbolBuffers",l_);var u_=class{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new ct,this.collisionVertexArray=new Sz}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,MF.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};G("CollisionBuffers",u_);var qd=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(o=>o.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=T4(this.zoom,t["text-size"]),this.iconSizeData=T4(this.zoom,t["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap=Ud(r,"text-overlap","text-allow-overlap")!=="never"||Ud(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=n!=="viewport-y"&&!i.isConstant();let a=n==="viewport-y"||n==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(o=>rC[o])),this.stateDependentLayerIds=this.layers.filter(o=>o.isStateDependent()).map(o=>o.id),this.sourceID=e.sourceID}createArrays(){this.text=new l_(new To(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new l_(new To(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new oE,this.lineVertexArray=new sE,this.symbolInstances=new aE,this.textAnchorOffsets=new uE}calculateGlyphDependencies(e,t,r,i){var o;let n=fv.fromFeature(e,r,!1),a=n.graphemes();for(let s=0;s<a.length;s++){let l=n.getSection(s);if("imageName"in l)continue;t[o=l.fontStack]||(t[o]={default:{},vertical:{}});let u=t[l.fontStack],c=a[s],h=i&&UR(c.codePointAt(0),this.allowVerticalPlacement);uc(c)&&(u.default[c]=!0),h&&(u.vertical[c]=!0);for(let p of c){if(u.default[p]=!0,!i)continue;h&&uc(c)&&(u.vertical[p]=!0);let d=zs[p];d&&(u.default[d]=!0)}}}populate(e,t,r){let i=this.layers[0],n=i.layout,a=n.get("text-font"),o=n.get("text-field"),s=n.get("icon-image"),l=(o.value.kind!=="constant"||o.value.value instanceof qn&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),u=s.value.kind!=="constant"||!!s.value.value||Object.keys(s.parameters).length>0,c=n.get("symbol-sort-key"),h=n.get("symbol-placement")==="point";if(this.features=[],!l&&!u)return;let p=t.iconDependencies,d=t.glyphDependencies,f=t.availableImages,m=new Re(this.zoom),_=n.get("text-keep-upright");for(let{feature:g,id:y,index:v,sourceLayerIndex:x}of e){let b=i._featureFilter.needGeometry,w=ko(g,b);if(!i._featureFilter.filter(m,w,r)||(b||(w.geometry=Io(g)),h&&g.type===1&&gL(w.geometry)))continue;let T;if(l){let D=i.getValueAndResolveTokens("text-field",w,r,f),F=qn.factory(D);this.hasRTLText||(this.hasRTLText=mL(F)),T=iR(F,i,w)}let S;if(u){let D=i.getValueAndResolveTokens("icon-image",w,r,f);S=D instanceof gn?D:gn.fromString(D)}if(!T&&!S)continue;let E=this.sortFeaturesByKey?c.evaluate(w,{},r):void 0,P={id:y,text:T,icon:S,index:v,sourceLayerIndex:x,geometry:w.geometry,properties:g.properties,type:bc.types[g.type],sortKey:E};if(this.features.push(P),S&&(p[S.name]=!0),T){let D=a.evaluate(w,{},r).join(","),F=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes?.includes(2);let I=(F&&_||this.allowVerticalPlacement)&&i_(T.toString());this.calculateGlyphDependencies(T,d,D,I);for(let C of T.sections)C.image&&(p[C.image.name]=!0)}}n.get("symbol-placement")==="line"&&(this.features=aR(this.features)),this.sortFeaturesByKey&&this.features.sort((g,y)=>g.sortKey-y.sortKey)}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}))}addFeatures({options:e,canonical:t,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:o}){lL({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:o,canonical:t,subdivisionGranularity:e.subdivisionGranularity,hasPromoteId:e.featureIndex.promoteId!=null})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),a={};for(let o=e.segment+1;o<t.length;o++)a[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:i},o<t.length-1&&(i+=t[o+1].dist(t[o]));for(let o=e.segment||0;o>=0;o--)a[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:n},o>0&&(n+=t[o-1].dist(t[o]));for(let o=0;o<t.length;o++){let s=a[o];this.lineVertexArray.emplaceBack(s.x,s.y,s.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,i,n,a,o,s,l,u,c,h,p){let d=e.indexArray,f=e.layoutVertexArray,m=e.segments.prepareSegment(4*t.length,f,d,this.canOverlap?a.sortKey:void 0),_=this.glyphOffsetArray.length,g=m.vertexLength,y=this.allowVerticalPlacement&&o===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let x=0;x<t.length;x++){let{tl:b,tr:w,bl:T,br:S,tex:E,pixelOffsetTL:P,pixelOffsetBR:D,minFontScaleX:F,minFontScaleY:I,glyphOffset:C,isSDF:A,sectionIndex:M}=t[x],L=m.vertexLength,j=C[1];qp(f,s.x,s.y,b.x,j+b.y,E.x,E.y,r,A,P.x,P.y,F,I,p),qp(f,s.x,s.y,w.x,j+w.y,E.x+E.w,E.y,r,A,D.x,P.y,F,I,p),qp(f,s.x,s.y,T.x,j+T.y,E.x,E.y+E.h,r,A,P.x,D.y,F,I,p),qp(f,s.x,s.y,S.x,j+S.y,E.x+E.w,E.y+E.h,r,A,D.x,D.y,F,I,p),$d(e.dynamicLayoutVertexArray,s,y),d.emplaceBack(L,L+2,L+1),d.emplaceBack(L+1,L+2,L+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),(x===t.length-1||M!==t[x+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(f.length,a,a.index,{imagePositions:{},canonical:h,formattedSection:v?.[M]})}e.placedSymbolArray.emplaceBack(s.x,s.y,_,this.glyphOffsetArray.length-_,g,l,u,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],o,0,!1,0,c,p)}_addCollisionDebugVertex(e,t,r,i,n,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,i,n,a,o){let s=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=s.vertexLength,u=n.layoutVertexArray,c=n.collisionVertexArray,h=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(u,c,a,h,p,new k(e,t)),this._addCollisionDebugVertex(u,c,a,h,p,new k(r,t)),this._addCollisionDebugVertex(u,c,a,h,p,new k(r,i)),this._addCollisionDebugVertex(u,c,a,h,p,new k(e,i)),s.vertexLength+=4;let d=n.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),s.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,i){for(let n=e;n<t;n++){let a=this.collisionBoxArray.get(n),o=a.x1,s=a.y1,l=a.x2,u=a.y2;this.addCollisionDebugVertices(o,s,l,u,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new u_(k5,s4.members,Ry),this.iconCollisionBox=new u_(k5,s4.members,Ry);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,a,o,s,l){let u={};for(let c=t;c<r;c++){let h=e.get(c);u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}for(let c=i;c<n;c++){let h=e.get(c);u.verticalTextBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.verticalTextFeatureIndex=h.featureIndex;break}for(let c=a;c<o;c++){let h=e.get(c);u.iconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.iconFeatureIndex=h.featureIndex;break}for(let c=s;c<l;c++){let h=e.get(c);u.verticalIconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.verticalIconFeatureIndex=h.featureIndex;break}return u}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;n<i;n+=4)e.indexArray.emplaceBack(n,n+2,n+1),e.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),i=[],n=[],a=[];for(let o=0;o<this.symbolInstances.length;++o){a.push(o);let s=this.symbolInstances.get(o);i.push(Math.round(t*s.anchorX+r*s.anchorY)|0),n.push(s.featureIndex)}return a.sort((o,s)=>i[o]-i[s]||n[s]-n[o]),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let t of this.symbolInstanceIndexes){let r=this.symbolInstances.get(t);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n<i.length;n++){let a=i[n];a>=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};function gL(e){return e.every(t=>t.every(nv))}G("SymbolBucket",qd,{omit:["layers","collisionBoxArray","features","compareText"]});function yL(e,t){return t.replace(/{([^{}]+)}/g,(r,i)=>e&&i in e?String(e[i]):"")}var P4,_L=()=>P4||(P4=new Kt({"symbol-placement":new $(z.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new $(z.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new $(z.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new re(z.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new $(z.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new $(z.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new $(z.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new $(z.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new $(z.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new re(z.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new re(z.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new $(z.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new $(z.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new re(z.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new re(z.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new re(z.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new $(z.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new re(z.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new re(z.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new $(z.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new $(z.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new $(z.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new re(z.layout_symbol["text-field"],"text-field"),"text-font":new re(z.layout_symbol["text-font"],"text-font"),"text-size":new re(z.layout_symbol["text-size"],"text-size"),"text-max-width":new re(z.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new $(z.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new re(z.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new re(z.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new re(z.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new $(z.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new re(z.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new re(z.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new $(z.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new $(z.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new re(z.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new $(z.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new $(z.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new re(z.layout_symbol["text-transform"],"text-transform"),"text-offset":new re(z.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new $(z.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new $(z.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new $(z.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new $(z.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new re(z.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new $(z.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),D4,vL=()=>D4||(D4=new Kt({"icon-opacity":new re(z.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new re(z.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new re(z.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new re(z.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new re(z.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new $(z.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new $(z.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new re(z.paint_symbol["text-opacity"],"text-opacity"),"text-color":new re(z.paint_symbol["text-color"],"text-color",{runtimeType:$i,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new re(z.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new re(z.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new re(z.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new $(z.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new $(z.paint_symbol["text-translate-anchor"],"text-translate-anchor")})),b1={get paint(){return vL()},get layout(){return _L()}},bC=class{constructor(e){if(e.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:dc,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t?.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let t=this.defaultValue.value;e(t._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};G("FormatSectionOverride",bC,{omit:["defaultValue"]});var wC=e=>e.type==="symbol",xL=class c_ extends Yi{constructor(t,r){super(t,b1,r)}recalculate(t,r){super.recalculate(t,r);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new bi(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),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").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let o of n)a.includes(o)||a.push(o);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,i,n){let a=this.layout.get(t).evaluate(r,{},i,n),o=this._unevaluatedLayout._values[t];return!o.isDataDriven()&&!df(o.value)&&a?yL(r.properties,a):a}createBucket(t){return new qd(t)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of b1.paint.overridableProperties){if(!c_.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),i=new K_(new bC(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind==="constant"||r.value.kind==="source"?new Ku("source",i):new Pd("composite",i,r.value.zoomStops),this.paint._values[t]=new bi(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:c_.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){let i=t.get("text-field"),n=b1.paint.properties[r],a=!1,o=s=>{for(let l of s)if(n.overrides?.hasOverride(l)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof qn)o(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let s=u=>{if(!a)if(u instanceof Ws&&St(u.value)===fc){let c=u.value;o(c.sections)}else u instanceof $T?o(u.sections):u.eachChild(s)},l=i.value;l._styleExpression&&s(l._styleExpression.expression)}return a}};function bL(e,t,r,i=1){let n=e.get("icon-padding").evaluate(t,{},r)?.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var A4,wL=()=>A4||(A4=new Kt({"background-color":new $(z.paint_background["background-color"],"background-color"),"background-pattern":new JS(z.paint_background["background-pattern"],"background-pattern"),"background-opacity":new $(z.paint_background["background-opacity"],"background-opacity")})),TL={get paint(){return wL()}},SL=e=>e.type==="background",EL=class extends Yi{constructor(e,t){super(e,TL,t)}};function CL(e){let t=[],r=e.id;return r===void 0&&t.push(new B(`layers.${r}`,null,'missing required property "id"')),e.render===void 0&&t.push(new B(`layers.${r}`,null,'missing required method "render"')),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push(new B(`layers.${r}`,null,'property "renderingMode" must be either "2d" or "3d"')),t}var Ef=e=>e.type==="custom",PL=class extends Yi{constructor(e,t){super(e,{},t),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function w1(e,t){if(e.type==="custom")return new PL(e,t);switch(e.type){case"background":return new EL(e,t);case"circle":return new Jz(e,t);case"color-relief":return new p9(e,t);case"fill":return new q9(e,t);case"fill-extrusion":return new fF(e,t);case"heatmap":return new i9(e,t);case"hillshade":return new s9(e,t);case"line":return new PF(e,t);case"raster":return new cz(e,t);case"symbol":return new xL(e,t)}}function ud(e){let t=[];if(typeof e=="string")t.push({id:"default",url:e});else if(e&&e.length>0){let r=[];for(let{id:i,url:n}of e){let a=`${i}${n}`;r.includes(a)||(r.push(a),t.push({id:i,url:n}))}}return t}function M4(e,t,r){try{let i=new URL(e);return i.pathname+=`${t}${r}`,i.toString()}catch{throw Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}async function DL(e,t,r,i){let n=ud(e),a=r>1?"@2x":"",o={},s={};for(let{id:l,url:u}of n){let c=await t.transformRequest(M4(u,a,".json"),"SpriteJSON");o[l]=ef(c,i);let h=await t.transformRequest(M4(u,a,".png"),"SpriteImage");s[l]=Vi.getImage(h,i)}return await Promise.all([...Object.values(o),...Object.values(s)]),AL(o,s)}async function AL(e,t){let r={};for(let i in e){r[i]={};let n=(await t[i]).data;if(!n)throw Error(`Could not load sprite image for ${i}: the response is empty`);let a=Nr.getImageCanvasContext(n),o=(await e[i]).data;for(let s in o){let{width:l,height:u,x:c,y:h,sdf:p,pixelRatio:d,stretchX:f,stretchY:m,content:_,textFitWidth:g,textFitHeight:y}=o[s],v={width:l,height:u,x:c,y:h,context:a};r[i][s]={data:null,pixelRatio:d,sdf:p,stretchX:f,stretchY:m,content:_,textFitWidth:g,textFitHeight:y,spriteData:v}}}return r}var ML=class extends lr{constructor(){super(),this.images={},this.updateVersion=0,this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this._spriteImagesIds={},this._imagesIds=null,this._renderCallbacksDispatchedThisFrame={}}destroy(){for(let e of Object.keys(this.images))this.removeImage(e);this._spriteImagesIds={}}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:t,promiseResolve:r}of this.requestors)r(this._getImagesForIds(t));this.requestors=[]}}getImage(e){let t=this.images[e];if(t&&!t.data&&t.spriteData){let r=t.spriteData;t.data=new Ye({width:r.width,height:r.height},r.context.getImageData(r.x,r.y,r.width,r.height).data),t.spriteData=null}return t}addImage(e,t){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t,this._imagesIds=null,t.isWebGLImage&&this.updateImage(e,t,!1))}_validate(e,t){let r=!0,i=t.data||t.spriteData;return this._validateStretch(t.stretchX,i?.width)||(this.fire(new ee(Error(`Image "${e}" has invalid "stretchX" value`))),r=!1),this._validateStretch(t.stretchY,i?.height)||(this.fire(new ee(Error(`Image "${e}" has invalid "stretchY" value`))),r=!1),this._validateContent(t.content,t)||(this.fire(new ee(Error(`Image "${e}" has invalid "content" value`))),r=!1),r}_validateStretch(e,t){if(!e)return!0;let r=0;for(let i of e){if(i[0]<r||i[1]<i[0]||t<i[1])return!1;r=i[1]}return!0}_validateContent(e,t){if(!e)return!0;if(e.length!==4)return!1;let r=t.spriteData,i=r?.width||t.data.width,n=r?.height||t.data.height;return e[0]<0||i<e[0]||e[1]<0||n<e[1]||e[2]<0||i<e[2]||e[3]<0||n<e[3]||e[2]<e[0]?!1:e[3]>=e[1]}updateImage(e,t,r=!0){let i=this.images[e];if(r){let n=i.data||i.spriteData;if(n.width!==t.data.width||n.height!==t.data.height)throw Error(`size mismatch between old image (${n.width}x${n.height}) and new image (${t.data.width}x${t.data.height}).`)}t.version=(i.version??0)+1,this.images[e]=t,this.updateVersion++}removeImage(e){let t=this.images[e];t&&(delete this.images[e],this._imagesIds=null,t.userImage?.onRemove&&t.userImage.onRemove())}listImages(){return this._imagesIds??(this._imagesIds=Object.keys(this.images)),this._imagesIds}_getSpriteImageId(e,t){return e==="default"?t:`${e}:${t}`}setSpriteImages(e,t){let r=this._spriteImagesIds[e]??[],i=[];for(let o in t){let s=this._getSpriteImageId(e,o);i.push(s),s in this.images?this.updateImage(s,t[o],!1):this.addImage(s,t[o])}let n=new Set(i),a=r.filter(o=>!n.has(o));for(let o of a)this.removeImage(o);return this._spriteImagesIds[e]=i,{loaded:i,removed:a}}removeSpriteImages(e){let t=this._spriteImagesIds[e]??[];for(let r of t)this.removeImage(r);return delete this._spriteImagesIds[e],t}removeAllSpriteImages(){let e=Object.values(this._spriteImagesIds).flat();for(let t of e)this.removeImage(t);return this._spriteImagesIds={},e}setMissingImageResolver(e){this.missingImageResolver=e}getImages(e){return new Promise((t,r)=>{let i=!0;if(!this.isLoaded())for(let n of e)this.images[n]||(i=!1);this.isLoaded()||i?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})})}async _getImagesForIds(e){let t=new Set(e.filter(n=>!this.getImage(n))),r=this.missingImageResolver;r&&await Promise.allSettled(Array.from(t,n=>r(n)));let i={};for(let n of e){let a=this.getImage(n);a&&(t.delete(n),i[n]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,stretchX:a.stretchX,stretchY:a.stretchY,content:a.content,textFitWidth:a.textFitWidth,textFitHeight:a.textFitHeight,hasRenderCallback:!!a.userImage?.render,isWebGLImage:a.isWebGLImage})}for(let n of t)this.fire(new QI({id:n})),we(`Image "${n}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return i}beginFrame(){this._renderCallbacksDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let t of e){if(this._renderCallbacksDispatchedThisFrame[t])continue;this._renderCallbacksDispatchedThisFrame[t]=!0;let r=this.getImage(t);r||we(`Image with ID: "${t}" was not found`),zR(r)&&this.updateImage(t,r)}}cloneImages(){let e={};for(let t in this.images){let r=this.images[t];e[t]={...r,data:r.data?r.data.clone():null}}return e}},IL=class{constructor(e){this._imageManager=e,this._entries={},this._image=new Ye({width:1,height:1}),this._dirty=!0}destroy(){this._texture&&(this._texture=(this._texture.destroy(),null)),this._entries={},this._image=new Ye({width:1,height:1}),this._dirty=!0}getPixelSize(){let{width:e,height:t}=this._image;return{width:e,height:t}}getPattern(e){let t=this._imageManager.getImage(e);if(!t)return null;let r=this._entries[e];if(r?.image!==t){let i={w:t.data.width+2,h:t.data.height+2,x:0,y:0};this._entries[e]={bin:i,position:new gv(i,t),image:t}}else if(r.position.version!==t.version)r.position.version=t.version;else return r.position;return this._update(),this._entries[e].position}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.getPattern(e.from.toString()),r=this.getPattern(e.to.toString());return!t||!r}bind(e){let t=e.gl;this._texture?this._dirty&&(this._dirty=(this._texture.update(this._image),!1)):(this._texture=new Ot(e,this._image,t.RGBA),this._dirty=!1),this._texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_update(){for(let n in this._entries)this._imageManager.getImage(n)||delete this._entries[n];let e=[];for(let n in this._entries)e.push(this._entries[n].bin);let{w:t,h:r}=tC(e),i=this._image;i.resize({width:t||1,height:r||1});for(let n in this._entries){let{bin:a}=this._entries[n],o=a.x+1,s=a.y+1,l=this._entries[n].image.data,u=l.width,c=l.height;Ye.copy(l,i,{x:0,y:0},{x:o,y:s},{width:u,height:c}),Ye.copy(l,i,{x:0,y:c-1},{x:o,y:s-1},{width:u,height:1}),Ye.copy(l,i,{x:0,y:0},{x:o,y:s+c},{width:u,height:1}),Ye.copy(l,i,{x:u-1,y:0},{x:o-1,y:s},{width:1,height:c}),Ye.copy(l,i,{x:0,y:0},{x:o+u,y:s},{width:1,height:c})}this._dirty=!0}},h_=1114111,kL={start:0,end:h_},zL=0;function FL(e){let t=/^u\+([0-9a-f]*)(\?+)$/i.exec(e);if(t){let[,n,a]=t;return n.length+a.length>6?null:I4(parseInt(`${n}${"0".repeat(a.length)}`,16),parseInt(`${n}${"f".repeat(a.length)}`,16))}let r=/^u\+([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?$/i.exec(e);if(!r)return null;let i=parseInt(r[1],16);return I4(i,r[2]===void 0?i:parseInt(r[2],16))}function I4(e,t){return e>t||e>h_?null:{start:e,end:Math.min(t,h_)}}function RL(e,t){return e.ranges.some(({start:r,end:i})=>t>=r&&t<=i)}var LL=class{constructor(e){this.requestManager=e,this._faces={},this._registered=new Set}setFontFaces(e){this._unregisterAll(),this._faces={};for(let[t,r]of Object.entries(e??{})){let i=Array.isArray(r)?r:[r];this._faces[t]=i.map(n=>this._declareFontFace(t,n)).filter(n=>n!==null)}}hasFontFaces(){return Object.keys(this._faces).length>0}async getFontFamily(e,t,r){var i,n;for(let a of e.split(","))for(let o of this._faces[a.trim()]??[]){if(!RL(o,t))continue;(i=o.loads).normal??(i.normal=this._loadFontFace(o,"normal"));let s=o.data,l=await o.loads.normal;if(l)return r==="normal"?l:((n=o.loads)[r]??(n[r]=this._loadFontFace(o,r,s)),o.loads[r])}return null}_declareFontFace(e,t){let r=typeof t=="string"?{url:t}:t;if(typeof r?.url!="string")return we(`Ignoring the font face declared for "${e}": it has no URL.`),null;let i=`maplibre-gl-font-face-${zL++}`,n=r["unicode-range"];if(!n?.length)return{url:r.url,ranges:[kL],family:i,loads:{}};let a=[];for(let o of n){let s=FL(o);s?a.push(s):we(`Ignoring the unicode range "${o}" of the font face at ${r.url}: it is not a valid range.`)}return a.length?{url:r.url,ranges:a,family:i,loads:{}}:null}async _loadFontFace(e,t,r){let i=t==="normal"?"font face":`font face with "${t}" enabled`;if(typeof FontFace>"u"||typeof document>"u"||!document.fonts)return we(`Ignoring the ${i} at ${e.url}: this environment has no CSS Font Loading API.`),null;let n;try{r||(r=(e.data??(e.data=this._downloadFontFile(e.url)),e.data));let a=t==="normal"?e.family:`${e.family}-${t}`;return n=new FontFace(a,await r,{featureSettings:t==="normal"?"normal":`"${t}" 1`}),!Object.values(this._faces).some(o=>o.includes(e))||t!=="normal"&&(!n.featureSettings||n.featureSettings==="normal")?null:(document.fonts.add(n),this._registered.add(n),await n.load(),this._registered.has(n)?a:null)}catch(a){return n&&this._unregister(n),we(`Ignoring the ${i} at ${e.url}: ${Xt(a).message}`),null}finally{e.data===r&&delete e.data}}async _downloadFontFile(e){let t=await this.requestManager.transformRequest(e,"Glyphs"),r=await CT(t,new AbortController);if(!r?.data)throw Error(`the response was empty for the font file at ${e}`);return r.data}_unregister(e){document.fonts?.delete(e),this._registered.delete(e)}_unregisterAll(){for(let e of Object.values(this._faces))for(let t of e)delete t.data;for(let e of this._registered)document.fonts?.delete(e);this._registered.clear()}destroy(){this._unregisterAll(),this._faces={}}},p_=1e20,vv=new Float64Array(256);for(let e=0;e<256;e++){let t=.5-(e/255)**.45454545454545453;vv[e]=t*Math.abs(t)}vv[255]=-1e20;var BL=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:i=.25,fontFamily:n="sans-serif",fontWeight:a="normal",fontStyle:o="normal",lang:s=null}={}){t=this.buffer=Math.round(t),this.radius=r,this.cutoff=i,this.lang=s;let l=this.size=Math.ceil(e)+t*4,u=this._createCanvas(l),c=this.ctx=u.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${e}px ${n}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",s&&(c.lang=s);let h=(this.maxGlyphDim=l-t)+2*t;this.gridOuter=new Float64Array(h*h),this.gridInner=new Float64Array(h*h),this.f=new Float64Array(h),this.z=new Float64Array(h+1),this.v=new Uint16Array(h)}_createCanvas(e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,e);let t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:i,actualBoundingBoxLeft:n,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(r),s=Math.floor(-n),l=Math.max(0,Math.min(this.maxGlyphDim,Math.ceil(a)-s)),u=Math.max(0,Math.min(this.maxGlyphDim,o+Math.ceil(i))),c=l+2*this.buffer,h=u+2*this.buffer,p=c*h,d=new Uint8ClampedArray(p),f={data:d,width:c,height:h,glyphWidth:l,glyphHeight:u,glyphTop:o,glyphLeft:s,glyphAdvance:t};if(l===0||u===0)return f;let{ctx:m,buffer:_,gridInner:g,gridOuter:y}=this;m.clearRect(_,_,l,u),m.fillText(e,_-s,_+o);let v=m.getImageData(_,_,l,u);y.fill(p_,0,p),g.fill(0,0,p);let x=3;for(let S=0;S<u;S++){let E=(S+_)*c+_;for(let P=0;P<l;P++,x+=4,E++){let D=v.data[x];if(D===0)continue;let F=vv[D];y[E]=Math.max(0,F),g[E]=Math.max(0,-F)}}k4(y,0,0,c,h,c,this.f,this.v,this.z,_);let b=Math.min(_,1);k4(g,_-b,_-b,l+2*b,u+2*b,c,this.f,this.v,this.z);let w=255/this.radius,T=255*(1-this.cutoff);for(let S=0;S<p;S++){let E=Math.sqrt(y[S])-Math.sqrt(g[S]);d[S]=T-w*E}return f}};function k4(e,t,r,i,n,a,o,s,l,u=0){for(let c=t+u;c<t+i-u;c++)z4(e,r*a+c,a,n,o,s,l);for(let c=r;c<r+n;c++)z4(e,c*a+t,1,i,o,s,l)}function z4(e,t,r,i,n,a,o){a[0]=0,o[0]=-1e20,o[1]=p_,n[0]=e[t];for(let s=1,l=0;s<i;s++){let u=n[s]=e[t+s*r],c=s*s,h;do{let p=a[l];h=(u-n[p]+c-p*p)/(s-p)/2}while(h<=o[l]&&--l>-1);l++,a[l]=s,o[l]=h,o[l+1]=p_}for(let s=0,l=0;s<i;s++){for(;o[l+1]<s;)l++;let u=a[l],c=s-u;e[t+s*r]=n[u]+c*c}}var OL=z.layout_symbol["text-font"].default.join(","),jL=(e,t)=>{let r=new BL(e);return r.buffer=t,r},F4={vertical:"vert"};function NL(e,t){return e.bitmap.width===t.bitmap.width&&e.bitmap.height===t.bitmap.height&&e.metrics.width===t.metrics.width&&e.metrics.height===t.metrics.height&&e.metrics.left===t.metrics.left&&e.metrics.top===t.metrics.top&&e.metrics.advance===t.metrics.advance&&e.bitmap.data.every((r,i)=>r===t.bitmap.data[i])}var VL=class{constructor(e,t,r,i=jL){this.rasterizedGlyphs=new WeakMap,this.requestManager=e,this.localIdeographFontFamily=t,this.entries={},this.lang=r,this.fontFaceManager=new LL(e),this.createRasterizer=i}setURL(e){this.url=e}setFontFaces(e){this.fontFaceManager.setFontFaces(e),this.entries={}}async getGlyphs(e){var a;let t=[],r=this.fontFaceManager.hasFontFaces();for(let o in e)for(let s in e[o])if(!F4[s]||r)for(let l of e[o][s])t.push(this._getAndCacheGlyphsPromise(o,l,s));let i=await Promise.all(t),n={};for(let{stack:o,id:s,variant:l,glyph:u}of i)n[o]||(n[o]={}),(a=n[o])[l]||(a[l]={}),n[o][l][s]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics};return n}async _getAndCacheGlyphsPromise(e,t,r){var l,u;(l=this.entries)[e]??(l[e]={glyphs:{default:{}},requests:{},ranges:{}});let i=this.entries[e],n=(u=i.glyphs)[r]||(u[r]={}),a=n[t];if(a!==void 0)return{stack:e,id:t,variant:r,glyph:a};if(r!=="default"){let c=F4[r];return a=c?await this._drawAlternateGlyph(i,e,t,c):null,n[t]=a,{stack:e,id:t,variant:r,glyph:a}}let o=t.codePointAt(0),s=this.fontFaceManager.hasFontFaces()?await this.fontFaceManager.getFontFamily(e,o,"normal"):null;return s?(a=await this._drawGlyph(i,e,t,s),n[t]=a,{stack:e,id:t,variant:r,glyph:a}):!this.url||uc(t)||this._charUsesLocalIdeographFontFamily(o)||RF(o)?(a=await this._drawGlyph(i,e,t),n[t]=a,{stack:e,id:t,variant:r,glyph:a}):{...await this._downloadAndCacheRangePromise(e,t),variant:r}}async _drawAlternateGlyph(e,t,r,i){let n=await this._getFontFaceTinySDF(e,t,r,i);if(!n||this.entries[t]!==e)return null;let a=n.draw(r);if(!a.glyphWidth||!a.glyphHeight)return null;let o=await this._getFontFaceTinySDF(e,t,r,"normal");if(!o||this.entries[t]!==e)return null;let s=this._createGlyph(r,a);return NL(this._getRasterizedGlyph(o,r),s)?null:s}async _downloadAndCacheRangePromise(e,t){var a;let r=t.codePointAt(0),i=this.entries[e],n=Math.floor(r/256);if(i.ranges[n])return{stack:e,id:t,glyph:null};(a=i.requests)[n]||(a[n]=this._loadGlyphRange(e,n));try{let o=await i.requests[n];for(let s in o)i.glyphs.default[String.fromCodePoint(+s)]=o[+s];return i.ranges[n]=!0,{stack:e,id:t,glyph:o[r]||null}}catch(o){let s=await this._drawGlyph(i,e,t);return i.glyphs.default[t]=s,this._warnOnMissingGlyphRange(s,n,r,Xt(o)),{stack:e,id:t,glyph:s}}}async _loadGlyphRange(e,t){let r=t*256,i=r+255,n=await this.requestManager.transformRequest(this.url.replace("{fontstack}",e).replace("{range}",`${r}-${i}`),"Glyphs"),a=await CT(n,new AbortController);if(!a?.data)throw Error(`Could not load glyph range. range: ${t}, ${r}-${i}`);let o={};for(let s of kR(a.data))o[s.id]=s;return o}_warnOnMissingGlyphRange(e,t,r,i){let n=t*256;we(`Unable to load glyph range ${t}, ${n}-${n+255}. Rendering codepoint U+${r.toString(16).padStart(4,"0").toUpperCase()} locally instead. ${i}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&LF(e)}async _drawGlyph(e,t,r,i){let n=await this._getTinySDF(e,t,r,i);return this._getRasterizedGlyph(n,r)}_getRasterizedGlyph(e,t){let r=this.rasterizedGlyphs.get(e);return r||(r={},this.rasterizedGlyphs.set(e,r)),r[t]??(r[t]=this._createGlyph(t,e.draw(t))),r[t]}_createGlyph(e,t){let r=/^\p{gc=Cf}+$/u.test(e);return{id:e.codePointAt(0),bitmap:new cv({width:t.width||60,height:t.height||60},t.data),metrics:{width:r?0:t.glyphWidth/2||24,height:t.glyphHeight/2||24,left:t.glyphLeft/2+.5||0,top:t.glyphTop/2-27.5||-8,advance:r?0:t.glyphAdvance/2||24,isDoubleResolution:!0}}}async _getFontFaceTinySDF(e,t,r,i){if(this.entries[t]!==e)return null;let n=await this.fontFaceManager.getFontFamily(t,r.codePointAt(0),i);return!n||this.entries[t]!==e?null:this._getTinySDF(e,t,r,n)}_getTinySDF(e,t,r,i){var l,u;let n=uc(r);if(i){let c=n?"clusterTinySDFs":"fontFaceTinySDFs";return e[c]??(e[c]={}),(l=e[c])[i]||(l[i]=this._createTinySDF(i,!1,n?3:1)),e[c][i]}let a=t===OL&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(r.codePointAt(0)),o=a?this.localIdeographFontFamily:t;if(n)return e.clusterTinySDFs??(e.clusterTinySDFs={}),(u=e.clusterTinySDFs)[o]||(u[o]=this._createTinySDF(o,!0,3)),e.clusterTinySDFs[o];let s=a?"ideographTinySDF":"tinySDF";return e[s]||(e[s]=this._createTinySDF(o)),e[s]}async _createTinySDF(e,t=!0,r=1){let i=e?e.split(","):[];i.push("sans-serif");let n=i.map(s=>/[-\w]+/.test(s)?s:`'${CSS.escape(s)}'`).join(","),a=t?this._fontWeight(i[0]):void 0,o=t?this._fontStyle(i[0]):"normal";if(typeof document<"u"&&document.fonts?.load)try{await document.fonts.load(`${o} ${a||"normal"} 48px ${n}`)}catch(s){we(`Failed to load font "${n}": ${Xt(s).message}`)}return this.createRasterizer({fontSize:48,buffer:Math.max(6,Math.ceil(48*(r-1)/4)),radius:16,cutoff:.25,fontFamily:n,fontWeight:a,fontStyle:o,lang:this.lang},6)}_fontStyle(e){return/italic/i.test(e)?"italic":/oblique/i.test(e)?"oblique":"normal"}_fontWeight(e){let t={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},r;for(let[i,n]of Object.entries(t))RegExp(`\\b${i}\\b`,"i").test(e)&&(r=`${n}`);return r}destroy(){for(let e in this.entries){let t=this.entries[e];t.tinySDF=null,t.ideographTinySDF=null,t.fontFaceTinySDFs={},t.glyphs={default:{}},t.requests={},t.ranges={}}this.entries={},this.fontFaceManager.destroy()}},R4,UL=()=>R4||(R4=new Kt({anchor:new $(z.light.anchor,"anchor"),position:new $(z.light.position,"position"),color:new $(z.light.color,"color"),intensity:new $(z.light.intensity,"intensity")})),$L=class extends lr{constructor(e,t){super(),this._transitionable=new gf(UL(),"light",t),this.setLight(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Re(0))}getLight(){return this._transitionable.serialize()}getEvaluated(){return{anchor:this.properties.get("anchor"),position:this.properties.get("position"),color:this.properties.get("color"),intensity:this.properties.get("intensity")}}setLight(e,t={}){this._validate(Br.light,e,t)||this._transitionable.setValues(e)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}applyGlobalStateChange(e,t,r){this._transitioning=this._transitionable.applyGlobalStateChange(e,t,this._transitioning,r)}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,r){return vc(this,e,{value:t},r)}},L4,qL=()=>L4||(L4=new Kt({"sky-color":new $(z.sky["sky-color"],"sky-color"),"horizon-color":new $(z.sky["horizon-color"],"horizon-color"),"fog-color":new $(z.sky["fog-color"],"fog-color"),"fog-ground-blend":new $(z.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new $(z.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new $(z.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new $(z.sky["atmosphere-blend"],"atmosphere-blend")})),GL=class extends lr{constructor(e,t){super(),this._transitionable=new gf(qL(),"sky",t),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Re(0))}setSky(e,t={}){return!this._validate(Br.sky,e,t)&&(e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0}),this._transitionable.setValues(e),!0)}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}applyGlobalStateChange(e,t,r){this._transitioning=this._transitionable.applyGlobalStateChange(e,t,this._transitioning,r)}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,r={}){return vc(this,e,{value:t},r)}getEvaluated(){return{"sky-color":this.properties.get("sky-color"),"horizon-color":this.properties.get("horizon-color"),"fog-color":this.properties.get("fog-color"),"fog-ground-blend":this.properties.get("fog-ground-blend"),"horizon-fog-blend":this.properties.get("horizon-fog-blend"),"sky-horizon-blend":this.properties.get("sky-horizon-blend"),"atmosphere-blend":this.properties.get("atmosphere-blend")}}};function ZL(e){return e<60?0:e<70?(e-60)/10:1}var HL=class{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){var i;let r=e.join(",")+String(t);return(i=this.dashEntry)[r]||(i[r]=this.addDash(e,t)),this.dashEntry[r]}getDashRanges(e,t,r){let i=e.length%2==1,n=[],a=i?-e[e.length-1]*r:0,o=e[0]*r,s=!0;n.push({left:a,right:o,isDash:s,zeroLength:e[0]===0});let l=e[0];for(let u=1;u<e.length;u++){s=!s;let c=e[u];a=l*r,l+=c,o=l*r,n.push({left:a,right:o,isDash:s,zeroLength:c===0})}return n}addRoundDash(e,t,r){let i=t/2;for(let n=-r;n<=r;n++){let a=this.nextRow+r+n,o=this.width*a,s=0,l=e[s];for(let u=0;u<this.width;u++){u/l.right>1&&(l=e[++s]);let c=Math.abs(u-l.left),h=Math.abs(u-l.right),p=Math.min(c,h),d,f=n/r*(i+1);if(l.isDash){let m=i-Math.abs(f);d=Math.sqrt(p*p+m*m)}else d=i-Math.sqrt(p*p+f*f);this.data[o+u]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let o=e.length-1;o>=0;--o){let s=e[o],l=e[o+1];s.zeroLength?e.splice(o,1):l?.isDash===s.isDash&&(l.left=s.left,e.splice(o,1))}let t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);let i=this.width*this.nextRow,n=0,a=e[n];for(let o=0;o<this.width;o++){o/a.right>1&&(a=e[++n]);let s=Math.abs(o-a.left),l=Math.abs(o-a.right),u=Math.min(s,l),c=a.isDash?u:-u;this.data[i+o]=Math.max(0,Math.min(255,c+128))}}addDash(e,t){let r=t?7:0,i=2*r+1;if(this.nextRow+i>this.height)return we("LineAtlas out of space"),null;let n=0;for(let o of e)n+=o;if(n!==0){let o=this.width/n,s=this.getDashRanges(e,this.width,o);t?this.addRoundDash(s,o,r):this.addRegularDash(s)}let a={y:this.nextRow+r,height:2*r,width:n};return this.nextRow+=i,this.dirty=!0,a}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}},WL=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>this._invoke()}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0),setTimeout(()=>this._invoke(),0))}_invoke(){this._triggered&&(this._triggered=!1,this._methodToThrottle())}remove(){delete this._channel,this._methodToThrottle=()=>{}}},YL={once:!0},XL=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new WL(()=>this.process()),this.subscription=bd(this.target,"message",r=>this.receive(r),!1),this.globalScope=Gs(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=t?bd(t.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new pc(t.signal.reason))},YL):null;this.resolveRejects[n]={resolve:l=>{a?.unsubscribe(),r(l)},reject:l=>{a?.unsubscribe(),i(l)}};let o=[],s={...e,id:n,sourceMapId:this.mapId,origin:location.origin,data:Ou(e.data,o)};this.target.postMessage(s,{transfer:o})})}receive(e){let t=e.data,r=t.id,i=["file://","resource://android","null"],n=[t.origin,location.origin],a=t.origin===location.origin,o=n.some(s=>i.includes(s));if((a||o)&&!(t.targetMapId&&this.mapId!==t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];let s=this.abortControllers[r];delete this.abortControllers[r],s&&s.abort()}else Gs(self)||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}async processTask(e,t){if(t.type==="<response>"){let n=this.resolveRejects[e];if(delete this.resolveRejects[e],!n)return;t.error?n.reject(Xt(ju(t.error))):n.resolve(ju(t.data));return}if(!this.messageHandlers[t.type]){this.completeTask(e,null,null);return}let r=ju(t.data),i=new AbortController;this.abortControllers[e]=i;try{let n=await this.messageHandlers[t.type](t.sourceMapId,r,i);this.completeTask(e,null,n)}catch(n){this.completeTask(e,Xt(n))}}completeTask(e,t,r){let i=[];delete this.abortControllers[e];let n={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?Ou(t):null,data:Ou(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function KL(e){if(!e)return!1;let t=globalThis.location;if(!t)return!1;try{return new URL(e,t.href).origin!==t.origin}catch{return!1}}function QL(){let e=import.meta.url;if(!/^https?:/.test(e))return"";let t=e.endsWith("-dev.mjs")?"maplibre-gl-worker-dev.mjs":"maplibre-gl-worker.mjs",r=new URL(`./${t}`,e);return r.searchParams.set("v",pT),r.href}function JL(e){return e.endsWith(".cjs")||e.split(/[?#]/)[0].endsWith(".cjs")}function T1(e,t){if(t)try{return new Worker(e,{type:"module"})}catch(r){console.warn("Module worker not supported, falling back to classic worker",r)}return new Worker(e)}async function eB(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch worker script (${t.status}): ${e}`);let r=await t.text(),i=new Blob([r],{type:"text/javascript"});return URL.createObjectURL(i)}function tB(e){let t=new Blob([`import ${JSON.stringify(new URL(e,import.meta.url).href)}`],{type:"text/javascript"});return URL.createObjectURL(t)}async function rB(){let e=bo.WORKER_URL||QL(),t=!JL(e);if(!KL(e))return T1(e,t);if(t){let i=tB(e);try{return T1(i,t)}finally{URL.revokeObjectURL(i)}}let r=await eB(e);try{return T1(r,t)}finally{URL.revokeObjectURL(r)}}var iB="maplibre_preloaded_worker_pool",TC=class SC{constructor(){this.active={},this.workersPromise=null}async acquire(t){if(this.active[t]=!0,!this.workersPromise){let r=[];for(;r.length<SC.workerCount;)r.push(rB());this.workersPromise=Promise.all(r)}return(await this.workersPromise).slice()}release(t){if(delete this.active[t],this.numActive()===0&&this.workersPromise){let r=this.workersPromise;this.workersPromise=null,r.then(i=>{for(let n of i)n.terminate()})}}isPreloaded(){return!!this.active[iB]}numActive(){return Object.keys(this.active).length}},nB=Math.floor(Nr.hardwareConcurrency/2);TC.workerCount=AI(globalThis)?Math.max(Math.min(nB,3),1):1;var S1;function EC(){return S1||(S1=new TC),S1}var CC=class extends lr{constructor(e,t){super(),this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t,this.removed=!1,this.workerErrorSubscriptions=[],this.actorsPromise=this.initActors(t)}async initActors(e){let t=await this.workerPool.acquire(e);if(this.removed)return[];if(this.actors=t.map((r,i)=>{this.workerErrorSubscriptions.push(bd(r,"error",()=>{this.fire(new ee(Error("Worker failed to load. Check that the worker URL is correct.")))},!1));let n=new XL(r,e);return n.name=`Worker ${i}`,n}),!this.actors.length)throw Error("No actors found");return this.actors}async broadcast(e,t){let r=await this.actorsPromise;return Promise.all(r.map(i=>i.sendAsync({type:e,data:t})))}async getActor(){let e=await this.actorsPromise;return this.currentActor=(this.currentActor+1)%e.length,e[this.currentActor]}async waitForInitComplete(){this.actors.length===0&&await this.actorsPromise}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.removed=!0;for(let t of this.actors)t.remove();for(let t of this.workerErrorSubscriptions)t.unsubscribe();this.actors=[],this.workerErrorSubscriptions=[],this.setEventedParent(null),e&&this.workerPool.release(this.id)}async registerMessageHandler(e,t){let r=await this.actorsPromise;for(let i of r)i.registerMessageHandler(e,t)}async unregisterMessageHandler(e){let t=await this.actorsPromise;for(let r of t)r.unregisterMessageHandler(e)}},Gp;function aB(){return Gp||(Gp=new CC(EC(),J1),Gp.registerMessageHandler("GR",(e,t,r)=>Jd(t,r))),Gp}function oB(e,t){let r=Do();At(r,r,[1,1,0]),gr(r,r,[e.width*.5,e.height*.5,1]);let i=e.getFastPathSimpleProjectionMatrix(t);return i?Es(r,r,i):r}function sB(e,t,r){if(e)for(let i of e){let n=t[i];if(n?.source===r&&n.type==="fill-extrusion")return!0}else for(let i in t){let n=t[i];if(n.source===r&&n.type==="fill-extrusion")return!0}return!1}function lB(e,t,r,i,n,a,o){let s=sB(n?.layers??null,t,e.id),l=a.maxPitchScaleFactor(),u=e.tilesIn(i,l,s);u.sort(PC);let c=[];for(let h of u)c.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(t,r,e.getState(),h.queryGeometry,h.cameraQueryGeometry,h.scale,n,a,l,oB(a,h.tileID),o?(p,d)=>o(h.tileID,p,d):void 0)});return pB(hB(c),e)}function uB(e,t,r,i,n,a,o){let s={},l=a.queryRenderedSymbols(i),u=[];for(let c of Object.keys(l).map(Number))u.push(o[c]);u.sort(PC);for(let c of u){let h=c.featureIndex.lookupSymbolFeatures(l[c.bucketInstanceId],t,c.bucketIndex,c.sourceLayerIndex,{filterSpec:n.filter,globalState:n.globalState,worldCoordinateHelper:a.transform.worldCoordinateHelper},n.layers,n.availableImages,e);for(let p in h){s[p]||(s[p]=[]);let d=h[p];d.sort((f,m)=>{let _=c.featureSortOrder;if(_){let g=_.indexOf(f.featureIndex);return _.indexOf(m.featureIndex)-g}return m.featureIndex-f.featureIndex});for(let f of d)s[p].push(f)}}return dB(s,e,r)}function cB(e,t){let r=e.getRenderableIds().map(a=>e.getTileByID(a)),i=[],n={};for(let a of r){let o=a.tileID.canonical.key;n[o]||(n[o]=!0,a.querySourceFeatures(i,t))}return i}function PC(e,t){let r=e.tileID,i=t.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}function hB(e){let t={},r={};for(let{queryResults:i,wrappedTileID:n}of e){r[n]||(r[n]={});let a=r[n];for(let o in i){let s=i[o];a[o]||(a[o]={});let l=a[o];t[o]||(t[o]=[]);for(let u of s)l[u.featureIndex]||(l[u.featureIndex]=!0,t[o].push(u))}}return t}function pB(e,t){for(let r in e)for(let i of e[r])DC(i,t);return e}function dB(e,t,r){for(let i in e)for(let n of e[i]){let a=r[t[i].source];DC(n,a)}return e}function DC(e,t){let r=e.feature,i=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}async function AC(e,t,r,i){let n=e;if(e.url?n=(await ef(await t.transformRequest(e.url,"Source"),r)).data:await Nr.frameAsync(r,i),!n)return null;let a=Qd(J(n,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in n&&n.vector_layers&&(a.vectorLayerIds=n.vector_layers.map(o=>o.id)),a}var Zn=class Fn{constructor(t,r){t&&(r?this.setSouthWest(t).setNorthEast(r):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof H?new H(t.lng,t.lat):H.convert(t),this}setSouthWest(t){return this._sw=t instanceof H?new H(t.lng,t.lat):H.convert(t),this}extend(t){let r=this._sw,i=this._ne,n,a;if(t instanceof H)n=t,a=t;else if(t instanceof Fn){if(n=t._sw,a=t._ne,!n||!a)return this}else{if(Array.isArray(t)){if(t.length===4||t.every(Array.isArray)){let o=t;return this.extend(Fn.convert(o))}{let o=t;return this.extend(H.convert(o))}}return t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(H.convert(t)):this}return!r&&!i?(this._sw=new H(n.lng,n.lat),this._ne=new H(a.lng,a.lat)):(r.lng=Math.min(n.lng,r.lng),r.lat=Math.min(n.lat,r.lat),i.lng=Math.max(a.lng,i.lng),i.lat=Math.max(a.lat,i.lat)),this}getCenter(){return new H((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 H(this.getWest(),this.getNorth())}getSouthEast(){return new H(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(t){let{lng:r,lat:i}=H.convert(t),n=this._sw.lat<=i&&i<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),n&&a}intersects(t){if(t=Fn.convert(t),!(t.getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let r=Math.abs(this.getEast()-this.getWest()),i=Math.abs(t.getEast()-t.getWest());if(r>=360||i>=360)return!0;let n=xi(this.getWest(),-180,180),a=xi(this.getEast(),-180,180),o=xi(t.getWest(),-180,180),s=xi(t.getEast(),-180,180),l=n>a,u=o>s;return l&&u?!0:l?s>=n||o<=a:u?a>=o||n<=s:o<=a&&s>=n}static convert(t){return t instanceof Fn||!t?t:new Fn(t)}static fromLngLat(t,r=0){let i=360*r/40075017,n=i/Math.cos(Math.PI/180*t.lat);return new Fn(new H(t.lng-n,t.lat-i),new H(t.lng+n,t.lat+i))}adjustAntiMeridian(){let t=new H(this._sw.lng,this._sw.lat),r=new H(this._ne.lng,this._ne.lat);return t.lng>r.lng?new Fn(t,new H(r.lng+360,r.lat)):new Fn(t,r)}},MC=class{constructor(e,t,r,i){this.bounds=Zn.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=r||24,this._worldBox=$E(i,this.bounds.getWest(),this.bounds.getSouth(),this.bounds.getEast(),this.bounds.getNorth())}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let t=2**e.z,r={minX:Math.floor(this._worldBox.minX*t),minY:Math.floor(this._worldBox.minY*t),maxX:Math.ceil(this._worldBox.maxX*t),maxY:Math.ceil(this._worldBox.maxY*t)};return e.x>=r.minX&&e.x<r.maxX&&e.y>=r.minY&&e.y<r.maxY}},fB=class extends lr{constructor(e,t,r,i){if(super(),this.id=e,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,J(this,Qd(t,["url","scheme","tileSize","promoteId","encoding"])),this._options=J({type:"vector"},t),this._collectResourceTiming=t.collectResourceTiming,this.tileSize!==512)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}async load(e=!1){this._loaded=!1,this.fire(new et("dataloading")),this._tileJSONRequest=new AbortController;try{let t=await AC(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(J(this,t),t.bounds&&(this.tileBounds=new MC(t.bounds,this.minzoom,this.maxzoom,this.map.style.projection.worldCoordinateHelper)),this.fire(new et("data",{sourceDataType:"metadata"})),this.fire(new et("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,Ra(t)||this.fire(new ee(Xt(t)))}}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}serialize(){return J({},this._options)}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme,this.map.style.projection.worldCoordinateHelper.tileMatrixSet),r={request:await this.map._requestManager.transformRequest(t,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:await this._getOverzoomParameters(e),etag:e.etag};if(r.request.collectResourceTiming=this._collectResourceTiming,await this.dispatcher.waitForInitComplete(),e.aborted)return;let i="RT";if(!e.actor||e.state==="expired")e.actor=this.dispatcher.getReadyActor(),i="LT";else if(e.state==="loading")return new Promise((n,a)=>{e.reloadPromise={resolve:n,reject:a}});e.abortController=new AbortController;try{let n=await e.actor.sendAsync({type:i,data:r},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,n);let a={};return n?.etagUnmodified&&(a.unmodified=!0),a}catch(n){if(delete e.abortController,e.aborted||Ra(n))return;if(n&&n.status!==404)throw n;this._afterTileLoadWorkerResponse(e,null)}}async _getOverzoomParameters(e){if(e.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let t=e.tileID.scaledTo(this.maxzoom).canonical,r=t.url(this.tiles,this.map.getPixelRatio(),this.scheme,this.map.style.projection.worldCoordinateHelper.tileMatrixSet);return{maxZoomTileID:t,overzoomRequest:await this.map._requestManager.transformRequest(r,"Tile")}}_afterTileLoadWorkerResponse(e,t){if(t?.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.etag=t?.etag,e.loadVectorData(t,this.map.style),e.reloadPromise){let r=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(r.resolve).catch(r.reject)}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&await e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}})}async unloadTile(e){e.unloadVectorData(),e.actor&&await e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}hasTransition(){return!1}},IC=class extends lr{constructor(e,t,r,i){super(),this.id=e,this.dispatcher=r,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=J({type:"raster"},t),J(this,Qd(t,["url","scheme","tileSize"]))}async load(e=!1){this._loaded=!1,this.fire(new et("dataloading")),this._tileJSONRequest=new AbortController;try{let t=await AC(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(J(this,t),t.bounds&&(this.tileBounds=new MC(t.bounds,this.minzoom,this.maxzoom,this.map.style.projection.worldCoordinateHelper)),this.fire(new et("data",{sourceDataType:"metadata"})),this.fire(new et("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,Ra(t)||this.fire(new ee(Xt(t)))}}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null)),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return J({},this._options)}setPremultiplyAlpha(e){return this._premultiplyAlpha===e||this.setSourceProperty(()=>{this._premultiplyAlpha=e}),this}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme,this.map.style.projection.worldCoordinateHelper.tileMatrixSet),r=this._premultiplyAlpha,i=r?void 0:{premultiplyAlpha:"none"};e.abortController=new AbortController;try{let n=await Vi.transformAndGetImage(this.map._requestManager,t,"Tile",e.abortController,this.map._refreshExpiredTiles,i);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(n){this.map._refreshExpiredTiles&&(n.cacheControl||n.expires)&&e.setExpiryData({cacheControl:n.cacheControl,expires:n.expires});let a=this.map.painter.context,o=a.gl,s=n.data??new Ye({width:1,height:1},new Uint8Array(4));e.texture=this.map.painter.getTileTexture(s.width),e.texture?e.texture.update(s,{useMipmap:!0,premultiply:r}):(e.texture=new Ot(a,s,o.RGBA,{useMipmap:!0,premultiply:r}),e.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(n){if(delete e.abortController,e.aborted)e.state="unloaded";else if(n)throw e.state="errored",n}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController)}async unloadTile(e){e.texture&&this.map.painter.saveTileTexture(e.texture)}hasTransition(){return!1}};function mB(e,t,r){return!(e<0||e>25||r<0||r>=2**e||t<0||t>=2**e)}function E1(e,t,r){let{x:i,y:n}=r.worldFromLngLat(t.lng,t.lat);return!(e<0||e>25||n<0||n>=1||i<0||i>=1)}var Cf=class{constructor(e,t,r){if(!mB(e,t,r))throw Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=r,this.key=Ns(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r,i=Ky){let n=gB(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,()=>B4(this.x,this.y,this.z,Ky)).replace(/{bbox}/g,()=>B4(this.x,this.y,this.z,i))}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new k((e.x*t-this.x)*R,(e.y*t-this.y)*R)}toString(){return`${this.z}/${this.x}/${this.y}`}},Gd=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Ns(e,t.z,t.z,t.x,t.y)}},ir=class _i{constructor(t,r,i,n,a){if(this.terrainRttPosMatrix32f=null,t<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=r,this.canonical=new Cf(i,+n,+a),this.key=Ns(r,t,i,n,a)}clone(){return new _i(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?new _i(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new _i(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,r){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-t;return t>this.canonical.z?Ns(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):Ns(this.wrap*+r,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(t.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-t.canonical.z;return r<0?!1:t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new _i(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new _i(r,this.wrap,r,i,n),new _i(r,this.wrap,r,i+1,n),new _i(r,this.wrap,r,i,n+1),new _i(r,this.wrap,r,i+1,n+1)]}isLessThan(t){return this.wrap<t.wrap?!0:this.wrap>t.wrap?!1:this.overscaledZ<t.overscaledZ?!0:this.overscaledZ>t.overscaledZ?!1:this.canonical.x<t.canonical.x?!0:this.canonical.x>t.canonical.x?!1:this.canonical.y<t.canonical.y}wrapped(){return new _i(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new _i(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Gd(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new sr(t.x-this.wrap,t.y))}normalizeCoordinates(t,r,i=R){if(t>=0&&t<i&&r>=0&&r<i)return{tileID:this,x:t,y:r};let n=Math.floor(t/i),a=Math.floor(r/i),o=t-n*i,s=r-a*i,l=this.canonical.z,u=1<<l,c=this.canonical.y+a;if(c<0||c>=u)return null;let h=this.canonical.x+n,p=this.wrap;return h<0?(p-=Math.ceil(-h/u),h=(h%u+u)%u):h>=u&&(p+=Math.floor(h/u),h%=u),{tileID:new _i(this.overscaledZ,p,l,h,c),x:o,y:s}}};function Ns(e,t,r,i,n){e*=2,e<0&&(e=e*-1-1);let a=1<<r;return(a*a*e+a*n+i).toString(36)+r.toString(36)+t.toString(36)}function B4(e,t,r,i){let n=2**r,a=i.extentAtZoom0/n,[o,s]=i.origin,l=s-i.extentAtZoom0,u=n-t-1;return`${o+e*a},${l+u*a},${o+(e+1)*a},${l+(u+1)*a}`}function gB(e,t,r){let i="";for(let n=e;n>0;n--){let a=1<<n-1;i+=(t&a?1:0)+(r&a?2:0)}return i}function O4(e,t){let r=Math.abs(e.wrap*2)-+(e.wrap<0),i=Math.abs(t.wrap*2)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||i-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}G("CanonicalTileID",Cf),G("OverscaledTileID",ir,{omit:["terrainRttPosMatrix32f"]});var yB=class extends IC{constructor(e,t,r,i){super(e,t,r,i),this.type="raster-dem",this.maxzoom=22,this._options=J({type:"raster-dem"},t),this.encoding=t.encoding||"mapbox",this.redFactor=t.redFactor,this.greenFactor=t.greenFactor,this.blueFactor=t.blueFactor,this.baseShift=t.baseShift}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme,this.map.style.projection.worldCoordinateHelper.tileMatrixSet);e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let r=await Vi.transformAndGetImage(this.map._requestManager,t,"Tile",e.abortController,this.map._refreshExpiredTiles,{colorSpaceConversion:"none"});if(delete e.abortController,e.aborted){e.state="unloaded";return}if(r){if(this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires}),!r.data){e.state="loaded";return}let i=r.data,n=fo(i)&&M_()?i:await this.readImageNow(i),a={type:this.type,uid:e.uid,source:this.id,rawImageData:n,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&e.state!=="expired"&&e.state!=="reloading")return;await this.dispatcher.waitForInitComplete(),(!e.actor||e.state==="expired")&&(e.actor=this.dispatcher.getReadyActor()),e.dem=await e.actor.sendAsync({type:"LDT",data:a}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0,e.state="loaded"}}catch(r){if(delete e.abortController,e.aborted)e.state="unloaded";else if(r)throw e.state="errored",r}}async readImageNow(e){if(typeof VideoFrame<"u"&&dT()){let t=e.width+4,r=e.height+4;try{return new Ye({width:t,height:r},await zI(e,-2,-2,t,r))}catch{}}return Nr.getImageData(e,2)}_getNeighboringTiles(e){let t=e.canonical,r=2**t.z,i=(t.x-1+r)%r,n=t.x===0?e.wrap-1:e.wrap,a=(t.x+1+r)%r,o=t.x+1===r?e.wrap+1:e.wrap,s={};return s[new ir(e.overscaledZ,n,t.z,i,t.y).key]={backfilled:!1},s[new ir(e.overscaledZ,o,t.z,a,t.y).key]={backfilled:!1},t.y>0&&(s[new ir(e.overscaledZ,n,t.z,i,t.y-1).key]={backfilled:!1},s[new ir(e.overscaledZ,e.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},s[new ir(e.overscaledZ,o,t.z,a,t.y-1).key]={backfilled:!1}),t.y+1<r&&(s[new ir(e.overscaledZ,n,t.z,i,t.y+1).key]={backfilled:!1},s[new ir(e.overscaledZ,e.wrap,t.z,t.x,t.y+1).key]={backfilled:!1},s[new ir(e.overscaledZ,o,t.z,a,t.y+1).key]={backfilled:!1}),s}async unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&await e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}})}};function Zd(e,t){return t?e.properties[t]:e.id}function _B(e,t){let r=new Map;if(e==null||e.type==null)return r;if(e.type==="Feature"){let i=Zd(e,t);return i==null?void 0:(r.set(i,e),r)}if(e.type==="FeatureCollection"){let i=new Set;for(let n of e.features){let a=Zd(n,t);if(a==null||i.has(a))return;i.add(a),r.set(a,n)}return r}}function vB(e,t,r){let i=[];if(t.removeAll)e.clear();else if(t.remove)for(let n of t.remove){let a=e.get(n);a&&(i.push(a.geometry),e.delete(n))}if(t.add)for(let n of t.add){let a=Zd(n,r);if(a==null)continue;let o=e.get(a);o&&i.push(o.geometry),i.push(n.geometry),e.set(a,n)}if(t.update)for(let n of t.update){let a=e.get(n.id);if(!a)continue;let o=!!n.newGeometry,s=n.removeAllProperties||n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0;if(!o&&!s)continue;i.push(a.geometry);let l={...a};if(e.set(n.id,l),o&&(i.push(n.newGeometry),l.geometry=n.newGeometry),s){if(l.properties=n.removeAllProperties?{}:{...l.properties||{}},n.removeProperties)for(let u of n.removeProperties)delete l.properties[u];if(n.addOrUpdateProperties)for(let{key:u,value:c}of n.addOrUpdateProperties)l.properties[u]=c}}return i}function xB(e,t,r){if(!e)return t||{};if(!t)return e||{};let i=j4(e,r),n=j4(t,r);bB(i,n);let a={};if((i.removeAll||n.removeAll)&&(a.removeAll=!0),a.remove=new Set([...i.remove,...n.remove]),a.add=new Map([...i.add,...n.add]),a.update=new Map([...i.update,...n.update]),a.remove.size&&a.add.size)for(let o of a.add.keys())a.remove.delete(o);return TB(a)}function bB(e,t){t.removeAll&&(e.add.clear(),e.update.clear(),e.remove.clear(),t.remove.clear());for(let r of t.remove)e.add.delete(r),e.update.delete(r);for(let[r,i]of t.update){let n=e.update.get(r);n&&(t.update.set(r,wB(n,i)),e.update.delete(r))}}function wB(e,t){let r={id:e.id};if(t.removeAllProperties&&(delete e.removeProperties,delete e.addOrUpdateProperties,delete t.removeProperties),t.removeProperties&&e.addOrUpdateProperties){let i=new Set(t.removeProperties);e.addOrUpdateProperties=e.addOrUpdateProperties.filter(n=>!i.has(n.key))}return(e.removeAllProperties||t.removeAllProperties)&&(r.removeAllProperties=!0),(e.removeProperties||t.removeProperties)&&(r.removeProperties=[...e.removeProperties||[],...t.removeProperties||[]]),(e.addOrUpdateProperties||t.addOrUpdateProperties)&&(r.addOrUpdateProperties=[...e.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(e.newGeometry||t.newGeometry)&&(r.newGeometry=t.newGeometry||e.newGeometry),r}function j4(e,t){if(!e)return{};let r={};return r.removeAll=e.removeAll,r.remove=new Set(e.remove||[]),r.add=new Map(e.add?.map(i=>[Zd(i,t),i])),r.update=new Map(e.update?.map(i=>[i.id,i])),r}function TB(e){let t={};return e.removeAll&&(t.removeAll=e.removeAll),e.remove&&(t.remove=Array.from(e.remove)),e.add&&(t.add=Array.from(e.add.values())),e.update&&(t.update=Array.from(e.update.values())),t}function kC(e){return!e||e.length===0?[]:typeof e[0]=="number"?[e]:e.flatMap(t=>kC(t))}function cd(e){return e.type==="GeometryCollection"?e.geometries.flatMap(t=>cd(t)):kC(e.coordinates)}function N4(e){let t=new Zn,r;switch(e.type){case"FeatureCollection":r=e.features.flatMap(i=>cd(i.geometry));break;case"Feature":r=cd(e.geometry);break;default:r=cd(e)}if(r.length===0)return t;for(let i of r){let[n,a]=i;t.extend([n,a])}return t}function SB({x:e,y:t,z:r},i,n){let a=2**r,{west:o,south:s,east:l,north:u}=eF(n,(e-i)/a,(t-i)/a,(e+1+i)/a,(t+1+i)/a);return new Zn([o,s],[l,u])}var EB=class{constructor(e){this._waiting=[],this._sending=!1,this._replacedWhileSending=!1,this._handlers=e}isIdle(){return!this._sending&&this._waiting.length===0}top(){return this._waiting.length?this._waiting[this._waiting.length-1]:void 0}some(e){return this._waiting.some(e)}enqueue(e){this._waiting.push(e)}replace(e){this._waiting=[e],this._replacedWhileSending=this._sending}clear(){this._waiting=[]}flush(){if(this.isIdle())return Promise.resolve();if(!this._flushing){let t,r=new Promise(i=>{t=i});this._flushing={promise:r,resolve:t}}let{promise:e}=this._flushing;return this._next(),e}_next(){if(this._sending)return;let e=this._waiting.shift();e===void 0?(this._flushing?.resolve(),this._flushing=void 0):(this._sending=!0,this._replacedWhileSending=!1,this._send(e).finally(()=>this._next()))}async _send(e){let t;try{t=await this._handlers.send(e)}catch(r){this._sending=!1,this._handlers.onError(e,r);return}this._sending=!1;try{this._handlers.onResult(e,t,this._replacedWhileSending)}catch(r){this._handlers.onError(e,r)}}},CB=class{constructor(e){this.wraps=!1,this._crs=e,this._originX=e.tileMatrixSet.origin[0],this._originY=e.tileMatrixSet.origin[1],this._extent=e.tileMatrixSet.extentAtZoom0}get name(){return this._crs.name}get tileMatrixSet(){return this._crs.tileMatrixSet}worldFromLngLat(e,t,r){let[i,n]=this._crs.projection.forward([e,t]);return new sr((i-this._originX)/this._extent,(this._originY-n)/this._extent,r===void 0?0:r/this._extent)}lngLatFromWorld(e,t){let r=Q(e,0,1),i=Q(t,0,1),n=this._inverse(e,t)??this._inverse(r,i)??this._inverseTowardCenter(r,i)??this._finiteInverse(r,i);if(!n)throw Error(`The inverse of the projection "${this._crs.name}" has no answer inside its tile matrix set.`);return new H(n[0],Q(n[1],-90,90))}hasLngLat(e,t){return this._inverse(e,t)!==null}_inverse(e,t){let r=this._finiteInverse(e,t);if(!r)return null;let i=this._originX+e*this._extent,n=this._originY-t*this._extent,[a,o]=this._crs.projection.forward(r);return Math.hypot(a-i,o-n)<=.001*this._extent?r:null}_finiteInverse(e,t){let r;try{r=this._crs.projection.inverse([this._originX+e*this._extent,this._originY-t*this._extent])}catch{return null}return r&&Number.isFinite(r[0])&&Number.isFinite(r[1])?r:null}_inverseTowardCenter(e,t){let r=0,i=1;for(let n=0;n<30;n++){let a=(r+i)/2;this._inverse(.5+(e-.5)*a,.5+(t-.5)*a)?r=a:i=a}return this._inverse(.5+(e-.5)*r,.5+(t-.5)*r)}metersPerWorldUnit(e,t){return this._extent}worldZFromAltitude(e,t){return e/this._extent}get latitudeRange(){return this._latitudeRange??(this._latitudeRange=[this._findLatitudeLimit(-90),this._findLatitudeLimit(90)]),this._latitudeRange}_findLatitudeLimit(e){let t=this.lngLatFromWorld(.5,.5),r=10*this._meridianStretch(t.lng,t.lat);if(!(r>0))return e;let i=Math.sign(e-t.lat);for(let n=t.lat;Math.abs(e-n)>1;n+=i)if(!(this._meridianStretch(t.lng,n+i)<=r))return n;return e}_meridianStretch(e,t){let[r,i]=this._crs.projection.forward([e,t]),[n,a]=this._crs.projection.forward([e,t>=0?t-.01:t+.01]);return Math.hypot(n-r,a-i)}},PB=class{forward(e){return[e[0],e[1]]}inverse(e){return[e[0],e[1]]}},d_=new class{constructor(){this.name="identity",this.projection=new PB,this.tileMatrixSet={origin:[-90,90],extentAtZoom0:180}}},DB=new Map([[d_.name,d_]]);function Pf(e){return typeof e=="string"?DB.get(e):void 0}var AB=class extends lr{constructor(e,t,r,i){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._workerUpdates=new EB({send:n=>this._sendWorkerUpdate(n),onResult:(n,a,o)=>this._onWorkerUpdateResult(n,a,o),onError:(n,a)=>this._onWorkerUpdateError(a)}),t.data!==void 0&&this._workerUpdates.enqueue({data:t.data}),this.actorPromise=r.getActor(),this.setEventedParent(i),this._data=typeof t.data=="string"?{url:t.data}:{geojson:t.data},this._options=J({},t),this._collectResourceTiming=t.collectResourceTiming,t.maxzoom!==void 0&&(this.maxzoom=t.maxzoom),t.type&&(this.type=t.type),t.attribution&&(this.attribution=t.attribution),this.promoteId=t.promoteId,t.clusterMaxZoom!==void 0&&this.maxzoom<=t.clusterMaxZoom&&we(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${t.clusterMaxZoom}".`),this.workerOptions=J({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(t.buffer===void 0?128:t.buffer),tolerance:this._pixelsToTileUnits(t.tolerance===void 0?.375:t.tolerance),extent:R,maxZoom:this.maxzoom,lineMetrics:t.lineMetrics||!1,generateId:t.generateId||!1,promoteId:this._promoteIdKey,cluster:t.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(t.clusterMaxZoom),minPoints:Math.max(2,t.clusterMinPoints||2),extent:R,radius:this._pixelsToTileUnits(t.clusterRadius||50),log:!1,generateId:t.generateId||!1}},clusterProperties:t.clusterProperties,filter:t.filter},t.workerOptions)}get _promoteIdKey(){return typeof this.promoteId=="string"?this.promoteId:void 0}_pixelsToTileUnits(e){return e*(R/this.tileSize)}_tileUnitsToPixels(e){return e/(R/this.tileSize)}_getClusterMaxZoom(e){let t=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||we(`Integer expected for option 'clusterMaxZoom': provided value "${e}" rounded to "${t}"`),t}async load(){this._workerUpdates.isIdle()?we(`No pending worker updates for GeoJSONSource ${this.id}.`):await this._workerUpdates.flush()}onAdd(e){this.map=e,this.load()}setData(e){return this._data=typeof e=="string"?{url:e}:{geojson:e},this._workerUpdates.replace({data:e}),this._workerUpdates.flush()}updateData(e){let t=this._getWaitingWorkerChange();return t?t.diff=xB(t.diff,e,this._promoteIdKey):this._workerUpdates.enqueue({diff:e}),this._workerUpdates.flush()}async getData(){for(;this._data.url;)await this.once("data");return this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}async getBounds(){return N4(await this.getData())}setClusterOptions(e){if(this.workerOptions.geojsonVtOptions.cluster=e.cluster,e.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom)),!this._workerUpdates.some(t=>"data"in t)){let t=this._getWaitingWorkerChange();t?t.updateCluster=!0:this._workerUpdates.enqueue({updateCluster:!0})}return this._workerUpdates.flush()}_getWaitingWorkerChange(){let e=this._workerUpdates.top();return e&&!("data"in e)?e:void 0}getClusterOptions(){let{cluster:e,clusterOptions:t}=this.workerOptions.geojsonVtOptions;return{cluster:e,clusterMaxZoom:t.maxZoom,clusterRadius:this._tileUnitsToPixels(t.radius)}}async getClusterExpansionZoom(e){return(await this.actorPromise).sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}async getClusterChildren(e){return(await this.actorPromise).sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}async getClusterLeaves(e,t,r){return(await this.actorPromise).sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:r}})}async _getLoadGeoJSONParameters(e){let t=J({type:this.type,source:this.id},this.workerOptions),r=this._getCRSParameters();return r&&(t.crs=r),"data"in e?typeof e.data=="string"?(t.request=await this.map._requestManager.transformRequest(Nr.resolveURL(e.data),"Source"),t.request.collectResourceTiming=this._collectResourceTiming,t):(t.data=e.data,t):(e.diff&&(t.dataDiff=e.diff),e.updateCluster&&(t.updateCluster=!0),t)}_getCRSParameters(){let e=Pf(this.map?.style?.projection?.name);if(e)if(!e.definition&&e!==d_)we(`GeoJSON source "${this.id}" is drawn in the wrong place: the projection "${e.name}" has no \`definition\` to project its data with.`);else return{name:e.name,definition:e.definition,tileMatrixSet:e.tileMatrixSet}}async _sendWorkerUpdate(e){this.fire(new et("dataloading"));let t=await this._getLoadGeoJSONParameters(e);return(await this.actorPromise).sendAsync({type:"LD",data:t})}_onWorkerUpdateResult(e,t,r){if(this._removed||t.abandoned){this.fire(new et("dataabort"));return}t.data&&!r&&(this._data={geojson:t.data});let i="data"in e||r?void 0:e.diff,n=this._applyDiffToSource(i),a=!("data"in e)&&e.updateCluster||this.map?.style?.projection?.worldCoordinateHelper.wraps===!1?void 0:this._getShouldReloadTileOptions(n),o={};this._applyResourceTiming(o,t),this.fire(new et("data",{...o,sourceDataType:"metadata"})),this.fire(new et("data",{...o,sourceDataType:"content",shouldReloadTileOptions:a}))}_onWorkerUpdateError(e){this._removed?this.fire(new et("dataabort")):this.fire(new ee(Xt(e)))}_applyResourceTiming(e,t){if(!this._collectResourceTiming)return;let r=t.resourceTiming?.[this.id];if(!r)return;let i=r.slice(0);i?.length&&J(e,{resourceTiming:i})}_applyDiffToSource(e){if(!e)return;let t=this._promoteIdKey;if(!this._data.url&&!this._data.updateable){let i=_B(this._data.geojson,t);if(!i)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:i}}if(!this._data.updateable)return;let r=vB(this._data.updateable,e,t);if(!(e.removeAll||this.workerOptions.geojsonVtOptions.cluster))return r}_getShouldReloadTileOptions(e){if(e)return{affectedBounds:e.filter(Boolean).map(t=>N4(t))}}shouldReloadTile(e,{affectedBounds:t}){if(e.state==="loading")return!0;if(e.state==="unloaded")return!1;let{buffer:r,extent:i}=this.workerOptions.geojsonVtOptions,n=SB(e.tileID.canonical,r/i,this.map.style.projection.worldCoordinateHelper);for(let a of t)if(n.intersects(a))return!0;return!1}loaded(){return this._workerUpdates.isIdle()}async loadTile(e){let t=e.actor?"RT":"LT";e.actor=await this.actorPromise;let r={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;try{let i=await(await this.actorPromise).sendAsync({type:t,data:r},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(i,this.map.style,t==="RT")}catch(i){if(delete e.abortController,e.aborted||Ra(i))return;throw i}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}async unloadTile(e){e.unloadVectorData(),await(await this.actorPromise).sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}onRemove(){this._removed=!0,this._workerUpdates.clear(),this.actorPromise.then(e=>e.sendAsync({type:"RS",data:{type:this.type,source:this.id}}))}serialize(){return J({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},Vs=[0,0,1],MB=(e,t)=>({u_tl_parent:new _e(e,t.u_tl_parent),u_scale_parent:new q(e,t.u_scale_parent),u_buffer_scale:new q(e,t.u_buffer_scale),u_image_warp:new Pr(e,t.u_image_warp),u_fade_t:new q(e,t.u_fade_t),u_opacity:new q(e,t.u_opacity),u_image0:new te(e,t.u_image0),u_image1:new te(e,t.u_image1),u_brightness_low:new q(e,t.u_brightness_low),u_brightness_high:new q(e,t.u_brightness_high),u_saturation_factor:new q(e,t.u_saturation_factor),u_contrast_factor:new q(e,t.u_contrast_factor),u_spin_weights:new Pr(e,t.u_spin_weights),u_coords_top:new Qs(e,t.u_coords_top),u_coords_bottom:new Qs(e,t.u_coords_bottom)}),IB=(e,t,r,i,n,a)=>({u_tl_parent:e,u_scale_parent:t,u_buffer_scale:1,u_image_warp:a,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:FB(i.paint.get("raster-saturation")),u_contrast_factor:zB(i.paint.get("raster-contrast")),u_spin_weights:kB(i.paint.get("raster-hue-rotate")),u_coords_top:[n[0].x,n[0].y,n[1].x,n[1].y],u_coords_bottom:[n[3].x,n[3].y,n[2].x,n[2].y]});function kB(e){e*=Math.PI/180;let t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}function zB(e){return e>0?1/(1-e):1+e}function FB(e){return e>0?1-1/(1.001-e):-e}var hc=class{constructor(e,t,r){this.vertexBuffer=e,this.indexBuffer=t,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}},Fs=dt([{name:"a_pos",type:"Int16",components:2}]);function zC(e,t){let r=RB(t,"16bit"),i=ho.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),n=yn.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3});return new hc(e.createVertexBuffer(i,Fs.members),e.createIndexBuffer(n),ct.simpleSegment(0,0,i.length,n.length))}function RB(e,t){let r=e.granularity===void 0?1:Math.max(e.granularity,1),i=r+(e.generateBorders?2:0),n=r+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),a=i+1,o=n+1,s=e.generateBorders?-1:0,l=e.generateBorders||e.extendToNorthPole?-1:0,u=r+ +!!e.generateBorders,c=r+(e.generateBorders||e.extendToSouthPole?1:0),h=a*o,p=i*n*6,d=a*o>65536;if(d&&t==="16bit")throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let f=d||t==="32bit",m=new Int16Array(h*2),_=0;for(let v=l;v<=c;v++)for(let x=s;x<=u;x++){let b=x/r*R;x===-1&&(b=-64),x===r+1&&(b=8256);let w=v/r*R;v===-1&&(w=e.extendToNorthPole?Nu:-64),v===r+1&&(w=e.extendToSouthPole?Vu:8256),m[_++]=b,m[_++]=w}let g=f?new Uint32Array(p):new Uint16Array(p),y=0;for(let v=0;v<n;v++)for(let x=0;x<i;x++){let b=x+v*a,w=x+1+v*a,T=x+(v+1)*a,S=x+1+(v+1)*a;g[y++]=b,g[y++]=T,g[y++]=w,g[y++]=w,g[y++]=T,g[y++]=S}return{vertices:m.buffer.slice(0),indices:g.buffer.slice(0),uses32bitIndices:f}}var Tc=class extends lr{constructor(e,t,r,i){super(),this.imageWarp=Vs,this.flippedWindingOrder=!1,this._warp="auto",this._imageDirty=!1,this._subdividedQuad=!1,this._subdividedMesh=null,this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=t}async load(e){if(this.options.url===void 0)this._loaded=!0,this._finishLoading();else{this._loaded=!1,this.fire(new et("dataloading")),this.url=this.options.url,this._abortController=new AbortController;try{let t=await Vi.transformAndGetImage(this.map._requestManager,this.url,"Image",this._abortController);this._abortController=null,this._loaded=!0,t?.data?(this._setImage(t.data),e&&(this.coordinates=e),this._finishLoading()):this.fire(new ee(Error(`Could not load image ${this.url}: the response is empty`)))}catch(t){if(Ra(t))return;this._abortController=null,this._loaded=!0,this.fire(new ee(Xt(t)))}}}loaded(){return this._loaded}updateImage(e){return this._abortController&&(this._abortController=(this._abortController.abort(),null)),"image"in e?(this._loaded=!0,this._setImage(e.image),e.coordinates&&(this.coordinates=e.coordinates),this._finishLoading(),this):(e.url&&(this.options.url=e.url,this.load(e.coordinates)),this)}_setImage(e){this.image=e,this._imageDirty=!0}getMesh(e,t){return!this._subdividedQuad||t?null:(this._subdividedMesh??(this._subdividedMesh=zC(e,{granularity:16})),this._subdividedMesh)}_disposeTexture(){this.texture?.destroy(),this.texture=null}_finishLoading(){if(this.map)try{this.setCoordinates(this.coordinates),this.fire(new et("data",{sourceDataType:"metadata"}))}catch(e){this.fire(new ee(Xt(e)))}}onAdd(e){this.map=e,this.load()}onRemove(){this._abortController&&(this._abortController=(this._abortController.abort(),null)),this._disposeTexture(),this._subdividedMesh?.destroy(),this._subdividedMesh=null,this.image=null,this.tiles={}}setWarp(e){return this._warp===e||(this._warp=e,this.tileCoords&&this.setCoordinates(this.coordinates)),this}getWarp(){return this._warp}setCoordinates(e){this.coordinates=e;let t=this.map.style.projection.worldCoordinateHelper,r=e.map(i=>{let n=H.convert(i);return t.worldFromLngLat(n.lng,n.lat)});return this.tileID=LB(r),this.terrainTileRanges=this._getOverlappingTileRanges(r),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=r.map(i=>this.tileID.getTilePoint(i)._round()),this.imageWarp=OB(this.tileCoords,this._warp),this._subdividedQuad=this.imageWarp[2]>0&&!FC(this.tileCoords),this.flippedWindingOrder=BB(this.tileCoords),this.fire(new et("data",{sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,t=e.gl;this.texture?this._imageDirty&&(this.texture.update(this.image),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)):(this.texture=new Ot(e,this.image,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)),this._imageDirty=!1;let r=!1;for(let i in this.tiles){let n=this.tiles[i];n.state!=="loaded"&&(n.state="loaded",n.texture=this.texture,r=!0)}r&&this.fire(new et("data",{sourceDataType:"idle",sourceId:this.id}))}async loadTile(e){this.tileID?.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}serialize(){let e={type:"image",coordinates:this.coordinates};return this.options.url!==void 0&&(e.url=this.options.url),e}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:t,minY:r,maxX:i,maxY:n}=qi.fromPoints(e),a={};for(let o=0;o<=25;o++){let s=2**o,l=Math.floor(t*s),u=Math.floor(r*s),c=Math.floor(i*s),h=Math.floor(n*s),p=(l%s+s)%s,d=c%s,f=Math.floor(l/s),m=Math.floor(c/s);a[o]={minWrap:f,maxWrap:m,minTileXWrapped:p,maxTileXWrapped:d,minTileY:u,maxTileY:h}}return a}};function LB(e){let t=qi.fromPoints(e),r=t.width(),i=t.height(),n=Math.max(0,Math.floor(-Math.log(Math.max(r,i))/Math.LN2)),a=2**n;return new Cf(n,Math.floor((t.minX+t.maxX)/2*a),Math.floor((t.minY+t.maxY)/2*a))}function BB(e){let t=e[1].x-e[0].x,r=e[1].y-e[0].y,i=e[2].x-e[0].x;return t*(e[2].y-e[0].y)-r*i<0}function OB(e,t){if(t==="flat"||FC(e))return Vs;let[r,i,n,a]=e,o=r.x-i.x+n.x-a.x,s=r.y-i.y+n.y-a.y,l=[i.x-n.x,i.y-n.y,a.x-n.x,a.y-n.y],[u,c,h,p]=l,d=qM(l),f=(o*p-h*s)/d,m=(u*s-o*c)/d,_=[1,1+f,1+f+m,1+m],g=Math.max(..._)/Math.min(..._),y=t==="perspective"?0:jB(g);return!(g>=1&&g<=512)||y>=1?Vs:[f,m,y]}function jB(e){let t=(1-4/e)/.9921875;return Math.max(0,t)}function FC(e){let[t,r,i,n]=e;return t.x+i.x===r.x+n.x&&t.y+i.y===r.y+n.y}var NB=class extends Tc{constructor(e,t,r,i){super(e,t,r,i),this._onPlayingHandler=()=>{this.map?.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=t}async load(){this._loaded=!1;let e=this.options;this.urls=[];for(let t of e.urls)this.urls.push((await this.map._requestManager.transformRequest(t,"Source")).url);try{let t=await HI(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new ee(Xt(t)))}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let t=this.video.seekable;e<t.start(0)||e>t.end(0)?this.fire(new ee(new B(`sources.${this.id}`,null,`Playback for this video can be set only between the ${t.start(0)} and ${t.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,t=e.gl;this.texture?this.video.paused||(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.texture=new Ot(e,this.video,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let r=!1;for(let i in this.tiles){let n=this.tiles[i];n.state!=="loaded"&&(n.state="loaded",n.texture=this.texture,r=!0)}r&&this.fire(new et("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},VB=class extends Tc{constructor(e,t,r,i){super(e,t,r,i),t.coordinates?(!Array.isArray(t.coordinates)||t.coordinates.length!==4||t.coordinates.some(n=>!Array.isArray(n)||n.length!==2||n.some(a=>typeof a!="number")))&&this.fire(new ee(new B(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new ee(new B(`sources.${e}`,null,'missing required property "coordinates"'))),t.animate&&typeof t.animate!="boolean"&&this.fire(new ee(new B(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),t.canvas?typeof t.canvas!="string"&&!(t.canvas instanceof HTMLCanvasElement)&&this.fire(new ee(new B(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new ee(new B(`sources.${e}`,null,'missing required property "canvas"'))),this.options=t,this.animate=t.animate===void 0||t.animate}async 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 ee(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._playing=(this.prepare(),!1))},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this._playing=!1,super.onRemove()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let t=this.map.painter.context,r=t.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new Ot(t,this.canvas,r.RGBA,{premultiply:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let i=!1;for(let n in this.tiles){let a=this.tiles[n];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,i=!0)}i&&this.fire(new et("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},UB={},$B=(e,t,r,i)=>{let n=new(qB(t.type))(e,t,r,i);if(n.id!==e)throw Error(`Expected Source id to be ${e} instead of ${n.id}`);return n},qB=e=>{switch(e){case"geojson":return AB;case"image":return Tc;case"raster":return IC;case"raster-dem":return yB;case"vector":return fB;case"video":return NB;case"canvas":return VB}return UB[e]};function GB(e,t){let r={};if(!t)return r;for(let i of e){let n=i.layerIds.map(a=>t.getLayer(a)).filter(Boolean);if(n.length!==0){i.layers=n,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map(a=>n.filter(o=>o.id===a)[0]));for(let a of n)r[a.id]=i}}return r}var hd="_geojsonTileLayer",ZB=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},za,RC=(za=class{constructor(t,r,i,n,a,o){this.type="Feature",this._vectorTileFeature=t,this._x=i,this._y=n,this._z=r,o!==nl&&za.worldCoordinateHelpers.set(this,o);for(let s in t.properties)typeof t.properties[s]=="string"&&t.properties[s].startsWith("__$json__:")&&(t.properties[s]=JSON.parse(t.properties[s].slice(10)));this.properties=t.properties,this.id=a}projectPoint(t,r,i,n,a){if(a){let o=a.lngLatFromWorld((t.x+r)/n,(t.y+i)/n);return[o.lng,o.lat]}return[(t.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+i)*2/n)*Math.PI))-90]}projectLine(t,r,i,n,a){return t.map(o=>this.projectPoint(o,r,i,n,a))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,r=za.worldCoordinateHelpers.get(this),i=t.extent*2**this._z,n=t.extent*this._x,a=t.extent*this._y,o=t.loadGeometry();switch(t.type){case 1:{let s=[];for(let u of o)s.push(u[0]);let l=this.projectLine(s,n,a,i,r);this._geometry=s.length===1?{type:"Point",coordinates:l[0]}:{type:"MultiPoint",coordinates:l};break}case 2:{let s=o.map(l=>this.projectLine(l,n,a,i,r));this._geometry=s.length===1?{type:"LineString",coordinates:s[0]}:{type:"MultiLineString",coordinates:s};break}case 3:{let s=RE(o),l=[];for(let u of s)l.push(u.map(c=>this.projectLine(c,n,a,i,r)));this._geometry=l.length===1?{type:"Polygon",coordinates:l[0]}:{type:"MultiPolygon",coordinates:l};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&r!=="_x"&&r!=="_y"&&r!=="_z"&&(t[r]=this[r]);return t}},za.worldCoordinateHelpers=new WeakMap,za),zo=class{constructor(e,t,r){this._name=e,this.dataBuffer=t,typeof r=="number"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Df=class extends zo{},xv=class extends Df{getValueFromBuffer(e){return this.dataBuffer[e]}},bv=class extends Df{getValueFromBuffer(e){return this.dataBuffer[e]}},LC=class extends zo{constructor(e,t,r,i){super(e,t,i),this.delta=r}},wv=class extends LC{constructor(e,t,r,i,n){super(e,n?Int32Array.of(t):Uint32Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},Tv=class extends zo{constructor(e,t,r,i){super(e,i?Int32Array.of(t):Uint32Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},HB=class{constructor(e,t,r,i,n=4096){if(this._name=e,this._geometryVector=t,this._idVector=r,this._propertyVectors=i,this._extent=n,e.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(t=>[t.name,t]))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let i;if(this.idVector){let o=this.idVector.getValue(r);o!==null&&(i=this.containsMaxSafeIntegerValues(this.idVector)?Number(o):o)}let n={coordinates:t[r],type:this.geometryVector.geometryType(r)},a={};for(let o of this.propertyVectors){if(!o)continue;let s=o.name,l=o.getValue(r);l!==null&&(a[s]=l)}e.push({id:i,geometry:n,properties:a})}return e}containsMaxSafeIntegerValues(e){return e instanceof xv||e instanceof Tv||e instanceof wv||e instanceof bv}},zu={FEATURE:0,VERTEX:1},Me={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},ka={GEOMETRY:0,STRUCT:1,MAP:2},BC={ID:0},OC=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}},me;(function(e){e.NONE="NONE",e.DELTA="DELTA",e.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",e.RLE="RLE",e.MORTON="MORTON"})(me||(me={}));var ri;(function(e){e.NONE="NONE",e.FAST_PFOR="FAST_PFOR",e.VARINT="VARINT"})(ri||(ri={}));var Sv=new Uint32Array(33);Sv[0]=0;for(let e=1;e<=32;e++)Sv[e]=e===32?4294967295:4294967295>>>32-e;var f_=Sv,Ev=65536;function Cv(e,t){return e-e%t}function WB(e){return Cv(e+31,32)}function jC(e){if(!Number.isFinite(e)||e<=0)return Ev;let t=Cv(Math.floor(e),256);return t===0?256:t}function YB(e){let t=e>>>0;return((t&255)<<24|(t&65280)<<8|t>>>8&65280|t>>>24&255)>>>0}function XB(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n]=o>>>30&3}function KB(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(o&1)<<2)&7,r[n++]=o>>>1&7,r[n++]=o>>>4&7,r[n++]=o>>>7&7,r[n++]=o>>>10&7,r[n++]=o>>>13&7,r[n++]=o>>>16&7,r[n++]=o>>>19&7,r[n++]=o>>>22&7,r[n++]=o>>>25&7,r[n++]=o>>>28&7,r[n++]=(o>>>31|(s&3)<<1)&7,r[n++]=s>>>2&7,r[n++]=s>>>5&7,r[n++]=s>>>8&7,r[n++]=s>>>11&7,r[n++]=s>>>14&7,r[n++]=s>>>17&7,r[n++]=s>>>20&7,r[n++]=s>>>23&7,r[n++]=s>>>26&7,r[n]=s>>>29&7}function QB(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function JB(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(o&7)<<2)&31,r[n++]=o>>>3&31,r[n++]=o>>>8&31,r[n++]=o>>>13&31,r[n++]=o>>>18&31,r[n++]=o>>>23&31,r[n++]=(o>>>28|(s&1)<<4)&31,r[n++]=s>>>1&31,r[n++]=s>>>6&31,r[n++]=s>>>11&31,r[n++]=s>>>16&31,r[n++]=s>>>21&31,r[n++]=s>>>26&31,r[n++]=(s>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function eO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(o&15)<<2)&63,r[n++]=o>>>4&63,r[n++]=o>>>10&63,r[n++]=o>>>16&63,r[n++]=o>>>22&63,r[n++]=(o>>>28|(s&3)<<4)&63,r[n++]=s>>>2&63,r[n++]=s>>>8&63,r[n++]=s>>>14&63,r[n++]=s>>>20&63,r[n++]=s>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(c&3)<<4)&63,r[n++]=c>>>2&63,r[n++]=c>>>8&63,r[n++]=c>>>14&63,r[n++]=c>>>20&63,r[n]=c>>>26&63}function tO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0,h=e[t+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(o&7)<<4)&127,r[n++]=o>>>3&127,r[n++]=o>>>10&127,r[n++]=o>>>17&127,r[n++]=o>>>24&127,r[n++]=(o>>>31|(s&63)<<1)&127,r[n++]=s>>>6&127,r[n++]=s>>>13&127,r[n++]=s>>>20&127,r[n++]=(s>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(c&1)<<6)&127,r[n++]=c>>>1&127,r[n++]=c>>>8&127,r[n++]=c>>>15&127,r[n++]=c>>>22&127,r[n++]=(c>>>29|(h&15)<<3)&127,r[n++]=h>>>4&127,r[n++]=h>>>11&127,r[n++]=h>>>18&127,r[n]=h>>>25&127}function rO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0,h=e[t+6]>>>0,p=e[t+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function iO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0,h=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(o&15)<<5)&511,r[n++]=o>>>4&511,r[n++]=o>>>13&511,r[n++]=o>>>22&511,r[n++]=(o>>>31|(s&255)<<1)&511,r[n++]=s>>>8&511,r[n++]=s>>>17&511,r[n++]=(s>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(c&3)<<7)&511,r[n++]=c>>>2&511,r[n++]=c>>>11&511,r[n++]=c>>>20&511,r[n++]=(c>>>29|(h&63)<<3)&511,r[n++]=h>>>6&511,r[n++]=h>>>15&511,r[n++]=(h>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(d&31)<<4)&511,r[n++]=d>>>5&511,r[n++]=d>>>14&511,r[n]=d>>>23&511}function nO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0,h=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(o&255)<<2)&1023,r[n++]=o>>>8&1023,r[n++]=o>>>18&1023,r[n++]=(o>>>28|(s&63)<<4)&1023,r[n++]=s>>>6&1023,r[n++]=s>>>16&1023,r[n++]=(s>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=c>>>0&1023,r[n++]=c>>>10&1023,r[n++]=c>>>20&1023,r[n++]=(c>>>30|(h&255)<<2)&1023,r[n++]=h>>>8&1023,r[n++]=h>>>18&1023,r[n++]=(h>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(d&15)<<6)&1023,r[n++]=d>>>4&1023,r[n++]=d>>>14&1023,r[n++]=(d>>>24|(f&3)<<8)&1023,r[n++]=f>>>2&1023,r[n++]=f>>>12&1023,r[n]=f>>>22&1023}function aO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0,h=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0,m=e[t+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(o&1)<<10)&2047,r[n++]=o>>>1&2047,r[n++]=o>>>12&2047,r[n++]=(o>>>23|(s&3)<<9)&2047,r[n++]=s>>>2&2047,r[n++]=s>>>13&2047,r[n++]=(s>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(c&31)<<6)&2047,r[n++]=c>>>5&2047,r[n++]=c>>>16&2047,r[n++]=(c>>>27|(h&63)<<5)&2047,r[n++]=h>>>6&2047,r[n++]=h>>>17&2047,r[n++]=(h>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(d&255)<<3)&2047,r[n++]=d>>>8&2047,r[n++]=d>>>19&2047,r[n++]=(d>>>30|(f&511)<<2)&2047,r[n++]=f>>>9&2047,r[n++]=f>>>20&2047,r[n++]=(f>>>31|(m&1023)<<1)&2047,r[n++]=m>>>10&2047,r[n]=m>>>21&2047}function oO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0,h=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0,m=e[t+10]>>>0,_=e[t+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(o&15)<<8)&4095,r[n++]=o>>>4&4095,r[n++]=o>>>16&4095,r[n++]=(o>>>28|(s&255)<<4)&4095,r[n++]=s>>>8&4095,r[n++]=s>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(c&255)<<4)&4095,r[n++]=c>>>8&4095,r[n++]=c>>>20&4095,r[n++]=h>>>0&4095,r[n++]=h>>>12&4095,r[n++]=(h>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(d&255)<<4)&4095,r[n++]=d>>>8&4095,r[n++]=d>>>20&4095,r[n++]=f>>>0&4095,r[n++]=f>>>12&4095,r[n++]=(f>>>24|(m&15)<<8)&4095,r[n++]=m>>>4&4095,r[n++]=m>>>16&4095,r[n++]=(m>>>28|(_&255)<<4)&4095,r[n++]=_>>>8&4095,r[n]=_>>>20&4095}function sO(e,t,r,i){let n=i,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,c=e[t+5]>>>0,h=e[t+6]>>>0,p=e[t+7]>>>0,d=e[t+8]>>>0,f=e[t+9]>>>0,m=e[t+10]>>>0,_=e[t+11]>>>0,g=e[t+12]>>>0,y=e[t+13]>>>0,v=e[t+14]>>>0,x=e[t+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=_>>>0&65535,r[n++]=_>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=x>>>0&65535,r[n]=x>>>16&65535}function lO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0;r[n++]=s>>>0&1,r[n++]=s>>>1&1,r[n++]=s>>>2&1,r[n++]=s>>>3&1,r[n++]=s>>>4&1,r[n++]=s>>>5&1,r[n++]=s>>>6&1,r[n++]=s>>>7&1,r[n++]=s>>>8&1,r[n++]=s>>>9&1,r[n++]=s>>>10&1,r[n++]=s>>>11&1,r[n++]=s>>>12&1,r[n++]=s>>>13&1,r[n++]=s>>>14&1,r[n++]=s>>>15&1,r[n++]=s>>>16&1,r[n++]=s>>>17&1,r[n++]=s>>>18&1,r[n++]=s>>>19&1,r[n++]=s>>>20&1,r[n++]=s>>>21&1,r[n++]=s>>>22&1,r[n++]=s>>>23&1,r[n++]=s>>>24&1,r[n++]=s>>>25&1,r[n++]=s>>>26&1,r[n++]=s>>>27&1,r[n++]=s>>>28&1,r[n++]=s>>>29&1,r[n++]=s>>>30&1,r[n++]=s>>>31&1}}function uO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0,l=e[a++]>>>0;r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n++]=s>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function cO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0;r[n++]=s>>>0&7,r[n++]=s>>>3&7,r[n++]=s>>>6&7,r[n++]=s>>>9&7,r[n++]=s>>>12&7,r[n++]=s>>>15&7,r[n++]=s>>>18&7,r[n++]=s>>>21&7,r[n++]=s>>>24&7,r[n++]=s>>>27&7,r[n++]=(s>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function hO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,c=e[a++]>>>0;r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=c>>>0&15,r[n++]=c>>>4&15,r[n++]=c>>>8&15,r[n++]=c>>>12&15,r[n++]=c>>>16&15,r[n++]=c>>>20&15,r[n++]=c>>>24&15,r[n++]=c>>>28&15}}function pO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,c=e[a++]>>>0,h=e[a++]>>>0;r[n++]=s>>>0&31,r[n++]=s>>>5&31,r[n++]=s>>>10&31,r[n++]=s>>>15&31,r[n++]=s>>>20&31,r[n++]=s>>>25&31,r[n++]=(s>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(c&15)<<1)&31,r[n++]=c>>>4&31,r[n++]=c>>>9&31,r[n++]=c>>>14&31,r[n++]=c>>>19&31,r[n++]=c>>>24&31,r[n++]=(c>>>29|(h&3)<<3)&31,r[n++]=h>>>2&31,r[n++]=h>>>7&31,r[n++]=h>>>12&31,r[n++]=h>>>17&31,r[n++]=h>>>22&31,r[n++]=h>>>27&31}}function dO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,c=e[a++]>>>0,h=e[a++]>>>0,p=e[a++]>>>0;r[n++]=s>>>0&63,r[n++]=s>>>6&63,r[n++]=s>>>12&63,r[n++]=s>>>18&63,r[n++]=s>>>24&63,r[n++]=(s>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=c>>>0&63,r[n++]=c>>>6&63,r[n++]=c>>>12&63,r[n++]=c>>>18&63,r[n++]=c>>>24&63,r[n++]=(c>>>30|(h&15)<<2)&63,r[n++]=h>>>4&63,r[n++]=h>>>10&63,r[n++]=h>>>16&63,r[n++]=h>>>22&63,r[n++]=(h>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function fO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,c=e[a++]>>>0,h=e[a++]>>>0,p=e[a++]>>>0,d=e[a++]>>>0;r[n++]=s>>>0&127,r[n++]=s>>>7&127,r[n++]=s>>>14&127,r[n++]=s>>>21&127,r[n++]=(s>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(c&3)<<5)&127,r[n++]=c>>>2&127,r[n++]=c>>>9&127,r[n++]=c>>>16&127,r[n++]=c>>>23&127,r[n++]=(c>>>30|(h&31)<<2)&127,r[n++]=h>>>5&127,r[n++]=h>>>12&127,r[n++]=h>>>19&127,r[n++]=(h>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(d&15)<<3)&127,r[n++]=d>>>4&127,r[n++]=d>>>11&127,r[n++]=d>>>18&127,r[n++]=d>>>25&127}}function mO(e,t,r,i){let n=i,a=t;for(let o=0;o<8;o++){let s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,c=e[a++]>>>0,h=e[a++]>>>0,p=e[a++]>>>0,d=e[a++]>>>0,f=e[a++]>>>0;r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255}}function gO(e,t,r,i){let n=i,a=t;for(let o=0;o<128;o++){let s=e[a++]>>>0;r[n++]=s&65535,r[n++]=s>>>16&65535}}function yO(e,t,r,i,n){let a=f_[n]>>>0,o=t,s=0,l=e[o]>>>0,u=i;for(let c=0;c<8;c++){for(let h=0;h<32;h++)if(s+n<=32){let p=l>>>s&a;r[u+h]=p|0,s+=n,s===32&&(s=0,o++,h!==31&&(l=e[o]>>>0))}else{let p=32-s,d=l>>>s;o++,l=e[o]>>>0;let f=n-p,m=-1>>>32-f>>>0,_=(d|(l&m)<<p)&a;r[u+h]=_|0,s=f}u+=32,s=0,c<7&&(l=e[o]>>>0)}}var m_=jC(Ev),_O=3*m_/256+m_|0;function NC(){let e=new Uint8Array(_O);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function vO(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let t=Math.max(16,e|0);return{encodedWords:new Uint32Array(t),decoderWorkspace:NC()}}function xO(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let r=new Uint32Array(Math.max(16,t*2));return e.encodedWords=r,r}function bO(e,t,r,i){i.byteContainer.length<r&&(i.byteContainer=new Uint8Array(r*2),i.byteContainerI32=void 0);let n=i.byteContainer,a=r>>>2;if(n.byteOffset&3)for(let s=0;s<a;s=s+1|0){let l=e[t+s|0]|0,u=s<<2;n[u]=l&255,n[u+1|0]=l>>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let s=i.byteContainerI32;(!s||s.buffer!==n.buffer||s.byteOffset!==n.byteOffset||s.length<a)&&(s=i.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),s.set(e.subarray(t,t+a))}let o=r&3;if(o>0){let s=e[t+a|0]|0,l=a<<2;for(let u=0;u<o;u=u+1|0)n[l+u|0]=s>>>(u<<3)&255}return n}function wO(e,t,r){let i=e[t++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let o=e[t++]>>>0,s=WB(o),l=o*a+31>>>5;if(t+l>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${o}, streamWordIndex=${t}, needWords=${l}, availableWords=${e.length-t}, encodedWords=${e.length})`);let u=n[a];(!u||u.length<s)&&(u=n[a]=new Uint32Array(s));let c=0;for(;c<o;c=c+32|0)kO(e,t,u,c,a),t=t+a|0;let h=c-o|0;t=t-(h*a>>>5)|0,r.exceptionSizes[a]=o}return t}function TO(e,t,r,i,n){switch(n){case 1:lO(e,t,r,i);break;case 2:uO(e,t,r,i);break;case 3:cO(e,t,r,i);break;case 4:hO(e,t,r,i);break;case 5:pO(e,t,r,i);break;case 6:dO(e,t,r,i);break;case 7:fO(e,t,r,i);break;case 8:mO(e,t,r,i);break;case 16:gO(e,t,r,i);break;default:yO(e,t,r,i,n)}return t+(n<<3)|0}function SO(e,t,r,i){if(r+2>t)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${t})`);let n=e[r++],a=e[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function EO(e,t,r,i,n,a){if(r+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${t})`);let o=e[r++];if(o<i||o>32)throw Error(`FastPFOR decode: invalid maxBits=${o} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let s=o-i|0;if(s<1||s>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${s} at block=${a} (bitWidth=${i}, maxBits=${o})`);if(r+n>t)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${t-r})`);return{maxBits:o,exceptionBitWidth:s,bytePosIn:r}}function CO(e,t,r,i,n,a,o,s,l){let{maxBits:u,exceptionBitWidth:c,bytePosIn:h}=EO(n,a,o,r,i,l);if(o=h,c===1){let _=1<<r;for(let g=0;g<i;g=g+1|0){let y=n[o++];e[y+t|0]|=_}return o}let p=s.dataToBePacked[c];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${c} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let d=s.dataPointers,f=d[c]|0,m=s.exceptionSizes[c]|0;if(f+i>m)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${c} (ptr=${f}, need ${i}, size=${m}) at block ${l}`);for(let _=0;_<i;_=_+1|0){let g=n[o++],y=p[f++]|0;e[g+t|0]|=y<<r}return d[c]=f,o}function PO(e,t,r,i,n,a,o,s,l,u){let c=r|0,h=0;for(let p=0;p<o;p=p+1|0){let d=SO(s,l,h,p);h=d.bytePosIn;let f=d.bitWidth,m=d.exceptionCount,_=a+p*256|0;switch(f){case 0:n.fill(0,_,_+256);break;case 32:for(let g=0;g<256;g=g+1|0)n[_+g|0]=e[c+g|0]|0;c=c+256|0;break;default:c=TO(e,c,n,_,f)}m>0&&(h=CO(n,_,f,m,s,l,h,u,p))}if(c!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${r}, consumedPackedEnd=${c}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${e.length})`)}function DO(e,t,r,i,n,a){let o=r|0,s=e[o]|0;if(s<=0||o+s>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${s} at pageStart=${o} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let l=o+1|0,u=o+s|0,c=e[u]>>>0,h=c+3>>>2,p=u+1,d=p+h;if(d>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${c} (metaInts=${h}, pageStart=${o}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${d} out of bounds (encoded.length=${e.length})`);let f=bO(e,p,c,a),m=c,_=wO(e,d,a);return a.dataPointers.fill(0),PO(e,o,l,u,t,i|0,n/256|0,f,m,a),_}function AO(e,t,r,i,n,a){let o=i+Cv(n,256),s=i,l=r;for(;s!==o;){let u=Math.min(m_,o-s);l=DO(e,t,l,s,u,a),s=s+u|0}return l}function MO(e,t,r,i,n,a){if(a===0)return t;let o=0,s=t,l=t+r,u=n,c=n,h=n+a,p=0,d=0;for(;s<l&&c<h;){let f=e[s]>>>o&255;if(o+=8,s+=o>>>5,o&=31,p|=(f&127)<<d,f&128)i[c++]=p|0,p=0,d=0;else if(d+=7,d>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${d}, partial=${p}, decoded=${c-u}/${a}, inPos=${s}, inEnd=${l})`)}if(c!==h)throw Error(`FastPFOR VByte: truncated stream (decoded=${c-u}, expected=${a}, consumedWords=${s-t}/${r}, vbyteStart=${t}, vbyteEnd=${l})`);return s}function IO(e,t,r){let i=0,n=0,a=new Uint32Array(t),o=r??NC();if(e.length>0){let u=e[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=AO(e,a,i,n,u,o),n=n+u|0}let s=e.length-i|0,l=t-n|0;return MO(e,i,s,a,n,l),a}function kO(e,t,r,i,n){switch(n){case 2:XB(e,t,r,i);return;case 3:KB(e,t,r,i);return;case 4:QB(e,t,r,i);return;case 5:JB(e,t,r,i);return;case 6:eO(e,t,r,i);return;case 7:tO(e,t,r,i);return;case 8:rO(e,t,r,i);return;case 9:iO(e,t,r,i);return;case 10:nO(e,t,r,i);return;case 11:aO(e,t,r,i);return;case 12:oO(e,t,r,i);return;case 16:sO(e,t,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=e[t+u|0]|0;return}let a=f_[n]>>>0,o=t,s=0,l=e[o]>>>0;for(let u=0;u<32;u++)if(s+n<=32){let c=l>>>s&a;r[i+u]=c|0,s+=n,s===32&&(s=0,o++,u!==31&&(l=e[o]>>>0))}else{let c=32-s,h=l>>>s;o++,l=e[o]>>>0;let p=f_[n-c]>>>0,d=(h|(l&p)<<c)&a;r[i+u]=d|0,s=n-c}}function zO(e,t,r,i){if(t<0||r<0||t+r>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${r}, bytes.length=${e.length})`);let n=Math.floor(r/4),a=r%4!=0,o=a?n+1:n;if(i.length<o)throw RangeError(`decodeBigEndianInt32sInto: out.length=${i.length} < ${o}`);if(n>0){let s=e.byteOffset+t;if(s&3)for(let l=0;l<n;l++){let u=t+l*4;i[l]=e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]}else{let l=new Uint32Array(e.buffer,s,n);for(let u=0;u<n;u++)i[u]=YB(l[u])|0}}if(a){let s=t+n*4,l=r-n*4,u=0;for(let c=0;c<l;c++)u|=e[s+c]<<24-c*8;i[n]=u|0}return o}function or(e,t,r){let i=new Uint32Array(r),n=0,a=t.get();for(let o=0;o<i.length;o++){let s=e[a++],l=s&127;s<128||(s=e[a++],l|=(s&127)<<7,s<128||(s=e[a++],l|=(s&127)<<14,s<128||(s=e[a++],l|=(s&127)<<21,s<128||(s=e[a++],l|=(s&15)<<28)))),i[n++]=l}return t.set(a),i}function Pv(e,t,r){let i=new BigUint64Array(r);for(let n=0;n<i.length;n++)i[n]=FO(e,t);return i}function FO(e,t){let r=0n,i=0,n=t.get();for(;n<e.length;){let a=e[n++];if(r|=BigInt(a&127)<<BigInt(i),!(a&128))break;if(i+=7,i>=64)throw Error("Varint too long")}return t.set(n),r}function RO(e,t,r){let i=new Float64Array(r);for(let n=0;n<r;n++)i[n]=LO(e,t);return i}function LO(e,t){let r,i;return i=e[t.get()],t.increment(),r=i&127,i<128||(i=e[t.get()],t.increment(),r|=(i&127)<<7,i<128)||(i=e[t.get()],t.increment(),r|=(i&127)<<14,i<128)||(i=e[t.get()],t.increment(),r|=(i&127)<<21,i<128)?r:(i=e[t.get()],r|=(i&15)<<28,BO(r,e,t))}function BO(e,t,r){let i,n;if(n=t[r.get()],r.increment(),i=(n&112)>>4,n<128||(n=t[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=t[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=t[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=t[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=t[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(e>>>0);throw Error("Expected varint not more than 10 bytes")}function OO(e,t,r,i){return jO(e,t,r,i,vO(r>>>2))}function jO(e,t,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let o=r>>>2,s=xO(n,o);zO(e,a,r,s);let l=IO(s.subarray(0,o),t,n.decoderWorkspace);return i.add(r),l}function Te(e){return e>>>1^-(e&1)}function ar(e){return e>>1n^-(e&1n)}function Sa(e){return e%2==1?(e+1)/-2:e/2}function NO(e){let t=new Int32Array(e.length);for(let r=0;r<e.length;r++)t[r]=Te(e[r]);return t}function VO(e){let t=new BigInt64Array(e.length);for(let r=0;r<e.length;r++)t[r]=ar(e[r]);return t}function UO(e){for(let t=0;t<e.length;t++)e[t]=Sa(e[t])}function g_(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=e[a]}let i=new Uint32Array(r),n=0;for(let a=0;a<t;a++){let o=e[a],s=e[a+t];i.fill(s,n,n+o),n+=o}return i}function y_(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=Number(e[a])}let i=new BigUint64Array(r),n=0;for(let a=0;a<t;a++){let o=Number(e[a]),s=e[a+t];i.fill(s,n,n+o),n+=o}return i}function VC(e,t,r){let i=new Float64Array(r),n=0;for(let a=0;a<t;a++){let o=e[a],s=e[a+t];i.fill(s,n,n+o),n+=o}return i}function V4(e){let t=new Int32Array(e.length);t[0]=Te(e[0]);let r=e.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=e[i],a=e[i+1],o=e[i+2],s=e[i+3];t[i]=Te(n)+t[i-1],t[i+1]=Te(a)+t[i],t[i+2]=Te(o)+t[i+1],t[i+3]=Te(s)+t[i+2]}for(;i!==e.length;++i)t[i]=Te(e[i])+t[i-1];return t}function U4(e){let t=new BigInt64Array(e.length);t[0]=ar(e[0]);let r=e.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=e[i],a=e[i+1],o=e[i+2],s=e[i+3];t[i]=ar(n)+t[i-1],t[i+1]=ar(a)+t[i],t[i+2]=ar(o)+t[i+1],t[i+3]=ar(s)+t[i+2]}for(;i!==t.length;++i)t[i]=ar(e[i])+t[i-1];return t}function $O(e){e[0]=Sa(e[0]);let t=e.length/4*4,r=1;if(t>=4)for(;r<t-4;r+=4){let i=e[r],n=e[r+1],a=e[r+2],o=e[r+3];e[r]=Sa(i)+e[r-1],e[r+1]=Sa(n)+e[r],e[r+2]=Sa(a)+e[r+1],e[r+3]=Sa(o)+e[r+2]}for(;r!==e.length;++r)e[r]=Sa(e[r])+e[r-1]}function qO(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=e[a]}let i=new Int32Array(r),n=0;for(let a=0;a<t;a++){let o=e[a],s=e[a+t];s=Te(s),i.fill(s,n,n+o),n+=o}return i}function GO(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=Number(e[a])}let i=new BigInt64Array(r),n=0;for(let a=0;a<t;a++){let o=Number(e[a]),s=e[a+t];s=ar(s),i.fill(s,n,n+o),n+=o}return i}function ZO(e,t,r){let i=new Float64Array(r),n=0;for(let a=0;a<t;a++){let o=e[a],s=e[a+t];s=Sa(s),i.fill(s,n,n+o),n+=o}return i}function Dv(e){let t=e.length/4*4,r=1;if(t>=4)for(let i=e[0];r<t-4;r+=4)i=e[r]+=i,i=e[r+1]+=i,i=e[r+2]+=i,i=e[r+3]+=i;for(;r!==e.length;)e[r]+=e[r-1],++r}function HO(e){let t=0;for(let r=0;r<e.length;r++)e[r]+=t,t=e[r]}function WO(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);t[0]=Te(e[0]),t[1]=Te(e[1]);let r=e.length/4*4,i=2;if(r>=4)for(;i<r-4;i+=4){let n=e[i],a=e[i+1],o=e[i+2],s=e[i+3];t[i]=Te(n)+t[i-2],t[i+1]=Te(a)+t[i-1],t[i+2]=Te(o)+t[i],t[i+3]=Te(s)+t[i+1]}for(;i!==e.length;i+=2)t[i]=Te(e[i])+t[i-2],t[i+1]=Te(e[i+1])+t[i-1];return t}function UC(e,t,r,i){if(e.length<2)return new Int32Array(e);let n=new Int32Array(e.length),a=Te(e[0]),o=Te(e[1]);n[0]=ba(Math.round(a*t),r,i),n[1]=ba(Math.round(o*t),r,i);let s=e.length/16,l=2;if(s>=4)for(;l<s-4;l+=4){let u=e[l],c=e[l+1],h=Te(u)+a,p=Te(c)+o;n[l]=ba(Math.round(h*t),r,i),n[l+1]=ba(Math.round(p*t),r,i);let d=e[l+2],f=e[l+3];a=Te(d)+h,o=Te(f)+p,n[l+2]=ba(Math.round(a*t),r,i),n[l+3]=ba(Math.round(o*t),r,i)}for(;l!==e.length;l+=2)a+=Te(e[l]),o+=Te(e[l+1]),n[l]=ba(Math.round(a*t),r,i),n[l+1]=ba(Math.round(o*t),r,i);return n}function ba(e,t,r){return Math.min(r,Math.max(t,e))}function YO(e){let t=new Int32Array(e.length+1);t[0]=0,t[1]=Te(e[0]);let r=t[1];for(let i=2;i!==t.length;++i){let n=e[i-1],a=Te(n);r+=a,t[i]=t[i-1]+r}return new Uint32Array(t)}function XO(e,t,r){let i=new Int32Array(r+1);i[0]=0;let n=1,a=i[0];for(let o=0;o<t;o++){let s=e[o],l=e[o+t];l=Te(l);for(let u=n;u<n+s;u++)i[u]=l+a,a=i[u];n+=s}return i}function KO(e,t,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let o=0;o<t;o++){let s=e[o],l=e[o+t];for(let u=n;u<n+s;u++)i[u]=l+a,a=i[u];n+=s}return i}function QO(e,t,r){let i=new Int32Array(r),n=0,a=0;for(let o=0;o<t;o++){let s=e[o],l=e[o+t],u=Te(l);for(let c=0;c<s;c++)a+=u,i[n++]=a}return i}function JO(e,t,r){let i=new BigInt64Array(r),n=0,a=0n;for(let o=0;o<t;o++){let s=Number(e[o]),l=e[o+t],u=ar(l);for(let c=0;c<s;c++)a+=u,i[n++]=a}return i}function $4(e){let t=new Uint32Array(e.length);t[0]=Te(e[0])>>>0;for(let r=1;r<e.length;r++)t[r]=t[r-1]+Te(e[r])>>>0;return t}function q4(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,ar(e[0]));for(let r=1;r<e.length;r++)t[r]=BigInt.asUintN(64,t[r-1]+ar(e[r]));return t}function ej(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=Te(e[0])>>>0,t[1]=Te(e[1])>>>0;for(let r=2;r<e.length;r+=2)t[r]=t[r-2]+Te(e[r])>>>0,t[r+1]=t[r-1]+Te(e[r+1])>>>0;return t}function tj(e,t,r,i){let n=UC(e,t,r,i);return new Uint32Array(n)}function rj(e){return e[1]}function ij(e){return Te(e[1])}function nj(e){if(e.length===2){let t=Te(e[1]);return[t,t]}return[Te(e[2]),Te(e[3])]}function aj(e){return e[1]}function oj(e){return ar(e[1])}function sj(e){if(e.length===2){let t=ar(e[1]);return[t,t]}return[ar(e[2]),ar(e[3])]}var Tt;(function(e){e.PRESENT="PRESENT",e.DATA="DATA",e.OFFSET="OFFSET",e.LENGTH="LENGTH"})(Tt||(Tt={}));var yr;(function(e){e.NONE="NONE",e.SINGLE="SINGLE",e.SHARED="SHARED",e.VERTEX="VERTEX",e.MORTON="MORTON",e.FSST="FSST"})(yr||(yr={}));var hn;(function(e){e.VERTEX="VERTEX",e.INDEX="INDEX",e.STRING="STRING",e.KEY="KEY"})(hn||(hn={}));var Rt;(function(e){e.VAR_BINARY="VAR_BINARY",e.GEOMETRIES="GEOMETRIES",e.PARTS="PARTS",e.RINGS="RINGS",e.TRIANGLES="TRIANGLES",e.SYMBOL="SYMBOL",e.DICTIONARY="DICTIONARY"})(Rt||(Rt={}));var lj=[Tt.PRESENT,Tt.DATA,Tt.OFFSET,Tt.LENGTH],G4=[me.NONE,me.DELTA,me.COMPONENTWISE_DELTA,me.RLE,me.MORTON],uj=[ri.NONE,ri.FAST_PFOR,ri.VARINT],cj=[yr.NONE,yr.SINGLE,yr.SHARED,yr.VERTEX,yr.MORTON,yr.FSST],hj=[hn.VERTEX,hn.INDEX,hn.STRING,hn.KEY],pj=[Rt.VAR_BINARY,Rt.GEOMETRIES,Rt.PARTS,Rt.RINGS,Rt.TRIANGLES,Rt.SYMBOL,Rt.DICTIONARY];function tt(e,t){let r=mj(e,t);return r.logicalLevelTechnique1===me.MORTON?dj(r,e,t):(me.RLE===r.logicalLevelTechnique1||me.RLE===r.logicalLevelTechnique2)&&ri.NONE!==r.physicalLevelTechnique?fj(r,e,t):r}function dj(e,t,r){let i=or(t,r,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:e.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function fj(e,t,r){let i=or(t,r,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function mj(e,t){let r=e[t.get()],i=lj[r>>4],n={};switch(i){case Tt.DATA:n={dictionaryType:cj[r&15]};break;case Tt.OFFSET:n={offsetType:hj[r&15]};break;case Tt.LENGTH:n={lengthType:pj[r&15]}}t.increment();let a=e[t.get()],o=G4[a>>5],s=G4[a>>2&7],l=uj[a&3];t.increment();let u=or(e,t,2),c=u[0],h=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:o,logicalLevelTechnique2:s,physicalLevelTechnique:l,numValues:c,byteLength:h,decompressedCount:c}}var We;(function(e){e[e.FLAT=0]="FLAT",e[e.CONST=1]="CONST",e[e.SEQUENCE=2]="SEQUENCE",e[e.DICTIONARY=3]="DICTIONARY",e[e.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(We||(We={}));var Wi=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8),r=e%8;return(this.values[t]>>r&1)==1}set(e,t){let r=Math.floor(e/8),i=e%8;this.values[r]=this.values[r]|+!!t<<i}getInt(e){let t=Math.floor(e/8),r=e%8;return this.values[t]>>r&1}size(){return this._size}getBuffer(){return this.values}};function Fo(e,t,r){if(!t)return e;let i=t.size(),n=e.constructor,a=new n(i),o=0;for(let s=0;s<i;s++)a[s]=t.get(s)?e[o++]:r;return a}function gj(e,t,r){if(!r)return e;let i=r.size(),n=new Wi(e,t),a=new Wi(new Uint8Array(Math.ceil(i/8)),i),o=0;for(let s=0;s<i;s++){let l=r.get(s)?n.get(o++):!1;a.set(s,l)}return a.getBuffer()}function $C(e,t,r){for(let i=0;i<e;i++){let n=tt(t,r);r.add(n.byteLength)}}function al(e,t,r,i,n){let a=yj(e,Math.ceil(t/8),r,i);return n?gj(a,t,n):a}function yj(e,t,r,i){let n=new Uint8Array(t),a=0,o=i.get()+r;for(;a<t&&!(i.get()>=o);){let s=e[i.increment()];if(s<=127){let l=s+3,u=e[i.increment()],c=Math.min(a+l,t);n.fill(u,a,c),a=c}else{let l=256-s;for(let u=0;u<l&&a<t;u++)n[a++]=e[i.increment()]}}return i.set(o),n}function qC(e,t,r,i){let n=t.get(),a=n+r*Float32Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(n,a)).buffer,s=new Float32Array(o);return t.set(a),i?Fo(s,i,0):s}function GC(e,t,r,i){let n=t.get(),a=n+r*Float64Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(n,a)).buffer,s=new Float64Array(o);return t.set(a),i?Fo(s,i,0):s}function _j(e,t,r){let i=t.get(),n=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=new Uint32Array(r);for(let s=0;s<r;s++)o[s]=a.getUint32(i+s*Uint32Array.BYTES_PER_ELEMENT,!0);return t.add(n),o}function vj(e,t,r){let i=t.get(),n=r*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=new BigUint64Array(r);for(let s=0;s<r;s++)o[s]=a.getBigUint64(i+s*BigUint64Array.BYTES_PER_ELEMENT,!0);return t.add(n),o}var xj=new TextDecoder;function Av(e,t,r){return r-t>=12?xj.decode(e.subarray(t,r)):bj(e,t,r)}function bj(e,t,r){let i="",n=t;for(;n<r;){let a=e[n],o=null,s=a>239?4:a>223?3:a>191?2:1;if(n+s>r)break;let l,u,c;s===1?a<128&&(o=a):s===2?(l=e[n+1],(l&192)==128&&(o=(a&31)<<6|l&63,o<=127&&(o=null))):s===3?(l=e[n+1],u=e[n+2],(l&192)==128&&(u&192)==128&&(o=(a&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(l=e[n+1],u=e[n+2],c=e[n+3],(l&192)==128&&(u&192)==128&&(c&192)==128&&(o=(a&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),n+=s}return i}function Hd(e,t,r,i,n){return Cj(ol(e,t,r),r,i,n)}function rr(e,t,r,i,n){return Pj(ol(e,t,r),r,i,n)}function Ca(e,t,r){return Aj(ol(e,t,r),r)}function ol(e,t,r){let i=r.physicalLevelTechnique;switch(i){case ri.FAST_PFOR:return OO(e,r.numValues,r.byteLength,t);case ri.VARINT:return or(e,t,r.numValues);case ri.NONE:return _j(e,t,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Sc(e,t,r){let i=r.physicalLevelTechnique;switch(i){case ri.VARINT:return Pv(e,t,r.numValues);case ri.NONE:return vj(e,t,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function wj(e,t,r){let i=ol(e,t,r);return i.length===1?Te(i[0]):ij(i)}function Mv(e,t,r){let i=ol(e,t,r);return i.length===1?r.logicalLevelTechnique1===me.DELTA?Te(i[0]):i[0]:rj(i)}function ZC(e,t,r){return nj(ol(e,t,r))}function HC(e,t,r){return sj(Pv(e,t,r.numValues))}function WC(e,t,r,i){return XC(Sc(e,t,r),r,i)}function Iv(e,t,r,i){return KC(Sc(e,t,r),r,i)}function Tj(e,t,r,i){let n=Sj(e,t,r,!1);return i?Fo(n,i,0):n}function Sj(e,t,r,i){if(r.physicalLevelTechnique===ri.VARINT)return Dj(RO(e,t,r.numValues),r,i);let n=Sc(e,t,r),a=i?XC(n,r):KC(n,r);return Float64Array.from(a,Number)}function Ej(e,t,r){let i=Sc(e,t,r);return i.length===1?ar(i[0]):oj(i)}function YC(e,t,r){let i=Sc(e,t,r);return i.length===1?r.logicalLevelTechnique1===me.DELTA?ar(i[0]):i[0]:aj(i)}function Cj(e,t,r,i){let n;switch(t.logicalLevelTechnique1){case me.DELTA:if(t.logicalLevelTechnique2===me.RLE){let a=t;if(!i)return QO(e,a.runs,a.numRleValues);e=g_(e,a.runs,a.numRleValues),n=V4(e)}else n=V4(e);break;case me.RLE:n=qO(e,t.runs,t.numRleValues);break;case me.MORTON:Dv(e),n=new Int32Array(e);break;case me.COMPONENTWISE_DELTA:if(r&&!i)return UC(e,r.scale,r.min,r.max);n=WO(e);break;case me.NONE:n=NO(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?Fo(n,i,0):n}function Pj(e,t,r,i){let n;switch(t.logicalLevelTechnique1){case me.DELTA:if(t.logicalLevelTechnique2===me.RLE){let a=t;n=$4(g_(e,a.runs,a.numRleValues))}else n=$4(e);break;case me.RLE:n=g_(e,t.runs,t.numRleValues);break;case me.MORTON:Dv(e),n=e;break;case me.COMPONENTWISE_DELTA:n=r&&!i?tj(e,r.scale,r.min,r.max):ej(e);break;case me.NONE:n=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?Fo(n,i,0):n}function XC(e,t,r){let i;switch(t.logicalLevelTechnique1){case me.DELTA:if(t.logicalLevelTechnique2===me.RLE){let n=t;if(!r)return JO(e,n.runs,n.numRleValues);e=y_(e,n.runs,n.numRleValues),i=U4(e)}else i=U4(e);break;case me.RLE:i=GO(e,t.runs,t.numRleValues);break;case me.NONE:i=VO(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?Fo(i,r,0n):i}function KC(e,t,r){let i;switch(t.logicalLevelTechnique1){case me.DELTA:if(t.logicalLevelTechnique2===me.RLE){let n=t;i=q4(y_(e,n.runs,n.numRleValues))}else i=q4(e);break;case me.RLE:i=y_(e,t.runs,t.numRleValues);break;case me.NONE:i=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?Fo(i,r,0n):i}function Dj(e,t,r){switch(t.logicalLevelTechnique1){case me.DELTA:if(t.logicalLevelTechnique2===me.RLE){let i=t;e=VC(e,i.runs,i.numRleValues)}return $O(e),e;case me.RLE:return Ij(e,t,r);case me.NONE:return r&&UO(e),e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}function Aj(e,t){if(t.logicalLevelTechnique1===me.DELTA&&t.logicalLevelTechnique2===me.NONE)return YO(e);if(t.logicalLevelTechnique1===me.RLE&&t.logicalLevelTechnique2===me.NONE){let r=t;return KO(e,r.runs,r.numRleValues)}if(t.logicalLevelTechnique1===me.NONE&&t.logicalLevelTechnique2===me.NONE){HO(e);let r=new Uint32Array(t.numValues+1);return r[0]=0,r.set(e,1),r}if(t.logicalLevelTechnique1===me.DELTA&&t.logicalLevelTechnique2===me.RLE){let r=t,i=XO(e,r.runs,r.numRleValues);return Dv(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function Af(e,t,r,i,n="int32"){let a=e.logicalLevelTechnique1;if(a===me.RLE)return e.runs===1?We.CONST:We.FLAT;if(a!==me.DELTA||e.logicalLevelTechnique2!==me.RLE)return e.numValues===1?We.CONST:We.FLAT;let o=t instanceof Wi?t.size():t,s=e;if(s.numRleValues!==o)return We.FLAT;if(s.runs===1)return We.SEQUENCE;if(s.runs!==2)return e.numValues===1?We.CONST:We.FLAT;let l=i.get();if(e.physicalLevelTechnique===ri.VARINT)return Mj(r,i,n)?We.SEQUENCE:e.numValues===1?We.CONST:We.FLAT;let u=i.get(),c=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),c[2]===2&&c[3]===2?We.SEQUENCE:e.numValues===1?We.CONST:We.FLAT}function Mj(e,t,r){let i=new OC(t.get());if(r==="int64"){let a=Pv(e,i,4);return a[2]===2n&&a[3]===2n}let n=or(e,i,4);return n[2]===2&&n[3]===2}function Ij(e,t,r){return r?ZO(e,t.runs,t.numRleValues):VC(e,t.runs,t.numRleValues)}var QC=class extends Df{getValueFromBuffer(e){return this.dataBuffer[e]}},JC=class extends LC{constructor(e,t,r,i,n){super(e,n?BigInt64Array.of(t):BigUint64Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}};function kv(e,t,r){return{x:Z4(e,t)-r,y:Z4(e>>1,t)-r}}function Z4(e,t){let r=0;for(let i=0;i<t;i++)r|=(e&1<<2*i)>>i;return r}var Ht;(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON",e[e.MULTIPOINT=3]="MULTIPOINT",e[e.MULTILINESTRING=4]="MULTILINESTRING",e[e.MULTIPOLYGON=5]="MULTIPOLYGON"})(Ht||(Ht={}));var H4;(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON"})(H4||(H4={}));var Oa;(function(e){e[e.MORTON=0]="MORTON",e[e.VEC_2=1]="VEC_2",e[e.VEC_3=2]="VEC_3"})(Oa||(Oa={}));function kj(e){let t=Array(e.numGeometries),r=1,i=1,n=1,a=0,o=0,s=0,l=e.mortonSettings,u=e.topologyVector,c=u.geometryOffsets,h=u.partOffsets,p=u.ringOffsets,d=e.vertexOffsets,f=!d||d.length===0,m=e.containsPolygonGeometry(),_=e.vertexBuffer;for(let g=0;g<e.numGeometries;g++){let y=e.geometryType(g);switch(y){case Ht.POINT:{let v,x;if(f)v=_[o++],x=_[o++];else if(e.vertexBufferType===Oa.MORTON){let b=_[d[s++]],w=kv(b,l.numBits,l.coordinateShift);v=w.x,x=w.y}else{let b=d[s++]*2;v=_[b],x=_[b+1]}t[a++]=[[new k(v,x)]],c&&n++,h&&r++,p&&i++}break;case Ht.MULTIPOINT:{let v=c[n]-c[n-1];n++;let x;if(f){x=Array(v);for(let b=0;b<v;b++){let w=_[o++],T=_[o++];x[b]=new k(w,T)}}else x=so(e.vertexBufferType,_,d,s,v,!1,l),s+=v;t[a++]=x.map(b=>[b]),r+=v,i+=v}break;case Ht.LINESTRING:{let v;m?(v=p[i]-p[i-1],i++):v=h[r]-h[r-1],r++;let x;f?(x=ws(_,o,v,!1),o+=v*2):(x=so(e.vertexBufferType,_,d,s,v,!1,l),s+=v),t[a++]=[x],c&&n++}break;case Ht.POLYGON:{let v=h[r]-h[r-1];r++;let x=Array(v-1),b,w=p[i]-p[i-1];if(i++,f){b=ws(_,o,w,!0),o+=w*2;for(let T=0;T<x.length;T++)w=p[i]-p[i-1],i++,x[T]=ws(_,o,w,!0),o+=w*2}else{b=so(e.vertexBufferType,_,d,s,w,!0,l),s+=w;for(let T=0;T<x.length;T++)w=p[i]-p[i-1],i++,x[T]=so(e.vertexBufferType,_,d,s,w,!0,l),s+=w}t[a++]=[b].concat(x),c&&n++}break;case Ht.MULTILINESTRING:{let v=c[n]-c[n-1];n++;let x=Array(v);for(let b=0;b<v;b++){let w;if(m?(w=p[i]-p[i-1],i++):w=h[r]-h[r-1],r++,f)x[b]=ws(_,o,w,!1),o+=w*2;else{let T=so(e.vertexBufferType,_,d,s,w,!1,l);x[b]=T,s+=w}}t[a++]=x}break;case Ht.MULTIPOLYGON:{let v=c[n]-c[n-1];n++;let x=Array(v);for(let b=0;b<v;b++){let w=h[r]-h[r-1];r++;let T,S=Array(w-1),E=p[i]-p[i-1];i++,f?(T=ws(_,o,E,!0),o+=E*2):(T=so(e.vertexBufferType,_,d,s,E,!0,l),s+=E);for(let P=0;P<S.length;P++){let D=p[i]-p[i-1];i++,f?(S[P]=ws(_,o,D,!0),o+=D*2):(S[P]=so(e.vertexBufferType,_,d,s,D,!0,l),s+=D)}x[b]=[T].concat(S)}t[a++]=x.flat()}break;default:throw Error(`The specified geometry type (${y}) is currently not supported.`)}}return t}function so(e,t,r,i,n,a,o){return e===Oa.MORTON?Fj(t,r,i,n,a,o):zj(t,r,i,n,a)}function ws(e,t,r,i){let n=Array(i?r+1:r);for(let a=0;a<r*2;a+=2){let o=e[t+a],s=e[t+a+1];n[a/2]=new k(o,s)}return i&&(n[n.length-1]=n[0]),n}function zj(e,t,r,i,n){let a=Array(n?i+1:i);for(let o=0;o<i*2;o+=2){let s=t[r+o/2]*2,l=e[s],u=e[s+1];a[o/2]=new k(l,u)}return n&&(a[a.length-1]=a[0]),a}function Fj(e,t,r,i,n,a){let o=Array(n?i+1:i);for(let s=0;s<i;s++){let l=e[t[r+s]],u=kv(l,a.numBits,a.coordinateShift);o[s]=new k(u.x,u.y)}return n&&(o[o.length-1]=o[0]),o}var eP=class{constructor(e,t,r,i,n){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let r=this.vertexOffsets[e],i=this.vertexBuffer[r],n=kv(i,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[n.x,n.y]}let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return kj(this)}get mortonSettings(){return this._mortonSettings}};function Rj(e,t,r,i,n){return new tP(e,t,Oa.VEC_2,r,i,n)}function Lj(e,t,r,i,n,a){return new tP(e,t,Oa.MORTON,r,i,n,a)}var tP=class extends eP{constructor(e,t,r,i,n,a,o){super(r,i,n,a,o),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Ht.POLYGON||this._geometryType===Ht.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function rP(e,t,r,i){return new iP(Oa.VEC_2,e,t,r,i)}function Bj(e,t,r,i,n){return new iP(Oa.MORTON,e,t,r,i,n)}var iP=class extends eP{constructor(e,t,r,i,n,a){super(e,r,i,n,a),this._geometryTypes=t}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Ht.POLYGON||this.geometryType(e)===Ht.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},nP=class{constructor(e,t,r,i){this._triangleOffsets=e,this._indexBuffer=t,this._vertexBuffer=r,this._topologyVector=i}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let e=new Uint32Array(this.numGeometries);for(let t=0;t<this.numGeometries;t++)e[t]=this.geometryType(t);return rP(e,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function W4(e,t,r,i,n,a){return new Oj(e,t,r,i,n,a)}var Oj=class extends nP{constructor(e,t,r,i,n,a){super(r,i,n,a),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function Y4(e,t,r,i,n){return new jj(e,t,r,i,n)}var jj=class extends nP{constructor(e,t,r,i,n){super(t,r,i,n),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function Nj(e,t,r,i,n){let a=tt(e,r),o=Af(a,i,e,r),s,l,u,c;if(o===We.CONST){let v=Mv(e,r,a),x,b,w,T;for(let S=0;S<t-1;S++){let E=tt(e,r);switch(E.physicalStreamType){case Tt.LENGTH:switch(E.logicalStreamType.lengthType){case Rt.GEOMETRIES:x=Ca(e,r,E);break;case Rt.PARTS:b=Ca(e,r,E);break;case Rt.RINGS:w=Ca(e,r,E);break;case Rt.TRIANGLES:T=Ca(e,r,E)}break;case Tt.OFFSET:switch(E.logicalStreamType.offsetType){case hn.VERTEX:s=rr(e,r,E);break;case hn.INDEX:c=rr(e,r,E)}break;case Tt.DATA:if(yr.VERTEX===E.logicalStreamType.dictionaryType)l=Hd(e,r,E,n);else{let P=E;u={numBits:P.numBits,coordinateShift:P.coordinateShift},l=rr(e,r,E,n)}}}return c?x!==void 0||b!==void 0?W4(i,v,T,c,l,{geometryOffsets:x,partOffsets:b,ringOffsets:w}):W4(i,v,T,c,l):u===void 0?Rj(i,v,{geometryOffsets:x,partOffsets:b,ringOffsets:w},s,l):Lj(i,v,{geometryOffsets:x,partOffsets:b,ringOffsets:w},s,l,u)}let h=rr(e,r,a),p,d,f,m;for(let v=0;v<t-1;v++){let x=tt(e,r);switch(x.physicalStreamType){case Tt.LENGTH:switch(x.logicalStreamType.lengthType){case Rt.GEOMETRIES:p=rr(e,r,x);break;case Rt.PARTS:d=rr(e,r,x);break;case Rt.RINGS:f=rr(e,r,x);break;case Rt.TRIANGLES:m=Ca(e,r,x)}break;case Tt.OFFSET:switch(x.logicalStreamType.offsetType){case hn.VERTEX:s=rr(e,r,x);break;case hn.INDEX:c=rr(e,r,x)}break;case Tt.DATA:if(yr.VERTEX===x.logicalStreamType.dictionaryType)l=Hd(e,r,x,n);else{let b=x;u={numBits:b.numBits,coordinateShift:b.coordinateShift},l=rr(e,r,x,n)}}}let _,g,y;return p?(_=C1(h,p,2),d&&f?(g=X4(h,_,d,!1),y=Uj(h,_,g,f)):d&&(g=Vj(h,_,d))):d&&f?(g=C1(h,d,1),y=X4(h,g,f,!0)):d&&(g=C1(h,d,0)),c&&!g?Y4(h,m,c,l):c?Y4(h,m,c,l,{geometryOffsets:_,partOffsets:g,ringOffsets:y}):u===void 0?rP(h,{geometryOffsets:_,partOffsets:g,ringOffsets:y},s,l):Bj(h,{geometryOffsets:_,partOffsets:g,ringOffsets:y},s,l,u)}function C1(e,t,r){let i=new Uint32Array(e.length+1),n=0;i[0]=n;let a=0;for(let o=0;o<e.length;o++)n=i[o+1]=n+(e[o]>r?t[a++]:1);return i}function X4(e,t,r,i){let n=new Uint32Array(t[t.length-1]+1),a=0;n[0]=a;let o=1,s=0;for(let l=0;l<e.length;l++){let u=e[l],c=t[l+1]-t[l];if(u===5||u===2||i&&(u===4||u===1))for(let h=0;h<c;h++)a=n[o++]=a+r[s++];else for(let h=0;h<c;h++)n[o++]=++a}return n}function Vj(e,t,r){let i=new Uint32Array(t[t.length-1]+1),n=0;i[0]=n;let a=1,o=0;for(let s=0;s<e.length;s++){let l=e[s],u=t[s+1]-t[s];if(l===4||l===1)for(let c=0;c<u;c++)n=i[a++]=n+r[o++];else for(let c=0;c<u;c++)i[a++]=++n}return i}function Uj(e,t,r,i){let n=new Uint32Array(r[r.length-1]+1),a=0;n[0]=a;let o=1,s=1,l=0;for(let u=0;u<e.length;u++){let c=e[u],h=t[u+1]-t[u];if(c!==0&&c!==3)for(let p=0;p<h;p++){let d=r[o]-r[o-1];o++;for(let f=0;f<d;f++)a=n[s++]=a+i[l++]}else for(let p=0;p<h;p++)n[s++]=++a,o++}return n}var $j=class extends zo{constructor(e,t,r){super(e,t.getBuffer(),r),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}},qj=class extends Df{getValueFromBuffer(e){return this.dataBuffer[e]}},aP=class extends zo{constructor(e,t,r,i){super(e,i?BigInt64Array.of(t):BigUint64Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},zv=class extends zo{constructor(e,t,r,i){super(e,r,i),this.offsetBuffer=t}},K4=class extends zv{constructor(e,t,r,i){super(e,t,r,i??t.length-1)}getValueFromBuffer(e){let t=this.offsetBuffer[e],r=this.offsetBuffer[e+1];return Av(this.dataBuffer,t,r)}},Us=class extends zv{constructor(e,t,r,i,n){super(e,r,i,n??t.length),this.indexBuffer=t,this.indexBuffer=t}getValueFromBuffer(e){let t=this.indexBuffer[e],r=this.offsetBuffer[t],i=this.offsetBuffer[t+1];return Av(this.dataBuffer,r,i)}};function Gj(e,t){let r=0;for(let i=0;i<t.length;i++){let n=t[i];n===255?(r++,i++):r+=e[n]}return r}function Zj(e,t,r){let i=new Uint32Array(t.length);for(let o=1;o<t.length;o++)i[o]=i[o-1]+t[o-1];let n=new Uint8Array(Gj(t,r)),a=0;for(let o=0;o<r.length;o++){let s=r[o];if(s===255)o++,n[a++]=r[o];else{let l=t[s],u=i[s];for(;l-- >0;)n[a++]=e[u++]}}return n}var oP=class extends zv{constructor(e,t,r,i,n,a,o,s){super(e,r,i,o??t.length),this.indexBuffer=t,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=s}getValueFromBuffer(e){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let t=this.indexBuffer[e],r=this.offsetBuffer[t],i=this.offsetBuffer[t+1];return Av(this.decodedDictionary,r,i)}decodeDictionary(){return this.symbolLengthBuffer??(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),Zj(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),r=e[0];for(let i=1;i<e.length;i++){let n=e[i];t[i-1]=n-r,r=n}return t}};function sP(e,t,r,i,n){let a,o,s,l,u,c=n,h,p;for(let d=0;d<i;d++){let f=tt(t,r);switch(f.physicalStreamType){case Tt.PRESENT:{let m=new Wi(al(t,f.numValues,f.byteLength,r),f.numValues);c=n??m;break}case Tt.OFFSET:o=rr(t,r,f,void 0,c);break;case Tt.LENGTH:{let m=Ca(t,r,f);Rt.DICTIONARY===f.logicalStreamType.lengthType?a=m:Rt.SYMBOL===f.logicalStreamType.lengthType?l=m:h=m;break}case Tt.DATA:{let m=t.subarray(r.get(),r.get()+f.byteLength);r.add(f.byteLength);let _=f.logicalStreamType.dictionaryType;yr.FSST===_?u=m:yr.SINGLE===_||yr.SHARED===_?s=m:yr.NONE===_&&(p=m);break}}}return Hj(e,u,o,a,s,l,c)??Wj(e,s,o,a,c)??Yj(e,h,p,o,c)}function Hj(e,t,r,i,n,a,o){if(t){if(!r||!i||!n||!a)throw Error(`Incomplete FSST dictionary string column "${e}"`);return new oP(e,r,i,n,a,t,o)}}function Wj(e,t,r,i,n){if(t){if(!r||!i)throw Error(`Incomplete dictionary string column "${e}"`);return n?new Us(e,r,i,t,n):new Us(e,r,i,t)}}function Yj(e,t,r,i,n){if(t&&r){if(i)return n?new Us(e,i,t,r,n):new Us(e,i,t,r);if(n&&n.size()!==t.length-1){let a=new Uint32Array(n.size()),o=0;for(let s=0;s<n.size();s++)n.get(s)?a[s]=o++:a[s]=0;return new Us(e,a,t,r,n)}return n?new K4(e,t,r,n):new K4(e,t,r)}}function Xj(e,t,r,i){let n,a,o,s,l=!1;for(;!l;){let d=tt(e,t);switch(d.physicalStreamType){case Tt.LENGTH:Rt.DICTIONARY===d.logicalStreamType.lengthType?n=Ca(e,t,d):o=Ca(e,t,d);break;case Tt.DATA:yr.SINGLE===d.logicalStreamType.dictionaryType||yr.SHARED===d.logicalStreamType.dictionaryType?(a=e.subarray(t.get(),t.get()+d.byteLength),l=!0):s=e.subarray(t.get(),t.get()+d.byteLength),t.add(d.byteLength)}}if(r.type!=="complexType")throw Error(`Shared dictionary column ${r.name} must be a complex (struct) column.`);if(!n||!a)throw Error(`Incomplete shared dictionary for column "${r.name}"`);let u=r.complexType.children,c=[],h=s?{}:void 0,p=0;for(let d of u){let f=or(e,t,1)[0];if(f===0)continue;let m=d.name?`${r.name}${d.name}`:r.name;if(i&&!i.has(m)){$C(f,e,t);continue}if(d.type!=="scalarField"||d.scalarField.physicalType!==Me.STRING)throw Error("Currently only scalar string fields are implemented for a struct.");if(f>1&&!d.nullable||f===1&&d.nullable)throw Error(`The number of streams for the child field ${d.name} does not match its nullability. nullibilty: ${d.nullable}, numStreams: ${f}`);let _;if(d.nullable){let y=tt(e,t);_=new Wi(al(e,y.numValues,y.byteLength,t),y.numValues)}let g=rr(e,t,tt(e,t),void 0,_);if(s){if(!o)throw Error(`Incomplete shared FSST dictionary for column "${m}"`);c[p++]=new oP(m,g,n,a,o,s,_,h)}else c[p++]=new Us(m,g,n,a,_)}return c}var Q4=class extends zo{constructor(e,t,r){super(e,new Uint8Array,r??t.length),this.values=t}getValueFromBuffer(e){return this.values[e]}},pn;(function(e){e[e.STRING=1]="STRING",e[e.INT32=2]="INT32",e[e.UINT32=4]="UINT32",e[e.INT64=8]="INT64",e[e.UINT64=16]="UINT64",e[e.FLOAT=32]="FLOAT",e[e.DOUBLE=64]="DOUBLE",e[e.PRESENCE=128]="PRESENCE"})(pn||(pn={}));var Aa;(function(e){e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e[e.START_MAP=2]="START_MAP",e[e.START_LIST=3]="START_LIST",e[e.COUNT=4]="COUNT"})(Aa||(Aa={}));function Kj(e,t,r,i){let n=Qj(r);if(i===0)return n.map(c=>new Q4(c,[]));let a=Jj(e,t,i),o=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,s=[],l=0,u=0;for(let c=0;c<n.length;c++){let h=nN(a,c,o,l,u);s.push(new Q4(n[c],h.value,h.nullabilityBuffer)),l=h.countsEnd,u=h.valuesEnd}return s}function Qj(e){let t=e.type==="complexType"?e.complexType.children:void 0;return!t||t.length===0?[e.name]:t.map(r=>e.name+(r.name??""))}function Jj(e,t,r){let i=e[t.get()];t.add(1);let n=rr(e,t,tt(e,t)),a=r-1,o=[];i&pn.STRING&&(a-=eN(e,t,o)),a-=tN(e,t,i,o),a-=rN(e,t,i,o);let s,l=0;if(i&pn.PRESENCE){let c=iN(e,t);s=c.value,l=c.count,a--}let u=new Uint32Array;if(a>0&&(u=rr(e,t,tt(e,t)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:o,presentStream:s,presentCount:l,flattenedValues:u}}function eN(e,t,r){let i=e[t.get()];t.add(1);let n=sP("",e,t,i);if(n)for(let a=0;a<n.size;a++)r.push(n.getValue(a));return i}function tN(e,t,r,i){let n=0;return r&pn.INT32?(Rs(i,Hd(e,t,tt(e,t))),n++):r&pn.INT64&&(Rs(i,WC(e,t,tt(e,t))),n++),r&pn.UINT32?(Rs(i,rr(e,t,tt(e,t))),n++):r&pn.UINT64&&(Rs(i,Iv(e,t,tt(e,t))),n++),n}function rN(e,t,r,i){let n=0;return r&pn.FLOAT&&(Rs(i,qC(e,t,tt(e,t).numValues)),n++),r&pn.DOUBLE&&(Rs(i,GC(e,t,tt(e,t).numValues)),n++),n}function iN(e,t){let r=tt(e,t);if(r.physicalStreamType!==Tt.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${r.physicalStreamType}`);let i=r.numValues,n=t.get(),a=new Wi(al(e,i,r.byteLength,t),i);return t.set(n+r.byteLength),{value:a,count:i}}function nN(e,t,r,i,n){let{lengthStream:a,flattenedValues:o,presentStream:s,dictionary:l}=e,u=t*r,c=r,h;if(s){h=new Wi(new Uint8Array(Math.ceil(r/8)),r),c=0;for(let y=0;y<r;y++)s.get(u+y)&&(h.set(y,!0),c++)}let p=i+c;if(p>a.length)throw Error("Merged map counts underflow while decoding child streams");let d=Array(r),f=i,m=n;for(let y=0;y<r;y++){if(s&&!s.get(u+y)){d[y]=null;continue}let v=m+a[f++];if(v>o.length)throw Error("Map value stream underflow while decoding feature payload");let x=aN(o,m,v,l);d[y]=x.value,m=x.nextIndex}let _=0;for(let y=i;y<p;y++)_+=a[y];let g=n+_;if(m!==g)throw Error("Unused flattened map values remain after decode");return{value:d,nullabilityBuffer:h,countsEnd:p,valuesEnd:g}}function aN(e,t,r,i){return r-t===1||e[t]===Aa.START_LIST?Fv(e,t,r,i):lP(e,t,r,i)}function lP(e,t,r,i){let n=Object.create(null),a=t;for(;a<r;){let o=uP(e[a++],i);if(typeof o!="string")throw Error(`Map key dictionary index does not resolve to a string: ${o}`);let s=Fv(e,a,r,i);n[o]=s.value,a=s.nextIndex}return{value:n,nextIndex:a}}function Fv(e,t,r,i){if(t>=r)throw Error("Unexpected end of map value stream");let n=e[t];if(n===Aa.FALSE)return{value:!1,nextIndex:t+1};if(n===Aa.TRUE)return{value:!0,nextIndex:t+1};if(n===Aa.START_MAP){let a=J4(e,t,r);return{value:lP(e,t+2,a,i).value,nextIndex:a}}if(n===Aa.START_LIST){let a=J4(e,t,r),o=[],s=t+2;for(;s<a;){let l=Fv(e,s,a,i);o.push(l.value),s=l.nextIndex}return{value:o,nextIndex:a}}return{value:uP(n,i),nextIndex:t+1}}function J4(e,t,r){if(t+1>=r)throw Error("Missing length for nested map/list payload");let i=e[t+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=t+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function uP(e,t){let r=e-Aa.COUNT;if(r<0||r>=t.length)throw Error(`Scalar dictionary index out of range: ${e}`);return t[r]}function Rs(e,t){for(let r of t)e.push(r)}function oN(e,t,r,i,n,a){return r.type==="scalarType"?a&&!a.has(r.name)?($C(i,e,t),null):sN(i,e,t,n,r.scalarType,r):r.complexType?.physicalType===ka.MAP?Kj(e,t,r,i):i===0?null:Xj(e,t,r,a)}function sN(e,t,r,i,n,a){let o;if(e===0)return null;if(a.nullable){let l=tt(t,r),u=l.numValues,c=r.get(),h=al(t,u,l.byteLength,r);r.set(c+l.byteLength),o=new Wi(h,l.numValues)}let s=o??i;switch(n.physicalType){case Me.UINT_32:case Me.INT_32:return pN(t,r,a,n,s);case Me.STRING:{let l=a.nullable?e-1:e;return sP(a.name,t,r,l,o)??null}case Me.BOOLEAN:return lN(t,r,a,i,s);case Me.UINT_64:case Me.INT_64:return hN(t,r,a,s,n);case Me.FLOAT:return uN(t,r,a,s);case Me.DOUBLE:return cN(t,r,a,s);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function lN(e,t,r,i,n){let a=tt(e,t),o=a.numValues,s=t.get(),l=Ec(n)?n:void 0,u=al(e,o,a.byteLength,t,l);t.set(s+a.byteLength);let c=new Wi(u,o);return new $j(r.name,c,n)}function uN(e,t,r,i){let n=tt(e,t),a=Ec(i)?i:void 0,o=qC(e,t,n.numValues,a);return new qj(r.name,o,i)}function cN(e,t,r,i){let n=tt(e,t),a=Ec(i)?i:void 0,o=GC(e,t,n.numValues,a);return new bv(r.name,o,i)}function hN(e,t,r,i,n){let a=tt(e,t),o=Af(a,i,e,t,"int64"),s=n.physicalType===Me.INT_64;if(o===We.FLAT){let u=Ec(i)?i:void 0,c=s?WC(e,t,a,u):Iv(e,t,a,u);return new QC(r.name,c,i)}if(o===We.SEQUENCE){let u=HC(e,t,a);return new JC(r.name,u[0],u[1],a.numRleValues,s)}let l=s?Ej(e,t,a):YC(e,t,a);return new aP(r.name,l,i,s)}function pN(e,t,r,i,n){let a=tt(e,t),o=Af(a,n,e,t),s=i.physicalType===Me.INT_32;if(o===We.FLAT){let u=Ec(n)?n:void 0,c=s?Hd(e,t,a,void 0,u):rr(e,t,a,void 0,u);return new xv(r.name,c,n)}if(o===We.SEQUENCE){let u=ZC(e,t,a);return new wv(r.name,u[0],u[1],a.numRleValues,s)}let l=s?wj(e,t,a):Mv(e,t,a);return new Tv(r.name,l,n,s)}function Ec(e){return e instanceof Wi}var Vt={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function cP(e){switch(e){case Vt.ID:case Vt.ID|Vt.ID_NULLABLE:case Vt.ID|Vt.ID_LONG:case Vt.ID|Vt.ID_LONG|Vt.ID_NULLABLE:return{nullable:(e&Vt.ID_NULLABLE)!==0,columnScope:zu.FEATURE,type:"scalarType",scalarType:{longID:(e&Vt.ID_LONG)!==0,type:"logicalType",logicalType:BC.ID}};case Vt.GEOMETRY:return{nullable:!1,columnScope:zu.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:ka.GEOMETRY,children:[]}};case Vt.STRUCT:return{nullable:!1,columnScope:zu.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:ka.STRUCT,children:[]}};case Vt.MAP:return{nullable:!0,columnScope:zu.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:ka.MAP,children:[]}};default:return yN(e)}}function dN(e){return e>=Vt.SCALAR_BASE}function hP(e){return e===Vt.STRUCT||e===Vt.MAP}function fN(e){if(e.type==="scalarType"){let t=e.scalarType;if(t.type==="physicalType")switch(t.physicalType){case Me.BOOLEAN:case Me.INT_8:case Me.UINT_8:case Me.INT_32:case Me.UINT_32:case Me.INT_64:case Me.UINT_64:case Me.FLOAT:case Me.DOUBLE:return!1;case Me.STRING:return!0;default:return!1}if(t.type==="logicalType")return!1}else if(e.type==="complexType"){let t=e.complexType;if(t.type==="physicalType")switch(t.physicalType){case ka.GEOMETRY:case ka.STRUCT:case ka.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}function mN(e){return e.type==="scalarType"&&e.scalarType?.type==="logicalType"&&e.scalarType.logicalType===BC.ID}function gN(e){return e.type==="complexType"&&e.complexType?.type==="physicalType"&&e.complexType.physicalType===ka.GEOMETRY}function yN(e){let t;switch(e){case 10:case 11:t=Me.BOOLEAN;break;case 12:case 13:t=Me.INT_8;break;case 14:case 15:t=Me.UINT_8;break;case 16:case 17:t=Me.INT_32;break;case 18:case 19:t=Me.UINT_32;break;case 20:case 21:t=Me.INT_64;break;case 22:case 23:t=Me.UINT_64;break;case 24:case 25:t=Me.FLOAT;break;case 26:case 27:t=Me.DOUBLE;break;case 28:case 29:t=Me.STRING;break;default:return null}return{nullable:!!(e&1),columnScope:zu.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:t}}}var _N=new TextDecoder,e6="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function Rv(e,t){let r=or(e,t,1)[0];if(r===0)return"";let i=t.get(),n=i+r,a=e.subarray(i,n);return t.add(r),_N.decode(a)}function vN(e){let t=e.name,r=e.nullable;return e.type==="scalarType"?{type:"scalarField",scalarField:e.scalarType,name:t,nullable:r}:{type:"complexField",complexField:e.complexType,name:t,nullable:r}}function pP(e,t){let r=or(e,t,1)[0]>>>0,i=r>=Vt.SCALAR_BASE?cP(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n={...i,name:Rv(e,t)};if(n.type==="complexType"&&hP(r)){let a=n.complexType,o=or(e,t,1)[0]>>>0;a.children=Array(o);for(let s=0;s<o;s++)a.children[s]=pP(e,t)}return vN(n)}function xN(e,t){let r=or(e,t,1)[0]>>>0,i=cP(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${e6}`);let n;if(dN(r))n=Rv(e,t);else if(r<Vt.GEOMETRY)n="id";else if(r===Vt.GEOMETRY)n="geometry";else throw Error(`Unsupported column type code ${r}. Supported: ${e6}`);let a={...i,name:n};if(a.type==="complexType"&&hP(r)){let o=or(e,t,1)[0]>>>0,s=a.complexType;s.children=Array(o);for(let l=0;l<o;l++)s.children[l]=pP(e,t)}return a}function bN(e,t){let r={};r.featureTables=[];let i={};if(i.name=Rv(e,t),i.name.length===0)throw Error("Missing layer name");let n=or(e,t,1)[0]>>>0,a=or(e,t,1)[0]>>>0;i.columns=Array(a);for(let o=0;o<a;o++)i.columns[o]=xN(e,t);return r.featureTables.push(i),[r,n]}function wN(e,t,r=!0){let i=new OC(0),n=[];for(;i.get()<e.length;){let a=or(e,i,1)[0]>>>0,o=i.get()+a;if(o>e.length)throw Error(`Block overruns tile: ${o} > ${e.length}`);let s=or(e,i,1)[0]>>>0;if(s!==1&&s!==2){i.set(o);continue}let[l,u]=bN(e,i),c=l.featureTables[0],h=null,p=null,d=[],f=0;for(let _ of c.columns){let g=_.name;if(mN(_)){let y=null;if(_.nullable){let x=tt(e,i),b=i.get(),w=al(e,x.numValues,x.byteLength,i);i.set(b+x.byteLength),y=new Wi(w,x.numValues)}let v=tt(e,i);f=y?y.size():v.decompressedCount,h=TN(e,_,i,g,v,y??f,r)}else if(gN(_)){let y=or(e,i,1)[0];if(f===0){let v=i.get();f=tt(e,i).decompressedCount,i.set(v)}t&&(t.scale=t.extent/u),p=Nj(e,y,i,f,t)}else{let y=fN(_)?or(e,i,1)[0]:1;if(y===0)continue;let v=oN(e,i,_,y,f,void 0);if(v)if(Array.isArray(v))for(let x of v)d.push(x);else d.push(v)}}let m=new HB(c.name,p,h,d,u);n.push(m),i.set(o)}return n}function TN(e,t,r,i,n,a,o=!1){let s=t.scalarType?.longID?Me.UINT_64:Me.UINT_32,l=typeof a=="number"?void 0:a,u=Af(n,a,e,r,s===Me.UINT_64?"int64":"int32");if(s===Me.UINT_32)switch(u){case We.FLAT:return new xv(i,rr(e,r,n,void 0,l),a);case We.SEQUENCE:{let c=ZC(e,r,n);return new wv(i,c[0],c[1],n.numRleValues,!1)}case We.CONST:return new Tv(i,Mv(e,r,n),a,!1)}switch(u){case We.FLAT:return o?new bv(i,Tj(e,r,n,l),a):new QC(i,Iv(e,r,n,l),a);case We.SEQUENCE:{let c=HC(e,r,n);return new JC(i,c[0],c[1],n.numRleValues,!1)}case We.CONST:return new aP(i,YC(e,r,n),a,!1)}throw Error("Vector type not supported for id column.")}var P1=jC(Ev);P1/32*4,3*P1/256+P1|0;var SN=class{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Ht.POINT:case Ht.MULTIPOINT:this.type=1;break;case Ht.LINESTRING:case Ht.MULTILINESTRING:this.type=2;break;case Ht.POLYGON:case Ht.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=t,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let t of this._featureData.geometry.coordinates){let r=[];for(let i of t)r.push(new k(i.x,i.y));e.push(r)}return e}},EN=class{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new SN(this.features[e],this.extent)}},CN=class{constructor(e){this.layers={};let t=wN(new Uint8Array(e));this.layers=t.reduce((r,i)=>({...r,[i.name]:new EN(i)}),{})}};G("FeatureIndex",class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new py(R,16,0),this.grid3D=new py(R,16,0),this.featureIndexArray=new hE,this.promoteId=t}insert(e,t,r,i,n,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let s=a?this.grid3D:this.grid;for(let l of t){let u=[1/0,1/0,-1/0,-1/0];for(let c of l)u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new CN(this.rawTileData).layers:this.vtLayers=new X9(new eC(this.rawTileData)).layers,this.sourceLayerCoder=new ZB(this.vtLayers?Object.keys(this.vtLayers).sort():[hd])),this.vtLayers}query(e,t,r,i){this.loadVTLayers();let n=e.params,a=R/e.tileSize/e.scale,o=Qu(n.filter,"queryRenderedFeatures filter",n.globalState),s=e.queryGeometry,l=e.queryPadding*a,u=qi.fromPoints(s),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=qi.fromPoints(e.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(h.minX,h.minY,h.maxX,h.maxY,(m,_,g,y)=>Nz(e.cameraQueryGeometry,m-l,_-l,g+l,y+l));for(let m of p)c.push(m);c.sort(DN);let d={},f;for(let m of c){if(m===f)continue;f=m;let _=this.featureIndexArray.get(m),g=null;this.loadMatchingFeature(d,_.bucketIndex,_.sourceLayerIndex,_.featureIndex,o,n.layers,n.availableImages,t,r,e.transform.worldCoordinateHelper,i,(y,v,x)=>(g||(g=Io(y)),v.queryIntersectsFeature({queryGeometry:s,feature:y,featureState:x,geometry:g,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return d}loadMatchingFeature(e,t,r,i,n,a,o,s,l,u,c,h){let p=this.bucketLayerIDs[t];if(a&&!p.some(_=>a.has(_)))return;let d=this.sourceLayerCoder.decode(r),f=this.vtLayers[d].feature(i);if(n.needGeometry){let _=ko(f,!0);if(!n.filter(new Re(this.tileID.overscaledZ),_,this.tileID.canonical))return}else if(!n.filter(new Re(this.tileID.overscaledZ),f))return;let m=this.getId(f,d);for(let _ of p){if(a&&!a.has(_))continue;let g=s[_];if(!g)continue;let y={};m&&c&&(y=c.getState(g.sourceLayer||"_geojsonTileLayer",m));let v=J({},l[_]);v.paint=t6(v.paint,g.paint,f,y,o),v.layout=t6(v.layout,g.layout,f,y,o);let x=!h||h(f,g,y);if(!x)continue;let b=new RC(f,this.z,this.x,this.y,m,u);b.layer=v;let w=e[_];w===void 0&&(w=e[_]=[]),w.push({featureIndex:i,feature:b,intersectionZ:x})}}lookupSymbolFeatures(e,t,r,i,n,a,o,s){let l={};this.loadVTLayers();let u=Qu(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let c of e)this.loadMatchingFeature(l,r,i,c,u,a,o,s,t,n.worldCoordinateHelper);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[t];r=e.properties[i],typeof r=="boolean"&&(r=Number(r)),r===void 0&&e.properties?.cluster&&this.promoteId&&(r=Number(e.properties.cluster_id))}return r}},{omit:["rawTileData","sourceLayerCoder"]});function PN(e){return typeof e=="object"&&!!e&&"evaluate"in e}function t6(e,t,r,i,n){return R_(e,(a,o)=>{let s=t instanceof yf?t.get(o):null;return PN(s)?s.evaluate(r,i,void 0,n):s})}function DN(e,t){return t-e}var __="RTLPluginLoaded",AN=class extends lr{constructor(...e){super(...e),this.status="unavailable",this.url=null,this.dispatcher=aB()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(t=>{throw this.status="error",t})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}async setRTLTextPlugin(e,t=!1){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Nr.resolveURL(e),!this.url)throw Error(`requested url ${e} is invalid`);if(this.status==="unavailable")if(t)this.status="deferred",this._syncState(this.status);else return this._requestImport();else if(this.status==="requested")return this._requestImport()}async _requestImport(){await this._syncState("loading"),this.status="loaded",this.fire(new Ao(__))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}},D1=null;function v_(){return D1||(D1=new AN),D1}var dP=class{constructor(e,t){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=vT(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading",this.featureStateRevision=-1}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadingDirection!==0||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:t,fadingParentID:r,fadeEndTime:i}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=t,this.fadingParentID=r,this.fadeEndTime=i}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Be(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(e){return this.rttObjects[e]}acquireRTT(e,t,r){return this.rttObjects[t]=e.acquireRTT(r)}releaseRTT(e){if(this.rttObjects.length!==0){for(let t of this.rttObjects)t&&e.releaseRTT(t);this.rttObjects.length=0}}releaseRTTStack(e,t){let r=this.rttObjects[t];r&&(e.releaseRTT(r),this.rttObjects[t]=void 0)}loadVectorData(e,t,r){if(e?.etagUnmodified===!0)this.state="loaded";else if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e)this.collisionBoxArray=new tE;else{e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestEncoding=e.encoding,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=GB(e.buckets,t),this.hasSymbolBuckets=!1;for(let i in this.buckets){let n=this.buckets[i];if(n instanceof qd)if(this.hasSymbolBuckets=!0,r)n.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let i in this.buckets){let n=this.buckets[i];if(n instanceof qd&&n.hasRTLText){this.hasRTLText=!0,v_().lazyLoad();break}}this.queryPadding=0;for(let i in this.buckets){let n=this.buckets[i];this.queryPadding=Math.max(this.queryPadding,t.getLayer(i).queryRadius(n))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let r in this.buckets){let i=this.buckets[r];i.uploadPending()&&i.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ot(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasImage=(this.glyphAtlasTexture=new Ot(e,this.glyphAtlasImage,t.ALPHA),null))}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,i,n,a,o,s,l,u,c){return this.latestFeatureIndex?.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:o,queryPadding:this.queryPadding*l,getElevation:c},e,t,r):{}}querySourceFeatures(e,t){let r=this.latestFeatureIndex;if(!r?.rawTileData)return;let i=r.loadVTLayers(),n=t.sourceLayer?t.sourceLayer:"",a=i._geojsonTileLayer||i[n];if(!a)return;let o=Qu(t.filter,`querySourceFeatures[${n}].filter`,t.globalState),{z:s,x:l,y:u}=this.tileID.canonical,c={z:s,x:l,y:u};for(let h=0;h<a.length;h++){let p=a.feature(h);if(o.needGeometry){let f=ko(p,!0);if(!o.filter(new Re(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!o.filter(new Re(this.tileID.overscaledZ),p))continue;let d=new RC(p,s,l,u,r.getId(p,n),t.worldCoordinateHelper);d.tile=c,e.push(d)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let t=this.expirationTime;if(e.cacheControl){let r=DI(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+r["max-age"]*1e3)}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let r=Date.now(),i=!1;if(this.expirationTime>r)i=!1;else if(!t)i=!0;else if(this.expirationTime<t)i=!0;else{let n=this.expirationTime-t;n?this.expirationTime=r+Math.max(n,3e4):i=!0}i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),2**31-1)}setFeatureState(e,t,r){if(!this.latestFeatureIndex?.rawTileData||Object.keys(e).length===0||this.featureStateRevision===r)return;this.featureStateRevision=r;let i=this.latestFeatureIndex.loadVTLayers();for(let n in this.buckets){if(!t.hasLayer(n))continue;let a=this.buckets[n],o=a.layers[0].sourceLayer||"_geojsonTileLayer",s=i[o],l=e[o];if(!s||!l||l.length===0)continue;a.update(l,s,this.imageAtlas?.patternPositions||{},this.dashPositions||{});let u=t.getLayer(n);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(a)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Be()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=Be()+e}setDependencies(e,t){let r={};for(let i of t)r[i]=!0;this.dependencies[e]=r}hasDependency(e,t){for(let r of e){let i=this.dependencies[r];if(i){for(let n of t)if(i[n])return!0}}return!1}},MN=class{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){let i=e.wrapped().key;this.data[i]===void 0&&(this.data[i]=[]);let n={value:t,timeout:void 0};if(r!==void 0&&(n.timeout=setTimeout(()=>{this.remove(e,n)},r)),this.data[i].push(n),this.order.push(i),this.order.length>this.max){let a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let r=e.wrapped().key,i=t===void 0?0:this.data[r].indexOf(t),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),this.data[r].length===0&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(e){let t=[];for(let r in this.data)for(let i of this.data[r])e(i.value)||t.push(i);for(let r of t)this.remove(r.value.tileID,r)}};function r6(e){let t=[];for(let r in e)t.push({id:r,state:e[r]});return t}var IN=class{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(e,t,r){var n,a;let i=String(t);if((n=this.stateChanges)[e]||(n[e]={}),(a=this.stateChanges[e])[i]||(a[i]={}),J(this.stateChanges[e][i],r),this.deletedStates[e]===null){this.deletedStates[e]={};for(let o in this.state[e])if(o===i){this.deletedStates[e][i]={};for(let s in this.state[e][o])r[s]===void 0&&(this.deletedStates[e][i][s]=null)}else this.deletedStates[e][o]=null}else if(this.deletedStates[e]?.[i]===null){this.deletedStates[e][i]={};for(let o in this.state[e][i])r[o]===void 0&&(this.deletedStates[e][i][o]=null)}else for(let o in r)this.deletedStates[e]?.[i]?.[o]===null&&delete this.deletedStates[e][i][o]}removeFeatureState(e,t,r){var n,a;if(this.deletedStates[e]===null)return;let i=String(t);if((n=this.deletedStates)[e]||(n[e]={}),r&&t!==void 0)this.deletedStates[e][i]!==null&&((a=this.deletedStates[e])[i]||(a[i]={}),this.deletedStates[e][i][r]=null);else if(t!==void 0)if(this.stateChanges[e]?.[i])for(r in this.deletedStates[e][i]={},this.stateChanges[e][i])this.deletedStates[e][i][r]=null;else this.deletedStates[e][i]=null;else this.deletedStates[e]=null}getState(e,t){let r=String(t),i=this.state[e]||{},n=this.stateChanges[e]||{},a=J({},i[r],n[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let o=this.deletedStates[e][t];if(o===null)return{};for(let s in o)delete a[s]}return a}initializeTileState(e,t){let r={};for(let i in this.state)r[i]=r6(this.state[i]);e.setFeatureState(r,t,this.revision)}coalesceChanges(e,t){var n,a,o;let r={};for(let s in this.stateChanges){(n=this.state)[s]||(n[s]={}),r[s]||(r[s]={});for(let l in this.stateChanges[s])(a=this.state[s])[l]||(a[l]={}),J(this.state[s][l],this.stateChanges[s][l]),r[s][l]=this.state[s][l]}for(let s in this.deletedStates)if((o=this.state)[s]||(o[s]={}),r[s]||(r[s]={}),this.deletedStates[s]===null)for(let l in this.state[s])this.state[s][l]={},r[s][l]={};else for(let l in this.deletedStates[s]){if(this.deletedStates[s][l]===null)this.state[s][l]={};else if(this.state[s][l])for(let u of Object.keys(this.deletedStates[s][l]))delete this.state[s][l][u];else continue;r[s][l]=this.state[s][l]}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length===0)return;this.revision++;let i={};for(let s in r)i[s]=r6(r[s]);e.setFeatureState(i,t,this.revision)}},Lv=class fP{constructor(t,r){this.min=t,this.max=r,this.center=Xe([],vi([],this.min,this.max),.5)}quadrant(t){let r=[t%2==0,t<2],i=Y1(this.min),n=Y1(this.max);for(let a=0;a<r.length;a++)i[a]=r[a]?this.min[a]:this.center[a],n[a]=r[a]?this.center[a]:this.max[a];return n[2]=this.max[2],new fP(i,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let r=!0;for(let i of t.planes){let n=this.intersectsPlane(i);if(n===0)return 0;n===1&&(r=!1)}return r?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let r=t[3],i=t[3];for(let n=0;n<3;n++)t[n]>0?(r+=t[n]*this.min[n],i+=t[n]*this.max[n]):(i+=t[n]*this.min[n],r+=t[n]*this.max[n]);return r>=0?2:i<0?0:1}},Bv=class mP{constructor(t,r,i){this.points=t,this.planes=r,this.aabb=i}static fromInvProjectionMatrix(t,r=1,i=0,n,a){let o=[[-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]],s=a?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],l=2**i,u=o.map(d=>kN(d,t,r,l));n&&zN(u,s[0],n,a);let c=s.map(d=>{let f=Cr([],jr([],$n([],u[d[0]],u[d[1]]),$n([],u[d[2]],u[d[1]]))),m=-Mt(f,u[d[1]]);return f.concat(m)}),h=[1/0,1/0,1/0],p=[-1/0,-1/0,-1/0];for(let d of u)for(let f=0;f<3;f++)h[f]=Math.min(h[f],d[f]),p[f]=Math.max(p[f],d[f]);return new mP(u,c,new Lv(h,p))}};function kN(e,t,r,i){let n=nr([],e,t),a=1/n[3]/r*i;return hI(n,n,[a,a,1/n[3],a])}function zN(e,t,r,i){let n=i?4:0,a=i?0:4,o=0,s=[],l=[];for(let h=0;h<4;h++){let p=$n([],e[h+a],e[h+n]),d=Ui(p);Xe(p,p,1/d),s.push(d),l.push(p)}for(let h=0;h<4;h++){let p=xI(e[h+n],l[h],r);o=p!==null&&p>=0?Math.max(o,p):Math.max(o,s[h])}let u=FN(e,t),c=RN(r,u);if(c!==null){let h=c/Mt(l[0],u);o=Math.min(o,h)}for(let h=0;h<4;h++){let p=Math.min(o,s[h]);e[h+a]=[e[h+n][0]+l[h][0]*p,e[h+n][1]+l[h][1]*p,e[h+n][2]+l[h][2]*p,1]}}function FN(e,t){let r=$n([],e[t[0]],e[t[1]]),i=$n([],e[t[2]],e[t[1]]),n=[0,0,0,0];return Cr(n,jr([],r,i)),n[3]=-Mt(n,e[t[0]]),n}function RN(e,t){let r=uI([],e,1/xd(e)),i=$n([],t,Xe([],r,Mt(t,r))),n=xd(i);if(n>0){let a=Math.sqrt(1-r[3]*r[3]);return K1(t,vi([],Xe([],r,-r[3]),Xe([],i,a/n)))}return null}function LN(e,t,r){let i=t.intersectsFrustum(e);if(!r||i===0)return i;let n=t.intersectsPlane(r);return n===0?0:i===2&&n===2?2:1}function i6(e,t,r){let i=0,n=(r-t)/10;for(let a=0;a<10;a++){let o=t+(a+.5)/10*(r-t);i+=n*Math.cos(o)**+e}return i}function x_(e,t){return function(r,i,n,a,o){let s=2*((e-1)/Ut(Math.cos(Je(Os-o))/Math.cos(Je(Os)))-1),l=Math.acos(n/a),u=2*i6(s-1,0,Je(o/2)),c=Math.min(Je(Os),l+Je(o/2)),h=Math.min(c,l-Je(o/2)),p=i6(s-1,h,c),d=Math.atan(i/n),f=Math.hypot(i,n),m=r;return m+=Ut(a/f/Math.max(.5,Math.cos(Je(o/2)))),m+=s*Ut(Math.cos(d))/2,m-=Ut(Math.max(1,p/u/t))/2,m}}var BN=x_(9.314,3);function Ov(e,t){let r=(t.roundZoom?Math.round:Math.floor)(e.zoom+Ut(e.tileSize/t.tileSize));return Math.max(0,r)}function ON(e,t){let r=Q((15-(Os-e.pitch-e.fov/2))/15,0,1),i=Math.max(500,t??0);return e.elevation+r*i}function jN(e,t,r){let i=e.planes[1],n=e.points.map(l=>{let u=i[0]*l[0]+i[1]*l[1]+i[2]*l[2]+i[3];if(Math.abs(u)>1e-6)return l;let c=[l[0]-r[0],l[1]-r[1],l[2]-r[2]],h=i[0]*c[0]+i[1]*c[1]+i[2]*c[2];if(h>=-1e-9)return l;let p=t/-h;return[l[0]+c[0]*p,l[1]+c[1]*p,l[2]+c[2]*p,l[3]]}),a=e.planes.map((l,u)=>u===1?[l[0],l[1],l[2],l[3]+t]:l),o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0];for(let l of n)for(let u=0;u<3;u++)o[u]=Math.min(o[u],l[u]),s[u]=Math.max(s[u],l[u]);return new Bv(n,a,new Lv(o,s))}function NN(e,t,r,i){let n=Math.hypot(t[0],t[1],t[2]);if(n===0)return{frustum:e,plane:t};let a=1+i/Er,o=Q(-t[3]/n,-1,1),s=Math.cos(Math.acos(o)+Math.acos(1/a));return{frustum:jN(e,Math.sqrt(a*a-1),r),plane:[t[0],t[1],t[2],-s*n]}}function Cc(e,t){let r=e.getCameraFrustum(),i=e.getClippingPlane();i&&t.maxContentElevation>0&&({frustum:r,plane:i}=NN(r,i,e.cameraPosition,t.maxContentElevation));let n=e.getCoveringTilesDetailsProvider(),a=n.getCenter(e),o=J9(e,a),s=e.worldCoordinateHelper.worldFromLngLat(a.lng,a.lat,e.elevation),l=ON(e,t.maxContentElevation),u=n.allowVariableZoom(e,t),c=Ov(e,t),h=t.minzoom||0,p=t.maxzoom===void 0?e.maxZoom:t.maxzoom,d=Math.min(Math.max(0,c),p),f=2**d,m=[f*o.x,f*o.y,0],_=[f*s.x,f*s.y,0],g=Math.hypot(s.x-o.x,s.y-o.y),y=Math.abs(s.z-o.z),v=Math.hypot(g,y),x=T=>({zoom:0,x:0,y:0,wrap:T,fullyVisible:!1}),b=[],w=[];if(e.renderWorldCopies&&e.worldCoordinateHelper.wraps&&n.allowWorldCopies())for(let T=1;T<=3;T++)b.push(x(-T)),b.push(x(T));for(b.push(x(0));b.length>0;){let T=b.pop(),S=T.x,E=T.y,P=T.fullyVisible,D={x:S,y:E,z:T.zoom},F=n.getTileBoundingVolume(D,T.wrap,l,t);if(!P){let M=LN(r,F,i);if(M===0)continue;P=M===2}let I=n.distanceToTile2d(o.x,o.y,D,F),C=c;u&&(C=(t.calculateTileZoom||BN)(e.zoom+Ut(e.tileSize/t.tileSize),I,y,v,e.fov)),C=(t.roundZoom?Math.round:Math.floor)(C),C=Math.max(0,C);let A=Math.min(C,p);if(T.wrap=n.getWrap(s,D,T.wrap),T.zoom>=A){if(T.zoom<h)continue;let M=d-T.zoom,L=m[0]-.5-(S<<M),j=m[1]-.5-(E<<M),O=t.reparseOverscaled?Math.max(T.zoom,C):T.zoom;w.push({tileID:new ir(T.zoom===p?O:T.zoom,T.wrap,T.zoom,S,E),distanceSq:vI([_[0]-.5-S,_[1]-.5-E]),tileDistanceToCamera:Math.sqrt(L*L+j*j)})}else for(let M=0;M<4;M++){let L=(S<<1)+M%2,j=(E<<1)+(M>>1),O=T.zoom+1;b.push({zoom:O,x:L,y:j,wrap:T.wrap,fullyVisible:P})}}return w.sort((T,S)=>T.distanceSq-S.distanceSq).map(T=>T.tileID)}function n6(e){return e==="raster"||e==="image"||e==="video"}function VN(e,t,r,i,n,a,o){let s=Be(),l=wI(t);for(let u of t){let c=e.getTileById(u.key);(c.fadingDirection===0||c.fadeOpacity===0)&&c.resetFadeLogic(),!UN(e,c,r,s,i,n,o)&&($N(e,c,r,s,a,o)||qN(c,l,s,o)||c.resetFadeLogic())}}function UN(e,t,r,i,n,a,o){if(!t.hasData())return!1;let{tileID:s,fadingRole:l,fadingDirection:u,fadingParentID:c}=t;if(l===0&&u===1&&c)return r[c.key]=c,!0;let h=Math.max(s.overscaledZ-n,a);for(let p=s.overscaledZ-1;p>=h;p--){let d=s.scaledTo(p),f=e.getLoadedTile(d);if(f)return t.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:f.tileID,fadeEndTime:i+o}),f.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:i+o}),r[d.key]=d,!0}return!1}function $N(e,t,r,i,n,a){if(!t.hasData())return!1;let o=t.tileID.children(n),s=a6(e,t,o,r,i,n,a);if(s)return!0;for(let l of o)a6(e,t,l.children(n),r,i,n,a)&&(s=!0);return s}function a6(e,t,r,i,n,a,o){if(r[0].overscaledZ>a)return!1;let s=!1;for(let l of r){let u=e.getLoadedTile(l);if(!u)continue;let{fadingRole:c,fadingDirection:h,fadingParentID:p}=u;(c!==0||h!==0||!p)&&(u.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:t.tileID,fadeEndTime:n+o}),t.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:n+o})),i[l.key]=l,s=!0}return s}function qN(e,t,r,i){let n=e.tileID;if(e.selfFading)return!0;if(e.hasData())return!1;if(t.has(n)){let a=r+i;return e.setSelfFadeLogic(a),!0}return!1}function GN(e,t){if(t<=0)return!1;let r=Be();for(let i of e.getAllTiles())if(i.fadeEndTime>=r)return!0;return!1}function ZN(e,t){let r=t.getRenderableIds();for(let i of r){if(!e.neighboringTiles?.[i])continue;let n=t.getTileById(i);e.neighboringTiles[i].backfilled||o6(e,n),!n.neighboringTiles?.[e.tileID.key]?.backfilled&&o6(n,e)}}function o6(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x,i=t.tileID.canonical.y-e.tileID.canonical.y,n=2**e.tileID.canonical.z,a=t.tileID.key;(r!==0||i!==0)&&(Math.abs(i)>1||(Math.abs(r)>1&&(Math.abs(r+n)===1?r+=n:Math.abs(r-n)===1&&(r-=n)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,i),e.neighboringTiles?.[a]&&(e.neighboringTiles[a].backfilled=!0))))}var s6=class{constructor(){this._tiles={}}handleWrapJump(e){let t={};for(let r in this._tiles){let i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),t[i.tileID.key]=i}this._tiles=t}setFeatureState(e,t,r){for(let i in this._tiles)this._tiles[i].setFeatureState(e,t,r)}getAllTiles(){return Object.values(this._tiles)}getAllIds(e=!1){return e?Object.values(this._tiles).map(t=>t.tileID).sort(O4).map(t=>t.key):Object.keys(this._tiles)}getTileById(e){return this._tiles[e]}setTile(e,t){this._tiles[e]=t}deleteTileById(e){delete this._tiles[e]}getLoadedTile(e){let t=this.getTileById(e.key);return t?.hasData()?t:null}isIdRenderable(e,t=!1){return this.getTileById(e)?.isRenderable(t)}getRenderableIds(e=0,t){let r=[];for(let i of this.getAllIds())this.isIdRenderable(i,t)&&r.push(this.getTileById(i));return t?r.sort((i,n)=>{let a=i.tileID,o=n.tileID,s=new k(a.canonical.x,a.canonical.y)._rotate(-e),l=new k(o.canonical.x,o.canonical.y)._rotate(-e);return a.overscaledZ-o.overscaledZ||l.y-s.y||l.x-s.x}).map(i=>i.tileID.key):r.map(i=>i.tileID).sort(O4).map(i=>i.key)}},Un,b_=(Un=class extends lr{constructor(t,r,i){super(),this._maxContentElevationSeen=0,this.id=t,this.dispatcher=i,this.on("data",n=>{this._dataHandler(n)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",n=>{n.tile||(this._sourceErrored=this._source.loaded())}),this._source=$B(t,r,i,this),this._inViewTiles=new s6,this._outOfViewCache=new MN(0,n=>this._unloadTile(n)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new IN,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source?.onAdd&&this._source.onAdd(t)}onRemove(t){for(let r of this._inViewTiles.getAllTiles())r.unloadVectorData();this.clearTiles(),this._source?.onRemove&&this._source.onRemove(t),this._inViewTiles=new s6}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((this.used!==void 0||this.usedForTerrain!==void 0)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}async _loadTile(t,r,i,n){try{let a=await this._source.loadTile(t);this._tileLoaded(t,r,i,n,a)}catch(a){t.state="errored",a.status===404?this.update(this.transform,this.terrain):this._source.fire(new ee(Xt(a),{tile:t}))}}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new et("dataabort",{tile:t,coord:t.tileID}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.style);for(let r of this._inViewTiles.getAllTiles())r.upload(t),r.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians,t)}hasRenderableParent(t){let r=t.overscaledZ-1;if(r>=this._source.minzoom){let i=this.getLoadedTile(t.scaledTo(r));if(i)return this._inViewTiles.isIdRenderable(i.tileID.key)}return!1}reload(t,r=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let i of this._inViewTiles.getAllIds()){let n=this._inViewTiles.getTileById(i);(!r||this._source.shouldReloadTile(n,r))&&(t?this._reloadTile(i,n.state==="errored"?"loading":"expired"):n.state!=="errored"&&this._reloadTile(i,"reloading"))}}}async _reloadTile(t,r){let i=this._inViewTiles.getTileById(t);if(!i)return;let n=i.hasData();i.state!=="loading"&&(i.state=r),await this._loadTile(i,t,r,n)}_tileLoaded(t,r,i,n,a){n||(t.timeAdded=Be(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration)),i==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),!a?.unmodified&&(this.getSource().type==="raster-dem"&&t.dem&&ZN(t,this._inViewTiles),t.featureStateRevision=-1,this._state.initializeTileState(t,this.style),t.aborted||this._source.fire(new et("data",{tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,r){let i=this._getLoadedDescendents(r),n=new Set;for(let a of r){let o=i[a.key];if(!o?.length){n.add(a);continue}let s=a.overscaledZ+Un.maxOverzooming,l=o.filter(h=>h.tileID.overscaledZ<=s);if(!l.length){n.add(a);continue}let u=Math.min(...l.map(h=>h.tileID.overscaledZ)),c=l.filter(h=>h.tileID.overscaledZ===u).map(h=>h.tileID);for(let h of c)t[h.key]=h;this._areDescendentsComplete(c,u,a.overscaledZ)||n.add(a)}return n}_getLoadedDescendents(t){var i;let r={};for(let n of this._inViewTiles.getAllTiles().filter(a=>a.hasData()))for(let a of t)n.tileID.isChildOf(a)&&(r[i=a.key]||(r[i]=[]),r[a.key].push(n));return r}_areDescendentsComplete(t,r,i){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===r:4**(r-i)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let r=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),i=this._maxTileCacheZoomLevels===null?bo.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,n=Math.floor(r*i),a=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,n):n;this._outOfViewCache.setMaxSize(a)}handleWrapJump(t){let r=(t-(this._prevLng===void 0?t:this._prevLng))/360,i=Math.round(r);this._prevLng=t,i&&(this._inViewTiles.handleWrapJump(i),this._resetTileReloadTimers())}_updateMaxContentElevation(){let t=this._maxContentElevationSeen,r=this.map?.style?._layers;if(!r)return t;let i=this._inViewTiles.getAllTiles();for(let n in r){let a=r[n];if(a.type!=="symbol"||a.source!==this.id||a.isHidden(this.transform.zoom))continue;let o=a;if(!o.layout)continue;let s=o.layout.get("symbol-height-offset");if(t=Math.max(t,s.constantOr(0)),!s.isConstant())for(let l of i){let u=l.getBucket(a);u&&u.maxHeightOffset>t&&(t=u.maxHeightOffset)}}return this._maxContentElevationSeen=t,t}update(t,r){if(!this._sourceLoaded||this._paused)return;this.transform=t,this.terrain=r,this.updateCacheSize(t),this.transform.worldCoordinateHelper.wraps&&this.handleWrapJump(this.transform.center.lng);let i;!this.used&&!this.usedForTerrain?i=[]:this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(l=>new ir(l.canonical.z,l.wrap,l.canonical.z,l.canonical.x,l.canonical.y)):(i=Cc(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?Math.max(this._source.maxzoom,t.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom,maxContentElevation:this._updateMaxContentElevation()}),this._source.hasTile&&(i=i.filter(l=>this._source.hasTile(l)))),this.usedForTerrain&&(i=this._addTerrainIdealTiles(i));let n=i.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,n&&this.fire(new et("data",{sourceDataType:"idle",sourceId:this.id}));let a=Ov(t,this._source),o=this._updateRetainedTiles(i,a),s=n6(this._source.type);s&&this._rasterFadeDuration>0&&!r&&VN(this._inViewTiles,i,o,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),s?this._cleanUpRasterTiles(o):this._cleanUpVectorTiles(o)}_cleanUpRasterTiles(t){for(let r of this._inViewTiles.getAllIds())t[r]||this._removeTile(r)}_cleanUpVectorTiles(t){for(let r of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(r);t[r]?i.clearSymbolFadeHold():i.hasSymbolBuckets?i.holdingForSymbolFade()?i.symbolFadeFinished()&&this._removeTile(r):i.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(r)}}_addTerrainIdealTiles(t){let r=[];for(let i of t)if(i.canonical.z>this._source.minzoom){let n=i.scaledTo(i.canonical.z-1);r.push(n);let a=i.scaledTo(Math.max(this._source.minzoom,Math.min(i.canonical.z,5)));r.push(a)}return t.concat(r)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,r){let i=new Set;for(let l of t)this._addTile(l).hasData()||i.add(l);let n=t.reduce((l,u)=>(l[u.key]=u,l),{}),a=this._retainLoadedChildren(n,i),o={},s=Math.max(r-Un.maxUnderzooming,this._source.minzoom);for(let l of a){let u=this._inViewTiles.getTileById(l.key),c=u?.wasRequested();for(let h=l.overscaledZ-1;h>=s;--h){let p=l.scaledTo(h);if(o[p.key])break;if(o[p.key]=!0,u=this.getTile(p),!u&&c&&(u=this._addTile(p)),u){let d=u.hasData();if((d||!this.map?.cancelPendingTileRequestsWhileZooming||c)&&(n[p.key]=p),c=u.wasRequested(),d)break}}}return n}_addTile(t){let r=this._inViewTiles.getTileById(t.key);if(r)return r;r=this._outOfViewCache.getAndRemove(t),r&&(r.resetFadeLogic(),this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.style));let i=r;return r||(r=new dP(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,t.key,r.state,!1)),r.uses++,this._inViewTiles.setTile(t.key,r),i||this._source.fire(new et("dataloading",{tile:r,coord:r.tileID})),r}_setTileReloadTimer(t,r){this._clearTileReloadTimer(t);let i=r.getExpiryTimeout();if(i){let n=()=>{this._reloadTile(t,"expired"),delete this._timers[t]};this._timers[t]=setTimeout(n,i)}}_clearTileReloadTimer(t){let r=this._timers[t];r&&(clearTimeout(r),delete this._timers[t])}_resetTileReloadTimers(){for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,r)}}refreshTiles(t){for(let r of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(r);(this._inViewTiles.isIdRenderable(r)||i.state=="errored")&&t.some(n=>n.equals(i.tileID.canonical))&&this._reloadTile(r,"expired")}}_removeTile(t){let r=this._inViewTiles.getTileById(t);r&&(r.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),!(r.uses>0)&&(r.hasData()&&r.state!=="reloading"?this._outOfViewCache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(t){t.dataType==="source"&&(t.sourceDataType==="metadata"?this._sourceLoaded=!0:t.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0))}resetMaxContentElevation(){this._maxContentElevationSeen=0}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1,this.resetMaxContentElevation();for(let t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,r,i){let n=[],a=this.transform;if(!a)return n;let o=a.getCoveringTilesDetailsProvider().allowWorldCopies(),s=i?a.getCameraQueryGeometry(t):t,l=d=>a.screenPointToMercatorCoordinate(d,this.terrain),u=this.transformBbox(t,l,!o),c=this.transformBbox(s,l,!o),h=this.getIds(),p=qi.fromPoints(c);for(let d of h){let f=this._inViewTiles.getTileById(d);if(f.holdingForSymbolFade())continue;let m=o?[f.tileID]:[f.tileID.unwrapTo(-1),f.tileID.unwrapTo(0)],_=2**(a.zoom-f.tileID.overscaledZ),g=r*f.queryPadding*R/f.tileSize/_;for(let y of m){let v=p.map(x=>y.getTilePoint(new sr(x.x,x.y)));if(v.expandBy(g),v.intersects(Rz)){let x=u.map(w=>y.getTilePoint(w)),b=c.map(w=>y.getTilePoint(w));n.push({tile:f,tileID:o?y:y.unwrapTo(0),queryGeometry:x,cameraQueryGeometry:b,scale:_})}}}return n}transformBbox(t,r,i){let n=t.map(r);if(i){let a=qi.fromPoints(t);a.shrinkBy(Math.min(a.width(),a.height())*.001);let o=a.map(r);qi.fromPoints(n).covers(o)||(n=n.map(s=>s.x>.5?new sr(s.x-1,s.y,s.z):s))}return n}getVisibleCoordinates(t){let r=this.getRenderableIds(t).map(i=>this._inViewTiles.getTileById(i).tileID);return this.transform&&this.transform.populateCache(r),r}hasTransition(){return this._source.hasTransition()?!0:n6(this._source.type)&&GN(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,r,i){t||(t=hd),this._state.updateState(t,r,i)}removeFeatureState(t,r,i){t||(t=hd),this._state.removeFeatureState(t,r,i)}getFeatureState(t,r){return t||(t=hd),this._state.getState(t,r)}setDependencies(t,r,i){let n=this._inViewTiles.getTileById(t);n&&n.setDependencies(r,i)}reloadTilesForDependencies(t,r){for(let i of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(i).hasDependency(t,r)&&this._reloadTile(i,"reloading");this._outOfViewCache.filter(i=>!i.hasDependency(t,r))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}},Un.maxUnderzooming=10,Un.maxOverzooming=3,Un),HN=class{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,this.length*.5),this.paddedLength=this.length-this.padding*2}lerp(e){if(this.points.length===1)return this.points[0];e=Q(e,0,1);let t=1,r=this._distances[t],i=e*this.paddedLength+this.padding;for(;r<i&&t<this._distances.length;)r=this._distances[++t];let n=t-1,a=this._distances[n],o=r-a,s=o>0?(i-a)/o:0;return this.points[n].mult(1-s).add(this.points[t].mult(s))}};function pd(e,t,r,i,n){return n?e?e(t,r)+i:i===0?void 0:i:i}function Zp(e,t){let r=!0;return e==="always"||(e==="never"||t==="never")&&(r=!1),r}var l6=class{constructor(e,t,r){let i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let a=0;a<this.xCellCount*this.yCellCount;a++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}insertCircle(e,t,r,i){this._forEachCell(t-i,r-i,t+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(i)}_insertBoxCell(e,t,r,i,n,a){this.boxCells[n].push(a)}_insertCircleCell(e,t,r,i,n,a){this.circleCells[n].push(a)}_query(e,t,r,i,n,a,o){if(r<0||e>this.width||i<0||t>this.height)return[];let s=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=i){if(n)return[{key:null,x1:e,y1:t,x2:r,y2:i}];for(let l=0;l<this.boxKeys.length;l++)s.push({key:this.boxKeys[l],x1:this.bboxes[l*4],y1:this.bboxes[l*4+1],x2:this.bboxes[l*4+2],y2:this.bboxes[l*4+3]});for(let l=0;l<this.circleKeys.length;l++){let u=this.circles[l*3],c=this.circles[l*3+1],h=this.circles[l*3+2];s.push({key:this.circleKeys[l],x1:u-h,y1:c-h,x2:u+h,y2:c+h})}}else{let l={hitTest:n,overlapMode:a,seenUids:{box:{},circle:{}}};this._forEachCell(e,t,r,i,this._queryCell,s,l,o)}return s}query(e,t,r,i){return this._query(e,t,r,i,!1,null)}hitTest(e,t,r,i,n,a){return this._query(e,t,r,i,!0,n,a).length>0}hitTestCircle(e,t,r,i,n){let a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!1;let u=[],c={hitTest:!0,overlapMode:i,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,u,c,n),u.length>0}_queryCell(e,t,r,i,n,a,o,s){let{seenUids:l,hitTest:u,overlapMode:c}=o,h=this.boxCells[n],p=1e-6;if(h!==null){let f=this.bboxes;for(let m of h)if(!l.box[m]){l.box[m]=!0;let _=m*4,g=this.boxKeys[m];if(e<=f[_+2]+p&&t<=f[_+3]+p&&r>=f[_+0]-p&&i>=f[_+1]-p&&(!s||s(g))&&(!u||!Zp(c,g.overlapMode))&&(a.push({key:g,x1:f[_],y1:f[_+1],x2:f[_+2],y2:f[_+3]}),u))return!0}}let d=this.circleCells[n];if(d!==null){let f=this.circles;for(let m of d)if(!l.circle[m]){l.circle[m]=!0;let _=m*3,g=this.circleKeys[m];if(this._circleAndRectCollide(f[_],f[_+1],f[_+2],e,t,r,i)&&(!s||s(g))&&(!u||!Zp(c,g.overlapMode))){let y=f[_],v=f[_+1],x=f[_+2];if(a.push({key:g,x1:y-x,y1:v-x,x2:y+x,y2:v+x}),u)return!0}}}return!1}_queryCellCircle(e,t,r,i,n,a,o,s){let{circle:l,seenUids:u,overlapMode:c}=o,h=this.boxCells[n];if(h!==null){let d=this.bboxes;for(let f of h)if(!u.box[f]){u.box[f]=!0;let m=f*4,_=this.boxKeys[f];if(this._circleAndRectCollide(l.x,l.y,l.radius,d[m+0],d[m+1],d[m+2],d[m+3])&&(!s||s(_))&&!Zp(c,_.overlapMode))return a.push(!0),!0}}let p=this.circleCells[n];if(p!==null){let d=this.circles;for(let f of p)if(!u.circle[f]){u.circle[f]=!0;let m=f*3,_=this.circleKeys[f];if(this._circlesCollide(d[m],d[m+1],d[m+2],l.x,l.y,l.radius)&&(!s||s(_))&&!Zp(c,_.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,r,i,n,a,o,s){let l=this._convertToXCellCoord(e),u=this._convertToYCellCoord(t),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(i);for(let p=l;p<=c;p++)for(let d=u;d<=h;d++){let f=this.xCellCount*d+p;if(n.call(this,e,t,r,i,f,a,o,s))return}}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,r,i,n,a){let o=i-e,s=n-t,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(e,t,r,i,n,a,o){let s=(a-i)/2,l=Math.abs(e-(i+s));if(l>s+r)return!1;let u=(o-n)/2,c=Math.abs(t-(n+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;let h=l-s,p=c-u;return h*h+p*p<=r*r}};function WN(e,t){let r=1/(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),i=1/(t[8]*t[8]+t[9]*t[9]+t[10]*t[10]),n=t[0]*r,a=t[4]*r,o=t[8]*i,s=t[1]*r,l=t[5]*r,u=t[9]*i,c=t[2]*r,h=t[6]*r,p=t[10]*i;e[0]=n,e[1]=a,e[2]=o,e[4]=s,e[5]=l,e[6]=u,e[8]=c,e[9]=h,e[10]=p;let d=t[12],f=t[13],m=t[14];return e[12]=-n*d-s*f-c*m,e[13]=-a*d-l*f-h*m,e[14]=-o*d-u*f-p*m,e[3]=0,e[7]=0,e[11]=0,e[15]=1,e}function YN(e,t){return e[0]=1/t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1/t[5],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=1/t[14],e[12]=0,e[13]=0,e[14]=-1,e[15]=t[10]/t[14],e}function XN(e,t){let r=1/(t[0]*t[5]-t[1]*t[4]);return e[0]=t[5]*r,e[1]=-t[1]*r,e[2]=0,e[3]=0,e[4]=-t[4]*r,e[5]=t[0]*r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1/t[10],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1/t[15],e}var KN=Do();function jv(e,t,r){let i=Do();if(!e){let{vecSouth:n,vecEast:a}=Nv(t),o=fT();o[0]=a[0],o[1]=a[1],o[2]=n[0],o[3]=n[1],$M(o,o),i[0]=o[0],i[1]=o[1],i[4]=o[2],i[5]=o[3]}return gr(i,i,[1/r,1/r,1]),i}function QN(e,t,r,i){if(e){let n=Do();if(!t){let{vecSouth:a,vecEast:o}=Nv(r);n[0]=o[0],n[1]=o[1],n[4]=a[0],n[5]=a[1]}return gr(n,n,[i,i,1]),n}return r.pixelsToClipSpaceMatrix}function Nv(e){let t=Math.cos(e.rollInRadians),r=Math.sin(e.rollInRadians),i=Math.cos(e.pitchInRadians),n=Math.cos(e.bearingInRadians),a=Math.sin(e.bearingInRadians),o=X1();o[0]=-n*i*r-a*t,o[1]=-a*i*r+n*t;let s=H3(o);s<1e-9?W3(o):Z3(o,o,1/s);let l=X1();l[0]=n*i*t-a*r,l[1]=a*i*t+n*r;let u=H3(l);return u<1e-9?W3(l):Z3(l,l,1/u),{vecEast:l,vecSouth:o}}function Eo(e,t,r){return pd(e.getElevation,t,r,e.heightOffset??0,e.heightAnchorGround??!0)}function Vv(e,t,r,i){let n;i==null?(n=[e,t,0,1],Uv(n,n,r)):(n=[e,t,i,1],nr(n,n,r));let a=n[3];return{point:new k(n[0]/a,n[1]/a),signedDistanceFromCamera:a,isOccluded:!1}}function gP(e,t){return .5+e/t*.5}function JN(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function eV(e,t,r,i,n,a,o,s,l,u,c,h){let p=i?e.textSizeData:e.iconSizeData,d=Sf(p,r.zoom),f=[256/t.width*2+1,256/t.height*2+1],m=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;m.clear();let _=e.lineVertexArray,g=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,y=r.width/r.height,v=!1;for(let x=0;x<g.length;x++){let b=g.get(x);if(b.hidden||b.writingMode===2&&!v){$s(b.numGlyphs,m);continue}v=!1;let w={getElevation:h,pitchedLabelPlaneMatrix:n,lineVertexArray:_,pitchWithMap:o,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:r,tileAnchorPoint:new k(b.anchorX,b.anchorY),unwrappedTileID:u,width:r.width,height:r.height,translation:c},T=vP(b.anchorX,b.anchorY,w);if(!JN(T.point,f)){$s(b.numGlyphs,m);continue}let S=T.signedDistanceFromCamera,E=gP(r.cameraToCenterDistance,S),P=yv(p,d,b),D=o?P*r.getPitchedTextCorrection(b.anchorX,b.anchorY,u)/E:P*E,F=c6({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:D,flip:!1,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:y,rotateToLine:l});v=F.useVertical,(F.notEnoughRoom||v||F.needsFlipping&&c6({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:D,flip:!0,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:y,rotateToLine:l}).notEnoughRoom)&&$s(b.numGlyphs,m)}i?e.text.dynamicLayoutVertexBuffer.updateData(m):e.icon.dynamicLayoutVertexBuffer.updateData(m)}function yP(e,t,r,i,n,a,o,s){let l=a.glyphStartIndex+a.numGlyphs,u=a.lineStartIndex,c=a.lineStartIndex+a.lineLength,h=t.getoffsetX(a.glyphStartIndex),p=t.getoffsetX(l-1),d=Wd(e*h,r,i,n,a.segment,u,c,s,o);if(!d)return null;let f=Wd(e*p,r,i,n,a.segment,u,c,s,o);return!f||s.projectionCache.anyProjectionOccluded?null:{first:d,last:f}}function u6(e,t,r,i){return e===1&&Math.abs(r.y-t.y)>Math.abs(r.x-t.x)*i?{useVertical:!0}:(e===2?t.y<r.y:t.x>r.x)?{needsFlipping:!0}:null}function c6(e){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:r,symbol:i,fontSize:n,flip:a,keepUpright:o,glyphOffsetArray:s,dynamicLayoutVertexArray:l,aspectRatio:u,rotateToLine:c}=e,h=n/24,p=i.lineOffsetX*h,d=i.lineOffsetY*h,f;if(i.numGlyphs>1){let m=i.glyphStartIndex+i.numGlyphs,_=i.lineStartIndex,g=i.lineStartIndex+i.lineLength,y=yP(h,s,p,d,a,i,c,t);if(!y)return{notEnoughRoom:!0};let v=Hp(y.first.point.x,y.first.point.y,t,r),x=Hp(y.last.point.x,y.last.point.y,t,r);if(o&&!a){let b=u6(i.writingMode,v,x,u);if(b)return b}f=[y.first];for(let b=i.glyphStartIndex+1;b<m-1;b++){let w=Wd(h*s.getoffsetX(b),p,d,a,i.segment,_,g,t,c);if(!w)return{notEnoughRoom:!0};f.push(w)}f.push(y.last)}else{if(o&&!a){let _=Co(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,g=i.lineStartIndex+i.segment+1,y=new k(t.lineVertexArray.getx(g),t.lineVertexArray.gety(g)),v=Co(y.x,y.y,t),x=v.signedDistanceFromCamera>0?v.point:_P(t.tileAnchorPoint,y,_,1,t),b=Hp(_.x,_.y,t,r),w=Hp(x.x,x.y,t,r),T=u6(i.writingMode,b,w,u);if(T)return T}let m=Wd(h*s.getoffsetX(i.glyphStartIndex),p,d,a,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,t,c);if(!m||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};f=[m]}for(let m of f)$d(l,m.point,m.angle);return{}}function _P(e,t,r,i,n){let a=e.add(e.sub(t)._unit()),o=Co(a.x,a.y,n).point,s=r.sub(o);return r.add(s._mult(i/s.mag()))}function w_(e,t,r){let i=t.projectionCache;if(i.projections[e])return i.projections[e];let n=new k(t.lineVertexArray.getx(e),t.lineVertexArray.gety(e)),a=Co(n.x,n.y,t);if(a.signedDistanceFromCamera>0)return i.projections[e]=a.point,i.anyProjectionOccluded||(i.anyProjectionOccluded=a.isOccluded),a.point;let o=e-r.direction,s=r.distanceFromAnchor===0?t.tileAnchorPoint:new k(t.lineVertexArray.getx(o),t.lineVertexArray.gety(o)),l=r.absOffsetX-r.distanceFromAnchor+1;return _P(s,n,r.previousVertex,l,t)}function Co(e,t,r){let i=e+r.translation[0],n=t+r.translation[1],a;return r.pitchWithMap?(a=Vv(i,n,r.pitchedLabelPlaneMatrix,Eo(r,i,n)),a.isOccluded=!1):(a=r.transform.projectTileCoordinates(i,n,r.unwrappedTileID,Eo(r,i,n)),a.point.x=(a.point.x*.5+.5)*r.width,a.point.y=(-a.point.y*.5+.5)*r.height),a}function Hp(e,t,r,i){if(r.pitchWithMap){let n=[e,t,0,1];nr(n,n,i);let a=n[0]/n[3],o=n[1]/n[3];return r.transform.projectTileCoordinates(a,o,r.unwrappedTileID,Eo(r,a,o)).point}return{x:e/r.width*2-1,y:1-t/r.height*2}}function vP(e,t,r){return r.transform.projectTileCoordinates(e,t,r.unwrappedTileID,Eo(r,e,t))}function T_(e,t,r){return e._unit()._perp()._mult(t*r)}function tV(e,t,r,i,n,a,o,s,l){if(s.projectionCache.offsets[e])return s.projectionCache.offsets[e];let u=r.add(t);if(e+l.direction<i||e+l.direction>=n)return s.projectionCache.offsets[e]=u,u;let c=w_(e+l.direction,s,l),h=T_(c.sub(r),o,l.direction),p=r.add(h),d=c.add(h);return s.projectionCache.offsets[e]=PI(a,u,p,d)||u,s.projectionCache.offsets[e]}function Wd(e,t,r,i,n,a,o,s,l){let u=i?e-t:e+t,c=u>0?1:-1,h=0;i&&(c*=-1,h=Math.PI),c<0&&(h+=Math.PI);let p=c>0?a+n:a+n+1,d;s.projectionCache.cachedAnchorPoint?d=s.projectionCache.cachedAnchorPoint:(d=Co(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=d);let f=d,m=d,_,g,y=0,v=0,x=Math.abs(u),b=[],w;for(;y+v<=x;){if(p+=c,p<a||p>=o)return null;y+=v,m=f,g=_;let P={absOffsetX:x,direction:c,distanceFromAnchor:y,previousVertex:m};if(f=w_(p,s,P),r===0)b.push(m),w=f.sub(m);else{let D,F=f.sub(m);D=F.mag()===0?T_(w_(p+c,s,P).sub(f),r,c):T_(F,r,c),g||(g=m.add(D)),_=tV(p,D,f,a,o,g,r,s,P),b.push(g),w=_.sub(g)}v=w.mag()}let T=(x-y)/v,S=w._mult(T)._add(g||m),E=h+Math.atan2(f.y-m.y,f.x-m.x);return b.push(S),{point:S,angle:l?E:0,path:b}}var rV=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function $s(e,t){for(let r=0;r<e;r++){let i=t.length;t.resize(i+4),t.float32.set(rV,i*3)}}function Uv(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e[3]=r[3]*i+r[7]*n+r[15],e}function iV(e,t){let r=KN;return XN(r,t.pitchedLabelPlaneMatrix),e.map(i=>{let n=Vv(i.x,i.y,r,Eo(t,i.x,i.y)),a=t.transform.projectTileCoordinates(n.point.x,n.point.y,t.unwrappedTileID,Eo(t,n.point.x,n.point.y));return a.point.x=(a.point.x*.5+.5)*t.width,a.point.y=(-a.point.y*.5+.5)*t.height,a})}function nV(e){let t=0,r=0,i=0,n=0;for(let a=0;a<e.length;a++)e[a].isOccluded?(i=a+1,n=0):(n++,n>r&&(r=n,t=i));return e.slice(t,t+r)}var aV=class{constructor(e,t=new l6(e.width+200,e.height+200,25),r=new l6(e.width+200,e.height+200,25)){this.transform=e,this.grid=t,this.ignoredGrid=r,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,i,n,a,o,s,l,u,c,h,p=0,d=!0){let f=e.anchorPointX+s[0],m=e.anchorPointY+s[1],_=this.projectAndGetPerspectiveRatio(f,m,n,pd(u,f,m,p,d),h),g=r*_.perspectiveRatio,y;if(!a&&!o){let E=_.x+(c?c.x*g:0),P=_.y+(c?c.y*g:0);y={allPointsOccluded:!1,box:[E+e.x1*g,P+e.y1*g,E+e.x2*g,P+e.y2*g]}}else y=this._projectCollisionBox(e,g,i,n,a,o,s,_,u,c,h,p,d);let[v,x,b,w]=y.box,T=a?y.allPointsOccluded:_.isOccluded,S=T;return S||(S=_.perspectiveRatio<this.perspectiveRatioCutoff),S||(S=!this.isInsideGrid(v,x,b,w)),S||t!=="always"&&this.grid.hitTest(v,x,b,w,t,l)?{box:[v,x,b,w],placeable:!1,offscreen:!1,occluded:T}:{box:[v,x,b,w],placeable:!0,offscreen:this.isOffscreen(v,x,b,w),occluded:T}}placeCollisionCircles(e,t,r,i,n,a,o,s,l,u,c,h,p,d){let f=[],m=new k(t.anchorX,t.anchorY),_=this.getPerspectiveRatio(m.x,m.y,a,d?.(m.x,m.y)),g=(l?n*this.transform.getPitchedTextCorrection(t.anchorX,t.anchorY,a)/_:n*_)/24,y={projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},v=t.lineOffsetX*g,x=t.lineOffsetY*g,b={getElevation:d,pitchedLabelPlaneMatrix:o,lineVertexArray:r,pitchWithMap:l,projectionCache:y,transform:this.transform,tileAnchorPoint:m,unwrappedTileID:a,width:this.transform.width,height:this.transform.height,translation:p},w=yP(g,i,v,x,!1,t,!1,b),T=!1,S=!1,E=!0;if(w){let P=c*.5*_+h,D=new k(-100,-100),F=new k(this.screenRightBoundary,this.screenBottomBoundary),I=new HN,C=w.first,A=w.last,M=[];for(let O=C.path.length-1;O>=1;O--)M.push(C.path[O]);for(let O=1;O<A.path.length;O++)M.push(A.path[O]);let L=P*2.5;if(l){let O=this.projectPathToScreenSpace(M,b);M=O.some(Y=>Y.signedDistanceFromCamera<=0)?[]:O.map(Y=>Y.point)}let j=[];if(M.length>0){let O=M[0].clone(),Y=M[0].clone();for(let ue=1;ue<M.length;ue++)O.x=Math.min(O.x,M[ue].x),O.y=Math.min(O.y,M[ue].y),Y.x=Math.max(Y.x,M[ue].x),Y.y=Math.max(Y.y,M[ue].y);j=O.x>=D.x&&Y.x<=F.x&&O.y>=D.y&&Y.y<=F.y?[M]:Y.x<D.x||O.x>F.x||Y.y<D.y||O.y>F.y?[]:yC([M],D.x,D.y,F.x,F.y)}for(let O of j){I.reset(O,P*.25);let Y=0;Y=I.length<=.5*P?1:Math.ceil(I.paddedLength/L)+1;for(let ue=0;ue<Y;ue++){let pe=ue/Math.max(Y-1,1),de=I.lerp(pe),je=de.x+100,Se=de.y+100;f.push(je,Se,P,0);let ae=je-P,oe=Se-P,$e=je+P,qe=Se+P;if(E&&(E=this.isOffscreen(ae,oe,$e,qe)),S||(S=this.isInsideGrid(ae,oe,$e,qe)),e!=="always"&&this.grid.hitTestCircle(je,Se,P,e,u)&&(T=!0,!s))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!s&&T||!S||_<this.perspectiveRatioCutoff?[]:f,offscreen:E,collisionDetected:T}}projectPathToScreenSpace(e,t){return nV(iV(e,t))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let t=[],r=new qi;for(let c of e){let h=new k(c.x+100,c.y+100);r.extend(h),t.push(h)}let{minX:i,minY:n,maxX:a,maxY:o}=r,s=this.grid.query(i,n,a,o).concat(this.ignoredGrid.query(i,n,a,o)),l={},u={};for(let c of s){let h=c.key;l[h.bucketInstanceId]===void 0&&(l[h.bucketInstanceId]={}),!l[h.bucketInstanceId][h.featureIndex]&&yE(t,[new k(c.x1,c.y1),new k(c.x2,c.y1),new k(c.x2,c.y2),new k(c.x1,c.y2)])&&(l[h.bucketInstanceId][h.featureIndex]=!0,u[h.bucketInstanceId]===void 0&&(u[h.bucketInstanceId]=[]),u[h.bucketInstanceId].push(h.featureIndex))}return u}insertCollisionBox(e,t,r,i,n,a){let o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t};o.insert(s,e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,i,n,a){let o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t};for(let l=0;l<e.length;l+=4)o.insertCircle(s,e[l],e[l+1],e[l+2])}projectAndGetPerspectiveRatio(e,t,r,i,n){if(n){let a;i==null?(a=[e,t,0,1],Uv(a,a,n)):(a=[e,t,i,1],nr(a,a,n));let o=a[3];return{x:(a[0]/o+1)/2*this.transform.width+100,y:(-a[1]/o+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/o),isOccluded:!1,signedDistanceFromCamera:o}}{let a=this.transform.projectTileCoordinates(e,t,r,i);return{x:(a.point.x+1)/2*this.transform.width+100,y:(-a.point.y+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/a.signedDistanceFromCamera),isOccluded:a.isOccluded,signedDistanceFromCamera:a.signedDistanceFromCamera}}}getPerspectiveRatio(e,t,r,i){let n=this.transform.projectTileCoordinates(e,t,r,i);return .5+.5*(this.transform.cameraToCenterDistance/n.signedDistanceFromCamera)}isOffscreen(e,t,r,i){return r<100||e>=this.screenRightBoundary||i<100||t>this.screenBottomBoundary}isInsideGrid(e,t,r,i){return r>=0&&e<this.gridRightBoundary&&i>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=Gi([]);return At(e,e,[-100,-100,0]),e}_projectCollisionBox(e,t,r,i,n,a,o,s,l,u,c,h=0,p=!0){let d=1,f=0,m=0,_=1,g=e.anchorPointX+o[0],y=e.anchorPointY+o[1];if(a&&!n){let A=this.projectAndGetPerspectiveRatio(g+1,y,i,pd(l,g+1,y,h,p),c),M=A.x-s.x,L=A.y-s.y,j=Math.atan(L/M)+(M<0?Math.PI:0),O=Math.sin(j),Y=Math.cos(j);d=Y,f=O,m=-O,_=Y}else if(!a&&n){let A=Nv(this.transform);d=A.vecEast[0],f=A.vecEast[1],m=A.vecSouth[0],_=A.vecSouth[1]}let v=s.x,x=s.y,b=t;if(n&&(v=g,x=y,b=2**-(this.transform.zoom-r.overscaledZ),b*=this.transform.getPitchedTextCorrection(g,y,i),!u)){let A=Q(.5+.5*(s.signedDistanceFromCamera/this.transform.cameraToCenterDistance),0,4);b*=A}u&&(v+=d*u.x*b+m*u.y*b,x+=f*u.x*b+_*u.y*b);let w=e.x1*b,T=e.x2*b,S=(w+T)/2,E=e.y1*b,P=e.y2*b,D=(E+P)/2,F=[{offsetX:w,offsetY:E},{offsetX:S,offsetY:E},{offsetX:T,offsetY:E},{offsetX:T,offsetY:D},{offsetX:T,offsetY:P},{offsetX:S,offsetY:P},{offsetX:w,offsetY:P},{offsetX:w,offsetY:D}],I=[];for(let{offsetX:A,offsetY:M}of F)I.push(new k(v+d*A+m*M,x+f*A+_*M));let C=!1;if(n){let A=I.map(M=>this.projectAndGetPerspectiveRatio(M.x,M.y,i,pd(l,M.x,M.y,h,p),c));C=A.some(M=>!M.isOccluded),I=A.map(M=>new k(M.x,M.y))}else C=!0;return{box:bI(I),allPointsOccluded:!C}}},h6=class{constructor(e,t,r,i){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):i&&r?1:0,this.placed=r}isHidden(){return this.opacity===0&&!this.placed}},wu=class{constructor(e,t,r,i,n){this.text=new h6(e?e.text:null,t,r,n),this.icon=new h6(e?e.icon:null,t,i,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},p6=class{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}},oV=class{constructor(e,t,r,i,n){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n}},sV=class{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:r=>r.collisionGroupID===t}}return this.collisionGroups[e]}};function d6(e,t,r,i,n){let{horizontalAlign:a,verticalAlign:o}=Tf(e),s=-(a-.5)*t,l=-(o-.5)*r;return new k(s+i[0]*n,l+i[1]*n)}var lV=kF.members.find(e=>e.name==="crossTileID").offset/4,uV=class{constructor(e,t,r,i,n){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new aV(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new sV(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.lastOpacityInputs=new WeakMap,this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let t=this.terrain;if(t)return(r,i)=>t.getElevation(e,r,i)}getBucketParts(e,t,r,i){let n=r.getBucket(t),a=r.latestFeatureIndex;if(!n||!a||t.id!==n.layerIds[0])return;let o=r.collisionBoxArray,s=n.layers[0].layout,l=n.layers[0].paint,u=2**(this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/R,h=r.tileID.toUnwrapped(),p=s.get("text-rotation-alignment")==="map",d=ii(r,1,this.transform.zoom),f=Fa(this.collisionIndex.transform,r,l.get("text-translate"),l.get("text-translate-anchor")),m=Fa(this.collisionIndex.transform,r,l.get("icon-translate"),l.get("icon-translate-anchor")),_=jv(p,this.transform,d);this.retainedQueryData[n.bucketInstanceId]=new oV(n.bucketInstanceId,a,n.sourceLayerIndex,n.index,r.tileID);let g={bucket:n,layout:s,translationText:f,translationIcon:m,unwrappedTileID:h,pitchedLabelPlaneMatrix:_,scale:u,textPixelRatio:c,holdingForFade:r.holdingForSymbolFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:Sf(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(i)for(let y of n.sortKeyRanges){let{sortKey:v,symbolInstanceStart:x,symbolInstanceEnd:b}=y;e.push({sortKey:v,symbolInstanceStart:x,symbolInstanceEnd:b,parameters:g})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:g})}attemptAnchorPlacement(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y,v,x,b){let w=o_[e.textAnchor],T=[e.textOffset0,e.textOffset1],S=d6(w,r,i,T,n),E=this.collisionIndex.placeCollisionBox(t,h,s,l,u,o,a,m,c.predicate,y,S,v,x,b);if((!g||this.collisionIndex.placeCollisionBox(g,h,s,l,u,o,a,_,c.predicate,y,S,v,x,b).placeable)&&E.placeable){let P;if(this.prevPlacement?.variableOffsets[p.crossTileID]&&this.prevPlacement?.placements[p.crossTileID]?.text&&(P=this.prevPlacement.variableOffsets[p.crossTileID].anchor),p.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:T,width:r,height:i,anchor:w,textBoxScale:n,prevAnchor:P},this.markUsedJustification(d,w,p,f),d.allowVerticalPlacement&&(this.markUsedOrientation(d,f,p),this.placedOrientations[p.crossTileID]=f),{shift:S,placedGlyphBoxes:E}}}placeLayerBucketPart(e,t,r){let{bucket:i,layout:n,translationText:a,translationIcon:o,unwrappedTileID:s,pitchedLabelPlaneMatrix:l,textPixelRatio:u,holdingForFade:c,collisionBoxArray:h,partiallyEvaluatedTextSize:p,collisionGroup:d}=e.parameters,f=n.get("text-optional"),m=n.get("icon-optional"),_=Ud(n,"text-overlap","text-allow-overlap"),g=_==="always",y=Ud(n,"icon-overlap","icon-allow-overlap"),v=y==="always",x=n.get("text-rotation-alignment")==="map",b=n.get("text-pitch-alignment")==="map",w=n.get("icon-text-fit")!=="none",T=n.get("symbol-z-order")==="viewport-y",S=n.get("symbol-height-anchor")==="ground",E=g&&(v||!i.hasIconData()||m),P=v&&(g||!i.hasTextData()||f);!i.collisionArrays&&h&&i.deserializeCollisionBoxes(h);let D=this.retainedQueryData[i.bucketInstanceId].tileID,F=this._getTerrainElevationFunc(D),I=this.transform.getFastPathSimpleProjectionMatrix(D),C=(A,M,L)=>{if(t[A.crossTileID])return;if(c){this.placements[A.crossTileID]=new p6(!1,!1,!1);return}let j=A.heightOffset,O=!1,Y=!1,ue=!0,pe=null,de={box:null,placeable:!1,offscreen:null,occluded:!1},je={box:null,placeable:!1,offscreen:null},Se=null,ae=null,oe=null,$e=0,qe=0,mt=0;M.textFeatureIndex?$e=M.textFeatureIndex:A.useRuntimeCollisionCircles&&($e=A.featureIndex),M.verticalTextFeatureIndex&&(qe=M.verticalTextFeatureIndex);let Et=M.textBox;if(Et){let ye=X=>{let ie=1;if(i.allowVerticalPlacement&&!X&&this.prevPlacement){let Z=this.prevPlacement.placedOrientations[A.crossTileID];Z&&(this.placedOrientations[A.crossTileID]=Z,ie=Z,this.markUsedOrientation(i,ie,A))}return ie},se=(X,ie)=>{if(i.allowVerticalPlacement&&A.numVerticalGlyphVertices>0&&M.verticalTextBox){for(let Z of i.writingModes)if(Z===2?(de=ie(),je=de):de=X(),de?.placeable)break}else de=X()},N=A.textAnchorOffsetStartIndex,De=A.textAnchorOffsetEndIndex;if(De===N){let X=(ie,Z)=>{let Ee=this.collisionIndex.placeCollisionBox(ie,_,u,D,s,b,x,a,d.predicate,F,void 0,I,j,S);return Ee?.placeable&&(this.markUsedOrientation(i,Z,A),this.placedOrientations[A.crossTileID]=Z),Ee};se(()=>X(Et,1),()=>{let ie=M.verticalTextBox;return i.allowVerticalPlacement&&A.numVerticalGlyphVertices>0&&ie?X(ie,2):{box:null,offscreen:null}}),ye(de?.placeable)}else{let X=o_[this.prevPlacement?.variableOffsets[A.crossTileID]?.anchor],ie=(Ee,Ze,Ae)=>{let Ct=Ee.x2-Ee.x1,Va=Ee.y2-Ee.y1,wn=A.textBoxScale,Ki=w&&y==="never"?Ze:null,vr=null,Ue=_==="never"?1:2,rt="never";X&&Ue++;for(let ai=0;ai<Ue;ai++){for(let oi=N;oi<De;oi++){let Bo=i.textAnchorOffsets.get(oi);if(X&&Bo.textAnchor!==X)continue;let Pt=this.attemptAnchorPlacement(Bo,Ee,Ct,Va,wn,x,b,u,D,s,d,rt,A,i,Ae,a,o,Ki,F,I,j,S);if(Pt&&(vr=Pt.placedGlyphBoxes,vr?.placeable))return O=!0,pe=Pt.shift,vr}X?X=null:rt=_}return r&&!vr&&(vr={box:this.collisionIndex.placeCollisionBox(Et,"always",u,D,s,b,x,a,d.predicate,F,void 0,I,j,S).box,offscreen:!1,placeable:!1,occluded:!1}),vr};se(()=>ie(Et,M.iconBox,1),()=>{let Ee=M.verticalTextBox,Ze=de?.placeable;return i.allowVerticalPlacement&&!Ze&&A.numVerticalGlyphVertices>0&&Ee?ie(Ee,M.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),de&&(O=de.placeable,ue=de.offscreen);let Z=ye(de?.placeable);if(!O&&this.prevPlacement){let Ee=this.prevPlacement.variableOffsets[A.crossTileID];Ee&&(this.variableOffsets[A.crossTileID]=Ee,this.markUsedJustification(i,Ee.anchor,A,Z))}}}if(Se=de,O=Se?.placeable,ue=Se?.offscreen,A.useRuntimeCollisionCircles&&A.centerJustifiedTextSymbolIndex>=0){let ye=i.text.placedSymbolArray.get(A.centerJustifiedTextSymbolIndex),se=yv(i.textSizeData,p,ye),N=n.get("text-padding"),De=A.collisionCircleDiameter;ae=this.collisionIndex.placeCollisionCircles(_,ye,i.lineVertexArray,i.glyphOffsetArray,se,s,l,r,b,d.predicate,De,N,a,F),ae.circles.length&&ae.collisionDetected&&!r&&we("Collisions detected, but collision boxes are not shown"),O=g||ae.circles.length>0&&!ae.collisionDetected,ue&&(ue=ae.offscreen)}if(M.iconFeatureIndex&&(mt=M.iconFeatureIndex),M.iconBox){let ye=se=>this.collisionIndex.placeCollisionBox(se,y,u,D,s,b,x,o,d.predicate,F,w&&pe?pe:void 0,I,j,S);je&&je.placeable&&M.verticalIconBox?(oe=ye(M.verticalIconBox),Y=oe.placeable):(oe=ye(M.iconBox),Y=oe.placeable),ue&&(ue=oe.offscreen)}let kt=f||A.numHorizontalGlyphVertices===0&&A.numVerticalGlyphVertices===0,st=m||A.numIconVertices===0;!kt&&!st?Y=O=Y&&O:st?kt||Y&&(Y=O):O=Y&&O;let Ur=O&&Se.placeable,Di=Y&&oe.placeable;if(Ur&&(je&&je.placeable&&qe?this.collisionIndex.insertCollisionBox(Se.box,_,n.get("text-ignore-placement"),i.bucketInstanceId,qe,d.ID):this.collisionIndex.insertCollisionBox(Se.box,_,n.get("text-ignore-placement"),i.bucketInstanceId,$e,d.ID)),Di&&this.collisionIndex.insertCollisionBox(oe.box,y,n.get("icon-ignore-placement"),i.bucketInstanceId,mt,d.ID),ae&&O&&this.collisionIndex.insertCollisionCircles(ae.circles,_,n.get("text-ignore-placement"),i.bucketInstanceId,$e,d.ID),r&&this.storeCollisionData(i.bucketInstanceId,L,M,Se,oe,ae),A.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");if(i.bucketInstanceId===0)throw Error("bucket.bucketInstanceId can't be 0");let ni=(O||E)&&!Se?.occluded,W=(Y||P)&&!oe?.occluded;this.placements[A.crossTileID]=new p6(ni,W,ue||i.justReloaded),t[A.crossTileID]=!0};if(T){if(e.symbolInstanceStart!==0)throw Error("bucket.bucketInstanceId should be 0");let A=i.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let M=A.length-1;M>=0;--M){let L=A[M];C(i.symbolInstances.get(L),i.collisionArrays[L],L)}}else for(let A=e.symbolInstanceStart;A<e.symbolInstanceEnd;A++)C(i.symbolInstances.get(A),i.collisionArrays[A],A);i.justReloaded=!1}storeCollisionData(e,t,r,i,n,a){if(r.textBox||r.iconBox){let o;this.collisionBoxArrays.has(e)?o=this.collisionBoxArrays.get(e):(o=new Map,this.collisionBoxArrays.set(e,o));let s;o.has(t)?s=o.get(t):(s={text:null,icon:null},o.set(t,s)),r.textBox&&(s.text=i.box),r.iconBox&&(s.icon=n.box)}if(a){let o=this.collisionCircleArrays[e];o===void 0&&(o=this.collisionCircleArrays[e]=[]);for(let s=0;s<a.circles.length;s+=4)o.push(a.circles[s+0]-100),o.push(a.circles[s+1]-100),o.push(a.circles[s+2]),o.push(+!!a.collisionDetected)}}markUsedJustification(e,t,r,i){let n={left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex},a;a=i===2?r.verticalPlacedTextSymbolIndex:n[s_(t)];let o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(let s of o)s>=0&&(a>=0&&s!==a?e.text.placedSymbolArray.get(s).crossTileID=0:e.text.placedSymbolArray.get(s).crossTileID=r.crossTileID)}markUsedOrientation(e,t,r){let i=t===1||t===3?t:0,n=t===2?t:0,a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(let o of a)e.text.placedSymbolArray.get(o).placedOrientation=i;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=n)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let i=t?t.symbolFadeChange(e):1,n=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(let s in this.placements){let l=this.placements[s],u=n[s];u?(this.opacities[s]=new wu(u,i,l.text,l.icon),r||(r=l.text!==u.text.placed),r||(r=l.icon!==u.icon.placed)):(this.opacities[s]=new wu(null,i,l.text,l.icon,l.skipFade),r||(r=l.text||l.icon))}for(let s in n){let l=n[s];if(!this.opacities[s]){let u=new wu(l,i,!1,!1);u.isHidden()||(this.opacities[s]=u,r||(r=l.text.placed),r||(r=l.icon.placed))}}for(let s in a)!this.variableOffsets[s]&&this.opacities[s]&&!this.opacities[s].isHidden()&&(this.variableOffsets[s]=a[s]);for(let s in o)!this.placedOrientations[s]&&this.opacities[s]&&!this.opacities[s].isHidden()&&(this.placedOrientations[s]=o[s]);if(t&&t.lastPlacementChangeTime===void 0)throw Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let r={};for(let i of t){let n=i.getBucket(e);if(!n||!i.latestFeatureIndex||e.id!==n.layerIds[0])continue;let{duplicates:a,changed:o}=this._markDuplicates(n,r),s=!!n.hasDebugData()||n.bucketInstanceId in this.collisionCircleArrays;(o||s)&&this.updateBucketOpacities(n,i.tileID,a,i.collisionBoxArray),n.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[n.bucketInstanceId]&&(this.retainedQueryData[n.bucketInstanceId].featureSortOrder=n.featureSortOrder)}}_markDuplicates(e,t){let r=e.symbolInstances.length,i=this.lastOpacityInputs.get(e),n=!1;i||(i={crossTileIDs:Array(r).fill(0),duplicates:Array(r).fill(!1)},this.lastOpacityInputs.set(e,i),n=!0);let{crossTileIDs:a,duplicates:o}=i,s=e.symbolInstances.uint32,l=e.symbolInstances.bytesPerElement/4;for(let u=0;u<r;u++){let c=s[u*l+lV],h=!!t[c];t[c]=!0,(a[u]!==c||o[u]!==h)&&(a[u]=c,o[u]=h,n=!0)}return{duplicates:o,changed:n}}updateBucketOpacities(e,t,r,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let n=e.layers[0],a=n.layout,o=new wu(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),u=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),c=a.get("text-rotation-alignment")==="map",h=a.get("text-pitch-alignment")==="map",p=a.get("icon-text-fit")!=="none",d=new wu(null,0,s&&(l||!e.hasIconData()||a.get("icon-optional")),l&&(s||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let f=(_,g,y)=>{for(let v=0;v<g/4;v++)_.opacityVertexArray.emplaceBack(y);_.hasVisibleVertices||(_.hasVisibleVertices=y!==0)},m=this.collisionBoxArrays.get(e.bucketInstanceId);for(let _=0;_<e.symbolInstances.length;_++){let g=e.symbolInstances.get(_),{numHorizontalGlyphVertices:y,numVerticalGlyphVertices:v,crossTileID:x}=g,b=r[_],w=this.opacities[x];b?w=o:w||(w=d,this.opacities[x]=w);let T=y>0||v>0,S=g.numIconVertices>0,E=this.placedOrientations[g.crossTileID],P=E===2,D=E===1||E===3;if(T){let I=m6(w.text),C=P?0:I;f(e.text,y,C);let A=D?0:I;f(e.text,v,A);let M=w.text.isHidden(),L=[g.rightJustifiedTextSymbolIndex,g.centerJustifiedTextSymbolIndex,g.leftJustifiedTextSymbolIndex];for(let Y of L)Y>=0&&(e.text.placedSymbolArray.get(Y).hidden=M||P?1:0);g.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(g.verticalPlacedTextSymbolIndex).hidden=M||D?1:0);let j=this.variableOffsets[g.crossTileID];j&&this.markUsedJustification(e,j.anchor,g,E);let O=this.placedOrientations[g.crossTileID];O&&(this.markUsedJustification(e,"left",g,O),this.markUsedOrientation(e,O,g))}if(S){let I=m6(w.icon),C=!(p&&g.verticalPlacedIconSymbolIndex&&P);if(g.placedIconSymbolIndex>=0){let A=C?I:0;f(e.icon,g.numIconVertices,A),e.icon.placedSymbolArray.get(g.placedIconSymbolIndex).hidden=w.icon.isHidden()}if(g.verticalPlacedIconSymbolIndex>=0){let A=C?0:I;f(e.icon,g.numVerticalIconVertices,A),e.icon.placedSymbolArray.get(g.verticalPlacedIconSymbolIndex).hidden=w.icon.isHidden()}}let F=m?.has(_)?m.get(_):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let I=e.collisionArrays[_];if(I){let C=new k(0,0);if(I.textBox||I.verticalTextBox){let A=!0;if(u){let M=this.variableOffsets[x];M?(C=d6(M.anchor,M.width,M.height,M.textOffset,M.textBoxScale),c&&C._rotate(h?-this.transform.bearingInRadians:this.transform.bearingInRadians)):A=!1}if(I.textBox||I.verticalTextBox){let M;I.textBox&&(M=P),I.verticalTextBox&&(M=D),f6(e.textCollisionBox.collisionVertexArray,w.text.placed,!A||M,F.text,C.x,C.y)}}if(I.iconBox||I.verticalIconBox){let A=!(D||!I.verticalIconBox),M;I.iconBox&&(M=A),I.verticalIconBox&&(M=!A),f6(e.iconCollisionBox.collisionVertexArray,w.icon.placed,M,F.icon,p?C.x:0,p?C.y:0)}}}}if(e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}setStale(){this.stale=!0}};function f6(e,t,r,i,n,a){(!i||i.length===0)&&(i=[0,0,0,0]);let o=i[0]-100,s=i[1]-100,l=i[2]-100,u=i[3]-100;e.emplaceBack(+!!t,+!!r,n||0,a||0,o,s),e.emplaceBack(+!!t,+!!r,n||0,a||0,l,s),e.emplaceBack(+!!t,+!!r,n||0,a||0,l,u),e.emplaceBack(+!!t,+!!r,n||0,a||0,o,u)}var cV=2**25,hV=2**24,pV=2**17,dV=2**16;function m6(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return fV;let t=+!!e.placed,r=Math.floor(e.opacity*127);return r*cV+t*hV+r*pV+t*dV+r*512+t*256+r*2+t}var fV=4294967295,mV=class{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,i,n){let a=this._bucketParts;for(;this._currentTileIndex<e.length;){let o=e[this._currentTileIndex];if(t.getBucketParts(a,i,o,this._sortAcrossTiles),this._currentTileIndex++,n())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((o,s)=>o.sortKey-s.sortKey));this._currentPartIndex<a.length;){let o=a[this._currentPartIndex];if(t.placeLayerBucketPart(o,this._seenCrossTileIDs,r),this._currentPartIndex++,n())return!0}return!1}},gV=class{constructor(e,t,r,i,n,a,o,s){this.placement=new uV(e,t,a,o,s),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(e,t,r){let i=Be(),n=()=>!this._forceFullPlacement&&Be()-i>2;for(;this._currentPlacementIndex>=0;){let a=t[e[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if(wC(a)&&a.layout&&(!a.minzoom||a.minzoom<=o)&&(!a.maxzoom||a.maxzoom>o)){if(this._inProgressLayer||(this._inProgressLayer=new mV(a)),this._inProgressLayer.continuePlacement(r[a.source],this.placement,this._showCollisionBoxes,a,n))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}},g6=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ut=new Uint32Array(96),yV=class xP{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(t,0,2);if(r!==219)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=g6[i&15];if(!a)throw Error("Unrecognized array type.");let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new xP(s,o,a,void 0,t)}constructor(t,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(t)||t<0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=g6.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,l=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(o<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,t),this.coords=new i(a,8+l+u,t*2),this._pos=t*2,this._finished=!0;else{let c=this.data=new n(8+s+l+u);this.ids=new this.IndexArrayType(c,8,t),this.coords=new i(c,8+l+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(c,0,2).set([219,16+o]),new Uint16Array(c,2,1)[0]=r,new Uint32Array(c,4,1)[0]=t}}add(t,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=r,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw Error(`Added ${t} items when expected ${this.numItems}.`);return S_(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:o,nodeSize:s}=this;ut[0]=0,ut[1]=a.length-1,ut[2]=0;let l=3,u=[];for(;l>0;){let c=ut[--l],h=ut[--l],p=ut[--l];if(h-p<=s){for(let _=p;_<=h;_++){let g=o[2*_],y=o[2*_+1];g>=t&&g<=i&&y>=r&&y<=n&&u.push(a[_])}continue}let d=p+h>>1,f=o[2*d],m=o[2*d+1];f>=t&&f<=i&&m>=r&&m<=n&&u.push(a[d]),(c===0?t<=f:r<=m)&&(ut[l++]=p,ut[l++]=d-1,ut[l++]=1-c),(c===0?i>=f:n>=m)&&(ut[l++]=d+1,ut[l++]=h,ut[l++]=1-c)}return u}within(t,r,i){let n=[];return this.withinInto(t,r,i,n),n}withinInto(t,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:o,nodeSize:s}=this;ut[0]=0,ut[1]=a.length-1,ut[2]=0;let l=3,u=0,c=i*i;for(;l>0;){let h=ut[--l],p=ut[--l],d=ut[--l];if(p-d<=s){for(let g=d;g<=p;g++)y6(o[2*g],o[2*g+1],t,r)<=c&&(n[u++]=a[g]);continue}let f=d+p>>1,m=o[2*f],_=o[2*f+1];y6(m,_,t,r)<=c&&(n[u++]=a[f]),(h===0?t-i<=m:r-i<=_)&&(ut[l++]=d,ut[l++]=f-1,ut[l++]=1-h),(h===0?t+i>=m:r+i>=_)&&(ut[l++]=f+1,ut[l++]=p,ut[l++]=1-h)}return u}};function S_(e,t,r,i,n,a){if(n-i<=r)return;let o=i+n>>1;bP(e,t,o,i,n,a),S_(e,t,r,i,o-1,1-a),S_(e,t,r,o+1,n,1-a)}function bP(e,t,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,c=r-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*p*(u-p)/u)*(c-u/2<0?-1:1);bP(e,t,r,Math.max(i,Math.floor(r-c*p/u+d)),Math.min(n,Math.floor(r+(u-c)*p/u+d)),a)}let o=t[2*r+a],s=i,l=n;for(Tu(e,t,i,r),t[2*n+a]>o&&Tu(e,t,i,n);s<l;){for(Tu(e,t,s,l),s++,l--;t[2*s+a]<o;)s++;for(;t[2*l+a]>o;)l--}t[2*i+a]===o?Tu(e,t,i,l):(l++,Tu(e,t,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Tu(e,t,r,i){A1(e,r,i),A1(t,2*r,2*i),A1(t,2*r+1,2*i+1)}function A1(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function y6(e,t,r,i){let n=e-r,a=t-i;return n*n+a*a}var Su=512/R/2,_V=class{constructor(e,t,r){this.tileID=e,this.bucketInstanceId=r,this._symbolsByKey={};let i=new Map;for(let n=0;n<t.length;n++){let a=t.get(n),o=a.key,s=i.get(o);s?s.push(a):i.set(o,[a])}for(let[n,a]of i){let o={positions:a.map(s=>({x:Math.floor(s.anchorX*Su),y:Math.floor(s.anchorY*Su)})),crossTileIDs:a.map(s=>s.crossTileID)};if(o.positions.length>128){let s=new yV(o.positions.length,16,Uint16Array);for(let{x:l,y:u}of o.positions)s.add(l,u);s.finish(),delete o.positions,o.index=s}this._symbolsByKey[n]=o}}getScaledCoordinates(e,t){let{x:r,y:i,z:n}=this.tileID.canonical,{x:a,y:o,z:s}=t.canonical,l=s-n,u=Su/2**l,c=(a*R+e.anchorX)*u,h=(o*R+e.anchorY)*u,p=r*R*Su,d=i*R*Su;return{x:Math.floor(c-p),y:Math.floor(h-d)}}findMatches(e,t,r){let i=this.tileID.canonical.z<t.canonical.z?1:2**(this.tileID.canonical.z-t.canonical.z);for(let n=0;n<e.length;n++){let a=e.get(n);if(a.crossTileID)continue;let o=this._symbolsByKey[a.key];if(!o)continue;let s=this.getScaledCoordinates(a,t);o.index?this.findMatchesForIndexedEntry(o,a,s,i,r):o.positions&&this.findMatchesForNonIndexedEntry(o,a,s,i,r)}}findMatchesForIndexedEntry(e,t,r,i,n){let a=e.index.range(r.x-i,r.y-i,r.x+i,r.y+i),o=1/0;for(let s of a)s<o&&!n[e.crossTileIDs[s]]&&(o=s);if(o!==1/0){let s=e.crossTileIDs[o];n[s]=!0,t.crossTileID=s}}findMatchesForNonIndexedEntry(e,t,r,i,n){for(let a=0;a<e.positions.length;a++){let o=e.positions[a],s=e.crossTileIDs[a];if(Math.abs(o.x-r.x)<=i&&Math.abs(o.y-r.y)<=i&&!n[s]){n[s]=!0,t.crossTileID=s;break}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}},vV=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},xV=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(t!==0)for(let r in this.indexes){let i=this.indexes[r],n={};for(let a in i){let o=i[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),n[o.tileID.key]=o}this.indexes[r]=n}this.lng=e}addBucket(e,t,r){var n,a;if(this.indexes[e.overscaledZ]?.[e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let o=0;o<t.symbolInstances.length;o++){let s=t.symbolInstances.get(o);s.crossTileID=0}(n=this.usedCrossTileIDs)[a=e.overscaledZ]||(n[a]={});let i=this.usedCrossTileIDs[e.overscaledZ];for(let o in this.indexes){let s=this.indexes[o];if(Number(o)>e.overscaledZ)for(let l in s){let u=s[l];u.tileID.isChildOf(e)&&u.findMatches(t.symbolInstances,e,i)}else{let l=s[e.scaledTo(Number(o)).key];l&&l.findMatches(t.symbolInstances,e,i)}}for(let o=0;o<t.symbolInstances.length;o++){let s=t.symbolInstances.get(o);s.crossTileID||(s.crossTileID=r.generate(),i[s.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new _V(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let r of t.getCrossTileIDsLists())for(let i of r)delete this.usedCrossTileIDs[e][i]}removeStaleBuckets(e){let t=!1;for(let r in this.indexes){let i=this.indexes[r];for(let n in i)e[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],t=!0)}return t}},bV=class{constructor(){this.layerIndexes={},this.crossTileIDs=new vV,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r){let i=this.layerIndexes[e.id];i===void 0&&(i=this.layerIndexes[e.id]=new xV);let n=!1,a={};i.handleWrapJump(r);for(let o of t){let s=o.getBucket(e);e.id===s?.layerIds[0]&&(s.bucketInstanceId||(s.bucketInstanceId=(this.maxBucketInstanceId+=1,this.maxBucketInstanceId)),i.addBucket(o.tileID,s,this.crossTileIDs)&&(n=!0),a[s.bucketInstanceId]=!0)}return i.removeStaleBuckets(a)&&(n=!0),n}pruneUnusedLayers(e){let t={};for(let r of e)t[r]=!0;for(let r in this.layerIndexes)t[r]||delete this.layerIndexes[r]}},wV=`#ifdef GL_ES
10
10
  precision mediump float;
11
11
  #else
@@ -821,13 +821,13 @@ uniform ${h} ${p} u_${d};
821
821
  `),x=y.concat(dn.prelude.vertexSource,o.vertexSource,t.vertexSource).join(`
822
822
  `),b=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}u.shaderSource(b,v),u.compileShader(b),u.attachShader(this.program,b);let w=u.createShader(u.VERTEX_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}u.shaderSource(w,x),u.compileShader(w),u.attachShader(this.program,w),this.attributes={};let T={};if(this.numAttributes=p.length,u.linkProgram(this.program),!u.getProgramParameter(this.program,u.LINK_STATUS)){if(u.isContextLost()||u.getProgramParameter(this.program,u.ATTACHED_SHADERS)===0){this.failedToCreate=!0;return}throw u.getShaderParameter(b,u.COMPILE_STATUS)?u.getShaderParameter(w,u.COMPILE_STATUS)?Error(`Program failed to link: ${u.getProgramInfoLog(this.program)}`):Error(`Could not compile vertex shader: ${u.getShaderInfoLog(w)}`):Error(`Could not compile fragment shader: ${u.getShaderInfoLog(b)}`)}RU(u,this.program);let S=JU(u,this.program);for(let E of p){if(!E)continue;let P=u.getAttribLocation(this.program,E);P>=0&&(this.attributes[E]={location:P,isInteger:S.has(E)})}u.deleteShader(w),u.deleteShader(b);for(let E of g)if(E&&!T[E]){let P=u.getUniformLocation(this.program,E);P&&(T[E]=P)}this.fixedUniforms=i(e,T),this.terrainUniforms=ZU(e,T),this.binderUniforms=r?r.getUniforms(e,T):[]}draw(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y){var b;let v=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.terrainUniformBuffer.bind(),e.frameUniformBuffer.bind(),e.setDepthMode(r),e.setStencilMode(i),e.setColorMode(n),e.setCullFace(a),s){e.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),e.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(let w in this.terrainUniforms)this.terrainUniforms[w].set(s[w]);$U(e.terrainUniformBuffer,s)}if(BU(e,l),o)for(let w in this.fixedUniforms)this.fixedUniforms[w].set(o[w]);m&&m.setUniforms(e,this.binderUniforms,d,{zoom:f});let x=0;switch(t){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(let w of p.get())w.vaos||(w.vaos={}),(b=w.vaos)[u]||(b[u]=new GU),w.vaos[u].bind(e,this,c,m?m.getPaintVertexBuffers():[],h,w.vertexOffset,_,g,y),v.drawElements(t,w.primitiveLength*x,v.UNSIGNED_SHORT,w.primitiveOffset*x*2)}};function qP(e,t,r){let i=1/ii(r,1,t.tileZoom),n=2**r.tileID.overscaledZ,a=r.tileSize*2**t.tileZoom/n,o=a*(r.tileID.canonical.x+r.tileID.wrap*n),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[o&65535,s&65535]}}function t$(e,t,r,i,n){let a=r.getPattern(e.from.toString()),o=r.getPattern(e.to.toString()),{width:s,height:l}=r.getPixelSize(),u=2**n.tileID.overscaledZ,c=n.tileSize*2**i.tileZoom/u,h=c*(n.tileID.canonical.x+n.tileID.wrap*u),p=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/ii(n,1,i.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[h&65535,p&65535]}}var r$=(e,t)=>({u_lightpos:new Pr(e,t.u_lightpos),u_lightpos_globe:new Pr(e,t.u_lightpos_globe),u_lightintensity:new q(e,t.u_lightintensity),u_lightcolor:new Pr(e,t.u_lightcolor),u_vertical_gradient:new q(e,t.u_vertical_gradient),u_opacity:new q(e,t.u_opacity),u_fill_translate:new _e(e,t.u_fill_translate)}),i$=(e,t)=>({u_lightpos:new Pr(e,t.u_lightpos),u_lightpos_globe:new Pr(e,t.u_lightpos_globe),u_lightintensity:new q(e,t.u_lightintensity),u_lightcolor:new Pr(e,t.u_lightcolor),u_vertical_gradient:new q(e,t.u_vertical_gradient),u_height_factor:new q(e,t.u_height_factor),u_opacity:new q(e,t.u_opacity),u_fill_translate:new _e(e,t.u_fill_translate),u_image:new te(e,t.u_image),u_texsize:new _e(e,t.u_texsize),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade)}),GP=(e,t,r,i,n)=>{let a=bT(t.position),o=mT();t.anchor==="viewport"&&HM(o,e.bearingInRadians),nI(a,a,o);let s=e.transformLightDirection(a),l=t.color;return{u_lightpos:a,u_lightpos_globe:s,u_lightintensity:t.intensity,u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:i,u_fill_translate:n}},n$=(e,t,r,i,n,a,o,s)=>J(GP(e,t,r,i,n),qP(o,e,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),a$=(e,t)=>({u_fill_translate:new _e(e,t.u_fill_translate)}),o$=(e,t)=>({u_image:new te(e,t.u_image),u_texsize:new _e(e,t.u_texsize),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade),u_sdf_pattern:new te(e,t.u_sdf_pattern),u_fill_translate:new _e(e,t.u_fill_translate)}),s$=(e,t)=>({u_fill_translate:new _e(e,t.u_fill_translate)}),l$=(e,t)=>({u_image:new te(e,t.u_image),u_texsize:new _e(e,t.u_texsize),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade),u_sdf_pattern:new te(e,t.u_sdf_pattern),u_fill_translate:new _e(e,t.u_fill_translate)}),ZP=(e,t,r,i,n)=>J(qP(t,e,r),{u_fill_translate:i,u_sdf_pattern:+!!n}),u$=e=>({u_fill_translate:e}),c$=e=>({u_fill_translate:e}),h$=(e,t,r,i,n)=>ZP(e,t,r,i,n),p$=(e,t)=>({u_scale_with_map:new te(e,t.u_scale_with_map),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_extrude_scale:new _e(e,t.u_extrude_scale),u_globe_extrude_scale:new q(e,t.u_globe_extrude_scale),u_translate:new _e(e,t.u_translate)}),d$=(e,t,r,i,n)=>{let a,o,s=0;if(r.paint.get("circle-pitch-alignment")==="map"){let l=ii(t,1,e.zoom);a=!0,o=[l,l],s=l/(R*2**t.tileID.overscaledZ)*2*Math.PI*n}else a=!1,o=e.pixelsToGLUnits;return{u_scale_with_map:+(r.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+a,u_extrude_scale:o,u_globe_extrude_scale:s,u_translate:i}},f$=(e,t)=>({u_color:new Ba(e,t.u_color),u_overlay:new te(e,t.u_overlay),u_overlay_scale:new q(e,t.u_overlay_scale)}),V6=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),m$=(e,t)=>({u_extrude_scale:new q(e,t.u_extrude_scale),u_intensity:new q(e,t.u_intensity),u_globe_extrude_scale:new q(e,t.u_globe_extrude_scale)}),g$=(e,t)=>({u_matrix:new Hi(e,t.u_matrix),u_image:new te(e,t.u_image),u_color_ramp:new te(e,t.u_color_ramp),u_opacity:new q(e,t.u_opacity)}),HP=(e,t,r,i)=>{let n=ii(e,1,t)/(R*2**e.tileID.overscaledZ)*2*Math.PI*i;return{u_extrude_scale:ii(e,1,t),u_intensity:r,u_globe_extrude_scale:n}},WP=(e,t,r,i)=>{let n=Do();return Ln(n,0,e.width,e.height,0,0,1),{u_matrix:n,u_image:r,u_color_ramp:i,u_opacity:t.paint.get("heatmap-opacity")}},y$=(e,t)=>({u_image:new te(e,t.u_image),u_latrange:new _e(e,t.u_latrange),u_exaggeration:new q(e,t.u_exaggeration),u_altitudes:new L5(e,t.u_altitudes),u_azimuths:new L5(e,t.u_azimuths),u_accent:new Ba(e,t.u_accent),u_method:new te(e,t.u_method),u_shadows:new R5(e,t.u_shadows),u_highlights:new R5(e,t.u_highlights)}),_$=(e,t)=>({u_matrix:new Hi(e,t.u_matrix),u_image:new te(e,t.u_image),u_dimension:new _e(e,t.u_dimension),u_zoom:new q(e,t.u_zoom),u_unpack:new Qs(e,t.u_unpack),u_log2_world_width:new q(e,t.u_log2_world_width)}),v$=(e,t,r)=>{let i=r.paint.get("hillshade-accent-color"),n;switch(r.paint.get("hillshade-method")){case"basic":n=4;break;case"combined":n=1;break;case"igor":n=2;break;case"multidirectional":n=3;break;default:n=0}let a=r.getIlluminationProperties();for(let o=0;o<a.directionRadians.length;o++)r.paint.get("hillshade-illumination-anchor")==="viewport"&&(a.directionRadians[o]+=e.bearingInRadians);return{u_image:0,u_latrange:w$(e,t.tileID),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:a.altitudeRadians,u_azimuths:a.directionRadians,u_accent:i,u_method:n,u_highlights:a.highlightColor,u_shadows:a.shadowColor}},x$=(e,t,r)=>{let i=r.stride,n=Do();return Ln(n,0,R,-8192,0,0,1),At(n,n,[0,-8192,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector(),u_log2_world_width:b$(e)}};function b$(e){let t=e.worldCoordinateHelper;return t.wraps?25.2562:Math.log2(t.metersPerWorldUnit(.5,.5))}function w$(e,t){let r=e.worldCoordinateHelper;if(!r.wraps)return[0,0];let i=2**t.canonical.z,n=t.canonical.y;return[r.lngLatFromWorld(0,n/i).lat,r.lngLatFromWorld(0,(n+1)/i).lat]}var T$=(e,t)=>({u_image:new te(e,t.u_image),u_unpack:new Qs(e,t.u_unpack),u_dimension:new _e(e,t.u_dimension),u_elevation_stops:new te(e,t.u_elevation_stops),u_color_stops:new te(e,t.u_color_stops),u_color_ramp_size:new te(e,t.u_color_ramp_size),u_opacity:new q(e,t.u_opacity)}),S$=(e,t,r=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:r,u_opacity:e.paint.get("color-relief-opacity")}),E$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio)}),C$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_image_height:new q(e,t.u_image_height)}),P$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_texsize:new _e(e,t.u_texsize),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade)}),D$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_mix:new q(e,t.u_mix),u_tileratio:new q(e,t.u_tileratio),u_crossfade_from:new q(e,t.u_crossfade_from),u_crossfade_to:new q(e,t.u_crossfade_to),u_lineatlas_width:new q(e,t.u_lineatlas_width),u_lineatlas_height:new q(e,t.u_lineatlas_height)}),A$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_image_height:new q(e,t.u_image_height),u_tileratio:new q(e,t.u_tileratio),u_crossfade_from:new q(e,t.u_crossfade_from),u_crossfade_to:new q(e,t.u_crossfade_to),u_image_dash:new te(e,t.u_image_dash),u_mix:new q(e,t.u_mix),u_lineatlas_width:new q(e,t.u_lineatlas_width),u_lineatlas_height:new q(e,t.u_lineatlas_height)}),If=(e,t,r,i)=>({u_translation:YP(e,t,r),u_ratio:i/ii(t,1,e.zoom)}),M$=(e,t,r,i,n)=>J(If(e,t,r,i),{u_image:0,u_image_height:n}),I$=(e,t,r,i,n)=>{let a=Wv(t,e);return{u_translation:YP(e,t,r),u_texsize:t.imageAtlasTexture.size,u_ratio:i/ii(t,1,e.zoom),u_image:0,u_scale:[a,n.fromScale,n.toScale],u_fade:n.t}},k$=(e,t,r,i,n,a)=>{let o=Wv(r,e);return J(If(e,r,i,n),{u_tileratio:o,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:t.width,u_lineatlas_height:t.height})},z$=(e,t,r,i,n,a,o)=>{let s=Wv(r,e);return J(If(e,r,i,n),{u_image:0,u_image_height:o,u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:t.width,u_lineatlas_height:t.height})};function Wv(e,t){return 1/ii(e,1,t.tileZoom)}function YP(e,t,r){return Fa(e,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var F$=(e,t)=>({u_image:new te(e,t.u_image),u_opacity:new q(e,t.u_opacity)}),R$=(e,t)=>({u_image:t,u_opacity:e}),L$=(e,t)=>({u_is_size_zoom_constant:new te(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new te(e,t.u_is_size_feature_constant),u_size_t:new q(e,t.u_size_t),u_size:new q(e,t.u_size),u_rotate_symbol:new te(e,t.u_rotate_symbol),u_label_plane_matrix:new Hi(e,t.u_label_plane_matrix),u_coord_matrix:new Hi(e,t.u_coord_matrix),u_is_text:new te(e,t.u_is_text),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_is_along_line:new te(e,t.u_is_along_line),u_is_variable_anchor:new te(e,t.u_is_variable_anchor),u_texsize:new _e(e,t.u_texsize),u_texture:new te(e,t.u_texture),u_translation:new _e(e,t.u_translation),u_pitched_scale:new q(e,t.u_pitched_scale),u_is_offset:new te(e,t.u_is_offset),u_height_anchor_ground:new te(e,t.u_height_anchor_ground)}),B$=(e,t)=>({u_is_size_zoom_constant:new te(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new te(e,t.u_is_size_feature_constant),u_size_t:new q(e,t.u_size_t),u_size:new q(e,t.u_size),u_rotate_symbol:new te(e,t.u_rotate_symbol),u_label_plane_matrix:new Hi(e,t.u_label_plane_matrix),u_coord_matrix:new Hi(e,t.u_coord_matrix),u_is_text:new te(e,t.u_is_text),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_is_along_line:new te(e,t.u_is_along_line),u_is_variable_anchor:new te(e,t.u_is_variable_anchor),u_texsize:new _e(e,t.u_texsize),u_texture:new te(e,t.u_texture),u_gamma_scale:new q(e,t.u_gamma_scale),u_is_halo:new te(e,t.u_is_halo),u_is_plain:new te(e,t.u_is_plain),u_translation:new _e(e,t.u_translation),u_pitched_scale:new q(e,t.u_pitched_scale),u_is_offset:new te(e,t.u_is_offset),u_height_anchor_ground:new te(e,t.u_height_anchor_ground)}),O$=(e,t)=>({u_is_size_zoom_constant:new te(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new te(e,t.u_is_size_feature_constant),u_size_t:new q(e,t.u_size_t),u_size:new q(e,t.u_size),u_rotate_symbol:new te(e,t.u_rotate_symbol),u_label_plane_matrix:new Hi(e,t.u_label_plane_matrix),u_coord_matrix:new Hi(e,t.u_coord_matrix),u_is_text:new te(e,t.u_is_text),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_is_along_line:new te(e,t.u_is_along_line),u_is_variable_anchor:new te(e,t.u_is_variable_anchor),u_texsize:new _e(e,t.u_texsize),u_texsize_icon:new _e(e,t.u_texsize_icon),u_texture:new te(e,t.u_texture),u_texture_icon:new te(e,t.u_texture_icon),u_gamma_scale:new q(e,t.u_gamma_scale),u_is_halo:new te(e,t.u_is_halo),u_translation:new _e(e,t.u_translation),u_pitched_scale:new q(e,t.u_pitched_scale),u_is_offset:new te(e,t.u_is_offset),u_height_anchor_ground:new te(e,t.u_height_anchor_ground)}),XP=(e,t,r,i,n,a,o,s,l,u,c,h,p,d)=>({u_is_size_zoom_constant:+(e==="constant"||e==="source"),u_is_size_feature_constant:+(e==="constant"||e==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_rotate_symbol:+r,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+i,u_is_along_line:n,u_is_variable_anchor:a,u_texsize:c,u_texture:0,u_translation:l,u_pitched_scale:h,u_is_offset:p,u_height_anchor_ground:+d}),KP=(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m)=>J(XP(e,t,r,i,n,a,s,l,u,c,h,d,f,m),{u_gamma_scale:i?Math.cos(o.pitch*Math.PI/180)*o.cameraToCenterDistance:1,u_is_halo:+!!p,u_is_plain:1}),j$=(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f)=>J(KP(e,t,r,i,n,a,o,s,l,u,!0,c,!0,p,d,f),{u_texsize_icon:h,u_texture_icon:1}),N$=(e,t)=>({u_opacity:new q(e,t.u_opacity),u_color:new Ba(e,t.u_color)}),V$=(e,t)=>({u_opacity:new q(e,t.u_opacity),u_image:new te(e,t.u_image),u_pattern_tl_a:new _e(e,t.u_pattern_tl_a),u_pattern_br_a:new _e(e,t.u_pattern_br_a),u_pattern_tl_b:new _e(e,t.u_pattern_tl_b),u_pattern_br_b:new _e(e,t.u_pattern_br_b),u_texsize:new _e(e,t.u_texsize),u_mix:new q(e,t.u_mix),u_pattern_size_a:new _e(e,t.u_pattern_size_a),u_pattern_size_b:new _e(e,t.u_pattern_size_b),u_scale_a:new q(e,t.u_scale_a),u_scale_b:new q(e,t.u_scale_b),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_tile_units_to_pixels:new q(e,t.u_tile_units_to_pixels)}),U$=(e,t)=>({u_opacity:e,u_color:t}),$$=(e,t,r,i,n,a)=>J(t$(i,a,t,r,n),{u_opacity:e}),q$=(e,t)=>({u_sun_pos:new Pr(e,t.u_sun_pos),u_atmosphere_blend:new q(e,t.u_atmosphere_blend),u_globe_position:new Pr(e,t.u_globe_position),u_globe_radius:new q(e,t.u_globe_radius),u_inv_proj_matrix:new Hi(e,t.u_inv_proj_matrix)}),G$=(e,t,r,i,n)=>({u_sun_pos:e,u_atmosphere_blend:t,u_globe_position:r,u_globe_radius:i,u_inv_proj_matrix:n}),Z$=(e,t)=>({u_sky_color:new Ba(e,t.u_sky_color),u_horizon_color:new Ba(e,t.u_horizon_color),u_horizon:new _e(e,t.u_horizon),u_horizon_normal:new _e(e,t.u_horizon_normal),u_sky_horizon_blend:new q(e,t.u_sky_horizon_blend),u_sky_blend:new q(e,t.u_sky_blend),u_inv_proj_matrix:new Hi(e,t.u_inv_proj_matrix),u_globe_position:new Pr(e,t.u_globe_position),u_globe_radius:new q(e,t.u_globe_radius),u_atmosphere_blend:new q(e,t.u_atmosphere_blend)}),H$=(e,t,r)=>{let i=Math.cos(t.rollInRadians),n=Math.sin(t.rollInRadians),a=$u(t),o=t.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition,s=zP(t),l=yo(t.worldSize,t.center.lat);return{u_sky_color:e["sky-color"],u_horizon_color:e["horizon-color"],u_horizon:[(t.width/2-a*n)*r,(t.height/2+a*i)*r],u_horizon_normal:[-n,i],u_sky_horizon_blend:e["sky-horizon-blend"]*t.height/2*r,u_sky_blend:o,u_inv_proj_matrix:t.inverseProjectionMatrix,u_globe_position:s,u_globe_radius:l,u_atmosphere_blend:e["atmosphere-blend"]*FP(Ui(s)-l,l)}},Kp=(e,t)=>({}),W$={fillExtrusion:r$,fillExtrusionPattern:i$,fill:a$,fillPattern:o$,fillOutline:s$,fillOutlinePattern:l$,circle:p$,collisionBox:Kp,collisionCircle:Kp,debug:f$,depth:Kp,clippingMask:Kp,heatmap:m$,heatmapTexture:g$,hillshade:y$,hillshadePrepare:_$,colorRelief:T$,line:E$,lineGradient:C$,linePattern:P$,lineSDF:D$,lineGradientSDF:A$,layerOpacity:F$,raster:MB,symbolIcon:L$,symbolSDF:B$,symbolTextAndIcon:O$,background:N$,backgroundPattern:V$,terrain:HU,terrainDepth:WU,terrainHeight:YU,atmosphere:q$,sky:Z$},Y$=class{constructor(e){this.programs={},this.context=e}getProgram(e){var s;let t=e.programConfiguration?e.programConfiguration.cacheKey:"",r=`/${e.projectionShaderVariant.name}`,i=e.showOverdrawInspector?"/overdraw":"",n=e.useTerrain?"/terrain":"",a=e.defines?`/${e.defines.join("/")}`:"",o=e.name+t+r+i+n+a;return(s=this.programs)[o]||(s[o]=new e$(this.context,dn[e.name],e.programConfiguration,W$[e.name],e.showOverdrawInspector,e.useTerrain,e.projectionShaderVariant.prelude,e.projectionShaderVariant.define,e.defines)),this.programs[o]}destroy(){for(let e of Object.values(this.programs))e.program&&this.context.gl.deleteProgram(e.program);this.programs={}}},L1=7680,Ie=class{constructor(e,t,r,i,n,a){this.test=e,this.ref=t,this.mask=r,this.fail=i,this.depthFail=n,this.pass=a}};Ie.disabled=new Ie({func:519,mask:0},0,0,L1,L1,L1);var U6=1029,B1=2305,ke=class{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}};ke.disabled=new ke(!1,U6,B1),ke.backCCW=new ke(!0,U6,B1),ke.frontCCW=new ke(!0,1028,B1);var be=class{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}};be.ReadOnly=!1,be.ReadWrite=!0,be.disabled=new be(519,be.ReadOnly,[0,1]);var Qp;function $6(e,t,r,i,n){let a=n.context,o=a.gl,s=n.useProgram("collisionBox"),l=[],u=0,c=0;for(let _ of r){let g=e.getTile(_).getBucket(t);if(!g)continue;let y=i?g.textCollisionBox:g.iconCollisionBox,v=g.collisionCircleArray;v.length>0&&(l.push({circleArray:v,circleOffset:c,coord:_}),u+=v.length/4,c=u),y&&s.draw(a,o.LINES,be.disabled,Ie.disabled,n.colorModeForRenderPass(),ke.disabled,null,n.getTerrainDataForTile(_),n.getProjectionDataForTile(_),t.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,n.transform.zoom,null,null,y.collisionVertexBuffer)}if(!i||!l.length)return;let h=n.useProgram("collisionCircle"),p=new Tz;p.resize(u*4),p._trim();let d=0;for(let _ of l)for(let g=0;g<_.circleArray.length/4;g++){let y=g*4,v=_.circleArray[y+0],x=_.circleArray[y+1],b=_.circleArray[y+2],w=_.circleArray[y+3];p.emplace(d++,v,x,b,w,0),p.emplace(d++,v,x,b,w,1),p.emplace(d++,v,x,b,w,2),p.emplace(d++,v,x,b,w,3)}(!Qp||Qp.length<u*2)&&(Qp=X$(u));let f=a.createIndexBuffer(Qp,!0),m=a.createVertexBuffer(p,IF.members,!0);for(let _ of l)h.draw(a,o.TRIANGLES,be.disabled,Ie.disabled,n.colorModeForRenderPass(),ke.disabled,null,n.getTerrainDataForTile(_.coord),null,t.id,m,f,ct.simpleSegment(0,_.circleOffset*2,_.circleArray.length,_.circleArray.length/2),null,n.transform.zoom,null,null,null);m.destroy(),f.destroy()}function X$(e){let t=e*2,r=new Ez;r.resize(t),r._trim();for(let i=0;i<t;i++){let n=i*6;r.uint16[n+0]=i*4+0,r.uint16[n+1]=i*4+1,r.uint16[n+2]=i*4+2,r.uint16[n+3]=i*4+2,r.uint16[n+4]=i*4+3,r.uint16[n+5]=i*4+0}return r}var K$=Gi(new Float32Array(16));function Q$(e,t,r,i,n){if(n.currentPass!=="translucent")return;let a=Ie.disabled,o=n.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&eq(i,r,t,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),n),r.paint.get("icon-opacity").constantOr(1)!==0&&q6(e,t,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment").constantOr("viewport"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,o,n),r.paint.get("text-opacity").constantOr(1)!==0&&q6(e,t,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,o,n),t.map.showCollisionBoxes&&($6(t,r,i,!0,n),$6(t,r,i,!1,n))}function J$(e,t,r,i,n,a){let{horizontalAlign:o,verticalAlign:s}=Tf(e),l=-(o-.5)*t,u=-(s-.5)*r;return new k((l/n+i[0])*a,(u/n+i[1])*a)}function eq(e,t,r,i,n,a,o,s){let l=s.transform,u=s.terrain,c=s.data.variableOffsets,h=i==="map",p=n==="map";for(let d of e){let f=r.getTile(d),m=f.getBucket(t);if(!m?.text?.segments.get().length)continue;let _=m.textSizeData,g=Sf(_,l.zoom),y=jv(h,l,ii(f,1,l.zoom)),v=t.layout.get("icon-text-fit")!=="none"&&m.hasIconData();if(g){let x=2**(l.zoom-f.tileID.overscaledZ),b=u?(w,T)=>u.getElevation(d,w,T):void 0;rq(m,h,p,c,l,y,x,g,v,Fa(l,f,a,o),d.toUnwrapped(),b,t.layout.get("symbol-height-anchor")==="ground")}}}function tq(e,t,r,i,n,a){let o=t.tileAnchorPoint.add(new k(t.translation[0],t.translation[1]));if(t.pitchWithMap){let s=i.mult(a);r||(s=s.rotate(-n));let l=o.add(s);return Vv(l.x,l.y,t.pitchedLabelPlaneMatrix,Eo(t,l.x,l.y)).point}if(r){let s=Co(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(e),l=Math.atan(s.y/s.x)+(s.x<0?Math.PI:0);return e.add(i.rotate(l))}return e.add(i)}function rq(e,t,r,i,n,a,o,s,l,u,c,h,p){let d=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,m=e.icon.dynamicLayoutVertexArray,_={};f.clear();for(let g=0;g<d.length;g++){let y=d.get(g),v=e.allowVerticalPlacement&&!y.placedOrientation,x=!y.hidden&&y.crossTileID&&!v?i[y.crossTileID]:null;if(!x)$s(y.numGlyphs,f);else{let b=new k(y.anchorX,y.anchorY),w={getElevation:h,heightOffset:y.heightOffset,heightAnchorGround:p,width:n.width,height:n.height,pitchedLabelPlaneMatrix:a,lineVertexArray:null,pitchWithMap:r,transform:n,projectionCache:null,tileAnchorPoint:b,translation:u,unwrappedTileID:c},T=r?vP(b.x,b.y,w):Co(b.x,b.y,w),S=gP(n.cameraToCenterDistance,T.signedDistanceFromCamera),E=yv(e.textSizeData,s,y)*S/24;r&&(E*=e.tilePixelRatio/o);let{width:P,height:D,anchor:F,textOffset:I,textBoxScale:C}=x,A=J$(F,P,D,I,C,E),M=n.getPitchedTextCorrection(b.x+u[0],b.y+u[1],c),L=tq(T.point,w,t,A,-n.bearingInRadians,M),j=e.allowVerticalPlacement&&y.placedOrientation===2?Math.PI/2:0;for(let O=0;O<y.numGlyphs;O++)$d(f,L,j);l&&y.associatedIconIndex>=0&&(_[y.associatedIconIndex]={shiftedAnchor:L,angle:j})}}if(l){m.clear();let g=e.icon.placedSymbolArray;for(let y=0;y<g.length;y++){let v=g.get(y);if(v.hidden)$s(v.numGlyphs,m);else{let x=_[y];if(!x)$s(v.numGlyphs,m);else for(let b=0;b<v.numGlyphs;b++)$d(m,x.shiftedAnchor,x.angle)}}e.icon.dynamicLayoutVertexBuffer.updateData(m)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function iq(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function q6(e,t,r,i,n,a,o,s,l,u,c,h,p){let d=p.context,f=d.gl,m=p.transform,_=s==="map",g=l==="map",y=s!=="viewport"&&r.layout.get("symbol-placement")!=="point",v=_&&!g&&!y,x=!r.layout.get("symbol-sort-key").isConstant(),b=!1,w=p.getDepthModeForSublayer(0,be.ReadOnly),T=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),S=[],E=m.getCircleRadiusCorrection();for(let F of i){let I=t.getTile(F),C=I.getBucket(r);if(!C)continue;let A=n?C.text:C.icon;if(!A?.segments.get().length||!A.hasVisibleVertices)continue;let M=A.programConfigurations.get(r.id),L=n||C.sdfIcons,j=n?C.textSizeData:C.iconSizeData,O=g||m.pitch!==0,Y=p.useProgram(iq(L,n,C),M),ue=Sf(j,m.zoom),pe=p.getTerrainDataForTile(F),de,je=[0,0],Se,ae,oe=null,$e;if(n){if(Se=I.glyphAtlasTexture,ae=f.LINEAR,de=I.glyphAtlasTexture.size,C.iconsInText){je=I.imageAtlasTexture.size,oe=I.imageAtlasTexture;let Z=j.kind==="composite"||j.kind==="camera";$e=O||p.data.rotating||p.data.zooming||Z?f.LINEAR:f.NEAREST}}else{let Z=r.layout.get("icon-size").constantOr(0)!==1||C.iconsNeedLinear;Se=I.imageAtlasTexture,ae=L||p.data.rotating||p.data.zooming||Z||O?f.LINEAR:f.NEAREST,de=I.imageAtlasTexture.size}let qe=ii(I,1,p.transform.zoom),mt=jv(_,p.transform,qe),Et=QN(g,_,p.transform,qe),kt=Fa(m,I,a,o),st=p.getProjectionDataForTile(F),Ur=T&&C.hasTextData(),Di=r.layout.get("icon-text-fit")!=="none"&&Ur&&C.hasIconData(),ni=r._unevaluatedLayout.hasValue("icon-offset"),W=r.layout.get("symbol-height-anchor")==="ground";if(y){let Z=Do();WN(Z,mt);let Ee=p.terrain?(Ze,Ae)=>p.terrain.getElevation(F,Ze,Ae):void 0;eV(C,e,m,n,mt,Z,g,u,r.layout.get("text-rotation-alignment")==="map",F.toUnwrapped(),kt,Ee)}let ye=n&&T||Di,se=g?mt:p.transform.clipSpaceToPixelsMatrix,N=y||ye?K$:se,De=L&&r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1)!==0,X;X=L?C.iconsInText?j$(j.kind,ue,v,g,y,ye,m,N,Et,kt,de,je,E,ni,W):KP(j.kind,ue,v,g,y,ye,m,N,Et,kt,n,de,De,E,ni,W):XP(j.kind,ue,v,g,y,ye,N,Et,kt,n,de,E,ni,W);let ie={program:Y,buffers:A,uniformValues:X,projectionData:st,atlasTexture:Se,atlasTextureIcon:oe,atlasInterpolation:ae,atlasInterpolationIcon:$e,isSDF:L,hasHalo:De};if(x&&C.canOverlap){b=!0;let Z=A.segments.get();for(let Ee of Z)S.push({segments:new ct([Ee]),sortKey:Ee.sortKey,state:ie,terrainData:pe})}else S.push({segments:A.segments,sortKey:0,state:ie,terrainData:pe})}b&&S.sort((F,I)=>F.sortKey-I.sortKey);let P=r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(null)??1/0,D=r.layout.get("text-letter-spacing").constantOr(0)*24<0||P>1;for(let F of S){let I=F.state;d.activeTexture.set(f.TEXTURE0),I.atlasTexture.bind(I.atlasInterpolation,f.CLAMP_TO_EDGE),I.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),I.atlasTextureIcon&&I.atlasTextureIcon.bind(I.atlasInterpolationIcon,f.CLAMP_TO_EDGE));let C=I.isSDF&&I.hasHalo;if(C){let A=I.uniformValues;A.u_is_halo=1,D&&(A.u_is_plain=0,G6(I.buffers,F.segments,r,p,I.program,w,c,h,A,I.projectionData,F.terrainData),A.u_is_halo=0,A.u_is_plain=1)}G6(I.buffers,F.segments,r,p,I.program,w,c,h,I.uniformValues,I.projectionData,F.terrainData),C&&!D&&(I.uniformValues.u_is_halo=0)}}function G6(e,t,r,i,n,a,o,s,l,u,c){let h=i.context,p=h.gl;n.draw(h,p.TRIANGLES,a,o,s,ke.backCCW,l,c,u,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,i.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function nq(e,t,r,i){if(i.currentPass!=="translucent")return;let n=t.paint.get("circle-opacity"),a=t.paint.get("circle-stroke-width"),o=t.paint.get("circle-stroke-opacity"),s=!t.layout.get("circle-sort-key").isConstant();if(n.constantOr(1)===0&&(a.constantOr(1)===0||o.constantOr(1)===0))return;let l=i.context,u=l.gl,c=i.transform,h=i.getDepthModeForSublayer(0,be.ReadOnly),p=Ie.disabled,d=i.colorModeForRenderPass(),f=[],m=c.getCircleRadiusCorrection();for(let _ of r){let g=e.getTile(_),y=g.getBucket(t);if(!y)continue;let v=Fa(c,g,t.paint.get("circle-translate"),t.paint.get("circle-translate-anchor")),x=y.programConfigurations.get(t.id),b=i.useProgram("circle",x),w=y.layoutVertexBuffer,T=y.indexBuffer,S=i.getTerrainDataForTile(_),E={programConfiguration:x,program:b,layoutVertexBuffer:w,indexBuffer:T,uniformValues:d$(c,g,t,v,m),terrainData:S,projectionData:i.getProjectionDataForTile(_)};if(s){let P=y.segments.get();for(let D of P)f.push({segments:new ct([D]),sortKey:D.sortKey,state:E})}else f.push({segments:y.segments,sortKey:0,state:E})}s&&f.sort((_,g)=>_.sortKey-g.sortKey);for(let _ of f){let{programConfiguration:g,program:y,layoutVertexBuffer:v,indexBuffer:x,uniformValues:b,terrainData:w,projectionData:T}=_.state,S=_.segments;y.draw(l,u.TRIANGLES,h,p,d,ke.backCCW,b,w,T,t.id,v,x,S,t.paint,i.transform.zoom,g)}}function aq(e,t,r,i,n){if(r.paint.get("heatmap-opacity")===0)return;let a=n.context;if(n.terrain){for(let o of i){let s=t.getTile(o);t.hasRenderableParent(o)||(n.currentPass==="offscreen"?lq(s,r,o,n):n.currentPass==="translucent"&&uq(e,r,o,n))}a.viewport.set([0,0,e.width,e.height])}else n.currentPass==="offscreen"?oq(e,t,r,i,n):n.currentPass==="translucent"&&sq(e,r,n)}function oq(e,t,r,i,n){let a=n.context,o=a.gl,s=n.transform,l=Ie.disabled,u=new vt([o.ONE,o.ONE],he.transparent,[!0,!0,!0,!0]);cq(a,e,r),a.clear({color:he.transparent});for(let c of i){if(t.hasRenderableParent(c))continue;let h=t.getTile(c),p=h.getBucket(r);if(!p)continue;let d=p.programConfigurations.get(r.id),f=n.useProgram("heatmap",d),m=n.getProjectionDataForTile(c,{applyTerrainMatrix:!1}),_=s.getCircleRadiusCorrection();f.draw(a,o.TRIANGLES,be.disabled,l,u,ke.backCCW,HP(h,s.zoom,r.paint.get("heatmap-intensity"),_),null,m,r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,s.zoom,d)}a.viewport.set([0,0,e.width,e.height])}function sq(e,t,r){let i=r.context,n=i.gl;i.setColorMode(r.colorModeForRenderPass());let a=t.heatmapFbos.get(Fd);a&&(i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1),JP(i,t).bind(n.LINEAR,n.CLAMP_TO_EDGE),r.useProgram("heatmapTexture").draw(i,n.TRIANGLES,be.disabled,Ie.disabled,r.colorModeForRenderPass(),ke.disabled,WP(e,t,0,1),null,null,t.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,t.paint,r.transform.zoom))}function lq(e,t,r,i){let n=i.context,a=n.gl,o=Ie.disabled,s=new vt([a.ONE,a.ONE],he.transparent,[!0,!0,!0,!0]),l=e.getBucket(t);if(!l)return;let u=r.key,c=t.heatmapFbos.get(u);c||(c=QP(n,e.tileSize,e.tileSize),t.heatmapFbos.set(u,c)),n.bindFramebuffer.set(c.framebuffer),n.viewport.set([0,0,e.tileSize,e.tileSize]),n.clear({color:he.transparent});let h=l.programConfigurations.get(t.id),p=i.useProgram("heatmap",h,!i.data.isRenderingGlobe),d=i.getProjectionDataForTile(e.tileID),f=i.getTerrainDataForTile(r);p.draw(n,a.TRIANGLES,be.disabled,o,s,ke.disabled,HP(e,i.transform.zoom,t.paint.get("heatmap-intensity"),1),f,d,t.id,l.layoutVertexBuffer,l.indexBuffer,l.segments,t.paint,i.transform.zoom,h)}function uq(e,t,r,i){let n=i.context,a=n.gl,o=i.transform;n.setColorMode(i.colorModeForRenderPass());let s=JP(n,t),l=r.key,u=t.heatmapFbos.get(l);if(!u)return;n.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,u.colorAttachment.get()),n.activeTexture.set(a.TEXTURE1),s.bind(a.LINEAR,a.CLAMP_TO_EDGE);let c=i.getProjectionDataForTile(r,{applyTerrainMatrix:i.data.isRenderingGlobe});i.useProgram("heatmapTexture").draw(n,a.TRIANGLES,be.disabled,Ie.disabled,i.colorModeForRenderPass(),ke.disabled,WP(e,t,0,1),null,c,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,o.zoom),u.destroy(),t.heatmapFbos.delete(l)}function cq(e,t,r){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);let n=r.heatmapFbos.get(Fd);n?(i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),e.bindFramebuffer.set(n.framebuffer)):(n=QP(e,t.width/4,t.height/4),r.heatmapFbos.set(Fd,n))}function QP(e,t,r){let i=e.gl,n=i.createTexture();i.bindTexture(i.TEXTURE_2D,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texStorage2D(i.TEXTURE_2D,1,i.RGBA16F,t,r);let a=e.createFramebuffer(t,r,!1,!1);return a.colorAttachment.set(n),a}function JP(e,t){return t.colorRampTexture||(t.colorRampTexture=new Ot(e,t.colorRamp,e.gl.RGBA)),t.colorRampTexture}function eD(e,t,r,i){let n=i.context,a=n.bindFramebuffer.get(),o=n.viewport.get(),[,,s,l]=o;return hq(e,s,l),n.viewport.set([0,0,s,l]),n.clear({color:he.transparent,depth:1,stencil:0}),i.invalidateTileClippingMasks(),i.renderTileClippingMasks(t,r),{compositeTarget:a,compositeViewport:o}}function hq(e,t,r){let i=e.context.gl;if(!e.layerOpacityFbo){let a=e.context.createFramebuffer(t,r,!0,!0),o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,r,0,i.RGBA,i.UNSIGNED_BYTE,null),a.colorAttachment.set(o),a.depthAttachment.set(e.context.createRenderbuffer(i.DEPTH_STENCIL,t,r)),e.layerOpacityFbo=a,e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}if(e.layerOpacityFbo.width===t&&e.layerOpacityFbo.height===r){e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}let n=e.layerOpacityFbo;i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,r,0,i.RGBA,i.UNSIGNED_BYTE,null),e.context.bindRenderbuffer.set(n.depthAttachment.get()),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t,r),e.context.bindRenderbuffer.set(null),n.width=t,n.height=r,e.context.bindFramebuffer.set(n.framebuffer)}function tD(e,t,r,i,n){let a=n.context,o=a.gl;a.bindFramebuffer.set(r.compositeTarget),a.viewport.set(r.compositeViewport),a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),n.useProgram("layerOpacity").draw(a,o.TRIANGLES,be.disabled,Ie.disabled,n.colorModeForRenderPass(),ke.disabled,R$(t,0),null,null,i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,n.transform.zoom),n.invalidateTileClippingMasks()}function rD(e,t,r,i,n,a,o,s){let l=256;if(i.stepInterpolant){let u=e.getSource().maxzoom,c=a.canonical.z===u?Math.ceil(1<<s.transform.maxZoom-a.canonical.z):1;l=Q(CI(n.maxLineLength/R*1024*c),256,t.maxTextureSize)}return o.gradient=EE({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:o.gradient||void 0,clips:n.lineClipsArray}),o.texture?o.texture.update(o.gradient):o.texture=new Ot(t,o.gradient,r.RGBA),o.version=i.gradientVersion,o.texture}function pq(e,t,r,i,n){e.activeTexture.set(t.TEXTURE0),r.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),i.updatePaintBuffers(n)}function dq(e,t,r,i,n,a){(n||e.lineAtlas.dirty)&&(t.activeTexture.set(r.TEXTURE0),e.lineAtlas.bind(t)),i.updatePaintBuffers(a)}function fq(e,t,r,i,n,a,o){let s=n.gradients[i.id],l=s.texture;i.gradientVersion!==s.version&&(l=rD(e,t,r,i,n,a,s,o)),t.activeTexture.set(r.TEXTURE0),l.bind(i.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function mq(e,t,r,i,n,a,o,s,l,u){let c=a.gradients[n.id],h=c.texture;n.gradientVersion!==c.version&&(h=rD(t,r,i,n,a,o,c,u)),r.activeTexture.set(i.TEXTURE0),h.bind(n.stepInterpolant?i.NEAREST:i.LINEAR,i.CLAMP_TO_EDGE),r.activeTexture.set(i.TEXTURE1),e.lineAtlas.bind(r),s.updatePaintBuffers(l)}function gq(e,t,r,i,n){if(n.currentPass!=="translucent")return;let a=r.paint.get("line-opacity"),o=r.paint.get("line-width"),s=r.paint.get("line-layer-opacity");if(a.constantOr(1)!==0&&o.constantOr(1)!==0&&s!==0)if(s<1){let l=eD(e,r,i,n);Z6(e,t,r,i,n),tD(e,s,l,r,n)}else Z6(e,t,r,i,n)}function Z6(e,t,r,i,n){let a=n.getDepthModeForSublayer(0,be.ReadOnly),o=n.colorModeForRenderPass(),s=r.paint.get("line-dasharray"),l=s.constantOr(1),u=r.paint.get("line-pattern"),c=u.constantOr(1),h=r.paint.get("line-gradient"),p=r.getCrossfadeParameters(),d;d=c?"linePattern":l&&h?"lineGradientSDF":l?"lineSDF":h?"lineGradient":"line";let f=n.context,m=f.gl,_=n.transform,g=!0;for(let y of i){let v=t.getTile(y);if(c&&!v.patternsLoaded())continue;let x=v.getBucket(r);if(!x)continue;let b=x.programConfigurations.get(r.id),w=f.program.get(),T=n.useProgram(d,b),S=g||T.program!==w,E=n.getTerrainDataForTile(y),P=u.constantOr(null),D=s?.constantOr(null);if(P&&v.imageAtlas){let M=v.imageAtlas,L=M.patternPositions[P.to.toString()],j=M.patternPositions[P.from.toString()];L&&j&&b.setConstantPatternPositions(L,j)}else if(D){let M=r.layout.get("line-cap").constantOr(null)==="round",L=e.lineAtlas.getDash(D.to,M),j=e.lineAtlas.getDash(D.from,M);b.setConstantDashPositions(L,j)}let F=n.getProjectionDataForTile(y),I=_.getPixelScale(),C;c?(C=I$(_,v,r,I,p),pq(f,m,v,b,p)):l&&h?(C=z$(_,e.lineAtlas,v,r,I,p,x.lineClipsArray.length),mq(e,t,f,m,r,x,y,b,p,n)):l?(C=k$(_,e.lineAtlas,v,r,I,p),dq(e,f,m,b,S,p)):h?(C=M$(_,v,r,I,x.lineClipsArray.length),fq(t,f,m,r,x,y,n)):C=If(_,v,r,I);let A=n.stencilModeForClipping(y);T.draw(f,m.TRIANGLES,a,A,o,ke.disabled,C,E,F,r.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,r.paint,n.transform.zoom,b,x.layoutVertexBuffer2),g=!1}}function iD(e,t,r,i,n){if(!r||!i?.imageAtlas)return;let a=i.imageAtlas.patternPositions,o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let l=n.getPaintProperty(t);o=a[l],s=a[l]}o&&s&&e.setConstantPatternPositions(o,s)}function yq(e,t,r,i,n){let a=r.paint.get("fill-color"),o=r.paint.get("fill-opacity"),s=r.paint.get("fill-layer-opacity");if(o.constantOr(1)===0||s===0)return;if(s<1){if(n.currentPass!=="translucent")return;let c=eD(e,r,i,n);H6(t,r,i,n),tD(e,s,c,r,n);return}let l=r.paint.get("fill-pattern"),u=n.opaquePassEnabledForLayer()&&!l.constantOr(1)&&a.constantOr(he.transparent).a===1&&o.constantOr(0)===1;if(u&&n.currentPass==="opaque"){let c=n.colorModeForRenderPass();Yv(t,r,i,n.getDepthModeForSublayer(1,be.ReadWrite),c,!1,n)}else u&&n.currentPass==="translucent"?nD(t,r,i,n):n.currentPass==="translucent"&&H6(t,r,i,n)}function H6(e,t,r,i){let n=i.colorModeForRenderPass();Yv(e,t,r,i.getDepthModeForSublayer(1,be.ReadOnly),n,!1,i),nD(e,t,r,i)}function nD(e,t,r,i){if(!t.paint.get("fill-antialias"))return;let n=i.colorModeForRenderPass();Yv(e,t,r,i.getDepthModeForSublayer(t.getPaintProperty("fill-outline-color")?2:0,be.ReadOnly),n,!0,i)}function Yv(e,t,r,i,n,a,o){let s=o.context,l=s.gl,u="fill-pattern",c=t.paint.get(u),h=c?.constantOr(1),p=t.getCrossfadeParameters(),d,f,m,_,g,y=o.transform,v=t.paint.get("fill-translate"),x=t.paint.get("fill-translate-anchor");a?(f=h&&!t.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=l.LINES):(f=h?"fillPattern":"fill",d=l.TRIANGLES);let b=c.constantOr(null);for(let w of r){let T=e.getTile(w);if(h&&!T.patternsLoaded())continue;let S=T.getBucket(t);if(!S)continue;let E=S.sdfPatterns[t.id]??!1,P=S.programConfigurations.get(t.id),D=o.useProgram(f,P),F=o.getTerrainDataForTile(w);h&&(s.activeTexture.set(l.TEXTURE0),T.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),P.updatePaintBuffers(p)),iD(P,u,b,T,t);let I=o.getProjectionDataForTile(w),C=Fa(y,T,v,x);a?(_=S.indexBuffer2,g=S.segments2,m=f==="fillOutlinePattern"&&h?h$(y,p,T,C,E):c$(C)):(_=S.indexBuffer,g=S.segments,m=h?ZP(y,p,T,C,E):u$(C));let A=o.stencilModeForClipping(w);D.draw(s,d,i,A,n,ke.backCCW,m,F,I,t.id,S.layoutVertexBuffer,_,g,t.paint,o.transform.zoom,P)}}function _q(e,t,r,i){let n=t.paint.get("fill-extrusion-opacity");if(n!==0&&i.currentPass==="translucent"){let a=new be(i.context.gl.LEQUAL,be.ReadWrite,i.depthRangeFor3D);if(n===1&&!t.paint.get("fill-extrusion-pattern").constantOr(1)){let o=i.colorModeForRenderPass();O1(e,t,r,a,Ie.disabled,o,i)}else O1(e,t,r,a,Ie.disabled,vt.disabled,i),O1(e,t,r,a,i.stencilModeFor3D(),i.colorModeForRenderPass(),i)}}function O1(e,t,r,i,n,a,o){let s=o.context,l=s.gl,u="fill-extrusion-pattern",c=t.paint.get(u),h=c.constantOr(1),p=t.getCrossfadeParameters(),d=t.paint.get("fill-extrusion-opacity"),f=c.constantOr(null),m=o.transform;for(let _ of r){let g=e.getTile(_),y=g.getBucket(t);if(!y)continue;let v=o.getTerrainDataForTile(_),x=y.programConfigurations.get(t.id),b=o.useProgram(h?"fillExtrusionPattern":"fillExtrusion",x);h&&(s.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),x.updatePaintBuffers(p));let w=o.getProjectionDataForTile(_);iD(x,u,f,g,t);let T=Fa(m,g,t.paint.get("fill-extrusion-translate"),t.paint.get("fill-extrusion-translate-anchor")),S=t.paint.get("fill-extrusion-vertical-gradient"),E=h?n$(m,o.data.light,S,d,T,_,p,g):GP(m,o.data.light,S,d,T);b.draw(s,s.gl.TRIANGLES,i,n,a,ke.backCCW,E,v,w,t.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,t.paint,o.transform.zoom,x,o.terrain&&y.centroidVertexBuffer)}}function vq(e,t,r,i,n){if(n.currentPass!=="offscreen"&&n.currentPass!=="translucent")return;let a=n.context,{useSubdivision:o}=n.data,s=n.getDepthModeForSublayer(0,be.ReadOnly),l=n.colorModeForRenderPass();if(n.currentPass==="offscreen")xq(e,t,i,r,s,Ie.disabled,l,n),a.viewport.set([0,0,e.width,e.height]);else if(n.currentPass==="translucent")if(o){let[u,c,h]=n.stencilConfigForOverlapTwoPass(i);j1(t,r,h,u,s,l,!1,n),j1(t,r,h,c,s,l,!0,n)}else{let[u,c]=n.getStencilConfigForOverlapAndUpdateStencilID(i);j1(t,r,c,u,s,l,!1,n)}}function j1(e,t,r,i,n,a,o,s){let l=s.context,u=l.gl,c=[`#define NUM_ILLUMINATION_SOURCES ${t.paint.get("hillshade-highlight-color").values.length}`],h=s.useProgram("hillshade",null,!1,c),p=!s.data.moving;for(let d of r){let f=e.getTile(d),m=f.fbo;if(!m)continue;let _=s.getMeshFromTileID(d.canonical,o,!0,"raster"),g=s.getTerrainDataForTile(d);l.activeTexture.set(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,m.colorAttachment.get());let y=s.getProjectionDataForTile(d,{aligned:p});h.draw(l,u.TRIANGLES,n,i[d.overscaledZ],a,ke.backCCW,v$(s.transform,f,t),g,y,t.id,_.vertexBuffer,_.indexBuffer,_.segments)}}function xq(e,t,r,i,n,a,o,s){let l=s.context,u=l.gl,c=i.paint.get("resampling")==="nearest"?u.NEAREST:u.LINEAR;for(let h of r){let p=t.getTile(h),d=p.dem;if(!d?.data||!p.needsHillshadePrepare)continue;let f=d.dim+2,m=d.stride,_=d.getPixels();if(l.activeTexture.set(u.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),p.demTexture||(p.demTexture=e.getTileTexture(m)),p.demTexture){let y=p.demTexture;y.update(_,{premultiply:!1}),y.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else p.demTexture=new Ot(l,_,u.RGBA,{premultiply:!1}),p.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);l.activeTexture.set(u.TEXTURE0);let g=p.fbo;if(!g){let y=new Ot(l,{width:f,height:f,data:null},u.RGBA);y.bind(c,u.CLAMP_TO_EDGE),g=p.fbo=l.createFramebuffer(f,f,!0,!1),g.colorAttachment.set(y.texture)}l.bindFramebuffer.set(g.framebuffer),l.viewport.set([0,0,f,f]),s.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,n,a,o,ke.disabled,x$(s.transform,p.tileID,d),null,null,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),p.needsHillshadePrepare=!1}}function bq(e,t,r,i,n){if(n.currentPass!=="translucent"||!i.length)return;let{useSubdivision:a}=n.data,o=n.getDepthModeForSublayer(0,be.ReadOnly),s=n.colorModeForRenderPass();if(a){let[l,u,c]=n.stencilConfigForOverlapTwoPass(i);V1(e,t,r,c,l,o,s,!1,n),V1(e,t,r,c,u,o,s,!0,n)}else{let[l,u]=n.getStencilConfigForOverlapAndUpdateStencilID(i);V1(e,t,r,u,l,o,s,!1,n)}}var N1=0;function V1(e,t,r,i,n,a,o,s,l){let u=l.context,c=u.gl,h=l.useProgram("colorRelief"),p=!l.data.moving,d=r.paint.get("resampling")==="nearest"?c.NEAREST:c.LINEAR,f=!0,m=0;for(let _ of i){let g=t.getTile(_),y=g.dem;if(!y?.data)continue;if(f){N1||(N1=c.getParameter(c.MAX_TEXTURE_SIZE));let T=N1,{elevationTexture:S,colorTexture:E}=r.getColorRampTextures(u,T,y.getUnpackVector());u.activeTexture.set(c.TEXTURE1),S.bind(c.NEAREST,c.CLAMP_TO_EDGE),u.activeTexture.set(c.TEXTURE4),E.bind(c.LINEAR,c.CLAMP_TO_EDGE),f=!1,m=S.size[0]}let v=y.stride;u.activeTexture.set(c.TEXTURE0),(!g.demTexture||g.needsColorReliefPrepare)&&(u.pixelStoreUnpackPremultiplyAlpha.set(!1),g.demTexture||(g.demTexture=e.getTileTexture(v)??new Ot(u,{width:v,height:v,data:null},c.RGBA)),g.demTexture.update(y.getPixels(),{premultiply:!1}),g.needsColorReliefPrepare=!1),g.demTexture.bind(d,c.CLAMP_TO_EDGE);let x=l.getMeshFromTileID(_.canonical,s,!0,"raster"),b=l.getTerrainDataForTile(_),w=l.getProjectionDataForTile(_,{aligned:p});h.draw(u,c.TRIANGLES,a,n[_.overscaledZ],o,ke.backCCW,S$(r,g.dem,m),b,w,r.id,x.vertexBuffer,x.indexBuffer,x.segments)}}var U1=[new k(0,0),new k(R,0),new k(R,R),new k(0,R)];function wq(e,t,r,i){if(i.currentPass!=="translucent"||t.paint.get("raster-opacity")===0||!r.length)return;let n=e.getSource(),{useSubdivision:a}=i.data;if(n instanceof Tc)Jp(e,t,r,null,!1,!1,n.tileCoords,n.imageWarp,n.flippedWindingOrder,i,n.getMesh(i.context,a));else if(a){let[o,s,l]=i.stencilConfigForOverlapTwoPass(r);Jp(e,t,l,o,!1,!0,U1,Vs,!1,i),Jp(e,t,l,s,!0,!0,U1,Vs,!1,i)}else{let[o,s]=i.getStencilConfigForOverlapAndUpdateStencilID(r);Jp(e,t,s,o,!1,!0,U1,Vs,!1,i)}}function Jp(e,t,r,i,n,a,o,s,l=!1,u,c=null){let h=r[r.length-1].overscaledZ,p=u.context,d=p.gl,f=u.useProgram("raster"),m=u.colorModeForRenderPass(),_=!u.data.moving,g=t.paint.get("raster-opacity"),y=t.paint.get("resampling")==="nearest"||t.paint.get("raster-resampling")==="nearest"?d.NEAREST:d.LINEAR,v=t.paint.get("raster-fade-duration"),x=!!u.terrain;for(let b of r){let w=u.getDepthModeForSublayer(b.overscaledZ-h,g===1?be.ReadWrite:be.ReadOnly,d.LESS),T=e.getTile(b);p.activeTexture.set(d.TEXTURE0),T.texture.bind(y,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(d.TEXTURE1);let{parentTile:S,parentScaleBy:E,parentTopLeft:P,fadeValues:D}=Tq(T,e,v,x);T.fadeOpacity=D.tileOpacity,S?(S.fadeOpacity=D.parentTileOpacity,S.texture.bind(y,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST)):T.texture.bind(y,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),T.texture.useMipmap&&p.extTextureFilterAnisotropic&&u.transform.pitch>u.data.anisotropicFilterPitch&&d.texParameterf(d.TEXTURE_2D,p.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,p.extTextureFilterAnisotropicMax);let F=u.getTerrainDataForTile(b),I=u.getProjectionDataForTile(b,{aligned:_}),C=IB(P,E,D.fadeMix,t,o,s),A=c??u.getMeshFromTileID(b.canonical,n,a,"raster"),M=i?i[b.overscaledZ]:Ie.disabled;f.draw(p,d.TRIANGLES,w,M,m,l?ke.frontCCW:ke.backCCW,C,F,I,t.id,A.vertexBuffer,A.indexBuffer,A.segments)}}function Tq(e,t,r,i){let n={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(r===0||i)return n;if(e.fadingParentID){let a=t.getLoadedTile(e.fadingParentID);if(!a)return n;let o=2**(a.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:a,parentScaleBy:o,parentTopLeft:[e.tileID.canonical.x*o%1,e.tileID.canonical.y*o%1],fadeValues:Sq(e,a,r)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:Eq(e,r)}:n}function Sq(e,t,r){let i=Be(),n=(i-e.timeAdded)/r,a=(i-t.timeAdded)/r,o=e.fadingDirection===1,s=Q(n,0,1),l=Q(1-a,0,1),u=o?s:l;return{tileOpacity:u,parentTileOpacity:o?l:s,fadeMix:{opacity:1,mix:1-u}}}function Eq(e,t){let r=Q((Be()-e.timeAdded)/t,0,1);return{tileOpacity:r,fadeMix:{opacity:r,mix:0}}}function Cq(e,t,r,i,n){let a=r.paint.get("background-color"),o=r.paint.get("background-opacity");if(o===0)return;let s=n.context,l=s.gl,u=n.transform,c=u.tileSize,h=r.paint.get("background-pattern");if(e.patternAtlas.isPatternMissing(h))return;let p=!h&&a.a===1&&o===1&&n.opaquePassEnabledForLayer()?"opaque":"translucent";if(n.currentPass!==p)return;let d=Ie.disabled,f=n.getDepthModeForSublayer(0,p==="opaque"?be.ReadWrite:be.ReadOnly),m=n.colorModeForRenderPass(),_=n.useProgram(h?"backgroundPattern":"background"),g=i||Cc(u,{tileSize:c,terrain:n.terrain});h&&(s.activeTexture.set(l.TEXTURE0),e.patternAtlas.bind(s));let y=r.getCrossfadeParameters();for(let v of g){let x=n.getProjectionDataForTile(v),b=h?$$(o,e.patternAtlas,u,h,{tileID:v,tileSize:c},y):U$(o,a),w=n.getTerrainDataForTile(v),T=n.getMeshFromTileID(v.canonical,!1,!0,"raster");_.draw(s,l.TRIANGLES,f,d,m,ke.backCCW,b,w,x,r.id,T.vertexBuffer,T.indexBuffer,T.segments)}}var Pq=new he(1,0,0,1),Dq=new he(0,1,0,1),Aq=new he(0,0,1,1),Mq=new he(1,0,1,1),Iq=new he(0,1,1,1);function kq(e){let t=e.transform.padding;W6(e,e.transform.height-(t.top||0),3,Pq),W6(e,t.bottom||0,3,Dq),Y6(e,t.left||0,3,Aq),Y6(e,e.transform.width-(t.right||0),3,Mq);let r=e.transform.centerPoint;zq(e,r.x,e.transform.height-r.y,Iq)}function zq(e,t,r,i){Xd(e,t-1,r-10,2,20,i),Xd(e,t-10,r-1,20,2,i)}function W6(e,t,r,i){Xd(e,0,t+r/2,e.transform.width,r,i)}function Y6(e,t,r,i){Xd(e,t-r/2,0,r,e.transform.height,i)}function Xd(e,t,r,i,n,a){let o=e.context,s=o.gl,l=e.data.pixelRatio;s.enable(s.SCISSOR_TEST),s.scissor(t*l,r*l,i*l,n*l),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function Fq(e,t,r,i){for(let n of r)Rq(e,t,n,i)}function Rq(e,t,r,i){let n=i.context,a=n.gl,o=i.useProgram("debug"),s=be.disabled,l=Ie.disabled,u=i.colorModeForRenderPass(),c="$debug",h=i.getTerrainDataForTile(r);n.activeTexture.set(a.TEXTURE0);let p=t.getTileByID(r.key).latestRawTileData?.byteLength||0,d=Math.floor(p/1024),f=t.getTile(r).tileSize,m=512/Math.min(f,512)*(r.overscaledZ/i.transform.zoom)*.5,_=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(_+=` => ${r.overscaledZ}`),Lq(e,`${_} ${d}kB`);let g=i.getProjectionDataForTile(r);o.draw(n,a.TRIANGLES,s,l,vt.alphaBlended,ke.disabled,V6(he.transparent,m),null,g,c,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),o.draw(n,a.LINE_STRIP,s,l,u,ke.disabled,V6(he.red),h,g,c,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function Lq(e,t){e.initDebugOverlayCanvas();let r=e.debugOverlayCanvas,i=e.context.gl,n=e.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(t,5,5),n.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}function Bq(e,t){let r=null,i=Object.values(e._layers).flatMap(s=>s.source&&!s.isHidden(t)?[e.tileManagers[s.source]]:[]),n=i.filter(s=>s.getSource().type==="vector"),a=i.filter(s=>s.getSource().type!=="vector"),o=s=>{(!r||r.getSource().maxzoom<s.getSource().maxzoom)&&(r=s)};for(let s of n)o(s);if(!r)for(let s of a)o(s);return r}function Oq(e,t,r){let i=r.context,n=i.gl,a=r.transform,o=vt.unblended,s=new be(n.LEQUAL,be.ReadWrite,[0,1]),l=t.tileManager.getRenderableTiles(),u=r.useProgram("terrainDepth");i.bindFramebuffer.set(t.getFramebuffer().framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:he.white,depth:1});for(let c of l){let h=t.getTerrainMesh(c.tileID,r.data.isRenderingGlobe),p=t.getTerrainData(c.tileID),d=a.getProjectionData({overscaledTileID:c.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),f=KU(t.getSkirtLength(a.zoom));u.draw(i,n.TRIANGLES,s,Ie.disabled,o,ke.backCCW,f,p,d,"terrain",h.vertexBuffer,h.indexBuffer,h.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}function jq(e,t,r,i){let{isRenderingGlobe:n}=i.data,a=i.context,o=a.gl,s=i.transform,l=i.colorModeForRenderPass(),u=i.getDepthModeFor3D(),c=i.useProgram("terrain");a.bindFramebuffer.set(null),a.viewport.set([0,0,e.width,e.height]);for(let h of r){let p=t.getTerrainMesh(h.tileID,n),d=e.renderToTexture.getTexture(h),f=t.getTerrainData(h.tileID);a.activeTexture.set(o.TEXTURE0),d.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_LINEAR);let m=t.getSkirtLength(s.zoom),_=s.calculateFogMatrix(h.tileID.toUnwrapped()),g=XU(m,_,i.data.sky,s.pitch,n),y=i.getProjectionDataForTile(h.tileID,{applyTerrainMatrix:!1});c.draw(a,o.TRIANGLES,u,Ie.disabled,l,ke.backCCW,g,f,y,"terrain",p.vertexBuffer,p.indexBuffer,p.segments)}}function Nq(e,t,r){let i=e.context,n=i.gl,[a,o,s,l]=r.bounds;i.setDirty();let u=t.getHeightMapFramebuffer(r.texture);i.viewport.set([0,0,r.width,r.height]),i.clear({color:he.transparent});let c=e.useProgram("terrainHeight",null,!0);for(let h of t.tileManager.getRenderableTiles()){let p=t.getTerrainData(h.tileID);if(!p.tile?.dem)continue;let{canonical:d,wrap:f}=h.tileID,m=1/(1<<d.z),_=QU([(d.x*m+f-a)/(s-a),(d.y*m-o)/(l-o),m/(s-a),m/(l-o)]),g=t.getTerrainMesh(h.tileID,e.data.isRenderingGlobe);c.draw(i,n.TRIANGLES,be.disabled,Ie.disabled,vt.unblended,ke.disabled,_,p,null,"terrain",g.vertexBuffer,g.indexBuffer,g.segments)}u.colorAttachment.set(null)}function Vq(e,t,r,i,n){if(n.isRenderingToTexture){Uq(e,r,i[0],n);return}let{isRenderingGlobe:a,projectionShaderVariant:o}=n.data,{terrain:s}=n,l=n.context,u=r.implementation,c=n.transform,h=c.getProjectionDataForCustomLayer(a),p={farZ:c.farZ,nearZ:c.nearZ,fov:c.fov*Math.PI/180,modelViewProjectionMatrix:c.modelViewProjectionMatrix,projectionMatrix:c.projectionMatrix,shaderData:{variantName:o.name,vertexShaderPrelude:`const float PI = 3.141592653589793;
823
823
  uniform mat4 u_projection_matrix;
824
- ${o.prelude.vertexSource}`,define:o.define},defaultProjectionData:h,getProjectionData:f=>c.getProjectionData({overscaledTileID:new ir(f.tileID.canonical.z,f.tileID.wrap??0,f.tileID.canonical.z,f.tileID.canonical.x,f.tileID.canonical.y),aligned:f.aligned,applyGlobeMatrix:f.applyGlobeMatrix,applyTerrainMatrix:f.applyTerrainMatrix}),renderTerrainHeightMap:s&&n.currentPass==="offscreen"?f=>Nq(n,s,f):void 0},d=u.renderingMode?u.renderingMode:"2d";if(n.currentPass==="offscreen"){let f=u.prerender;f&&(l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),f.call(u,l.gl,p),l.setDirty(),e.setBaseState())}else if(n.currentPass==="translucent"){l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),l.setStencilMode(Ie.disabled);let f=d==="3d"?n.getDepthModeFor3D():n.getDepthModeForSublayer(0,be.ReadOnly);l.setDepthMode(f),u.render(l.gl,p),l.setDirty(),e.setBaseState(),l.bindFramebuffer.set(null)}}function Uq(e,t,r,i){let n=i.context,a=n.bindFramebuffer.get(),o=n.viewport.get();n.setCustomLayerDefaults(),n.setColorMode(i.colorModeForRenderPass()),n.setDepthMode(be.disabled),n.setStencilMode(Ie.disabled),t.implementation.renderToTerrainTile(n.gl,{tileID:{canonical:r.canonical,wrap:r.wrap},width:o[2],height:o[3]}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(a),n.viewport.set(o)}function $q(e,t){let r=t.context,i=r.gl,{sky:n,pixelRatio:a}=t.data,o=H$(n,t.transform,a),s=new be(i.LEQUAL,be.ReadWrite,[0,1]),l=Ie.disabled,u=t.colorModeForRenderPass();t.useProgram("sky").draw(r,i.TRIANGLES,s,l,u,ke.disabled,o,null,void 0,"sky",e.vertexBuffer,e.indexBuffer,e.segments)}function qq(e,t){let r=bT(e.position);tI(r,r);let i=Gi(new Float64Array(16));return e.anchor==="map"&&(Pa(i,i,t.rollInRadians),qs(i,i,-t.pitchInRadians),Pa(i,i,t.bearingInRadians),qs(i,i,t.center.lat*Math.PI/180),gT(i,i,-t.center.lng*Math.PI/180)),iI(r,r,i),r}function Gq(e,t){let r=t.context,i=r.gl,{sky:n,light:a}=t.data,o=t.useProgram("atmosphere"),s=new be(i.LEQUAL,be.ReadOnly,[0,1]),l=t.transform,u=qq(a,l),c=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),h=yo(l.worldSize,l.center.lat),p=zP(l),d=FP(Ui(p)-h,h),f=n["atmosphere-blend"]*c.projectionTransition*d;if(f===0)return;let m=G$(u,f,p,h,l.inverseProjectionMatrix);o.draw(r,i.TRIANGLES,s,Ie.disabled,vt.alphaBlended,ke.disabled,m,null,null,"atmosphere",e.vertexBuffer,e.indexBuffer,e.segments)}var Zq={symbol:Q$,circle:nq,heatmap:aq,line:gq,fill:yq,fillExtrusion:_q,hillshade:vq,colorRelief:bq,raster:wq,background:Cq,sky:$q,atmosphere:Gq,custom:Vq,debug:Fq,debugPadding:kq,terrainDepth:Oq},X6=b_.maxOverzooming+b_.maxUnderzooming+1,K6=1/2**16,Hq={name:TP,define:wP,prelude:dn.projectionMercator},Wq=class{constructor(e){this.currentLayer=0,this.opaquePassCutoff=1/0,this.depthRangeFor3D=[0,1],this.isRenderingToTexture=!1,this.nextStencilID=1,this.tileClippingMaskIDs={},this.transform=e.transform,this.terrain=e.terrain,this.data=e.data,this.context=e.context,this.programCache=e.programCache,this.currentPass=e.currentPass,this.projection=e.projection}getProjectionDataForTile(e,t={}){let r=this.transform.getProjectionData({overscaledTileID:e,aligned:t.aligned,applyGlobeMatrix:!this.isRenderingToTexture,applyTerrainMatrix:t.applyTerrainMatrix??!0});return this.isRenderingToTexture||(r.uniformBufferKey=t.aligned?`${e.key}/aligned`:e.key),r}getTerrainDataForTile(e){return this.isRenderingToTexture?null:this.terrain?.getTerrainData(e)??null}getMeshFromTileID(e,t,r,i){return this.projection.getMeshFromTileID(this.context,e,t,r,i)}useProgram(e,t,r=!1,i=[]){return this.programCache.getProgram({name:e,programConfiguration:t,projectionShaderVariant:r?Hq:this.data.projectionShaderVariant,showOverdrawInspector:this.data.showOverdrawInspector,useTerrain:this.terrain!==null,defines:i})}colorModeForRenderPass(){let e=this.context.gl;if(this.data.showOverdrawInspector){let t=.125;return new vt([e.CONSTANT_COLOR,e.ONE],new he(t,t,t,0),[!0,!0,!0,!0])}return this.currentPass==="opaque"?vt.unblended:vt.alphaBlended}getDepthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return be.disabled;let i=1-((1+this.currentLayer)*X6+e)*K6;return new be(r||this.context.gl.LEQUAL,t,[i,i])}getDepthModeFor3D(){return new be(this.context.gl.LEQUAL,be.ReadWrite,this.depthRangeFor3D)}setDepthRangeFor3D(e){this.depthRangeFor3D=[0,1-(e+2)*X6*K6]}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}clearStencil(){this.nextStencilID=1,this.currentStencilSource=void 0,this.context.clear({stencil:0})}invalidateTileClippingMasks(){this.currentStencilSource=void 0}renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let r=this.context;r.setColorMode(vt.disabled),r.setDepthMode(be.disabled);let i={};for(let n of t)i[n.key]=this.nextStencilID++;this.data.useSubdivision&&this.renderTileMasks(i,t,!0),this.renderTileMasks(i,t,!1),this.tileClippingMaskIDs=i}renderTileMasks(e,t,r){let i=this.context,n=i.gl,a=this.useProgram("clippingMask");for(let o of t){let s=e[o.key],l=this.getTerrainDataForTile(o),u=this.getMeshFromTileID(o.canonical,r,!0,"stencil"),c=this.getProjectionDataForTile(o);a.draw(i,n.TRIANGLES,be.disabled,new Ie({func:n.ALWAYS,mask:0},s,255,n.KEEP,n.KEEP,n.REPLACE),vt.disabled,this.isRenderingToTexture?ke.disabled:ke.backCCW,null,l,c,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new Ie({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Ie({func:t.EQUAL,mask:255},this.tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();let a={};for(let o=0;o<n;o++)a[o+i]=new Ie({func:t.GEQUAL,mask:255},o+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=n,[a,r]}return[{[i]:Ie.disabled},r]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(this.clearStencil(),n>1){let a={},o={};for(let s=0;s<n;s++)a[s+i]=new Ie({func:t.GREATER,mask:255},n+1+s,255,t.KEEP,t.KEEP,t.REPLACE),o[s+i]=new Ie({func:t.GREATER,mask:255},1+s,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=n*2+1,[a,o,r]}return this.nextStencilID=3,[{[i]:new Ie({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[i]:new Ie({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},r]}},vo,Yq=(vo=class{constructor(t){this.drawFunctions=Zq,this.context=new qU(t),this.programCache=new Y$(this.context),this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:Gi(new Float64Array(16)),renderTime:0},this.setup()}resize(t,r,i){this.width=Math.round(t*i),this.height=Math.round(r*i),this.context.viewport.set([0,0,this.width,this.height])}setup(){let t=this.context,r=new ho;r.emplaceBack(0,0),r.emplaceBack(R,0),r.emplaceBack(0,R),r.emplaceBack(R,R),this.tileExtentBuffer=t.createVertexBuffer(r,Fs.members),this.tileExtentSegments=ct.simpleSegment(0,0,4,2);let i=new ho;i.emplaceBack(0,0),i.emplaceBack(R,0),i.emplaceBack(0,R),i.emplaceBack(R,R),this.debugBuffer=t.createVertexBuffer(i,Fs.members),this.debugSegments=ct.simpleSegment(0,0,4,5);let n=new fz;n.emplaceBack(0,0,0,0),n.emplaceBack(R,0,R,0),n.emplaceBack(0,R,0,R),n.emplaceBack(R,R,R,R),this.rasterBoundsBuffer=t.createVertexBuffer(n,KV.members),this.rasterBoundsSegments=ct.simpleSegment(0,0,4,2);let a=new ho;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,Fs.members),this.viewportSegments=ct.simpleSegment(0,0,4,2);let o=new Cz;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new yn;s.emplaceBack(1,0,2),s.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.tileExtentMesh=new hc(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);let l=new ho;l.emplaceBack(-1,-1),l.emplaceBack(1,-1),l.emplaceBack(1,1),l.emplaceBack(-1,1);let u=new yn;u.emplaceBack(0,1,2),u.emplaceBack(0,2,3),this.skyMesh=new hc(t.createVertexBuffer(l,Fs.members),t.createIndexBuffer(u),ct.simpleSegment(0,0,l.length,u.length))}_renderTilesDepthBuffer(t){let r=this.context,i=r.gl,n=t.transform,a=t.useProgram("depth"),o=t.getDepthModeFor3D(),s=Cc(n,{tileSize:n.tileSize});for(let l of s){let u=t.getTerrainDataForTile(l),c=t.getMeshFromTileID(l.canonical,!0,!0,"raster"),h=t.getProjectionDataForTile(l);a.draw(r,i.TRIANGLES,o,Ie.disabled,vt.disabled,ke.backCCW,null,u,h,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}render(t,r,i){if(this.context.gl.isContextLost())return;let n=new Wq({transform:r,terrain:t.map.terrain??null,data:i,context:this.context,programCache:this.programCache,currentPass:"offscreen",projection:t.projection});this.lineAtlas=t.lineAtlas,this.patternAtlas=t.patternAtlas,VU(this.context.frameUniformBuffer,r,i),t.imageManager.beginFrame(),OU(this.context);let a=t._order,o=t.tileManagers,s={},l={},u={};for(let h in o){let p=o[h];p.used&&p.prepare(this.context),s[h]=p.getVisibleCoordinates(!1),l[h]=s[h].slice().reverse(),u[h]=p.getVisibleCoordinates(!0).reverse()}n.opaquePassCutoff=1/0;for(let h=0;h<a.length;h++){let p=a[h];if(t._layers[p].is3D()){n.opaquePassCutoff=h;break}}this.maybeDrawDepth(n),this.renderToTexture&&(this.renderToTexture.prepareForRender(t,r.zoom,i.moving),n.opaquePassCutoff=0),n.currentPass="offscreen";for(let h of a){let p=t._layers[h];if(!p.hasOffscreenPass()||p.isHidden(r.zoom))continue;let d=l[p.source];(p.type==="custom"||d.length)&&this.renderLayer(this,o[p.source],p,d,n)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?he.black:he.transparent,depth:1}),n.clearStencil(),i.sky&&this.drawFunctions.sky(this.skyMesh,n),n.setDepthRangeFor3D(t._order.length),!this.renderToTexture)for(n.currentPass="opaque",n.currentLayer=a.length-1;n.currentLayer>=0;n.currentLayer--){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source],d=s[h.source];n.renderTileClippingMasks(h,d),this.renderLayer(this,p,h,d,n)}n.currentPass="translucent";let c=!1;for(n.currentLayer=0;n.currentLayer<a.length;n.currentLayer++){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source];if(this.renderToTexture?.renderLayer(h,t,n))continue;!n.opaquePassEnabledForLayer()&&!c&&(c=!0,i.isRenderingGlobe&&!n.terrain&&this._renderTilesDepthBuffer(n));let d=(h.type==="symbol"?u:l)[h.source];n.renderTileClippingMasks(h,s[h.source]),this.renderLayer(this,p,h,d,n)}if(i.isRenderingGlobe&&this.drawFunctions.atmosphere(this.skyMesh,n),i.showTileBoundaries){let h=Bq(t,r.zoom);h&&this.drawFunctions.debug(this,h,h.getVisibleCoordinates(),n)}i.showPadding&&this.drawFunctions.debugPadding(n),this.renderToTexture&&!i.moving&&this.clearRTTPool(),this.context.setDefault()}markTerrainDepthDirty(){this.terrainFacilitator.depthDirty=!0}maybeDrawDepth(t){if(!t.data.projectionShaderVariant||!t.terrain)return;let r=this.terrainFacilitator.matrix,i=t.transform.modelViewProjectionMatrix,n=this.terrainFacilitator.depthDirty;n||(n=!eI(r,i)),n||(n=t.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),n&&(YM(r,i),this.terrainFacilitator.renderTime=Be(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,t.terrain,t))}renderLayer(t,r,i,n,a){if(i.isHidden(a.transform.zoom)||i.type!=="background"&&i.type!=="custom"&&!(n||[]).length)return;let o=this.drawFunctions;wC(i)?o.symbol(t,r,i,n,a):Qz(i)?o.circle(r,i,n,a):r9(i)?o.heatmap(t,r,i,n,a):CF(i)?o.line(t,r,i,n,a):$9(i)?o.fill(t,r,i,n,a):dF(i)?o.fillExtrusion(r,i,n,a):o9(i)?o.hillshade(t,r,i,n,a):h9(i)?o.colorRelief(t,r,i,n,a):my(i)?o.raster(r,i,n,a):SL(i)?o.background(t,r,i,n,a):Ef(i)&&o.custom(t,r,i,n,a)}saveTileTexture(t){let r=this._tileTextures[t.size[0]];r?r.length<vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?r.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let r=this._tileTextures[t];return r&&r.length>0?r.pop():null}acquireRTT(t){let r=this.context.gl,i=this._rttObjectRecyclePool.pop();if(i)return i.size!==t&&(i.texture.update({width:t,height:t,data:null},{premultiply:!1,useMipmap:!0}),i.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),i.size=t),i;let n=new Ot(this.context,{width:t,height:t,data:null},r.RGBA,{premultiply:!1,useMipmap:!0});return n.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:n,size:t}}bindRTT(t){let r=this.context.gl,i=t.size;if(!this._rttSharedFbo){let n=this.context.createFramebuffer(i,i,!0,!0),a=this.context.createRenderbuffer(r.DEPTH_STENCIL,i,i);n.depthAttachment.set(a),this._rttSharedFbo={fbo:n,depthRenderbuffer:a,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,i,i),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=i,this._rttSharedFbo.fbo.height=i,this._rttSharedFbo.size=i),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}clearRTTPool(){for(let t of this._rttObjectRecyclePool)t.texture.destroy();this._rttObjectRecyclePool.length=0}destroyRTTResources(){if(this.clearRTTPool(),!this._rttSharedFbo)return;this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new Ot(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let r=this._tileTextures[t];if(r)for(let i of r)i.destroy()}this._tileTextures={}}this.destroyRTTResources(),this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.skyMesh?.destroy(),this.skyMesh=null,this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.destroy(),this.programCache.destroy(),this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:r}=this.context.gl;return this.width!==t||this.height!==r}},vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,vo),Xq=class extends Error{constructor(e,t){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=t?.statusMessage??null}};function Xv(e,t){let r=!1,i=null,n,a=()=>{i=null,r&&(r=(e(...n),i=setTimeout(a,t),!1))};return(...o)=>(r=!0,n=o,i||a(),i)}var Kq=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):([...t.keys()][0]??"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let r=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:r,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let a=Array.from(t.keys());a.length>0&&t.delete(a[0])}let r=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=r?`#${r}`:"",n=window.location.href.replace(/(#.+)?$/,i);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Xv(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),r=Math.round(this._map.getZoom()*100)/100,i=tF(this._map._camera.transform.worldCoordinateHelper,t),n=10**Math.ceil((r*Math.LN2+Math.log(512/i/.5))/Math.LN10),a=Math.round(t.lng*n)/n,o=Math.round(t.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=e?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(u+=`/${Math.round(s*10)/10}`),l&&(u+=`/${Math.round(l)}`),this._hashName){let c=this._getHashParams();return c.set(this._hashName,u),`#${decodeURIComponent(c.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${u}`}_isValidHash(e){if(e.length<3||e.some(n=>isNaN(+n)))return!1;try{new H(+e[2],+e[1])}catch{return!1}let t=+e[0],r=+(e[3]||0),i=+(e[4]||0);return t>=this._map.getMinZoom()&&t<=this._map.getMaxZoom()&&r>=-180&&r<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}},Pc={linearity:.3,easing:F_(0,0,.3,1)},Qq=J({deceleration:2500,maxSpeed:1400},Pc),Jq=J({deceleration:20,maxSpeed:1400},Pc),eG=J({deceleration:1e3,maxSpeed:360},Pc),tG=J({deceleration:1e3,maxSpeed:90},Pc),rG=J({deceleration:1e3,maxSpeed:360},Pc),iG=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Be(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=Be();for(;e.length>0&&t-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,t=Be()-60,r=Math.max(0,e.length-2);for(;r>0&&e[r-1].time>=t;)r--;return e.slice(r)}_onMoveEnd(e){this._drainInertiaBuffer();let t=this._getVelocityEntries();if(t.length<2){this.clear();return}let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new k(0,0),pinchAround:void 0,around:void 0};for(let{settings:a}of t)a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround);for(let{settings:a}of t.slice(1))r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,r.roll+=a.rollDelta||0,a.panDelta&&r.pan._add(a.panDelta);if(!r.pan.mag()&&!r.zoom&&!r.bearing&&!r.pitch&&!r.roll){this.clear();return}let i=Be()-t[0].time,n={};if(r.pan.mag()){let a=Cu(r.pan.mag(),i,J({},Qq,e||{})),o=r.pan.mult(a.amount/r.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(o,this._map._camera.transform);n.center=s.easingCenter,n.offset=s.easingOffset,Eu(n,a)}if(r.zoom){let a=Cu(r.zoom,i,Jq);n.zoom=Jr(this._map.getZoom()+a.amount,this._map.getZoomSnap(),a.amount),Eu(n,a)}if(r.bearing){let a=Cu(r.bearing,i,eG);n.bearing=this._map.getBearing()+Q(a.amount,-179,179),Eu(n,a)}if(r.pitch){let a=Cu(r.pitch,i,tG);n.pitch=this._map.getPitch()+a.amount,Eu(n,a)}if(r.roll){let a=Cu(r.roll,i,rG);n.roll=this._map.getRoll()+Q(a.amount,-179,179),Eu(n,a)}if(n.zoom||n.bearing){let a=r.pinchAround===void 0?r.around:r.pinchAround;n.around=a?this._map.unproject(a):this._map.getCenter()}return this.clear(),J(n,{noMoveStart:!0})}};function Eu(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Cu(e,t,r){let{maxSpeed:i,linearity:n,deceleration:a}=r,o=Q(e*n/(t/1e3),-i,i),s=Math.abs(o)/(a*n);return{easing:r.easing,duration:s*1e3,amount:s/2*o}}var nG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new YI(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new ei(e.type,this._map,e))}mouseup(e){this._map.fire(new ei(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new ei(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ei(e.type,this._map,e))}mouseover(e){this._map.fire(new ei(e.type,this._map,e))}mouseout(e){this._map.fire(new ei(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Dp(e.type,this._map,e))}touchmove(e){this._map.fire(new Dp(e.type,this._map,e))}touchend(e){this._map.fire(new Dp(e.type,this._map,e))}touchcancel(e){this._map.fire(new Dp(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},aG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent,this._clearLongPress(),this._touchActive=!1}mousemove(e){this._map.fire(new ei(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ei("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}touchstart(e,t,r){if(this._clearLongPress(),this._touchActive=r.length>0,r.length!==1)return;this._longPressStart=t[0];let i=r[0];this._longPressTimer=setTimeout(()=>{this._longPressTimer=void 0;let n=new MouseEvent("contextmenu",{clientX:i.clientX,clientY:i.clientY,button:2,bubbles:!0,cancelable:!0});this._map.fire(new ei("contextmenu",this._map,n))},500)}touchmove(e,t,r){this._longPressTimer&&(r.length!==1||!this._longPressStart||t[0].dist(this._longPressStart)>this._clickTolerance)&&this._clearLongPress()}touchend(){this._touchActive=!1,this._clearLongPress()}touchcancel(){this._touchActive=!1,this._clearLongPress()}_clearLongPress(){this._longPressTimer&&(this._longPressTimer=(clearTimeout(this._longPressTimer),void 0)),this._longPressStart=void 0}contextmenu(e){this._touchActive?e.preventDefault():(this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ei(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault())}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},oG=class{constructor(e,t,r){this._map=e,this._tr=r,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&typeof t.boxZoom=="object"&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(ht.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=r,this._box||(this._box=ht.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let n=Math.min(i.x,r.x),a=Math.max(i.x,r.x),o=Math.min(i.y,r.y),s=Math.max(i.y,r.y);this._box.style.transform=`translate(${n}px,${o}px)`,this._box.style.width=`${a-n}px`,this._box.style.height=`${s-o}px`}mouseupWindow(e,t){if(!this._active||e.button!==0)return;let r=this._startPos,i=t;if(this.reset(),ht.suppressClick(),r.x===i.x&&r.y===i.y)this._fireEvent("boxzoomcancel",e);else{if(this._map.fire(new e5("boxzoomend",{originalEvent:e})),this._boxZoomEnd){this._boxZoomEnd(this._map,r,i,e);return}return{cameraAnimation:n=>n.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),ht.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new e5(e,{originalEvent:t}))}};function C_(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let r={};for(let i=0;i<e.length;i++)r[e[i].identifier]=t[i];return r}function sG(e){let t=new k(0,0);for(let r of e)t._add(r);return t.div(e.length)}var lG=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=sG(t),this.touches=C_(r,t)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;let i=C_(r,t);for(let n in this.touches){let a=this.touches[n],o=i[n];(!o||o.dist(a)>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),r.length===0){let i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}},P_=class{constructor(e){this.singleTap=new lG(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){let i=this.singleTap.touchend(e,t,r);if(i){let n=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(i)<30;if((!n||!a)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}},uG=class{constructor(e,t){this._tr=t,this._zoomIn=new P_({numTouches:1,numTaps:2}),this._zoomOut=new P_({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){let i=this._zoomIn.touchend(e,t,r),n=this._zoomOut.touchend(e,t,r),a=this._tr;if(i)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom+1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(i)?a.unproject(i):void 0},{originalEvent:e})};if(n)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom-1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(n)?a.unproject(n):void 0},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},kf=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._startPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._startPoint=Array.isArray(t)?t[0]:t,this._lastPoint=this._startPoint,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let i=Array.isArray(t)?t[0]:t;if(!(!this._moved&&i.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=i,this._move(r,i,this._startPoint)}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&ht.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}},cG={0:1,2:2};function hG(e,t){let r=cG[t];return e.buttons===void 0||(e.buttons&r)!==r}var zf=class{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=e.button}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!hG(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}};function Kv(e,t,r){return t==="center"||!(e.bearingDelta||e.pitchDelta||e.rollDelta)?e:{...e,around:r}}var Ff=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=t=>{t.preventDefault()}};function pG({enable:e,clickTolerance:t}){return new kf({clickTolerance:t,move:(r,i)=>({around:i,panDelta:i.sub(r)}),activateOnStart:!0,moveStateManager:new zf({checkCorrectEvent:r=>r.button===0&&!r.ctrlKey}),enable:e,assignEvents:Ff})}function dG({enable:e,clickTolerance:t,minPixelCenterThreshold:r=100,rotateSpeed:i=.8},n,a,o){return new kf({clickTolerance:t,move:(s,l,u)=>{if(a?.()==="pointer")return Kv({bearingDelta:(l.x-s.x)*i},"pointer",u);let c=n(),h=(o?.()??"circular")==="circular";if(h&&Math.abs(c.y-s.y)>r)return{bearingDelta:RI(new k(s.x,l.y),l,c)};let p=(l.x-s.x)*i;return h&&l.y<c.y&&(p=-p),{bearingDelta:p}},moveStateManager:new zf({checkCorrectEvent:s=>s.button===0&&s.ctrlKey||s.button===2&&!s.ctrlKey}),enable:e,assignEvents:Ff})}function fG({enable:e,clickTolerance:t,pitchSpeed:r=-.5},i){return new kf({clickTolerance:t,move:(n,a,o)=>Kv({pitchDelta:(a.y-n.y)*r},i?.()??"center",o),moveStateManager:new zf({checkCorrectEvent:n=>n.button===0&&n.ctrlKey||n.button===2}),enable:e,assignEvents:Ff})}function mG({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:r=.3},i,n){return new kf({clickTolerance:t,move:(a,o,s)=>{let l=i(),u=(o.x-a.x)*r;return o.y<l.y&&(u=-u),Kv({rollDelta:u},n?.()??"center",s)},moveStateManager:new zf({checkCorrectEvent:a=>a.button===2&&a.ctrlKey}),enable:e,assignEvents:Ff})}var gG=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new k(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active)if(this._shouldBePrevented(r.length))this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e);else return e.preventDefault(),this._calculateTransform(e,t,r)}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,r){r.length>0&&(this._active=!0);let i=C_(r,t),n=new k(0,0),a=new k(0,0),o=0;for(let l in i){let u=i[l],c=this._touches[l];c&&(n._add(u),a._add(u.sub(c)),o++,i[l]=u)}if(this._touches=i,this._shouldBePrevented(o)||!a.mag())return;let s=a.div(o);if(this._sum._add(s),!(this._sum.mag()<this._clickTolerance))return{around:n.div(o),panDelta:s}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},Qv=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);a&&o||(this._active&&ht.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function ed(e,t,r){for(let i=0;i<e.length;i++)if(e[i].identifier===r)return t[i]}var Q6=.1;function J6(e,t){return Math.log(e/t)/Math.LN2}var yG=class extends Qv{constructor(){super(),this._zoomRate=1,this._zoomThreshold=Q6}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??Q6}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let r=this._distance;if(this._distance=e[0].dist(e[1]),!(!this._active&&Math.abs(J6(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:J6(this._distance,r)*this._zoomRate,pinchAround:t}}};function eT(e,t){return e.angleWith(t)*180/Math.PI}var _G=class extends Qv{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,r){let i=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:eT(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,r=eT(e,this._startVector);return Math.abs(r)<t}};function $1(e){return Math.abs(e.y)>Math.abs(e.x)}var vG=class extends Qv{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,$1(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let i=e[0].sub(this._lastPoints[0]),n=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}}gestureBeginsVertically(e,t,r){if(this._valid!==void 0)return this._valid;let i=e.mag()>=2,n=t.mag()>=2;if(!i&&!n)return;if(!i||!n)return this._firstMove===void 0&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return $1(e)&&$1(t)&&a}},xG={panStep:100,bearingStep:15,pitchStep:10},bG=class{constructor(e,t){this._tr=t;let r=xG;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,i=0,n=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:wG,zoom:t?Jr(s.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+i*this._pitchStep,offset:[-n*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}};function wG(e){return e*(2-e)}var tT=4.000244140625,TG=class{constructor(e,t,r){this._onTimeout=i=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},this._map=e,this._tr=r,this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);return}let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,r=Be(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,t!==0&&t%tT==0?this._type="wheel":t!==0&&Math.abs(t)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let t=ht.mousePos(this._map.getCanvas(),e),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(H.convert(r.center)):t,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let o=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=o),typeof this._targetZoom=="number"&&(this._targetZoom+=o)}if(this._delta!==0){let o=this._type==="wheel"&&Math.abs(this._delta)>tT?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*o)));this._delta<0&&s!==0&&(s=1/s);let l=typeof this._targetZoom=="number"?Bt(this._targetZoom):e.scale,u=e.applyConstrain(e.getCameraLngLat(),Ut(l*s)).zoom,c=this._map.getZoomSnap();if(this._type==="wheel"&&c>0){let h=Jr(e.zoom,c);this._targetZoom=Jr(u,c,u-h)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,r=this._startZoom,i=this._easing,n=!1,a;if(this._type==="wheel"&&r&&i){let o=Be()-this._lastWheelEventTime,s=Math.min((o+5)/200,1),l=i(s);a=ot.number(r,t,l),s<1?this._needsRerender=!0:n=!0}else a=t,n=!0;return this._active=!0,n&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!n,zoomDelta:a-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=Q1;if(this._prevEase){let r=this._prevEase,i=(Be()-r.start)/r.duration,n=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(n*n+1e-4)*.01;t=F_(a,Math.sqrt(.0729-a*a),.25,1)}return this._prevEase={start:Be(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},SG=class{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}},EG=class{constructor(e,t){this._tr=t,this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:Jr(this._tr.zoom+(e.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.transform.isPointOnMapSurface(t)?this._tr.unproject(t):void 0},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},CG=class{constructor(){this._tap=new P_({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,t,r);else{let i=t[0],n=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(i)<30;!n||!a?this.reset():r.length>0&&(this._swipePoint=i,this._swipeTouch=r[0].identifier)}}touchmove(e,t,r){if(!this._tapTime)this._tap.touchmove(e,t,r);else if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128*this._zoomRate}}}touchend(e,t,r){if(this._tapTime)this._swipePoint&&r.length===0&&this.reset();else{let i=this._tap.touchend(e,t,r);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},PG=class{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},DG=class{constructor(e,t,r,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=r,this._mouseRoll=i;let{aroundCenter:n=!0}=e;this._defaultMovement=n?"circular":"linear",this.around="center",this.movement=this._defaultMovement}enable(e){let t=typeof e=="object"?e:{};this.around=t.around??"center",this.movement=t.around==="pointer"?"linear":t.movement??this._defaultMovement,this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},AG=class{constructor(e,t,r,i){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},MG=class{constructor(e,t){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=ht.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=r,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,t){this._enabled&&(this._map.fire(new Wt("cooperativegestureprevented",{gestureType:e,originalEvent:t})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},IG=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(k.convert(e),this._camera.terrain)}},td=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,kG=class extends Ao{};function q1(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}var zG=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,t,r){this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._rotationPivot=null,this.handleWindowEvent=n=>{this.handleEvent(n,`${n.type}Window`)},this.handleEvent=(n,a)=>{if(n.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let o=n.type==="renderFrame"?void 0:n,s={needsRenderFrame:!1},l={},u={};for(let{handlerName:p,handler:d,allowed:f}of this._handlers){if(!d.isEnabled())continue;let m;if(this._blockedByActive(u,f,p))d.reset();else if(d[a||n.type]){if(BI(n,a||n.type)){let _=ht.mousePos(this._map.getCanvas(),n);m=d[a||n.type](n,_)}else if(LI(n,a||n.type)){let _=n.touches,g=this._getMapTouches(_),y=ht.touchPos(this._map.getCanvas(),g);m=d[a||n.type](n,y,g)}else OI(a||n.type)||(m=d[a||n.type](n));this.mergeHandlerResult(s,l,m,p,o),m?.needsRenderFrame&&this._triggerRenderFrame()}(m||d.isActive())&&(u[p]=d)}let c={};for(let p in this._previousActiveHandlers)u[p]||(c[p]=o);this._previousActiveHandlers=u,(Object.keys(c).length||q1(s))&&(this._changes.push([s,l,c]),this._triggerRenderFrame()),(Object.keys(u).length||q1(s))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=s;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._camera=t,this._transformProvider=new IG(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iG(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[n,a,o]of this._listeners)n.addEventListener(a,n===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(let[e,t,r]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){let t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new nG(t,e));let i=t.boxZoom=new oG(t,e,this._transformProvider);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let n=t.cooperativeGestures=new MG(t,e.cooperativeGestures);this._add("cooperativeGestures",n),e.cooperativeGestures&&n.enable();let a=new uG(t,this._transformProvider),o=new EG(t,this._transformProvider);t.doubleClickZoom=new SG(o,a),this._add("tapZoom",a),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new CG;this._add("tapDragZoom",s);let l=t.touchPitch=new vG(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=()=>this._camera.transform.centerPoint,c=()=>t.dragRotate.around,h=dG(e,u,c,()=>t.dragRotate.movement),p=fG(e,c),d=mG(e,u,c);t.dragRotate=new DG(e,h,p,d),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",p,["mouseRotate","mouseRoll"]),this._add("mouseRoll",d,["mousePitch"]),e.interactive&&e.dragRotate&&t.dragRotate.enable(e.dragRotate);let f=pG(e),m=new gG(e,t);t.dragPan=new PG(r,f,m),this._add("mousePan",f),this._add("touchPan",m,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let _=new _G,g=new yG;t.touchZoomRotate=new AG(r,g,_,s),this._add("touchRotate",_,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new aG(t,e),["touchPan"]);let y=t.scrollZoom=new TG(t,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let v=t.keyboard=new bG(t,this._transformProvider);this._add("keyboard",v),e.interactive&&e.keyboard&&t.keyboard.enable()}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!td(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,r){for(let i in e)if(i!==r&&!t?.includes(i))return!0;return!1}_getMapTouches(e){let t=[];for(let r of e){let i=r.target;this._el.contains(i)&&t.push(r)}return t}mergeHandlerResult(e,t,r,i,n){if(!r)return;J(e,r);let a={handlerName:i,originalEvent:r.originalEvent||n};r.zoomDelta!==void 0&&(t.zoom=a),r.panDelta!==void 0&&(t.drag=a),r.rollDelta!==void 0&&(t.roll=a),r.pitchDelta!==void 0&&(t.pitch=a),r.bearingDelta!==void 0&&(t.rotate=a)}_applyChanges(){let e={},t={},r={};for(let[i,n,a]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new k(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),J(t,n),J(r,a);this._updateMapTransform(e,t,r),this._changes=[]}_updateMapTransform(e,t,r){let i=this._map.terrain;if(!q1(e)){this._fireEvents(t,r,!0);return}let n=this._camera.getTransformForUpdate();if(this._camera.stop(!0),this._turnsAroundPivot(e,t)){this._orbitRotationPivot(n,e,i),this._commitFrame(n,e,t,r);return}let{panDelta:a,zoomDelta:o,bearingDelta:s,pitchDelta:l,rollDelta:u}=e;o>0&&this._terrainGesture.inFlight&&this._camera.moveCenterOntoTerrain(n,o);let{around:c,aroundOnSurface:h}=this._resolveAround(e,i,n),p=i?this._terrainGestureElevation(i,c,h,n,t):void 0,d={panDelta:a,zoomDelta:o,rollDelta:u,pitchDelta:l,bearingDelta:s,around:c,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(c)&&(c=n.centerPoint);let f=this._computePreZoomAroundLoc(n,c,a,p);this._handleMapControls({terrain:i,tr:n,deltasForHelper:d,preZoomAroundLoc:f,combinedEventsInProgress:t,panDelta:a}),this._commitFrame(n,e,t,r)}_commitFrame(e,t,r,i){this._camera.applyUpdatedTransform(e),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,i,!0)}_turnsAroundPivot(e,t){return e.around?!t.drag&&!t.zoom:!1}_orbitRotationPivot(e,t,r){r&&!this._terrainGesture.inFlight&&(this._terrainGesture.inFlight=!0,this._camera.holdElevation(e,"gesture"));let{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l}=t;this._rotationPivot??(this._rotationPivot=this._camera.captureRotationPivot(e,l)),this._camera.orbitRotationPivot(e,this._rotationPivot,{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l})||(this._rotationPivot=null)}_resolveAround(e,t,r){let i=e.pinchAround===void 0?e.around:e.pinchAround;return i||(i=this._camera.transform.centerPoint),t&&!r.isPointOnMapSurface(i)?{around:r.centerPoint,aroundOnSurface:!1}:{around:i,aroundOnSurface:!0}}_terrainGestureElevation(e,t,r,i,n){if(!r)return;if(this._terrainGesture.anchorCenterElevation!==i.elevation&&(n.drag||n.zoom)){let o=i.screenTerrainPointToMercatorCoordinate(t,e);this._terrainGesture.anchorElevation=o?o.z:void 0,this._terrainGesture.anchorCenterElevation=i.elevation}let a=this._terrainGesture.anchorElevation;if(a!=null&&!(t.distSqr(i.centerPoint)<.01)&&!(a-i.elevation>=.9*(i.getCameraAltitude()-i.elevation)))return a}_computePreZoomAroundLoc(e,t,r,i){if(t.distSqr(e.centerPoint)<.01)return e.center;let n=r?t.sub(r):t;return i===void 0?e.screenPointToLocation(n):e.screenPointToLocationAtElevation(n,i)}_handleMapControls({terrain:e,tr:t,deltasForHelper:r,preZoomAroundLoc:i,combinedEventsInProgress:n,panDelta:a}){let o=this._camera.cameraHelper;o.handleMapControlsRollPitchBearingZoom(r,t),!e&&!o.useGlobeControls&&!t.isPointOnMapSurface(r.around)?a&&t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):e?this._terrainGesture.inFlight?!o.useGlobeControls&&r.aroundElevation===void 0&&n.drag&&a?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):o.handleMapControlsPan(r,t,i):(this._terrainGesture.inFlight=!0,this._camera.holdElevation(t,"gesture"),o.handleMapControlsPan(r,t,i)):o.handleMapControlsPan(r,t,i)}_fireEvents(e,t,r){let i=td(this._eventsInProgress),n=td(e),a={};for(let c in e){let{originalEvent:h}=e[c];this._eventsInProgress[c]||(a[`${c}start`]=h),this._eventsInProgress[c]=e[c]}!i&&n&&this._fireEvent("movestart",n.originalEvent);for(let c in a)this._fireEvent(c,a[c]);n&&this._fireEvent("move",n.originalEvent);for(let c in e){let{originalEvent:h}=e[c];this._fireEvent(c,h)}let o={},s;for(let c in this._eventsInProgress){let{handlerName:h,originalEvent:p}=this._eventsInProgress[c];this._handlersById[h].isActive()||(delete this._eventsInProgress[c],s=t[h]||p,o[`${c}end`]=s)}for(let c in o)this._fireEvent(c,o[c]);let l=td(this._eventsInProgress),u=(i||n)&&!l;if(u&&this._terrainGesture.inFlight){let c=this._camera.releaseElevation();this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._camera.applyTransformChange(h=>{this._map.getCenterClampedToGround()&&(this._map.terrain?this._camera.putCenterBackOnTerrain(h,this._map.terrain,c):h.setElevation(0))})}if(r&&u){this._updatingCamera=!0;let c=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),h=p=>p!==0&&-this._bearingSnap<p&&p<this._bearingSnap;c&&(c.essential||!Nr.prefersReducedMotion)?(h(c.bearing||this._map.getBearing())&&(c.bearing=0),c.freezeElevation=!0,this._map.easeTo(c,{originalEvent:s})):(this._fireEvent("moveend",s),h(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}u&&(this._rotationPivot=null)}_fireEvent(e,t){this._camera.fire(new ne(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new kG("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},FG=class{constructor(e,t,r){this.holder=e,this.lift=null,this._terrainChanged=!1,this._dem=t?"awaiting":"loaded",this.keepsTerrainBelowMaxZoomForCenter=r}get tookDem(){return this._dem==="taken"}noteTerrainChange(){this._terrainChanged=!0}take(e,t){let r=!1;if(this._terrainChanged&&(this._terrainChanged=!1,t.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded"&&(e.setElevation(0),this._dem="awaiting",r=!0)),this._dem!=="awaiting")return r;let i=t.getDrawnElevationForLngLat(e.center,!0);if(i!==void 0)return e.setElevation(i),this._dem="taken",!0;let n=t.getDrawnElevationForLngLat(e.center);return n===void 0||n===e.elevation?r:(e.setElevation(n),!0)}},rT=.01,RG=class extends lr{constructor(e){super(),this._elevationHold=null,this._renderFrameCallback=()=>{let t=Math.min((Be()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=fd(),this.cameraHelper=new qu,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=e.centerClampedToGround??!0,this.transformCameraUpdate=e.transformCameraUpdate??null,this._stopHandlers=e.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}setTerrain(e){this.terrain=e,e&&this._elevationHold?.noteTerrainChange(),this.applyTerrainChange()}migrateProjection(e,t){if(e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t,this._requestedCameraState){let r=e.clone();r.apply(this._requestedCameraState,!0),this._requestedCameraState=r}}getCenter(){return new H(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,t,r){return e=k.convert(e).mult(-1),this.panTo(this.transform.center,J({offset:e},t),r)}panTo(e,t,r){return this.easeTo(J({center:e},t),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,r){return this.easeTo(J({zoom:e},t),r)}zoomIn(e,t){return this.zoomTo(Jr(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(Jr(this.getZoom()-1,this._zoomSnap),e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return e!=this.transform.fov&&(this.applyTransformChange(r=>r.setFov(e)),this.fire(new ne("movestart",t)).fire(new ne("move",t)).fire(new ne("moveend",t))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,r){return this.easeTo(J({bearing:e},t),r)}resetNorth(e,t){return this.rotateTo(0,J({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(J({bearing:0,pitch:0,roll:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=Zn.convert(e).adjustAntiMeridian();let r=t?.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,t,r,i){let n={top:0,bottom:0,right:0,left:0};if(i=J({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},i),typeof i.padding=="number"){let p=i.padding;i.padding={top:p,bottom:p,right:p,left:p}}let a=J(n,i.padding);i.padding=a;let o=this.transform,s=new Zn(e,t),l={top:0,bottom:0,right:0,left:0},u=i.absolutePadding?l:a,c=i.absolutePadding?a:J(l,o.padding),h=this.cameraHelper.cameraForBoxAndBearing(i,u,c,s,r,o);if(h)return this._zoomSnap&&(h.zoom=Jr(h.zoom,this._zoomSnap,-1)),i.absolutePadding?{...h,padding:a}:h}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,t,r,i,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(k.convert(e)),this.transform.screenPointToLocation(k.convert(t)),r,i),i,n)}_fitInternal(e,t,r){return e?(t=J(e,t),t.absolutePadding?(t.padding=e.padding,delete t.absolutePadding):delete t.padding,t.linear?this.easeTo(t,r):this.flyTo(t,r)):this}jumpTo(e,t){this.stop(),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=!1,n=!1,a=!1,o=r.zoom;if(this.terrain&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(e.center?H.convert(e.center):r.center,r);u!=="loading"&&r.setElevation(l)}this.cameraHelper.handleJumpToCenterZoom(r,e);let s=r.zoom!==o;return e.elevation!==void 0&&r.elevation!==+e.elevation&&r.setElevation(+e.elevation),e.bearing!==void 0&&r.bearing!==+e.bearing&&(i=!0,r.setBearing(+e.bearing)),e.pitch!==void 0&&r.pitch!==+e.pitch&&(n=!0,r.setPitch(+e.pitch)),e.roll!==void 0&&r.roll!==+e.roll&&(a=!0,r.setRoll(+e.roll)),e.padding!=null&&!r.isPaddingEqual(e.padding)&&r.setPadding(e.padding),this.applyUpdatedTransform(r),this.fire(new ne("movestart",t)).fire(new ne("move",t)),s&&this.fire(new ne("zoomstart",t)).fire(new ne("zoom",t)).fire(new ne("zoomend",t)),i&&this.fire(new ne("rotatestart",t)).fire(new ne("rotate",t)).fire(new ne("rotateend",t)),n&&this.fire(new ne("pitchstart",t)).fire(new ne("pitch",t)).fire(new ne("pitchend",t)),a&&this.fire(new ne("rollstart",t)).fire(new ne("roll",t)).fire(new ne("rollend",t)),this.fire(new ne("moveend",t))}calculateAnchoredCameraOptions(e){let t=this.transform.clone(),r=H.convert(e.anchorLocation),i=k.convert(e.anchorScreenPoint),n={panDelta:i.sub(this.transform.locationToScreenPoint(r,this.terrain)),zoomDelta:e.zoom===void 0?0:e.zoom-t.zoom,bearingDelta:0,pitchDelta:0,rollDelta:0,around:i,aroundElevation:this.terrain?.getElevationForLngLat(r,t)};return this.cameraHelper.handleMapControlsRollPitchBearingZoom(n,t),this.cameraHelper.handleMapControlsPan(n,t,r),{center:t.center,zoom:t.zoom}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){let a=this.transform.calculateCenterFromCameraLngLatAlt(e,t,r,i);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:r,pitch:i,roll:n}}easeTo(e,t){this._stop(!1,e.easeId),e=J({offset:[0,0],duration:500,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap)),(e.animate===!1||!e.essential&&Nr.prefersReducedMotion)&&(e.duration=0);let r=this.getTransformForUpdate(),i=this.getBearing(),n=r.pitch,a=r.roll,o=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),s=e.pitch===void 0?n:+e.pitch,l=e.roll===void 0?a:this._normalizeBearing(e.roll,a),u=e.padding===void 0?r.padding:e.padding,c=k.convert(e.offset),h,p;e.around&&(h=H.convert(e.around),p=r.locationToScreenPoint(h));let d={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(r,{bearing:o,pitch:s,roll:l,padding:u,around:h,aroundPoint:p,offsetAsPoint:c,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating||(this._rotating=i!==o),this._pitching||(this._pitching=s!==n),this._rolling||(this._rolling=l!==a),this._padding=!r.isPaddingEqual(u),this._zooming||(this._zooming=f.isZooming),this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,d,{tr:r,center:f.elevationCenter,freeze:e.freezeElevation}),this._ease(m=>{f.easeFunc(m),this.terrain&&!e.freezeElevation&&this._updateElevation(m,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},m=>{this._afterEase(t,m,e.freezeElevation)},e),this}_prepareEase(e,t,r={},i){this._moving=!0,this.terrain&&i&&(this._prepareElevation(i.center,i.tr),i.freeze&&this.holdElevation(i.tr,"animation")),!t&&!r.moving&&this.fire(new ne("movestart",e)),this._zooming&&!r.zooming&&this.fire(new ne("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new ne("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new ne("pitchstart",e)),this._rolling&&!r.rolling&&this.fire(new ne("rollstart",e))}_prepareElevation(e,t){this._elevationCenter=e,this._elevationStart=t.elevation;let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(e,t);this._elevationTarget=i==="loading"?t.elevation:r,this.elevationFreeze=!0}_updateElevation(e,t){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(t.center,t),t.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,t.tileZoom));let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(this._elevationCenter,t),n=i==="loading"?this._elevationTarget:r;if(e<1&&n!==this._elevationTarget){let a=this._elevationTarget-this._elevationStart,o=(n-(a*e+this._elevationStart))/(1-e);this._elevationStart+=e*(a-o),this._elevationTarget=n}this.getCenterClampedToGround()&&t.setElevation(ot.number(this._elevationStart,this._elevationTarget,e))}holdElevation(e,t){this.elevationFreeze=!0;let r=!!this.terrain&&this.getCenterClampedToGround()&&this.terrain.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded",i=this.terrain?this._terrainHeightAboveMaxZoomForCenter(e):void 0;this._elevationHold=new FG(t,r,i!==void 0&&i<=rT)}releaseElevation(){let e=this._elevationHold?.tookDem??!1;return this.elevationFreeze=!1,this._elevationHold=null,e}putCenterBackOnTerrain(e,t,r){if(r&&t.getDrawnElevationForLngLat(e.center,!0)===void 0){e.setElevation(t.getElevationForLngLat(e.center,e));let i=this._raiseCameraByPitchAndZoom(e);i!==e&&e.apply(i,!1)}else e.recalculateZoomAndCenter(t)}_takeLandedElevation(e){return!this._elevationHold||!this.terrain||!this.getCenterClampedToGround()?!1:this._elevationHold.take(e,this.terrain)}applyTerrainChange(){if(this.elevationFreeze){let i=this._requestedCameraState;this._elevationHold?.holder==="gesture"&&i&&this._takeLandedElevation(i)&&this.applyUpdatedTransform(i);return}let e=this.transform;if(e.setMinElevationForCurrentTile(this.terrain?this.terrain.getMinTileElevationForLngLatZoom(e.center,e.tileZoom):0),!this.getCenterClampedToGround())return;if(!this.terrain){e.setElevation(0);return}let{elevation:t,demState:r}=this.terrain.getElevationAndDEMStateForLngLat(e.center,e);r!=="loading"&&e.setElevation(t)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState)}_keepCameraAboveTerrain(e){let t=this._elevationHold;if(!this.terrain||!t||e.pitch>=90||!this.getCenterClampedToGround()||e.getClippingPlane())return this._raiseCameraByPitchAndZoom(e);let r=t.holder==="gesture",i=t.lift&&t.lift.heldElevation+t.lift.height===e.elevation?t.lift:{heldElevation:e.elevation,height:0},n=this._terrainHeightAboveMaxZoomForCenter(e);n!==void 0&&n<=rT&&(t.keepsTerrainBelowMaxZoomForCenter=!0);let a=t.keepsTerrainBelowMaxZoomForCenter&&n!==void 0?n:-1/0,o=r?this._terrainHeightAboveCamera(e):-1/0,s=Math.max(0,Math.max(o,a)+i.height);return s!==i.height&&e.setElevation(i.heldElevation+s),t.lift=s>0?{heldElevation:i.heldElevation,height:s}:null,r?e:this._raiseCameraByPitchAndZoom(e)}_raiseCameraByPitchAndZoom(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90||e.getClippingPlane())return e;let t=e.getCameraLngLat(),r=this.terrain?this._terrainHeightAboveCamera(e):-e.getCameraAltitude();if(r<=0)return e;let i=e.clone();for(let n=0;n<3&&r>0;n++){let{zoom:a,pitch:o}=i.calculateCameraOptionsFromTo(t,i.getCameraAltitude()+r,i.center,i.elevation);i.setZoom(a),i.setPitch(o),r=this.terrain?this._terrainHeightAboveCamera(i):-i.getCameraAltitude()}return i}_terrainHeightAboveCamera(e){let t=this.terrain.getElevationForLngLat(e.getCameraLngLat(),e)-e.getCameraAltitude(),r=e.getClippingPlane()?null:this.terrain.getCoverageIndex();if(!r)return t;let[i,n,a,o]=e.getCameraFrustum().points;for(let s=0;s<=2;s++){let l=s/2;for(let u=0;u<=2;u++){let c=u/2,h=(1-c)*(1-l),p=c*(1-l),d=c*l,f=(1-c)*l,m=h*i[0]+p*n[0]+d*a[0]+f*o[0],_=h*i[1]+p*n[1]+d*a[1]+f*o[1],g=h*i[2]+p*n[2]+d*a[2]+f*o[2],y=tl(r,this.terrain.exaggeration,m,_,e.worldCoordinateHelper.wraps);y.covered&&(t=Math.max(t,y.elevation-g))}}return t}_terrainHeightAboveMaxZoomForCenter(e){let t=this.terrain.getCoverageIndex();if(!t)return;let r=e.worldCoordinateHelper,i=e.getCameraLngLat(),n=r.worldFromLngLat(i.lng,i.lat),a=r.worldFromLngLat(e.center.lng,e.center.lat),o=Bt(e.zoom-e.maxZoom),s=tl(t,this.terrain.exaggeration,Ma(n.x,a.x,o),Ma(n.y,a.y,o),r.wraps);return s.covered?s.elevation-Ma(e.getCameraAltitude(),e.elevation,o):void 0}moveCenterOntoTerrain(e,t){if(!this.terrain||!this.getCenterClampedToGround()||e.getClippingPlane())return;let{center:r,elevation:i,zoom:n}=e;e.recalculateZoomAndCenter(this.terrain),(!(e.zoom>n-t&&e.zoom<e.maxZoom)||Math.abs(this.terrain.getElevationForLngLat(e.center,e)-e.elevation)>=1)&&(e.setZoom(n),e.setCenter(r),e.setElevation(i))}captureRotationPivot(e,t){if(!aT(e,t))return{point:e.centerPoint,location:e.center,distance:yd(e,e.center)};let r=this.terrain?e.screenTerrainPointToMercatorCoordinate(t,this.terrain):null,i=r?r.toLngLat():e.screenPointToLocation(t);return r&&this.cameraHelper.useGlobeControls?{point:e.locationToScreenPoint(i),location:i,distance:yd(e,i)}:{point:t,location:i,elevation:r?.z,distance:yd(e,i,r?.z)}}orbitRotationPivot(e,t,r){if(t.point.equals(e.centerPoint))return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!0;let i=this._turnAroundPivot(e,t,r)??this._turnAroundPivot(e,t,{...r,pitchDelta:0,rollDelta:0});return i?(e.apply(i,!1),!0):(this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!1)}_turnAroundPivot(e,t,r){let i=e.clone();return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,i),i.pitch>=90||!aT(i,t.point)?null:LG(i,t)&&BG(i,t)?i:null}applyUpdatedTransform(e){this._takeLandedElevation(e);let t=this._keepCameraAboveTerrain(e);if(!this.transformCameraUpdate){t!==this.transform&&this.transform.apply(t,!1);return}let r=t.clone(),{center:i,zoom:n,roll:a,pitch:o,bearing:s,elevation:l}=this.transformCameraUpdate(r);i&&r.setCenter(i),l!==void 0&&r.setElevation(l),n!==void 0&&r.setZoom(n),a!==void 0&&r.setRoll(a),o!==void 0&&r.setPitch(o),s!==void 0&&r.setBearing(s),this.transform.apply(l===void 0?r:this._raiseCameraByPitchAndZoom(r),!1)}applyTransformChange(e){let t=this._requestedCameraState!==void 0,r=this.getTransformForUpdate();e(r),this.applyUpdatedTransform(r),t||delete this._requestedCameraState}_fireMoveEvents(e){this.fire(new ne("move",e)),this._zooming&&this.fire(new ne("zoom",e)),this._rotating&&this.fire(new ne("rotate",e)),this._pitching&&this.fire(new ne("pitch",e)),this._rolling&&this.fire(new ne("roll",e))}_afterEase(e,t,r=!1){this._takeLandedElevation(this.transform);let i=this.releaseElevation();if(this.terrain&&r&&this.getCenterClampedToGround()&&this.putCenterBackOnTerrain(this.transform,this.terrain,i),this._easeId&&t&&this._easeId===t)return;delete this._easeId;let n=this._zooming,a=this._rotating,o=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,n&&this.fire(new ne("zoomend",e)),a&&this.fire(new ne("rotateend",e)),o&&this.fire(new ne("pitchend",e)),s&&this.fire(new ne("rollend",e)),this.fire(new ne("moveend",e))}flyTo(e,t){if(!e.essential&&Nr.prefersReducedMotion)return this.easeTo(e,t);this.stop(),e=J({offset:[0,0],speed:1.2,curve:1.42,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=r.bearing,n=r.pitch,a=r.roll,o=r.padding,s=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),l=e.pitch===void 0?n:+e.pitch,u=e.roll===void 0?a:this._normalizeBearing(e.roll,a),c=e.padding===void 0?r.padding:e.padding,h=k.convert(e.offset),p=r.centerPoint.add(h),d=r.screenPointToLocation(p),f=this.cameraHelper.handleFlyTo(r,{bearing:s,pitch:l,roll:u,padding:c,locationAtOffset:d,offsetAsPoint:h,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),m=e.curve,_=Math.max(r.width,r.height),g=_/f.scaleOfZoom,y=f.pixelPathLength,v=_/f.scaleOfMinZoom;m=Math.min(m,Math.sqrt(v/y*2));let x=m*m;function b(I){let C=(g*g-_*_+(I?-1:1)*x*x*y*y)/(2*(I?g:_)*x*y);return Math.log(Math.sqrt(C*C+1)-C)}function w(I){return(Math.exp(I)-Math.exp(-I))/2}function T(I){return(Math.exp(I)+Math.exp(-I))/2}function S(I){return w(I)/T(I)}let E=b(!1),P=function(I){return T(E)/T(E+m*I)},D=function(I){return _*((T(E)*S(E+m*I)-w(E))/x)/y},F=(b(!0)-E)/m;if(Math.abs(y)<2e-6||!isFinite(F)){if(Math.abs(_-g)<1e-6)return this.easeTo(e,t);let I=g<_?-1:1;F=Math.abs(Math.log(g/_))/m,D=()=>0,P=C=>Math.exp(I*m*C)}if(e.duration!==void 0)e.duration=+e.duration;else{let I=e.screenSpeed===void 0?+e.speed:+e.screenSpeed/m;e.duration=1e3*F/I}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==s,this._pitching=l!==n,this._rolling=u!==a,this._padding=!r.isPaddingEqual(c),this._prepareEase(t,!1,{},{tr:r,center:f.targetCenter,freeze:e.freezeElevation}),this._ease(I=>{let C=I*F,A=1/P(C),M=D(C);this._rotating&&r.setBearing(ot.number(i,s,I)),this._pitching&&r.setPitch(ot.number(n,l,I)),this._rolling&&r.setRoll(ot.number(a,u,I)),this._padding&&(r.interpolatePadding(o,c,I),p=r.centerPoint.add(h)),f.easeFunc(I,A,M,p),this.terrain&&!e.freezeElevation&&this._updateElevation(I,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},()=>{this._afterEase(t,void 0,e.freezeElevation)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,r){r.animate===!1||r.duration===0?(e(1),t()):(this._easeStart=Be(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=xi(e,-180,180);let r=Math.abs(e-t);return Math.abs(e-360-t)<r&&(e-=360),Math.abs(e+360-t)<r&&(e+=360),e}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};function LG(e,t){let r=1,i=iT(e,t),n=t.distance/i;for(let a=0;a<5&&!nT(i,t);a++){if(!Number.isFinite(n)||n<=0)return!1;let o=e.zoom;e.setZoom(o+Ut(r/n));let s=r*Bt(o-e.zoom);if(s===r)return!0;let l=iT(e,t);n=s+(t.distance-l)*(s-r)/(l-i),r=s,i=l}return nT(i,t)}function iT(e,t){return e.setLocationAtPoint(t.location,t.point,t.elevation),yd(e,t.location,t.elevation)}function nT(e,t){return Math.abs(e/t.distance-1)<1e-7}function BG(e,t){return t.elevation!==void 0||k_(Kd(e.screenPointToLocation(t.point),0),Kd(t.location,0))<t.distance*1e-4}function aT(e,t){return e.isPointOnMapSurface(new k(t.x,t.y-16))}function yd(e,t,r=e.elevation){return k_(Kd(e.getCameraLngLat(),e.getCameraAltitude()),Kd(t,r))}function Kd(e,t){let r=Ft(e);return Xe(r,r,Er+t)}var aD={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'},OG=class{constructor(e=aD){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{t&&(t.type==="terrain"||t.dataType==="style"||t.dataType==="source"&&(t.sourceDataType==="metadata"||t.sourceDataType==="visibility"))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("maplibregl-compact")&&!this._container.classList.contains("maplibregl-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=ht.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ht.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(i=>typeof i=="string"?i:"")):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}let t=this._map.style.tileManagers;for(let i in t){let n=t[i];if(n.used||n.usedForTerrain){let a=n.getSource();a.attribution&&!e.includes(a.attribution)&&e.push(a.attribution)}}e=e.filter(i=>String(i).trim()),e.sort((i,n)=>i.length-n.length),e=e.filter((i,n)=>{for(let a=n+1;a<e.length;a++)if(e[a].includes(i))return!1;return!0});let r=e.join(" | ");if(r!==this._attribHTML){if(this._attribHTML=r,e.length){let i=document.createDocumentFragment(),n=!0;for(let a of e){let o=ht.sanitize(a);o.hasChildNodes()&&(n||i.append(" | "),i.append(o),n=!1)}this._innerContainer.replaceChildren(i),this._container.classList.remove("maplibregl-attrib-empty")}else this._container.classList.add("maplibregl-attrib-empty");this._updateCompact(),this._editLink=null}}},jG=class{constructor(e={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let r=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&r.classList.add("maplibregl-compact"):r.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=ht.create("div","maplibregl-ctrl");let t=ht.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},NG=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(let i of r)if(i.id===e){i.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];let r=!1,i;for(let n of t)if(!n.cancelled){try{n.callback(e)}catch(a){r||(r=!0,i=a)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,r)throw i}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},VG=dt([{name:"a_pos3d",type:"Int16",components:3}]),UG=class extends lr{constructor(e){super(),this._lastTilesetChange=Be(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,t){this.tileManager.update(e,t),this._renderableTilesKeys=[];let r={},i=!1;for(let n of Cc(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:t}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float32Array(16),Ln(n.terrainRttPosMatrix32f,0,R,R,0,0,1),this._tiles[n.key]=new dP(n,this.tileSize),this._lastTilesetChange=Be(),i=!0);for(let n in this._tiles)r[n]||(this._tiles[n].releaseRTT(this.tileManager.map.painter),delete this._tiles[n],i=!0);return i}releaseRTT(e){for(let t in this._tiles){let r=this._tiles[t];(r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&r.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let t={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID,n=e.clone(),a=uo();if(i.canonical.equals(e.canonical))Ln(a,0,R,R,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let o=i.canonical.z-e.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),l=i.canonical.y-(i.canonical.y>>o<<o),u=R>>o;Ln(a,0,u,u,0,0,1),At(a,a,[-s*u,-l*u,0])}else if(e.canonical.isChildOf(i.canonical)){let o=e.canonical.z-i.canonical.z,s=e.canonical.x-(e.canonical.x>>o<<o),l=e.canonical.y-(e.canonical.y>>o<<o),u=R>>o;Ln(a,0,R,R,0,0,1),At(a,a,[s*u,l*u,0]),gr(a,a,[1/2**o,1/2**o,0])}else continue;n.terrainRttPosMatrix32f=new Float32Array(a),t[r]=n}return t}_getTerrainCoordsForTileRanges(e,t){let r={};for(let i of this._renderableTilesKeys){let n=this._tiles[i].tileID;if(!this._isWithinTileRanges(n,t))continue;let a=e.clone(),o=uo();if(n.canonical.z===e.canonical.z){let s=e.canonical.x-n.canonical.x+e.wrap*(1<<e.canonical.z),l=e.canonical.y-n.canonical.y;Ln(o,0,R,R,0,0,1),At(o,o,[s*R,l*R,0])}else if(n.canonical.z>e.canonical.z){let s=n.canonical.z-e.canonical.z,l=n.canonical.x-(n.canonical.x>>s<<s)+e.wrap*(1<<n.canonical.z),u=n.canonical.y-(n.canonical.y>>s<<s),c=e.canonical.x-(n.canonical.x>>s),h=e.canonical.y-(n.canonical.y>>s),p=R>>s;Ln(o,0,p,p,0,0,1),At(o,o,[-l*p+c*R,-u*p+h*R,0])}else{let s=e.canonical.z-n.canonical.z,l=e.canonical.x-(e.canonical.x>>s<<s)+e.wrap*(1<<e.canonical.z),u=e.canonical.y-(e.canonical.y>>s<<s),c=(e.canonical.x>>s)-n.canonical.x,h=(e.canonical.y>>s)-n.canonical.y,p=R<<s;Ln(o,0,p,p,0,0,1),At(o,o,[l*R+c*p,u*R+h*p,0])}a.terrainRttPosMatrix32f=new Float32Array(o),r[i]=a}return r}getSourceTile(e,t){let r=this.tileManager._source,i=e.overscaledZ-this.deltaZoom;if(i>r.maxzoom&&(i=r.maxzoom),i<r.minzoom)return;this._sourceTileCache[e.key]?.zoom!==i&&(this._sourceTileCache[e.key]={zoom:i,key:e.scaledTo(i).key});let n=this.findTileInCaches(this._sourceTileCache[e.key].key);if(!n?.dem&&t)for(;i>=r.minzoom&&!n?.dem;)n=this.findTileInCaches(e.scaledTo(i--).key);return n}isStillWaitingForDEM(e){let t=this.tileManager._source,r=Math.min(e.overscaledZ-this.deltaZoom,t.maxzoom);if(r<t.minzoom)return!1;let i=e.scaledTo(r);return t.hasTile&&!t.hasTile(i)?!1:this.findTileInCaches(i.key)?.state!=="errored"}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e),t)}anyTilesAfterTime(e=Be()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let r=t[e.canonical.z];return!!r&&(e.wrap>r.minWrap||e.wrap<r.maxWrap||e.canonical.x>=r.minTileXWrapped&&e.canonical.x<=r.maxTileXWrapped&&e.canonical.y>=r.minTileY&&e.canonical.y<=r.maxTileY)}},$G=class{constructor(e,t,r,i="auto",n=()=>nl){this._meshCache={},this.painter=e,this._getWorldCoordinateHelper=n,this.tileManager=new UG(t),this.options=r,this.exaggeration=typeof r.exaggeration=="number"?r.exaggeration:1,this._terrainSkirtLength=i,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this.coverage=new IV(this.tileManager,this.exaggeration,()=>this._worldCoordinateHelper)}destroy(){this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._heightMapFbo&&(this._heightMapFbo=(this._heightMapFbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null));for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,t,r,i=R){let n=e.normalizeCoordinates(t,r,i);if(!n)return 0;let a=this.coverage.getSampler(n.tileID);return a?a(n.x,n.y,i):0}getElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i,worldX:n,worldY:a}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(i,n%R,a%R,R)}getElevationForLngLat(e,t){let r=this.getDrawnElevationForLngLat(e);return r===void 0?this.getElevationForLngLatZoom(e,this._getFallbackZoom(t)):r}getDrawnElevationForLngLat(e,t=!1){return this.coverage.sample(e,t)}getElevationAndDEMStateForLngLat(e,t){let r=this.getElevationForLngLat(e,t);if(r!==0||this.getDrawnElevationForLngLat(e)!==void 0)return{elevation:r,demState:"loaded"};let i=this._getFallbackZoom(t),n=this._worldCoordinateHelper;if(!E1(i,n.wraps?e.wrap():e,n))return{elevation:r,demState:"none"};let{tileID:a}=this._getOverscaledTileIDFromLngLatZoom(e,i);return this.tileManager.getSourceTile(a,!0)?.dem?{elevation:r,demState:"loaded"}:{elevation:r,demState:this.tileManager.isStillWaitingForDEM(a)?"loading":"none"}}_getFallbackZoom(e){return Math.min(e.tileZoom,this.tileManager.maxzoom)}getElevation(e,t,r,i=R){return this.getDEMElevation(e,t,r,i)*this.exaggeration}resetElevationCache(){this.coverage.reset()}getCoverageIndex(){return this.coverage.getIndex()}_getDEMTileMatrix(e,t){let r=`${t.tileID.key}/${e.key}`,i=this._demMatrixCache.get(r);if(i)return i;let n=e.canonical.z-t.tileID.canonical.z,a=e.canonical.x-(e.canonical.x>>n<<n),o=e.canonical.y-(e.canonical.y>>n<<n),s=XM(new Float64Array(16),[1/(R<<n),1/(R<<n),0]);return At(s,s,[a*R,o*R,0]),this._demMatrixCache.set(r,s),s}getTerrainData(e){if(!this._emptyDemTexture){let i=this.painter.context,n=new Ye({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ot(i,n,i.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ot(i,new Ye({width:1,height:1}),i.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=Gi([])}let t=this.tileManager.getSourceTile(e,!0);if(t?.dem&&(!t.demTexture||t.needsTerrainPrepare)){let i=this.painter.context;t.demTexture||(t.demTexture=this.painter.getTileTexture(t.dem.stride)),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new Ot(i,t.dem.getPixels(),i.gl.RGBA,{premultiply:!1}),t.demTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),t.needsTerrainPrepare=!1}let r=t?this._getDEMTileMatrix(e,t):this._emptyDemMatrix;return{u_depth:2,u_terrain:3,u_terrain_dim:t?.dem?.dim||1,u_terrain_matrix:r,u_terrain_unpack:t?.dem?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(t?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:t}}getFramebuffer(){let e=this.painter,t=e.width/devicePixelRatio,r=e.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==t||this._fbo.height!==r)&&(this._fbo.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture),this._fboDepthTexture||(this._fboDepthTexture=new Ot(e.context,{width:t,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(t,r,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,t,r))),this._fbo.colorAttachment.set(this._fboDepthTexture.texture),this._fbo}getHeightMapFramebuffer(e){return this._heightMapFbo||(this._heightMapFbo=this.painter.context.createFramebuffer(1,1,!1,!1)),this._heightMapFbo.colorAttachment.set(e),this._heightMapFbo}getTerrainMesh(e,t){let r=t&&e.canonical.y===0,i=t&&e.canonical.y===(1<<e.canonical.z)-1,n=`m_${r?"n":""}_${i?"s":""}`;if(this._meshCache[n])return this._meshCache[n];let a=this.painter.context,o=new dz,s=new yn,l=this.meshSize,u=R/l,c=l*l;for(let p=0;p<=l;p++)for(let d=0;d<=l;d++)o.emplaceBack(d*u,p*u,0);for(let p=0;p<c;p+=l+1)for(let d=0;d<l;d++)s.emplaceBack(d+p,l+d+p+1,l+d+p+2),s.emplaceBack(d+p,l+d+p+2,d+p+1);this._terrainSkirtLength!=="none"&&this._buildSkirts(o,s,l,u,r,i);let h=new hc(a.createVertexBuffer(o,VG.members),a.createIndexBuffer(s),ct.simpleSegment(0,0,o.length,s.length));return this._meshCache[n]=h,h}getSkirtLength(e){return this._worldCoordinateHelper.metersPerWorldUnit(.5,.5)/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getMinMaxElevation(i).minElevation??0}getMinMaxElevation(e){let t=this.tileManager.getSourceTile(e,!0),r={minElevation:null,maxElevation:null};return t?.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}get _worldCoordinateHelper(){return this._getWorldCoordinateHelper()}_getOverscaledTileIDFromLngLatZoom(e,t){let r=this._worldCoordinateHelper,i=r.wraps?e.wrap():e,n=r.worldFromLngLat(i.lng,i.lat),a=(1<<t)*R,o=n.x*a,s=n.y*a;return{tileID:new ir(t,0,t,Math.floor(o/R),Math.floor(s/R)),worldX:o,worldY:s}}_buildSkirts(e,t,r,i,n,a){let o=e.length,s=o+(r+1),l=(r+1)*r,u=n?Nu:0,c=+!n,h=a?Vu:R,p=+!a;for(let m=0;m<=r;m++)e.emplaceBack(m*i,u,c);for(let m=0;m<=r;m++)e.emplaceBack(m*i,h,p);for(let m=0;m<r;m++)t.emplaceBack(l+m,s+m,s+m+1),t.emplaceBack(l+m,s+m+1,l+m+1),t.emplaceBack(0+m,o+m+1,o+m),t.emplaceBack(0+m,0+m+1,o+m+1);let d=e.length,f=d+(r+1)*2;for(let m of[0,1])for(let _=0;_<=r;_++)for(let g of[0,1])e.emplaceBack(m*R,_*i,g);for(let m=0;m<r*2;m+=2)t.emplaceBack(d+m,d+m+1,d+m+3),t.emplaceBack(d+m,d+m+3,d+m+2),t.emplaceBack(f+m,f+m+3,f+m+1),t.emplaceBack(f+m,f+m+2,f+m+3)}},oT=["none","zoom","sourceTiles","visibleLayers","revision"],sT=class{constructor(e,t,r,i){this._tileKeys=e.map(n=>n.key).sort().join(),this._revision=t,this._zoom=r,this._visibleLayerIds=i}difference(e){return this._revision===e?._revision?this._visibleLayerIds===e._visibleLayerIds?this._tileKeys===e._tileKeys?this._zoom===e._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},oD={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};function G1(e){return Ef(e)?`custom-layer:${e.id}`:e.source}function D_(e){return Ef(e)?e.implementation.renderToTerrainTile!==void 0:oD[e.type]===!0}function qG(e,t){let r=[],i=!1;for(let n of t){let a=D_(e._layers[n]);a&&!i&&r.push([]),a&&r[r.length-1].push(n),i=a}return r}var GG=class{constructor(e,t){this.needsFollowUpFrame=!1,this.painter=e,this.terrain=t,this.rttSize=t.tileManager.tileSize*t.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}prepareForRender(e,t,r){let i=t!==this._lastPrepareZoom;this._lastPrepareZoom=t,this._stacks=[],this._prevRenderedToTexture=!1,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(u=>!e._layers[u].isHidden(t));let n=qG(e,this._renderableLayerIds),a=this._renderableLayerIds.join(),o=new Set;for(let u of this._renderableLayerIds){let c=e._layers[u],h=c.source;h&&oD[c.type]&&o.add(h)}this._coordsAscending={},this._rttFingerprints={};for(let u of o){let c=e.tileManagers[u];if(!c)continue;this._coordsAscending[u]={};let h=this._coordsAscending[u],p=c.getSource(),d=p instanceof Tc?p.terrainTileRanges:null;for(let _ of c.getVisibleCoordinates()){let g=this.terrain.tileManager.getTerrainCoords(_,d);for(let y in g)h[y]||(h[y]=[]),h[y].push(g[y])}this._rttFingerprints[u]={};let f=this._rttFingerprints[u],m=c.getState().revision;for(let _ in h)f[_]=new sT(h[_],m,t,a)}for(let u of this._renderableLayerIds){let c=e._layers[u];if(!Ef(c)||!D_(c))continue;let h=c.implementation.terrainTileRevision??0,p={};for(let d of this._renderableTiles)p[d.tileID.key]=new sT([d.tileID],h,t,a);this._rttFingerprints[G1(c)]=p}this.needsFollowUpFrame=!1;let s=i||r,l=!1;for(let u of this._renderableTiles){let c=this._textureDifference(u);c!=="none"&&(c==="zoom"&&s||c==="visibleLayers"&&i?this.needsFollowUpFrame=!0:c==="zoom"||c==="sourceTiles"?(l?this.needsFollowUpFrame=!0:this._releaseChangedTextures(u,e,n),l=!0):this._releaseChangedTextures(u,e,n))}}_releaseChangedTextures(e,t,r){let i=r.map(n=>this._hasStackChanged(e,t,n));if(!i.includes(!1))e.releaseRTT(this.painter);else for(let[n,a]of i.entries())a&&e.releaseRTTStack(this.painter,n)}_hasStackChanged(e,t,r){let i=!1;for(let n of r){let a=G1(t._layers[n]),o=this._rttFingerprints[a]?.[e.tileID.key],s=e.rttFingerprint[a];if(o||s){if(o?.difference(s)!=="none")return!0;i=!0}}return!i}_textureDifference(e){let t="none";for(let r in this._rttFingerprints){let i=this._rttFingerprints[r][e.tileID.key];if(!i)continue;let n=i.difference(e.rttFingerprint[r]);oT.indexOf(n)>oT.indexOf(t)&&(t=n)}return t}renderLayer(e,t,r){if(e.isHidden(r.transform.zoom))return!1;let i=D_(e),n=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(i&&(this._prevRenderedToTexture||this._stacks.push([]),this._prevRenderedToTexture=!0,this._stacks[this._stacks.length-1].push(e.id),!a))return!0;if(this._prevRenderedToTexture||i&&a){this._prevRenderedToTexture=i;let o=this._stacks.length-1,s=this._stacks[o]||[];r.isRenderingToTexture=!0,N6(n.context.frameUniformBuffer,this.rttSize,this.rttSize);for(let l of this._renderableTiles){if(this._rttTiles.push(l),l.getRTT(o))continue;let u=l.acquireRTT(n,o,this.rttSize);n.bindRTT(u),n.context.clear({color:he.transparent,stencil:0}),r.invalidateTileClippingMasks();for(let c of s){let h=t._layers[c],p=h.source?this._coordsAscending[h.source][l.tileID.key]:[l.tileID];n.context.viewport.set([0,0,this.rttSize,this.rttSize]),r.renderTileClippingMasks(h,p),n.renderLayer(n,t.tileManagers[h.source],h,p,r);let d=G1(h);d&&(l.rttFingerprint[d]=this._rttFingerprints[d][l.tileID.key])}u.texture.generateMipmap()}return r.isRenderingToTexture=!1,N6(n.context.frameUniformBuffer,n.context.gl.drawingBufferWidth,n.context.gl.drawingBufferHeight),jq(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],i}return!1}},ZG={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},HG=pT,lT={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:aD,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:bo.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,globalState:void 0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},sD=class extends lr{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new NG,this._controls=[],this._mapId=vT(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=a=>{if(a.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)this.fire(new r1("webglcontextlost",{originalEvent:a}));else{for(let o of Object.values(this.style._layers))if(o.type==="custom"&&console.warn(`Custom layer with id '${o.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),o._listeners)for(let[s]of Object.entries(o._listeners))console.warn(`Custom layer with id '${o.id}' had event listeners for event '${s}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.off("error",this._onStyleError),this.style.destroy(),this.style=null,this.fire(new r1("webglcontextlost",{originalEvent:a}))}},this._contextRestored=a=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let o in this._lostContextStyle.images){let s=this._lostContextStyle.images[o];s.isWebGLImage&&this.style.imageManager.updateImage(o,s,!1)}}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(o){this.fire(new ee(o));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new r1("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onStyleError=a=>{a.tile&&this.triggerRepaint()},this._onWindowOnline=()=>{this._update()};let t={...lT,...e,canvasContextAttributes:{...lT.canvasContextAttributes,...e.canvasContextAttributes}};if(t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(t.minPitch!=null&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(t.maxPitch!=null&&t.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new RG({minZoom:t.minZoom,maxZoom:t.maxZoom,minPitch:t.minPitch,maxPitch:t.maxPitch,bearingSnap:t.bearingSnap,zoomSnap:t.zoomSnap,renderWorldCopies:t.renderWorldCopies,centerClampedToGround:t.centerClampedToGround,terrain:this.terrain,transformConstrain:t.transformConstrain,requestRenderFrame:a=>this._requestRenderFrame(a),cancelRenderFrame:a=>this._cancelRenderFrame(a),transformCameraUpdate:t.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._canvasContextAttributes={...t.canvasContextAttributes},this._trackResize=t.trackResize===!0,this._terrainSkirtLength=t.terrainSkirtLength,this._refreshExpiredTiles=t.refreshExpiredTiles===!0,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions===!0,this._collectResourceTiming=t.collectResourceTiming===!0,this._locale={...ZG,...t.locale},this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this._zoomLevelsToOverscale=t.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=t.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(t.anisotropicFilterPitch),t.reduceMotion!==void 0&&(Nr.prefersReducedMotion=t.reduceMotion),this._requestManager=new WI(t.transformRequest),this._container=this._resolveContainer(t.container),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer();try{this._setupPainter()}catch(a){throw this._cleanupContainer(),a}this._imageQueueHandle=Vi.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.markTerrainDepthDirty(),this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new zG(this,this._camera,t),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let r=typeof t.hash=="string"&&t.hash||void 0;this._hash=t.hash?new Kq(r).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:t.center,elevation:t.elevation,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch,roll:t.roll}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,J({},t.fitBoundsOptions,{duration:0}))));let i=typeof t.style=="string"?void 0:t.style?.projection?.type,n=i!=="globe"&&!Pf(i);this.resize(null,n),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,this._initialGlobalState=t.globalState,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new OG(typeof t.attributionControl=="boolean"?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new jG,t.logoPosition),this.on("style.load",()=>{if(n||this._resizeTransform(),this._camera.transform.unmodified){let a=Qd(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(a)}}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(a.dataType==="style"?new ji("styledata",a):new et("sourcedata",a))}),this.on("dataloading",a=>{this.fire(a.dataType==="style"?new ji("styledataloading",a):new et("sourcedataloading",a))}),this.on("dataabort",a=>{this.fire(new et("sourcedataabort",a))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,t){if(t===void 0&&(t=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new ee(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[t];return t.includes("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(e){if(!e?.onRemove)return this.fire(new ee(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(e);return t>-1&&this._controls.splice(t,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return Cc(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new H(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,t){return this._camera.setCenter(e,t),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,t){return this._camera.setCenterElevation(e,t),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,t,r){return this._camera.panBy(e,t,r),this}panTo(e,t,r){return this._camera.panTo(e,t,r),this}getZoom(){return this._camera.transform.zoom}setZoom(e,t){return this._camera.setZoom(e,t),this}zoomTo(e,t,r){return this._camera.zoomTo(e,t,r),this}zoomIn(e,t){return this._camera.zoomIn(e,t),this}zoomOut(e,t){return this._camera.zoomOut(e,t),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,t){return this._camera.setVerticalFieldOfView(e,t),this}getBearing(){return this._camera.transform.bearing}setBearing(e,t){return this._camera.setBearing(e,t),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,t){return this._camera.setPadding(e,t),this}rotateTo(e,t,r){return this._camera.rotateTo(e,t,r),this}resetNorth(e,t){return this._camera.resetNorth(e,t),this}resetNorthPitch(e,t){return this._camera.resetNorthPitch(e,t),this}snapToNorth(e,t){return this._camera.snapToNorth(e,t),this}getPitch(){return this._camera.transform.pitch}setPitch(e,t){return this._camera.setPitch(e,t),this}getRoll(){return this._camera.transform.roll}setRoll(e,t){return this._camera.setRoll(e,t),this}cameraForBounds(e,t){return this._camera.cameraForBounds(e,t)}fitBounds(e,t,r){return this._camera.fitBounds(e,t,r),this}fitScreenCoordinates(e,t,r,i,n){return this._camera.fitScreenCoordinates(e,t,r,i,n),this}jumpTo(e,t){return this._camera.jumpTo(e,t),this}calculateAnchoredCameraOptions(e){return this._camera.calculateAnchoredCameraOptions(e)}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n)}easeTo(e,t){return this._camera.easeTo(e,t),this}flyTo(e,t){return this._camera.flyTo(e,t),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(H.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,r,i){return i==null&&this.terrain&&(i=this.terrain.getElevationForLngLat(r,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(e,t,r,i??0)}resize(e,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let r=!this._camera._moving;return r&&(this.stop(),this.fire(new ne("movestart",e)).fire(new ne("move",e))),this.fire(new Wt("resize",e)),r&&this.fire(new ne("moveend",e)),this}_resizeInternal(e=!0){let[t,r]=this._containerDimensions();if(this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio),this.painter.overLimit()){let i=this.painter.context.gl;this._maxCanvasSize=[i.drawingBufferWidth,i.drawingBufferHeight],this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio)}this.style?.resize(),this._resizeTransform(e)}_resizeTransform(e=!0){let[t,r]=this._containerDimensions();this._camera.transform.resize(t,r,e),this._camera._requestedCameraState?.resize(t,r,e)}_getClampedPixelRatio(e,t){let{0:r,1:i}=this._maxCanvasSize,n=this.getPixelRatio(),a=e*n,o=t*n,s=a>r?r/a:1,l=o>i?i/o:1,u=Math.min(s,l);return u<1&&we("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),u*n}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.applyTransformChange(t=>t.setMaxBounds(Zn.convert(e))),this._update()}setMinZoom(e){if(e??(e=-2),e>=-2&&e<=this._camera.transform.maxZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMinZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(e=!1){let t=this._camera.transform;return e?t.applyConstrain(t.center,t.minZoom).zoom:t.minZoom}setMaxZoom(e){if(e??(e=22),e>=this._camera.transform.minZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMaxZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??(e=0),e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMinPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??(e=60),e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMaxPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??(e=20),e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.applyTransformChange(t=>t.setRenderWorldCopies(e)),this._update()}setTransformConstrain(e){return this._camera.applyTransformChange(t=>t.setConstrainOverride(e)),this._update()}project(e){return this._camera.transform.locationToScreenPoint(H.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(k.convert(e),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegates(e,t,r){if(e==="mouseenter"||e==="mouseover"){let i=!1;return{mousemove:n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length?i||(i=!0,r.call(this,new ei(e,this,n.originalEvent,{features:o}))):i=!1},mouseout:()=>{i=!1}}}if(e==="mouseleave"||e==="mouseout"){let i=!1;return{mousemove:n=>{let a=t.filter(o=>this.getLayer(o));(a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a})).length?i=!0:i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))},mouseout:n=>{i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))}}}{let i=n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length&&(n.features=o,r.call(this,n),delete n.features)};return{[e]:i}}}_addDelegatedListener(e,t){var r;this._delegatedListeners||(this._delegatedListeners={}),(r=this._delegatedListeners)[e]||(r[e]=[]),this._delegatedListeners[e].push(t);for(let i in t.delegates)this.on(i,t.delegates[i])}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners?.[e])return;let i=this._delegatedListeners[e];for(let n=0;n<i.length;n++){let a=i[n];if(a.listener===r&&a.layers.length===t.length&&a.layers.every(o=>t.includes(o))){for(let o in a.delegates)this.off(o,a.delegates[o]);i.splice(n,1);return}}}on(e,t,r){if(r===void 0)return super.on(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,r)};return this._addDelegatedListener(e,n),{unsubscribe:()=>{this._removeDelegatedListener(e,i,r)}}}once(e,t,r){if(r===void 0)return super.once(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,a=>{this._removeDelegatedListener(e,i,r),r.call(this,a)})};return this._addDelegatedListener(e,n),this}off(e,t,r){if(r===void 0)return super.off(e,t);let i=typeof t=="string"?[t]:t;return this._removeDelegatedListener(e,i,r),this}queryRenderedFeatures(e,t){if(!this.style)return[];let r,i=e instanceof k||Array.isArray(e),n=i?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||(t=(i?{}:e)||{}),n instanceof k||typeof n[0]=="number")r=[k.convert(n)];else{let a=k.convert(n[0]),o=k.convert(n[1]);r=[a,new k(o.x,a.y),o,new k(a.x,o.y),a]}return this.style.queryRenderedFeatures(r,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return t=J({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle,globalState:this._initialGlobalState},t),this._styleUrl=typeof e=="string"?e:null,t.diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(e,t))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(e,t));return}let r=this.style&&t.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.off("error",this._onStyleError),this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new B6(this,t||{});else return this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.style?.projection?.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),typeof e=="string"?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this}_lazyInitEmptyStyle(){this.style||(this.style=new B6(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),this.style.loadEmpty())}async _diffStyle(e,t){if(this._diffStyleRequest?.abort(),typeof e=="string"){let r=e;this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let n=await this._requestManager.transformRequest(r,"Style");if(i.signal.aborted){this._diffStyleRequest=null;return}let a=await ef(n,i);this._diffStyleRequest=null,this._updateDiff(a.data,t)}catch(n){this._diffStyleRequest=null,Ra(n)||this.fire(new ee(Xt(n)))}}else typeof e=="object"&&(this._diffStyleRequest=null,this._updateDiff(e,t))}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(r){we(`Unable to perform style diff: ${Xt(r).message}. Rebuilding the style from scratch.`),this._updateStyle(e,t)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style)we("There is no style added to the map.");else return this.style.loaded()}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let t=this.style?.tileManagers[e];if(t===void 0)this.fire(new ee(Error(`There is no tile manager with ID '${e}'`)));else return t.loaded()}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&vc(this,Br.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this.painter.destroyRTTResources(),this._camera.setTerrain(null);else{let r=this.style.tileManagers[e.source];if(!r)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&r.reload();for(let i in this.style._layers){let n=this.style._layers[i];n.type==="hillshade"&&n.source===e.source&&we("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),n.type==="color-relief"&&n.source===e.source&&we("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new $G(this.painter,r,e,this._terrainSkirtLength,()=>this._camera.transform.worldCoordinateHelper),this.painter.renderToTexture=new GG(this.painter,this.terrain),this._camera.setTerrain(this.terrain),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,e.source),this.style.on("data",this._terrainDataCallback)}return this.style.triggerSymbolPlacement(),this.fire(new XI({terrain:e})),this}_handleTerrainDataEvent(e,t){if(e.dataType==="style"){this.terrain.tileManager.releaseAllRTT();return}let r=e.sourceId===t;r&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),r&&e.tile&&(this.painter.markTerrainDepthDirty(),this._camera.applyTerrainChange()),e.tile&&(e.source?.type==="image"?this.terrain.tileManager.releaseAllRTT():this.terrain.tileManager.releaseRTT(e.tile.tileID))}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style?.tileManagers;for(let t of Object.values(e))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style?.getSource(e)}setSourceTileLodParams(e,t,r){if(r){let i=this.getSource(r);if(!i)throw Error(`There is no source with ID "${r}", cannot set LOD parameters`);i.calculateTileZoom=x_(Math.max(1,e),Math.max(1,t))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=x_(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,t){let r=this.style.tileManagers[e];if(!r)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);t===void 0?r.reload(!0):r.refreshTiles(t.map(i=>new Cf(i.z,i.x,i.y)))}addImage(e,t,r={}){this._lazyInitEmptyStyle();let i=this._createStyleImage(t,r);return i&&(this.style.addImage(e,i),i.userImage?.onAdd&&i.userImage.onAdd(this,e)),this}setMissingStyleImageResolver(e){return this._missingStyleImageResolver=e,this.style?.setMissingImageResolver(e),this}_createStyleImage(e,t={}){let{pixelRatio:r=1,sdf:i=!1,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}=t;if(e instanceof HTMLImageElement||fo(e)){let{width:u,height:c,data:h}=Nr.getImageData(e);return{data:new Ye({width:u,height:c},h),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0}}if(e.width===void 0||e.height===void 0)return this.fire(new ee(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`"))),null;{let{width:u,height:c,data:h}=e,p=e,d=Vd(p.data);return{data:d?new Ye({width:u,height:c}):new Ye({width:u,height:c},new Uint8Array(h)),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0,isWebGLImage:d,userImage:p}}}updateImage(e,t){let r=this.style.getImage(e);if(!r)return this.fire(new ee(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:n,data:a}=t instanceof HTMLImageElement||fo(t)?Nr.getImageData(t):t;if(i===void 0||n===void 0)return this.fire(new ee(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(i!==r.data.width||n!==r.data.height)return this.fire(new ee(Error("The width and height of the updated image must be that same as the previous version of the image")));if(r.isWebGLImage=Vd(a),r.isWebGLImage)r.userImage=t;else{let o=!(t instanceof HTMLImageElement||fo(t));r.data.replace(a,o)}return this.style.updateImage(e,r),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new ee(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}async loadImage(e){let t=await Vi.getImage(await this._requestManager.transformRequest(e,"Image"),new AbortController);if(!t.data)throw Error(`Could not load image ${e}: the response is empty`);return t}listImages(){return this.style?.listImages()??[]}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style?.getLayer(e)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style?.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,i={}){return this.style?.setPaintProperty(e,t,r,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,i={}){return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(e){return this._lazyInitEmptyStyle(),this.style.setFontFaces(e),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(e,t,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,i=>{i||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,r=>{r||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=Math.floor(this._container.clientWidth)||400,t=Math.floor(this._container.clientHeight)||300),[e,t]}_shouldHandleInitialResize(){if(!this._container?.clientWidth||!this._container.clientHeight)return!1;let[e,t]=this._containerDimensions();return e!==this._camera.transform.width||t!==this._camera.transform.height}_setupResizeObserver(){let e=!1,t=Xv(i=>{this._trackResize&&!this._removed&&(this.resize(i),this.redraw())},50),r=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new r(i=>{!e&&(e=!0,!this._shouldHandleInitialResize())||t(i)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e=="string"){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&typeof e=="object"&&e.nodeType===1)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._containerDimensions(),t=this._getClampedPixelRatio(e[0],e[1]),r=this._container;r.classList.add("maplibregl-map");let i=this._canvasContainer=ht.create("div","maplibregl-canvas-container",r);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=ht.create("canvas","maplibregl-canvas",i),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._resizeCanvas(e[0],e[1],t);let n=this._controlContainer=ht.create("div","maplibregl-control-container",r),a=this._controlPositions={};for(let o of["top-left","top-right","bottom-left","bottom-right"])a[o]=ht.create("div",`maplibregl-ctrl-${o} `,n);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(e,t,r){let i=Math.round(r*e),n=Math.round(r*t);this._canvas.width=i,this._canvas.height=n,this._canvas.style.width=`${i/r}px`,this._canvas.style.height=`${n/r}px`}_setupPainter(){let e={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},t=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{t=i},{once:!0});let r=this._canvas.getContext("webgl2",e);if(!r)throw new Xq(e,t);this.painter=new Yq(r)}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.fire(new KI({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?._loaded&&(this._styleDirty||(this._styleDirty=e),this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let t=this._idleTriggered?this._fadeDuration:0,r=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let i=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let l=this._camera.transform.zoom,u=Be();this.style.zoomHistory.update(l,u);let c=new Re(l,{now:u,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),h=c.crossFadingFactor();(h!==1||h!==this._crossFadingFactor)&&(i=!0,this._crossFadingFactor=h),this.style.update(c)}let n=this.style.projection?.transitionState>0!==r;if(this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||n)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain){if(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(this._camera.transform.center,this._camera.transform);u!=="loading"&&this._camera.transform.setElevation(l)}}else this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,t,this._crossSourceCollisions,n);let a=this.style.projection,o=a?.transitionState??0;this.painter.render(this.style,this._camera.transform,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,symbolFadeChange:this.style.placement.symbolFadeChange(Be()),variableOffsets:this.style.placement.variableOffsets,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch(),projectionTransition:o,isRenderingGlobe:o>0,projectionShaderVariant:a?{name:a.shaderVariantName,define:a.shaderDefine,prelude:a.shaderPreludeCode}:void 0,useSubdivision:a?.useSubdivision??!1,pixelRatio:this._clampedPixelRatio,light:this.style.light?.getEvaluated(),sky:this.style.sky?.getEvaluated()}),this.fire(new Wt("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Wt("load"))),this.style&&(this.style.hasTransitions()||i)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new Wt("idle")),this._loaded&&!this._fullyLoaded&&!s&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Vi.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let e=this.painter.context.gl.getExtension("WEBGL_lose_context");e?.loseContext&&e.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new Wt("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Nr.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(t){if(!Ra(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return HG}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}};function WG(e,t,r,i=!1){if(i||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let n=new H(e.lng,e.lat);if(e=new H(e.lng,e.lat),t){let a=new H(e.lng-360,e.lat),o=new H(e.lng+360,e.lat),s=r.locationToScreenPoint(e).distSqr(t);r.locationToScreenPoint(a).distSqr(t)<s?e=a:r.locationToScreenPoint(o).distSqr(t)<s&&(e=o)}for(;Math.abs(e.lng-r.center.lng)>180;){let a=r.locationToScreenPoint(e);if(a.x>=0&&a.y>=0&&a.x<=r.width&&a.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e.lng!==n.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(e))?e:n}var lD={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 YG(e,t,r){let i=e.classList;for(let n in lD)i.remove(`maplibregl-${r}-anchor-${n}`);i.add(`maplibregl-${r}-anchor-${t}`)}var uT={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},uD="#3FB1CE";function yi(e,t,r=[]){let i=ht.createNS("http://www.w3.org/2000/svg",e);for(let n in t)i.setAttributeNS(null,n,t[n]);for(let n of r)i.appendChild(n);return i}var Z1;function XG(){return Z1||(Z1=yi("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[yi("g",{"fill-rule":"nonzero"},[yi("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([e,t])=>yi("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:e,ry:t}))),yi("g",{fill:uD},[yi("path",{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"})]),yi("g",{opacity:"0.25",fill:"#000000"},[yi("path",{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"})]),yi("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),yi("g",{transform:"translate(8.0, 8.0)"},[yi("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),yi("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]),Z1)}function KG(e){return e.firstElementChild.children[1]}var Ss=class extends Ao{},QG=class extends Ao{},cD=class extends lr{constructor(e){if(super(),this._onClick=t=>{this.fire(new QG("click",{originalEvent:t}))},this._onKeyPress=t=>{(t.code==="Space"||t.code==="Enter")&&this.togglePopup()},this._onKeyDown=t=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||t.composedPath()[0]!==this._element||t.altKey||t.ctrlKey||t.metaKey)return;let r=uT[t.key];if(!r)return;t.preventDefault(),t.stopPropagation();let i=t.shiftKey?10:1,n=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new k(n.x+r[0]*i,n.y+r[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new Ss("dragstart"))),this.fire(new Ss("drag"))},this._onKeyUp=t=>{uT[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let r=t.originalEvent.target,i=this._element;this._popup&&(r===i||i.contains(r))&&this.togglePopup()},this._updateCoveredUnthrottled=()=>{let t=this._map?.terrain;if(!t||!this._isInViewport())return;let r=this._isCovered(t);r&&this._popup?.isOpen()&&this._popup.remove(),this._element.style.opacity=r?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",r)},this._updateCovered=Xv(this._updateCoveredUnthrottled,100),this._update=t=>{if(!this._map)return;this._lngLat=WG(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?r=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?i="rotateX(0deg)":this._pitchAlignment==="map"&&(i=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&t?.type!=="move"&&(this._pos=this._pos.round()),this._element.style.transform=`${lD[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${r}`,this._updateOpacity()},this._onMove=t=>{if(!this._isDragging){let r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new Ss("dragstart"))),this.fire(new Ss("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new Ss("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||uD,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=k.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht.create("div");let t=XG().cloneNode(!0);t.setAttributeNS(null,"height",`${41*this._scale}px`),t.setAttributeNS(null,"width",`${27*this._scale}px`),KG(t).setAttributeNS(null,"fill",this._color),this._element.appendChild(t),this._offset=k.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),YG(this._element,this._anchor,"marker"),e?.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),e.on("idle",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("idle",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),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=H.convert(e),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),e){if(!("offset"in e.options)){let t=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,(24.6+t)*-1],"bottom-right":[-t,(24.6+t)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new Ss("dragend")))}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(){if(!this._isInViewport())return;let e=this._map?.terrain,t=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!e||t){let r=t?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==r&&(this._element.style.opacity=r,this._element.classList.toggle("maplibregl-marker-covered",t))}else this._updateCovered()}_isInViewport(){let{width:e,height:t}=this._map._camera.transform;return!!this._pos&&this._pos.x>=0&&this._pos.y>=0&&this._pos.x<=e&&this._pos.y<=t}_isCovered(e){let t=this._map._camera.transform,r=e.getElevationForLngLat(this._lngLat,t),i=Math.max(0,-this._offset.y)/t.pixelsPerMeter,n=Math.sin(this._map.getPitch()*Math.PI/180)*i;return t.isLocationOccluded(this._lngLat,e,r+n)}getOffset(){return this._offset}setOffset(e){return this._offset=k.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=(this._element.getAttribute("tabindex")==="0"&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(this._opacity===void 0||e===void 0&&t===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=String(e)),t!==void 0&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(),this}};var hH=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Jv(e){bo.WORKER_URL=e}var pD=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0);-webkit-touch-callout:none}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media(forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid buttontext}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media(hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%23333'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%2333b5e5'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%23333'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%2333b5e5'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media(forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right,[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media(prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media(hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}`;var Rf="gramps-connect-story";var dD={},eZ=Object.freeze(Array.from({length:1},(e,t)=>t+1).filter(e=>e===1||dD[e]!==void 0)),Vr=class extends Error{constructor(t,r){super(r),this.name="StoryFormatError",this.code=t}};function Lf(e){if(typeof e!="string")return null;let t=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.exec(e);return t?{major:Number(t[1]),minor:Number(t[2])}:null}function e2(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Vr("not-a-story","story.json is not a JSON object.");let t=e;if(t.format!==Rf)throw new Vr("not-a-story",`story.json's "format" is not "${Rf}".`);let r=Lf(t.version);if(!r||r.major<1)throw new Vr("bad-version",`story.json's "version" (${JSON.stringify(t.version)}) is not a valid MAJOR.MINOR version.`);if(r.major>1)throw new Vr("newer-version",`This story uses format version ${t.version}, which is newer than this viewer supports (up to 1.x). A newer viewer is needed to open it.`);for(let i=r.major;i<1;i++){let n=dD[i];if(!n)throw new Vr("bad-version",`No upgrade path from format version ${i}.x.`);t=n(t)}return t}var t2={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var r2=Bf;var rZ={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var iZ=new RegExp("^1\\.(0|[1-9][0-9]*)$","u"),Na=new RegExp("\\S","u"),nZ=new RegExp("^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$","u"),aZ=new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$","u"),Of=new RegExp("^[A-Za-z0-9_-]{1,64}$","u"),oZ=new RegExp("^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$","u"),sZ=new RegExp("^[a-z]+/[A-Za-z0-9.+-]+$","u");function sl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=sl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.media===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[u]:o.push(u),s++}if(e.corners===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"corners"},message:"must have required property 'corners'"};o===null?o=[u]:o.push(u),s++}if(e.media!==void 0){let u=e.media;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.corners!==void 0){let u=e.corners;if(Array.isArray(u)){if(u.length>4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/maxItems",keyword:"maxItems",params:{limit:4},message:"must NOT have more than 4 items"};o===null?o=[h]:o.push(h),s++}if(u.length<4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/minItems",keyword:"minItems",params:{limit:4},message:"must NOT have fewer than 4 items"};o===null?o=[h]:o.push(h),s++}let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(Array.isArray(p)){if(p.length>2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items"};o===null?o=[f]:o.push(f),s++}if(p.length<2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items"};o===null?o=[f]:o.push(f),s++}let d=p.length;if(d>0){let f=p[0];if(typeof f=="number"&&isFinite(f)){if(f>180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[m]:o.push(m),s++}if(f<-180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}if(d>1){let f=p[1];if(typeof f=="number"&&isFinite(f)){if(f>90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[m]:o.push(m),s++}if(f<-90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}}else{let d={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/corners",schemaPath:"#/properties/corners/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.opacity!==void 0){let u=e.opacity;if(typeof u=="number"&&isFinite(u)){if(u>1||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/maximum",keyword:"maximum",params:{comparison:"<=",limit:1},message:"must be <= 1"};o===null?o=[c]:o.push(c),s++}if(u<0||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.order!==void 0){let u=e.order;if(!(typeof u=="number"&&!(u%1)&&!isNaN(u)&&isFinite(u))){let c={instancePath:t+"/order",schemaPath:"#/properties/order/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[c]:o.push(c),s++}}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return sl.errors=o,s===0}sl.evaluated={props:{media:!0,corners:!0,opacity:!0,order:!0,date:!0},dynamicProps:!1,dynamicItems:!1};function ll(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ll.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.name!==void 0&&typeof e.name!="string"){let u={instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.lat!==void 0){let u=e.lat;if(typeof u=="number"&&isFinite(u)){if(u>90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[c]:o.push(c),s++}if(u<-90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.lon!==void 0){let u=e.lon;if(typeof u=="number"&&isFinite(u)){if(u>180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[c]:o.push(c),s++}if(u<-180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.geometry!==void 0){let u=e.geometry;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.type===void 0){let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};o===null?o=[c]:o.push(c),s++}if(u.type!==void 0&&typeof u.type!="string"){let c={instancePath:t+"/geometry/type",schemaPath:"#/properties/geometry/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.overlays!==void 0){let u=e.overlays;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)sl(u[h],{instancePath:t+"/overlays/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?sl.errors:o.concat(sl.errors),s=o.length)}else{let c={instancePath:t+"/overlays",schemaPath:"#/properties/overlays/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.lat!==void 0&&e.lon===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lat",missingProperty:"lon",depsCount:1,deps:"lon"},message:"must have property lon when property lat is present"};o===null?o=[u]:o.push(u),s++}if(e.lon!==void 0&&e.lat===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lon",missingProperty:"lat",depsCount:1,deps:"lat"},message:"must have property lat when property lon is present"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ll.errors=o,s===0}ll.evaluated={props:{name:!0,lat:!0,lon:!0,geometry:!0,overlays:!0},dynamicProps:!1,dynamicItems:!1};function ul(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ul.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.ref===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"ref"},message:"must have required property 'ref'"};o===null?o=[u]:o.push(u),s++}if(e.ref!==void 0){let u=e.ref;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.caption!==void 0&&typeof e.caption!="string"){let u={instancePath:t+"/caption",schemaPath:"#/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.credit!==void 0&&typeof e.credit!="string"){let u={instancePath:t+"/credit",schemaPath:"#/properties/credit/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ul.errors=o,s===0}ul.evaluated={props:{ref:!0,caption:!0,credit:!0},dynamicProps:!1,dynamicItems:!1};function cl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=cl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};o===null?o=[u]:o.push(u),s++}if(e.id!==void 0){let u=e.id;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.title!==void 0&&typeof e.title!="string"){let u={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.text!==void 0&&typeof e.text!="string"){let u={instancePath:t+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.place!==void 0&&(ll(e.place,{instancePath:t+"/place",parentData:e,parentDataProperty:"place",rootData:n,dynamicAnchors:a})||(o=o===null?ll.errors:o.concat(ll.errors),s=o.length)),e.media!==void 0){let u=e.media;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)ul(u[h],{instancePath:t+"/media/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?ul.errors:o.concat(ul.errors),s=o.length)}else{let c={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.people!==void 0){let u=e.people;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.name===void 0){let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[d]:o.push(d),s++}if(p.name!==void 0){let d=p.name;if(typeof d=="string"){if(!Na.test(d)){let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.role!==void 0&&typeof p.role!="string"){let d={instancePath:t+"/people/"+h+"/role",schemaPath:"#/properties/people/items/properties/role/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/people",schemaPath:"#/properties/people/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return cl.errors=o,s===0}cl.evaluated={props:{id:!0,title:!0,text:!0,date:!0,place:!0,media:!0,people:!0},dynamicProps:!1,dynamicItems:!1};function Bf(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=Bf.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.format===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"format"},message:"must have required property 'format'"};o===null?o=[c]:o.push(c),s++}if(e.version===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};o===null?o=[c]:o.push(c),s++}if(e.title===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};o===null?o=[c]:o.push(c),s++}if(e.slides===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"slides"},message:"must have required property 'slides'"};o===null?o=[c]:o.push(c),s++}if(e.media===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[c]:o.push(c),s++}if(e.$schema!==void 0&&typeof e.$schema!="string"){let c={instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.format!==void 0&&e.format!=="gramps-connect-story"){let c={instancePath:t+"/format",schemaPath:"#/properties/format/const",keyword:"const",params:{allowedValue:"gramps-connect-story"},message:"must be equal to constant"};o===null?o=[c]:o.push(c),s++}if(e.version!==void 0){let c=e.version;if(typeof c=="string"){if(!iZ.test(c)){let h={instancePath:t+"/version",schemaPath:"#/properties/version/pattern",keyword:"pattern",params:{pattern:"^1\\.(0|[1-9][0-9]*)$"},message:'must match pattern "^1\\.(0|[1-9][0-9]*)$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.title!==void 0){let c=e.title;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/title",schemaPath:"#/properties/title/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.language!==void 0){let c=e.language;if(typeof c=="string"){if(!nZ.test(c)){let h={instancePath:t+"/language",schemaPath:"#/properties/language/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},message:'must match pattern "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/language",schemaPath:"#/properties/language/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.created!==void 0){let c=e.created;if(typeof c=="string"){if(!aZ.test(c)){let h={instancePath:t+"/created",schemaPath:"#/properties/created/pattern",keyword:"pattern",params:{pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},message:'must match pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/created",schemaPath:"#/properties/created/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.generator!==void 0){let c=e.generator;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.name===void 0){let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[h]:o.push(h),s++}if(c.name!==void 0){let h=c.name;if(typeof h=="string"){if(!Na.test(h)){let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[p]:o.push(p),s++}}else{let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[p]:o.push(p),s++}}if(c.version!==void 0&&typeof c.version!="string"){let h={instancePath:t+"/generator/version",schemaPath:"#/properties/generator/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}if(c.url!==void 0&&typeof c.url!="string"){let h={instancePath:t+"/generator/url",schemaPath:"#/properties/generator/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.authors!==void 0){let c=e.authors;if(Array.isArray(c)){let h=c.length;for(let p=0;p<h;p++){let d=c[p];if(d&&typeof d=="object"&&!Array.isArray(d)){if(d.name===void 0){let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[f]:o.push(f),s++}if(d.name!==void 0){let f=d.name;if(typeof f=="string"){if(!Na.test(f)){let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[m]:o.push(m),s++}}if(d.url!==void 0&&typeof d.url!="string"){let f={instancePath:t+"/authors/"+p+"/url",schemaPath:"#/properties/authors/items/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[f]:o.push(f),s++}}}else{let h={instancePath:t+"/authors",schemaPath:"#/properties/authors/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.license!==void 0&&typeof e.license!="string"){let c={instancePath:t+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.presentation!==void 0){let c=e.presentation;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.basemap!==void 0){let h=c.basemap;if(!(h==="standard"||h==="historical"||h==="auto"||h==="none")){let p={instancePath:t+"/presentation/basemap",schemaPath:"#/properties/presentation/properties/basemap/enum",keyword:"enum",params:{allowedValues:rZ.properties.presentation.properties.basemap.enum},message:"must be equal to one of the allowed values"};o===null?o=[p]:o.push(p),s++}}}else{let h={instancePath:t+"/presentation",schemaPath:"#/properties/presentation/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.slides!==void 0){let c=e.slides;if(Array.isArray(c)){if(c.length<1){let p={instancePath:t+"/slides",schemaPath:"#/properties/slides/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};o===null?o=[p]:o.push(p),s++}let h=c.length;for(let p=0;p<h;p++)cl(c[p],{instancePath:t+"/slides/"+p,parentData:c,parentDataProperty:p,rootData:n,dynamicAnchors:a})||(o=o===null?cl.errors:o.concat(cl.errors),s=o.length)}else{let h={instancePath:t+"/slides",schemaPath:"#/properties/slides/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.media!==void 0){let c=e.media;if(c&&typeof c=="object"&&!Array.isArray(c)){for(let h in c){let p=s;if(typeof h=="string"){if(!Of.test(h)){let d={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"',propertyName:h};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",propertyName:h};o===null?o=[d]:o.push(d),s++}var u=p===s;if(!u){let d={instancePath:t+"/media",schemaPath:"#/properties/media/propertyNames",keyword:"propertyNames",params:{propertyName:h},message:"property name must be valid"};o===null?o=[d]:o.push(d),s++}}for(let h in c){let p=c[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.src===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"src"},message:"must have required property 'src'"};o===null?o=[d]:o.push(d),s++}if(p.mime===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"mime"},message:"must have required property 'mime'"};o===null?o=[d]:o.push(d),s++}if(p.src!==void 0){let d=p.src;if(typeof d=="string"){if(!oZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/pattern",keyword:"pattern",params:{pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},message:'must match pattern "^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.mime!==void 0){let d=p.mime;if(typeof d=="string"){if(!sZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/pattern",keyword:"pattern",params:{pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},message:'must match pattern "^[a-z]+/[A-Za-z0-9.+-]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.width!==void 0){let d=p.width;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.height!==void 0){let d=p.height;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.alt!==void 0&&typeof p.alt!="string"){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/alt",schemaPath:"#/$defs/mediaItem/properties/alt/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let h={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.extensions!==void 0){let c=e.extensions;if(c&&typeof c=="object"&&!Array.isArray(c))for(let h in c){let p=c[h];if(!(p&&typeof p=="object"&&!Array.isArray(p))){let d={instancePath:t+"/extensions/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/extensions/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}else{let h={instancePath:t+"/extensions",schemaPath:"#/properties/extensions/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}return Bf.errors=o,s===0}Bf.evaluated={props:{$schema:!0,format:!0,version:!0,title:!0,language:!0,created:!0,generator:!0,authors:!0,license:!0,presentation:!0,slides:!0,media:!0,extensions:!0},dynamicProps:!1,dynamicItems:!1};var lZ=0;function i2(e,t){let r=[],i=[];if(!r2(e)){for(let u of r2.errors??[])r.push({path:u.instancePath,message:uZ(u)});return{valid:!1,errors:r,warnings:i}}let n=e,a=new Set,o=new Set,s=(u,c)=>{o.add(u),Object.prototype.hasOwnProperty.call(n.media,u)||r.push({path:c,message:`refers to media "${u}", which isn't in "media".`})};n.slides.forEach((u,c)=>{a.has(u.id)&&r.push({path:`/slides/${c}/id`,message:`duplicate slide id "${u.id}".`}),a.add(u.id),u.media?.forEach((h,p)=>s(h.ref,`/slides/${c}/media/${p}/ref`)),u.place?.overlays?.forEach((h,p)=>s(h.media,`/slides/${c}/place/overlays/${p}/media`))});for(let[u,c]of Object.entries(n.media)){let h=`/media/${mD(u)}`;t&&!t.has(c.src)&&r.push({path:`${h}/src`,message:`file "${c.src}" is not in the zip.`}),o.has(u)||i.push({path:h,message:`media "${u}" isn't used by any slide or overlay.`})}let l=Lf(n.version);return l&&l.major===1&&l.minor<=lZ&&jf(n,t2,"",i),{valid:r.length===0,errors:r,warnings:i}}function uZ(e){return e.keyword==="pattern"&&e.params.pattern==="\\S"?"must not be empty.":e.keyword==="required"?`is missing required field "${String(e.params.missingProperty)}".`:e.keyword==="const"?`must be ${JSON.stringify(e.params.allowedValue)}.`:e.keyword==="enum"?`must be one of ${e.params.allowedValues.map(t=>JSON.stringify(t)).join(", ")}.`:`${e.message??"is invalid"}.`}function mD(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function cZ(e,t){if(!e.$ref)return e;let r=e.$ref.replace(/^#\/\$defs\//,"");return t.$defs[r]}function jf(e,t,r,i,n=t2){if(t=cZ(t,n),Array.isArray(e)){e.forEach((a,o)=>{let s=t.prefixItems?.[o]??t.items;s&&jf(a,s,`${r}/${o}`,i,n)});return}if(!(typeof e!="object"||e===null))for(let[a,o]of Object.entries(e)){let s=`${r}/${mD(a)}`,l=t.properties?.[a];l?jf(o,l,s,i,n):typeof t.additionalProperties=="object"?jf(o,t.additionalProperties,s,i,n):t.properties&&t.additionalProperties!==!0&&i.push({path:s,message:`unknown field "${a}" (ignored).`})}}var gD={},hZ=(function(e,t,r,i,n){var a=new Worker(gD[t]||(gD[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var s=o.data,l=s.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],n(u,null)}else n(null,s)},a.postMessage(r,i),a}),Dr=Uint8Array,Ro=Uint16Array,vD=Int32Array,o2=new Dr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s2=new Dr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xD=new Dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bD=function(e,t){for(var r=new Ro(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];for(var n=new vD(r[30]),i=1;i<30;++i)for(var a=r[i];a<r[i+1];++a)n[a]=a-r[i]<<5|i;return{b:r,r:n}},wD=bD(o2,2),l2=wD.b,pZ=wD.r;l2[28]=258,pZ[258]=28;var TD=bD(s2,0),SD=TD.b,LJ=TD.r,$f=new Ro(32768);for(Ve=0;Ve<32768;++Ve)Wn=(Ve&43690)>>1|(Ve&21845)<<1,Wn=(Wn&52428)>>2|(Wn&13107)<<2,Wn=(Wn&61680)>>4|(Wn&3855)<<4,$f[Ve]=((Wn&65280)>>8|(Wn&255)<<8)>>1;var Wn,Ve,hl=(function(e,t,r){for(var i=e.length,n=0,a=new Ro(t);n<i;++n)e[n]&&++a[e[n]-1];var o=new Ro(t);for(n=1;n<t;++n)o[n]=o[n-1]+a[n-1]<<1;var s;if(r){s=new Ro(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],h=o[e[n]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)s[$f[h]>>l]=u}else for(s=new Ro(i),n=0;n<i;++n)e[n]&&(s[n]=$f[o[e[n]-1]++]>>15-e[n]);return s}),Dc=new Dr(288);for(Ve=0;Ve<144;++Ve)Dc[Ve]=8;var Ve;for(Ve=144;Ve<256;++Ve)Dc[Ve]=9;var Ve;for(Ve=256;Ve<280;++Ve)Dc[Ve]=7;var Ve;for(Ve=280;Ve<288;++Ve)Dc[Ve]=8;var Ve,ED=new Dr(32);for(Ve=0;Ve<32;++Ve)ED[Ve]=5;var Ve;var CD=hl(Dc,9,1);var PD=hl(ED,5,1),Vf=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Ei=function(e,t,r){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(t&7)&r},Uf=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},DD=function(e){return(e+7)/8|0},qf=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Dr(e.subarray(t,r))};var AD=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_r=function(e,t,r){var i=new Error(t||AD[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,_r),!r)throw i;return i},MD=function(e,t,r,i){var n=e.length,a=i?i.length:0;if(!n||t.f&&!t.l)return r||new Dr(0);var o=!r,s=o||t.i!=2,l=t.i;o&&(r=new Dr(n*3));var u=function(Et){var kt=r.length;if(Et>kt){var st=new Dr(Math.max(kt*2,Et));st.set(r),r=st}},c=t.f||0,h=t.p||0,p=t.b||0,d=t.l,f=t.d,m=t.m,_=t.n,g=n*8;do{if(!d){c=Ei(e,h,1);var y=Ei(e,h+1,3);if(h+=3,y)if(y==1)d=CD,f=PD,m=9,_=5;else if(y==2){var w=Ei(e,h,31)+257,T=Ei(e,h+10,15)+4,S=w+Ei(e,h+5,31)+1;h+=14;for(var E=new Dr(S),P=new Dr(19),D=0;D<T;++D)P[xD[D]]=Ei(e,h+D*3,7);h+=T*3;for(var F=Vf(P),I=(1<<F)-1,C=hl(P,F,1),D=0;D<S;){var A=C[Ei(e,h,I)];h+=A&15;var v=A>>4;if(v<16)E[D++]=v;else{var M=0,L=0;for(v==16?(L=3+Ei(e,h,3),h+=2,M=E[D-1]):v==17?(L=3+Ei(e,h,7),h+=3):v==18&&(L=11+Ei(e,h,127),h+=7);L--;)E[D++]=M}}var j=E.subarray(0,w),O=E.subarray(w);m=Vf(j),_=Vf(O),d=hl(j,m,1),f=hl(O,_,1)}else _r(1);else{var v=DD(h)+4,x=e[v-4]|e[v-3]<<8,b=v+x;if(b>n){l&&_r(0);break}s&&u(p+x),r.set(e.subarray(v,b),p),t.b=p+=x,t.p=h=b*8,t.f=c;continue}if(h>g){l&&_r(0);break}}s&&u(p+131072);for(var Y=(1<<m)-1,ue=(1<<_)-1,pe=h;;pe=h){var M=d[Uf(e,h)&Y],de=M>>4;if(h+=M&15,h>g){l&&_r(0);break}if(M||_r(2),de<256)r[p++]=de;else if(de==256){pe=h,d=null;break}else{var je=de-254;if(de>264){var D=de-257,Se=o2[D];je=Ei(e,h,(1<<Se)-1)+l2[D],h+=Se}var ae=f[Uf(e,h)&ue],oe=ae>>4;ae||_r(3),h+=ae&15;var O=SD[oe];if(oe>3){var Se=s2[oe];O+=Uf(e,h)&(1<<Se)-1,h+=Se}if(h>g){l&&_r(0);break}s&&u(p+131072);var $e=p+je;if(p<O){var qe=a-O,mt=Math.min(O,$e);for(qe+p<0&&_r(3);p<mt;++p)r[p]=i[qe+p]}for(;p<$e;++p)r[p]=r[p-O]}}t.l=d,t.p=pe,t.b=p,t.f=c,d&&(c=1,t.m=m,t.d=f,t.n=_)}while(!c);return p!=r.length&&o?qf(r,0,p):r.subarray(0,p)};var dZ=new Dr(0);var fZ=function(e,t){var r={};for(var i in e)r[i]=e[i];for(var i in t)r[i]=t[i];return r},yD=function(e,t,r){for(var i=e(),n=e.toString(),a=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<i.length;++o){var s=i[o],l=a[o];if(typeof s=="function"){t+=";"+l+"=";var u=s.toString();if(s.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;t+=u.slice(c,u.indexOf("(",c))}else{t+=u;for(var h in s.prototype)t+=";"+l+".prototype."+h+"="+s.prototype[h].toString()}else t+=u}else r[l]=s}return t},Nf=[],mZ=function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},gZ=function(e,t,r,i){if(!Nf[r]){for(var n="",a={},o=e.length-1,s=0;s<o;++s)n=yD(e[s],n,a);Nf[r]={c:yD(e[o],n,a),e:a}}var l=fZ({},Nf[r].e);return hZ(Nf[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,mZ(l),i)},yZ=function(){return[Dr,Ro,vD,o2,s2,xD,l2,SD,CD,PD,$f,AD,hl,Vf,Ei,Uf,DD,qf,_r,MD,u2,ID,kD]};var ID=function(e){return postMessage(e,[e.buffer])},kD=function(e){return e&&{out:e.size&&new Dr(e.size),dictionary:e.dictionary}},_Z=function(e,t,r,i,n,a){var o=gZ(r,i,n,function(s,l){o.terminate(),a(s,l)});return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}};var xn=function(e,t){return e[t]|e[t+1]<<8},Ci=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},n2=function(e,t){return Ci(e,t)+Ci(e,t+4)*4294967296};function vZ(e,t,r){return r||(r=t,t={}),typeof r!="function"&&_r(7),_Z(e,t,[yZ],function(i){return ID(u2(i.data[0],kD(i.data[1])))},1,r)}function u2(e,t){return MD(e,{i:2},t&&t.out,t&&t.dictionary)}var a2=typeof TextDecoder<"u"&&new TextDecoder,xZ=0;try{a2.decode(dZ,{stream:!0}),xZ=1}catch{}var bZ=function(e){for(var t="",r=0;;){var i=e[r++],n=(i>127)+(i>223)+(i>239);if(r+n>e.length)return{s:t,r:qf(e,r-1)};n?n==3?(i=((i&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|i>>10,56320|i&1023)):n&1?t+=String.fromCharCode((i&31)<<6|e[r++]&63):t+=String.fromCharCode((i&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(i)}};function wZ(e,t){if(t){for(var r="",i=0;i<e.length;i+=16384)r+=String.fromCharCode.apply(null,e.subarray(i,i+16384));return r}else{if(a2)return a2.decode(e);var n=bZ(e),a=n.s,r=n.r;return r.length&&_r(8),a}}var TZ=function(e,t){return t+30+xn(e,t+26)+xn(e,t+28)},SZ=function(e,t,r){var i=xn(e,t+28),n=xn(e,t+30),a=wZ(e.subarray(t+46,t+46+i),!(xn(e,t+8)&2048)),o=t+46+i,s=EZ(e,o,n,r,Ci(e,t+20),Ci(e,t+24),Ci(e,t+42)),l=s[0],u=s[1],c=s[2];return[xn(e,t+10),l,u,a,o+n+xn(e,t+32),c]},EZ=function(e,t,r,i,n,a,o){var s=n==4294967295,l=a==4294967295,u=o==4294967295,c=t+r,h=s+l+u;if(i&&h){for(;t+4<c;t+=4+xn(e,t+2))if(xn(e,t)==1)return[s?n2(e,t+4+8*l):n,l?n2(e,t+4):a,u?n2(e,t+4+8*(l+s)):o,1];i<2&&_r(13)}return[n,a,o,0]};var _D=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function zD(e,t,r){r||(r=t,t={}),typeof r!="function"&&_r(7);var i=[],n=function(){for(var _=0;_<i.length;++_)i[_]()},a={},o=function(_,g){_D(function(){r(_,g)})};_D(function(){o=r});for(var s=e.length-22;Ci(e,s)!=101010256;--s)if(!s||e.length-s>65558)return o(_r(13,0,1),null),n;var l=xn(e,s+8);if(l){var u=l,c=Ci(e,s+16),h=Ci(e,s-20)==117853008;if(h){var p=Ci(e,s-12);h=Ci(e,p)==101075792,h&&(u=l=Ci(e,p+32),c=Ci(e,p+48))}for(var d=t&&t.filter,f=function(_){var g=SZ(e,c,h),y=g[0],v=g[1],x=g[2],b=g[3],w=g[4],T=g[5],S=TZ(e,T);c=w;var E=function(D,F){D?(n(),o(D,null)):(F&&(a[b]=F),--l||o(null,a))};if(!d||d({name:b,size:v,originalSize:x,compression:y}))if(!y)E(null,qf(e,S,S+v));else if(y==8){var P=e.subarray(S,S+v);if(x<524288||v>.8*x)try{E(null,u2(P,{out:new Dr(x)}))}catch(D){E(D,null)}else i.push(vZ(P,{size:x},E))}else E(_r(14,"unknown compression type "+y,1),null);else E(null,null)},m=0;m<u;++m)f(m)}else o(null,{});return n}var c2="story.json";async function PZ(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(await e.arrayBuffer())}function DZ(e){return e.endsWith("/")||e.startsWith("__MACOSX/")}async function h2(e,t={}){let r=t.maxTotalBytes??536870912,i=t.maxFiles??1e4,n=await PZ(e),a=0,o=0,s=!1,l=await new Promise((f,m)=>{zD(n,{filter(_){return DZ(_.name)?!1:(o+=1,a+=_.originalSize,(o>i||a>r)&&(s=!0),!s)}},(_,g)=>_?m(_):f(g))}).catch(f=>{throw new Vr("not-a-zip",`Not a readable zip file (${f instanceof Error?f.message:String(f)}).`)});if(s)throw new Vr("too-large","This zip is too large to open as a story.");let u=AZ(Object.keys(l)),c=new Map;for(let[f,m]of Object.entries(l))f.startsWith(u)&&c.set(f.slice(u.length),m);let h;try{h=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c.get(c2)))}catch(f){throw new Vr("bad-json",`story.json is not valid JSON (${f instanceof Error?f.message:String(f)}).`)}let p=e2(h),d=i2(p,c);if(!d.valid)throw new Gf(d.errors);return{doc:p,files:c,warnings:d.warnings}}var Gf=class extends Vr{constructor(t){super("invalid",`story.json is invalid: ${t.slice(0,5).map(r=>`${r.path||"/"} ${r.message}`).join("; ")}${t.length>5?` (and ${t.length-5} more)`:""}`),this.issues=t}};function AZ(e){if(e.includes(c2))return"";let t=e.filter(r=>/^[^/]+\/story\.json$/.test(r));if(t.length===1)return t[0].slice(0,-c2.length);throw new Vr("no-story-json",t.length>1?"This zip holds more than one story.json; a story zip has exactly one.":"This zip has no story.json, so it isn't a story.")}function p2(e,t){let r=Object.prototype.hasOwnProperty.call(e.doc.media,t)?e.doc.media[t]:void 0,i=r&&e.files.get(r.src);return i?new Blob([i],{type:r.mime}):void 0}var He=ur($a(),1);var FD=/^(-?\d{4})(?:-(\d{2}|XX))?(?:-(\d{2}|XX))?[~?%]?$/;function Ac(e){let t=FD.exec(e.trim());return t?Number(t[1]):null}function RD(e){if(!e)return null;let t=e.trim(),r=/^\[(.+)\.\.(.+)\]$/.exec(t);if(r){let n=Ac(r[1]),a=Ac(r[2]);return n!==null&&a!==null?{min:Math.min(n,a),max:Math.max(n,a)}:null}if(t.includes("/")){let[n,a]=t.split("/"),o=n===".."||n==="",s=a===".."||a==="",l=o?void 0:Ac(n),u=s?void 0:Ac(a);return l===null||u===null||l===void 0&&u===void 0?null:l!==void 0&&u!==void 0?{min:Math.min(l,u),max:Math.max(l,u)}:{min:l,max:u}}let i=Ac(t);return i===null?null:{min:i,max:i}}function Zf(e,t){if(!e||t===null)return!0;let r=RD(e.edtf);return r?!(r.min!==void 0&&t<r.min||r.max!==void 0&&t>r.max):!0}function Hf(e){if(!e)return null;let t=e.edtf?FD.exec(e.edtf.trim()):null,r=e.sortYear??(t?Number(t[1]):void 0);if(r===void 0)return null;if(!t||Number(t[1])!==r)return r;let i=t[2]&&t[2]!=="XX"?Number(t[2]):0,n=t[3]&&t[3]!=="XX"?Number(t[3]):0;return i?r+(i-1)/12+(n?(n-1)/365:0):r}function Mc(e,t){if(Array.isArray(e)){if(e.length>=2&&typeof e[0]=="number"&&typeof e[1]=="number"){let[r,i]=e;t[0]=Math.min(t[0],r),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],r),t[3]=Math.max(t[3],i);return}for(let r of e)Mc(r,t)}}function Wf(e,t){if(!e||typeof e!="object")return;let r=e;r.coordinates!==void 0&&Mc(r.coordinates,t),r.geometry&&Wf(r.geometry,t);for(let i of r.geometries??[])Wf(i,t);for(let i of r.features??[])Wf(i,t)}function Ic(e){if(!e)return null;let t=[1/0,1/0,-1/0,-1/0];Wf(e.geometry,t);for(let r of e.overlays??[])Mc(r.corners,t);return Number.isFinite(t[0])?t:null}function Yn(e){if(e?.lat!==void 0&&e.lon!==void 0)return[e.lon,e.lat];let t=Ic(e);return t?[(t[0]+t[2])/2,(t[1]+t[3])/2]:null}function LD(e){let t=[1/0,1/0,-1/0,-1/0],r=new Map;for(let i of e){let n=Yn(i);if(!n)continue;r.set(`${n[0].toFixed(5)},${n[1].toFixed(5)}`,n),Mc(n,t);let a=Ic(i);a&&Mc([[a[0],a[1]],[a[2],a[3]]],t)}return r.size?{points:[...r.values()],bounds:t}:null}var It=ur($a(),1);var $D=ur(UD(),1),qD="https://tiles.openfreemap.org/styles/liberty",GD="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",ZD="https://www.openhistoricalmap.org/map-styles/main/main.json";function zc(e,t){return t!=null?"ohm":e?"dark":"light"}function Qf(e,t){return t!=null?ZD:e?GD:qD}function g2(e,t,r,i=300){let n=e.getContainer();n.style.zIndex||(n.style.zIndex="0");let a=null;try{a=e.getCanvas().toDataURL("image/png")}catch{}if(r(),e.setStyle(t),!a)return;let o=document.createElement("img");o.src=a,o.alt="",Object.assign(o.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"5",pointerEvents:"none",transition:`opacity ${i}ms ease`}),n.appendChild(o),e.once("idle",()=>{requestAnimationFrame(()=>{o.style.opacity="0"}),window.setTimeout(()=>o.remove(),i+50)})}function y2(e,t){(0,$D.filterByDate)(e,String(Math.round(t)))}function _2(e){return e?{surface:"#242424",text:"#c9c9c9",muted:"#828282",border:"#424242",mark:"#3987e5",panel:"rgb(20,20,20)"}:{surface:"#ffffff",text:"#000000",muted:"#868e96",border:"#dee2e6",mark:"#2a78d6",panel:"rgb(255,255,255)"}}var Fc="M12 0C7.03 0 3 4.03 3 9c0 6.25 9 15 9 15s9-8.75 9-15c0-4.97-4.03-9-9-9z";var e8=ur(Xi(),1),Lo="story-shape",XD="story-shape-fill",LZ="story-shape-line",BZ="story-shape-points",OZ="story-shape-labels",jZ="story-overlay-",v2="story-places",NZ="story-places-dots",VZ=60,x2={type:"FeatureCollection",features:[]};function KD(e,t,r){if(t.overview){let[o,s,l,u]=t.overview.bounds;e.fitBounds([[o,s],[l,u]],{maxZoom:9,padding:VZ,duration:r});return}let i=t.place,n=Ic(i);if(n){e.fitBounds([[n[0],n[1]],[n[2],n[3]]],{maxZoom:17,duration:r});return}let a=Yn(i);a&&e.flyTo({center:a,zoom:9,essential:!0,duration:r})}function QD(e,t){if(!e)return;let r=Yn(t.place);r&&e.setLngLat(r),e.setOpacity(t.overview?0:r?1:.4)}var UZ=e=>({type:"FeatureCollection",features:(e?.points??[]).map(t=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:t}}))});function JD({initialCenter:e,current:t,dark:r,colors:i,panelFraction:n,ohmYear:a,resolveMedia:o}){let[s,l]=(0,It.useState)(null),u=(0,It.useRef)(null),c=(0,It.useRef)(null),[h,p]=(0,It.useState)(!1),d=(0,It.useRef)(r);d.current=r;let f=(0,It.useRef)(a);f.current=a;let m=(0,It.useRef)(i);m.current=i;let _=(0,It.useRef)(new Map),g=(0,It.useRef)(zc(r,a)),y=(0,It.useRef)(t);y.current=t,(0,It.useEffect)(()=>{if(!s)return;p(!1),g.current=zc(d.current,f.current);let b=new sD({container:s,style:Qf(d.current,f.current),zoom:5,attributionControl:{compact:!0},canvasContextAttributes:{preserveDrawingBuffer:!0}});u.current=b,b.on("style.load",()=>p(!0)),b.setPadding({top:0,bottom:0,left:0,right:s.clientWidth*n});let w=y.current;return b.jumpTo({center:Yn(w.place)??e}),KD(b,w,0),b.on("load",()=>{let T=m.current,S=document.createElement("div");S.style.width="26px",S.style.height="26px",S.style.transition="opacity 300ms",S.innerHTML=`<svg viewBox="0 0 24 24" width="26" height="26"><path d="${Fc}" fill="${T.mark}" stroke="${T.surface}" stroke-width="1.5" /></svg>`,c.current=new cD({element:S,anchor:"bottom"}).setLngLat(e).addTo(b),QD(c.current,y.current)}),()=>{c.current?.remove(),c.current=null,b.remove(),u.current=null}},[s]),(0,It.useEffect)(()=>{let b=u.current,w=zc(r,a);!b||g.current===w||(g.current=w,g2(b,Qf(r,a),()=>p(!1)))},[r,a]),(0,It.useEffect)(()=>{let b=u.current;!b||!h||a==null||y2(b,a)},[h,a]),(0,It.useEffect)(()=>{let b=u.current;if(!b||!h||b.getSource(Lo))return;let w=m.current;b.addSource(Lo,{type:"geojson",data:x2});let T=["coalesce",["get","color"],w.mark];b.addLayer({id:XD,type:"fill",source:Lo,filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":T,"fill-opacity":["coalesce",["to-number",["get","opacity"],.25],.25]}}),b.addLayer({id:LZ,type:"line",source:Lo,filter:["any",["==",["geometry-type"],"Polygon"],["==",["geometry-type"],"LineString"]],paint:{"line-color":T,"line-width":2}}),b.addLayer({id:BZ,type:"circle",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["!",["has","name"]]],paint:{"circle-radius":5,"circle-color":T,"circle-stroke-width":1,"circle-stroke-color":w.surface}}),b.addLayer({id:OZ,type:"symbol",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["has","name"]],layout:{"text-field":["get","name"],"text-size":12,"text-font":["Noto Sans Regular"],"text-anchor":"left","text-offset":[.6,0]},paint:{"text-color":["coalesce",["get","color"],w.text],"text-halo-color":w.surface,"text-halo-width":1.5}}),b.addSource(v2,{type:"geojson",data:x2}),b.addLayer({id:NZ,type:"circle",source:v2,paint:{"circle-radius":6,"circle-color":w.mark,"circle-stroke-width":2,"circle-stroke-color":w.surface}})},[h]);let v=t.place;(0,It.useEffect)(()=>{let b=u.current;if(!b||!h)return;b.getSource(Lo)?.setData(v?.geometry??x2),b.getSource(v2)?.setData(UZ(t.overview))},[h,t.key,v,t.overview]),(0,It.useEffect)(()=>{let b=u.current;b&&(QD(c.current,t),KD(b,t,900))},[t.key]);let x=JSON.stringify(v?.overlays??[]);return(0,It.useEffect)(()=>{let b=u.current,w=v?.overlays??[];if(!b||!h||w.length===0)return;let T=!1,S=[];return(async()=>{let E=w.map((P,D)=>({overlay:P,i:D})).sort((P,D)=>(P.overlay.order??P.i)-(D.overlay.order??D.i));for(let{overlay:P,i:D}of E){let F=await o(P.media);if(T)return;if(!F)continue;let I=`${jZ}${D}`;b.getSource(I)||(b.addSource(I,{type:"image",url:F,coordinates:P.corners}),b.addLayer({id:I,type:"raster",source:I},XD),b.setPaintProperty(I,"raster-opacity",P.opacity??1),_.current.set(I,P.date),b.setLayoutProperty(I,"visibility",Zf(P.date,f.current)?"visible":"none"),S.push(I))}})(),()=>{T=!0;for(let E of S)_.current.delete(E),b.getLayer(E)&&b.removeLayer(E),b.getSource(E)&&b.removeSource(E)}},[x,h]),(0,It.useEffect)(()=>{let b=u.current;if(!(!b||!h))for(let[w,T]of _.current)b.getLayer(w)&&b.setLayoutProperty(w,"visibility",Zf(T,a)?"visible":"none")},[a,h]),(0,e8.jsx)("div",{ref:l,style:{position:"absolute",inset:0}})}var Xn=ur(Xi(),1);function b2({mode:e,onModeChange:t,autoYear:r,year:i,onYearChange:n,yearBounds:a,strings:o,colors:s}){let l=[["auto",o.auto],["standard",o.standard],["historical",o.historical]],u={fontSize:12,fontFamily:"inherit"};return(0,Xn.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,whiteSpace:"nowrap"},children:[(0,Xn.jsx)("div",{role:"radiogroup","aria-label":o.mapMode,style:{display:"flex",border:`1px solid ${s.border}`,borderRadius:6,overflow:"hidden",background:s.surface},children:l.map(([c,h])=>(0,Xn.jsx)("button",{type:"button",role:"radio","aria-checked":e===c,onClick:()=>t(c),style:{...u,padding:"4px 10px",border:"none",cursor:"pointer",background:e===c?s.mark:"transparent",color:e===c?"#ffffff":s.text},children:h},c))}),e==="auto"&&(0,Xn.jsx)("span",{style:{...u,color:s.muted},children:r!=null?o.historicalMapYear(r):o.noDateStandardMap}),e==="historical"&&(0,Xn.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,Xn.jsx)("input",{type:"range",min:a[0],max:a[1],step:1,value:i,onChange:c=>n(Number(c.currentTarget.value)),"aria-label":o.historicalYear,style:{width:150,accentColor:s.mark}}),(0,Xn.jsx)("input",{type:"number",min:a[0],max:a[1],step:1,value:i,onChange:c=>{let h=Number(c.currentTarget.value);Number.isFinite(h)&&c.currentTarget.value!==""&&n(Math.round(h))},"aria-label":o.historicalYear,style:{...u,width:70,padding:"3px 4px",border:`1px solid ${s.border}`,borderRadius:4,background:s.surface,color:s.text}})]})]})}var $Z=/\*\*([^\n]+?)\*\*|\*([^\n]+?)\*/g;function qZ(e){let t=[],r=0;for(let i of e.matchAll($Z)){let n=i.index??0;n>r&&t.push({text:e.slice(r,n)}),i[1]!==void 0?t.push({text:i[1],bold:!0}):t.push({text:i[2],italic:!0}),r=n+i[0].length}return r<e.length&&t.push({text:e.slice(r)}),t}function w2(e){return e.replace(/\r\n?/g,`
824
+ ${o.prelude.vertexSource}`,define:o.define},defaultProjectionData:h,getProjectionData:f=>c.getProjectionData({overscaledTileID:new ir(f.tileID.canonical.z,f.tileID.wrap??0,f.tileID.canonical.z,f.tileID.canonical.x,f.tileID.canonical.y),aligned:f.aligned,applyGlobeMatrix:f.applyGlobeMatrix,applyTerrainMatrix:f.applyTerrainMatrix}),renderTerrainHeightMap:s&&n.currentPass==="offscreen"?f=>Nq(n,s,f):void 0},d=u.renderingMode?u.renderingMode:"2d";if(n.currentPass==="offscreen"){let f=u.prerender;f&&(l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),f.call(u,l.gl,p),l.setDirty(),e.setBaseState())}else if(n.currentPass==="translucent"){l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),l.setStencilMode(Ie.disabled);let f=d==="3d"?n.getDepthModeFor3D():n.getDepthModeForSublayer(0,be.ReadOnly);l.setDepthMode(f),u.render(l.gl,p),l.setDirty(),e.setBaseState(),l.bindFramebuffer.set(null)}}function Uq(e,t,r,i){let n=i.context,a=n.bindFramebuffer.get(),o=n.viewport.get();n.setCustomLayerDefaults(),n.setColorMode(i.colorModeForRenderPass()),n.setDepthMode(be.disabled),n.setStencilMode(Ie.disabled),t.implementation.renderToTerrainTile(n.gl,{tileID:{canonical:r.canonical,wrap:r.wrap},width:o[2],height:o[3]}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(a),n.viewport.set(o)}function $q(e,t){let r=t.context,i=r.gl,{sky:n,pixelRatio:a}=t.data,o=H$(n,t.transform,a),s=new be(i.LEQUAL,be.ReadWrite,[0,1]),l=Ie.disabled,u=t.colorModeForRenderPass();t.useProgram("sky").draw(r,i.TRIANGLES,s,l,u,ke.disabled,o,null,void 0,"sky",e.vertexBuffer,e.indexBuffer,e.segments)}function qq(e,t){let r=bT(e.position);tI(r,r);let i=Gi(new Float64Array(16));return e.anchor==="map"&&(Pa(i,i,t.rollInRadians),qs(i,i,-t.pitchInRadians),Pa(i,i,t.bearingInRadians),qs(i,i,t.center.lat*Math.PI/180),gT(i,i,-t.center.lng*Math.PI/180)),iI(r,r,i),r}function Gq(e,t){let r=t.context,i=r.gl,{sky:n,light:a}=t.data,o=t.useProgram("atmosphere"),s=new be(i.LEQUAL,be.ReadOnly,[0,1]),l=t.transform,u=qq(a,l),c=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),h=yo(l.worldSize,l.center.lat),p=zP(l),d=FP(Ui(p)-h,h),f=n["atmosphere-blend"]*c.projectionTransition*d;if(f===0)return;let m=G$(u,f,p,h,l.inverseProjectionMatrix);o.draw(r,i.TRIANGLES,s,Ie.disabled,vt.alphaBlended,ke.disabled,m,null,null,"atmosphere",e.vertexBuffer,e.indexBuffer,e.segments)}var Zq={symbol:Q$,circle:nq,heatmap:aq,line:gq,fill:yq,fillExtrusion:_q,hillshade:vq,colorRelief:bq,raster:wq,background:Cq,sky:$q,atmosphere:Gq,custom:Vq,debug:Fq,debugPadding:kq,terrainDepth:Oq},X6=b_.maxOverzooming+b_.maxUnderzooming+1,K6=1/2**16,Hq={name:TP,define:wP,prelude:dn.projectionMercator},Wq=class{constructor(e){this.currentLayer=0,this.opaquePassCutoff=1/0,this.depthRangeFor3D=[0,1],this.isRenderingToTexture=!1,this.nextStencilID=1,this.tileClippingMaskIDs={},this.transform=e.transform,this.terrain=e.terrain,this.data=e.data,this.context=e.context,this.programCache=e.programCache,this.currentPass=e.currentPass,this.projection=e.projection}getProjectionDataForTile(e,t={}){let r=this.transform.getProjectionData({overscaledTileID:e,aligned:t.aligned,applyGlobeMatrix:!this.isRenderingToTexture,applyTerrainMatrix:t.applyTerrainMatrix??!0});return this.isRenderingToTexture||(r.uniformBufferKey=t.aligned?`${e.key}/aligned`:e.key),r}getTerrainDataForTile(e){return this.isRenderingToTexture?null:this.terrain?.getTerrainData(e)??null}getMeshFromTileID(e,t,r,i){return this.projection.getMeshFromTileID(this.context,e,t,r,i)}useProgram(e,t,r=!1,i=[]){return this.programCache.getProgram({name:e,programConfiguration:t,projectionShaderVariant:r?Hq:this.data.projectionShaderVariant,showOverdrawInspector:this.data.showOverdrawInspector,useTerrain:this.terrain!==null,defines:i})}colorModeForRenderPass(){let e=this.context.gl;if(this.data.showOverdrawInspector){let t=.125;return new vt([e.CONSTANT_COLOR,e.ONE],new he(t,t,t,0),[!0,!0,!0,!0])}return this.currentPass==="opaque"?vt.unblended:vt.alphaBlended}getDepthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return be.disabled;let i=1-((1+this.currentLayer)*X6+e)*K6;return new be(r||this.context.gl.LEQUAL,t,[i,i])}getDepthModeFor3D(){return new be(this.context.gl.LEQUAL,be.ReadWrite,this.depthRangeFor3D)}setDepthRangeFor3D(e){this.depthRangeFor3D=[0,1-(e+2)*X6*K6]}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}clearStencil(){this.nextStencilID=1,this.currentStencilSource=void 0,this.context.clear({stencil:0})}invalidateTileClippingMasks(){this.currentStencilSource=void 0}renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let r=this.context;r.setColorMode(vt.disabled),r.setDepthMode(be.disabled);let i={};for(let n of t)i[n.key]=this.nextStencilID++;this.data.useSubdivision&&this.renderTileMasks(i,t,!0),this.renderTileMasks(i,t,!1),this.tileClippingMaskIDs=i}renderTileMasks(e,t,r){let i=this.context,n=i.gl,a=this.useProgram("clippingMask");for(let o of t){let s=e[o.key],l=this.getTerrainDataForTile(o),u=this.getMeshFromTileID(o.canonical,r,!0,"stencil"),c=this.getProjectionDataForTile(o);a.draw(i,n.TRIANGLES,be.disabled,new Ie({func:n.ALWAYS,mask:0},s,255,n.KEEP,n.KEEP,n.REPLACE),vt.disabled,this.isRenderingToTexture?ke.disabled:ke.backCCW,null,l,c,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new Ie({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Ie({func:t.EQUAL,mask:255},this.tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();let a={};for(let o=0;o<n;o++)a[o+i]=new Ie({func:t.GEQUAL,mask:255},o+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=n,[a,r]}return[{[i]:Ie.disabled},r]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(this.clearStencil(),n>1){let a={},o={};for(let s=0;s<n;s++)a[s+i]=new Ie({func:t.GREATER,mask:255},n+1+s,255,t.KEEP,t.KEEP,t.REPLACE),o[s+i]=new Ie({func:t.GREATER,mask:255},1+s,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=n*2+1,[a,o,r]}return this.nextStencilID=3,[{[i]:new Ie({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[i]:new Ie({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},r]}},vo,Yq=(vo=class{constructor(t){this.drawFunctions=Zq,this.context=new qU(t),this.programCache=new Y$(this.context),this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:Gi(new Float64Array(16)),renderTime:0},this.setup()}resize(t,r,i){this.width=Math.round(t*i),this.height=Math.round(r*i),this.context.viewport.set([0,0,this.width,this.height])}setup(){let t=this.context,r=new ho;r.emplaceBack(0,0),r.emplaceBack(R,0),r.emplaceBack(0,R),r.emplaceBack(R,R),this.tileExtentBuffer=t.createVertexBuffer(r,Fs.members),this.tileExtentSegments=ct.simpleSegment(0,0,4,2);let i=new ho;i.emplaceBack(0,0),i.emplaceBack(R,0),i.emplaceBack(0,R),i.emplaceBack(R,R),this.debugBuffer=t.createVertexBuffer(i,Fs.members),this.debugSegments=ct.simpleSegment(0,0,4,5);let n=new fz;n.emplaceBack(0,0,0,0),n.emplaceBack(R,0,R,0),n.emplaceBack(0,R,0,R),n.emplaceBack(R,R,R,R),this.rasterBoundsBuffer=t.createVertexBuffer(n,KV.members),this.rasterBoundsSegments=ct.simpleSegment(0,0,4,2);let a=new ho;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,Fs.members),this.viewportSegments=ct.simpleSegment(0,0,4,2);let o=new Cz;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new yn;s.emplaceBack(1,0,2),s.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.tileExtentMesh=new hc(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);let l=new ho;l.emplaceBack(-1,-1),l.emplaceBack(1,-1),l.emplaceBack(1,1),l.emplaceBack(-1,1);let u=new yn;u.emplaceBack(0,1,2),u.emplaceBack(0,2,3),this.skyMesh=new hc(t.createVertexBuffer(l,Fs.members),t.createIndexBuffer(u),ct.simpleSegment(0,0,l.length,u.length))}_renderTilesDepthBuffer(t){let r=this.context,i=r.gl,n=t.transform,a=t.useProgram("depth"),o=t.getDepthModeFor3D(),s=Cc(n,{tileSize:n.tileSize});for(let l of s){let u=t.getTerrainDataForTile(l),c=t.getMeshFromTileID(l.canonical,!0,!0,"raster"),h=t.getProjectionDataForTile(l);a.draw(r,i.TRIANGLES,o,Ie.disabled,vt.disabled,ke.backCCW,null,u,h,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}render(t,r,i){if(this.context.gl.isContextLost())return;let n=new Wq({transform:r,terrain:t.map.terrain??null,data:i,context:this.context,programCache:this.programCache,currentPass:"offscreen",projection:t.projection});this.lineAtlas=t.lineAtlas,this.patternAtlas=t.patternAtlas,VU(this.context.frameUniformBuffer,r,i),t.imageManager.beginFrame(),OU(this.context);let a=t._order,o=t.tileManagers,s={},l={},u={};for(let h in o){let p=o[h];p.used&&p.prepare(this.context),s[h]=p.getVisibleCoordinates(!1),l[h]=s[h].slice().reverse(),u[h]=p.getVisibleCoordinates(!0).reverse()}n.opaquePassCutoff=1/0;for(let h=0;h<a.length;h++){let p=a[h];if(t._layers[p].is3D()){n.opaquePassCutoff=h;break}}this.maybeDrawDepth(n),this.renderToTexture&&(this.renderToTexture.prepareForRender(t,r.zoom,i.moving),n.opaquePassCutoff=0),n.currentPass="offscreen";for(let h of a){let p=t._layers[h];if(!p.hasOffscreenPass()||p.isHidden(r.zoom))continue;let d=l[p.source];(p.type==="custom"||d.length)&&this.renderLayer(this,o[p.source],p,d,n)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?he.black:he.transparent,depth:1}),n.clearStencil(),i.sky&&this.drawFunctions.sky(this.skyMesh,n),n.setDepthRangeFor3D(t._order.length),!this.renderToTexture)for(n.currentPass="opaque",n.currentLayer=a.length-1;n.currentLayer>=0;n.currentLayer--){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source],d=s[h.source];n.renderTileClippingMasks(h,d),this.renderLayer(this,p,h,d,n)}n.currentPass="translucent";let c=!1;for(n.currentLayer=0;n.currentLayer<a.length;n.currentLayer++){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source];if(this.renderToTexture?.renderLayer(h,t,n))continue;!n.opaquePassEnabledForLayer()&&!c&&(c=!0,i.isRenderingGlobe&&!n.terrain&&this._renderTilesDepthBuffer(n));let d=(h.type==="symbol"?u:l)[h.source];n.renderTileClippingMasks(h,s[h.source]),this.renderLayer(this,p,h,d,n)}if(i.isRenderingGlobe&&this.drawFunctions.atmosphere(this.skyMesh,n),i.showTileBoundaries){let h=Bq(t,r.zoom);h&&this.drawFunctions.debug(this,h,h.getVisibleCoordinates(),n)}i.showPadding&&this.drawFunctions.debugPadding(n),this.renderToTexture&&!i.moving&&this.clearRTTPool(),this.context.setDefault()}markTerrainDepthDirty(){this.terrainFacilitator.depthDirty=!0}maybeDrawDepth(t){if(!t.data.projectionShaderVariant||!t.terrain)return;let r=this.terrainFacilitator.matrix,i=t.transform.modelViewProjectionMatrix,n=this.terrainFacilitator.depthDirty;n||(n=!eI(r,i)),n||(n=t.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),n&&(YM(r,i),this.terrainFacilitator.renderTime=Be(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,t.terrain,t))}renderLayer(t,r,i,n,a){if(i.isHidden(a.transform.zoom)||i.type!=="background"&&i.type!=="custom"&&!(n||[]).length)return;let o=this.drawFunctions;wC(i)?o.symbol(t,r,i,n,a):Qz(i)?o.circle(r,i,n,a):r9(i)?o.heatmap(t,r,i,n,a):CF(i)?o.line(t,r,i,n,a):$9(i)?o.fill(t,r,i,n,a):dF(i)?o.fillExtrusion(r,i,n,a):o9(i)?o.hillshade(t,r,i,n,a):h9(i)?o.colorRelief(t,r,i,n,a):my(i)?o.raster(r,i,n,a):SL(i)?o.background(t,r,i,n,a):Ef(i)&&o.custom(t,r,i,n,a)}saveTileTexture(t){let r=this._tileTextures[t.size[0]];r?r.length<vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?r.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let r=this._tileTextures[t];return r&&r.length>0?r.pop():null}acquireRTT(t){let r=this.context.gl,i=this._rttObjectRecyclePool.pop();if(i)return i.size!==t&&(i.texture.update({width:t,height:t,data:null},{premultiply:!1,useMipmap:!0}),i.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),i.size=t),i;let n=new Ot(this.context,{width:t,height:t,data:null},r.RGBA,{premultiply:!1,useMipmap:!0});return n.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:n,size:t}}bindRTT(t){let r=this.context.gl,i=t.size;if(!this._rttSharedFbo){let n=this.context.createFramebuffer(i,i,!0,!0),a=this.context.createRenderbuffer(r.DEPTH_STENCIL,i,i);n.depthAttachment.set(a),this._rttSharedFbo={fbo:n,depthRenderbuffer:a,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,i,i),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=i,this._rttSharedFbo.fbo.height=i,this._rttSharedFbo.size=i),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}clearRTTPool(){for(let t of this._rttObjectRecyclePool)t.texture.destroy();this._rttObjectRecyclePool.length=0}destroyRTTResources(){if(this.clearRTTPool(),!this._rttSharedFbo)return;this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new Ot(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let r=this._tileTextures[t];if(r)for(let i of r)i.destroy()}this._tileTextures={}}this.destroyRTTResources(),this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.skyMesh?.destroy(),this.skyMesh=null,this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.destroy(),this.programCache.destroy(),this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:r}=this.context.gl;return this.width!==t||this.height!==r}},vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,vo),Xq=class extends Error{constructor(e,t){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=t?.statusMessage??null}};function Xv(e,t){let r=!1,i=null,n,a=()=>{i=null,r&&(r=(e(...n),i=setTimeout(a,t),!1))};return(...o)=>(r=!0,n=o,i||a(),i)}var Kq=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):([...t.keys()][0]??"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let r=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:r,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let a=Array.from(t.keys());a.length>0&&t.delete(a[0])}let r=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=r?`#${r}`:"",n=window.location.href.replace(/(#.+)?$/,i);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Xv(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),r=Math.round(this._map.getZoom()*100)/100,i=tF(this._map._camera.transform.worldCoordinateHelper,t),n=10**Math.ceil((r*Math.LN2+Math.log(512/i/.5))/Math.LN10),a=Math.round(t.lng*n)/n,o=Math.round(t.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=e?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(u+=`/${Math.round(s*10)/10}`),l&&(u+=`/${Math.round(l)}`),this._hashName){let c=this._getHashParams();return c.set(this._hashName,u),`#${decodeURIComponent(c.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${u}`}_isValidHash(e){if(e.length<3||e.some(n=>isNaN(+n)))return!1;try{new H(+e[2],+e[1])}catch{return!1}let t=+e[0],r=+(e[3]||0),i=+(e[4]||0);return t>=this._map.getMinZoom()&&t<=this._map.getMaxZoom()&&r>=-180&&r<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}},Pc={linearity:.3,easing:F_(0,0,.3,1)},Qq=J({deceleration:2500,maxSpeed:1400},Pc),Jq=J({deceleration:20,maxSpeed:1400},Pc),eG=J({deceleration:1e3,maxSpeed:360},Pc),tG=J({deceleration:1e3,maxSpeed:90},Pc),rG=J({deceleration:1e3,maxSpeed:360},Pc),iG=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Be(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=Be();for(;e.length>0&&t-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,t=Be()-60,r=Math.max(0,e.length-2);for(;r>0&&e[r-1].time>=t;)r--;return e.slice(r)}_onMoveEnd(e){this._drainInertiaBuffer();let t=this._getVelocityEntries();if(t.length<2){this.clear();return}let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new k(0,0),pinchAround:void 0,around:void 0};for(let{settings:a}of t)a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround);for(let{settings:a}of t.slice(1))r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,r.roll+=a.rollDelta||0,a.panDelta&&r.pan._add(a.panDelta);if(!r.pan.mag()&&!r.zoom&&!r.bearing&&!r.pitch&&!r.roll){this.clear();return}let i=Be()-t[0].time,n={};if(r.pan.mag()){let a=Cu(r.pan.mag(),i,J({},Qq,e||{})),o=r.pan.mult(a.amount/r.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(o,this._map._camera.transform);n.center=s.easingCenter,n.offset=s.easingOffset,Eu(n,a)}if(r.zoom){let a=Cu(r.zoom,i,Jq);n.zoom=Jr(this._map.getZoom()+a.amount,this._map.getZoomSnap(),a.amount),Eu(n,a)}if(r.bearing){let a=Cu(r.bearing,i,eG);n.bearing=this._map.getBearing()+Q(a.amount,-179,179),Eu(n,a)}if(r.pitch){let a=Cu(r.pitch,i,tG);n.pitch=this._map.getPitch()+a.amount,Eu(n,a)}if(r.roll){let a=Cu(r.roll,i,rG);n.roll=this._map.getRoll()+Q(a.amount,-179,179),Eu(n,a)}if(n.zoom||n.bearing){let a=r.pinchAround===void 0?r.around:r.pinchAround;n.around=a?this._map.unproject(a):this._map.getCenter()}return this.clear(),J(n,{noMoveStart:!0})}};function Eu(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Cu(e,t,r){let{maxSpeed:i,linearity:n,deceleration:a}=r,o=Q(e*n/(t/1e3),-i,i),s=Math.abs(o)/(a*n);return{easing:r.easing,duration:s*1e3,amount:s/2*o}}var nG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new YI(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new ei(e.type,this._map,e))}mouseup(e){this._map.fire(new ei(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new ei(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ei(e.type,this._map,e))}mouseover(e){this._map.fire(new ei(e.type,this._map,e))}mouseout(e){this._map.fire(new ei(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Dp(e.type,this._map,e))}touchmove(e){this._map.fire(new Dp(e.type,this._map,e))}touchend(e){this._map.fire(new Dp(e.type,this._map,e))}touchcancel(e){this._map.fire(new Dp(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},aG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent,this._clearLongPress(),this._touchActive=!1}mousemove(e){this._map.fire(new ei(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ei("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}touchstart(e,t,r){if(this._clearLongPress(),this._touchActive=r.length>0,r.length!==1)return;this._longPressStart=t[0];let i=r[0];this._longPressTimer=setTimeout(()=>{this._longPressTimer=void 0;let n=new MouseEvent("contextmenu",{clientX:i.clientX,clientY:i.clientY,button:2,bubbles:!0,cancelable:!0});this._map.fire(new ei("contextmenu",this._map,n))},500)}touchmove(e,t,r){this._longPressTimer&&(r.length!==1||!this._longPressStart||t[0].dist(this._longPressStart)>this._clickTolerance)&&this._clearLongPress()}touchend(){this._touchActive=!1,this._clearLongPress()}touchcancel(){this._touchActive=!1,this._clearLongPress()}_clearLongPress(){this._longPressTimer&&(this._longPressTimer=(clearTimeout(this._longPressTimer),void 0)),this._longPressStart=void 0}contextmenu(e){this._touchActive?e.preventDefault():(this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ei(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault())}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},oG=class{constructor(e,t,r){this._map=e,this._tr=r,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&typeof t.boxZoom=="object"&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(ht.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=r,this._box||(this._box=ht.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let n=Math.min(i.x,r.x),a=Math.max(i.x,r.x),o=Math.min(i.y,r.y),s=Math.max(i.y,r.y);this._box.style.transform=`translate(${n}px,${o}px)`,this._box.style.width=`${a-n}px`,this._box.style.height=`${s-o}px`}mouseupWindow(e,t){if(!this._active||e.button!==0)return;let r=this._startPos,i=t;if(this.reset(),ht.suppressClick(),r.x===i.x&&r.y===i.y)this._fireEvent("boxzoomcancel",e);else{if(this._map.fire(new e5("boxzoomend",{originalEvent:e})),this._boxZoomEnd){this._boxZoomEnd(this._map,r,i,e);return}return{cameraAnimation:n=>n.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),ht.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new e5(e,{originalEvent:t}))}};function C_(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let r={};for(let i=0;i<e.length;i++)r[e[i].identifier]=t[i];return r}function sG(e){let t=new k(0,0);for(let r of e)t._add(r);return t.div(e.length)}var lG=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=sG(t),this.touches=C_(r,t)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;let i=C_(r,t);for(let n in this.touches){let a=this.touches[n],o=i[n];(!o||o.dist(a)>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),r.length===0){let i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}},P_=class{constructor(e){this.singleTap=new lG(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){let i=this.singleTap.touchend(e,t,r);if(i){let n=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(i)<30;if((!n||!a)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}},uG=class{constructor(e,t){this._tr=t,this._zoomIn=new P_({numTouches:1,numTaps:2}),this._zoomOut=new P_({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){let i=this._zoomIn.touchend(e,t,r),n=this._zoomOut.touchend(e,t,r),a=this._tr;if(i)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom+1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(i)?a.unproject(i):void 0},{originalEvent:e})};if(n)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom-1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(n)?a.unproject(n):void 0},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},kf=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._startPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._startPoint=Array.isArray(t)?t[0]:t,this._lastPoint=this._startPoint,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let i=Array.isArray(t)?t[0]:t;if(!(!this._moved&&i.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=i,this._move(r,i,this._startPoint)}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&ht.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}},cG={0:1,2:2};function hG(e,t){let r=cG[t];return e.buttons===void 0||(e.buttons&r)!==r}var zf=class{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=e.button}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!hG(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}};function Kv(e,t,r){return t==="center"||!(e.bearingDelta||e.pitchDelta||e.rollDelta)?e:{...e,around:r}}var Ff=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=t=>{t.preventDefault()}};function pG({enable:e,clickTolerance:t}){return new kf({clickTolerance:t,move:(r,i)=>({around:i,panDelta:i.sub(r)}),activateOnStart:!0,moveStateManager:new zf({checkCorrectEvent:r=>r.button===0&&!r.ctrlKey}),enable:e,assignEvents:Ff})}function dG({enable:e,clickTolerance:t,minPixelCenterThreshold:r=100,rotateSpeed:i=.8},n,a,o){return new kf({clickTolerance:t,move:(s,l,u)=>{if(a?.()==="pointer")return Kv({bearingDelta:(l.x-s.x)*i},"pointer",u);let c=n(),h=(o?.()??"circular")==="circular";if(h&&Math.abs(c.y-s.y)>r)return{bearingDelta:RI(new k(s.x,l.y),l,c)};let p=(l.x-s.x)*i;return h&&l.y<c.y&&(p=-p),{bearingDelta:p}},moveStateManager:new zf({checkCorrectEvent:s=>s.button===0&&s.ctrlKey||s.button===2&&!s.ctrlKey}),enable:e,assignEvents:Ff})}function fG({enable:e,clickTolerance:t,pitchSpeed:r=-.5},i){return new kf({clickTolerance:t,move:(n,a,o)=>Kv({pitchDelta:(a.y-n.y)*r},i?.()??"center",o),moveStateManager:new zf({checkCorrectEvent:n=>n.button===0&&n.ctrlKey||n.button===2}),enable:e,assignEvents:Ff})}function mG({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:r=.3},i,n){return new kf({clickTolerance:t,move:(a,o,s)=>{let l=i(),u=(o.x-a.x)*r;return o.y<l.y&&(u=-u),Kv({rollDelta:u},n?.()??"center",s)},moveStateManager:new zf({checkCorrectEvent:a=>a.button===2&&a.ctrlKey}),enable:e,assignEvents:Ff})}var gG=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new k(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active)if(this._shouldBePrevented(r.length))this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e);else return e.preventDefault(),this._calculateTransform(e,t,r)}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,r){r.length>0&&(this._active=!0);let i=C_(r,t),n=new k(0,0),a=new k(0,0),o=0;for(let l in i){let u=i[l],c=this._touches[l];c&&(n._add(u),a._add(u.sub(c)),o++,i[l]=u)}if(this._touches=i,this._shouldBePrevented(o)||!a.mag())return;let s=a.div(o);if(this._sum._add(s),!(this._sum.mag()<this._clickTolerance))return{around:n.div(o),panDelta:s}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},Qv=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);a&&o||(this._active&&ht.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function ed(e,t,r){for(let i=0;i<e.length;i++)if(e[i].identifier===r)return t[i]}var Q6=.1;function J6(e,t){return Math.log(e/t)/Math.LN2}var yG=class extends Qv{constructor(){super(),this._zoomRate=1,this._zoomThreshold=Q6}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??Q6}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let r=this._distance;if(this._distance=e[0].dist(e[1]),!(!this._active&&Math.abs(J6(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:J6(this._distance,r)*this._zoomRate,pinchAround:t}}};function eT(e,t){return e.angleWith(t)*180/Math.PI}var _G=class extends Qv{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,r){let i=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:eT(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,r=eT(e,this._startVector);return Math.abs(r)<t}};function $1(e){return Math.abs(e.y)>Math.abs(e.x)}var vG=class extends Qv{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,$1(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let i=e[0].sub(this._lastPoints[0]),n=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}}gestureBeginsVertically(e,t,r){if(this._valid!==void 0)return this._valid;let i=e.mag()>=2,n=t.mag()>=2;if(!i&&!n)return;if(!i||!n)return this._firstMove===void 0&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return $1(e)&&$1(t)&&a}},xG={panStep:100,bearingStep:15,pitchStep:10},bG=class{constructor(e,t){this._tr=t;let r=xG;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,i=0,n=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:wG,zoom:t?Jr(s.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+i*this._pitchStep,offset:[-n*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}};function wG(e){return e*(2-e)}var tT=4.000244140625,TG=class{constructor(e,t,r){this._onTimeout=i=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},this._map=e,this._tr=r,this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);return}let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,r=Be(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,t!==0&&t%tT==0?this._type="wheel":t!==0&&Math.abs(t)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let t=ht.mousePos(this._map.getCanvas(),e),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(H.convert(r.center)):t,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let o=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=o),typeof this._targetZoom=="number"&&(this._targetZoom+=o)}if(this._delta!==0){let o=this._type==="wheel"&&Math.abs(this._delta)>tT?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*o)));this._delta<0&&s!==0&&(s=1/s);let l=typeof this._targetZoom=="number"?Bt(this._targetZoom):e.scale,u=e.applyConstrain(e.getCameraLngLat(),Ut(l*s)).zoom,c=this._map.getZoomSnap();if(this._type==="wheel"&&c>0){let h=Jr(e.zoom,c);this._targetZoom=Jr(u,c,u-h)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,r=this._startZoom,i=this._easing,n=!1,a;if(this._type==="wheel"&&r&&i){let o=Be()-this._lastWheelEventTime,s=Math.min((o+5)/200,1),l=i(s);a=ot.number(r,t,l),s<1?this._needsRerender=!0:n=!0}else a=t,n=!0;return this._active=!0,n&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!n,zoomDelta:a-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=Q1;if(this._prevEase){let r=this._prevEase,i=(Be()-r.start)/r.duration,n=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(n*n+1e-4)*.01;t=F_(a,Math.sqrt(.0729-a*a),.25,1)}return this._prevEase={start:Be(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},SG=class{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}},EG=class{constructor(e,t){this._tr=t,this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:Jr(this._tr.zoom+(e.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.transform.isPointOnMapSurface(t)?this._tr.unproject(t):void 0},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},CG=class{constructor(){this._tap=new P_({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,t,r);else{let i=t[0],n=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(i)<30;!n||!a?this.reset():r.length>0&&(this._swipePoint=i,this._swipeTouch=r[0].identifier)}}touchmove(e,t,r){if(!this._tapTime)this._tap.touchmove(e,t,r);else if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128*this._zoomRate}}}touchend(e,t,r){if(this._tapTime)this._swipePoint&&r.length===0&&this.reset();else{let i=this._tap.touchend(e,t,r);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},PG=class{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},DG=class{constructor(e,t,r,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=r,this._mouseRoll=i;let{aroundCenter:n=!0}=e;this._defaultMovement=n?"circular":"linear",this.around="center",this.movement=this._defaultMovement}enable(e){let t=typeof e=="object"?e:{};this.around=t.around??"center",this.movement=t.around==="pointer"?"linear":t.movement??this._defaultMovement,this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},AG=class{constructor(e,t,r,i){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},MG=class{constructor(e,t){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=ht.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=r,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,t){this._enabled&&(this._map.fire(new Wt("cooperativegestureprevented",{gestureType:e,originalEvent:t})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},IG=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(k.convert(e),this._camera.terrain)}},td=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,kG=class extends Ao{};function q1(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}var zG=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,t,r){this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._rotationPivot=null,this.handleWindowEvent=n=>{this.handleEvent(n,`${n.type}Window`)},this.handleEvent=(n,a)=>{if(n.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let o=n.type==="renderFrame"?void 0:n,s={needsRenderFrame:!1},l={},u={};for(let{handlerName:p,handler:d,allowed:f}of this._handlers){if(!d.isEnabled())continue;let m;if(this._blockedByActive(u,f,p))d.reset();else if(d[a||n.type]){if(BI(n,a||n.type)){let _=ht.mousePos(this._map.getCanvas(),n);m=d[a||n.type](n,_)}else if(LI(n,a||n.type)){let _=n.touches,g=this._getMapTouches(_),y=ht.touchPos(this._map.getCanvas(),g);m=d[a||n.type](n,y,g)}else OI(a||n.type)||(m=d[a||n.type](n));this.mergeHandlerResult(s,l,m,p,o),m?.needsRenderFrame&&this._triggerRenderFrame()}(m||d.isActive())&&(u[p]=d)}let c={};for(let p in this._previousActiveHandlers)u[p]||(c[p]=o);this._previousActiveHandlers=u,(Object.keys(c).length||q1(s))&&(this._changes.push([s,l,c]),this._triggerRenderFrame()),(Object.keys(u).length||q1(s))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=s;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._camera=t,this._transformProvider=new IG(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iG(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[n,a,o]of this._listeners)n.addEventListener(a,n===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(let[e,t,r]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){let t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new nG(t,e));let i=t.boxZoom=new oG(t,e,this._transformProvider);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let n=t.cooperativeGestures=new MG(t,e.cooperativeGestures);this._add("cooperativeGestures",n),e.cooperativeGestures&&n.enable();let a=new uG(t,this._transformProvider),o=new EG(t,this._transformProvider);t.doubleClickZoom=new SG(o,a),this._add("tapZoom",a),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new CG;this._add("tapDragZoom",s);let l=t.touchPitch=new vG(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=()=>this._camera.transform.centerPoint,c=()=>t.dragRotate.around,h=dG(e,u,c,()=>t.dragRotate.movement),p=fG(e,c),d=mG(e,u,c);t.dragRotate=new DG(e,h,p,d),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",p,["mouseRotate","mouseRoll"]),this._add("mouseRoll",d,["mousePitch"]),e.interactive&&e.dragRotate&&t.dragRotate.enable(e.dragRotate);let f=pG(e),m=new gG(e,t);t.dragPan=new PG(r,f,m),this._add("mousePan",f),this._add("touchPan",m,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let _=new _G,g=new yG;t.touchZoomRotate=new AG(r,g,_,s),this._add("touchRotate",_,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new aG(t,e),["touchPan"]);let y=t.scrollZoom=new TG(t,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let v=t.keyboard=new bG(t,this._transformProvider);this._add("keyboard",v),e.interactive&&e.keyboard&&t.keyboard.enable()}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!td(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,r){for(let i in e)if(i!==r&&!t?.includes(i))return!0;return!1}_getMapTouches(e){let t=[];for(let r of e){let i=r.target;this._el.contains(i)&&t.push(r)}return t}mergeHandlerResult(e,t,r,i,n){if(!r)return;J(e,r);let a={handlerName:i,originalEvent:r.originalEvent||n};r.zoomDelta!==void 0&&(t.zoom=a),r.panDelta!==void 0&&(t.drag=a),r.rollDelta!==void 0&&(t.roll=a),r.pitchDelta!==void 0&&(t.pitch=a),r.bearingDelta!==void 0&&(t.rotate=a)}_applyChanges(){let e={},t={},r={};for(let[i,n,a]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new k(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),J(t,n),J(r,a);this._updateMapTransform(e,t,r),this._changes=[]}_updateMapTransform(e,t,r){let i=this._map.terrain;if(!q1(e)){this._fireEvents(t,r,!0);return}let n=this._camera.getTransformForUpdate();if(this._camera.stop(!0),this._turnsAroundPivot(e,t)){this._orbitRotationPivot(n,e,i),this._commitFrame(n,e,t,r);return}let{panDelta:a,zoomDelta:o,bearingDelta:s,pitchDelta:l,rollDelta:u}=e;o>0&&this._terrainGesture.inFlight&&this._camera.moveCenterOntoTerrain(n,o);let{around:c,aroundOnSurface:h}=this._resolveAround(e,i,n),p=i?this._terrainGestureElevation(i,c,h,n,t):void 0,d={panDelta:a,zoomDelta:o,rollDelta:u,pitchDelta:l,bearingDelta:s,around:c,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(c)&&(c=n.centerPoint);let f=this._computePreZoomAroundLoc(n,c,a,p);this._handleMapControls({terrain:i,tr:n,deltasForHelper:d,preZoomAroundLoc:f,combinedEventsInProgress:t,panDelta:a}),this._commitFrame(n,e,t,r)}_commitFrame(e,t,r,i){this._camera.applyUpdatedTransform(e),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,i,!0)}_turnsAroundPivot(e,t){return e.around?!t.drag&&!t.zoom:!1}_orbitRotationPivot(e,t,r){r&&!this._terrainGesture.inFlight&&(this._terrainGesture.inFlight=!0,this._camera.holdElevation(e,"gesture"));let{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l}=t;this._rotationPivot??(this._rotationPivot=this._camera.captureRotationPivot(e,l)),this._camera.orbitRotationPivot(e,this._rotationPivot,{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l})||(this._rotationPivot=null)}_resolveAround(e,t,r){let i=e.pinchAround===void 0?e.around:e.pinchAround;return i||(i=this._camera.transform.centerPoint),t&&!r.isPointOnMapSurface(i)?{around:r.centerPoint,aroundOnSurface:!1}:{around:i,aroundOnSurface:!0}}_terrainGestureElevation(e,t,r,i,n){if(!r)return;if(this._terrainGesture.anchorCenterElevation!==i.elevation&&(n.drag||n.zoom)){let o=i.screenTerrainPointToMercatorCoordinate(t,e);this._terrainGesture.anchorElevation=o?o.z:void 0,this._terrainGesture.anchorCenterElevation=i.elevation}let a=this._terrainGesture.anchorElevation;if(a!=null&&!(t.distSqr(i.centerPoint)<.01)&&!(a-i.elevation>=.9*(i.getCameraAltitude()-i.elevation)))return a}_computePreZoomAroundLoc(e,t,r,i){if(t.distSqr(e.centerPoint)<.01)return e.center;let n=r?t.sub(r):t;return i===void 0?e.screenPointToLocation(n):e.screenPointToLocationAtElevation(n,i)}_handleMapControls({terrain:e,tr:t,deltasForHelper:r,preZoomAroundLoc:i,combinedEventsInProgress:n,panDelta:a}){let o=this._camera.cameraHelper;o.handleMapControlsRollPitchBearingZoom(r,t),!e&&!o.useGlobeControls&&!t.isPointOnMapSurface(r.around)?a&&t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):e?this._terrainGesture.inFlight?!o.useGlobeControls&&r.aroundElevation===void 0&&n.drag&&a?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):o.handleMapControlsPan(r,t,i):(this._terrainGesture.inFlight=!0,this._camera.holdElevation(t,"gesture"),o.handleMapControlsPan(r,t,i)):o.handleMapControlsPan(r,t,i)}_fireEvents(e,t,r){let i=td(this._eventsInProgress),n=td(e),a={};for(let c in e){let{originalEvent:h}=e[c];this._eventsInProgress[c]||(a[`${c}start`]=h),this._eventsInProgress[c]=e[c]}!i&&n&&this._fireEvent("movestart",n.originalEvent);for(let c in a)this._fireEvent(c,a[c]);n&&this._fireEvent("move",n.originalEvent);for(let c in e){let{originalEvent:h}=e[c];this._fireEvent(c,h)}let o={},s;for(let c in this._eventsInProgress){let{handlerName:h,originalEvent:p}=this._eventsInProgress[c];this._handlersById[h].isActive()||(delete this._eventsInProgress[c],s=t[h]||p,o[`${c}end`]=s)}for(let c in o)this._fireEvent(c,o[c]);let l=td(this._eventsInProgress),u=(i||n)&&!l;if(u&&this._terrainGesture.inFlight){let c=this._camera.releaseElevation();this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._camera.applyTransformChange(h=>{this._map.getCenterClampedToGround()&&(this._map.terrain?this._camera.putCenterBackOnTerrain(h,this._map.terrain,c):h.setElevation(0))})}if(r&&u){this._updatingCamera=!0;let c=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),h=p=>p!==0&&-this._bearingSnap<p&&p<this._bearingSnap;c&&(c.essential||!Nr.prefersReducedMotion)?(h(c.bearing||this._map.getBearing())&&(c.bearing=0),c.freezeElevation=!0,this._map.easeTo(c,{originalEvent:s})):(this._fireEvent("moveend",s),h(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}u&&(this._rotationPivot=null)}_fireEvent(e,t){this._camera.fire(new ne(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new kG("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},FG=class{constructor(e,t,r){this.holder=e,this.lift=null,this._terrainChanged=!1,this._dem=t?"awaiting":"loaded",this.keepsTerrainBelowMaxZoomForCenter=r}get tookDem(){return this._dem==="taken"}noteTerrainChange(){this._terrainChanged=!0}take(e,t){let r=!1;if(this._terrainChanged&&(this._terrainChanged=!1,t.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded"&&(e.setElevation(0),this._dem="awaiting",r=!0)),this._dem!=="awaiting")return r;let i=t.getDrawnElevationForLngLat(e.center,!0);if(i!==void 0)return e.setElevation(i),this._dem="taken",!0;let n=t.getDrawnElevationForLngLat(e.center);return n===void 0||n===e.elevation?r:(e.setElevation(n),!0)}},rT=.01,RG=class extends lr{constructor(e){super(),this._elevationHold=null,this._renderFrameCallback=()=>{let t=Math.min((Be()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=fd(),this.cameraHelper=new qu,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=e.centerClampedToGround??!0,this.transformCameraUpdate=e.transformCameraUpdate??null,this._stopHandlers=e.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}setTerrain(e){this.terrain=e,e&&this._elevationHold?.noteTerrainChange(),this.applyTerrainChange()}migrateProjection(e,t){if(e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t,this._requestedCameraState){let r=e.clone();r.apply(this._requestedCameraState,!0),this._requestedCameraState=r}}getCenter(){return new H(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,t,r){return e=k.convert(e).mult(-1),this.panTo(this.transform.center,J({offset:e},t),r)}panTo(e,t,r){return this.easeTo(J({center:e},t),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,r){return this.easeTo(J({zoom:e},t),r)}zoomIn(e,t){return this.zoomTo(Jr(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(Jr(this.getZoom()-1,this._zoomSnap),e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return e!=this.transform.fov&&(this.applyTransformChange(r=>r.setFov(e)),this.fire(new ne("movestart",t)).fire(new ne("move",t)).fire(new ne("moveend",t))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,r){return this.easeTo(J({bearing:e},t),r)}resetNorth(e,t){return this.rotateTo(0,J({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(J({bearing:0,pitch:0,roll:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=Zn.convert(e).adjustAntiMeridian();let r=t?.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,t,r,i){let n={top:0,bottom:0,right:0,left:0};if(i=J({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},i),typeof i.padding=="number"){let p=i.padding;i.padding={top:p,bottom:p,right:p,left:p}}let a=J(n,i.padding);i.padding=a;let o=this.transform,s=new Zn(e,t),l={top:0,bottom:0,right:0,left:0},u=i.absolutePadding?l:a,c=i.absolutePadding?a:J(l,o.padding),h=this.cameraHelper.cameraForBoxAndBearing(i,u,c,s,r,o);if(h)return this._zoomSnap&&(h.zoom=Jr(h.zoom,this._zoomSnap,-1)),i.absolutePadding?{...h,padding:a}:h}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,t,r,i,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(k.convert(e)),this.transform.screenPointToLocation(k.convert(t)),r,i),i,n)}_fitInternal(e,t,r){return e?(t=J(e,t),t.absolutePadding?(t.padding=e.padding,delete t.absolutePadding):delete t.padding,t.linear?this.easeTo(t,r):this.flyTo(t,r)):this}jumpTo(e,t){this.stop(),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=!1,n=!1,a=!1,o=r.zoom;if(this.terrain&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(e.center?H.convert(e.center):r.center,r);u!=="loading"&&r.setElevation(l)}this.cameraHelper.handleJumpToCenterZoom(r,e);let s=r.zoom!==o;return e.elevation!==void 0&&r.elevation!==+e.elevation&&r.setElevation(+e.elevation),e.bearing!==void 0&&r.bearing!==+e.bearing&&(i=!0,r.setBearing(+e.bearing)),e.pitch!==void 0&&r.pitch!==+e.pitch&&(n=!0,r.setPitch(+e.pitch)),e.roll!==void 0&&r.roll!==+e.roll&&(a=!0,r.setRoll(+e.roll)),e.padding!=null&&!r.isPaddingEqual(e.padding)&&r.setPadding(e.padding),this.applyUpdatedTransform(r),this.fire(new ne("movestart",t)).fire(new ne("move",t)),s&&this.fire(new ne("zoomstart",t)).fire(new ne("zoom",t)).fire(new ne("zoomend",t)),i&&this.fire(new ne("rotatestart",t)).fire(new ne("rotate",t)).fire(new ne("rotateend",t)),n&&this.fire(new ne("pitchstart",t)).fire(new ne("pitch",t)).fire(new ne("pitchend",t)),a&&this.fire(new ne("rollstart",t)).fire(new ne("roll",t)).fire(new ne("rollend",t)),this.fire(new ne("moveend",t))}calculateAnchoredCameraOptions(e){let t=this.transform.clone(),r=H.convert(e.anchorLocation),i=k.convert(e.anchorScreenPoint),n={panDelta:i.sub(this.transform.locationToScreenPoint(r,this.terrain)),zoomDelta:e.zoom===void 0?0:e.zoom-t.zoom,bearingDelta:0,pitchDelta:0,rollDelta:0,around:i,aroundElevation:this.terrain?.getElevationForLngLat(r,t)};return this.cameraHelper.handleMapControlsRollPitchBearingZoom(n,t),this.cameraHelper.handleMapControlsPan(n,t,r),{center:t.center,zoom:t.zoom}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){let a=this.transform.calculateCenterFromCameraLngLatAlt(e,t,r,i);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:r,pitch:i,roll:n}}easeTo(e,t){this._stop(!1,e.easeId),e=J({offset:[0,0],duration:500,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap)),(e.animate===!1||!e.essential&&Nr.prefersReducedMotion)&&(e.duration=0);let r=this.getTransformForUpdate(),i=this.getBearing(),n=r.pitch,a=r.roll,o=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),s=e.pitch===void 0?n:+e.pitch,l=e.roll===void 0?a:this._normalizeBearing(e.roll,a),u=e.padding===void 0?r.padding:e.padding,c=k.convert(e.offset),h,p;e.around&&(h=H.convert(e.around),p=r.locationToScreenPoint(h));let d={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(r,{bearing:o,pitch:s,roll:l,padding:u,around:h,aroundPoint:p,offsetAsPoint:c,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating||(this._rotating=i!==o),this._pitching||(this._pitching=s!==n),this._rolling||(this._rolling=l!==a),this._padding=!r.isPaddingEqual(u),this._zooming||(this._zooming=f.isZooming),this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,d,{tr:r,center:f.elevationCenter,freeze:e.freezeElevation}),this._ease(m=>{f.easeFunc(m),this.terrain&&!e.freezeElevation&&this._updateElevation(m,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},m=>{this._afterEase(t,m,e.freezeElevation)},e),this}_prepareEase(e,t,r={},i){this._moving=!0,this.terrain&&i&&(this._prepareElevation(i.center,i.tr),i.freeze&&this.holdElevation(i.tr,"animation")),!t&&!r.moving&&this.fire(new ne("movestart",e)),this._zooming&&!r.zooming&&this.fire(new ne("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new ne("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new ne("pitchstart",e)),this._rolling&&!r.rolling&&this.fire(new ne("rollstart",e))}_prepareElevation(e,t){this._elevationCenter=e,this._elevationStart=t.elevation;let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(e,t);this._elevationTarget=i==="loading"?t.elevation:r,this.elevationFreeze=!0}_updateElevation(e,t){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(t.center,t),t.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,t.tileZoom));let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(this._elevationCenter,t),n=i==="loading"?this._elevationTarget:r;if(e<1&&n!==this._elevationTarget){let a=this._elevationTarget-this._elevationStart,o=(n-(a*e+this._elevationStart))/(1-e);this._elevationStart+=e*(a-o),this._elevationTarget=n}this.getCenterClampedToGround()&&t.setElevation(ot.number(this._elevationStart,this._elevationTarget,e))}holdElevation(e,t){this.elevationFreeze=!0;let r=!!this.terrain&&this.getCenterClampedToGround()&&this.terrain.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded",i=this.terrain?this._terrainHeightAboveMaxZoomForCenter(e):void 0;this._elevationHold=new FG(t,r,i!==void 0&&i<=rT)}releaseElevation(){let e=this._elevationHold?.tookDem??!1;return this.elevationFreeze=!1,this._elevationHold=null,e}putCenterBackOnTerrain(e,t,r){if(r&&t.getDrawnElevationForLngLat(e.center,!0)===void 0){e.setElevation(t.getElevationForLngLat(e.center,e));let i=this._raiseCameraByPitchAndZoom(e);i!==e&&e.apply(i,!1)}else e.recalculateZoomAndCenter(t)}_takeLandedElevation(e){return!this._elevationHold||!this.terrain||!this.getCenterClampedToGround()?!1:this._elevationHold.take(e,this.terrain)}applyTerrainChange(){if(this.elevationFreeze){let i=this._requestedCameraState;this._elevationHold?.holder==="gesture"&&i&&this._takeLandedElevation(i)&&this.applyUpdatedTransform(i);return}let e=this.transform;if(e.setMinElevationForCurrentTile(this.terrain?this.terrain.getMinTileElevationForLngLatZoom(e.center,e.tileZoom):0),!this.getCenterClampedToGround())return;if(!this.terrain){e.setElevation(0);return}let{elevation:t,demState:r}=this.terrain.getElevationAndDEMStateForLngLat(e.center,e);r!=="loading"&&e.setElevation(t)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState)}_keepCameraAboveTerrain(e){let t=this._elevationHold;if(!this.terrain||!t||e.pitch>=90||!this.getCenterClampedToGround()||e.getClippingPlane())return this._raiseCameraByPitchAndZoom(e);let r=t.holder==="gesture",i=t.lift&&t.lift.heldElevation+t.lift.height===e.elevation?t.lift:{heldElevation:e.elevation,height:0},n=this._terrainHeightAboveMaxZoomForCenter(e);n!==void 0&&n<=rT&&(t.keepsTerrainBelowMaxZoomForCenter=!0);let a=t.keepsTerrainBelowMaxZoomForCenter&&n!==void 0?n:-1/0,o=r?this._terrainHeightAboveCamera(e):-1/0,s=Math.max(0,Math.max(o,a)+i.height);return s!==i.height&&e.setElevation(i.heldElevation+s),t.lift=s>0?{heldElevation:i.heldElevation,height:s}:null,r?e:this._raiseCameraByPitchAndZoom(e)}_raiseCameraByPitchAndZoom(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90||e.getClippingPlane())return e;let t=e.getCameraLngLat(),r=this.terrain?this._terrainHeightAboveCamera(e):-e.getCameraAltitude();if(r<=0)return e;let i=e.clone();for(let n=0;n<3&&r>0;n++){let{zoom:a,pitch:o}=i.calculateCameraOptionsFromTo(t,i.getCameraAltitude()+r,i.center,i.elevation);i.setZoom(a),i.setPitch(o),r=this.terrain?this._terrainHeightAboveCamera(i):-i.getCameraAltitude()}return i}_terrainHeightAboveCamera(e){let t=this.terrain.getElevationForLngLat(e.getCameraLngLat(),e)-e.getCameraAltitude(),r=e.getClippingPlane()?null:this.terrain.getCoverageIndex();if(!r)return t;let[i,n,a,o]=e.getCameraFrustum().points;for(let s=0;s<=2;s++){let l=s/2;for(let u=0;u<=2;u++){let c=u/2,h=(1-c)*(1-l),p=c*(1-l),d=c*l,f=(1-c)*l,m=h*i[0]+p*n[0]+d*a[0]+f*o[0],_=h*i[1]+p*n[1]+d*a[1]+f*o[1],g=h*i[2]+p*n[2]+d*a[2]+f*o[2],y=tl(r,this.terrain.exaggeration,m,_,e.worldCoordinateHelper.wraps);y.covered&&(t=Math.max(t,y.elevation-g))}}return t}_terrainHeightAboveMaxZoomForCenter(e){let t=this.terrain.getCoverageIndex();if(!t)return;let r=e.worldCoordinateHelper,i=e.getCameraLngLat(),n=r.worldFromLngLat(i.lng,i.lat),a=r.worldFromLngLat(e.center.lng,e.center.lat),o=Bt(e.zoom-e.maxZoom),s=tl(t,this.terrain.exaggeration,Ma(n.x,a.x,o),Ma(n.y,a.y,o),r.wraps);return s.covered?s.elevation-Ma(e.getCameraAltitude(),e.elevation,o):void 0}moveCenterOntoTerrain(e,t){if(!this.terrain||!this.getCenterClampedToGround()||e.getClippingPlane())return;let{center:r,elevation:i,zoom:n}=e;e.recalculateZoomAndCenter(this.terrain),(!(e.zoom>n-t&&e.zoom<e.maxZoom)||Math.abs(this.terrain.getElevationForLngLat(e.center,e)-e.elevation)>=1)&&(e.setZoom(n),e.setCenter(r),e.setElevation(i))}captureRotationPivot(e,t){if(!aT(e,t))return{point:e.centerPoint,location:e.center,distance:yd(e,e.center)};let r=this.terrain?e.screenTerrainPointToMercatorCoordinate(t,this.terrain):null,i=r?r.toLngLat():e.screenPointToLocation(t);return r&&this.cameraHelper.useGlobeControls?{point:e.locationToScreenPoint(i),location:i,distance:yd(e,i)}:{point:t,location:i,elevation:r?.z,distance:yd(e,i,r?.z)}}orbitRotationPivot(e,t,r){if(t.point.equals(e.centerPoint))return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!0;let i=this._turnAroundPivot(e,t,r)??this._turnAroundPivot(e,t,{...r,pitchDelta:0,rollDelta:0});return i?(e.apply(i,!1),!0):(this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!1)}_turnAroundPivot(e,t,r){let i=e.clone();return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,i),i.pitch>=90||!aT(i,t.point)?null:LG(i,t)&&BG(i,t)?i:null}applyUpdatedTransform(e){this._takeLandedElevation(e);let t=this._keepCameraAboveTerrain(e);if(!this.transformCameraUpdate){t!==this.transform&&this.transform.apply(t,!1);return}let r=t.clone(),{center:i,zoom:n,roll:a,pitch:o,bearing:s,elevation:l}=this.transformCameraUpdate(r);i&&r.setCenter(i),l!==void 0&&r.setElevation(l),n!==void 0&&r.setZoom(n),a!==void 0&&r.setRoll(a),o!==void 0&&r.setPitch(o),s!==void 0&&r.setBearing(s),this.transform.apply(l===void 0?r:this._raiseCameraByPitchAndZoom(r),!1)}applyTransformChange(e){let t=this._requestedCameraState!==void 0,r=this.getTransformForUpdate();e(r),this.applyUpdatedTransform(r),t||delete this._requestedCameraState}_fireMoveEvents(e){this.fire(new ne("move",e)),this._zooming&&this.fire(new ne("zoom",e)),this._rotating&&this.fire(new ne("rotate",e)),this._pitching&&this.fire(new ne("pitch",e)),this._rolling&&this.fire(new ne("roll",e))}_afterEase(e,t,r=!1){this._takeLandedElevation(this.transform);let i=this.releaseElevation();if(this.terrain&&r&&this.getCenterClampedToGround()&&this.putCenterBackOnTerrain(this.transform,this.terrain,i),this._easeId&&t&&this._easeId===t)return;delete this._easeId;let n=this._zooming,a=this._rotating,o=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,n&&this.fire(new ne("zoomend",e)),a&&this.fire(new ne("rotateend",e)),o&&this.fire(new ne("pitchend",e)),s&&this.fire(new ne("rollend",e)),this.fire(new ne("moveend",e))}flyTo(e,t){if(!e.essential&&Nr.prefersReducedMotion)return this.easeTo(e,t);this.stop(),e=J({offset:[0,0],speed:1.2,curve:1.42,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=r.bearing,n=r.pitch,a=r.roll,o=r.padding,s=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),l=e.pitch===void 0?n:+e.pitch,u=e.roll===void 0?a:this._normalizeBearing(e.roll,a),c=e.padding===void 0?r.padding:e.padding,h=k.convert(e.offset),p=r.centerPoint.add(h),d=r.screenPointToLocation(p),f=this.cameraHelper.handleFlyTo(r,{bearing:s,pitch:l,roll:u,padding:c,locationAtOffset:d,offsetAsPoint:h,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),m=e.curve,_=Math.max(r.width,r.height),g=_/f.scaleOfZoom,y=f.pixelPathLength,v=_/f.scaleOfMinZoom;m=Math.min(m,Math.sqrt(v/y*2));let x=m*m;function b(I){let C=(g*g-_*_+(I?-1:1)*x*x*y*y)/(2*(I?g:_)*x*y);return Math.log(Math.sqrt(C*C+1)-C)}function w(I){return(Math.exp(I)-Math.exp(-I))/2}function T(I){return(Math.exp(I)+Math.exp(-I))/2}function S(I){return w(I)/T(I)}let E=b(!1),P=function(I){return T(E)/T(E+m*I)},D=function(I){return _*((T(E)*S(E+m*I)-w(E))/x)/y},F=(b(!0)-E)/m;if(Math.abs(y)<2e-6||!isFinite(F)){if(Math.abs(_-g)<1e-6)return this.easeTo(e,t);let I=g<_?-1:1;F=Math.abs(Math.log(g/_))/m,D=()=>0,P=C=>Math.exp(I*m*C)}if(e.duration!==void 0)e.duration=+e.duration;else{let I=e.screenSpeed===void 0?+e.speed:+e.screenSpeed/m;e.duration=1e3*F/I}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==s,this._pitching=l!==n,this._rolling=u!==a,this._padding=!r.isPaddingEqual(c),this._prepareEase(t,!1,{},{tr:r,center:f.targetCenter,freeze:e.freezeElevation}),this._ease(I=>{let C=I*F,A=1/P(C),M=D(C);this._rotating&&r.setBearing(ot.number(i,s,I)),this._pitching&&r.setPitch(ot.number(n,l,I)),this._rolling&&r.setRoll(ot.number(a,u,I)),this._padding&&(r.interpolatePadding(o,c,I),p=r.centerPoint.add(h)),f.easeFunc(I,A,M,p),this.terrain&&!e.freezeElevation&&this._updateElevation(I,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},()=>{this._afterEase(t,void 0,e.freezeElevation)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,r){r.animate===!1||r.duration===0?(e(1),t()):(this._easeStart=Be(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=xi(e,-180,180);let r=Math.abs(e-t);return Math.abs(e-360-t)<r&&(e-=360),Math.abs(e+360-t)<r&&(e+=360),e}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};function LG(e,t){let r=1,i=iT(e,t),n=t.distance/i;for(let a=0;a<5&&!nT(i,t);a++){if(!Number.isFinite(n)||n<=0)return!1;let o=e.zoom;e.setZoom(o+Ut(r/n));let s=r*Bt(o-e.zoom);if(s===r)return!0;let l=iT(e,t);n=s+(t.distance-l)*(s-r)/(l-i),r=s,i=l}return nT(i,t)}function iT(e,t){return e.setLocationAtPoint(t.location,t.point,t.elevation),yd(e,t.location,t.elevation)}function nT(e,t){return Math.abs(e/t.distance-1)<1e-7}function BG(e,t){return t.elevation!==void 0||k_(Kd(e.screenPointToLocation(t.point),0),Kd(t.location,0))<t.distance*1e-4}function aT(e,t){return e.isPointOnMapSurface(new k(t.x,t.y-16))}function yd(e,t,r=e.elevation){return k_(Kd(e.getCameraLngLat(),e.getCameraAltitude()),Kd(t,r))}function Kd(e,t){let r=Ft(e);return Xe(r,r,Er+t)}var aD={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'},OG=class{constructor(e=aD){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{t&&(t.type==="terrain"||t.dataType==="style"||t.dataType==="source"&&(t.sourceDataType==="metadata"||t.sourceDataType==="visibility"))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("maplibregl-compact")&&!this._container.classList.contains("maplibregl-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=ht.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ht.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(i=>typeof i=="string"?i:"")):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}let t=this._map.style.tileManagers;for(let i in t){let n=t[i];if(n.used||n.usedForTerrain){let a=n.getSource();a.attribution&&!e.includes(a.attribution)&&e.push(a.attribution)}}e=e.filter(i=>String(i).trim()),e.sort((i,n)=>i.length-n.length),e=e.filter((i,n)=>{for(let a=n+1;a<e.length;a++)if(e[a].includes(i))return!1;return!0});let r=e.join(" | ");if(r!==this._attribHTML){if(this._attribHTML=r,e.length){let i=document.createDocumentFragment(),n=!0;for(let a of e){let o=ht.sanitize(a);o.hasChildNodes()&&(n||i.append(" | "),i.append(o),n=!1)}this._innerContainer.replaceChildren(i),this._container.classList.remove("maplibregl-attrib-empty")}else this._container.classList.add("maplibregl-attrib-empty");this._updateCompact(),this._editLink=null}}},jG=class{constructor(e={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let r=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&r.classList.add("maplibregl-compact"):r.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=ht.create("div","maplibregl-ctrl");let t=ht.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},NG=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(let i of r)if(i.id===e){i.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];let r=!1,i;for(let n of t)if(!n.cancelled){try{n.callback(e)}catch(a){r||(r=!0,i=a)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,r)throw i}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},VG=dt([{name:"a_pos3d",type:"Int16",components:3}]),UG=class extends lr{constructor(e){super(),this._lastTilesetChange=Be(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,t){this.tileManager.update(e,t),this._renderableTilesKeys=[];let r={},i=!1;for(let n of Cc(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:t}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float32Array(16),Ln(n.terrainRttPosMatrix32f,0,R,R,0,0,1),this._tiles[n.key]=new dP(n,this.tileSize),this._lastTilesetChange=Be(),i=!0);for(let n in this._tiles)r[n]||(this._tiles[n].releaseRTT(this.tileManager.map.painter),delete this._tiles[n],i=!0);return i}releaseRTT(e){for(let t in this._tiles){let r=this._tiles[t];(r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&r.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let t={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID,n=e.clone(),a=uo();if(i.canonical.equals(e.canonical))Ln(a,0,R,R,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let o=i.canonical.z-e.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),l=i.canonical.y-(i.canonical.y>>o<<o),u=R>>o;Ln(a,0,u,u,0,0,1),At(a,a,[-s*u,-l*u,0])}else if(e.canonical.isChildOf(i.canonical)){let o=e.canonical.z-i.canonical.z,s=e.canonical.x-(e.canonical.x>>o<<o),l=e.canonical.y-(e.canonical.y>>o<<o),u=R>>o;Ln(a,0,R,R,0,0,1),At(a,a,[s*u,l*u,0]),gr(a,a,[1/2**o,1/2**o,0])}else continue;n.terrainRttPosMatrix32f=new Float32Array(a),t[r]=n}return t}_getTerrainCoordsForTileRanges(e,t){let r={};for(let i of this._renderableTilesKeys){let n=this._tiles[i].tileID;if(!this._isWithinTileRanges(n,t))continue;let a=e.clone(),o=uo();if(n.canonical.z===e.canonical.z){let s=e.canonical.x-n.canonical.x+e.wrap*(1<<e.canonical.z),l=e.canonical.y-n.canonical.y;Ln(o,0,R,R,0,0,1),At(o,o,[s*R,l*R,0])}else if(n.canonical.z>e.canonical.z){let s=n.canonical.z-e.canonical.z,l=n.canonical.x-(n.canonical.x>>s<<s)+e.wrap*(1<<n.canonical.z),u=n.canonical.y-(n.canonical.y>>s<<s),c=e.canonical.x-(n.canonical.x>>s),h=e.canonical.y-(n.canonical.y>>s),p=R>>s;Ln(o,0,p,p,0,0,1),At(o,o,[-l*p+c*R,-u*p+h*R,0])}else{let s=e.canonical.z-n.canonical.z,l=e.canonical.x-(e.canonical.x>>s<<s)+e.wrap*(1<<e.canonical.z),u=e.canonical.y-(e.canonical.y>>s<<s),c=(e.canonical.x>>s)-n.canonical.x,h=(e.canonical.y>>s)-n.canonical.y,p=R<<s;Ln(o,0,p,p,0,0,1),At(o,o,[l*R+c*p,u*R+h*p,0])}a.terrainRttPosMatrix32f=new Float32Array(o),r[i]=a}return r}getSourceTile(e,t){let r=this.tileManager._source,i=e.overscaledZ-this.deltaZoom;if(i>r.maxzoom&&(i=r.maxzoom),i<r.minzoom)return;this._sourceTileCache[e.key]?.zoom!==i&&(this._sourceTileCache[e.key]={zoom:i,key:e.scaledTo(i).key});let n=this.findTileInCaches(this._sourceTileCache[e.key].key);if(!n?.dem&&t)for(;i>=r.minzoom&&!n?.dem;)n=this.findTileInCaches(e.scaledTo(i--).key);return n}isStillWaitingForDEM(e){let t=this.tileManager._source,r=Math.min(e.overscaledZ-this.deltaZoom,t.maxzoom);if(r<t.minzoom)return!1;let i=e.scaledTo(r);return t.hasTile&&!t.hasTile(i)?!1:this.findTileInCaches(i.key)?.state!=="errored"}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e),t)}anyTilesAfterTime(e=Be()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let r=t[e.canonical.z];return!!r&&(e.wrap>r.minWrap||e.wrap<r.maxWrap||e.canonical.x>=r.minTileXWrapped&&e.canonical.x<=r.maxTileXWrapped&&e.canonical.y>=r.minTileY&&e.canonical.y<=r.maxTileY)}},$G=class{constructor(e,t,r,i="auto",n=()=>nl){this._meshCache={},this.painter=e,this._getWorldCoordinateHelper=n,this.tileManager=new UG(t),this.options=r,this.exaggeration=typeof r.exaggeration=="number"?r.exaggeration:1,this._terrainSkirtLength=i,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this.coverage=new IV(this.tileManager,this.exaggeration,()=>this._worldCoordinateHelper)}destroy(){this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._heightMapFbo&&(this._heightMapFbo=(this._heightMapFbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null));for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,t,r,i=R){let n=e.normalizeCoordinates(t,r,i);if(!n)return 0;let a=this.coverage.getSampler(n.tileID);return a?a(n.x,n.y,i):0}getElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i,worldX:n,worldY:a}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(i,n%R,a%R,R)}getElevationForLngLat(e,t){let r=this.getDrawnElevationForLngLat(e);return r===void 0?this.getElevationForLngLatZoom(e,this._getFallbackZoom(t)):r}getDrawnElevationForLngLat(e,t=!1){return this.coverage.sample(e,t)}getElevationAndDEMStateForLngLat(e,t){let r=this.getElevationForLngLat(e,t);if(r!==0||this.getDrawnElevationForLngLat(e)!==void 0)return{elevation:r,demState:"loaded"};let i=this._getFallbackZoom(t),n=this._worldCoordinateHelper;if(!E1(i,n.wraps?e.wrap():e,n))return{elevation:r,demState:"none"};let{tileID:a}=this._getOverscaledTileIDFromLngLatZoom(e,i);return this.tileManager.getSourceTile(a,!0)?.dem?{elevation:r,demState:"loaded"}:{elevation:r,demState:this.tileManager.isStillWaitingForDEM(a)?"loading":"none"}}_getFallbackZoom(e){return Math.min(e.tileZoom,this.tileManager.maxzoom)}getElevation(e,t,r,i=R){return this.getDEMElevation(e,t,r,i)*this.exaggeration}resetElevationCache(){this.coverage.reset()}getCoverageIndex(){return this.coverage.getIndex()}_getDEMTileMatrix(e,t){let r=`${t.tileID.key}/${e.key}`,i=this._demMatrixCache.get(r);if(i)return i;let n=e.canonical.z-t.tileID.canonical.z,a=e.canonical.x-(e.canonical.x>>n<<n),o=e.canonical.y-(e.canonical.y>>n<<n),s=XM(new Float64Array(16),[1/(R<<n),1/(R<<n),0]);return At(s,s,[a*R,o*R,0]),this._demMatrixCache.set(r,s),s}getTerrainData(e){if(!this._emptyDemTexture){let i=this.painter.context,n=new Ye({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ot(i,n,i.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ot(i,new Ye({width:1,height:1}),i.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=Gi([])}let t=this.tileManager.getSourceTile(e,!0);if(t?.dem&&(!t.demTexture||t.needsTerrainPrepare)){let i=this.painter.context;t.demTexture||(t.demTexture=this.painter.getTileTexture(t.dem.stride)),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new Ot(i,t.dem.getPixels(),i.gl.RGBA,{premultiply:!1}),t.demTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),t.needsTerrainPrepare=!1}let r=t?this._getDEMTileMatrix(e,t):this._emptyDemMatrix;return{u_depth:2,u_terrain:3,u_terrain_dim:t?.dem?.dim||1,u_terrain_matrix:r,u_terrain_unpack:t?.dem?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(t?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:t}}getFramebuffer(){let e=this.painter,t=e.width/devicePixelRatio,r=e.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==t||this._fbo.height!==r)&&(this._fbo.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture),this._fboDepthTexture||(this._fboDepthTexture=new Ot(e.context,{width:t,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(t,r,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,t,r))),this._fbo.colorAttachment.set(this._fboDepthTexture.texture),this._fbo}getHeightMapFramebuffer(e){return this._heightMapFbo||(this._heightMapFbo=this.painter.context.createFramebuffer(1,1,!1,!1)),this._heightMapFbo.colorAttachment.set(e),this._heightMapFbo}getTerrainMesh(e,t){let r=t&&e.canonical.y===0,i=t&&e.canonical.y===(1<<e.canonical.z)-1,n=`m_${r?"n":""}_${i?"s":""}`;if(this._meshCache[n])return this._meshCache[n];let a=this.painter.context,o=new dz,s=new yn,l=this.meshSize,u=R/l,c=l*l;for(let p=0;p<=l;p++)for(let d=0;d<=l;d++)o.emplaceBack(d*u,p*u,0);for(let p=0;p<c;p+=l+1)for(let d=0;d<l;d++)s.emplaceBack(d+p,l+d+p+1,l+d+p+2),s.emplaceBack(d+p,l+d+p+2,d+p+1);this._terrainSkirtLength!=="none"&&this._buildSkirts(o,s,l,u,r,i);let h=new hc(a.createVertexBuffer(o,VG.members),a.createIndexBuffer(s),ct.simpleSegment(0,0,o.length,s.length));return this._meshCache[n]=h,h}getSkirtLength(e){return this._worldCoordinateHelper.metersPerWorldUnit(.5,.5)/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getMinMaxElevation(i).minElevation??0}getMinMaxElevation(e){let t=this.tileManager.getSourceTile(e,!0),r={minElevation:null,maxElevation:null};return t?.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}get _worldCoordinateHelper(){return this._getWorldCoordinateHelper()}_getOverscaledTileIDFromLngLatZoom(e,t){let r=this._worldCoordinateHelper,i=r.wraps?e.wrap():e,n=r.worldFromLngLat(i.lng,i.lat),a=(1<<t)*R,o=n.x*a,s=n.y*a;return{tileID:new ir(t,0,t,Math.floor(o/R),Math.floor(s/R)),worldX:o,worldY:s}}_buildSkirts(e,t,r,i,n,a){let o=e.length,s=o+(r+1),l=(r+1)*r,u=n?Nu:0,c=+!n,h=a?Vu:R,p=+!a;for(let m=0;m<=r;m++)e.emplaceBack(m*i,u,c);for(let m=0;m<=r;m++)e.emplaceBack(m*i,h,p);for(let m=0;m<r;m++)t.emplaceBack(l+m,s+m,s+m+1),t.emplaceBack(l+m,s+m+1,l+m+1),t.emplaceBack(0+m,o+m+1,o+m),t.emplaceBack(0+m,0+m+1,o+m+1);let d=e.length,f=d+(r+1)*2;for(let m of[0,1])for(let _=0;_<=r;_++)for(let g of[0,1])e.emplaceBack(m*R,_*i,g);for(let m=0;m<r*2;m+=2)t.emplaceBack(d+m,d+m+1,d+m+3),t.emplaceBack(d+m,d+m+3,d+m+2),t.emplaceBack(f+m,f+m+3,f+m+1),t.emplaceBack(f+m,f+m+2,f+m+3)}},oT=["none","zoom","sourceTiles","visibleLayers","revision"],sT=class{constructor(e,t,r,i){this._tileKeys=e.map(n=>n.key).sort().join(),this._revision=t,this._zoom=r,this._visibleLayerIds=i}difference(e){return this._revision===e?._revision?this._visibleLayerIds===e._visibleLayerIds?this._tileKeys===e._tileKeys?this._zoom===e._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},oD={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};function G1(e){return Ef(e)?`custom-layer:${e.id}`:e.source}function D_(e){return Ef(e)?e.implementation.renderToTerrainTile!==void 0:oD[e.type]===!0}function qG(e,t){let r=[],i=!1;for(let n of t){let a=D_(e._layers[n]);a&&!i&&r.push([]),a&&r[r.length-1].push(n),i=a}return r}var GG=class{constructor(e,t){this.needsFollowUpFrame=!1,this.painter=e,this.terrain=t,this.rttSize=t.tileManager.tileSize*t.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}prepareForRender(e,t,r){let i=t!==this._lastPrepareZoom;this._lastPrepareZoom=t,this._stacks=[],this._prevRenderedToTexture=!1,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(u=>!e._layers[u].isHidden(t));let n=qG(e,this._renderableLayerIds),a=this._renderableLayerIds.join(),o=new Set;for(let u of this._renderableLayerIds){let c=e._layers[u],h=c.source;h&&oD[c.type]&&o.add(h)}this._coordsAscending={},this._rttFingerprints={};for(let u of o){let c=e.tileManagers[u];if(!c)continue;this._coordsAscending[u]={};let h=this._coordsAscending[u],p=c.getSource(),d=p instanceof Tc?p.terrainTileRanges:null;for(let _ of c.getVisibleCoordinates()){let g=this.terrain.tileManager.getTerrainCoords(_,d);for(let y in g)h[y]||(h[y]=[]),h[y].push(g[y])}this._rttFingerprints[u]={};let f=this._rttFingerprints[u],m=c.getState().revision;for(let _ in h)f[_]=new sT(h[_],m,t,a)}for(let u of this._renderableLayerIds){let c=e._layers[u];if(!Ef(c)||!D_(c))continue;let h=c.implementation.terrainTileRevision??0,p={};for(let d of this._renderableTiles)p[d.tileID.key]=new sT([d.tileID],h,t,a);this._rttFingerprints[G1(c)]=p}this.needsFollowUpFrame=!1;let s=i||r,l=!1;for(let u of this._renderableTiles){let c=this._textureDifference(u);c!=="none"&&(c==="zoom"&&s||c==="visibleLayers"&&i?this.needsFollowUpFrame=!0:c==="zoom"||c==="sourceTiles"?(l?this.needsFollowUpFrame=!0:this._releaseChangedTextures(u,e,n),l=!0):this._releaseChangedTextures(u,e,n))}}_releaseChangedTextures(e,t,r){let i=r.map(n=>this._hasStackChanged(e,t,n));if(!i.includes(!1))e.releaseRTT(this.painter);else for(let[n,a]of i.entries())a&&e.releaseRTTStack(this.painter,n)}_hasStackChanged(e,t,r){let i=!1;for(let n of r){let a=G1(t._layers[n]),o=this._rttFingerprints[a]?.[e.tileID.key],s=e.rttFingerprint[a];if(o||s){if(o?.difference(s)!=="none")return!0;i=!0}}return!i}_textureDifference(e){let t="none";for(let r in this._rttFingerprints){let i=this._rttFingerprints[r][e.tileID.key];if(!i)continue;let n=i.difference(e.rttFingerprint[r]);oT.indexOf(n)>oT.indexOf(t)&&(t=n)}return t}renderLayer(e,t,r){if(e.isHidden(r.transform.zoom))return!1;let i=D_(e),n=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(i&&(this._prevRenderedToTexture||this._stacks.push([]),this._prevRenderedToTexture=!0,this._stacks[this._stacks.length-1].push(e.id),!a))return!0;if(this._prevRenderedToTexture||i&&a){this._prevRenderedToTexture=i;let o=this._stacks.length-1,s=this._stacks[o]||[];r.isRenderingToTexture=!0,N6(n.context.frameUniformBuffer,this.rttSize,this.rttSize);for(let l of this._renderableTiles){if(this._rttTiles.push(l),l.getRTT(o))continue;let u=l.acquireRTT(n,o,this.rttSize);n.bindRTT(u),n.context.clear({color:he.transparent,stencil:0}),r.invalidateTileClippingMasks();for(let c of s){let h=t._layers[c],p=h.source?this._coordsAscending[h.source][l.tileID.key]:[l.tileID];n.context.viewport.set([0,0,this.rttSize,this.rttSize]),r.renderTileClippingMasks(h,p),n.renderLayer(n,t.tileManagers[h.source],h,p,r);let d=G1(h);d&&(l.rttFingerprint[d]=this._rttFingerprints[d][l.tileID.key])}u.texture.generateMipmap()}return r.isRenderingToTexture=!1,N6(n.context.frameUniformBuffer,n.context.gl.drawingBufferWidth,n.context.gl.drawingBufferHeight),jq(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],i}return!1}},ZG={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},HG=pT,lT={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:aD,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:bo.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,globalState:void 0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},sD=class extends lr{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new NG,this._controls=[],this._mapId=vT(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=a=>{if(a.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)this.fire(new r1("webglcontextlost",{originalEvent:a}));else{for(let o of Object.values(this.style._layers))if(o.type==="custom"&&console.warn(`Custom layer with id '${o.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),o._listeners)for(let[s]of Object.entries(o._listeners))console.warn(`Custom layer with id '${o.id}' had event listeners for event '${s}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.off("error",this._onStyleError),this.style.destroy(),this.style=null,this.fire(new r1("webglcontextlost",{originalEvent:a}))}},this._contextRestored=a=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let o in this._lostContextStyle.images){let s=this._lostContextStyle.images[o];s.isWebGLImage&&this.style.imageManager.updateImage(o,s,!1)}}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(o){this.fire(new ee(o));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new r1("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onStyleError=a=>{a.tile&&this.triggerRepaint()},this._onWindowOnline=()=>{this._update()};let t={...lT,...e,canvasContextAttributes:{...lT.canvasContextAttributes,...e.canvasContextAttributes}};if(t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(t.minPitch!=null&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(t.maxPitch!=null&&t.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new RG({minZoom:t.minZoom,maxZoom:t.maxZoom,minPitch:t.minPitch,maxPitch:t.maxPitch,bearingSnap:t.bearingSnap,zoomSnap:t.zoomSnap,renderWorldCopies:t.renderWorldCopies,centerClampedToGround:t.centerClampedToGround,terrain:this.terrain,transformConstrain:t.transformConstrain,requestRenderFrame:a=>this._requestRenderFrame(a),cancelRenderFrame:a=>this._cancelRenderFrame(a),transformCameraUpdate:t.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._canvasContextAttributes={...t.canvasContextAttributes},this._trackResize=t.trackResize===!0,this._terrainSkirtLength=t.terrainSkirtLength,this._refreshExpiredTiles=t.refreshExpiredTiles===!0,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions===!0,this._collectResourceTiming=t.collectResourceTiming===!0,this._locale={...ZG,...t.locale},this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this._zoomLevelsToOverscale=t.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=t.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(t.anisotropicFilterPitch),t.reduceMotion!==void 0&&(Nr.prefersReducedMotion=t.reduceMotion),this._requestManager=new WI(t.transformRequest),this._container=this._resolveContainer(t.container),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer();try{this._setupPainter()}catch(a){throw this._cleanupContainer(),a}this._imageQueueHandle=Vi.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.markTerrainDepthDirty(),this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new zG(this,this._camera,t),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let r=typeof t.hash=="string"&&t.hash||void 0;this._hash=t.hash?new Kq(r).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:t.center,elevation:t.elevation,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch,roll:t.roll}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,J({},t.fitBoundsOptions,{duration:0}))));let i=typeof t.style=="string"?void 0:t.style?.projection?.type,n=i!=="globe"&&!Pf(i);this.resize(null,n),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,this._initialGlobalState=t.globalState,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new OG(typeof t.attributionControl=="boolean"?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new jG,t.logoPosition),this.on("style.load",()=>{if(n||this._resizeTransform(),this._camera.transform.unmodified){let a=Qd(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(a)}}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(a.dataType==="style"?new ji("styledata",a):new et("sourcedata",a))}),this.on("dataloading",a=>{this.fire(a.dataType==="style"?new ji("styledataloading",a):new et("sourcedataloading",a))}),this.on("dataabort",a=>{this.fire(new et("sourcedataabort",a))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,t){if(t===void 0&&(t=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new ee(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[t];return t.includes("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(e){if(!e?.onRemove)return this.fire(new ee(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(e);return t>-1&&this._controls.splice(t,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return Cc(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new H(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,t){return this._camera.setCenter(e,t),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,t){return this._camera.setCenterElevation(e,t),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,t,r){return this._camera.panBy(e,t,r),this}panTo(e,t,r){return this._camera.panTo(e,t,r),this}getZoom(){return this._camera.transform.zoom}setZoom(e,t){return this._camera.setZoom(e,t),this}zoomTo(e,t,r){return this._camera.zoomTo(e,t,r),this}zoomIn(e,t){return this._camera.zoomIn(e,t),this}zoomOut(e,t){return this._camera.zoomOut(e,t),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,t){return this._camera.setVerticalFieldOfView(e,t),this}getBearing(){return this._camera.transform.bearing}setBearing(e,t){return this._camera.setBearing(e,t),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,t){return this._camera.setPadding(e,t),this}rotateTo(e,t,r){return this._camera.rotateTo(e,t,r),this}resetNorth(e,t){return this._camera.resetNorth(e,t),this}resetNorthPitch(e,t){return this._camera.resetNorthPitch(e,t),this}snapToNorth(e,t){return this._camera.snapToNorth(e,t),this}getPitch(){return this._camera.transform.pitch}setPitch(e,t){return this._camera.setPitch(e,t),this}getRoll(){return this._camera.transform.roll}setRoll(e,t){return this._camera.setRoll(e,t),this}cameraForBounds(e,t){return this._camera.cameraForBounds(e,t)}fitBounds(e,t,r){return this._camera.fitBounds(e,t,r),this}fitScreenCoordinates(e,t,r,i,n){return this._camera.fitScreenCoordinates(e,t,r,i,n),this}jumpTo(e,t){return this._camera.jumpTo(e,t),this}calculateAnchoredCameraOptions(e){return this._camera.calculateAnchoredCameraOptions(e)}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n)}easeTo(e,t){return this._camera.easeTo(e,t),this}flyTo(e,t){return this._camera.flyTo(e,t),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(H.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,r,i){return i==null&&this.terrain&&(i=this.terrain.getElevationForLngLat(r,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(e,t,r,i??0)}resize(e,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let r=!this._camera._moving;return r&&(this.stop(),this.fire(new ne("movestart",e)).fire(new ne("move",e))),this.fire(new Wt("resize",e)),r&&this.fire(new ne("moveend",e)),this}_resizeInternal(e=!0){let[t,r]=this._containerDimensions();if(this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio),this.painter.overLimit()){let i=this.painter.context.gl;this._maxCanvasSize=[i.drawingBufferWidth,i.drawingBufferHeight],this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio)}this.style?.resize(),this._resizeTransform(e)}_resizeTransform(e=!0){let[t,r]=this._containerDimensions();this._camera.transform.resize(t,r,e),this._camera._requestedCameraState?.resize(t,r,e)}_getClampedPixelRatio(e,t){let{0:r,1:i}=this._maxCanvasSize,n=this.getPixelRatio(),a=e*n,o=t*n,s=a>r?r/a:1,l=o>i?i/o:1,u=Math.min(s,l);return u<1&&we("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),u*n}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.applyTransformChange(t=>t.setMaxBounds(Zn.convert(e))),this._update()}setMinZoom(e){if(e??(e=-2),e>=-2&&e<=this._camera.transform.maxZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMinZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(e=!1){let t=this._camera.transform;return e?t.applyConstrain(t.center,t.minZoom).zoom:t.minZoom}setMaxZoom(e){if(e??(e=22),e>=this._camera.transform.minZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMaxZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??(e=0),e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMinPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??(e=60),e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMaxPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??(e=20),e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.applyTransformChange(t=>t.setRenderWorldCopies(e)),this._update()}setTransformConstrain(e){return this._camera.applyTransformChange(t=>t.setConstrainOverride(e)),this._update()}project(e){return this._camera.transform.locationToScreenPoint(H.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(k.convert(e),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegates(e,t,r){if(e==="mouseenter"||e==="mouseover"){let i=!1;return{mousemove:n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length?i||(i=!0,r.call(this,new ei(e,this,n.originalEvent,{features:o}))):i=!1},mouseout:()=>{i=!1}}}if(e==="mouseleave"||e==="mouseout"){let i=!1;return{mousemove:n=>{let a=t.filter(o=>this.getLayer(o));(a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a})).length?i=!0:i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))},mouseout:n=>{i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))}}}{let i=n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length&&(n.features=o,r.call(this,n),delete n.features)};return{[e]:i}}}_addDelegatedListener(e,t){var r;this._delegatedListeners||(this._delegatedListeners={}),(r=this._delegatedListeners)[e]||(r[e]=[]),this._delegatedListeners[e].push(t);for(let i in t.delegates)this.on(i,t.delegates[i])}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners?.[e])return;let i=this._delegatedListeners[e];for(let n=0;n<i.length;n++){let a=i[n];if(a.listener===r&&a.layers.length===t.length&&a.layers.every(o=>t.includes(o))){for(let o in a.delegates)this.off(o,a.delegates[o]);i.splice(n,1);return}}}on(e,t,r){if(r===void 0)return super.on(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,r)};return this._addDelegatedListener(e,n),{unsubscribe:()=>{this._removeDelegatedListener(e,i,r)}}}once(e,t,r){if(r===void 0)return super.once(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,a=>{this._removeDelegatedListener(e,i,r),r.call(this,a)})};return this._addDelegatedListener(e,n),this}off(e,t,r){if(r===void 0)return super.off(e,t);let i=typeof t=="string"?[t]:t;return this._removeDelegatedListener(e,i,r),this}queryRenderedFeatures(e,t){if(!this.style)return[];let r,i=e instanceof k||Array.isArray(e),n=i?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||(t=(i?{}:e)||{}),n instanceof k||typeof n[0]=="number")r=[k.convert(n)];else{let a=k.convert(n[0]),o=k.convert(n[1]);r=[a,new k(o.x,a.y),o,new k(a.x,o.y),a]}return this.style.queryRenderedFeatures(r,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return t=J({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle,globalState:this._initialGlobalState},t),this._styleUrl=typeof e=="string"?e:null,t.diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(e,t))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(e,t));return}let r=this.style&&t.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.off("error",this._onStyleError),this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new B6(this,t||{});else return this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.style?.projection?.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),typeof e=="string"?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this}_lazyInitEmptyStyle(){this.style||(this.style=new B6(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),this.style.loadEmpty())}async _diffStyle(e,t){if(this._diffStyleRequest?.abort(),typeof e=="string"){let r=e;this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let n=await this._requestManager.transformRequest(r,"Style");if(i.signal.aborted){this._diffStyleRequest=null;return}let a=await ef(n,i);this._diffStyleRequest=null,this._updateDiff(a.data,t)}catch(n){this._diffStyleRequest=null,Ra(n)||this.fire(new ee(Xt(n)))}}else typeof e=="object"&&(this._diffStyleRequest=null,this._updateDiff(e,t))}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(r){we(`Unable to perform style diff: ${Xt(r).message}. Rebuilding the style from scratch.`),this._updateStyle(e,t)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style)we("There is no style added to the map.");else return this.style.loaded()}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let t=this.style?.tileManagers[e];if(t===void 0)this.fire(new ee(Error(`There is no tile manager with ID '${e}'`)));else return t.loaded()}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&vc(this,Br.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this.painter.destroyRTTResources(),this._camera.setTerrain(null);else{let r=this.style.tileManagers[e.source];if(!r)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&r.reload();for(let i in this.style._layers){let n=this.style._layers[i];n.type==="hillshade"&&n.source===e.source&&we("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),n.type==="color-relief"&&n.source===e.source&&we("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new $G(this.painter,r,e,this._terrainSkirtLength,()=>this._camera.transform.worldCoordinateHelper),this.painter.renderToTexture=new GG(this.painter,this.terrain),this._camera.setTerrain(this.terrain),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,e.source),this.style.on("data",this._terrainDataCallback)}return this.style.triggerSymbolPlacement(),this.fire(new XI({terrain:e})),this}_handleTerrainDataEvent(e,t){if(e.dataType==="style"){this.terrain.tileManager.releaseAllRTT();return}let r=e.sourceId===t;r&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),r&&e.tile&&(this.painter.markTerrainDepthDirty(),this._camera.applyTerrainChange()),e.tile&&(e.source?.type==="image"?this.terrain.tileManager.releaseAllRTT():this.terrain.tileManager.releaseRTT(e.tile.tileID))}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style?.tileManagers;for(let t of Object.values(e))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style?.getSource(e)}setSourceTileLodParams(e,t,r){if(r){let i=this.getSource(r);if(!i)throw Error(`There is no source with ID "${r}", cannot set LOD parameters`);i.calculateTileZoom=x_(Math.max(1,e),Math.max(1,t))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=x_(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,t){let r=this.style.tileManagers[e];if(!r)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);t===void 0?r.reload(!0):r.refreshTiles(t.map(i=>new Cf(i.z,i.x,i.y)))}addImage(e,t,r={}){this._lazyInitEmptyStyle();let i=this._createStyleImage(t,r);return i&&(this.style.addImage(e,i),i.userImage?.onAdd&&i.userImage.onAdd(this,e)),this}setMissingStyleImageResolver(e){return this._missingStyleImageResolver=e,this.style?.setMissingImageResolver(e),this}_createStyleImage(e,t={}){let{pixelRatio:r=1,sdf:i=!1,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}=t;if(e instanceof HTMLImageElement||fo(e)){let{width:u,height:c,data:h}=Nr.getImageData(e);return{data:new Ye({width:u,height:c},h),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0}}if(e.width===void 0||e.height===void 0)return this.fire(new ee(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`"))),null;{let{width:u,height:c,data:h}=e,p=e,d=Vd(p.data);return{data:d?new Ye({width:u,height:c}):new Ye({width:u,height:c},new Uint8Array(h)),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0,isWebGLImage:d,userImage:p}}}updateImage(e,t){let r=this.style.getImage(e);if(!r)return this.fire(new ee(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:n,data:a}=t instanceof HTMLImageElement||fo(t)?Nr.getImageData(t):t;if(i===void 0||n===void 0)return this.fire(new ee(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(i!==r.data.width||n!==r.data.height)return this.fire(new ee(Error("The width and height of the updated image must be that same as the previous version of the image")));if(r.isWebGLImage=Vd(a),r.isWebGLImage)r.userImage=t;else{let o=!(t instanceof HTMLImageElement||fo(t));r.data.replace(a,o)}return this.style.updateImage(e,r),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new ee(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}async loadImage(e){let t=await Vi.getImage(await this._requestManager.transformRequest(e,"Image"),new AbortController);if(!t.data)throw Error(`Could not load image ${e}: the response is empty`);return t}listImages(){return this.style?.listImages()??[]}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style?.getLayer(e)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style?.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,i={}){return this.style?.setPaintProperty(e,t,r,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,i={}){return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(e){return this._lazyInitEmptyStyle(),this.style.setFontFaces(e),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(e,t,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,i=>{i||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,r=>{r||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=Math.floor(this._container.clientWidth)||400,t=Math.floor(this._container.clientHeight)||300),[e,t]}_shouldHandleInitialResize(){if(!this._container?.clientWidth||!this._container.clientHeight)return!1;let[e,t]=this._containerDimensions();return e!==this._camera.transform.width||t!==this._camera.transform.height}_setupResizeObserver(){let e=!1,t=Xv(i=>{this._trackResize&&!this._removed&&(this.resize(i),this.redraw())},50),r=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new r(i=>{!e&&(e=!0,!this._shouldHandleInitialResize())||t(i)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e=="string"){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&typeof e=="object"&&e.nodeType===1)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._containerDimensions(),t=this._getClampedPixelRatio(e[0],e[1]),r=this._container;r.classList.add("maplibregl-map");let i=this._canvasContainer=ht.create("div","maplibregl-canvas-container",r);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=ht.create("canvas","maplibregl-canvas",i),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._resizeCanvas(e[0],e[1],t);let n=this._controlContainer=ht.create("div","maplibregl-control-container",r),a=this._controlPositions={};for(let o of["top-left","top-right","bottom-left","bottom-right"])a[o]=ht.create("div",`maplibregl-ctrl-${o} `,n);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(e,t,r){let i=Math.round(r*e),n=Math.round(r*t);this._canvas.width=i,this._canvas.height=n,this._canvas.style.width=`${i/r}px`,this._canvas.style.height=`${n/r}px`}_setupPainter(){let e={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},t=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{t=i},{once:!0});let r=this._canvas.getContext("webgl2",e);if(!r)throw new Xq(e,t);this.painter=new Yq(r)}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.fire(new KI({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?._loaded&&(this._styleDirty||(this._styleDirty=e),this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let t=this._idleTriggered?this._fadeDuration:0,r=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let i=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let l=this._camera.transform.zoom,u=Be();this.style.zoomHistory.update(l,u);let c=new Re(l,{now:u,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),h=c.crossFadingFactor();(h!==1||h!==this._crossFadingFactor)&&(i=!0,this._crossFadingFactor=h),this.style.update(c)}let n=this.style.projection?.transitionState>0!==r;if(this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||n)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain){if(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(this._camera.transform.center,this._camera.transform);u!=="loading"&&this._camera.transform.setElevation(l)}}else this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,t,this._crossSourceCollisions,n);let a=this.style.projection,o=a?.transitionState??0;this.painter.render(this.style,this._camera.transform,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,symbolFadeChange:this.style.placement.symbolFadeChange(Be()),variableOffsets:this.style.placement.variableOffsets,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch(),projectionTransition:o,isRenderingGlobe:o>0,projectionShaderVariant:a?{name:a.shaderVariantName,define:a.shaderDefine,prelude:a.shaderPreludeCode}:void 0,useSubdivision:a?.useSubdivision??!1,pixelRatio:this._clampedPixelRatio,light:this.style.light?.getEvaluated(),sky:this.style.sky?.getEvaluated()}),this.fire(new Wt("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Wt("load"))),this.style&&(this.style.hasTransitions()||i)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new Wt("idle")),this._loaded&&!this._fullyLoaded&&!s&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Vi.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let e=this.painter.context.gl.getExtension("WEBGL_lose_context");e?.loseContext&&e.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new Wt("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Nr.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(t){if(!Ra(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return HG}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}};function WG(e,t,r,i=!1){if(i||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let n=new H(e.lng,e.lat);if(e=new H(e.lng,e.lat),t){let a=new H(e.lng-360,e.lat),o=new H(e.lng+360,e.lat),s=r.locationToScreenPoint(e).distSqr(t);r.locationToScreenPoint(a).distSqr(t)<s?e=a:r.locationToScreenPoint(o).distSqr(t)<s&&(e=o)}for(;Math.abs(e.lng-r.center.lng)>180;){let a=r.locationToScreenPoint(e);if(a.x>=0&&a.y>=0&&a.x<=r.width&&a.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e.lng!==n.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(e))?e:n}var lD={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 YG(e,t,r){let i=e.classList;for(let n in lD)i.remove(`maplibregl-${r}-anchor-${n}`);i.add(`maplibregl-${r}-anchor-${t}`)}var uT={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},uD="#3FB1CE";function yi(e,t,r=[]){let i=ht.createNS("http://www.w3.org/2000/svg",e);for(let n in t)i.setAttributeNS(null,n,t[n]);for(let n of r)i.appendChild(n);return i}var Z1;function XG(){return Z1||(Z1=yi("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[yi("g",{"fill-rule":"nonzero"},[yi("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([e,t])=>yi("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:e,ry:t}))),yi("g",{fill:uD},[yi("path",{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"})]),yi("g",{opacity:"0.25",fill:"#000000"},[yi("path",{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"})]),yi("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),yi("g",{transform:"translate(8.0, 8.0)"},[yi("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),yi("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]),Z1)}function KG(e){return e.firstElementChild.children[1]}var Ss=class extends Ao{},QG=class extends Ao{},cD=class extends lr{constructor(e){if(super(),this._onClick=t=>{this.fire(new QG("click",{originalEvent:t}))},this._onKeyPress=t=>{(t.code==="Space"||t.code==="Enter")&&this.togglePopup()},this._onKeyDown=t=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||t.composedPath()[0]!==this._element||t.altKey||t.ctrlKey||t.metaKey)return;let r=uT[t.key];if(!r)return;t.preventDefault(),t.stopPropagation();let i=t.shiftKey?10:1,n=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new k(n.x+r[0]*i,n.y+r[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new Ss("dragstart"))),this.fire(new Ss("drag"))},this._onKeyUp=t=>{uT[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let r=t.originalEvent.target,i=this._element;this._popup&&(r===i||i.contains(r))&&this.togglePopup()},this._updateCoveredUnthrottled=()=>{let t=this._map?.terrain;if(!t||!this._isInViewport())return;let r=this._isCovered(t);r&&this._popup?.isOpen()&&this._popup.remove(),this._element.style.opacity=r?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",r)},this._updateCovered=Xv(this._updateCoveredUnthrottled,100),this._update=t=>{if(!this._map)return;this._lngLat=WG(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?r=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?i="rotateX(0deg)":this._pitchAlignment==="map"&&(i=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&t?.type!=="move"&&(this._pos=this._pos.round()),this._element.style.transform=`${lD[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${r}`,this._updateOpacity()},this._onMove=t=>{if(!this._isDragging){let r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new Ss("dragstart"))),this.fire(new Ss("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new Ss("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||uD,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=k.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht.create("div");let t=XG().cloneNode(!0);t.setAttributeNS(null,"height",`${41*this._scale}px`),t.setAttributeNS(null,"width",`${27*this._scale}px`),KG(t).setAttributeNS(null,"fill",this._color),this._element.appendChild(t),this._offset=k.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),YG(this._element,this._anchor,"marker"),e?.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),e.on("idle",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("idle",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),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=H.convert(e),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),e){if(!("offset"in e.options)){let t=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,(24.6+t)*-1],"bottom-right":[-t,(24.6+t)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new Ss("dragend")))}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(){if(!this._isInViewport())return;let e=this._map?.terrain,t=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!e||t){let r=t?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==r&&(this._element.style.opacity=r,this._element.classList.toggle("maplibregl-marker-covered",t))}else this._updateCovered()}_isInViewport(){let{width:e,height:t}=this._map._camera.transform;return!!this._pos&&this._pos.x>=0&&this._pos.y>=0&&this._pos.x<=e&&this._pos.y<=t}_isCovered(e){let t=this._map._camera.transform,r=e.getElevationForLngLat(this._lngLat,t),i=Math.max(0,-this._offset.y)/t.pixelsPerMeter,n=Math.sin(this._map.getPitch()*Math.PI/180)*i;return t.isLocationOccluded(this._lngLat,e,r+n)}getOffset(){return this._offset}setOffset(e){return this._offset=k.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=(this._element.getAttribute("tabindex")==="0"&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(this._opacity===void 0||e===void 0&&t===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=String(e)),t!==void 0&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(),this}};var mH=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Jv(e){bo.WORKER_URL=e}var pD=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0);-webkit-touch-callout:none}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media(forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid buttontext}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media(hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%23333'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%2333b5e5'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%23333'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%2333b5e5'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media(forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right,[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media(prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media(hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}`;var Rf="gramps-connect-story";var dD={},eZ=Object.freeze(Array.from({length:1},(e,t)=>t+1).filter(e=>e===1||dD[e]!==void 0)),Vr=class extends Error{constructor(t,r){super(r),this.name="StoryFormatError",this.code=t}};function Lf(e){if(typeof e!="string")return null;let t=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.exec(e);return t?{major:Number(t[1]),minor:Number(t[2])}:null}function e2(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Vr("not-a-story","story.json is not a JSON object.");let t=e;if(t.format!==Rf)throw new Vr("not-a-story",`story.json's "format" is not "${Rf}".`);let r=Lf(t.version);if(!r||r.major<1)throw new Vr("bad-version",`story.json's "version" (${JSON.stringify(t.version)}) is not a valid MAJOR.MINOR version.`);if(r.major>1)throw new Vr("newer-version",`This story uses format version ${t.version}, which is newer than this viewer supports (up to 1.x). A newer viewer is needed to open it.`);for(let i=r.major;i<1;i++){let n=dD[i];if(!n)throw new Vr("bad-version",`No upgrade path from format version ${i}.x.`);t=n(t)}return t}var t2={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var r2=Bf;var rZ={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var iZ=new RegExp("^1\\.(0|[1-9][0-9]*)$","u"),Na=new RegExp("\\S","u"),nZ=new RegExp("^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$","u"),aZ=new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$","u"),Of=new RegExp("^[A-Za-z0-9_-]{1,64}$","u"),oZ=new RegExp("^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$","u"),sZ=new RegExp("^[a-z]+/[A-Za-z0-9.+-]+$","u");function sl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=sl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.media===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[u]:o.push(u),s++}if(e.corners===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"corners"},message:"must have required property 'corners'"};o===null?o=[u]:o.push(u),s++}if(e.media!==void 0){let u=e.media;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.corners!==void 0){let u=e.corners;if(Array.isArray(u)){if(u.length>4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/maxItems",keyword:"maxItems",params:{limit:4},message:"must NOT have more than 4 items"};o===null?o=[h]:o.push(h),s++}if(u.length<4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/minItems",keyword:"minItems",params:{limit:4},message:"must NOT have fewer than 4 items"};o===null?o=[h]:o.push(h),s++}let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(Array.isArray(p)){if(p.length>2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items"};o===null?o=[f]:o.push(f),s++}if(p.length<2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items"};o===null?o=[f]:o.push(f),s++}let d=p.length;if(d>0){let f=p[0];if(typeof f=="number"&&isFinite(f)){if(f>180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[m]:o.push(m),s++}if(f<-180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}if(d>1){let f=p[1];if(typeof f=="number"&&isFinite(f)){if(f>90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[m]:o.push(m),s++}if(f<-90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}}else{let d={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/corners",schemaPath:"#/properties/corners/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.opacity!==void 0){let u=e.opacity;if(typeof u=="number"&&isFinite(u)){if(u>1||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/maximum",keyword:"maximum",params:{comparison:"<=",limit:1},message:"must be <= 1"};o===null?o=[c]:o.push(c),s++}if(u<0||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.order!==void 0){let u=e.order;if(!(typeof u=="number"&&!(u%1)&&!isNaN(u)&&isFinite(u))){let c={instancePath:t+"/order",schemaPath:"#/properties/order/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[c]:o.push(c),s++}}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return sl.errors=o,s===0}sl.evaluated={props:{media:!0,corners:!0,opacity:!0,order:!0,date:!0},dynamicProps:!1,dynamicItems:!1};function ll(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ll.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.name!==void 0&&typeof e.name!="string"){let u={instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.lat!==void 0){let u=e.lat;if(typeof u=="number"&&isFinite(u)){if(u>90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[c]:o.push(c),s++}if(u<-90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.lon!==void 0){let u=e.lon;if(typeof u=="number"&&isFinite(u)){if(u>180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[c]:o.push(c),s++}if(u<-180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.geometry!==void 0){let u=e.geometry;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.type===void 0){let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};o===null?o=[c]:o.push(c),s++}if(u.type!==void 0&&typeof u.type!="string"){let c={instancePath:t+"/geometry/type",schemaPath:"#/properties/geometry/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.overlays!==void 0){let u=e.overlays;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)sl(u[h],{instancePath:t+"/overlays/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?sl.errors:o.concat(sl.errors),s=o.length)}else{let c={instancePath:t+"/overlays",schemaPath:"#/properties/overlays/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.lat!==void 0&&e.lon===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lat",missingProperty:"lon",depsCount:1,deps:"lon"},message:"must have property lon when property lat is present"};o===null?o=[u]:o.push(u),s++}if(e.lon!==void 0&&e.lat===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lon",missingProperty:"lat",depsCount:1,deps:"lat"},message:"must have property lat when property lon is present"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ll.errors=o,s===0}ll.evaluated={props:{name:!0,lat:!0,lon:!0,geometry:!0,overlays:!0},dynamicProps:!1,dynamicItems:!1};function ul(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ul.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.ref===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"ref"},message:"must have required property 'ref'"};o===null?o=[u]:o.push(u),s++}if(e.ref!==void 0){let u=e.ref;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.caption!==void 0&&typeof e.caption!="string"){let u={instancePath:t+"/caption",schemaPath:"#/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.credit!==void 0&&typeof e.credit!="string"){let u={instancePath:t+"/credit",schemaPath:"#/properties/credit/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ul.errors=o,s===0}ul.evaluated={props:{ref:!0,caption:!0,credit:!0},dynamicProps:!1,dynamicItems:!1};function cl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=cl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};o===null?o=[u]:o.push(u),s++}if(e.id!==void 0){let u=e.id;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.title!==void 0&&typeof e.title!="string"){let u={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.text!==void 0&&typeof e.text!="string"){let u={instancePath:t+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.place!==void 0&&(ll(e.place,{instancePath:t+"/place",parentData:e,parentDataProperty:"place",rootData:n,dynamicAnchors:a})||(o=o===null?ll.errors:o.concat(ll.errors),s=o.length)),e.media!==void 0){let u=e.media;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)ul(u[h],{instancePath:t+"/media/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?ul.errors:o.concat(ul.errors),s=o.length)}else{let c={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.people!==void 0){let u=e.people;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.name===void 0){let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[d]:o.push(d),s++}if(p.name!==void 0){let d=p.name;if(typeof d=="string"){if(!Na.test(d)){let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.role!==void 0&&typeof p.role!="string"){let d={instancePath:t+"/people/"+h+"/role",schemaPath:"#/properties/people/items/properties/role/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/people",schemaPath:"#/properties/people/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return cl.errors=o,s===0}cl.evaluated={props:{id:!0,title:!0,text:!0,date:!0,place:!0,media:!0,people:!0},dynamicProps:!1,dynamicItems:!1};function Bf(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=Bf.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.format===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"format"},message:"must have required property 'format'"};o===null?o=[c]:o.push(c),s++}if(e.version===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};o===null?o=[c]:o.push(c),s++}if(e.title===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};o===null?o=[c]:o.push(c),s++}if(e.slides===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"slides"},message:"must have required property 'slides'"};o===null?o=[c]:o.push(c),s++}if(e.media===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[c]:o.push(c),s++}if(e.$schema!==void 0&&typeof e.$schema!="string"){let c={instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.format!==void 0&&e.format!=="gramps-connect-story"){let c={instancePath:t+"/format",schemaPath:"#/properties/format/const",keyword:"const",params:{allowedValue:"gramps-connect-story"},message:"must be equal to constant"};o===null?o=[c]:o.push(c),s++}if(e.version!==void 0){let c=e.version;if(typeof c=="string"){if(!iZ.test(c)){let h={instancePath:t+"/version",schemaPath:"#/properties/version/pattern",keyword:"pattern",params:{pattern:"^1\\.(0|[1-9][0-9]*)$"},message:'must match pattern "^1\\.(0|[1-9][0-9]*)$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.title!==void 0){let c=e.title;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/title",schemaPath:"#/properties/title/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.language!==void 0){let c=e.language;if(typeof c=="string"){if(!nZ.test(c)){let h={instancePath:t+"/language",schemaPath:"#/properties/language/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},message:'must match pattern "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/language",schemaPath:"#/properties/language/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.created!==void 0){let c=e.created;if(typeof c=="string"){if(!aZ.test(c)){let h={instancePath:t+"/created",schemaPath:"#/properties/created/pattern",keyword:"pattern",params:{pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},message:'must match pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/created",schemaPath:"#/properties/created/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.generator!==void 0){let c=e.generator;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.name===void 0){let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[h]:o.push(h),s++}if(c.name!==void 0){let h=c.name;if(typeof h=="string"){if(!Na.test(h)){let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[p]:o.push(p),s++}}else{let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[p]:o.push(p),s++}}if(c.version!==void 0&&typeof c.version!="string"){let h={instancePath:t+"/generator/version",schemaPath:"#/properties/generator/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}if(c.url!==void 0&&typeof c.url!="string"){let h={instancePath:t+"/generator/url",schemaPath:"#/properties/generator/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.authors!==void 0){let c=e.authors;if(Array.isArray(c)){let h=c.length;for(let p=0;p<h;p++){let d=c[p];if(d&&typeof d=="object"&&!Array.isArray(d)){if(d.name===void 0){let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[f]:o.push(f),s++}if(d.name!==void 0){let f=d.name;if(typeof f=="string"){if(!Na.test(f)){let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[m]:o.push(m),s++}}if(d.url!==void 0&&typeof d.url!="string"){let f={instancePath:t+"/authors/"+p+"/url",schemaPath:"#/properties/authors/items/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[f]:o.push(f),s++}}}else{let h={instancePath:t+"/authors",schemaPath:"#/properties/authors/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.license!==void 0&&typeof e.license!="string"){let c={instancePath:t+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.presentation!==void 0){let c=e.presentation;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.basemap!==void 0){let h=c.basemap;if(!(h==="standard"||h==="historical"||h==="auto"||h==="none")){let p={instancePath:t+"/presentation/basemap",schemaPath:"#/properties/presentation/properties/basemap/enum",keyword:"enum",params:{allowedValues:rZ.properties.presentation.properties.basemap.enum},message:"must be equal to one of the allowed values"};o===null?o=[p]:o.push(p),s++}}}else{let h={instancePath:t+"/presentation",schemaPath:"#/properties/presentation/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.slides!==void 0){let c=e.slides;if(Array.isArray(c)){if(c.length<1){let p={instancePath:t+"/slides",schemaPath:"#/properties/slides/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};o===null?o=[p]:o.push(p),s++}let h=c.length;for(let p=0;p<h;p++)cl(c[p],{instancePath:t+"/slides/"+p,parentData:c,parentDataProperty:p,rootData:n,dynamicAnchors:a})||(o=o===null?cl.errors:o.concat(cl.errors),s=o.length)}else{let h={instancePath:t+"/slides",schemaPath:"#/properties/slides/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.media!==void 0){let c=e.media;if(c&&typeof c=="object"&&!Array.isArray(c)){for(let h in c){let p=s;if(typeof h=="string"){if(!Of.test(h)){let d={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"',propertyName:h};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",propertyName:h};o===null?o=[d]:o.push(d),s++}var u=p===s;if(!u){let d={instancePath:t+"/media",schemaPath:"#/properties/media/propertyNames",keyword:"propertyNames",params:{propertyName:h},message:"property name must be valid"};o===null?o=[d]:o.push(d),s++}}for(let h in c){let p=c[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.src===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"src"},message:"must have required property 'src'"};o===null?o=[d]:o.push(d),s++}if(p.mime===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"mime"},message:"must have required property 'mime'"};o===null?o=[d]:o.push(d),s++}if(p.src!==void 0){let d=p.src;if(typeof d=="string"){if(!oZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/pattern",keyword:"pattern",params:{pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},message:'must match pattern "^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.mime!==void 0){let d=p.mime;if(typeof d=="string"){if(!sZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/pattern",keyword:"pattern",params:{pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},message:'must match pattern "^[a-z]+/[A-Za-z0-9.+-]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.width!==void 0){let d=p.width;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.height!==void 0){let d=p.height;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.alt!==void 0&&typeof p.alt!="string"){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/alt",schemaPath:"#/$defs/mediaItem/properties/alt/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let h={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.extensions!==void 0){let c=e.extensions;if(c&&typeof c=="object"&&!Array.isArray(c))for(let h in c){let p=c[h];if(!(p&&typeof p=="object"&&!Array.isArray(p))){let d={instancePath:t+"/extensions/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/extensions/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}else{let h={instancePath:t+"/extensions",schemaPath:"#/properties/extensions/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}return Bf.errors=o,s===0}Bf.evaluated={props:{$schema:!0,format:!0,version:!0,title:!0,language:!0,created:!0,generator:!0,authors:!0,license:!0,presentation:!0,slides:!0,media:!0,extensions:!0},dynamicProps:!1,dynamicItems:!1};var lZ=0;function i2(e,t){let r=[],i=[];if(!r2(e)){for(let u of r2.errors??[])r.push({path:u.instancePath,message:uZ(u)});return{valid:!1,errors:r,warnings:i}}let n=e,a=new Set,o=new Set,s=(u,c)=>{o.add(u),Object.prototype.hasOwnProperty.call(n.media,u)||r.push({path:c,message:`refers to media "${u}", which isn't in "media".`})};n.slides.forEach((u,c)=>{a.has(u.id)&&r.push({path:`/slides/${c}/id`,message:`duplicate slide id "${u.id}".`}),a.add(u.id),u.media?.forEach((h,p)=>s(h.ref,`/slides/${c}/media/${p}/ref`)),u.place?.overlays?.forEach((h,p)=>s(h.media,`/slides/${c}/place/overlays/${p}/media`))});for(let[u,c]of Object.entries(n.media)){let h=`/media/${mD(u)}`;t&&!t.has(c.src)&&r.push({path:`${h}/src`,message:`file "${c.src}" is not in the zip.`}),o.has(u)||i.push({path:h,message:`media "${u}" isn't used by any slide or overlay.`})}let l=Lf(n.version);return l&&l.major===1&&l.minor<=lZ&&jf(n,t2,"",i),{valid:r.length===0,errors:r,warnings:i}}function uZ(e){return e.keyword==="pattern"&&e.params.pattern==="\\S"?"must not be empty.":e.keyword==="required"?`is missing required field "${String(e.params.missingProperty)}".`:e.keyword==="const"?`must be ${JSON.stringify(e.params.allowedValue)}.`:e.keyword==="enum"?`must be one of ${e.params.allowedValues.map(t=>JSON.stringify(t)).join(", ")}.`:`${e.message??"is invalid"}.`}function mD(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function cZ(e,t){if(!e.$ref)return e;let r=e.$ref.replace(/^#\/\$defs\//,"");return t.$defs[r]}function jf(e,t,r,i,n=t2){if(t=cZ(t,n),Array.isArray(e)){e.forEach((a,o)=>{let s=t.prefixItems?.[o]??t.items;s&&jf(a,s,`${r}/${o}`,i,n)});return}if(!(typeof e!="object"||e===null))for(let[a,o]of Object.entries(e)){let s=`${r}/${mD(a)}`,l=t.properties?.[a];l?jf(o,l,s,i,n):typeof t.additionalProperties=="object"?jf(o,t.additionalProperties,s,i,n):t.properties&&t.additionalProperties!==!0&&i.push({path:s,message:`unknown field "${a}" (ignored).`})}}var gD={},hZ=(function(e,t,r,i,n){var a=new Worker(gD[t]||(gD[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var s=o.data,l=s.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],n(u,null)}else n(null,s)},a.postMessage(r,i),a}),Dr=Uint8Array,Ro=Uint16Array,vD=Int32Array,o2=new Dr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s2=new Dr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xD=new Dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bD=function(e,t){for(var r=new Ro(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];for(var n=new vD(r[30]),i=1;i<30;++i)for(var a=r[i];a<r[i+1];++a)n[a]=a-r[i]<<5|i;return{b:r,r:n}},wD=bD(o2,2),l2=wD.b,pZ=wD.r;l2[28]=258,pZ[258]=28;var TD=bD(s2,0),SD=TD.b,NJ=TD.r,$f=new Ro(32768);for(Ve=0;Ve<32768;++Ve)Wn=(Ve&43690)>>1|(Ve&21845)<<1,Wn=(Wn&52428)>>2|(Wn&13107)<<2,Wn=(Wn&61680)>>4|(Wn&3855)<<4,$f[Ve]=((Wn&65280)>>8|(Wn&255)<<8)>>1;var Wn,Ve,hl=(function(e,t,r){for(var i=e.length,n=0,a=new Ro(t);n<i;++n)e[n]&&++a[e[n]-1];var o=new Ro(t);for(n=1;n<t;++n)o[n]=o[n-1]+a[n-1]<<1;var s;if(r){s=new Ro(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],h=o[e[n]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)s[$f[h]>>l]=u}else for(s=new Ro(i),n=0;n<i;++n)e[n]&&(s[n]=$f[o[e[n]-1]++]>>15-e[n]);return s}),Dc=new Dr(288);for(Ve=0;Ve<144;++Ve)Dc[Ve]=8;var Ve;for(Ve=144;Ve<256;++Ve)Dc[Ve]=9;var Ve;for(Ve=256;Ve<280;++Ve)Dc[Ve]=7;var Ve;for(Ve=280;Ve<288;++Ve)Dc[Ve]=8;var Ve,ED=new Dr(32);for(Ve=0;Ve<32;++Ve)ED[Ve]=5;var Ve;var CD=hl(Dc,9,1);var PD=hl(ED,5,1),Vf=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Ei=function(e,t,r){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(t&7)&r},Uf=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},DD=function(e){return(e+7)/8|0},qf=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Dr(e.subarray(t,r))};var AD=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_r=function(e,t,r){var i=new Error(t||AD[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,_r),!r)throw i;return i},MD=function(e,t,r,i){var n=e.length,a=i?i.length:0;if(!n||t.f&&!t.l)return r||new Dr(0);var o=!r,s=o||t.i!=2,l=t.i;o&&(r=new Dr(n*3));var u=function(Et){var kt=r.length;if(Et>kt){var st=new Dr(Math.max(kt*2,Et));st.set(r),r=st}},c=t.f||0,h=t.p||0,p=t.b||0,d=t.l,f=t.d,m=t.m,_=t.n,g=n*8;do{if(!d){c=Ei(e,h,1);var y=Ei(e,h+1,3);if(h+=3,y)if(y==1)d=CD,f=PD,m=9,_=5;else if(y==2){var w=Ei(e,h,31)+257,T=Ei(e,h+10,15)+4,S=w+Ei(e,h+5,31)+1;h+=14;for(var E=new Dr(S),P=new Dr(19),D=0;D<T;++D)P[xD[D]]=Ei(e,h+D*3,7);h+=T*3;for(var F=Vf(P),I=(1<<F)-1,C=hl(P,F,1),D=0;D<S;){var A=C[Ei(e,h,I)];h+=A&15;var v=A>>4;if(v<16)E[D++]=v;else{var M=0,L=0;for(v==16?(L=3+Ei(e,h,3),h+=2,M=E[D-1]):v==17?(L=3+Ei(e,h,7),h+=3):v==18&&(L=11+Ei(e,h,127),h+=7);L--;)E[D++]=M}}var j=E.subarray(0,w),O=E.subarray(w);m=Vf(j),_=Vf(O),d=hl(j,m,1),f=hl(O,_,1)}else _r(1);else{var v=DD(h)+4,x=e[v-4]|e[v-3]<<8,b=v+x;if(b>n){l&&_r(0);break}s&&u(p+x),r.set(e.subarray(v,b),p),t.b=p+=x,t.p=h=b*8,t.f=c;continue}if(h>g){l&&_r(0);break}}s&&u(p+131072);for(var Y=(1<<m)-1,ue=(1<<_)-1,pe=h;;pe=h){var M=d[Uf(e,h)&Y],de=M>>4;if(h+=M&15,h>g){l&&_r(0);break}if(M||_r(2),de<256)r[p++]=de;else if(de==256){pe=h,d=null;break}else{var je=de-254;if(de>264){var D=de-257,Se=o2[D];je=Ei(e,h,(1<<Se)-1)+l2[D],h+=Se}var ae=f[Uf(e,h)&ue],oe=ae>>4;ae||_r(3),h+=ae&15;var O=SD[oe];if(oe>3){var Se=s2[oe];O+=Uf(e,h)&(1<<Se)-1,h+=Se}if(h>g){l&&_r(0);break}s&&u(p+131072);var $e=p+je;if(p<O){var qe=a-O,mt=Math.min(O,$e);for(qe+p<0&&_r(3);p<mt;++p)r[p]=i[qe+p]}for(;p<$e;++p)r[p]=r[p-O]}}t.l=d,t.p=pe,t.b=p,t.f=c,d&&(c=1,t.m=m,t.d=f,t.n=_)}while(!c);return p!=r.length&&o?qf(r,0,p):r.subarray(0,p)};var dZ=new Dr(0);var fZ=function(e,t){var r={};for(var i in e)r[i]=e[i];for(var i in t)r[i]=t[i];return r},yD=function(e,t,r){for(var i=e(),n=e.toString(),a=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<i.length;++o){var s=i[o],l=a[o];if(typeof s=="function"){t+=";"+l+"=";var u=s.toString();if(s.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;t+=u.slice(c,u.indexOf("(",c))}else{t+=u;for(var h in s.prototype)t+=";"+l+".prototype."+h+"="+s.prototype[h].toString()}else t+=u}else r[l]=s}return t},Nf=[],mZ=function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},gZ=function(e,t,r,i){if(!Nf[r]){for(var n="",a={},o=e.length-1,s=0;s<o;++s)n=yD(e[s],n,a);Nf[r]={c:yD(e[o],n,a),e:a}}var l=fZ({},Nf[r].e);return hZ(Nf[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,mZ(l),i)},yZ=function(){return[Dr,Ro,vD,o2,s2,xD,l2,SD,CD,PD,$f,AD,hl,Vf,Ei,Uf,DD,qf,_r,MD,u2,ID,kD]};var ID=function(e){return postMessage(e,[e.buffer])},kD=function(e){return e&&{out:e.size&&new Dr(e.size),dictionary:e.dictionary}},_Z=function(e,t,r,i,n,a){var o=gZ(r,i,n,function(s,l){o.terminate(),a(s,l)});return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}};var xn=function(e,t){return e[t]|e[t+1]<<8},Ci=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},n2=function(e,t){return Ci(e,t)+Ci(e,t+4)*4294967296};function vZ(e,t,r){return r||(r=t,t={}),typeof r!="function"&&_r(7),_Z(e,t,[yZ],function(i){return ID(u2(i.data[0],kD(i.data[1])))},1,r)}function u2(e,t){return MD(e,{i:2},t&&t.out,t&&t.dictionary)}var a2=typeof TextDecoder<"u"&&new TextDecoder,xZ=0;try{a2.decode(dZ,{stream:!0}),xZ=1}catch{}var bZ=function(e){for(var t="",r=0;;){var i=e[r++],n=(i>127)+(i>223)+(i>239);if(r+n>e.length)return{s:t,r:qf(e,r-1)};n?n==3?(i=((i&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|i>>10,56320|i&1023)):n&1?t+=String.fromCharCode((i&31)<<6|e[r++]&63):t+=String.fromCharCode((i&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(i)}};function wZ(e,t){if(t){for(var r="",i=0;i<e.length;i+=16384)r+=String.fromCharCode.apply(null,e.subarray(i,i+16384));return r}else{if(a2)return a2.decode(e);var n=bZ(e),a=n.s,r=n.r;return r.length&&_r(8),a}}var TZ=function(e,t){return t+30+xn(e,t+26)+xn(e,t+28)},SZ=function(e,t,r){var i=xn(e,t+28),n=xn(e,t+30),a=wZ(e.subarray(t+46,t+46+i),!(xn(e,t+8)&2048)),o=t+46+i,s=EZ(e,o,n,r,Ci(e,t+20),Ci(e,t+24),Ci(e,t+42)),l=s[0],u=s[1],c=s[2];return[xn(e,t+10),l,u,a,o+n+xn(e,t+32),c]},EZ=function(e,t,r,i,n,a,o){var s=n==4294967295,l=a==4294967295,u=o==4294967295,c=t+r,h=s+l+u;if(i&&h){for(;t+4<c;t+=4+xn(e,t+2))if(xn(e,t)==1)return[s?n2(e,t+4+8*l):n,l?n2(e,t+4):a,u?n2(e,t+4+8*(l+s)):o,1];i<2&&_r(13)}return[n,a,o,0]};var _D=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function zD(e,t,r){r||(r=t,t={}),typeof r!="function"&&_r(7);var i=[],n=function(){for(var _=0;_<i.length;++_)i[_]()},a={},o=function(_,g){_D(function(){r(_,g)})};_D(function(){o=r});for(var s=e.length-22;Ci(e,s)!=101010256;--s)if(!s||e.length-s>65558)return o(_r(13,0,1),null),n;var l=xn(e,s+8);if(l){var u=l,c=Ci(e,s+16),h=Ci(e,s-20)==117853008;if(h){var p=Ci(e,s-12);h=Ci(e,p)==101075792,h&&(u=l=Ci(e,p+32),c=Ci(e,p+48))}for(var d=t&&t.filter,f=function(_){var g=SZ(e,c,h),y=g[0],v=g[1],x=g[2],b=g[3],w=g[4],T=g[5],S=TZ(e,T);c=w;var E=function(D,F){D?(n(),o(D,null)):(F&&(a[b]=F),--l||o(null,a))};if(!d||d({name:b,size:v,originalSize:x,compression:y}))if(!y)E(null,qf(e,S,S+v));else if(y==8){var P=e.subarray(S,S+v);if(x<524288||v>.8*x)try{E(null,u2(P,{out:new Dr(x)}))}catch(D){E(D,null)}else i.push(vZ(P,{size:x},E))}else E(_r(14,"unknown compression type "+y,1),null);else E(null,null)},m=0;m<u;++m)f(m)}else o(null,{});return n}var c2="story.json";async function PZ(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(await e.arrayBuffer())}function DZ(e){return e.endsWith("/")||e.startsWith("__MACOSX/")}async function h2(e,t={}){let r=t.maxTotalBytes??536870912,i=t.maxFiles??1e4,n=await PZ(e),a=0,o=0,s=!1,l=await new Promise((f,m)=>{zD(n,{filter(_){return DZ(_.name)?!1:(o+=1,a+=_.originalSize,(o>i||a>r)&&(s=!0),!s)}},(_,g)=>_?m(_):f(g))}).catch(f=>{throw new Vr("not-a-zip",`Not a readable zip file (${f instanceof Error?f.message:String(f)}).`)});if(s)throw new Vr("too-large","This zip is too large to open as a story.");let u=AZ(Object.keys(l)),c=new Map;for(let[f,m]of Object.entries(l))f.startsWith(u)&&c.set(f.slice(u.length),m);let h;try{h=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c.get(c2)))}catch(f){throw new Vr("bad-json",`story.json is not valid JSON (${f instanceof Error?f.message:String(f)}).`)}let p=e2(h),d=i2(p,c);if(!d.valid)throw new Gf(d.errors);return{doc:p,files:c,warnings:d.warnings}}var Gf=class extends Vr{constructor(t){super("invalid",`story.json is invalid: ${t.slice(0,5).map(r=>`${r.path||"/"} ${r.message}`).join("; ")}${t.length>5?` (and ${t.length-5} more)`:""}`),this.issues=t}};function AZ(e){if(e.includes(c2))return"";let t=e.filter(r=>/^[^/]+\/story\.json$/.test(r));if(t.length===1)return t[0].slice(0,-c2.length);throw new Vr("no-story-json",t.length>1?"This zip holds more than one story.json; a story zip has exactly one.":"This zip has no story.json, so it isn't a story.")}function p2(e,t){let r=Object.prototype.hasOwnProperty.call(e.doc.media,t)?e.doc.media[t]:void 0,i=r&&e.files.get(r.src);return i?new Blob([i],{type:r.mime}):void 0}var He=ur($a(),1);var FD=/^(-?\d{4})(?:-(\d{2}|XX))?(?:-(\d{2}|XX))?[~?%]?$/;function Ac(e){let t=FD.exec(e.trim());return t?Number(t[1]):null}function RD(e){if(!e)return null;let t=e.trim(),r=/^\[(.+)\.\.(.+)\]$/.exec(t);if(r){let n=Ac(r[1]),a=Ac(r[2]);return n!==null&&a!==null?{min:Math.min(n,a),max:Math.max(n,a)}:null}if(t.includes("/")){let[n,a]=t.split("/"),o=n===".."||n==="",s=a===".."||a==="",l=o?void 0:Ac(n),u=s?void 0:Ac(a);return l===null||u===null||l===void 0&&u===void 0?null:l!==void 0&&u!==void 0?{min:Math.min(l,u),max:Math.max(l,u)}:{min:l,max:u}}let i=Ac(t);return i===null?null:{min:i,max:i}}function Zf(e,t){if(!e||t===null)return!0;let r=RD(e.edtf);return r?!(r.min!==void 0&&t<r.min||r.max!==void 0&&t>r.max):!0}function Hf(e){if(!e)return null;let t=e.edtf?FD.exec(e.edtf.trim()):null,r=e.sortYear??(t?Number(t[1]):void 0);if(r===void 0)return null;if(!t||Number(t[1])!==r)return r;let i=t[2]&&t[2]!=="XX"?Number(t[2]):0,n=t[3]&&t[3]!=="XX"?Number(t[3]):0;return i?r+(i-1)/12+(n?(n-1)/365:0):r}function Mc(e,t){if(Array.isArray(e)){if(e.length>=2&&typeof e[0]=="number"&&typeof e[1]=="number"){let[r,i]=e;t[0]=Math.min(t[0],r),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],r),t[3]=Math.max(t[3],i);return}for(let r of e)Mc(r,t)}}function Wf(e,t){if(!e||typeof e!="object")return;let r=e;r.coordinates!==void 0&&Mc(r.coordinates,t),r.geometry&&Wf(r.geometry,t);for(let i of r.geometries??[])Wf(i,t);for(let i of r.features??[])Wf(i,t)}function Ic(e){if(!e)return null;let t=[1/0,1/0,-1/0,-1/0];Wf(e.geometry,t);for(let r of e.overlays??[])Mc(r.corners,t);return Number.isFinite(t[0])?t:null}function Yn(e){if(e?.lat!==void 0&&e.lon!==void 0)return[e.lon,e.lat];let t=Ic(e);return t?[(t[0]+t[2])/2,(t[1]+t[3])/2]:null}function LD(e){let t=[1/0,1/0,-1/0,-1/0],r=new Map;for(let i of e){let n=Yn(i);if(!n)continue;r.set(`${n[0].toFixed(5)},${n[1].toFixed(5)}`,n),Mc(n,t);let a=Ic(i);a&&Mc([[a[0],a[1]],[a[2],a[3]]],t)}return r.size?{points:[...r.values()],bounds:t}:null}var It=ur($a(),1);var $D=ur(UD(),1),qD="https://tiles.openfreemap.org/styles/liberty",GD="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",ZD="https://www.openhistoricalmap.org/map-styles/main/main.json";function zc(e,t){return t!=null?"ohm":e?"dark":"light"}function Qf(e,t){return t!=null?ZD:e?GD:qD}function g2(e,t,r,i=300){let n=e.getContainer();n.style.zIndex||(n.style.zIndex="0");let a=null;try{a=e.getCanvas().toDataURL("image/png")}catch{}if(r(),e.setStyle(t),!a)return;let o=document.createElement("img");o.src=a,o.alt="",Object.assign(o.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"5",pointerEvents:"none",transition:`opacity ${i}ms ease`}),n.appendChild(o),e.once("idle",()=>{requestAnimationFrame(()=>{o.style.opacity="0"}),window.setTimeout(()=>o.remove(),i+50)})}function y2(e,t){(0,$D.filterByDate)(e,String(Math.round(t)))}function _2(e){return e?{surface:"#242424",text:"#c9c9c9",muted:"#828282",border:"#424242",mark:"#3987e5",panel:"rgb(20,20,20)"}:{surface:"#ffffff",text:"#000000",muted:"#868e96",border:"#dee2e6",mark:"#2a78d6",panel:"rgb(255,255,255)"}}var Fc="M12 0C7.03 0 3 4.03 3 9c0 6.25 9 15 9 15s9-8.75 9-15c0-4.97-4.03-9-9-9z";var e8=ur(Xi(),1),Lo="story-shape",XD="story-shape-fill",LZ="story-shape-line",BZ="story-shape-points",OZ="story-shape-labels",jZ="story-overlay-",v2="story-places",NZ="story-places-dots",VZ=60,UZ=6,$Z=13,qZ=40,GZ=1e-5,x2={type:"FeatureCollection",features:[]};function KD(e,t,r){if(t.overview){let[o,s,l,u]=t.overview.bounds;e.fitBounds([[o,s],[l,u]],{maxZoom:9,padding:VZ,duration:r});return}let i=t.place,n=Ic(i);if(n&&Math.max(n[2]-n[0],n[3]-n[1])>=GZ){e.fitBounds([[n[0],n[1]],[n[2],n[3]]],{maxZoom:$Z,padding:qZ,duration:r});return}let a=Yn(i);a&&e.flyTo({center:a,zoom:UZ,essential:!0,duration:r})}function QD(e,t){if(!e)return;let r=Yn(t.place);r&&e.setLngLat(r),e.setOpacity(t.overview?0:r?1:.4)}var ZZ=e=>({type:"FeatureCollection",features:(e?.points??[]).map(t=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:t}}))});function JD({initialCenter:e,current:t,dark:r,colors:i,panelFraction:n,ohmYear:a,resolveMedia:o}){let[s,l]=(0,It.useState)(null),u=(0,It.useRef)(null),c=(0,It.useRef)(null),[h,p]=(0,It.useState)(!1),d=(0,It.useRef)(r);d.current=r;let f=(0,It.useRef)(a);f.current=a;let m=(0,It.useRef)(i);m.current=i;let _=(0,It.useRef)(new Map),g=(0,It.useRef)(zc(r,a)),y=(0,It.useRef)(t);y.current=t,(0,It.useEffect)(()=>{if(!s)return;p(!1),g.current=zc(d.current,f.current);let b=new sD({container:s,style:Qf(d.current,f.current),zoom:5,attributionControl:{compact:!0},canvasContextAttributes:{preserveDrawingBuffer:!0}});u.current=b,b.on("style.load",()=>p(!0)),b.setPadding({top:0,bottom:0,left:0,right:s.clientWidth*n});let w=y.current;return b.jumpTo({center:Yn(w.place)??e}),KD(b,w,0),b.on("load",()=>{let T=m.current,S=document.createElement("div");S.style.width="26px",S.style.height="26px",S.style.transition="opacity 300ms",S.innerHTML=`<svg viewBox="0 0 24 24" width="26" height="26"><path d="${Fc}" fill="${T.mark}" stroke="${T.surface}" stroke-width="1.5" /></svg>`,c.current=new cD({element:S,anchor:"bottom"}).setLngLat(e).addTo(b),QD(c.current,y.current)}),()=>{c.current?.remove(),c.current=null,b.remove(),u.current=null}},[s]),(0,It.useEffect)(()=>{let b=u.current,w=zc(r,a);!b||g.current===w||(g.current=w,g2(b,Qf(r,a),()=>p(!1)))},[r,a]),(0,It.useEffect)(()=>{let b=u.current;!b||!h||a==null||y2(b,a)},[h,a]),(0,It.useEffect)(()=>{let b=u.current;if(!b||!h||b.getSource(Lo))return;let w=m.current;b.addSource(Lo,{type:"geojson",data:x2});let T=["coalesce",["get","color"],w.mark];b.addLayer({id:XD,type:"fill",source:Lo,filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":T,"fill-opacity":["coalesce",["to-number",["get","opacity"],.25],.25]}}),b.addLayer({id:LZ,type:"line",source:Lo,filter:["any",["==",["geometry-type"],"Polygon"],["==",["geometry-type"],"LineString"]],paint:{"line-color":T,"line-width":2}}),b.addLayer({id:BZ,type:"circle",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["!",["has","name"]]],paint:{"circle-radius":5,"circle-color":T,"circle-stroke-width":1,"circle-stroke-color":w.surface}}),b.addLayer({id:OZ,type:"symbol",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["has","name"]],layout:{"text-field":["get","name"],"text-size":12,"text-font":["Noto Sans Regular"],"text-anchor":"left","text-offset":[.6,0]},paint:{"text-color":["coalesce",["get","color"],w.text],"text-halo-color":w.surface,"text-halo-width":1.5}}),b.addSource(v2,{type:"geojson",data:x2}),b.addLayer({id:NZ,type:"circle",source:v2,paint:{"circle-radius":6,"circle-color":w.mark,"circle-stroke-width":2,"circle-stroke-color":w.surface}})},[h]);let v=t.place;(0,It.useEffect)(()=>{let b=u.current;if(!b||!h)return;b.getSource(Lo)?.setData(v?.geometry??x2),b.getSource(v2)?.setData(ZZ(t.overview))},[h,t.key,v,t.overview]),(0,It.useEffect)(()=>{let b=u.current;b&&(QD(c.current,t),KD(b,t,900))},[t.key]);let x=JSON.stringify(v?.overlays??[]);return(0,It.useEffect)(()=>{let b=u.current,w=v?.overlays??[];if(!b||!h||w.length===0)return;let T=!1,S=[];return(async()=>{let E=w.map((P,D)=>({overlay:P,i:D})).sort((P,D)=>(P.overlay.order??P.i)-(D.overlay.order??D.i));for(let{overlay:P,i:D}of E){let F=await o(P.media);if(T)return;if(!F)continue;let I=`${jZ}${D}`;b.getSource(I)||(b.addSource(I,{type:"image",url:F,coordinates:P.corners}),b.addLayer({id:I,type:"raster",source:I},XD),b.setPaintProperty(I,"raster-opacity",P.opacity??1),_.current.set(I,P.date),b.setLayoutProperty(I,"visibility",Zf(P.date,f.current)?"visible":"none"),S.push(I))}})(),()=>{T=!0;for(let E of S)_.current.delete(E),b.getLayer(E)&&b.removeLayer(E),b.getSource(E)&&b.removeSource(E)}},[x,h]),(0,It.useEffect)(()=>{let b=u.current;if(!(!b||!h))for(let[w,T]of _.current)b.getLayer(w)&&b.setLayoutProperty(w,"visibility",Zf(T,a)?"visible":"none")},[a,h]),(0,e8.jsx)("div",{ref:l,style:{position:"absolute",inset:0}})}var Xn=ur(Xi(),1);function b2({mode:e,onModeChange:t,autoYear:r,year:i,onYearChange:n,yearBounds:a,strings:o,colors:s}){let l=[["auto",o.auto],["standard",o.standard],["historical",o.historical]],u={fontSize:12,fontFamily:"inherit"};return(0,Xn.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,whiteSpace:"nowrap"},children:[(0,Xn.jsx)("div",{role:"radiogroup","aria-label":o.mapMode,style:{display:"flex",border:`1px solid ${s.border}`,borderRadius:6,overflow:"hidden",background:s.surface},children:l.map(([c,h])=>(0,Xn.jsx)("button",{type:"button",role:"radio","aria-checked":e===c,onClick:()=>t(c),style:{...u,padding:"4px 10px",border:"none",cursor:"pointer",background:e===c?s.mark:"transparent",color:e===c?"#ffffff":s.text},children:h},c))}),e==="auto"&&(0,Xn.jsx)("span",{style:{...u,color:s.muted},children:r!=null?o.historicalMapYear(r):o.noDateStandardMap}),e==="historical"&&(0,Xn.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,Xn.jsx)("input",{type:"range",min:a[0],max:a[1],step:1,value:i,onChange:c=>n(Number(c.currentTarget.value)),"aria-label":o.historicalYear,style:{width:150,accentColor:s.mark}}),(0,Xn.jsx)("input",{type:"number",min:a[0],max:a[1],step:1,value:i,onChange:c=>{let h=Number(c.currentTarget.value);Number.isFinite(h)&&c.currentTarget.value!==""&&n(Math.round(h))},"aria-label":o.historicalYear,style:{...u,width:70,padding:"3px 4px",border:`1px solid ${s.border}`,borderRadius:4,background:s.surface,color:s.text}})]})]})}var HZ=/\*\*([^\n]+?)\*\*|\*([^\n]+?)\*/g;function WZ(e){let t=[],r=0;for(let i of e.matchAll(HZ)){let n=i.index??0;n>r&&t.push({text:e.slice(r,n)}),i[1]!==void 0?t.push({text:i[1],bold:!0}):t.push({text:i[2],italic:!0}),r=n+i[0].length}return r<e.length&&t.push({text:e.slice(r)}),t}function w2(e){return e.replace(/\r\n?/g,`
825
825
  `).split(/\n[ \t]*\n+/).map(t=>t.replace(/^\n+|\n+$/g,"")).filter(t=>t.length>0).map(t=>t.split(`
826
- `).map(qZ))}var S2={previous:"Previous",next:"Next",close:"Close",mapMode:"Map",auto:"Auto",standard:"Standard",historical:"Historical",historicalMapYear:e=>`Historical map, ${e}`,noDateStandardMap:"No date here \u2014 standard map",historicalYear:"Historical map year",photoOf:(e,t)=>`Photo ${e} of ${t}`},T2={en:S2,de:{previous:"Zur\xFCck",next:"Weiter",close:"Schlie\xDFen",mapMode:"Karte",auto:"Automatisch",standard:"Standard",historical:"Historisch",historicalMapYear:e=>`Historische Karte, ${e}`,noDateStandardMap:"Kein Datum hier \u2014 Standardkarte",historicalYear:"Jahr der historischen Karte",photoOf:(e,t)=>`Foto ${e} von ${t}`},es:{previous:"Anterior",next:"Siguiente",close:"Cerrar",mapMode:"Mapa",auto:"Autom\xE1tico",standard:"Est\xE1ndar",historical:"Hist\xF3rico",historicalMapYear:e=>`Mapa hist\xF3rico, ${e}`,noDateStandardMap:"Sin fecha aqu\xED \u2014 mapa est\xE1ndar",historicalYear:"A\xF1o del mapa hist\xF3rico",photoOf:(e,t)=>`Foto ${e} de ${t}`},fr:{previous:"Pr\xE9c\xE9dent",next:"Suivant",close:"Fermer",mapMode:"Carte",auto:"Auto",standard:"Standard",historical:"Historique",historicalMapYear:e=>`Carte historique, ${e}`,noDateStandardMap:"Pas de date ici \u2014 carte standard",historicalYear:"Ann\xE9e de la carte historique",photoOf:(e,t)=>`Photo ${e} sur ${t}`},nl:{previous:"Vorige",next:"Volgende",close:"Sluiten",mapMode:"Kaart",auto:"Automatisch",standard:"Standaard",historical:"Historisch",historicalMapYear:e=>`Historische kaart, ${e}`,noDateStandardMap:"Geen datum hier \u2014 standaardkaart",historicalYear:"Jaar van de historische kaart",photoOf:(e,t)=>`Foto ${e} van ${t}`}};function E2(...e){for(let t of e){let r=t?.toLowerCase().split(/[-_]/)[0];if(r&&T2[r])return T2[r]}return S2}var GZ=Object.keys(T2);var pl=ur($a(),1);function C2(e){let t=Math.min(...e),r=Math.max(...e);if(r-t<1)return[t-5,t+5];let i=(r-t)*.05;return[t-i,r+i]}function P2(e,t,r){let[i,n]=t,a=n-i;return a>0?(e-i)/a*r:r/2}var ZZ=[1e3,500,250,100,50,25,10,5,2,1],HZ=8;function D2(e,t){let[r,i]=e,n=i-r;if(!(n>0)||t<=0)return[];let a=ZZ.find(s=>n/s>=HZ)??1,o=[];for(let s=Math.ceil(r/a)*a;s<i;s+=a)o.push({x:(s-r)/n*t,label:Rc(s)});return o}function Rc(e){let t=Math.floor(e);return t<0?`${-t} BC`:String(t)}var bn=ur(Xi(),1),Bc=70,Lc=28,em=42,WZ=62,A2=.95;function t8({points:e,currentIndex:t,onSelect:r,colors:i}){let n=(0,pl.useRef)(null),[a,o]=(0,pl.useState)(0);(0,pl.useEffect)(()=>{let c=n.current;if(!c)return;let h=new ResizeObserver(([p])=>o(p.contentRect.width));return h.observe(c),()=>h.disconnect()},[]);let s=Math.max(0,a-Lc*2),l=C2(e.map(c=>c.year)),u=s>0?D2(l,s):[];return(0,bn.jsx)("div",{ref:n,style:{position:"absolute",left:0,right:0,bottom:0,height:Bc,background:i.surface,zIndex:2},children:a>0&&(0,bn.jsxs)("svg",{width:a,height:Bc,style:{display:"block",overflow:"visible"},children:[(0,bn.jsx)("line",{x1:Lc,y1:em,x2:a-Lc,y2:em,stroke:i.border,strokeWidth:1}),u.map(c=>(0,bn.jsx)("text",{x:Lc+c.x,y:WZ,fontSize:15,fill:i.muted,textAnchor:"middle",children:c.label},c.x)),e.map(c=>{let h=Lc+P2(c.year,l,s);return c.index===t?(0,bn.jsx)("path",{d:Fc,transform:`translate(${h-12*A2} ${em-24*A2}) scale(${A2})`,fill:i.mark,stroke:i.text,strokeWidth:1.5,style:{cursor:"pointer"},onClick:()=>r(c.index),children:(0,bn.jsx)("title",{children:Rc(c.year)})},c.index):(0,bn.jsx)("circle",{cx:h,cy:em,r:3.5,fill:i.mark,stroke:i.surface,strokeWidth:1.5,style:{cursor:"pointer"},onClick:()=>r(c.index),children:(0,bn.jsx)("title",{children:Rc(c.year)})},c.index)})]})})}var ce=ur(Xi(),1),r8=.62,dl=56;function YZ(e){return e.presentation?.basemap==="historical"?"auto":"standard"}function XZ({text:e,colors:t}){return(0,ce.jsx)(ce.Fragment,{children:w2(e).map((r,i)=>(0,ce.jsx)("p",{dir:"auto",style:{margin:"0 0 0.6em",color:t.text,lineHeight:1.55},children:r.map((n,a)=>(0,ce.jsxs)("span",{children:[a>0&&(0,ce.jsx)("br",{}),n.map((o,s)=>o.bold?(0,ce.jsx)("b",{children:o.text},s):o.italic?(0,ce.jsx)("i",{children:o.text},s):(0,ce.jsx)("span",{children:o.text},s))]},a))},i))})}function KZ({mediaKey:e,item:t,caption:r,credit:i,resolveMedia:n,colors:a}){let[o,s]=(0,He.useState)(null);return(0,He.useEffect)(()=>{s(null);let l=!1;return n(e,t).then(u=>{l||s(u)},()=>{}),()=>{l=!0}},[e,t,n]),o?(0,ce.jsxs)("figure",{style:{margin:0,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[(0,ce.jsx)("img",{src:o,alt:t.alt??"",width:t.width,height:t.height,style:{maxHeight:"42vh",maxWidth:"100%",width:"auto",height:"auto",objectFit:"contain",borderRadius:4}}),(r||i)&&(0,ce.jsx)("figcaption",{style:{fontSize:13,color:a.muted},children:[r,i&&`\xA9 ${i}`].filter(Boolean).join(" \xB7 ")})]}):null}function QZ({mediaKey:e,item:t,label:r,selected:i,onSelect:n,resolveMedia:a,colors:o}){let[s,l]=(0,He.useState)(null);return(0,He.useEffect)(()=>{let u=!1;return a(e,t).then(c=>{u||l(c)},()=>{}),()=>{u=!0}},[e,t,a]),(0,ce.jsx)("button",{type:"button","aria-label":r,title:r,"aria-pressed":i,onClick:n,style:{width:44,height:44,padding:0,borderRadius:4,overflow:"hidden",cursor:"pointer",border:`2px solid ${i?o.mark:"transparent"}`,background:o.border,opacity:i?1:.7},children:s&&(0,ce.jsx)("img",{src:s,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})})}function JZ({slide:e,story:t,resolveMedia:r,colors:i,strings:n}){let a=(e?.media??[]).filter(c=>Object.prototype.hasOwnProperty.call(t.media,c.ref)),[o,s]=(0,He.useState)(0),l=a[Math.min(o,a.length-1)],u=[e?.date?.text,e?.place?.name].filter(Boolean).join(" \xB7 ");return(0,ce.jsxs)(ce.Fragment,{children:[l&&(0,ce.jsx)(KZ,{mediaKey:l.ref,item:t.media[l.ref],caption:l.caption,credit:l.credit,resolveMedia:r,colors:i}),a.length>1&&(0,ce.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",justifyContent:"center"},children:a.map((c,h)=>(0,ce.jsx)(QZ,{mediaKey:c.ref,item:t.media[c.ref],label:n.photoOf(h+1,a.length),selected:l===c,onSelect:()=>s(h),resolveMedia:r,colors:i},`${h}:${c.ref}`))}),(0,ce.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"center",maxWidth:640,textAlign:"center"},children:[u&&(0,ce.jsx)("div",{dir:"auto",style:{fontSize:14,color:i.muted},children:u}),e?.title&&(0,ce.jsx)("div",{dir:"auto",style:{fontSize:20,fontWeight:700,color:i.text},children:e.title}),e?.text&&(0,ce.jsx)("div",{children:(0,ce.jsx)(XZ,{text:e.text,colors:i})})]})]})}function Oc({label:e,onClick:t,disabled:r,size:i,children:n,style:a}){return(0,ce.jsx)("button",{type:"button","aria-label":e,title:e,onClick:t,disabled:r,style:{width:i,height:i,borderRadius:"50%",border:"none",background:"#25262b",color:"#ffffff",fontSize:i>=48?22:18,cursor:r?"default":"pointer",opacity:r?.35:.8,display:"flex",alignItems:"center",justifyContent:"center",padding:0,fontFamily:"inherit",...a},children:n})}function i8({index:e,total:t,onPrev:r,onNext:i,variant:n,strings:a,colors:o}){if(n==="edge"){let s={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2};return(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(Oc,{label:a.previous,size:56,disabled:e===0,onClick:r,style:{...s,left:24},children:"\u2190"}),(0,ce.jsx)(Oc,{label:a.next,size:56,disabled:e===t-1,onClick:i,style:{...s,right:24},children:"\u2192"})]})}return(0,ce.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,marginTop:16},children:[(0,ce.jsx)(Oc,{label:a.previous,size:34,disabled:e===0,onClick:r,children:"\u2190"}),(0,ce.jsxs)("span",{style:{fontSize:14,color:o.muted},children:[e+1," / ",t]}),(0,ce.jsx)(Oc,{label:a.next,size:34,disabled:e===t-1,onClick:i,children:"\u2192"})]})}function M2({story:e,resolveMedia:t,dark:r=!1,colors:i,strings:n,onClose:a,keyboard:o=!0,onSlideChange:s,renderMapModeControl:l,brand:u,actions:c,initialSlide:h=0}){let p=(0,He.useMemo)(()=>({..._2(r),...i}),[r,i]),d=(0,He.useMemo)(()=>({...E2(e.language,typeof navigator>"u"?void 0:navigator.language),...n}),[e.language,n]),f=(0,He.useRef)(null),m=e.slides,[_,g]=(0,He.useState)(h),y=m[_];(0,He.useEffect)(()=>{g(Math.min(Math.max(h,0),Math.max(m.length-1,0)))},[e,h,m.length]);let v=(0,He.useMemo)(()=>{let ae=[];return m.forEach((oe,$e)=>{let qe=Hf(oe.date);qe!==null&&ae.push({index:$e,year:qe})}),ae},[m]),x=v.length>=2,[b,w]=(0,He.useState)(()=>YZ(e)),[T,S]=(0,He.useState)(()=>new Date().getFullYear()),E=Hf(y?.date),P=E!==null?Math.floor(E):null,D=(0,He.useMemo)(()=>{if(v.length===0){let oe=new Date().getFullYear();return[oe-200,oe]}let ae=v.map(oe=>oe.year);return[Math.floor(Math.min(...ae)),Math.ceil(Math.max(...ae))]},[v]),F=(0,He.useRef)(!1);(0,He.useEffect)(()=>{b==="historical"&&!F.current&&S(P??D[1]),F.current=b==="historical"},[b,P,D]);let I=b==="standard"?null:b==="auto"?P:T,C=()=>g(ae=>Math.max(ae-1,0)),A=()=>g(ae=>Math.min(ae+1,m.length-1)),M=(0,He.useRef)(s);M.current=s,(0,He.useEffect)(()=>{M.current?.(_)},[_]),(0,He.useEffect)(()=>{if(!o)return;let ae=o==="focus"?f.current:window;if(!ae)return;function oe($e){let qe=$e.key,mt=$e.target;mt&&(mt.tagName==="INPUT"||mt.tagName==="TEXTAREA"||mt.isContentEditable)||(qe==="ArrowRight"&&g(Et=>Math.min(Et+1,m.length-1)),qe==="ArrowLeft"&&g(Et=>Math.max(Et-1,0)))}return ae.addEventListener("keydown",oe),()=>ae.removeEventListener("keydown",oe)},[o,m.length]);let L=(0,He.useRef)(null),j={onTouchStart:ae=>{let oe=ae.touches[0];L.current=ae.touches.length===1?{x:oe.clientX,y:oe.clientY}:null},onTouchEnd:ae=>{let oe=L.current;L.current=null;let $e=ae.changedTouches[0];if(!oe||!$e)return;let qe=$e.clientX-oe.x,mt=$e.clientY-oe.y;Math.abs(qe)<50||Math.abs(qe)<Math.abs(mt)*1.5||(qe<0?A():C())}},O=(0,He.useMemo)(()=>LD(m.map(ae=>ae.place)),[m]),Y=(0,He.useMemo)(()=>({key:y?.id??String(_),place:y?.place,overview:_===0&&!Yn(y?.place)?O:null}),[y,_,O]),ue=(0,He.useMemo)(()=>{if(e.presentation?.basemap==="none")return null;for(let ae of m){let oe=Yn(ae.place);if(oe)return oe}return null},[e,m]),pe={mode:b,onModeChange:w,autoYear:P,year:T,onYearChange:S,yearBounds:D},de=(0,He.useMemo)(()=>ae=>{let oe=Object.prototype.hasOwnProperty.call(e.media,ae)?e.media[ae]:void 0;return oe?t(ae,oe):Promise.resolve(null)},[e,t]),je=(0,ce.jsx)(JZ,{slide:y,story:e,resolveMedia:t,colors:p,strings:d},y?.id??_),Se=x&&(0,ce.jsx)(t8,{points:v,currentIndex:_,onSelect:g,colors:p});return(0,ce.jsxs)("div",{ref:f,lang:e.language,tabIndex:o==="focus"?0:void 0,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",background:p.surface,color:p.text},children:[(0,ce.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:dl,zIndex:3,background:r?"rgba(20,20,20,0.55)":"rgba(255,255,255,0.55)"}}),(0,ce.jsxs)("div",{dir:"auto",style:{position:"absolute",top:0,left:20,height:dl,maxWidth:"26%",zIndex:3,display:"flex",alignItems:"center",gap:10,fontWeight:600},children:[u&&(0,ce.jsx)("span",{style:{flex:"none",display:"flex"},children:u}),(0,ce.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title})]}),ue&&(0,ce.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:dl,zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,ce.jsx)("div",{style:{pointerEvents:"auto"},children:l?l(pe):(0,ce.jsx)(b2,{...pe,strings:d,colors:p})})}),c&&(0,ce.jsx)("div",{style:{position:"absolute",top:0,right:a?60:12,height:dl,zIndex:3,display:"flex",alignItems:"center",gap:8},children:c}),a&&(0,ce.jsx)(Oc,{label:d.close,size:36,onClick:a,style:{position:"absolute",top:10,right:12,zIndex:3},children:"\xD7"}),ue?(0,ce.jsxs)("div",{style:{position:"absolute",inset:0},children:[(0,ce.jsx)(JD,{initialCenter:ue,current:Y,dark:r,colors:p,panelFraction:r8,ohmYear:I,resolveMedia:de}),(0,ce.jsx)("div",{style:{position:"absolute",top:0,bottom:0,right:0,width:`${r8*100}%`,zIndex:1,padding:`${dl}px 32px ${x?Bc:32}px`,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:16,overflowY:"auto",background:`linear-gradient(to right, transparent 0%, ${p.panel} 22%)`},...j,children:je}),(0,ce.jsx)(i8,{index:_,total:m.length,onPrev:C,onNext:A,variant:"edge",strings:d,colors:p}),Se]}):(0,ce.jsxs)("div",{style:{position:"absolute",inset:0,overflowY:"auto",boxSizing:"border-box",padding:`${dl+16}px 24px ${x?Bc+16:24}px`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16},...j,children:[je,(0,ce.jsx)(i8,{index:_,total:m.length,onPrev:C,onNext:A,variant:"inline",strings:d,colors:p}),Se]})]})}var Pi=ur(Xi(),1),I2="Gramps Connect Story Viewer",n8="https://dsblank.github.io/gramps-connect-stories/";function a8({size:e=24}){return(0,Pi.jsxs)("svg",{viewBox:"0 0 64 64",width:e,height:e,"aria-hidden":"true",focusable:"false",children:[(0,Pi.jsx)("rect",{width:"64",height:"64",rx:"15",fill:"#1866ba"}),(0,Pi.jsxs)("g",{transform:"translate(9.6 9.6) scale(0.7)",children:[(0,Pi.jsx)("path",{d:"M25 32h7M32 15v34M32 15h7M32 49h7",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round"}),(0,Pi.jsxs)("g",{fill:"#fff",children:[(0,Pi.jsx)("rect",{x:"1",y:"24",width:"24",height:"16",rx:"4"}),(0,Pi.jsx)("rect",{x:"39",y:"7",width:"24",height:"16",rx:"4"}),(0,Pi.jsx)("rect",{x:"39",y:"41",width:"24",height:"16",rx:"4"})]})]})]})}function k2({href:e=n8,target:t="_blank",size:r=24}){return(0,Pi.jsx)("a",{href:e,target:t,rel:t==="_blank"?"noopener":void 0,title:I2,"aria-label":I2,style:{display:"flex",lineHeight:0,borderRadius:6},children:(0,Pi.jsx)(a8,{size:r})})}function eH(){let e=new URL("./maplibre-gl-worker.mjs",import.meta.url);if(e.origin===location.origin)Jv(e.href);else{let t=new Blob([`import ${JSON.stringify(e.href)};`],{type:"text/javascript"});Jv(URL.createObjectURL(t))}}var tH=`
826
+ `).map(WZ))}var S2={previous:"Previous",next:"Next",close:"Close",mapMode:"Map",auto:"Auto",standard:"Standard",historical:"Historical",historicalMapYear:e=>`Historical map, ${e}`,noDateStandardMap:"No date here \u2014 standard map",historicalYear:"Historical map year",photoOf:(e,t)=>`Photo ${e} of ${t}`},T2={en:S2,de:{previous:"Zur\xFCck",next:"Weiter",close:"Schlie\xDFen",mapMode:"Karte",auto:"Automatisch",standard:"Standard",historical:"Historisch",historicalMapYear:e=>`Historische Karte, ${e}`,noDateStandardMap:"Kein Datum hier \u2014 Standardkarte",historicalYear:"Jahr der historischen Karte",photoOf:(e,t)=>`Foto ${e} von ${t}`},es:{previous:"Anterior",next:"Siguiente",close:"Cerrar",mapMode:"Mapa",auto:"Autom\xE1tico",standard:"Est\xE1ndar",historical:"Hist\xF3rico",historicalMapYear:e=>`Mapa hist\xF3rico, ${e}`,noDateStandardMap:"Sin fecha aqu\xED \u2014 mapa est\xE1ndar",historicalYear:"A\xF1o del mapa hist\xF3rico",photoOf:(e,t)=>`Foto ${e} de ${t}`},fr:{previous:"Pr\xE9c\xE9dent",next:"Suivant",close:"Fermer",mapMode:"Carte",auto:"Auto",standard:"Standard",historical:"Historique",historicalMapYear:e=>`Carte historique, ${e}`,noDateStandardMap:"Pas de date ici \u2014 carte standard",historicalYear:"Ann\xE9e de la carte historique",photoOf:(e,t)=>`Photo ${e} sur ${t}`},nl:{previous:"Vorige",next:"Volgende",close:"Sluiten",mapMode:"Kaart",auto:"Automatisch",standard:"Standaard",historical:"Historisch",historicalMapYear:e=>`Historische kaart, ${e}`,noDateStandardMap:"Geen datum hier \u2014 standaardkaart",historicalYear:"Jaar van de historische kaart",photoOf:(e,t)=>`Foto ${e} van ${t}`}};function E2(...e){for(let t of e){let r=t?.toLowerCase().split(/[-_]/)[0];if(r&&T2[r])return T2[r]}return S2}var YZ=Object.keys(T2);var pl=ur($a(),1);function C2(e){let t=Math.min(...e),r=Math.max(...e);if(r-t<1)return[t-5,t+5];let i=(r-t)*.05;return[t-i,r+i]}function P2(e,t,r){let[i,n]=t,a=n-i;return a>0?(e-i)/a*r:r/2}var XZ=[1e3,500,250,100,50,25,10,5,2,1],KZ=8;function D2(e,t){let[r,i]=e,n=i-r;if(!(n>0)||t<=0)return[];let a=XZ.find(s=>n/s>=KZ)??1,o=[];for(let s=Math.ceil(r/a)*a;s<i;s+=a)o.push({x:(s-r)/n*t,label:Rc(s)});return o}function Rc(e){let t=Math.floor(e);return t<0?`${-t} BC`:String(t)}var bn=ur(Xi(),1),Bc=70,Lc=28,em=42,QZ=62,A2=.95;function t8({points:e,currentIndex:t,onSelect:r,colors:i}){let n=(0,pl.useRef)(null),[a,o]=(0,pl.useState)(0);(0,pl.useEffect)(()=>{let c=n.current;if(!c)return;let h=new ResizeObserver(([p])=>o(p.contentRect.width));return h.observe(c),()=>h.disconnect()},[]);let s=Math.max(0,a-Lc*2),l=C2(e.map(c=>c.year)),u=s>0?D2(l,s):[];return(0,bn.jsx)("div",{ref:n,style:{position:"absolute",left:0,right:0,bottom:0,height:Bc,background:i.surface,zIndex:2},children:a>0&&(0,bn.jsxs)("svg",{width:a,height:Bc,style:{display:"block",overflow:"visible"},children:[(0,bn.jsx)("line",{x1:Lc,y1:em,x2:a-Lc,y2:em,stroke:i.border,strokeWidth:1}),u.map(c=>(0,bn.jsx)("text",{x:Lc+c.x,y:QZ,fontSize:15,fill:i.muted,textAnchor:"middle",children:c.label},c.x)),e.map(c=>{let h=Lc+P2(c.year,l,s);return c.index===t?(0,bn.jsx)("path",{d:Fc,transform:`translate(${h-12*A2} ${em-24*A2}) scale(${A2})`,fill:i.mark,stroke:i.text,strokeWidth:1.5,style:{cursor:"pointer"},onClick:()=>r(c.index),children:(0,bn.jsx)("title",{children:Rc(c.year)})},c.index):(0,bn.jsx)("circle",{cx:h,cy:em,r:3.5,fill:i.mark,stroke:i.surface,strokeWidth:1.5,style:{cursor:"pointer"},onClick:()=>r(c.index),children:(0,bn.jsx)("title",{children:Rc(c.year)})},c.index)})]})})}var ce=ur(Xi(),1),r8=.62,dl=56;function JZ(e){return e.presentation?.basemap==="historical"?"auto":"standard"}function eH({text:e,colors:t}){return(0,ce.jsx)(ce.Fragment,{children:w2(e).map((r,i)=>(0,ce.jsx)("p",{dir:"auto",style:{margin:"0 0 0.6em",color:t.text,lineHeight:1.55},children:r.map((n,a)=>(0,ce.jsxs)("span",{children:[a>0&&(0,ce.jsx)("br",{}),n.map((o,s)=>o.bold?(0,ce.jsx)("b",{children:o.text},s):o.italic?(0,ce.jsx)("i",{children:o.text},s):(0,ce.jsx)("span",{children:o.text},s))]},a))},i))})}function tH({mediaKey:e,item:t,caption:r,credit:i,resolveMedia:n,colors:a}){let[o,s]=(0,He.useState)(null);return(0,He.useEffect)(()=>{s(null);let l=!1;return n(e,t).then(u=>{l||s(u)},()=>{}),()=>{l=!0}},[e,t,n]),o?(0,ce.jsxs)("figure",{style:{margin:0,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[(0,ce.jsx)("img",{src:o,alt:t.alt??"",width:t.width,height:t.height,style:{maxHeight:"42vh",maxWidth:"100%",width:"auto",height:"auto",objectFit:"contain",borderRadius:4}}),(r||i)&&(0,ce.jsx)("figcaption",{style:{fontSize:13,color:a.muted},children:[r,i&&`\xA9 ${i}`].filter(Boolean).join(" \xB7 ")})]}):null}function rH({mediaKey:e,item:t,label:r,selected:i,onSelect:n,resolveMedia:a,colors:o}){let[s,l]=(0,He.useState)(null);return(0,He.useEffect)(()=>{let u=!1;return a(e,t).then(c=>{u||l(c)},()=>{}),()=>{u=!0}},[e,t,a]),(0,ce.jsx)("button",{type:"button","aria-label":r,title:r,"aria-pressed":i,onClick:n,style:{width:44,height:44,padding:0,borderRadius:4,overflow:"hidden",cursor:"pointer",border:`2px solid ${i?o.mark:"transparent"}`,background:o.border,opacity:i?1:.7},children:s&&(0,ce.jsx)("img",{src:s,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})})}function iH({slide:e,story:t,resolveMedia:r,colors:i,strings:n}){let a=(e?.media??[]).filter(c=>Object.prototype.hasOwnProperty.call(t.media,c.ref)),[o,s]=(0,He.useState)(0),l=a[Math.min(o,a.length-1)],u=[e?.date?.text,e?.place?.name].filter(Boolean).join(" \xB7 ");return(0,ce.jsxs)(ce.Fragment,{children:[l&&(0,ce.jsx)(tH,{mediaKey:l.ref,item:t.media[l.ref],caption:l.caption,credit:l.credit,resolveMedia:r,colors:i}),a.length>1&&(0,ce.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",justifyContent:"center"},children:a.map((c,h)=>(0,ce.jsx)(rH,{mediaKey:c.ref,item:t.media[c.ref],label:n.photoOf(h+1,a.length),selected:l===c,onSelect:()=>s(h),resolveMedia:r,colors:i},`${h}:${c.ref}`))}),(0,ce.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"center",maxWidth:640,textAlign:"center"},children:[u&&(0,ce.jsx)("div",{dir:"auto",style:{fontSize:14,color:i.muted},children:u}),e?.title&&(0,ce.jsx)("div",{dir:"auto",style:{fontSize:20,fontWeight:700,color:i.text},children:e.title}),e?.text&&(0,ce.jsx)("div",{children:(0,ce.jsx)(eH,{text:e.text,colors:i})})]})]})}function Oc({label:e,onClick:t,disabled:r,size:i,children:n,style:a}){return(0,ce.jsx)("button",{type:"button","aria-label":e,title:e,onClick:t,disabled:r,style:{width:i,height:i,borderRadius:"50%",border:"none",background:"#25262b",color:"#ffffff",fontSize:i>=48?22:18,cursor:r?"default":"pointer",opacity:r?.35:.8,display:"flex",alignItems:"center",justifyContent:"center",padding:0,fontFamily:"inherit",...a},children:n})}function i8({index:e,total:t,onPrev:r,onNext:i,variant:n,strings:a,colors:o}){if(n==="edge"){let s={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2};return(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(Oc,{label:a.previous,size:56,disabled:e===0,onClick:r,style:{...s,left:24},children:"\u2190"}),(0,ce.jsx)(Oc,{label:a.next,size:56,disabled:e===t-1,onClick:i,style:{...s,right:24},children:"\u2192"})]})}return(0,ce.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,marginTop:16},children:[(0,ce.jsx)(Oc,{label:a.previous,size:34,disabled:e===0,onClick:r,children:"\u2190"}),(0,ce.jsxs)("span",{style:{fontSize:14,color:o.muted},children:[e+1," / ",t]}),(0,ce.jsx)(Oc,{label:a.next,size:34,disabled:e===t-1,onClick:i,children:"\u2192"})]})}function M2({story:e,resolveMedia:t,dark:r=!1,colors:i,strings:n,onClose:a,keyboard:o=!0,onSlideChange:s,renderMapModeControl:l,brand:u,actions:c,initialSlide:h=0}){let p=(0,He.useMemo)(()=>({..._2(r),...i}),[r,i]),d=(0,He.useMemo)(()=>({...E2(e.language,typeof navigator>"u"?void 0:navigator.language),...n}),[e.language,n]),f=(0,He.useRef)(null),m=e.slides,[_,g]=(0,He.useState)(h),y=m[_];(0,He.useEffect)(()=>{g(Math.min(Math.max(h,0),Math.max(m.length-1,0)))},[e,h,m.length]);let v=(0,He.useMemo)(()=>{let ae=[];return m.forEach((oe,$e)=>{let qe=Hf(oe.date);qe!==null&&ae.push({index:$e,year:qe})}),ae},[m]),x=v.length>=2,[b,w]=(0,He.useState)(()=>JZ(e)),[T,S]=(0,He.useState)(()=>new Date().getFullYear()),E=Hf(y?.date),P=E!==null?Math.floor(E):null,D=(0,He.useMemo)(()=>{if(v.length===0){let oe=new Date().getFullYear();return[oe-200,oe]}let ae=v.map(oe=>oe.year);return[Math.floor(Math.min(...ae)),Math.ceil(Math.max(...ae))]},[v]),F=(0,He.useRef)(!1);(0,He.useEffect)(()=>{b==="historical"&&!F.current&&S(P??D[1]),F.current=b==="historical"},[b,P,D]);let I=b==="standard"?null:b==="auto"?P:T,C=()=>g(ae=>Math.max(ae-1,0)),A=()=>g(ae=>Math.min(ae+1,m.length-1)),M=(0,He.useRef)(s);M.current=s,(0,He.useEffect)(()=>{M.current?.(_)},[_]),(0,He.useEffect)(()=>{if(!o)return;let ae=o==="focus"?f.current:window;if(!ae)return;function oe($e){let qe=$e.key,mt=$e.target;mt&&(mt.tagName==="INPUT"||mt.tagName==="TEXTAREA"||mt.isContentEditable)||(qe==="ArrowRight"&&g(Et=>Math.min(Et+1,m.length-1)),qe==="ArrowLeft"&&g(Et=>Math.max(Et-1,0)))}return ae.addEventListener("keydown",oe),()=>ae.removeEventListener("keydown",oe)},[o,m.length]);let L=(0,He.useRef)(null),j={onTouchStart:ae=>{let oe=ae.touches[0];L.current=ae.touches.length===1?{x:oe.clientX,y:oe.clientY}:null},onTouchEnd:ae=>{let oe=L.current;L.current=null;let $e=ae.changedTouches[0];if(!oe||!$e)return;let qe=$e.clientX-oe.x,mt=$e.clientY-oe.y;Math.abs(qe)<50||Math.abs(qe)<Math.abs(mt)*1.5||(qe<0?A():C())}},O=(0,He.useMemo)(()=>LD(m.map(ae=>ae.place)),[m]),Y=(0,He.useMemo)(()=>({key:y?.id??String(_),place:y?.place,overview:_===0&&!Yn(y?.place)?O:null}),[y,_,O]),ue=(0,He.useMemo)(()=>{if(e.presentation?.basemap==="none")return null;for(let ae of m){let oe=Yn(ae.place);if(oe)return oe}return null},[e,m]),pe={mode:b,onModeChange:w,autoYear:P,year:T,onYearChange:S,yearBounds:D},de=(0,He.useMemo)(()=>ae=>{let oe=Object.prototype.hasOwnProperty.call(e.media,ae)?e.media[ae]:void 0;return oe?t(ae,oe):Promise.resolve(null)},[e,t]),je=(0,ce.jsx)(iH,{slide:y,story:e,resolveMedia:t,colors:p,strings:d},y?.id??_),Se=x&&(0,ce.jsx)(t8,{points:v,currentIndex:_,onSelect:g,colors:p});return(0,ce.jsxs)("div",{ref:f,lang:e.language,tabIndex:o==="focus"?0:void 0,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",background:p.surface,color:p.text},children:[(0,ce.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:dl,zIndex:3,background:r?"rgba(20,20,20,0.55)":"rgba(255,255,255,0.55)"}}),(0,ce.jsxs)("div",{dir:"auto",style:{position:"absolute",top:0,left:20,height:dl,maxWidth:"26%",zIndex:3,display:"flex",alignItems:"center",gap:10,fontWeight:600},children:[u&&(0,ce.jsx)("span",{style:{flex:"none",display:"flex"},children:u}),(0,ce.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title})]}),ue&&(0,ce.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:dl,zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,ce.jsx)("div",{style:{pointerEvents:"auto"},children:l?l(pe):(0,ce.jsx)(b2,{...pe,strings:d,colors:p})})}),c&&(0,ce.jsx)("div",{style:{position:"absolute",top:0,right:a?60:12,height:dl,zIndex:3,display:"flex",alignItems:"center",gap:8},children:c}),a&&(0,ce.jsx)(Oc,{label:d.close,size:36,onClick:a,style:{position:"absolute",top:10,right:12,zIndex:3},children:"\xD7"}),ue?(0,ce.jsxs)("div",{style:{position:"absolute",inset:0},children:[(0,ce.jsx)(JD,{initialCenter:ue,current:Y,dark:r,colors:p,panelFraction:r8,ohmYear:I,resolveMedia:de}),(0,ce.jsx)("div",{style:{position:"absolute",top:0,bottom:0,right:0,width:`${r8*100}%`,zIndex:1,padding:`${dl}px 32px ${x?Bc:32}px`,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:16,overflowY:"auto",background:`linear-gradient(to right, transparent 0%, ${p.panel} 22%)`},...j,children:je}),(0,ce.jsx)(i8,{index:_,total:m.length,onPrev:C,onNext:A,variant:"edge",strings:d,colors:p}),Se]}):(0,ce.jsxs)("div",{style:{position:"absolute",inset:0,overflowY:"auto",boxSizing:"border-box",padding:`${dl+16}px 24px ${x?Bc+16:24}px`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16},...j,children:[je,(0,ce.jsx)(i8,{index:_,total:m.length,onPrev:C,onNext:A,variant:"inline",strings:d,colors:p}),Se]})]})}var Pi=ur(Xi(),1),I2="Gramps Connect Story Viewer",n8="https://dsblank.github.io/gramps-connect-stories/";function a8({size:e=24}){return(0,Pi.jsxs)("svg",{viewBox:"0 0 64 64",width:e,height:e,"aria-hidden":"true",focusable:"false",children:[(0,Pi.jsx)("rect",{width:"64",height:"64",rx:"15",fill:"#1866ba"}),(0,Pi.jsxs)("g",{transform:"translate(9.6 9.6) scale(0.7)",children:[(0,Pi.jsx)("path",{d:"M25 32h7M32 15v34M32 15h7M32 49h7",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round"}),(0,Pi.jsxs)("g",{fill:"#fff",children:[(0,Pi.jsx)("rect",{x:"1",y:"24",width:"24",height:"16",rx:"4"}),(0,Pi.jsx)("rect",{x:"39",y:"7",width:"24",height:"16",rx:"4"}),(0,Pi.jsx)("rect",{x:"39",y:"41",width:"24",height:"16",rx:"4"})]})]})]})}function k2({href:e=n8,target:t="_blank",size:r=24}){return(0,Pi.jsx)("a",{href:e,target:t,rel:t==="_blank"?"noopener":void 0,title:I2,"aria-label":I2,style:{display:"flex",lineHeight:0,borderRadius:6},children:(0,Pi.jsx)(a8,{size:r})})}function nH(){let e=new URL("./maplibre-gl-worker.mjs",import.meta.url);if(e.origin===location.origin)Jv(e.href);else{let t=new Blob([`import ${JSON.stringify(e.href)};`],{type:"text/javascript"});Jv(URL.createObjectURL(t))}}var aH=`
827
827
  :host { display: block; position: relative; height: 480px; overflow: hidden; font-family: system-ui, sans-serif; }
828
828
  .frame { position: absolute; inset: 0; }
829
829
  .message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
830
830
  text-align: center; font-size: 14px; color: #868e96; }
831
831
  ${pD}
832
- `,rm=class extends HTMLElement{constructor(){super(...arguments);this.frame=null;this.reactRoot=null;this.urls=new Map;this.story=null;this.loadId=0;this.darkQuery=window.matchMedia("(prefers-color-scheme: dark)");this.onSchemeChange=()=>this.render();this.resolveMedia=async r=>{let i=this.urls.get(r);if(i)return i;let n=this.story&&p2(this.story,r);if(!n)return null;let a=URL.createObjectURL(n);return this.urls.set(r,a),a}}connectedCallback(){if(!this.shadowRoot){let r=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=tH,this.frame=document.createElement("div"),this.frame.className="frame",r.append(i,this.frame)}this.reactRoot??(this.reactRoot=(0,o8.createRoot)(this.frame)),this.darkQuery.addEventListener("change",this.onSchemeChange),this.load()}disconnectedCallback(){this.darkQuery.removeEventListener("change",this.onSchemeChange),this.loadId+=1,this.reactRoot?.unmount(),this.reactRoot=null,this.release()}attributeChangedCallback(r,i,n){!this.reactRoot||i===n||(r==="src"?this.load():this.render())}release(){for(let r of this.urls.values())URL.revokeObjectURL(r);this.urls.clear(),this.story=null}message(r){this.reactRoot?.render((0,tm.createElement)("div",{className:"message",role:"status"},r))}async load(){let r=++this.loadId,i=this.getAttribute("src");if(this.release(),!i){this.message("No story: set this element's src to a .story.zip.");return}this.message("Loading story\u2026");try{let n=await fetch(new URL(i,document.baseURI));if(!n.ok)throw new Error(`couldn't fetch it (${n.status})`);let a=await h2(await n.blob());if(r!==this.loadId)return;this.story=a,this.render()}catch(n){if(r!==this.loadId)return;this.message(`This story couldn't be opened: ${n instanceof Error?n.message:String(n)}`)}}initialSlide(){let r=this.getAttribute("slide");if(!r||!this.story)return 0;let i=this.story.doc.slides.findIndex(a=>a.id===r);if(i>=0)return i;let n=Number(r);return Number.isInteger(n)?n:0}render(){if(!this.reactRoot||!this.story)return;let r=this.getAttribute("theme"),i=r==="dark"||r!=="light"&&this.darkQuery.matches;this.reactRoot.render((0,tm.createElement)(M2,{story:this.story.doc,resolveMedia:this.resolveMedia,dark:i,keyboard:"focus",initialSlide:this.initialSlide(),brand:this.hasAttribute("brand")?(0,tm.createElement)(k2):void 0}))}};rm.observedAttributes=["src","slide","theme","brand"];eH();customElements.get("gramps-connect-story")||customElements.define("gramps-connect-story",rm);
832
+ `,rm=class extends HTMLElement{constructor(){super(...arguments);this.frame=null;this.reactRoot=null;this.urls=new Map;this.story=null;this.loadId=0;this.darkQuery=window.matchMedia("(prefers-color-scheme: dark)");this.onSchemeChange=()=>this.render();this.resolveMedia=async r=>{let i=this.urls.get(r);if(i)return i;let n=this.story&&p2(this.story,r);if(!n)return null;let a=URL.createObjectURL(n);return this.urls.set(r,a),a}}connectedCallback(){if(!this.shadowRoot){let r=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=aH,this.frame=document.createElement("div"),this.frame.className="frame",r.append(i,this.frame)}this.reactRoot??(this.reactRoot=(0,o8.createRoot)(this.frame)),this.darkQuery.addEventListener("change",this.onSchemeChange),this.load()}disconnectedCallback(){this.darkQuery.removeEventListener("change",this.onSchemeChange),this.loadId+=1,this.reactRoot?.unmount(),this.reactRoot=null,this.release()}attributeChangedCallback(r,i,n){!this.reactRoot||i===n||(r==="src"?this.load():this.render())}release(){for(let r of this.urls.values())URL.revokeObjectURL(r);this.urls.clear(),this.story=null}message(r){this.reactRoot?.render((0,tm.createElement)("div",{className:"message",role:"status"},r))}async load(){let r=++this.loadId,i=this.getAttribute("src");if(this.release(),!i){this.message("No story: set this element's src to a .story.zip.");return}this.message("Loading story\u2026");try{let n=await fetch(new URL(i,document.baseURI));if(!n.ok)throw new Error(`couldn't fetch it (${n.status})`);let a=await h2(await n.blob());if(r!==this.loadId)return;this.story=a,this.render()}catch(n){if(r!==this.loadId)return;this.message(`This story couldn't be opened: ${n instanceof Error?n.message:String(n)}`)}}initialSlide(){let r=this.getAttribute("slide");if(!r||!this.story)return 0;let i=this.story.doc.slides.findIndex(a=>a.id===r);if(i>=0)return i;let n=Number(r);return Number.isInteger(n)?n:0}render(){if(!this.reactRoot||!this.story)return;let r=this.getAttribute("theme"),i=r==="dark"||r!=="light"&&this.darkQuery.matches;this.reactRoot.render((0,tm.createElement)(M2,{story:this.story.doc,resolveMedia:this.resolveMedia,dark:i,keyboard:"focus",initialSlide:this.initialSlide(),brand:this.hasAttribute("brand")?(0,tm.createElement)(k2):void 0}))}};rm.observedAttributes=["src","slide","theme","brand"];nH();customElements.get("gramps-connect-story")||customElements.define("gramps-connect-story",rm);
833
833
  /*! For license information please see embed.js.LEGAL.txt */