yio-map 0.8.0
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/LICENSE +21 -0
- package/README.md +101 -0
- package/dist/YioMap.d.ts +84 -0
- package/dist/YioMap.d.ts.map +1 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/controls/LayerControl.d.ts +48 -0
- package/dist/controls/LayerControl.d.ts.map +1 -0
- package/dist/controls/UserEditInteraction.d.ts +33 -0
- package/dist/controls/UserEditInteraction.d.ts.map +1 -0
- package/dist/controls/UserPinInteraction.d.ts +18 -0
- package/dist/controls/UserPinInteraction.d.ts.map +1 -0
- package/dist/controls/UserSelectInteraction.d.ts +18 -0
- package/dist/controls/UserSelectInteraction.d.ts.map +1 -0
- package/dist/controls/YioAttribution.d.ts +3 -0
- package/dist/controls/YioAttribution.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/tiles/14/8901/5667.pbf +0 -0
- package/dist/tiles/14/8902/5667.pbf +0 -0
- package/dist/yio-map.js +1598 -0
- package/dist/yio-map.umd.cjs +144 -0
- package/package.json +72 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
(function(fe,xe){typeof exports=="object"&&typeof module<"u"?module.exports=xe():typeof define=="function"&&define.amd?define(xe):(fe=typeof globalThis<"u"?globalThis:fe||self,fe["yio-map"]=xe())})(this,function(){"use strict";var eC=Object.defineProperty;var EA=fe=>{throw TypeError(fe)};var tC=(fe,xe,Ve)=>xe in fe?eC(fe,xe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):fe[xe]=Ve;var Mi=(fe,xe,Ve)=>tC(fe,typeof xe!="symbol"?xe+"":xe,Ve),Ou=(fe,xe,Ve)=>xe.has(fe)||EA("Cannot "+Ve);var L=(fe,xe,Ve)=>(Ou(fe,xe,"read from private field"),Ve?Ve.call(fe):xe.get(fe)),_e=(fe,xe,Ve)=>xe.has(fe)?EA("Cannot add the same private member more than once"):xe instanceof WeakSet?xe.add(fe):xe.set(fe,Ve),Re=(fe,xe,Ve,As)=>(Ou(fe,xe,"write to private field"),As?As.call(fe,Ve):xe.set(fe,Ve),Ve),At=(fe,xe,Ve)=>(Ou(fe,xe,"access private method"),Ve);/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/var xA,ci,In,gs,CA,bA,ur,Ht,hi,Ri,Pn,dr,ui,TA,Yi,Ki,RA,SA,Zi,Gu,vo,fr,vl,IA,lt,Co,gr,Qi,pr,Ar,Xt,bo,To,mr,yr,Mn,Fn,Yt,PA,Bu,Nu,MA;const fe=globalThis,xe=fe.ShadowRoot&&(fe.ShadyCSS===void 0||fe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ve=Symbol(),As=new WeakMap;let ju=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Ve)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(xe&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=As.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&As.set(t,e))}return e}toString(){return this.cssText}};const bl=n=>new ju(typeof n=="string"?n:n+"",void 0,Ve),FA=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((i,r,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1],n[0]);return new ju(t,n,Ve)},LA=(n,e)=>{if(xe)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),r=fe.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},zu=xe?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return bl(t)})(n):n;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const{is:kA,defineProperty:DA,getOwnPropertyDescriptor:OA,getOwnPropertyNames:GA,getOwnPropertySymbols:BA,getPrototypeOf:NA}=Object,tn=globalThis,Uu=tn.trustedTypes,jA=Uu?Uu.emptyScript:"",Tl=tn.reactiveElementPolyfillSupport,ms=(n,e)=>n,Rl={toAttribute(n,e){switch(e){case Boolean:n=n?jA:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Vu=(n,e)=>!kA(n,e),Wu={attribute:!0,type:String,converter:Rl,reflect:!1,hasChanged:Vu};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),tn.litPropertyMetadata??(tn.litPropertyMetadata=new WeakMap);class xr extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Wu){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&DA(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:s}=OA(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Wu}static _$Ei(){if(this.hasOwnProperty(ms("elementProperties")))return;const e=NA(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ms("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ms("properties"))){const t=this.properties,i=[...GA(t),...BA(t)];for(const r of i)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)t.unshift(zu(r))}else e!==void 0&&t.push(zu(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return LA(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var s;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const o=(((s=i.converter)==null?void 0:s.toAttribute)!==void 0?i.converter:Rl).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var s;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:Rl;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Vu)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,o]of r)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(r=>{var s;return(s=r.hostUpdate)==null?void 0:s.call(r)}),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}xr.elementStyles=[],xr.shadowRootOptions={mode:"open"},xr[ms("elementProperties")]=new Map,xr[ms("finalized")]=new Map,Tl==null||Tl({ReactiveElement:xr}),(tn.reactiveElementVersions??(tn.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const ys=globalThis,Ro=ys.trustedTypes,Hu=Ro?Ro.createPolicy("lit-html",{createHTML:n=>n}):void 0,Xu="$lit$",nn=`lit$${Math.random().toFixed(9).slice(2)}$`,Yu="?"+nn,zA=`<${Yu}>`,Ln=document,_s=()=>Ln.createComment(""),xs=n=>n===null||typeof n!="object"&&typeof n!="function",Sl=Array.isArray,UA=n=>Sl(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Il=`[
|
|
14
|
+
\f\r]`,Es=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ku=/-->/g,Zu=/>/g,kn=RegExp(`>|${Il}(?:([^\\s"'>=/]+)(${Il}*=${Il}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Qu=/'/g,qu=/"/g,Ju=/^(?:script|style|textarea|title)$/i,VA=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),WA=VA(1),Er=Symbol.for("lit-noChange"),$e=Symbol.for("lit-nothing"),$u=new WeakMap,Dn=Ln.createTreeWalker(Ln,129);function ed(n,e){if(!Sl(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hu!==void 0?Hu.createHTML(e):e}const HA=(n,e)=>{const t=n.length-1,i=[];let r,s=e===2?"<svg>":e===3?"<math>":"",o=Es;for(let a=0;a<t;a++){const l=n[a];let c,h,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,h=o.exec(l),h!==null);)d=o.lastIndex,o===Es?h[1]==="!--"?o=Ku:h[1]!==void 0?o=Zu:h[2]!==void 0?(Ju.test(h[2])&&(r=RegExp("</"+h[2],"g")),o=kn):h[3]!==void 0&&(o=kn):o===kn?h[0]===">"?(o=r??Es,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?kn:h[3]==='"'?qu:Qu):o===qu||o===Qu?o=kn:o===Ku||o===Zu?o=Es:(o=kn,r=void 0);const g=o===kn&&n[a+1].startsWith("/>")?" ":"";s+=o===Es?l+zA:u>=0?(i.push(c),l.slice(0,u)+Xu+l.slice(u)+nn+g):l+nn+(u===-2?a:g)}return[ed(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class ws{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0;const a=e.length-1,l=this.parts,[c,h]=HA(e,t);if(this.el=ws.createElement(c,i),Dn.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=Dn.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const u of r.getAttributeNames())if(u.endsWith(Xu)){const d=h[o++],g=r.getAttribute(u).split(nn),f=/([.?@])?(.*)/.exec(d);l.push({type:1,index:s,name:f[2],strings:g,ctor:f[1]==="."?YA:f[1]==="?"?KA:f[1]==="@"?ZA:So}),r.removeAttribute(u)}else u.startsWith(nn)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(Ju.test(r.tagName)){const u=r.textContent.split(nn),d=u.length-1;if(d>0){r.textContent=Ro?Ro.emptyScript:"";for(let g=0;g<d;g++)r.append(u[g],_s()),Dn.nextNode(),l.push({type:2,index:++s});r.append(u[d],_s())}}}else if(r.nodeType===8)if(r.data===Yu)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(nn,u+1))!==-1;)l.push({type:7,index:s}),u+=nn.length-1}s++}}static createElement(e,t){const i=Ln.createElement("template");return i.innerHTML=e,i}}function wr(n,e,t=n,i){var o,a;if(e===Er)return e;let r=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const s=xs(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=r:t._$Cl=r),r!==void 0&&(e=wr(n,r._$AS(n,e.values),r,i)),e}class XA{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=((e==null?void 0:e.creationScope)??Ln).importNode(t,!0);Dn.currentNode=r;let s=Dn.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Pl(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new QA(s,this,e)),this._$AV.push(c),l=i[++a]}o!==(l==null?void 0:l.index)&&(s=Dn.nextNode(),o++)}return Dn.currentNode=Ln,r}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}let Pl=class wA{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=$e,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=wr(this,e,t),xs(e)?e===$e||e==null||e===""?(this._$AH!==$e&&this._$AR(),this._$AH=$e):e!==this._$AH&&e!==Er&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):UA(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==$e&&xs(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ln.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ws.createElement(ed(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(t);else{const o=new XA(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=$u.get(e.strings);return t===void 0&&$u.set(e.strings,t=new ws(e)),t}k(e){Sl(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new wA(this.O(_s()),this.O(_s()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}};class So{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=$e,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$e}_$AI(e,t=this,i,r){const s=this.strings;let o=!1;if(s===void 0)e=wr(this,e,t,0),o=!xs(e)||e!==this._$AH&&e!==Er,o&&(this._$AH=e);else{const a=e;let l,c;for(e=s[0],l=0;l<s.length-1;l++)c=wr(this,a[i+l],t,l),c===Er&&(c=this._$AH[l]),o||(o=!xs(c)||c!==this._$AH[l]),c===$e?e=$e:e!==$e&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!r&&this.j(e)}j(e){e===$e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class YA extends So{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===$e?void 0:e}}class KA extends So{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==$e)}}class ZA extends So{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=wr(this,e,t,0)??$e)===Er)return;const i=this._$AH,r=e===$e&&i!==$e||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==$e&&(i===$e||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class QA{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){wr(this,e)}}const Ml=ys.litHtmlPolyfillSupport;Ml==null||Ml(ws,Pl),(ys.litHtmlVersions??(ys.litHtmlVersions=[])).push("3.2.1");const qA=(n,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let r=i._$litPart$;if(r===void 0){const s=(t==null?void 0:t.renderBefore)??null;i._$litPart$=r=new Pl(e.insertBefore(_s(),s),s,void 0,t??{})}return r._$AI(n),r};/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2017 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
+
*/class vs extends xr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qA(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Er}}vs._$litElement$=!0,vs.finalized=!0,(xA=globalThis.litElementHydrateSupport)==null||xA.call(globalThis,{LitElement:vs});const Fl=globalThis.litElementPolyfillSupport;Fl==null||Fl({LitElement:vs}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");const JA=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}',$A=".layer-control{bottom:.5em;left:.5em}.layer-control>button{cursor:pointer;display:flex;align-items:center;justify-content:center}.svgContainer{width:22px;height:22px;scale:.8}.ol-touch .ol-control button>.svgContainer{scale:1.2}.layer-selection{position:absolute;bottom:0;display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;z-index:10;padding:10px 0 10px 10px;background-color:#fff}.layer-selection.fade-out{opacity:0;transition:opacity .15s ease-out}.layer-selection.hidden{display:none}.image-box{cursor:pointer;text-align:center;width:100px;height:100px;margin-right:10px;border-radius:4px;border:2px solid #bdbdbd}.image-box.selected{border:2px solid #474747}.image-box:hover{box-shadow:0 0 6px #949494}.image-box img{pointer-events:none;width:100px;height:100px;border-radius:4px;object-fit:cover}",ot={ADD:"add",REMOVE:"remove"},vr={PROPERTYCHANGE:"propertychange"},H={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Cs{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function em(n,e,t){let i,r;t=t||fi;let s=0,o=n.length,a=!1;for(;s<o;)i=s+(o-s>>1),r=+t(n[i],e),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function fi(n,e){return n>e?1:n<e?-1:0}function tm(n,e){return n<e?1:n>e?-1:0}function Io(n,e,t){if(n[0]<=e)return 0;const i=n.length;if(e<=n[i-1])return i-1;if(typeof t=="function"){for(let r=1;r<i;++r){const s=n[r];if(s===e)return r;if(s<e)return t(e,n[r-1],s)>0?r-1:r}return i-1}if(t>0){for(let r=1;r<i;++r)if(n[r]<e)return r-1;return i-1}if(t<0){for(let r=1;r<i;++r)if(n[r]<=e)return r;return i-1}for(let r=1;r<i;++r){if(n[r]==e)return r;if(n[r]<e)return n[r-1]-e<e-n[r]?r-1:r}return i-1}function im(n,e,t){for(;e<t;){const i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function gi(n,e){const t=Array.isArray(e)?e:[e],i=t.length;for(let r=0;r<i;r++)n[n.length]=t[r]}function Fi(n,e){const t=n.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function nm(n,e,t){const i=e||fi;return n.every(function(r,s){if(s===0)return!0;const o=i(n[s-1],r);return!(o>0||o===0)})}function Cr(){return!0}function br(){return!1}function bs(){}function td(n){let e,t,i;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==i||!Fi(r,t))&&(i=this,t=r,e=n.apply(this,arguments)),e}}function On(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}function Ts(n){for(const e in n)delete n[e]}function rn(n){let e;for(e in n)return!1;return!e}class Tt{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Rs extends Cs{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const i=this.listeners_||(this.listeners_={}),r=i[e]||(i[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){const t=typeof e=="string",i=t?e:e.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=t?new Tt(e):e;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=r.length;c<h;++c)if("handleEvent"in r[c]?l=r[c].handleEvent(s):l=r[c].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let c=a[i];for(delete a[i];c--;)this.removeEventListener(i,bs);delete o[i]}return l}disposeInternal(){this.listeners_&&Ts(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;const i=this.listeners_[e];if(!i)return;const r=i.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[r]=bs,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}function oe(n,e,t,i,r){if(r){const o=t;t=function(a){return n.removeEventListener(e,t),o.call(i??this,a)}}else i&&i!==n&&(t=t.bind(i));const s={target:n,type:e,listener:t};return n.addEventListener(e,t),s}function Po(n,e,t,i){return oe(n,e,t,i,!0)}function ve(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Ts(n))}class Ss extends Rs{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(H.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=oe(this,e[s],t);return r}return oe(this,e,t)}onceInternal(e,t){let i;if(Array.isArray(e)){const r=e.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=Po(this,e[s],t)}else i=Po(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)rm(i);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],t);else this.removeEventListener(e,t)}}Ss.prototype.on,Ss.prototype.once,Ss.prototype.un;function rm(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)ve(n[e]);else ve(n)}function Q(){throw new Error("Unimplemented abstract method.")}let sm=0;function Y(n){return n.ol_uid||(n.ol_uid=String(++sm))}class id extends Tt{constructor(e,t,i){super(e),this.key=t,this.oldValue=i}}class pi extends Ss{constructor(e){super(),this.on,this.once,this.un,Y(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let i;i=`change:${e}`,this.hasListener(i)&&this.dispatchEvent(new id(i,e,t)),i=vr.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new id(i,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,i){const r=this.values_||(this.values_={});if(i)r[e]=t;else{const s=r[e];r[e]=t,s!==t&&this.notify(e,s)}}setProperties(e,t){for(const i in e)this.set(i,e[i],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const i=this.values_[e];delete this.values_[e],rn(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}const nd={LENGTH:"length"};class Mo extends Tt{constructor(e,t,i){super(e),this.element=t,this.index=i}}class Gt extends pi{constructor(e,t){if(super(),this.on,this.once,this.un,t=t||{},this.unique_=!!t.unique,this.array_=e||[],this.unique_)for(let i=0,r=this.array_.length;i<r;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,i=e.length;t<i;++t)this.push(e[t]);return this}forEach(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)e(t[i],i,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(nd.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new Mo(ot.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)if(t[i]===e)return this.removeAt(i)}removeAt(e){if(e<0||e>=this.getLength())return;const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new Mo(ot.REMOVE,t,e)),t}setAt(e,t){const i=this.getLength();if(e>=i){this.insertAt(e,t);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t,e);const r=this.array_[e];this.array_[e]=t,this.dispatchEvent(new Mo(ot.REMOVE,r,e)),this.dispatchEvent(new Mo(ot.ADD,t,e))}updateLength_(){this.set(nd.LENGTH,this.array_.length)}assertUnique_(e,t){for(let i=0,r=this.array_.length;i<r;++i)if(this.array_[i]===e&&i!==t)throw new Error("Duplicate item added to a unique collection")}}class Tr extends Tt{constructor(e,t,i){super(e),this.map=t,this.frameState=i!==void 0?i:null}}class Li extends Tr{constructor(e,t,i,r,s,o){super(e,t,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0?r:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const ae={SINGLECLICK:"singleclick",CLICK:H.CLICK,DBLCLICK:H.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Gn=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Gn.includes("safari")&&!Gn.includes("chrom")&&(Gn.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Gn));const om=Gn.includes("webkit")&&!Gn.includes("edge"),rd=Gn.includes("macintosh"),am=typeof devicePixelRatio<"u"?devicePixelRatio:1,Ll=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,sd=typeof Image<"u"&&Image.prototype.decode,lm=typeof createImageBitmap=="function",od=function(){let n=!1;try{const e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n}(),kl={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class cm extends Rs{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=oe(i,kl.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=oe(i,kl.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(H.TOUCHMOVE,this.boundHandleTouchMove_,od?{passive:!1}:!1)}emulateClick_(e){let t=new Li(ae.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new Li(ae.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new Li(ae.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const t=e,i=t.pointerId;if(t.type==ae.POINTERUP||t.type==ae.POINTERCANCEL){delete this.trackedTouches_[i];for(const r in this.trackedTouches_)if(this.trackedTouches_[r].target!==t.target){delete this.trackedTouches_[r];break}}else(t.type==ae.POINTERDOWN||t.type==ae.POINTERMOVE)&&(this.trackedTouches_[i]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new Li(ae.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(ve),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const t=new Li(ae.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(oe(i,ae.POINTERMOVE,this.handlePointerMove_,this),oe(i,ae.POINTERUP,this.handlePointerUp_,this),oe(this.element_,ae.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(oe(this.element_.getRootNode(),ae.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new Li(ae.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Li(ae.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){const t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(ve(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(H.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(ve(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(ve),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const sn={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},at={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function ge(n,e){if(!n)throw new Error(e)}const Fo=1/0;class hm{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Ts(this.queuedElements_)}dequeue(){const e=this.elements_,t=this.priorities_,i=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));const r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(e){ge(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const t=this.priorityFunction_(e);return t!=Fo?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const t=this.elements_,i=this.priorities_,r=t.length,s=t[e],o=i[e],a=e;for(;e<r>>1;){const l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),h=c<r&&i[c]<i[l]?c:l;t[e]=t[h],i[e]=i[h],e=h}t[e]=s,i[e]=o,this.siftDown_(a,e)}siftDown_(e,t){const i=this.elements_,r=this.priorities_,s=i[t],o=r[t];for(;t>e;){const a=this.getParentIndex_(t);if(r[a]>o)i[t]=i[a],r[t]=r[a],t=a;else break}i[t]=s,r[t]=o}reprioritize(){const e=this.priorityFunction_,t=this.elements_,i=this.priorities_;let r=0;const s=t.length;let o,a,l;for(a=0;a<s;++a)o=t[a],l=e(o),l==Fo?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=l,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}class ad extends hm{constructor(e,t){super(i=>e.apply(null,i),i=>i[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const t=super.enqueue(e);return t&&e[0].addEventListener(H.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===G.LOADED||i===G.ERROR||i===G.EMPTY){i!==G.ERROR&&t.removeEventListener(H.CHANGE,this.boundHandleTileChange_);const r=t.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let i=0;for(;this.tilesLoading_<e&&i<t&&this.getCount()>0;){const r=this.dequeue()[0],s=r.getKey();r.getState()===G.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,r.load())}}}function um(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return Fo;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}const ke={ANIMATING:0,INTERACTING:1},$t={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Pe(n,e,t){return Math.min(Math.max(n,e),t)}function dm(n,e,t,i,r,s){const o=r-t,a=s-i;if(o!==0||a!==0){const l=((n-t)*o+(e-i)*a)/(o*o+a*a);l>1?(t=r,i=s):l>0&&(t+=o*l,i+=a*l)}return ki(n,e,t,i)}function ki(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function fm(n){const e=n.length;for(let i=0;i<e;i++){let r=i,s=Math.abs(n[i][i]);for(let a=i+1;a<e;a++){const l=Math.abs(n[a][i]);l>s&&(s=l,r=a)}if(s===0)return null;const o=n[r];n[r]=n[i],n[i]=o;for(let a=i+1;a<e;a++){const l=-n[a][i]/n[i][i];for(let c=i;c<e+1;c++)i==c?n[a][c]=0:n[a][c]+=l*n[i][c]}}const t=new Array(e);for(let i=e-1;i>=0;i--){t[i]=n[i][e]/n[i][i];for(let r=i-1;r>=0;r--)n[r][e]-=n[r][i]*t[i]}return t}function ld(n){return n*180/Math.PI}function on(n){return n*Math.PI/180}function an(n,e){const t=n%e;return t*e<0?t+e:t}function Rt(n,e,t){return n+t*(e-n)}function Is(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function Lo(n,e){return Math.floor(Is(n,e))}function ln(n,e){return Math.ceil(Is(n,e))}function Dl(n,e,t){if(n>=e&&n<t)return n;const i=t-e;return((n-e)%i+i)%i+e}function cd(n,e,t){return function(i,r,s,o,a){if(!i)return;if(!r&&!e)return i;const l=e?0:s[0]*r,c=e?0:s[1]*r,h=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+h,g=n[2]-l/2+h,f=n[1]+c/2+u,p=n[3]-c/2+u;d>g&&(d=(g+d)/2,g=d),f>p&&(f=(p+f)/2,p=f);let A=Pe(i[0],d,g),m=Pe(i[1],f,p);if(o&&t&&r){const y=30*r;A+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-g)/y),m+=-y*Math.log(1+Math.max(0,f-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-p)/y)}return[A,m]}}function gm(n){return n}const et={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ht(n){const e=St();for(let t=0,i=n.length;t<i;++t)Ms(e,n[t]);return e}function pm(n,e,t){const i=Math.min.apply(null,n),r=Math.min.apply(null,e),s=Math.max.apply(null,n),o=Math.max.apply(null,e);return Ai(i,r,s,o,t)}function Di(n,e,t){return t?(t[0]=n[0]-e,t[1]=n[1]-e,t[2]=n[2]+e,t[3]=n[3]+e,t):[n[0]-e,n[1]-e,n[2]+e,n[3]+e]}function hd(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function Bn(n,e,t){let i,r;return e<n[0]?i=n[0]-e:n[2]<e?i=e-n[2]:i=0,t<n[1]?r=n[1]-t:n[3]<t?r=t-n[3]:r=0,i*i+r*r}function Nn(n,e){return Ol(n,e[0],e[1])}function Oi(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function Ol(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function Gl(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let l=et.UNKNOWN;return o<t?l=l|et.LEFT:o>r&&(l=l|et.RIGHT),a<i?l=l|et.BELOW:a>s&&(l=l|et.ABOVE),l===et.UNKNOWN&&(l=et.INTERSECTING),l}function St(){return[1/0,1/0,-1/0,-1/0]}function Ai(n,e,t,i,r){return r?(r[0]=n,r[1]=e,r[2]=t,r[3]=i,r):[n,e,t,i]}function Rr(n){return Ai(1/0,1/0,-1/0,-1/0,n)}function Ps(n,e){const t=n[0],i=n[1];return Ai(t,i,t,i,e)}function Bl(n,e,t,i,r){const s=Rr(r);return ud(s,n,e,t,i)}function Gi(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function Nl(n,e){return e[0]<n[0]&&(n[0]=e[0]),e[2]>n[2]&&(n[2]=e[2]),e[1]<n[1]&&(n[1]=e[1]),e[3]>n[3]&&(n[3]=e[3]),n}function Ms(n,e){e[0]<n[0]&&(n[0]=e[0]),e[0]>n[2]&&(n[2]=e[0]),e[1]<n[1]&&(n[1]=e[1]),e[1]>n[3]&&(n[3]=e[1])}function ud(n,e,t,i,r){for(;t<i;t+=r)Am(n,e[t],e[t+1]);return n}function Am(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function jl(n,e){let t;return t=e(ko(n)),t||(t=e(Do(n)),t)||(t=e(Go(n)),t)||(t=e(ei(n)),t)?t:!1}function Fs(n){let e=0;return jn(n)||(e=ne(n)*De(n)),e}function ko(n){return[n[0],n[1]]}function Do(n){return[n[2],n[1]]}function It(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function mm(n,e){let t;if(e==="bottom-left")t=ko(n);else if(e==="bottom-right")t=Do(n);else if(e==="top-left")t=ei(n);else if(e==="top-right")t=Go(n);else throw new Error("Invalid corner");return t}function Oo(n,e,t,i,r){const[s,o,a,l,c,h,u,d]=dd(n,e,t,i);return Ai(Math.min(s,a,c,u),Math.min(o,l,h,d),Math.max(s,a,c,u),Math.max(o,l,h,d),r)}function dd(n,e,t,i){const r=e*i[0]/2,s=e*i[1]/2,o=Math.cos(t),a=Math.sin(t),l=r*o,c=r*a,h=s*o,u=s*a,d=n[0],g=n[1];return[d-l+u,g-c-h,d-l-u,g-c+h,d+l-u,g+c+h,d+l+u,g+c-h,d-l+u,g-c-h]}function De(n){return n[3]-n[1]}function ut(n,e,t){const i=t||St();return Be(n,e)?(n[0]>e[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]<e[2]?i[2]=n[2]:i[2]=e[2],n[3]<e[3]?i[3]=n[3]:i[3]=e[3]):Rr(i),i}function ei(n){return[n[0],n[3]]}function Go(n){return[n[2],n[3]]}function ne(n){return n[2]-n[0]}function Be(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function jn(n){return n[2]<n[0]||n[3]<n[1]}function ym(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function _m(n,e,t){let i=!1;const r=Gl(n,e),s=Gl(n,t);if(r===et.INTERSECTING||s===et.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],c=n[3],h=e[0],u=e[1],d=t[0],g=t[1],f=(g-u)/(d-h);let p,A;s&et.ABOVE&&!(r&et.ABOVE)&&(p=d-(g-c)/f,i=p>=o&&p<=l),!i&&s&et.RIGHT&&!(r&et.RIGHT)&&(A=g-(d-l)*f,i=A>=a&&A<=c),!i&&s&et.BELOW&&!(r&et.BELOW)&&(p=d-(g-a)/f,i=p>=o&&p<=l),!i&&s&et.LEFT&&!(r&et.LEFT)&&(A=g-(d-o)*f,i=A>=a&&A<=c)}return i}function xm(n,e,t,i){if(jn(n))return Rr(t);let r=[];r=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]],e(r,r,2);const s=[],o=[];for(let a=0,l=r.length;a<l;a+=2)s.push(r[a]),o.push(r[a+1]);return pm(s,o,t)}function fd(n,e){const t=e.getExtent(),i=It(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){const r=ne(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}function zl(n,e,t){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[i[0],n[1],i[2],n[3]]];fd(n,e);const r=ne(i);if(ne(n)>r&&!t)return[[i[0],n[1],i[2],n[3]]];if(n[0]<i[0])return[[n[0]+r,n[1],i[2],n[3]],[i[0],n[1],n[2],n[3]]];if(n[2]>i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-r,n[3]]]}return[n]}function Em(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function gd(n,e){const t=n[0],i=n[1],r=e[0],s=e[1],o=r[0],a=r[1],l=s[0],c=s[1],h=l-o,u=c-a,d=h===0&&u===0?0:(h*(t-o)+u*(i-a))/(h*h+u*u||0);let g,f;return d<=0?(g=o,f=a):d>=1?(g=l,f=c):(g=o+d*h,f=a+d*u),[g,f]}function dt(n,e){let t=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=e[i]){t=!1;break}return t}function Ul(n,e){const t=Math.cos(e),i=Math.sin(e),r=n[0]*t-n[1]*i,s=n[1]*t+n[0]*i;return n[0]=r,n[1]=s,n}function wm(n,e){return n[0]*=e,n[1]*=e,n}function Sr(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function Ls(n,e){return Math.sqrt(Sr(n,e))}function vm(n,e){return Sr(n,gd(n,e))}function Vl(n,e){if(e.canWrapX()){const t=ne(e.getExtent()),i=Cm(n,e,t);i&&(n[0]-=i*t)}return n}function Cm(n,e,t){const i=e.getExtent();let r=0;return e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(t=t||ne(i),r=Math.floor((n[0]-i[0])/t)),r}function pd(n){return Math.pow(n,3)}function Ir(n){return 1-pd(1-n)}function bm(n){return 3*n*n-2*n*n*n}function Tm(n){return n}const Rm=63710088e-1;function Ad(n,e,t){t=t||Rm;const i=on(n[1]),r=on(e[1]),s=(r-i)/2,o=on(e[0]-n[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(r);return 2*t*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function md(...n){console.warn(...n)}const cn={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Bo{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||cn[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const ks=6378137,Pr=Math.PI*ks,Sm=[-Pr,-Pr,Pr,Pr],Im=[-180,-85,180,85],No=ks*Math.log(Math.tan(Math.PI/2));class Mr extends Bo{constructor(e){super({code:e,units:"m",extent:Sm,global:!0,worldExtent:Im,getPointResolution:function(t,i){return t/Math.cosh(i[1]/ks)}})}}const yd=[new Mr("EPSG:3857"),new Mr("EPSG:102100"),new Mr("EPSG:102113"),new Mr("EPSG:900913"),new Mr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Mr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Pm(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;s<r;s+=i){e[s]=Pr*n[s]/180;let o=ks*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>No?o=No:o<-No&&(o=-No),e[s+1]=o}return e}function Mm(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;s<r;s+=i)e[s]=180*n[s]/Pr,e[s+1]=360*Math.atan(Math.exp(n[s+1]/ks))/Math.PI-90;return e}const Fm=6378137,_d=[-180,-90,180,90],Lm=Math.PI*Fm/180;class zn extends Bo{constructor(e,t){super({code:e,units:"degrees",extent:_d,axisOrientation:t,global:!0,metersPerUnit:Lm,worldExtent:_d})}}const xd=[new zn("CRS:84"),new zn("EPSG:4326","neu"),new zn("urn:ogc:def:crs:OGC:1.3:CRS84"),new zn("urn:ogc:def:crs:OGC:2:84"),new zn("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new zn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new zn("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Wl={};function km(n){return Wl[n]||Wl[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Dm(n,e){Wl[n]=e}let Fr={};function Ds(n,e,t){const i=n.getCode(),r=e.getCode();i in Fr||(Fr[i]={}),Fr[i][r]=t}function Hl(n,e){return n in Fr&&e in Fr[n]?Fr[n][e]:null}const jo=.9996,Bt=.00669438,zo=Bt*Bt,Uo=zo*Bt,Un=Bt/(1-Bt),Ed=Math.sqrt(1-Bt),Lr=(1-Ed)/(1+Ed),wd=Lr*Lr,Xl=wd*Lr,Yl=Xl*Lr,vd=Yl*Lr,Cd=1-Bt/4-3*zo/64-5*Uo/256,Om=3*Bt/8+3*zo/32+45*Uo/1024,Gm=15*zo/256+45*Uo/1024,Bm=35*Uo/3072,Nm=3/2*Lr-27/32*Xl+269/512*vd,jm=21/16*wd-55/32*Yl,zm=151/96*Xl-417/128*vd,Um=1097/512*Yl,Vo=6378137;function Vm(n,e,t){const i=n-5e5,o=(t.north?e:e-1e7)/jo/(Vo*Cd),a=o+Nm*Math.sin(2*o)+jm*Math.sin(4*o)+zm*Math.sin(6*o)+Um*Math.sin(8*o),l=Math.sin(a),c=l*l,h=Math.cos(a),u=l/h,d=u*u,g=d*d,f=1-Bt*c,p=Math.sqrt(1-Bt*c),A=Vo/p,m=(1-Bt)/f,y=Un*h**2,E=y*y,x=i/(A*jo),_=x*x,w=_*x,v=w*x,C=v*x,b=C*x,T=a-u/m*(_/2-v/24*(5+3*d+10*y-4*E-9*Un))+b/720*(61+90*d+298*y+45*g-252*Un-3*E);let P=(x-w/6*(1+2*d+y)+C/120*(5-2*y+28*d-3*E+8*Un+24*g))/h;return P=Dl(P+on(Rd(t.number)),-Math.PI,Math.PI),[ld(P),ld(T)]}const bd=-80,Td=84,Wm=-180,Hm=180;function Xm(n,e,t){n=Dl(n,Wm,Hm),e<bd?e=bd:e>Td&&(e=Td);const i=on(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,c=on(n),h=Rd(t.number),u=on(h),d=Vo/Math.sqrt(1-Bt*r**2),g=Un*s**2,f=s*Dl(c-u,-Math.PI,Math.PI),p=f*f,A=p*f,m=A*f,y=m*f,E=y*f,x=Vo*(Cd*i-Om*Math.sin(2*i)+Gm*Math.sin(4*i)-Bm*Math.sin(6*i)),_=jo*d*(f+A/6*(1-a+g)+y/120*(5-18*a+l+72*g-58*Un))+5e5;let w=jo*(x+d*o*(p/2+m/24*(5-a+9*g+4*g**2)+E/720*(61-58*a+l+600*g-330*Un)));return t.north||(w+=1e7),[_,w]}function Rd(n){return(n-1)*6-180+3}const Ym=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Sd(n){let e=0;for(const r of Ym){const s=n.match(r);if(s){e=parseInt(s[1]);break}}if(!e)return null;let t=0,i=!1;return e>32700&&e<32761?t=e-32700:e>32600&&e<32661&&(i=!0,t=e-32600),t?{number:t,north:i}:null}function Id(n,e){return function(t,i,r,s){const o=t.length;r=r>1?r:2,s=s??r,i||(r>2?i=t.slice():i=new Array(o));for(let a=0;a<o;a+=s){const l=t[a],c=t[a+1],h=n(l,c,e);i[a]=h[0],i[a+1]=h[1]}return i}}function Km(n){return Sd(n)?new Bo({code:n,units:"m"}):null}function Zm(n){const e=Sd(n.getCode());return e?{forward:Id(Xm,e),inverse:Id(Vm,e)}:null}const Qm=[Zm],qm=[Km];let Kl=!0;function Pd(n){Kl=!1}function Zl(n,e){if(e!==void 0){for(let t=0,i=n.length;t<i;++t)e[t]=n[t];e=e}else e=n.slice();return e}function Ql(n){Dm(n.getCode(),n),Ds(n,n,Zl)}function Jm(n){n.forEach(Ql)}function pe(n){if(typeof n!="string")return n;const e=km(n);if(e)return e;for(const t of qm){const i=t(n);if(i)return i}return null}function ql(n,e,t,i){n=pe(n);let r;const s=n.getPointResolutionFunc();if(s){if(r=s(e,t),i&&i!==n.getUnits()){const o=n.getMetersPerUnit();o&&(r=r*o/cn[i])}}else{const o=n.getUnits();if(o=="degrees"&&!i||i=="degrees")r=e;else{const a=Os(n,pe("EPSG:4326"));if(!a&&o!=="degrees")r=e*n.getMetersPerUnit();else{let c=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];c=a(c,c,2);const h=Ad(c.slice(0,2),c.slice(2,4)),u=Ad(c.slice(4,6),c.slice(6,8));r=(h+u)/2}const l=i?cn[i]:n.getMetersPerUnit();l!==void 0&&(r/=l)}}return r}function Md(n){Jm(n),n.forEach(function(e){n.forEach(function(t){e!==t&&Ds(e,t,Zl)})})}function $m(n,e,t,i){n.forEach(function(r){e.forEach(function(s){Ds(r,s,t),Ds(s,r,i)})})}function Jl(n,e){return n?typeof n=="string"?pe(n):n:pe(e)}function ey(n){return function(e,t,i,r){const s=e.length;i=i!==void 0?i:2,r=r??i,t=t!==void 0?t:new Array(s);for(let o=0;o<s;o+=r){const a=n(e.slice(o,o+i)),l=a.length;for(let c=0,h=r;c<h;++c)t[o+c]=c>=l?e[o+c]:a[c]}return t}}function Wo(n,e){return Pd(),Ho(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function Fd(n,e){const t=Ho(n,"EPSG:3857","EPSG:4326"),i=t[0];return(i<-180||i>180)&&(t[0]=an(i+180,360)-180),t}function ti(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||Os(n,e)===Zl)&&t}function Os(n,e){const t=n.getCode(),i=e.getCode();let r=Hl(t,i);if(r)return r;let s=null,o=null;for(const l of Qm)s||(s=l(n)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=$l(s.inverse,o.forward);else{const l=Hl(t,a);l&&(r=$l(l,o.forward))}else{const l=Hl(a,i);l&&(r=$l(s.inverse,l))}return r&&(Ql(n),Ql(e),Ds(n,e,r)),r}function $l(n,e){return function(t,i,r,s){return i=n(t,i,r,s),e(i,i,r,s)}}function Gs(n,e){const t=pe(n),i=pe(e);return Os(t,i)}function Ho(n,e,t){const i=Gs(e,t);if(!i){const r=pe(e).getCode(),s=pe(t).getCode();throw new Error(`No transform available between ${r} and ${s}`)}return i(n,void 0,n.length)}let ty=null;function iy(){return ty}function Vn(n,e){return n}function Ne(n,e){return Kl&&!dt(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Kl=!1,md("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function Xo(n,e){return n}function ii(n,e){return n}function ny(){Md(yd),Md(xd),$m(xd,yd,Pm,Mm)}ny();const Ld=new Array(6);function mt(){return[1,0,0,1,0,0]}function kd(n){return tc(n,1,0,0,1,0,0)}function ec(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=e[0],c=e[1],h=e[2],u=e[3],d=e[4],g=e[5];return n[0]=t*l+r*c,n[1]=i*l+s*c,n[2]=t*h+r*u,n[3]=i*h+s*u,n[4]=t*d+r*g+o,n[5]=i*d+s*g+a,n}function tc(n,e,t,i,r,s,o){return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function ry(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function Ye(n,e){const t=e[0],i=e[1];return e[0]=n[0]*t+n[2]*i+n[4],e[1]=n[1]*t+n[3]*i+n[5],e}function ic(n,e,t){return ec(n,tc(Ld,e,0,0,t,0,0))}function sy(n,e,t){return ec(n,tc(Ld,1,0,0,1,e,t))}function mi(n,e,t,i,r,s,o,a){const l=Math.sin(s),c=Math.cos(s);return n[0]=i*c,n[1]=r*l,n[2]=-i*l,n[3]=r*c,n[4]=o*i*c-a*i*l+e,n[5]=o*r*l+a*r*c+t,n}function Dd(n,e){const t=oy(e);ge(t!==0,"Transformation matrix cannot be inverted");const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return n[0]=o/t,n[1]=-r/t,n[2]=-s/t,n[3]=i/t,n[4]=(s*l-o*a)/t,n[5]=-(i*l-r*a)/t,n}function oy(n){return n[0]*n[3]-n[1]*n[2]}const ay=[1e5,1e5,1e5,1e5,2,2];function ly(n){return"matrix("+n.join(", ")+")"}function Od(n){return n.substring(7,n.length-1).split(",").map(parseFloat)}function cy(n,e){const t=Od(n),i=Od(e);for(let r=0;r<6;++r)if(Math.round((t[r]-i[r])*ay[r])!==0)return!1;return!0}function hn(n,e,t,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<t;l+=i){const c=n[l],h=n[l+1];s[a++]=r[0]*c+r[2]*h+r[4],s[a++]=r[1]*c+r[3]*h+r[5];for(let u=2;u<o;u++)s[a++]=n[l+u]}return s&&s.length!=a&&(s.length=a),s}function nc(n,e,t,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),c=s[0],h=s[1];let u=0;for(let d=e;d<t;d+=i){const g=n[d]-c,f=n[d+1]-h;o[u++]=c+g*a-f*l,o[u++]=h+g*l+f*a;for(let p=d+2;p<d+i;++p)o[u++]=n[p]}return o&&o.length!=u&&(o.length=u),o}function hy(n,e,t,i,r,s,o,a){a=a||[];const l=o[0],c=o[1];let h=0;for(let u=e;u<t;u+=i){const d=n[u]-l,g=n[u+1]-c;a[h++]=l+r*d,a[h++]=c+s*g;for(let f=u+2;f<u+i;++f)a[h++]=n[f]}return a&&a.length!=h&&(a.length=h),a}function uy(n,e,t,i,r,s,o){o=o||[];let a=0;for(let l=e;l<t;l+=i){o[a++]=n[l]+r,o[a++]=n[l+1]+s;for(let c=l+2;c<l+i;++c)o[a++]=n[c]}return o&&o.length!=a&&(o.length=a),o}const Gd=mt(),dy=[NaN,NaN];class Bd extends pi{constructor(){super(),this.extent_=St(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=td((e,t,i)=>{if(!i)return this.getSimplifiedGeometry(t);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return Q()}closestPointXY(e,t,i,r){return Q()}containsXY(e,t){return this.closestPointXY(e,t,dy,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return Q()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Rr(t),this.extentRevision_=this.getRevision()}return ym(this.extent_,e)}rotate(e,t){Q()}scale(e,t,i){Q()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return Q()}getType(){return Q()}applyTransform(e){Q()}intersectsExtent(e){return Q()}translate(e,t){Q()}transform(e,t){const i=pe(e),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=De(c)/De(l);mi(Gd,c[0],c[3],h,-h,0,0,0);const u=hn(s,0,s.length,a,Gd,o),d=Gs(i,t);return d?d(u,u,a):u}:Gs(i,t);return this.applyTransform(r),this}}class un extends Bd{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return Bl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return Q()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=Yo(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){Q()}setLayout(e,t,i){let r;if(e)r=Yo(e);else{for(let s=0;s<i;++s){if(t.length===0){this.layout="XY",this.stride=2;return}t=t[0]}r=t.length,e=Wn(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();nc(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){t===void 0&&(t=e),i||(i=It(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();hy(r,0,r.length,s,e,t,i,r),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();uy(i,0,i.length,r,e,t,i),this.changed()}}}function Wn(n){let e;return n==2?e="XY":n==3?e="XYZ":n==4&&(e="XYZM"),e}function Yo(n){let e;return n=="XY"?e=2:n=="XYZ"||n=="XYM"?e=3:n=="XYZM"&&(e=4),e}function fy(n,e,t){const i=n.getFlatCoordinates();if(!i)return null;const r=n.getStride();return hn(i,0,i.length,r,e,t)}function Nd(n,e,t,i){let r=0;const s=n[t-i],o=n[t-i+1];let a=0,l=0;for(;e<t;e+=i){const c=n[e]-s,h=n[e+1]-o;r+=l*c-a*h,a=c,l=h}return r/2}function jd(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=Nd(n,e,a,i),e=a}return r}function gy(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=jd(n,e,a,i),e=a[a.length-1]}return r}function zd(n,e,t,i,r,s,o){const a=n[e],l=n[e+1],c=n[t]-a,h=n[t+1]-l;let u;if(c===0&&h===0)u=e;else{const d=((r-a)*c+(s-l)*h)/(c*c+h*h);if(d>1)u=t;else if(d>0){for(let g=0;g<i;++g)o[g]=Rt(n[e+g],n[t+g],d);o.length=i;return}else u=e}for(let d=0;d<i;++d)o[d]=n[u+d];o.length=i}function rc(n,e,t,i,r){let s=n[e],o=n[e+1];for(e+=i;e<t;e+=i){const a=n[e],l=n[e+1],c=ki(s,o,a,l);c>r&&(r=c),s=a,o=l}return r}function sc(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=rc(n,e,a,i,r),e=a}return r}function py(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=sc(n,e,a,i,r),e=a[a.length-1]}return r}function oc(n,e,t,i,r,s,o,a,l,c,h){if(e==t)return c;let u,d;if(r===0){if(d=ki(o,a,n[e],n[e+1]),d<c){for(u=0;u<i;++u)l[u]=n[e+u];return l.length=i,d}return c}h=h||[NaN,NaN];let g=e+i;for(;g<t;)if(zd(n,g-i,g,i,o,a,h),d=ki(o,a,h[0],h[1]),d<c){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i,g+=i}else g+=i*Math.max((Math.sqrt(d)-Math.sqrt(c))/r|0,1);if(s&&(zd(n,t-i,e,i,o,a,h),d=ki(o,a,h[0],h[1]),d<c)){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i}return c}function ac(n,e,t,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=t.length;u<d;++u){const g=t[u];c=oc(n,e,g,i,r,s,o,a,l,c,h),e=g}return c}function Ay(n,e,t,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=t.length;u<d;++u){const g=t[u];c=ac(n,e,g,i,r,s,o,a,l,c,h),e=g[g.length-1]}return c}function Ud(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function Ko(n,e,t,i){for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0;a<i;++a)n[e++]=o[a]}return e}function Bs(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=Ko(n,e,t[o],i);r[s++]=l,e=l}return r.length=s,r}function Vd(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=Bs(n,e,t[o],i,r[s]);l.length===0&&(l[0]=e),r[s++]=l,e=l[l.length-1]}return r.length=s,r}function dn(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=e;o<t;o+=i)r[s++]=n.slice(o,o+i);return r.length=s,r}function Ns(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];r[s++]=dn(n,e,l,i,r[s]),e=l}return r.length=s,r}function lc(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];r[s++]=l.length===1&&l[0]===e?[]:Ns(n,e,l,i,r[s]),e=l[l.length-1]}return r.length=s,r}function Zo(n,e,t,i,r,s,o){const a=(t-e)/i;if(a<3){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const c=[e,t-i];let h=0;for(;c.length>0;){const u=c.pop(),d=c.pop();let g=0;const f=n[d],p=n[d+1],A=n[u],m=n[u+1];for(let y=d+i;y<u;y+=i){const E=n[y],x=n[y+1],_=dm(E,x,f,p,A,m);_>g&&(h=y,g=_)}g>r&&(l[(h-e)/i]=1,d+i<h&&c.push(d,h),h+i<u&&c.push(h,u))}for(let u=0;u<a;++u)l[u]&&(s[o++]=n[e+u*i],s[o++]=n[e+u*i+1]);return o}function Wd(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l];o=Zo(n,e,h,i,r,s,o),a.push(o),e=h}return o}function Hn(n,e){return e*Math.round(n/e)}function my(n,e,t,i,r,s,o){if(e==t)return o;let a=Hn(n[e],r),l=Hn(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;let c,h;do if(c=Hn(n[e],r),h=Hn(n[e+1],r),e+=i,e==t)return s[o++]=c,s[o++]=h,o;while(c==a&&h==l);for(;e<t;){const u=Hn(n[e],r),d=Hn(n[e+1],r);if(e+=i,u==c&&d==h)continue;const g=c-a,f=h-l,p=u-a,A=d-l;if(g*A==f*p&&(g<0&&p<g||g==p||g>0&&p>g)&&(f<0&&A<f||f==A||f>0&&A>f)){c=u,h=d;continue}s[o++]=c,s[o++]=h,a=c,l=h,c=u,h=d}return s[o++]=c,s[o++]=h,o}function cc(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l];o=my(n,e,h,i,r,s,o),a.push(o),e=h}return o}function yy(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l],u=[];o=cc(n,e,h,i,r,s,o,u),a.push(u),e=h[h.length-1]}return o}class js extends un{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new js(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<Bn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return Nd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=Zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new js(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ko(this.flatCoordinates,0,e,this.stride),this.changed()}}class yt extends un{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new yt(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=ki(e,t,s[0],s[1]);if(o<r){const a=this.stride;for(let l=0;l<a;++l)i[l]=s[l];return i.length=a,o}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return Ps(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return Ol(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ud(this.flatCoordinates,0,e,this.stride),this.changed()}}function _y(n,e,t,i,r){return!jl(r,function(o){return!Xn(n,e,t,i,o[0],o[1])})}function Xn(n,e,t,i,r,s){let o=0,a=n[t-i],l=n[t-i+1];for(;e<t;e+=i){const c=n[e],h=n[e+1];l<=s?h>s&&(c-a)*(s-l)-(r-a)*(h-l)>0&&o++:h<=s&&(c-a)*(s-l)-(r-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function hc(n,e,t,i,r,s){if(t.length===0||!Xn(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(Xn(n,t[o-1],t[o],i,r,s))return!1;return!0}function xy(n,e,t,i,r,s){if(t.length===0)return!1;for(let o=0,a=t.length;o<a;++o){const l=t[o];if(hc(n,e,l,i,r,s))return!0;e=l[l.length-1]}return!1}function uc(n,e,t,i,r,s,o){let a,l,c,h,u,d,g;const f=r[s+1],p=[];for(let y=0,E=t.length;y<E;++y){const x=t[y];for(h=n[x-i],d=n[x-i+1],a=e;a<x;a+=i)u=n[a],g=n[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(c=(f-d)/(g-d)*(u-h)+h,p.push(c)),h=u,d=g}let A=NaN,m=-1/0;for(p.sort(fi),h=p[0],a=1,l=p.length;a<l;++a){u=p[a];const y=Math.abs(u-h);y>m&&(c=(h+u)/2,hc(n,e,t,i,c,f)&&(A=c,m=y)),h=u}return isNaN(A)&&(A=r[s]),o?(o.push(A,f,m),o):[A,f,m]}function Hd(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o<a;++o){const l=t[o];s=uc(n,e,l,i,r,2*o,s),e=l[l.length-1]}return s}function Xd(n,e,t,i,r){let s;for(e+=i;e<t;e+=i)if(s=r(n.slice(e-i,e),n.slice(e,e+i)),s)return s;return!1}function Qo(n,e,t,i,r,s){return s=s??ud(St(),n,e,t,i),Be(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Xd(n,e,t,i,function(o,a){return _m(r,o,a)}):!1}function Ey(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){if(Qo(n,e,t[s],i,r))return!0;e=t[s]}return!1}function Yd(n,e,t,i,r){return!!(Qo(n,e,t,i,r)||Xn(n,e,t,i,r[0],r[1])||Xn(n,e,t,i,r[0],r[3])||Xn(n,e,t,i,r[2],r[1])||Xn(n,e,t,i,r[2],r[3]))}function Kd(n,e,t,i,r){if(!Yd(n,e,t[0],i,r))return!1;if(t.length===1)return!0;for(let s=1,o=t.length;s<o;++s)if(_y(n,t[s-1],t[s],i,r)&&!Qo(n,t[s-1],t[s],i,r))return!1;return!0}function wy(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(Kd(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function vy(n,e,t,i){for(;e<t-i;){for(let r=0;r<i;++r){const s=n[e+r];n[e+r]=n[t-i+r],n[t-i+r]=s}e+=i,t-=i}}function dc(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],l=n[e+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function fc(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=dc(n,e,a,i);if(s===0){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;e=a}return!0}function Zd(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(!fc(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function qo(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=dc(n,e,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&vy(n,e,a,i),e=a}return e}function gc(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s)e=qo(n,e,t[s],i,r);return e}function pc(n,e){const t=[];let i=0,r=0,s;for(let o=0,a=e.length;o<a;++o){const l=e[o],c=dc(n,i,l,2);if(s===void 0&&(s=c),c===s)t.push(e.slice(r,o+1));else{if(t.length===0)continue;t[t.length-1].push(e[r])}r=o+1,i=l}return t}class Nt extends un{constructor(e,t,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&i?(this.setFlatCoordinates(t,e),this.ends_=i):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?gi(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Nt(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Bn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sc(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ac(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return hc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return jd(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),qo(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,Ns(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=It(this.getExtent());this.flatInteriorPoint_=uc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new yt(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new js(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],c=new js(t.slice(s,l),e);r.push(c),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;fc(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=qo(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=cc(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new Nt(t,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Kd(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Bs(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Qd(n){if(jn(n))throw new Error("Cannot create polygon from empty extent");const e=n[0],t=n[1],i=n[2],r=n[3],s=[e,t,e,r,i,r,i,t,e,t];return new Nt(s,"XY",[s.length])}function Ac(n,e,t,i){const r=ne(e)/t[0],s=De(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function mc(n,e,t){let i=Math.min(n,e);const r=50;return i*=Math.log(1+r*Math.max(0,n/e-1))/r+1,t&&(i=Math.max(i,t),i/=Math.log(1+r*Math.max(0,t/n-1))/r+1),Pe(i,t/2,e*2)}function Cy(n,e,t,i){return e=e!==void 0?e:!0,function(r,s,o,a){if(r!==void 0){const l=n[0],c=n[n.length-1],h=t?Ac(l,t,o,i):l;if(a)return e?mc(r,h,c):Pe(r,c,h);const u=Math.min(h,r),d=Math.floor(Io(n,u,s));return n[d]>h&&d<n.length-1?n[d+1]:n[d]}}}function by(n,e,t,i,r,s){return i=i!==void 0?i:!0,t=t!==void 0?t:0,function(o,a,l,c){if(o!==void 0){const h=r?Ac(e,r,l,s):e;if(c)return i?mc(o,h,t):Pe(o,t,h);const u=1e-9,d=Math.ceil(Math.log(e/h)/Math.log(n)-u),g=-a*(.5-u)+.5,f=Math.min(h,o),p=Math.floor(Math.log(e/f)/Math.log(n)+g),A=Math.max(d,p),m=e/Math.pow(n,A);return Pe(m,t,h)}}}function qd(n,e,t,i,r){return t=t!==void 0?t:!0,function(s,o,a,l){if(s!==void 0){const c=i?Ac(n,i,a,r):n;return!t||!l?Pe(s,e,c):mc(s,c,e)}}}function yc(n){if(n!==void 0)return 0}function Jd(n){if(n!==void 0)return n}function Ty(n){const e=2*Math.PI/n;return function(t,i){if(i)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t}}function Ry(n){const e=on(5);return function(t,i){return i||t===void 0?t:Math.abs(t)<=e?0:t}}const $d=42,_c=256,xc=0;class yi extends pi{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Jl(e.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&Pd(),e.center&&(e.center=Ne(e.center,this.projection_)),e.extent&&(e.extent=ii(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in $t)delete t[a];this.setProperties(t,!0);const i=Iy(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const r=Sy(e),s=i.constraint,o=Py(e);this.constraints_={center:r,resolution:s,rotation:o},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const i=this.getCenterInternal();if(i){const r=e||[0,0,0,0];t=t||[0,0,0,0];const s=this.getResolution(),o=s/2*(r[3]-t[3]+t[1]-r[1]),a=s/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let i=0;i<t.length;++i){let r=arguments[i];r.center&&(r=Object.assign({},r),r.center=Ne(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=Ne(r.anchor,this.getProjection())),t[i]=r}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,i;t>1&&typeof arguments[t-1]=="function"&&(i=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){const h=arguments[r];h.center&&this.setCenterInternal(h.center),h.zoom!==void 0?this.setZoom(h.zoom):h.resolution&&this.setResolution(h.resolution),h.rotation!==void 0&&this.setRotation(h.rotation)}if(r===t){i&&Jo(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const c=[];for(;r<t;++r){const h=arguments[r],u={start:s,complete:!1,anchor:h.anchor,duration:h.duration!==void 0?h.duration:1e3,easing:h.easing||bm,callback:i};if(h.center&&(u.sourceCenter=o,u.targetCenter=h.center.slice(),o=u.targetCenter),h.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(h.zoom),a=u.targetResolution):h.resolution&&(u.sourceResolution=a,u.targetResolution=h.resolution,a=u.targetResolution),h.rotation!==void 0){u.sourceRotation=l;const d=an(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+d,l=u.targetRotation}My(u)?u.complete=!0:s+=u.duration,c.push(u)}this.animations_.push(c),this.setHint(ke.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[ke.ANIMATING]>0}getInteracting(){return this.hints_[ke.INTERACTING]>0}cancelAnimations(){this.setHint(ke.ANIMATING,-this.hints_[ke.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&Jo(r[0].callback,!1),!e)for(let s=0,o=r.length;s<o;++s){const a=r[s];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let t=!1;for(let i=this.animations_.length-1;i>=0;--i){const r=this.animations_[i];let s=!0;for(let o=0,a=r.length;o<a;++o){const l=r[o];if(l.complete)continue;const c=e-l.start;let h=l.duration>0?c/l.duration:1;h>=1?(l.complete=!0,h=1):s=!1;const u=l.easing(h);if(l.sourceCenter){const d=l.sourceCenter[0],g=l.sourceCenter[1],f=l.targetCenter[0],p=l.targetCenter[1];this.nextCenter_=l.targetCenter;const A=d+u*(f-d),m=g+u*(p-g);this.targetCenter_=[A,m]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const g=this.getViewportSize_(this.getRotation()),f=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(f,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?an(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),t=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(ke.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&Jo(o,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let i;const r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-t[0],r[1]-t[1]],Ul(i,e-this.getRotation()),Em(i,t)),i}calculateCenterZoom(e,t){let i;const r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){const o=t[0]-e*(t[0]-r[0])/s,a=t[1]-e*(t[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(e){const t=this.viewportSize_;if(e){const i=t[0],r=t[1];return[Math.abs(i*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&Vn(e,this.getProjection())}getCenterInternal(){return this.get($t.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const t=this.calculateExtentInternal(e);return Xo(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();ge(t,"The view center is not defined");const i=this.getResolution();ge(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return ge(r!==void 0,"The view rotation is not defined"),Oo(t,i,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get($t.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(ii(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const i=ne(e)/t[0],r=De(e)/t[1];return Math.max(i,r)}getResolutionForValueFunction(e){e=e||2;const t=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(t/i)/Math.log(e);return function(s){return t/Math.pow(e,s*r)}}getRotation(){return this.get($t.ROTATION)}getValueForResolutionFunction(e){const t=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/t;return function(o){return Math.log(i/o)/t/s}}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e);const i=this.padding_;return i&&(t=[t[0]-i[1]-i[3],t[1]-i[0]-i[2]]),t}getState(){const e=this.getProjection(),t=this.getResolution(),i=this.getRotation();let r=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();r=Ec(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],t,i)}return{center:r.slice(0),projection:e!==void 0?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e;const t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,i,r;if(this.resolutions_){const s=Io(this.resolutions_,e,1);t=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(i/e)/Math.log(r)}getResolutionForZoom(e){var t;if((t=this.resolutions_)!=null&&t.length){if(this.resolutions_.length===1)return this.resolutions_[0];const i=Pe(Math.floor(e),0,this.resolutions_.length-2),r=this.resolutions_[i]/this.resolutions_[i+1];return this.resolutions_[i]/Math.pow(r,Pe(e-i,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(ge(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){ge(!jn(e),"Cannot fit empty extent provided as `geometry`");const r=ii(e,this.getProjection());i=Qd(r)}else if(e.getType()==="Circle"){const r=ii(e.getExtent(),this.getProjection());i=Qd(r),i.rotate(this.getRotation(),It(r))}else i=e;this.fitInternal(i,t)}rotatedExtentForGeometry(e){const t=this.getRotation(),i=Math.cos(t),r=Math.sin(-t),s=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=s.length;u<d;u+=o){const g=s[u]*i-s[u+1]*r,f=s[u]*r+s[u+1]*i;a=Math.min(a,g),l=Math.min(l,f),c=Math.max(c,g),h=Math.max(h,f)}return[a,l,c,h]}fitInternal(e,t){t=t||{};let i=t.size;i||(i=this.getViewportSizeMinusPadding_());const r=t.padding!==void 0?t.padding:[0,0,0,0],s=t.nearest!==void 0?t.nearest:!1;let o;t.minResolution!==void 0?o=t.minResolution:t.maxZoom!==void 0?o=this.getResolutionForZoom(t.maxZoom):o=0;const a=this.rotatedExtentForGeometry(e);let l=this.getResolutionForExtentInternal(a,[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,s?0:1);const c=this.getRotation(),h=Math.sin(c),u=Math.cos(c),d=It(a);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;const g=d[0]*u-d[1]*h,f=d[1]*u+d[0]*h,p=this.getConstrainedCenter([g,f],l),A=t.callback?t.callback:bs;t.duration!==void 0?this.animateInternal({resolution:l,center:p,duration:t.duration,easing:t.easing},A):(this.targetResolution_=l,this.targetCenter_=p,this.applyTargetState_(!1,!0),Jo(A,!0))}centerOn(e,t,i){this.centerOnInternal(Ne(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal(Ec(e,t,i,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,i,r){let s;const o=this.padding_;if(o&&e){const a=this.getViewportSizeMinusPadding_(-i),l=Ec(e,r,[a[0]/2+o[3],a[1]/2+o[0]],t,i);s=[e[0]-l[0],e[1]-l[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const t=Vn(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){const t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t=t&&Ne(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*e,0,r,i);t&&(this.targetCenter_=this.calculateCenterZoom(s,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=Ne(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,i);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&Ne(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){const i=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,s,i),a=this.constraints_.center(this.targetCenter_,o,s,i,this.calculateCenterShift(this.targetCenter_,o,r,s));this.get($t.ROTATION)!==r&&this.set($t.ROTATION,r),this.get($t.RESOLUTION)!==o&&(this.set($t.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get($t.CENTER)||!dt(this.get($t.CENTER),a))&&this.set($t.CENTER,a),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,i){e=e!==void 0?e:200;const r=t||0,s=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(s),a=this.constraints_.resolution(this.targetResolution_,r,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,s,o));if(e===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=s,this.targetCenter_=l,this.applyTargetState_();return}i=i||(e===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==s||!this.getCenterInternal()||!dt(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:l,resolution:a,duration:e,easing:Ir,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(ke.INTERACTING,1)}endInteraction(e,t,i){i=i&&Ne(i,this.getProjection()),this.endInteractionInternal(e,t,i)}endInteractionInternal(e,t,i){this.getInteracting()&&(this.setHint(ke.INTERACTING,-1),this.resolveConstraints(e,t,i))}getConstrainedCenter(e,t){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),i)}getConstrainedZoom(e,t){const i=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(i,t))}getConstrainedResolution(e,t){t=t||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,i)}}function Jo(n,e){setTimeout(function(){n(e)},0)}function Sy(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return cd(n.extent,n.constrainOnlyCenter,t)}const e=Jl(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,cd(t,!1,!1)}return gm}function Iy(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:xc,a=n.maxZoom!==void 0?n.maxZoom:28;const l=n.zoomFactor!==void 0?n.zoomFactor:2,c=n.multiWorld!==void 0?n.multiWorld:!1,h=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,u=n.showFullExtent!==void 0?n.showFullExtent:!1,d=Jl(n.projection,"EPSG:3857"),g=d.getExtent();let f=n.constrainOnlyCenter,p=n.extent;if(!c&&!p&&d.isGlobal()&&(f=!1,p=g),n.resolutions!==void 0){const A=n.resolutions;t=A[o],i=A[a]!==void 0?A[a]:A[A.length-1],n.constrainResolution?e=Cy(A,h,!f&&p,u):e=qd(t,i,h,!f&&p,u)}else{const m=(g?Math.max(ne(g),De(g)):360*cn.degrees/d.getMetersPerUnit())/_c/Math.pow(2,xc),y=m/Math.pow(2,28-xc);t=n.maxResolution,t!==void 0?o=0:t=m/Math.pow(l,o),i=n.minResolution,i===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?i=t/Math.pow(l,a):i=m/Math.pow(l,a):i=y),a=o+Math.floor(Math.log(t/i)/Math.log(l)),i=t/Math.pow(l,a-o),n.constrainResolution?e=by(l,t,i,h,!f&&p,u):e=qd(t,i,h,!f&&p,u)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:l}}function Py(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?Ry():t===!1?Jd:typeof t=="number"?Ty(t):Jd}return yc}function My(n){return!(n.sourceCenter&&n.targetCenter&&!dt(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function Ec(n,e,t,i,r){const s=Math.cos(-r);let o=Math.sin(-r),a=n[0]*s-n[1]*o,l=n[1]*s+n[0]*o;a+=(e[0]/2-t[0])*i,l+=(t[1]-e[1]/2)*i,o=-o;const c=a*s-l*o,h=l*s+a*o;return[c,h]}const $o="ol-hidden",ea="ol-unselectable",wc="ol-control",ef="ol-collapsed",Fy=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(""),"i"),tf=["style","variant","weight","size","lineHeight","family"],nf=function(n){const e=n.match(Fy);if(!e)return null;const t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,r=tf.length;i<r;++i){const s=e[i+1];s!==void 0&&(t[tf[i]]=s)}return t.families=t.family.split(/,\s?/),t};function Fe(n,e,t,i){let r;return t&&t.length?r=t.shift():Ll?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}let vc;function ta(){return vc||(vc=Fe(1,1)),vc}function zs(n){const e=n.canvas;e.width=1,e.height=1,n.clearRect(0,0,1,1)}function rf(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function Ly(n){for(;n.lastChild;)n.lastChild.remove()}function ky(n,e){const t=n.childNodes;for(let i=0;;++i){const r=t[i],s=e[i];if(!r&&!s)break;if(r!==s){if(!r){n.appendChild(s);continue}if(!s){n.removeChild(r),--i;continue}n.insertBefore(s,r)}}}class ia extends pi{constructor(e){super();const t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){var e;(e=this.element)==null||e.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){var t;this.map_&&((t=this.element)==null||t.remove());for(let i=0,r=this.listenerKeys.length;i<r;++i)ve(this.listenerKeys[i]);if(this.listenerKeys.length=0,this.map_=e,e){const i=this.target_??e.getOverlayContainerStopEvent();this.element&&i.appendChild(this.element),this.render!==bs&&this.listenerKeys.push(oe(e,sn.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}class sf extends ia{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;const t=e.className!==void 0?e.className:"ol-attribution",i=e.tipLabel!==void 0?e.tipLabel:"Attributions",r=e.expandClassName!==void 0?e.expandClassName:t+"-expand",s=e.collapseLabel!==void 0?e.collapseLabel:"›",o=e.collapseClassName!==void 0?e.collapseClassName:t+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=o):this.collapseLabel_=s;const a=e.label!==void 0?e.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=r):this.label_=a;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(H.CLICK,this.handleClick_.bind(this),!1);const c=t+" "+ea+" "+wc+(this.collapsed_&&this.collapsible_?" "+ef:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=c,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const t=this.getMap().getAllLayers(),i=new Set(t.flatMap(r=>r.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(r=>i.add(r)):i.add(this.attributions_)),!this.overrideCollapsible_){const r=!t.some(s=>{var o;return((o=s.getSource())==null?void 0:o.getAttributionsCollapsible())===!1});this.setCollapsible(r)}return Array.from(i)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=await Promise.all(this.collectSourceAttributions_(e).map(r=>On(()=>r))),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Fi(t,this.renderedAttributions_)){Ly(this.ulElement_);for(let r=0,s=t.length;r<s;++r){const o=document.createElement("li");o.innerHTML=t[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(ef),this.collapsed_?rf(this.collapseLabel_,this.label_):rf(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}class Dy extends ia{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target});const t=e.className!==void 0?e.className:"ol-rotate",i=e.label!==void 0?e.label:"⇧",r=e.compassClassName!==void 0?e.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=r,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(r));const s=e.tipLabel?e.tipLabel:"Reset rotation",o=document.createElement("button");o.className=t+"-reset",o.setAttribute("type","button"),o.title=s,o.appendChild(this.label_),o.addEventListener(H.CLICK,this.handleClick_.bind(this),!1);const a=t+" "+ea+" "+wc,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration!==void 0?e.duration:250,this.autoHide_=e.autoHide!==void 0?e.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add($o)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const i=t.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:Ir}):t.setRotation(0))}render(e){const t=e.frameState;if(!t)return;const i=t.viewState.rotation;if(i!=this.rotation_){const r="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains($o);!s&&i===0?this.element.classList.add($o):s&&i!==0&&this.element.classList.remove($o)}this.label_.style.transform=r}this.rotation_=i}}class Oy extends ia{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const t=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,r=e.zoomInClassName!==void 0?e.zoomInClassName:t+"-in",s=e.zoomOutClassName!==void 0?e.zoomOutClassName:t+"-out",o=e.zoomInLabel!==void 0?e.zoomInLabel:"+",a=e.zoomOutLabel!==void 0?e.zoomOutLabel:"–",l=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",c=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=r,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof o=="string"?document.createTextNode(o):o),h.addEventListener(H.CLICK,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=c,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(H.CLICK,this.handleClick_.bind(this,-i),!1);const d=t+" "+ea+" "+wc,g=this.element;g.className=d,g.appendChild(h),g.appendChild(u),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const r=i.getZoom();if(r!==void 0){const s=i.getConstrainedZoom(r+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Ir})):i.setZoom(s)}}}function of(n){n=n||{};const e=new Gt;return(n.zoom!==void 0?n.zoom:!0)&&e.push(new Oy(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&e.push(new Dy(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&e.push(new sf(n.attributionOptions)),e}class Gy{constructor(e,t,i){this.decay_=e,this.minVelocity_=t,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let i=t-3;for(;i>0&&this.points_[i+2]>e;)i-=3;const r=this.points_[t+2]-this.points_[i+2];if(r<1e3/60)return!1;const s=this.points_[t]-this.points_[i],o=this.points_[t+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const Cc={ACTIVE:"active"};class fn extends pi{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Cc.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Cc.ACTIVE,e)}setMap(e){this.map_=e}}function By(n,e,t){const i=n.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:Tm,center:n.getConstrainedCenter(r)})}}function bc(n,e,t,i){const r=n.getZoom();if(r===void 0)return;const s=n.getConstrainedZoom(r+e),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:i!==void 0?i:250,easing:Ir})}class Ny extends fn{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let t=!1;if(e.type==ae.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();bc(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}function Tc(n){const e=arguments;return function(t){let i=!0;for(let r=0,s=e.length;r<s&&(i=i&&e[r](t),!!i);++r);return i}}const jy=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},zy=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Uy=function(n){const e=n.map.getTargetElement(),t=e.getRootNode(),i=n.map.getOwnerDocument().activeElement;return t instanceof ShadowRoot?t.host.contains(i):e.contains(i)},af=function(n){const e=n.map.getTargetElement(),t=e.getRootNode();return(t instanceof ShadowRoot?t.host:e).hasAttribute("tabindex")?Uy(n):!0},na=Cr,lf=function(n){const e=n.originalEvent;return e instanceof PointerEvent&&e.button==0&&!(om&&rd&&e.ctrlKey)},Vy=br,Wy=function(n){return n.type==ae.SINGLECLICK},ra=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Hy=function(n){const e=n.originalEvent;return rd?e.metaKey:e.ctrlKey},cf=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},hf=function(n){const e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},Rc=function(n){const e=n.originalEvent;return e instanceof PointerEvent&&e.pointerType=="mouse"},Sc=function(n){const e=n.originalEvent;return e instanceof PointerEvent&&e.isPrimary&&e.button===0};class Yn extends fn{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==ae.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==ae.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==ae.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==ae.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function Ic(n){const e=n.length;let t=0,i=0;for(let r=0;r<e;r++)t+=n[r].clientX,i+=n[r].clientY;return{clientX:t/e,clientY:i/e}}class Xy extends Yn{constructor(e){super({stopDown:br}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const t=e.condition?e.condition:Tc(ra,Sc);this.condition_=e.onFocusOnly?Tc(af,t):t,this.noKinetic_=!1}handleDragEvent(e){const t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());const i=this.targetPointers,r=t.getEventPixel(Ic(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){const s=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],a=e.map.getView();wm(s,a.getResolution()),Ul(s,a.getRotation()),a.adjustCenterInternal(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=i.length,e.originalEvent.preventDefault()}handleUpEvent(e){const t=e.map,i=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const r=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=t.getPixelFromCoordinateInternal(o),l=t.getCoordinateFromPixelInternal([a[0]-r*Math.cos(s),a[1]-r*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(l),duration:500,easing:Ir})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class Yy extends Yn{constructor(e){e=e||{},super({stopDown:br}),this.condition_=e.condition?e.condition:zy,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!Rc(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===yc)return;const r=t.getSize(),s=e.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return Rc(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return Rc(e)&&lf(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Ky extends Cs{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,t=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(e[0],t[0])+i,r.top=Math.min(e[1],t[1])+i,r.width=Math.abs(t[0]-e[0])+i,r.height=Math.abs(t[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const e=this.startPixel_,t=this.endPixel_,r=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Nt([r])}getGeometry(){return this.geometry_}}const kr={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Us extends Tt{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class Zy extends Yn{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new Ky(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??lf,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,i){const r=i[0]-t[0],s=i[1]-t[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Us(kr.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;const t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new Us(t?kr.BOXEND:kr.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Us(kr.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Us(kr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Us(kr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class Qy extends Zy{constructor(e){e=e||{};const t=e.condition?e.condition:cf;super({condition:t,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const i=this.getMap().getView();let r=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Ir})}}const Kn={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class qy extends fn{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return ra(t)&&hf(t)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==H.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==Kn.DOWN||r==Kn.LEFT||r==Kn.RIGHT||r==Kn.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;r==Kn.DOWN?c=-a:r==Kn.LEFT?l=-a:r==Kn.RIGHT?l=a:c=a;const h=[l,c];Ul(h,o.getRotation()),By(o,h,this.duration_),i.preventDefault(),t=!0}}return!t}}class Jy extends fn{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(t){return!Hy(t)&&hf(t)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let t=!1;if(e.type==H.KEYDOWN||e.type==H.KEYPRESS){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==="+"||r==="-")){const s=e.map,o=r==="+"?this.delta_:-this.delta_,a=s.getView();bc(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}class $y extends fn{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const t=e.condition?e.condition:na;this.condition_=e.onFocusOnly?Tc(af,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==H.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let s;if(e.type==H.WHEEL&&(s=r.deltaY,r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-Pe(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),bc(t,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}class e0 extends Yn{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=br),super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let t=0;const i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=l}this.lastAngle_=s;const o=e.map,a=o.getView();a.getConstraints().rotation!==yc&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Ic(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}class t0 extends Yn{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=br),super(t),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1;const i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(t=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,c=l.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Ic(this.targetPointers))),l.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}function i0(n){n=n||{};const e=new Gt,t=new Gy(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&e.push(new Yy),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&e.push(new Ny({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&e.push(new Xy({onFocusOnly:n.onFocusOnly,kinetic:t})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&e.push(new e0),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&e.push(new t0({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(e.push(new qy),e.push(new Jy({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&e.push(new $y({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&e.push(new Qy({duration:n.zoomDuration})),e}const we={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class uf extends pi{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const t=Object.assign({},e);typeof e.properties=="object"&&(delete t.properties,Object.assign(t,e.properties)),t[we.OPACITY]=e.opacity!==void 0?e.opacity:1,ge(typeof t[we.OPACITY]=="number","Layer opacity must be a number"),t[we.VISIBLE]=e.visible!==void 0?e.visible:!0,t[we.Z_INDEX]=e.zIndex,t[we.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[we.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[we.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[we.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=t.className!==void 0?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const t=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return t.opacity=Pe(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=i===void 0&&!t.managed?1/0:i,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return Q()}getLayerStatesArray(e){return Q()}getExtent(){return this.get(we.EXTENT)}getMaxResolution(){return this.get(we.MAX_RESOLUTION)}getMinResolution(){return this.get(we.MIN_RESOLUTION)}getMinZoom(){return this.get(we.MIN_ZOOM)}getMaxZoom(){return this.get(we.MAX_ZOOM)}getOpacity(){return this.get(we.OPACITY)}getSourceState(){return Q()}getVisible(){return this.get(we.VISIBLE)}getZIndex(){return this.get(we.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(we.EXTENT,e)}setMaxResolution(e){this.set(we.MAX_RESOLUTION,e)}setMinResolution(e){this.set(we.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(we.MAX_ZOOM,e)}setMinZoom(e){this.set(we.MIN_ZOOM,e)}setOpacity(e){ge(typeof e=="number","Layer opacity must be a number"),this.set(we.OPACITY,e)}setVisible(e){this.set(we.VISIBLE,e)}setZIndex(e){this.set(we.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}class gn extends Tt{constructor(e,t){super(e),this.layer=t}}const Pc={LAYERS:"layers"};class Bi extends uf{constructor(e){e=e||{};const t=Object.assign({},e);delete t.layers;let i=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Pc.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Gt(i.slice(),{unique:!0}):ge(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Gt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(ve),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(oe(e,ot.ADD,this.handleLayersAdd_,this),oe(e,ot.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(ve);Ts(this.listenerKeys_);const t=e.getArray();for(let i=0,r=t.length;i<r;i++){const s=t[i];this.registerLayerListeners_(s),this.dispatchEvent(new gn("addlayer",s))}this.changed()}registerLayerListeners_(e){const t=[oe(e,vr.PROPERTYCHANGE,this.handleLayerChange_,this),oe(e,H.CHANGE,this.handleLayerChange_,this)];e instanceof Bi&&t.push(oe(e,"addlayer",this.handleLayerGroupAdd_,this),oe(e,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[Y(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new gn("addlayer",e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new gn("removelayer",e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new gn("addlayer",t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=Y(t);this.listenerKeys_[i].forEach(ve),delete this.listenerKeys_[i],this.dispatchEvent(new gn("removelayer",t)),this.changed()}getLayers(){return this.get(Pc.LAYERS)}setLayers(e){const t=this.getLayers();if(t){const i=t.getArray();for(let r=0,s=i.length;r<s;++r)this.dispatchEvent(new gn("removelayer",i[r]))}this.set(Pc.LAYERS,e)}getLayersArray(e){return e=e!==void 0?e:[],this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){const t=e!==void 0?e:[],i=t.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(t)});const r=this.getLayerState();let s=r.zIndex;!e&&r.zIndex===void 0&&(s=0);for(let o=i,a=t.length;o<a;o++){const l=t[o];l.opacity*=r.opacity,l.visible=l.visible&&r.visible,l.maxResolution=Math.min(l.maxResolution,r.maxResolution),l.minResolution=Math.max(l.minResolution,r.minResolution),l.minZoom=Math.max(l.minZoom,r.minZoom),l.maxZoom=Math.min(l.maxZoom,r.maxZoom),r.extent!==void 0&&(l.extent!==void 0?l.extent=ut(l.extent,r.extent):l.extent=r.extent),l.zIndex===void 0&&(l.zIndex=s)}return t}getSourceState(){return"ready"}}const jt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class Dr extends uf{constructor(e){const t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(we.SOURCE,this.handleSourcePropertyChange_);const i=e.source?e.source:null;this.setSource(i)}getLayersArray(e){return e=e||[],e.push(this),e}getLayerStatesArray(e){return e=e||[],e.push(this.getLayerState()),e}getSource(){return this.get(we.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(ve(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=oe(e,H.CHANGE,this.handleSourceChange_,this),e.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0)),this.clearRenderer()),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let t;const i=this.getMapInternal();!e&&i&&(e=i.getView()),e instanceof yi?t={viewState:e.getState(),extent:e.calculateExtent()}:t=e,!t.layerStatesArray&&i&&(t.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(o=>o.layer===this),!r)return!1}else r=this.getLayerState();const s=this.getExtent();return Mc(r,t.viewState)&&(!s||Be(s,t.extent))}getAttributions(e){var s;if(!this.isVisible(e))return[];const t=(s=this.getSource())==null?void 0:s.getAttributions();if(!t)return[];const i=e instanceof yi?e.getViewStateAndExtent():e;let r=t(i);return Array.isArray(r)||(r=[r]),r}render(e,t){const i=this.getRenderer();return i.prepareFrame(e)?(this.rendered=!0,i.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){const t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(we.MAP,e)}getMapInternal(){return this.get(we.MAP)}setMap(e){this.mapPrecomposeKey_&&(ve(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(ve(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=oe(e,jt.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=oe(this,H.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const t=e.frameState.layerStatesArray,i=this.getLayerState(!1);ge(!t.some(r=>r.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(i)}setSource(e){this.set(we.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function Mc(n,e){if(!n.visible)return!1;const t=e.resolution;if(t<n.minResolution||t>=n.maxResolution)return!1;const i=e.zoom;return i>n.minZoom&&i<=n.maxZoom}function df(n,e,t=0,i=n.length-1,r=n0){for(;i>t;){if(i-t>600){const l=i-t+1,c=e-t+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),g=Math.max(t,Math.floor(e-c*u/l+d)),f=Math.min(i,Math.floor(e+(l-c)*u/l+d));df(n,e,g,f,r)}const s=n[e];let o=t,a=i;for(Vs(n,t,e),r(n[i],s)>0&&Vs(n,t,i);o<a;){for(Vs(n,o,a),o++,a--;r(n[o],s)<0;)o++;for(;r(n[a],s)>0;)a--}r(n[t],s)===0?Vs(n,t,a):(a++,Vs(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}}function Vs(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function n0(n,e){return n<e?-1:n>e?1:0}let ff=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!oa(e,t))return i;const r=this.toBBox,s=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?r(a):a;oa(e,l)&&(t.leaf?i.push(a):Lc(e,l)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!oa(e,t))return!1;const i=[];for(;t;){for(let r=0;r<t.children.length;r++){const s=t.children[r],o=t.leaf?this.toBBox(s):s;if(oa(e,o)){if(t.leaf||Lc(e,o))return!0;i.push(s)}}t=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const i=this.data;this.data=t,t=i}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=Gr([]),this}remove(e,t){if(!e)return this;let i=this.data;const r=this.toBBox(e),s=[],o=[];let a,l,c;for(;i||s.length;){if(i||(i=s.pop(),l=s[s.length-1],a=o.pop(),c=!0),i.leaf){const h=r0(e,i.children,t);if(h!==-1)return i.children.splice(h,1),s.push(i),this._condense(s),this}!c&&!i.leaf&&Lc(i,r)?(s.push(i),o.push(a),a=0,l=i,i=i.children[0]):l?(a++,i=l.children[a],c=!1):i=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const i=[];for(;e;)e.leaf?t.push(...e.children):i.push(...e.children),e=i.pop();return t}_build(e,t,i,r){const s=i-t+1;let o=this._maxEntries,a;if(s<=o)return a=Gr(e.slice(t,i+1)),Or(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=Gr([]),a.leaf=!1,a.height=r;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));gf(e,t,i,c,this.compareMinX);for(let h=t;h<=i;h+=c){const u=Math.min(h+c-1,i);gf(e,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const g=Math.min(d+l-1,u);a.children.push(this._build(e,d,g,r-1))}}return Or(a,this.toBBox),a}_chooseSubtree(e,t,i,r){for(;r.push(t),!(t.leaf||r.length-1===i);){let s=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const c=t.children[l],h=Fc(c),u=a0(e,c)-h;u<o?(o=u,s=h<s?h:s,a=c):u===o&&h<s&&(s=h,a=c)}t=a||t.children[0]}return t}_insert(e,t,i){const r=i?e:this.toBBox(e),s=[],o=this._chooseSubtree(r,this.data,t,s);for(o.children.push(e),Hs(o,r);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(r,s,t)}_split(e,t){const i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);const o=this._chooseSplitIndex(i,s,r),a=Gr(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Or(i,this.toBBox),Or(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=Gr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Or(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let r,s=1/0,o=1/0;for(let a=t;a<=i-t;a++){const l=Ws(e,0,a,this.toBBox),c=Ws(e,a,i,this.toBBox),h=l0(l,c),u=Fc(l)+Fc(c);h<s?(s=h,r=a,o=u<o?u:o):h===s&&u<o&&(o=u,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:s0,s=e.leaf?this.compareMinY:o0,o=this._allDistMargin(e,t,i,r),a=this._allDistMargin(e,t,i,s);o<a&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);const s=this.toBBox,o=Ws(e,0,t,s),a=Ws(e,i-t,i,s);let l=sa(o)+sa(a);for(let c=t;c<i-t;c++){const h=e.children[c];Hs(o,e.leaf?s(h):h),l+=sa(o)}for(let c=i-t-1;c>=t;c--){const h=e.children[c];Hs(a,e.leaf?s(h):h),l+=sa(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)Hs(t[r],e)}_condense(e){for(let t=e.length-1,i;t>=0;t--)e[t].children.length===0?t>0?(i=e[t-1].children,i.splice(i.indexOf(e[t]),1)):this.clear():Or(e[t],this.toBBox)}};function r0(n,e,t){if(!t)return e.indexOf(n);for(let i=0;i<e.length;i++)if(t(n,e[i]))return i;return-1}function Or(n,e){Ws(n,0,n.children.length,e,n)}function Ws(n,e,t,i,r){r||(r=Gr(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<t;s++){const o=n.children[s];Hs(r,n.leaf?i(o):o)}return r}function Hs(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function s0(n,e){return n.minX-e.minX}function o0(n,e){return n.minY-e.minY}function Fc(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function sa(n){return n.maxX-n.minX+(n.maxY-n.minY)}function a0(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function l0(n,e){const t=Math.max(n.minX,e.minX),i=Math.max(n.minY,e.minY),r=Math.min(n.maxX,e.maxX),s=Math.min(n.maxY,e.maxY);return Math.max(0,r-t)*Math.max(0,s-i)}function Lc(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function oa(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function Gr(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function gf(n,e,t,i,r){const s=[e,t];for(;s.length;){if(t=s.pop(),e=s.pop(),t-e<=i)continue;const o=e+Math.ceil((t-e)/i/2)*i;df(n,o,e,t,r),s.push(e,o,o,t)}}const kc=[NaN,NaN,NaN,0];let Dc;function c0(){return Dc||(Dc=Fe(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Dc}const h0=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,u0=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,d0=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,f0=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function aa(n,e){return n.endsWith("%")?Number(n.substring(0,n.length-1))/e:Number(n)}function Xs(n){throw new Error('failed to parse "'+n+'" as color')}function pf(n){if(n.toLowerCase().startsWith("rgb")){const s=n.match(u0)||n.match(h0)||n.match(d0);if(s){const o=s[4],a=100/255;return[Pe(aa(s[1],a)+.5|0,0,255),Pe(aa(s[2],a)+.5|0,0,255),Pe(aa(s[3],a)+.5|0,0,255),o!==void 0?Pe(aa(o,100),0,1):1]}Xs(n)}if(n.startsWith("#")){if(f0.test(n)){const s=n.substring(1),o=s.length<=4?1:2,a=[0,0,0,255];for(let l=0,c=s.length;l<c;l+=o){let h=parseInt(s.substring(l,l+o),16);o===1&&(h+=h<<4),a[l/o]=h}return a[3]=a[3]/255,a}Xs(n)}const e=c0();e.fillStyle="#abcdef";let t=e.fillStyle;e.fillStyle=n,e.fillStyle===t&&(e.fillStyle="#fedcba",t=e.fillStyle,e.fillStyle=n,e.fillStyle===t&&Xs(n));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return pf(i);e.clearRect(0,0,1,1),e.fillRect(0,0,1,1);const r=Array.from(e.getImageData(0,0,1,1).data);return r[3]=Is(r[3]/255,3),r}function g0(n){return typeof n=="string"?n:Uc(n)}const p0=1024,Ys={};let Oc=0;function A0(n){if(n.length===4)return n;const e=n.slice();return e[3]=1,e}function Gc(n){return n>.0031308?Math.pow(n,1/2.4)*269.025-14.025:n*3294.6}function Bc(n){return n>.2068965?Math.pow(n,3):(n-4/29)*(108/841)}function Nc(n){return n>10.314724?Math.pow((n+14.025)/269.025,2.4):n/3294.6}function jc(n){return n>.0088564?Math.pow(n,1/3):n/(108/841)+4/29}function Af(n){const e=Nc(n[0]),t=Nc(n[1]),i=Nc(n[2]),r=jc(e*.222488403+t*.716873169+i*.06060791),s=500*(jc(e*.452247074+t*.399439023+i*.148375274)-r),o=200*(r-jc(e*.016863605+t*.117638439+i*.865350722)),a=Math.atan2(o,s)*(180/Math.PI);return[116*r-16,Math.sqrt(s*s+o*o),a<0?a+360:a,n[3]]}function m0(n){const e=(n[0]+16)/116,t=n[1],i=n[2]*Math.PI/180,r=Bc(e),s=Bc(e+t/500*Math.cos(i)),o=Bc(e-t/200*Math.sin(i)),a=Gc(s*3.021973625-r*1.617392459-o*.404875592),l=Gc(s*-.943766287+r*1.916279586+o*.027607165),c=Gc(s*.069407491-r*.22898585+o*1.159737864);return[Pe(a+.5|0,0,255),Pe(l+.5|0,0,255),Pe(c+.5|0,0,255),n[3]]}function zc(n){if(n==="none")return kc;if(Ys.hasOwnProperty(n))return Ys[n];if(Oc>=p0){let t=0;for(const i in Ys)(t++&3)===0&&(delete Ys[i],--Oc)}const e=pf(n);e.length!==4&&Xs(n);for(const t of e)isNaN(t)&&Xs(n);return Ys[n]=e,++Oc,e}function Br(n){return Array.isArray(n)?n:zc(n)}function Uc(n){let e=n[0];e!=(e|0)&&(e=e+.5|0);let t=n[1];t!=(t|0)&&(t=t+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const r=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+e+","+t+","+i+","+r+")"}function mf(n){return n[0]>0&&n[1]>0}function y0(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function Ke(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}let Zn=0;const ft=1<<Zn++,le=1<<Zn++,_t=1<<Zn++,ni=1<<Zn++,Qn=1<<Zn++,Ks=1<<Zn++,la=Math.pow(2,Zn)-1,Vc={[ft]:"boolean",[le]:"number",[_t]:"string",[ni]:"color",[Qn]:"number[]",[Ks]:"size"},_0=Object.keys(Vc).map(Number).sort(fi);function x0(n){return n in Vc}function Zs(n){const e=[];for(const t of _0)Qs(n,t)&&e.push(Vc[t]);return e.length===0?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function Qs(n,e){return(n&e)===e}function pn(n,e){return n===e}class Ze{constructor(e,t){if(!x0(e))throw new Error(`literal expressions must have a specific type, got ${Zs(e)}`);this.type=e,this.value=t}}class E0{constructor(e,t,...i){this.type=e,this.operator=t,this.args=i}}function yf(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function rt(n,e,t){switch(typeof n){case"boolean":{if(pn(e,_t))return new Ze(_t,n?"true":"false");if(!Qs(e,ft))throw new Error(`got a boolean, but expected ${Zs(e)}`);return new Ze(ft,n)}case"number":{if(pn(e,Ks))return new Ze(Ks,Ke(n));if(pn(e,ft))return new Ze(ft,!!n);if(pn(e,_t))return new Ze(_t,n.toString());if(!Qs(e,le))throw new Error(`got a number, but expected ${Zs(e)}`);return new Ze(le,n)}case"string":{if(pn(e,ni))return new Ze(ni,zc(n));if(pn(e,ft))return new Ze(ft,!!n);if(!Qs(e,_t))throw new Error(`got a string, but expected ${Zs(e)}`);return new Ze(_t,n)}}if(!Array.isArray(n))throw new Error("expression must be an array or a primitive value");if(n.length===0)throw new Error("empty expression");if(typeof n[0]=="string")return F0(n,e,t);for(const i of n)if(typeof i!="number")throw new Error("expected an array of numbers");if(pn(e,Ks)){if(n.length!==2)throw new Error(`expected an array of two values for a size, got ${n.length}`);return new Ze(Ks,n)}if(pn(e,ni)){if(n.length===3)return new Ze(ni,[...n,1]);if(n.length===4)return new Ze(ni,n);throw new Error(`expected an array of 3 or 4 values for a color, got ${n.length}`)}if(!Qs(e,Qn))throw new Error(`got an array of numbers, but expected ${Zs(e)}`);return new Ze(Qn,n)}const F={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",LineMetric:"line-metric",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},w0={[F.Get]:q(te(1,1/0),_f),[F.Var]:q(te(1,1),v0),[F.Has]:q(te(1,1/0),_f),[F.Id]:q(C0,Nr),[F.Concat]:q(te(2,1/0),Ae(_t)),[F.GeometryType]:q(b0,Nr),[F.LineMetric]:q(Nr),[F.Resolution]:q(Wc,Nr),[F.Zoom]:q(Wc,Nr),[F.Time]:q(Wc,Nr),[F.Any]:q(te(2,1/0),Ae(ft)),[F.All]:q(te(2,1/0),Ae(ft)),[F.Not]:q(te(1,1),Ae(ft)),[F.Equal]:q(te(2,2),Ae(la)),[F.NotEqual]:q(te(2,2),Ae(la)),[F.GreaterThan]:q(te(2,2),Ae(le)),[F.GreaterThanOrEqualTo]:q(te(2,2),Ae(le)),[F.LessThan]:q(te(2,2),Ae(le)),[F.LessThanOrEqualTo]:q(te(2,2),Ae(le)),[F.Multiply]:q(te(2,1/0),xf),[F.Coalesce]:q(te(2,1/0),xf),[F.Divide]:q(te(2,2),Ae(le)),[F.Add]:q(te(2,1/0),Ae(le)),[F.Subtract]:q(te(2,2),Ae(le)),[F.Clamp]:q(te(3,3),Ae(le)),[F.Mod]:q(te(2,2),Ae(le)),[F.Pow]:q(te(2,2),Ae(le)),[F.Abs]:q(te(1,1),Ae(le)),[F.Floor]:q(te(1,1),Ae(le)),[F.Ceil]:q(te(1,1),Ae(le)),[F.Round]:q(te(1,1),Ae(le)),[F.Sin]:q(te(1,1),Ae(le)),[F.Cos]:q(te(1,1),Ae(le)),[F.Atan]:q(te(1,2),Ae(le)),[F.Sqrt]:q(te(1,1),Ae(le)),[F.Match]:q(te(4,1/0),Ef,R0),[F.Between]:q(te(3,3),Ae(le)),[F.Interpolate]:q(te(6,1/0),Ef,S0),[F.Case]:q(te(3,1/0),T0,I0),[F.In]:q(te(2,2),P0),[F.Number]:q(te(1,1/0),Ae(la)),[F.String]:q(te(1,1/0),Ae(la)),[F.Array]:q(te(1,1/0),Ae(le)),[F.Color]:q(te(1,4),Ae(le)),[F.Band]:q(te(1,3),Ae(le)),[F.Palette]:q(te(2,2),M0),[F.ToString]:q(te(1,1),Ae(ft|le|_t|ni))};function _f(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=n[s+1];switch(typeof o){case"number":{r[s]=new Ze(le,o);break}case"string":{r[s]=new Ze(_t,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}s===0&&t.properties.add(String(o))}return r}function v0(n,e,t){const i=n[1];if(typeof i!="string")throw new Error("expected a string argument for var operation");return t.variables.add(i),[new Ze(_t,i)]}function C0(n,e,t){t.featureId=!0}function b0(n,e,t){t.geometryType=!0}function Wc(n,e,t){t.mapState=!0}function Nr(n,e,t){const i=n[0];if(n.length!==1)throw new Error(`expected no arguments for ${i} operation`);return[]}function te(n,e){return function(t,i,r){const s=t[0],o=t.length-1;if(n===e){if(o!==n){const a=n===1?"":"s";throw new Error(`expected ${n} argument${a} for ${s}, got ${o}`)}}else if(o<n||o>e){const a=e===1/0?`${n} or more`:`${n} to ${e}`;throw new Error(`expected ${a} arguments for ${s}, got ${o}`)}}}function xf(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=rt(n[s+1],e,t);r[s]=o}return r}function Ae(n){return function(e,t,i){const r=e.length-1,s=new Array(r);for(let o=0;o<r;++o){const a=rt(e[o+1],n,i);s[o]=a}return s}}function T0(n,e,t){const i=n[0],r=n.length-1;if(r%2===0)throw new Error(`expected an odd number of arguments for ${i}, got ${r} instead`)}function Ef(n,e,t){const i=n[0],r=n.length-1;if(r%2===1)throw new Error(`expected an even number of arguments for operation ${i}, got ${r} instead`)}function R0(n,e,t){const i=n.length-1,r=_t|le|ft,s=rt(n[1],r,t),o=rt(n[n.length-1],e,t),a=new Array(i-2);for(let l=0;l<i-2;l+=2){try{const c=rt(n[l+2],s.type,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+1} of match expression: ${c.message}`)}try{const c=rt(n[l+3],o.type,t);a[l+1]=c}catch(c){throw new Error(`failed to parse argument ${l+2} of match expression: ${c.message}`)}}return[s,...a,o]}function S0(n,e,t){const i=n[1];let r;switch(i[0]){case"linear":r=1;break;case"exponential":const l=i[1];if(typeof l!="number"||l<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(l)} instead`);r=l;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(i)}`)}const s=new Ze(le,r);let o;try{o=rt(n[2],le,t)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(n.length-3);for(let l=0;l<a.length;l+=2){try{const c=rt(n[l+3],le,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${c.message}`)}try{const c=rt(n[l+4],e,t);a[l+1]=c}catch(c){throw new Error(`failed to parse argument ${l+3} for interpolate expression: ${c.message}`)}}return[s,o,...a]}function I0(n,e,t){const i=rt(n[n.length-1],e,t),r=new Array(n.length-1);for(let s=0;s<r.length-1;s+=2){try{const o=rt(n[s+1],ft,t);r[s]=o}catch(o){throw new Error(`failed to parse argument ${s} of case expression: ${o.message}`)}try{const o=rt(n[s+2],i.type,t);r[s+1]=o}catch(o){throw new Error(`failed to parse argument ${s+1} of case expression: ${o.message}`)}}return r[r.length-1]=i,r}function P0(n,e,t){let i=n[2];if(!Array.isArray(i))throw new Error('the second argument for the "in" operator must be an array');let r;if(typeof i[0]=="string"){if(i[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(i[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');i=i[1],r=_t}else r=le;const s=new Array(i.length);for(let a=0;a<s.length;a++)try{const l=rt(i[a],r,t);s[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[rt(n[1],r,t),...s]}function M0(n,e,t){let i;try{i=rt(n[1],le,t)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const r=n[2];if(!Array.isArray(r))throw new Error("the second argument of palette must be an array");const s=new Array(r.length);for(let o=0;o<s.length;o++){let a;try{a=rt(r[o],ni,t)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof Ze))throw new Error(`the palette color at index ${o} must be a literal value`);s[o]=a}return[i,...s]}function q(...n){return function(e,t,i){const r=e[0];let s;for(let o=0;o<n.length;o++){const a=n[o](e,t,i);if(o==n.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");s=a}}return new E0(t,r,...s)}}function F0(n,e,t){const i=n[0],r=w0[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(n,e,t)}function wf(n){if(!n)return"";const e=n.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return wf(n.getGeometries()[0]);default:return""}}function vf(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function Ni(n,e,t){const i=rt(n,e,t);return ri(i)}function ri(n,e){if(n instanceof Ze){if(n.type===ni&&typeof n.value=="string"){const i=zc(n.value);return function(){return i}}return function(){return n.value}}const t=n.operator;switch(t){case F.Number:case F.String:case F.Coalesce:return L0(n);case F.Get:case F.Var:case F.Has:return k0(n);case F.Id:return i=>i.featureId;case F.GeometryType:return i=>i.geometryType;case F.Concat:{const i=n.args.map(r=>ri(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case F.Resolution:return i=>i.resolution;case F.Any:case F.All:case F.Between:case F.In:case F.Not:return O0(n);case F.Equal:case F.NotEqual:case F.LessThan:case F.LessThanOrEqualTo:case F.GreaterThan:case F.GreaterThanOrEqualTo:return D0(n);case F.Multiply:case F.Divide:case F.Add:case F.Subtract:case F.Clamp:case F.Mod:case F.Pow:case F.Abs:case F.Floor:case F.Ceil:case F.Round:case F.Sin:case F.Cos:case F.Atan:case F.Sqrt:return G0(n);case F.Case:return B0(n);case F.Match:return N0(n);case F.Interpolate:return j0(n);case F.ToString:return z0(n);default:throw new Error(`Unsupported operator ${t}`)}}function L0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ri(n.args[s]);switch(t){case F.Coalesce:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a<"u"&&a!==null)return a}throw new Error("Expected one of the values to be non-null")};case F.Number:case F.String:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a===t)return a}throw new Error(`Expected one of the values to be a ${t}`)};default:throw new Error(`Unsupported assertion operator ${t}`)}}function k0(n,e){const i=n.args[0].value;switch(n.operator){case F.Get:return r=>{const s=n.args;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const h=s[a].value;o=o[h]}return o};case F.Var:return r=>r.variables[i];case F.Has:return r=>{const s=n.args;if(!(i in r.properties))return!1;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const h=s[a].value;if(!o||!Object.hasOwn(o,h))return!1;o=o[h]}return!0};default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function D0(n,e){const t=n.operator,i=ri(n.args[0]),r=ri(n.args[1]);switch(t){case F.Equal:return s=>i(s)===r(s);case F.NotEqual:return s=>i(s)!==r(s);case F.LessThan:return s=>i(s)<r(s);case F.LessThanOrEqualTo:return s=>i(s)<=r(s);case F.GreaterThan:return s=>i(s)>r(s);case F.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${t}`)}}function O0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ri(n.args[s]);switch(t){case F.Any:return s=>{for(let o=0;o<i;++o)if(r[o](s))return!0;return!1};case F.All:return s=>{for(let o=0;o<i;++o)if(!r[o](s))return!1;return!0};case F.Between:return s=>{const o=r[0](s),a=r[1](s),l=r[2](s);return o>=a&&o<=l};case F.In:return s=>{const o=r[0](s);for(let a=1;a<i;++a)if(o===r[a](s))return!0;return!1};case F.Not:return s=>!r[0](s);default:throw new Error(`Unsupported logical operator ${t}`)}}function G0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ri(n.args[s]);switch(t){case F.Multiply:return s=>{let o=1;for(let a=0;a<i;++a)o*=r[a](s);return o};case F.Divide:return s=>r[0](s)/r[1](s);case F.Add:return s=>{let o=0;for(let a=0;a<i;++a)o+=r[a](s);return o};case F.Subtract:return s=>r[0](s)-r[1](s);case F.Clamp:return s=>{const o=r[0](s),a=r[1](s);if(o<a)return a;const l=r[2](s);return o>l?l:o};case F.Mod:return s=>r[0](s)%r[1](s);case F.Pow:return s=>Math.pow(r[0](s),r[1](s));case F.Abs:return s=>Math.abs(r[0](s));case F.Floor:return s=>Math.floor(r[0](s));case F.Ceil:return s=>Math.ceil(r[0](s));case F.Round:return s=>Math.round(r[0](s));case F.Sin:return s=>Math.sin(r[0](s));case F.Cos:return s=>Math.cos(r[0](s));case F.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case F.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${t}`)}}function B0(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ri(n.args[r]);return r=>{for(let s=0;s<t-1;s+=2)if(i[s](r))return i[s+1](r);return i[t-1](r)}}function N0(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ri(n.args[r]);return r=>{const s=i[0](r);for(let o=1;o<t-1;o+=2)if(s===i[o](r))return i[o+1](r);return i[t-1](r)}}function j0(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ri(n.args[r]);return r=>{const s=i[0](r),o=i[1](r);let a,l;for(let c=2;c<t;c+=2){const h=i[c](r);let u=i[c+1](r);const d=Array.isArray(u);if(d&&(u=A0(u)),h>=o)return c===2?u:d?U0(s,o,a,l,h,u):qs(s,o,a,l,h,u);a=h,l=u}return l}}function z0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ri(n.args[s]);switch(t){case F.ToString:return s=>{const o=r[0](s);return n.args[0].type===ni?Uc(o):o.toString()};default:throw new Error(`Unsupported convert operator ${t}`)}}function qs(n,e,t,i,r,s){const o=r-t;if(o===0)return i;const a=e-t,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(s-i)}function U0(n,e,t,i,r,s){if(r-t===0)return i;const a=Af(i),l=Af(s);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const h=[qs(n,e,t,a[0],r,l[0]),qs(n,e,t,a[1],r,l[1]),a[2]+qs(n,e,t,0,r,c),qs(n,e,t,i[3],r,s[3])];return m0(h)}const V={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Hc extends Rs{constructor(e,t,i,r){super(),this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=typeof r=="function"?V.IDLE:r,this.image_=null,this.loader=typeof r=="function"?r:null}changed(){this.dispatchEvent(H.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==V.IDLE&&this.loader){this.state=V.LOADING,this.changed();const e=this.getResolution(),t=Array.isArray(e)?e[0]:e;On(()=>this.loader(this.getExtent(),t,this.getPixelRatio())).then(i=>{"image"in i&&(this.image_=i.image),"extent"in i&&(this.extent=i.extent),"resolution"in i&&(this.resolution=i.resolution),"pixelRatio"in i&&(this.pixelRatio_=i.pixelRatio),(i instanceof HTMLImageElement||lm&&i instanceof ImageBitmap||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(this.image_=i),this.state=V.LOADED}).catch(i=>{this.state=V.ERROR,console.error(i)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}}function V0(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[Po(i,H.LOAD,function(){o=!0,s||e()})];return i.src&&sd?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(Po(i,H.ERROR,t)),function(){r=!1,a.forEach(ve)}}function W0(n,e){return new Promise((t,i)=>{function r(){o(),t(n)}function s(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",r),n.removeEventListener("error",s)}n.addEventListener("load",r),n.addEventListener("error",s)})}function H0(n,e){return e&&(n.src=e),n.src&&sd?new Promise((t,i)=>n.decode().then(()=>t(n)).catch(r=>n.complete&&n.width?t(n):i(r))):W0(n)}class X0{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const t in this.cache_){const i=this.cache_[t];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t,i){const r=Xc(e,t,i);return r in this.cache_?this.cache_[r]:null}getPattern(e,t,i){const r=Xc(e,t,i);return r in this.patternCache_?this.patternCache_[r]:null}set(e,t,i,r,s){const o=Xc(e,t,i),a=o in this.cache_;this.cache_[o]=r,s&&(r.getImageState()===V.IDLE&&r.load(),r.getImageState()===V.LOADING?r.ready().then(()=>{this.patternCache_[o]=ta().createPattern(r.getImage(1),"repeat")}):this.patternCache_[o]=ta().createPattern(r.getImage(1),"repeat")),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function Xc(n,e,t){const i=t?Br(t):"null";return e+":"+n+":"+i}const zt=new X0;let Js=null;class Cf extends Rs{constructor(e,t,i,r,s){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=r===void 0?V.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===V.LOADED){Js||(Js=Fe(1,1,void 0,{willReadFrequently:!0})),Js.drawImage(this.image_,0,0);try{Js.getImageData(0,0,1,1),this.tainted_=!1}catch{Js=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(H.CHANGE)}handleImageError_(){this.imageState_=V.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=V.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],t=this.size_[1],i=Fe(e,t);i.fillRect(0,0,e,t),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===V.IDLE){this.image_||this.initializeImage_(),this.imageState_=V.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&H0(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==V.LOADED)return;const t=this.image_,i=Fe(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=i.canvas;i.scale(e,e),i.drawImage(t,0,0),i.globalCompositeOperation="multiply",i.fillStyle=g0(this.color_),i.fillRect(0,0,r.width/e,r.height/e),i.globalCompositeOperation="destination-in",i.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===V.LOADED||this.imageState_===V.ERROR)e();else{const t=()=>{(this.imageState_===V.LOADED||this.imageState_===V.ERROR)&&(this.removeEventListener(H.CHANGE,t),e())};this.addEventListener(H.CHANGE,t)}})),this.ready_}}function Yc(n,e,t,i,r,s){let o=e===void 0?void 0:zt.get(e,t,r);return o||(o=new Cf(n,n&&"src"in n?n.src||void 0:e,t,i,r),zt.set(e,t,r,o,s)),s&&o&&!zt.getPattern(e,t,r)&&zt.set(e,t,r,o,s),o}function _i(n){return n?Array.isArray(n)?Uc(n):typeof n=="object"&&"src"in n?Y0(n):n:null}function Y0(n){if(!n.offset||!n.size)return zt.getPattern(n.src,"anonymous",n.color);const e=n.src+":"+n.offset,t=zt.getPattern(e,void 0,n.color);if(t)return t;const i=zt.get(n.src,"anonymous",null);if(i.getImageState()!==V.LOADED)return null;const r=Fe(n.size[0],n.size[1]);return r.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),Yc(r.canvas,e,void 0,V.LOADED,n.color,!0),zt.getPattern(e,void 0,n.color)}const bf="10px sans-serif",xt="#000",jr="round",ji=[],zi=0,zr="round",$s=10,eo="#000",to="center",ca="middle",qn=[0,0,0,0],io=1,xi=new pi;let Ur=null,Kc;const Zc={},K0=function(){const e="32px ",t=["monospace","serif"],i=t.length,r="wmytzilWMYTZIL@#/&?$%10";let s,o;function a(c,h,u){let d=!0;for(let g=0;g<i;++g){const f=t[g];if(o=ha(c+" "+h+" "+e+f,r),u!=f){const p=ha(c+" "+h+" "+e+u+","+f,r);d=d&&p!=o}}return!!d}function l(){let c=!0;const h=xi.getKeys();for(let u=0,d=h.length;u<d;++u){const g=h[u];if(xi.get(g)<100){const[f,p,A]=g.split(`
|
|
20
|
+
`);a(f,p,A)?(Ts(Zc),Ur=null,Kc=void 0,xi.set(g,100)):(xi.set(g,xi.get(g)+1,!0),c=!1)}}c&&(clearInterval(s),s=void 0)}return function(c){const h=nf(c);if(!h)return;const u=h.families;for(let d=0,g=u.length;d<g;++d){const f=u[d],p=h.style+`
|
|
21
|
+
`+h.weight+`
|
|
22
|
+
`+f;xi.get(p)===void 0&&(xi.set(p,100,!0),a(h.style,h.weight,f)||(xi.set(p,0,!0),s===void 0&&(s=setInterval(l,32))))}}}(),Z0=function(){let n;return function(e){let t=Zc[e];if(t==null){if(Ll){const i=nf(e),r=Tf(e,"Žg");t=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=e,document.body.appendChild(n),t=n.offsetHeight,document.body.removeChild(n);Zc[e]=t}return t}}();function Tf(n,e){return Ur||(Ur=Fe(1,1)),n!=Kc&&(Ur.font=n,Kc=Ur.font),Ur.measureText(e)}function ha(n,e){return Tf(n,e).width}function Rf(n,e,t){if(e in t)return t[e];const i=e.split(`
|
|
23
|
+
`).reduce((r,s)=>Math.max(r,ha(n,s)),0);return t[e]=i,i}function Q0(n,e){const t=[],i=[],r=[];let s=0,o=0,a=0,l=0;for(let c=0,h=e.length;c<=h;c+=2){const u=e[c];if(u===`
|
|
24
|
+
`||c===h){s=Math.max(s,o),r.push(o),o=0,a+=l,l=0;continue}const d=e[c+1]||n.font,g=ha(d,u);t.push(g),o+=g;const f=Z0(d);i.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function q0(n,e,t,i,r,s,o,a,l,c,h){n.save(),t!==1&&(n.globalAlpha===void 0?n.globalAlpha=u=>u.globalAlpha*=t:n.globalAlpha*=t),e&&n.transform.apply(n,e),i.contextInstructions?(n.translate(l,c),n.scale(h[0],h[1]),J0(i,n)):h[0]<0||h[1]<0?(n.translate(l,c),n.scale(h[0],h[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,c,o*h[0],a*h[1]),n.restore()}function J0(n,e){const t=n.contextInstructions;for(let i=0,r=t.length;i<r;i+=2)Array.isArray(t[i+1])?e[t[i]].apply(e,t[i+1]):e[t[i]]=t[i+1]}class ua{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=Ke(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new ua({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return Q()}getImage(e){return Q()}getHitDetectionImage(){return Q()}getPixelRatio(e){return 1}getImageState(){return Q()}getImageSize(){return Q()}getOrigin(){return Q()}getSize(){return Q()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Ke(e)}listenImageChange(e){Q()}load(){Q()}unlistenImageChange(e){Q()}ready(){return Promise.resolve()}}class da extends ua{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?V.LOADING:V.LOADED,this.imageState_===V.LOADING&&this.ready().then(()=>this.imageState_=V.LOADED),this.render()}clone(){const e=this.getScale(),t=new da({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}getAnchor(){const e=this.size_,t=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-t[0]/i[0],e[1]/2+t[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){var s,o;const t=(s=this.fill_)==null?void 0:s.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(",");let r=(o=zt.get(i,null,null))==null?void 0:o.getImage(1);if(!r){const a=this.renderOptions_,l=Math.ceil(a.size*e),c=Fe(l,l);this.draw_(a,c,e),r=c.canvas,zt.set(i,null,null,new Cf(r,void 0,null,V.LOADED,null))}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,i){if(t===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return t;let r=this.radius,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const w=r;r=s,s=w}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=s*Math.sin(a),c=Math.sqrt(s*s-l*l),h=r-c,u=Math.sqrt(l*l+h*h),d=u/l;if(e==="miter"&&d<=i)return d*t;const g=t/2/d,f=t/2*(h/u),A=Math.sqrt((r+g)*(r+g)+f*f)-r;if(this.radius2_===void 0||e==="bevel")return A*2;const m=r*Math.sin(a),y=Math.sqrt(r*r-m*m),E=s-y,_=Math.sqrt(m*m+E*E)/m;if(_<=i){const w=_*t/2-s-r;return 2*Math.max(A,w)}return A*2}createRenderOptions(){let e=jr,t=zr,i=0,r=null,s=0,o,a=0;this.stroke_&&(o=_i(this.stroke_.getColor()??eo),a=this.stroke_.getWidth()??io,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??zr,e=this.stroke_.getLineCap()??jr,i=this.stroke_.getMiterLimit()??$s);const l=this.calculateLineJoinSize_(t,a,i),c=Math.max(this.radius,this.radius2_||0),h=Math.ceil(2*c+l);return{strokeStyle:o,strokeWidth:a,size:h,lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:t,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,i){if(t.scale(i,i),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let r=this.fill_.getColor();r===null&&(r=xt),t.fillStyle=_i(r),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let i=this.fill_.getColor(),r=0;typeof i=="string"&&(i=Br(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0&&(t=Fe(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_;const i=this.radius;if(t===1/0)e.arc(0,0,i,0,2*Math.PI);else{const r=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(t*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/t;for(let a=0;a<t;a++){const l=s+a*o,c=a%2===0?i:r;e.lineTo(c*Math.cos(l),c*Math.sin(l))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=xt,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class Jn extends da{constructor(e){e=e||{radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode})}clone(){const e=this.getScale(),t=new Jn({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}setRadius(e){this.radius=e,this.render()}}class Ut{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){const e=this.getColor();return new Ut({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){if(e!==null&&typeof e=="object"&&"src"in e){const t=Yc(null,e.src,"anonymous",void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===V.IDLE&&t.load(),t.getImageState()===V.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?Y(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:Br(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function Sf(n,e,t,i){return t!==void 0&&i!==void 0?[t/n,i/e]:t!==void 0?t/n:i!==void 0?i/e:1}class $n extends ua{constructor(e){e=e||{};const t=e.opacity!==void 0?e.opacity:1,i=e.rotation!==void 0?e.rotation:0,r=e.scale!==void 0?e.scale:1,s=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:t,rotation:i,scale:r,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:s,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null;const o=e.img!==void 0?e.img:null;let a=e.src;ge(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||Y(o)),ge(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),ge(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(e.src!==void 0?l=V.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?V.LOADED:V.IDLE:l=V.LOADING:l=V.LOADED),this.color_=e.color!==void 0?Br(e.color):null,this.iconImage_=Yc(o,a,this.crossOrigin_,l,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,this.initialOptions_,e.width!==void 0||e.height!==void 0){let c,h;if(e.size)[c,h]=e.size;else{const u=this.getImage(1);if(u.width&&u.height)c=u.width,h=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=e;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(Sf(g[0],g[1],e.width,e.height))};this.listenImageChange(d);return}}c!==void 0&&this.setScale(Sf(c,h,e.width,e.height))}}clone(){let e,t,i;return this.initialOptions_?(t=this.initialOptions_.width,i=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new $n({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:e,width:t,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=r[0]),this.anchorYUnits_=="fraction"&&(e[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+r[1])}this.normalizedAnchor_=e}const t=this.getDisplacement(),i=this.getScaleArray();return[e[0]-t[0]/i[0],e[1]+t[1]/i[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){const t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=i[0]-t[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==V.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){const e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==V.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(H.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(H.CHANGE,e)}ready(){return this.iconImage_.ready()}}class Vt{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const e=this.getColor();return new Vt({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}class Qe{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=Mf,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Qe({geometry:e??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=Mf,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function $0(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(ge(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),t=[n]),e=function(){return t}}return e}let Qc=null;function If(n,e){if(!Qc){const t=new Ut({color:"rgba(255,255,255,0.4)"}),i=new Vt({color:"#3399CC",width:1.25});Qc=[new Qe({image:new Jn({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return Qc}function Pf(){const n={},e=[255,255,255,1],t=[0,153,255,1],i=3;return n.Polygon=[new Qe({fill:new Ut({color:[255,255,255,.5]})})],n.MultiPolygon=n.Polygon,n.LineString=[new Qe({stroke:new Vt({color:e,width:i+2})}),new Qe({stroke:new Vt({color:t,width:i})})],n.MultiLineString=n.LineString,n.Circle=n.Polygon.concat(n.LineString),n.Point=[new Qe({image:new Jn({radius:i*2,fill:new Ut({color:t}),stroke:new Vt({color:e,width:i/2})}),zIndex:1/0})],n.MultiPoint=n.Point,n.GeometryCollection=n.Polygon.concat(n.LineString,n.Point),n}function Mf(n){return n.getGeometry()}const e_="#333";class fa{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=Ke(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new Ut({color:e_}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new fa({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Ke(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}function t_(n){return!0}function i_(n){const e=yf(),t=n_(n,e),i=vf();return function(r,s){if(i.properties=r.getPropertiesInternal(),i.resolution=s,e.featureId){const o=r.getId();o!==void 0?i.featureId=o:i.featureId=null}return e.geometryType&&(i.geometryType=wf(r.getGeometry())),t(i)}}function Ff(n){const e=yf(),t=n.length,i=new Array(t);for(let o=0;o<t;++o)i[o]=qc(n[o],e);const r=vf(),s=new Array(t);return function(o,a){if(r.properties=o.getPropertiesInternal(),r.resolution=a,e.featureId){const c=o.getId();c!==void 0?r.featureId=c:r.featureId=null}let l=0;for(let c=0;c<t;++c){const h=i[c](r);h&&(s[l]=h,l+=1)}return s.length=l,s}}function n_(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r){const s=n[r],o="filter"in s?Ni(s.filter,ft,e):t_;let a;if(Array.isArray(s.style)){const l=s.style.length;a=new Array(l);for(let c=0;c<l;++c)a[c]=qc(s.style[c],e)}else a=[qc(s.style,e)];i[r]={filter:o,styles:a}}return function(r){const s=[];let o=!1;for(let a=0;a<t;++a){const l=i[a].filter;if(l(r)&&!(n[a].else&&o)){o=!0;for(const c of i[a].styles){const h=c(r);h&&s.push(h)}}}return s}}function qc(n,e){const t=no(n,"",e),i=ro(n,"",e),r=r_(n,e),s=s_(n,e),o=Et(n,"z-index",e);if(!t&&!i&&!r&&!s&&!rn(n))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(n));const a=new Qe;return function(l){let c=!0;if(t){const h=t(l);h&&(c=!1),a.setFill(h)}if(i){const h=i(l);h&&(c=!1),a.setStroke(h)}if(r){const h=r(l);h&&(c=!1),a.setText(h)}if(s){const h=s(l);h&&(c=!1),a.setImage(h)}return o&&a.setZIndex(o(l)),c?null:a}}function no(n,e,t){let i;if(e+"fill-pattern-src"in n)i=c_(n,e+"fill-",t);else{if(n[e+"fill-color"]==="none")return s=>null;i=Jc(n,e+"fill-color",t)}if(!i)return null;const r=new Ut;return function(s){const o=i(s);return o===kc?null:(r.setColor(o),r)}}function ro(n,e,t){const i=Et(n,e+"stroke-width",t),r=Jc(n,e+"stroke-color",t);if(!i&&!r)return null;const s=Ui(n,e+"stroke-line-cap",t),o=Ui(n,e+"stroke-line-join",t),a=Lf(n,e+"stroke-line-dash",t),l=Et(n,e+"stroke-line-dash-offset",t),c=Et(n,e+"stroke-miter-limit",t),h=new Vt;return function(u){if(r){const d=r(u);if(d===kc)return null;h.setColor(d)}if(i&&h.setWidth(i(u)),s){const d=s(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(d)}if(o){const d=o(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(d)}return a&&h.setLineDash(a(u)),l&&h.setLineDashOffset(l(u)),c&&h.setMiterLimit(c(u)),h}}function r_(n,e){const t="text-",i=Ui(n,t+"value",e);if(!i)return null;const r=no(n,t,e),s=no(n,t+"background-",e),o=ro(n,t,e),a=ro(n,t+"background-",e),l=Ui(n,t+"font",e),c=Et(n,t+"max-angle",e),h=Et(n,t+"offset-x",e),u=Et(n,t+"offset-y",e),d=Vr(n,t+"overflow",e),g=Ui(n,t+"placement",e),f=Et(n,t+"repeat",e),p=pa(n,t+"scale",e),A=Vr(n,t+"rotate-with-view",e),m=Et(n,t+"rotation",e),y=Ui(n,t+"align",e),E=Ui(n,t+"justify",e),x=Ui(n,t+"baseline",e),_=Vr(n,t+"keep-upright",e),w=Lf(n,t+"padding",e),v=ma(n,t+"declutter-mode"),C=new fa({declutterMode:v});return function(b){if(C.setText(i(b)),r&&C.setFill(r(b)),s&&C.setBackgroundFill(s(b)),o&&C.setStroke(o(b)),a&&C.setBackgroundStroke(a(b)),l&&C.setFont(l(b)),c&&C.setMaxAngle(c(b)),h&&C.setOffsetX(h(b)),u&&C.setOffsetY(u(b)),d&&C.setOverflow(d(b)),g){const T=g(b);if(T!=="point"&&T!=="line")throw new Error("Expected point or line for text-placement");C.setPlacement(T)}if(f&&C.setRepeat(f(b)),p&&C.setScale(p(b)),A&&C.setRotateWithView(A(b)),m&&C.setRotation(m(b)),y){const T=y(b);if(T!=="left"&&T!=="center"&&T!=="right"&&T!=="end"&&T!=="start")throw new Error("Expected left, right, center, start, or end for text-align");C.setTextAlign(T)}if(E){const T=E(b);if(T!=="left"&&T!=="right"&&T!=="center")throw new Error("Expected left, right, or center for text-justify");C.setJustify(T)}if(x){const T=x(b);if(T!=="bottom"&&T!=="top"&&T!=="middle"&&T!=="alphabetic"&&T!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");C.setTextBaseline(T)}return w&&C.setPadding(w(b)),_&&C.setKeepUpright(_(b)),C}}function s_(n,e){return"icon-src"in n?o_(n,e):"shape-points"in n?a_(n,e):"circle-radius"in n?l_(n,e):null}function o_(n,e){const t="icon-",i=t+"src",r=Gf(n[i],i),s=ga(n,t+"anchor",e),o=pa(n,t+"scale",e),a=Et(n,t+"opacity",e),l=ga(n,t+"displacement",e),c=Et(n,t+"rotation",e),h=Vr(n,t+"rotate-with-view",e),u=Df(n,t+"anchor-origin"),d=Of(n,t+"anchor-x-units"),g=Of(n,t+"anchor-y-units"),f=f_(n,t+"color"),p=u_(n,t+"cross-origin"),A=d_(n,t+"offset"),m=Df(n,t+"offset-origin"),y=Aa(n,t+"width"),E=Aa(n,t+"height"),x=h_(n,t+"size"),_=ma(n,t+"declutter-mode"),w=new $n({src:r,anchorOrigin:u,anchorXUnits:d,anchorYUnits:g,color:f,crossOrigin:p,offset:A,offsetOrigin:m,height:E,width:y,size:x,declutterMode:_});return function(v){return a&&w.setOpacity(a(v)),l&&w.setDisplacement(l(v)),c&&w.setRotation(c(v)),h&&w.setRotateWithView(h(v)),o&&w.setScale(o(v)),s&&w.setAnchor(s(v)),w}}function a_(n,e){const t="shape-",i=t+"points",r=t+"radius",s=$c(n[i],i),o=$c(n[r],r),a=no(n,t,e),l=ro(n,t,e),c=pa(n,t+"scale",e),h=ga(n,t+"displacement",e),u=Et(n,t+"rotation",e),d=Vr(n,t+"rotate-with-view",e),g=Aa(n,t+"radius2"),f=Aa(n,t+"angle"),p=ma(n,t+"declutter-mode"),A=new da({points:s,radius:o,radius2:g,angle:f,declutterMode:p});return function(m){return a&&A.setFill(a(m)),l&&A.setStroke(l(m)),h&&A.setDisplacement(h(m)),u&&A.setRotation(u(m)),d&&A.setRotateWithView(d(m)),c&&A.setScale(c(m)),A}}function l_(n,e){const t="circle-",i=no(n,t,e),r=ro(n,t,e),s=Et(n,t+"radius",e),o=pa(n,t+"scale",e),a=ga(n,t+"displacement",e),l=Et(n,t+"rotation",e),c=Vr(n,t+"rotate-with-view",e),h=ma(n,t+"declutter-mode"),u=new Jn({radius:5,declutterMode:h});return function(d){return s&&u.setRadius(s(d)),i&&u.setFill(i(d)),r&&u.setStroke(r(d)),a&&u.setDisplacement(a(d)),l&&u.setRotation(l(d)),c&&u.setRotateWithView(c(d)),o&&u.setScale(o(d)),u}}function Et(n,e,t){if(!(e in n))return;const i=Ni(n[e],le,t);return function(r){return $c(i(r),e)}}function Ui(n,e,t){if(!(e in n))return null;const i=Ni(n[e],_t,t);return function(r){return Gf(i(r),e)}}function c_(n,e,t){const i=Ui(n,e+"pattern-src",t),r=kf(n,e+"pattern-offset",t),s=kf(n,e+"pattern-size",t),o=Jc(n,e+"color",t);return function(a){return{src:i(a),offset:r&&r(a),size:s&&s(a),color:o&&o(a)}}}function Vr(n,e,t){if(!(e in n))return null;const i=Ni(n[e],ft,t);return function(r){const s=i(r);if(typeof s!="boolean")throw new Error(`Expected a boolean for ${e}`);return s}}function Jc(n,e,t){if(!(e in n))return null;const i=Ni(n[e],ni,t);return function(r){return Bf(i(r),e)}}function Lf(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn,t);return function(r){return so(i(r),e)}}function ga(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn,t);return function(r){const s=so(i(r),e);if(s.length!==2)throw new Error(`Expected two numbers for ${e}`);return s}}function kf(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn,t);return function(r){return Nf(i(r),e)}}function pa(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn|le,t);return function(r){return g_(i(r),e)}}function Aa(n,e){const t=n[e];if(t!==void 0){if(typeof t!="number")throw new Error(`Expected a number for ${e}`);return t}}function h_(n,e){const t=n[e];if(t!==void 0){if(typeof t=="number")return Ke(t);if(!Array.isArray(t))throw new Error(`Expected a number or size array for ${e}`);if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw new Error(`Expected a number or size array for ${e}`);return t}}function u_(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);return t}}function Df(n,e){const t=n[e];if(t!==void 0){if(t!=="bottom-left"&&t!=="bottom-right"&&t!=="top-left"&&t!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return t}}function Of(n,e){const t=n[e];if(t!==void 0){if(t!=="pixels"&&t!=="fraction")throw new Error(`Expected pixels or fraction for ${e}`);return t}}function d_(n,e){const t=n[e];if(t!==void 0)return so(t,e)}function ma(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);if(t!=="declutter"&&t!=="obstacle"&&t!=="none")throw new Error(`Expected declutter, obstacle, or none for ${e}`);return t}}function f_(n,e){const t=n[e];if(t!==void 0)return Bf(t,e)}function so(n,e){if(!Array.isArray(n))throw new Error(`Expected an array for ${e}`);const t=n.length;for(let i=0;i<t;++i)if(typeof n[i]!="number")throw new Error(`Expected an array of numbers for ${e}`);return n}function Gf(n,e){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}function $c(n,e){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}function Bf(n,e){if(typeof n=="string")return n;const t=so(n,e),i=t.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return t}function Nf(n,e){const t=so(n,e);if(t.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return t}function g_(n,e){return typeof n=="number"?n:Nf(n,e)}const jf={RENDER_ORDER:"renderOrder"};class eh extends Dr{constructor(e){e=e||{};const t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(jf.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){const i=this.getDeclutter();i in e.declutter||(e.declutter[i]=new ff(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(jf.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?If:e;const t=p_(e);this.styleFunction_=e===null?void 0:$0(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function p_(n){if(n===void 0)return If;if(!n)return null;if(typeof n=="function"||n instanceof Qe)return n;if(!Array.isArray(n))return Ff([n]);if(n.length===0)return[];const e=n.length,t=n[0];if(t instanceof Qe){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!(o instanceof Qe))throw new Error("Expected a list of style instances");r[s]=o}return r}if("style"in t){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!("style"in o))throw new Error("Expected a list of rules with a style property");r[s]=o}return i_(r)}return Ff(n)}class zf extends Tt{constructor(e,t,i,r){super(e),this.inversePixelTransform=t,this.frameState=i,this.context=r}}class A_ extends Cs{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){Q()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;mi(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),Dd(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,l){let c;const h=t.viewState;function u(x,_,w,v){return s.call(o,_,x?w:null,v)}const d=h.projection,g=Vl(e.slice(),d),f=[[0,0]];if(d.canWrapX()&&r){const x=d.getExtent(),_=ne(x);f.push([-_,0],[_,0])}const p=t.layerStatesArray,A=p.length,m=[],y=[];for(let x=0;x<f.length;x++)for(let _=A-1;_>=0;--_){const w=p[_],v=w.layer;if(v.hasRenderer()&&Mc(w,h)&&a.call(l,v)){const C=v.getRenderer(),b=v.getSource();if(C&&b){const T=b.getWrapX()?g:e,P=u.bind(null,w.managed);y[0]=T[0]+f[x][0],y[1]=T[1]+f[x][1],c=C.forEachFeatureAtCoordinate(y,t,i,P,m)}if(c)return c}}if(m.length===0)return;const E=1/m.length;return m.forEach((x,_)=>x.distanceSq+=_*E),m.sort((x,_)=>x.distanceSq-_.distanceSq),m.some(x=>c=x.callback(x.feature,x.layer,x.geometry)),c}hasFeatureAtCoordinate(e,t,i,r,s,o){return this.forEachFeatureAtCoordinate(e,t,i,r,Cr,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){Q()}scheduleExpireIconCache(e){zt.canExpireCache()&&e.postRenderFunctions.push(m_)}}function m_(n,e){zt.expire()}class y_ extends A_{constructor(e){super(e),this.fontChangeListenerKey_=oe(xi,vr.PROPERTYCHANGE,e.redrawText,e),this.element_=document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=ea+" ol-layers";const i=e.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){const i=this.getMap();if(i.hasListener(e)){const r=new zf(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){ve(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(jt.PRECOMPOSE,e);const t=e.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);t.some(a=>a.layer instanceof eh&&a.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let o=null;for(let a=0,l=t.length;a<l;++a){const c=t[a];e.layerIndex=a;const h=c.layer,u=h.getSourceState();if(!Mc(c,r)||u!="ready"&&u!="undefined"){h.unrender();continue}const d=h.render(e,o);d&&(d!==o&&(this.children_.push(d),o=d),s.push(c))}this.declutter(e,s),ky(this.element_,this.children_),this.dispatchRenderEvent(jt.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let i=t.length-1;i>=0;--i){const r=t[i],s=r.layer;s.getDeclutter()&&s.renderDeclutter(e,r)}t.forEach(i=>i.layer.renderDeferred(e))}}}function Uf(n){if(n instanceof Dr){n.setMapInternal(null);return}n instanceof Bi&&n.getLayers().forEach(Uf)}function Vf(n,e){if(n instanceof Dr){n.setMapInternal(e);return}if(n instanceof Bi){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)Vf(t[i],e)}}let ya=class extends pi{constructor(e){super(),e=e||{},this.on,this.once,this.un;const t=__(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:am,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=mt(),this.pixelToCoordinateTransform_=mt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=t.controls||of(),this.interactions=t.interactions||i0({onFocusOnly:!0}),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new ad(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(at.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(at.VIEW,this.handleViewChanged_),this.addChangeListener(at.SIZE,this.handleSizeChanged_),this.addChangeListener(at.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof yi)&&e.view.then(function(r){i.setView(new yi(r))}),this.controls.addEventListener(ot.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(ot.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(ot.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(ot.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(ot.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(ot.REMOVE,r=>{const s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){Vf(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_||!this.renderer_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Cr,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,t,null,o,null)}getFeaturesAtPixel(e,t){const i=[];return this.forEachFeatureAtPixel(e,function(r){i.push(r)},t),i}getAllLayers(){const e=[];function t(i){i.forEach(function(r){r instanceof Bi?t(r.getLayers()):e.push(r)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(e);t=t!==void 0?t:{};const r=t.layerFilter!==void 0?t.layerFilter:Cr,s=t.hitTolerance!==void 0?t.hitTolerance:0,o=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],o=i.height/r[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(at.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Vn(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?Ye(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const t=this.overlayIdIndex_[e.toString()];return t!==void 0?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(at.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof Gt){t.setLayers(e);return}const i=t.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t];if(!r.visible)continue;const s=r.layer.getRenderer();if(s&&!s.ready)return!0;const o=r.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(e){const t=Ne(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?Ye(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(at.SIZE)}getView(){return this.get(at.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,i,r){return um(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){t=t||e.type;const i=new Li(t,this,e);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===kl.POINTERDOWN||i===H.WHEEL||i===H.KEYDOWN){const r=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=t.target,a=s instanceof ShadowRoot?s.host===o?s.host.ownerDocument:s:s===r?r.documentElement:s;if(this.overlayContainerStopEvent_.contains(o)||!a.contains(o))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const r=this.getInteractions().getArray().slice();for(let s=r.length-1;s>=0;s--){const o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let r=this.maxTilesLoading_,s=r;if(e){const o=e.viewHints;if(o[ke.ANIMATING]||o[ke.INTERACTING]){const a=Date.now()-e.time>8;r=a?0:8,s=a?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(jt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(jt.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Tr(sn.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Tr(sn.LOADSTART,this,e))));const i=this.postRenderFunctions_;if(e)for(let r=0,s=i.length;r<s;++r)i[r](this,e);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let i=0,r=this.targetChangeHandlerKeys_.length;i<r;++i)ve(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(H.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(H.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.host),this.setSize(void 0)}const e=this.getTarget(),t=typeof e=="string"?document.getElementById(e):e;if(this.targetElement_=t,!t)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new y_(this)),this.mapBrowserEventHandler_=new cm(this,this.moveTolerance_);for(const s in ae)this.mapBrowserEventHandler_.addEventListener(ae[s],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(H.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(H.WHEEL,this.boundHandleBrowserEvent_,od?{passive:!1}:!1);let i;if(this.keyboardEventTarget_)i=this.keyboardEventTarget_;else{const s=t.getRootNode();i=s instanceof ShadowRoot?s.host:t}this.targetChangeHandlerKeys_=[oe(i,H.KEYDOWN,this.handleBrowserEvent,this),oe(i,H.KEYPRESS,this.handleBrowserEvent,this)];const r=t.getRootNode();r instanceof ShadowRoot&&this.resizeObserver_.observe(r.host),this.resizeObserver_.observe(t)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(ve(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(ve(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=oe(e,vr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=oe(e,H.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(ve),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new gn("addlayer",e)),this.layerGroupPropertyListenerKeys_=[oe(e,vr.PROPERTYCHANGE,this.render,this),oe(e,H.CHANGE,this.render,this),oe(e,"addlayer",this.handleLayerAdd_,this),oe(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){Uf(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const t=this.getSize(),i=this.getView(),r=this.frameState_;let s=null;if(t!==void 0&&mf(t)&&i&&i.isDef()){const o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:Oo(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:Y(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=Oo(a.nextCenter,a.nextResolution,l,t)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),r&&(!this.previousExtent_||!jn(this.previousExtent_)&&!Gi(s.extent,this.previousExtent_))&&(this.dispatchEvent(new Tr(sn.MOVESTART,this,r)),this.previousExtent_=Rr(this.previousExtent_)),this.previousExtent_&&!s.viewHints[ke.ANIMATING]&&!s.viewHints[ke.INTERACTING]&&!Gi(s.extent,this.previousExtent_)&&(this.dispatchEvent(new Tr(sn.MOVEEND,this,s)),hd(s.extent,this.previousExtent_))),this.dispatchEvent(new Tr(sn.POSTRENDER,this,s)),this.renderComplete_=(this.hasListener(sn.LOADSTART)||this.hasListener(sn.LOADEND)||this.hasListener(jt.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new gn("removelayer",t)),this.set(at.LAYERGROUP,e)}setSize(e){this.set(at.SIZE,e)}setTarget(e){this.set(at.TARGET,e)}setView(e){if(!e||e instanceof yi){this.set(at.VIEW,e);return}this.set(at.VIEW,new yi);const t=this;e.then(function(i){t.setView(new yi(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){const r=getComputedStyle(e),s=e.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),o=e.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);!isNaN(s)&&!isNaN(o)&&(t=[Math.max(0,s),Math.max(0,o)],!mf(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&md("No map visible because the map container's width or height are 0."))}const i=this.getSize();t&&(!i||!Fi(t,i))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){const t=this.getView();t&&t.setViewportSize(e)}};function __(n){let e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const t={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Bi({layers:n.layers});t[at.LAYERGROUP]=i,t[at.TARGET]=n.target,t[at.VIEW]=n.view instanceof yi?n.view:new yi;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new Gt(n.controls.slice()):(ge(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new Gt(n.interactions.slice()):(ge(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new Gt(n.overlays.slice()):(ge(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Gt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}class Pt extends pi{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const t=e;this.setGeometry(t)}else{const t=e;this.setProperties(t)}}clone(){const e=new Pt(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const t=this.getGeometry();t&&e.setGeometry(t.clone());const i=this.getStyle();return i&&e.setStyle(i),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(ve(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=oe(e,H.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?x_(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function x_(n){if(typeof n=="function")return n;let e;return Array.isArray(n)?e=n:(ge(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[n]),function(){return e}}function Wf(n,e,t,i){const r=[];let s=St();for(let o=0,a=t.length;o<a;++o){const l=t[o];s=Bl(n,e,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=l[l.length-1]}return r}function _a(n,e,t,i,r,s,o){let a,l;const c=(t-e)/i;if(c===1)a=e;else if(c===2)a=e,l=r;else if(c!==0){let h=n[e],u=n[e+1],d=0;const g=[0];for(let A=e+i;A<t;A+=i){const m=n[A],y=n[A+1];d+=Math.sqrt((m-h)*(m-h)+(y-u)*(y-u)),g.push(d),h=m,u=y}const f=r*d,p=em(g,f);p<0?(l=(f-g[-p-2])/(g[-p-1]-g[-p-2]),a=e+(-p-2)*i):a=e+p*i}o=o>1?o:2,s=s||new Array(o);for(let h=0;h<o;++h)s[h]=a===void 0?NaN:l===void 0?n[a+h]:Rt(n[a+h],n[a+i+h],l);return s}function th(n,e,t,i,r,s){if(t==e)return null;let o;if(r<n[e+i-1])return s?(o=n.slice(e,e+i),o[i-1]=r,o):null;if(n[t-1]<r)return s?(o=n.slice(t-i,t),o[i-1]=r,o):null;if(r==n[e+i-1])return n.slice(e,e+i);let a=e/i,l=t/i;for(;a<l;){const d=a+l>>1;r<n[(d+1)*i-1]?l=d:a=d+1}const c=n[a*i-1];if(r==c)return n.slice((a-1)*i,(a-1)*i+i);const h=n[(a+1)*i-1],u=(r-c)/(h-c);o=[];for(let d=0;d<i-1;++d)o.push(Rt(n[(a-1)*i+d],n[a*i+d],u));return o.push(r),o}function E_(n,e,t,i,r,s,o){if(o)return th(n,e,t[t.length-1],i,r,s);let a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(let l=0,c=t.length;l<c;++l){const h=t[l];if(e!=h){if(r<n[e+i-1])return null;if(r<=n[h-1])return th(n,e,h,i,r,!1);e=h}}return null}class xa extends un{constructor(e,t,i){super(),i!==void 0&&t===void 0?this.setFlatCoordinates(i,e):(t=t||0,this.setCenterAndRadius(e,t,i))}clone(){const e=new xa(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=e-s[0],a=t-s[1],l=o*o+a*a;if(l<r){if(l===0)for(let c=0;c<this.stride;++c)i[c]=s[c];else{const c=this.getRadius()/Math.sqrt(l);i[0]=s[0]+c*o,i[1]=s[1]+c*a;for(let h=2;h<this.stride;++h)i[h]=s[h]}return i.length=this.stride,l}return r}containsXY(e,t){const i=this.flatCoordinates,r=e-i[0],s=t-i[1];return r*r+s*s<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const t=this.flatCoordinates,i=t[this.stride]-t[0];return Ai(t[0]-i,t[1]-i,t[0]+i,t[1]+i,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return"Circle"}intersectsExtent(e){const t=this.getExtent();if(Be(e,t)){const i=this.getCenter();return e[0]<=i[0]&&e[2]>=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:jl(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+i;for(let s=1;s<t;++s)r[t+s]=e[s];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,i){this.setLayout(i,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const r=this.flatCoordinates;let s=Ud(r,0,e,this.stride);r[s++]=r[0]+t;for(let o=1,a=this.stride;o<a;++o)r[s++]=r[o];r.length=s,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){const i=this.getCenter(),r=this.getStride();this.setCenter(nc(i,0,i.length,r,e,t,i)),this.changed()}}xa.prototype.transform;class oo extends Bd{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(ve),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let t=0,i=e.length;t<i;++t)this.changeEventsKeys_.push(oe(e[t],H.CHANGE,this.changed,this))}clone(){const e=new oo(ih(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Bn(this.getExtent(),e,t))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(e,t,i,r);return r}containsXY(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)if(i[r].containsXY(e,t))return!0;return!1}computeExtent(e){Rr(e);const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)Nl(e,t[i].getExtent());return e}getGeometries(){return ih(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].getType()===this.getType()?e=e.concat(t[i].getGeometriesArrayRecursive()):e.push(t[i]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=[],i=this.geometries_;let r=!1;for(let s=0,o=i.length;s<o;++s){const a=i[s],l=a.getSimplifiedGeometry(e);t.push(l),l!==a&&(r=!0)}return r?new oo(t):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getType(){return"GeometryCollection"}intersectsExtent(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)if(t[i].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].rotate(e,t);this.changed()}scale(e,t,i){i||(i=It(this.getExtent()));const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)r[s].scale(e,t,i);this.changed()}setGeometries(e){this.setGeometriesArray(ih(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].applyTransform(e);this.changed()}translate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function ih(n){return n.map(e=>e.clone())}function nh(n,e,t,i){let r=n[e],s=n[e+1],o=0;for(let a=e+i;a<t;a+=i){const l=n[a],c=n[a+1];o+=Math.sqrt((l-r)*(l-r)+(c-s)*(c-s)),r=l,s=c}return o}class Wt extends un{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){gi(this.flatCoordinates,e),this.changed()}clone(){const e=new Wt(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Bn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))}forEachSegment(e){return Xd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!="XYM"&&this.layout!="XYZM"?null:(t=t!==void 0?t:!1,th(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return _a(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return nh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const t=[];return t.length=Zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new Wt(t,"XY")}getType(){return"LineString"}intersectsExtent(e){return Qo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ko(this.flatCoordinates,0,e,this.stride),this.changed()}}class An extends un{constructor(e,t,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&i)this.setFlatCoordinates(t,e),this.ends_=i;else{const r=e,s=[],o=[];for(let l=0,c=r.length;l<c;++l){const h=r[l];gi(s,h.getFlatCoordinates()),o.push(s.length)}const a=r.length===0?this.getLayout():r[0].getLayout();this.setFlatCoordinates(a,s),this.ends_=o}}appendLineString(e){gi(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new An(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Bn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sc(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ac(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))}getCoordinateAtM(e,t,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(t=t!==void 0?t:!1,i=i!==void 0?i:!1,E_(this.flatCoordinates,0,this.ends_,this.stride,e,t,i))}getCoordinates(){return Ns(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new Wt(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o],c=new Wt(e.slice(s,l),i);r.push(c),s=l}return r}getLength(){const e=this.ends_;let t=0,i=0;for(let r=0,s=e.length;r<s;++r)i+=nh(this.flatCoordinates,t,e[r],this.stride),t=e[r];return i}getFlatMidpoints(){const e=[],t=this.flatCoordinates;let i=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const l=r[o],c=_a(t,i,l,s,.5);gi(e,c),i=l}return e}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Wd(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i),new An(t,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(e){return Ey(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Bs(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class er extends un{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){gi(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new er(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Bn(this.getExtent(),e,t))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,l=s.length;a<l;a+=o){const c=ki(e,t,s[a],s[a+1]);if(c<r){r=c;for(let h=0;h<o;++h)i[h]=s[a+h];i.length=o}}return r}getCoordinates(){return dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new yt(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,t=this.layout,i=this.stride,r=[];for(let s=0,o=e.length;s<o;s+=i){const a=new yt(e.slice(s,s+i),t);r.push(a)}return r}getType(){return"MultiPoint"}intersectsExtent(e){const t=this.flatCoordinates,i=this.stride;for(let r=0,s=t.length;r<s;r+=i){const o=t[r],a=t[r+1];if(Ol(e,o,a))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ko(this.flatCoordinates,0,e,this.stride),this.changed()}}class mn extends un{constructor(e,t,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){const r=e,s=[],o=[];for(let a=0,l=r.length;a<l;++a){const c=r[a],h=s.length,u=c.getEnds();for(let d=0,g=u.length;d<g;++d)u[d]+=h;gi(s,c.getFlatCoordinates()),o.push(u)}t=r.length===0?this.getLayout():r[0].getLayout(),e=s,i=o}t!==void 0&&i?(this.setFlatCoordinates(t,e),this.endss_=i):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;gi(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let r=0,s=t.length;r<s;++r)t[r]+=i}this.endss_.push(t),this.changed()}clone(){const e=this.endss_.length,t=new Array(e);for(let r=0;r<e;++r)t[r]=this.endss_[r].slice();const i=new mn(this.flatCoordinates.slice(),this.layout,t);return i.applyProperties(this),i}closestPointXY(e,t,i,r){return r<Bn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(py(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ay(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return xy(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return gy(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),gc(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,lc(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=Wf(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Hd(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new er(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Zd(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=gc(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=yy(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i),new mn(t,"XY",i)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{const s=this.endss_[e-1];t=s[s.length-1]}const i=this.endss_[e].slice(),r=i[i.length-1];if(t!==0)for(let s=0,o=i.length;s<o;++s)i[s]-=t;return new Nt(this.flatCoordinates.slice(t,r),this.layout,i)}getPolygons(){const e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o].slice(),c=l[l.length-1];if(s!==0)for(let u=0,d=l.length;u<d;++u)l[u]-=s;const h=new Nt(t.slice(s,c),e,l);r.push(h),s=c}return r}getType(){return"MultiPolygon"}intersectsExtent(e){return wy(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Vd(this.flatCoordinates,0,e,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const r=i[i.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}}const Hf=mt();class tt{constructor(e,t,i,r,s,o){this.styleFunction,this.extent_,this.id_=o,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?Ps(this.flatCoordinates_):Bl(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=It(this.getExtent());this.flatInteriorPoints_=uc(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=pc(this.flatCoordinates_,this.ends_),t=Wf(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=Hd(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=_a(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let t=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const o=i[r],a=_a(e,t,o,2,.5);gi(this.flatMidpoints_,a),t=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=pe(e);const t=e.getExtent(),i=e.getWorldExtent();if(t&&i){const r=De(i)/De(t);mi(Hf,i[0],i[3],r,-r,0,0,0),hn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Hf,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var e;return new tt(this.type_,this.flatCoordinates_.slice(),(e=this.ends_)==null?void 0:e.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=td((e,t)=>{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),t&&this.simplifiedGeometry_.applyTransform(t);const i=this.simplifiedGeometry_.getFlatCoordinates();let r;switch(this.type_){case"LineString":i.length=Zo(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Wd(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,r);break;case"Polygon":r=[],i.length=cc(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,r);break}return r&&(this.simplifiedGeometry_=new tt(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}tt.prototype.getFlatCoordinates=tt.prototype.getOrientedFlatCoordinates;function w_(n){const e=n.getType();switch(e){case"Point":return new yt(n.getFlatCoordinates());case"MultiPoint":return new er(n.getFlatCoordinates(),"XY");case"LineString":return new Wt(n.getFlatCoordinates(),"XY");case"MultiLineString":return new An(n.getFlatCoordinates(),"XY",n.getEnds());case"Polygon":const t=n.getFlatCoordinates(),i=n.getEnds(),r=pc(t,i);return r.length>1?new mn(t,"XY",r):new Nt(t,"XY",i);default:throw new Error("Invalid geometry type:"+e)}}function Xf(n,e){const t=n.getId(),i=w_(n),r=n.getProperties(),s=new Pt;return s.setGeometry(i),t!==void 0&&s.setId(t),s.setProperties(r,!0),s}class Yf{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Pt,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let i=t.dataProjection?pe(t.dataProjection):this.readProjection(e);t.extent&&i&&i.getUnits()==="tile-pixels"&&(i=pe(i),i.setWorldExtent(t.extent)),t={dataProjection:i,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return Q()}readFeature(e,t){return Q()}readFeatures(e,t){return Q()}readGeometry(e,t){return Q()}readProjection(e){return Q()}writeFeature(e,t){return Q()}writeFeatures(e,t){return Q()}writeGeometry(e,t){return Q()}}function Ea(n,e,t){const i=t?pe(t.featureProjection):null,r=t?pe(t.dataProjection):null;let s=n;if(i&&r&&!ti(i,r)){e&&(s=n.clone());const o=e?i:r,a=e?r:i;o.getUnits()==="tile-pixels"?s.transform(o,a):s.applyTransform(Gs(o,a))}if(e&&t&&t.decimals!==void 0){const o=Math.pow(10,t.decimals),a=function(l){for(let c=0,h=l.length;c<h;++c)l[c]=Math.round(l[c]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}const v_={Point:yt,LineString:Wt,Polygon:Nt,MultiPoint:er,MultiLineString:An,MultiPolygon:mn};function C_(n,e,t){return Array.isArray(e[0])?(Zd(n,0,e,t)||(n=n.slice(),gc(n,0,e,t)),n):(fc(n,0,e,t)||(n=n.slice(),qo(n,0,e,t)),n)}function Kf(n,e){var s;const t=n.geometry;if(!t)return[];if(Array.isArray(t))return t.map(o=>Kf({...n,geometry:o})).flat();const i=t.type==="MultiPolygon"?"Polygon":t.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const r=t.layout.length;return Ea(new tt(i,i==="Polygon"?C_(t.flatCoordinates,t.ends,r):t.flatCoordinates,(s=t.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,e)}function rh(n,e){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>rh(r,e));return new oo(i)}const t=v_[n.type];return Ea(new t(n.flatCoordinates,n.layout||"XY",n.ends),!1,e)}class b_ extends Yf{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(wa(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(wa(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return Q()}readFeaturesFromObject(e,t){return Q()}readGeometry(e,t){return this.readGeometryFromObject(wa(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return Q()}readProjection(e){return this.readProjectionFromObject(wa(e))}readProjectionFromObject(e){return Q()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return Q()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return Q()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return Q()}}function wa(n){if(typeof n=="string"){const e=JSON.parse(n);return e||null}return n!==null?n:null}class sh extends b_{constructor(e){e=e||{},super(),this.dataProjection=pe(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=pe(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let i=null;e.type==="Feature"?i=e:i={type:"Feature",geometry:e,properties:null};const r=oh(i.geometry);if(this.featureClass===tt)return Kf({geometry:r,id:i.id,properties:i.properties},t);const s=new Pt;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(rh(r,t)),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(e,t){const i=e;let r=null;if(i.type==="FeatureCollection"){const s=e;r=[];const o=s.features;for(let a=0,l=o.length;a<l;++a){const c=this.readFeatureFromObject(o[a],t);c&&r.push(c)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return T_(e,t)}readProjectionFromObject(e){const t=e.crs;let i;if(t)if(t.type=="name")i=pe(t.properties.name);else if(t.type==="EPSG")i=pe("EPSG:"+t.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(e,t){t=this.adaptOptions(t);const i={type:"Feature",geometry:null,properties:null},r=e.getId();if(r!==void 0&&(i.id=r),!e.hasProperties())return i;const s=e.getProperties(),o=e.getGeometry();return o&&(i.geometry=ah(o,t),delete s[e.getGeometryName()]),rn(s)||(i.properties=s),i}writeFeaturesObject(e,t){t=this.adaptOptions(t);const i=[];for(let r=0,s=e.length;r<s;++r)i.push(this.writeFeatureObject(e[r],t));return{type:"FeatureCollection",features:i}}writeGeometryObject(e,t){return ah(e,this.adaptOptions(t))}}function oh(n,e){if(!n)return null;let t;switch(n.type){case"Point":{t=S_(n);break}case"LineString":{t=I_(n);break}case"Polygon":{t=L_(n);break}case"MultiPoint":{t=M_(n);break}case"MultiLineString":{t=P_(n);break}case"MultiPolygon":{t=F_(n);break}case"GeometryCollection":{t=R_(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return t}function T_(n,e){const t=oh(n);return rh(t,e)}function R_(n,e){return n.geometries.map(function(i){return oh(i)})}function S_(n){const e=n.coordinates;return{type:"Point",flatCoordinates:e,layout:Wn(e.length)}}function I_(n){var i;const e=n.coordinates,t=e.flat();return{type:"LineString",flatCoordinates:t,ends:[t.length],layout:Wn(((i=e[0])==null?void 0:i.length)||2)}}function P_(n){var s,o;const e=n.coordinates,t=((o=(s=e[0])==null?void 0:s[0])==null?void 0:o.length)||2,i=[],r=Bs(i,0,e,t);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:Wn(t)}}function M_(n){var t;const e=n.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:Wn(((t=e[0])==null?void 0:t.length)||2)}}function F_(n){var s,o;const e=n.coordinates,t=[],i=((o=(s=e[0])==null?void 0:s[0])==null?void 0:o[0].length)||2,r=Vd(t,0,e,i);return{type:"MultiPolygon",flatCoordinates:t,ends:r,layout:Wn(i)}}function L_(n){var s,o;const e=n.coordinates,t=[],i=(o=(s=e[0])==null?void 0:s[0])==null?void 0:o.length,r=Bs(t,0,e,i);return{type:"Polygon",flatCoordinates:t,ends:r,layout:Wn(i)}}function ah(n,e){n=Ea(n,!0,e);const t=n.getType();let i;switch(t){case"Point":{i=N_(n);break}case"LineString":{i=D_(n);break}case"Polygon":{i=j_(n,e);break}case"MultiPoint":{i=G_(n);break}case"MultiLineString":{i=O_(n);break}case"MultiPolygon":{i=B_(n,e);break}case"GeometryCollection":{i=k_(n,e);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function k_(n,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return ah(i,e)})}}function D_(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function O_(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function G_(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function B_(n,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function N_(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function j_(n,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}var z_=8,U_={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},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"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},V_={"*":{type:"source"}},W_=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],H_={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},X_={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:"*"}},Y_={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:"*"}},K_={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Z_={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"}}},Q_={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},q_={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},J_=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],$_={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ex={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},tx={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ix={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},nx={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},rx={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},sx={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ox={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ax={type:"array",value:"*"},lx={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},cx={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},hx={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ux={type:"array",value:"*",minimum:1},dx={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}},fx={"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}},gx={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},px={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},Ax=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],mx={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},yx={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},_x={"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"}},xx={"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"}},Ex={"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"}},wx={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},vx={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Cx={"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"}},bx={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Tx={"*":{type:"string"}},Rx={$version:z_,$root:U_,sources:V_,source:W_,source_vector:H_,source_raster:X_,source_raster_dem:Y_,source_geojson:K_,source_video:Z_,source_image:Q_,layer:q_,layout:J_,layout_background:$_,layout_fill:ex,layout_circle:tx,layout_heatmap:ix,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:nx,layout_symbol:rx,layout_raster:sx,layout_hillshade:ox,filter:ax,filter_operator:lx,geometry_type:cx,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:hx,expression:ux,light:dx,sky:fx,terrain:gx,projection:px,paint:Ax,paint_fill:mx,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:yx,paint_circle:_x,paint_heatmap:xx,paint_symbol:Ex,paint_raster:wx,paint_hillshade:vx,paint_background:Cx,transition:bx,"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:Tx};const Sx=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ix(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return Sx.forEach(i=>{i in e&&(t[i]=e[i])}),t}function Zf(n){n=n.slice();const e=Object.create(null);for(let t=0;t<n.length;t++)e[n[t].id]=n[t];for(let t=0;t<n.length;t++)"ref"in n[t]&&(n[t]=Ix(n[t],e[n[t].ref]));return n}class Ei extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class lh{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[i,r]of t)this.bindings[i]=r}concat(e){return new lh(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}}const va={kind:"null"},N={kind:"number"},ie={kind:"string"},$={kind:"boolean"},wi={kind:"color"},Ca={kind:"projectionDefinition"},Wr={kind:"object"},ee={kind:"value"},Px={kind:"error"},ba={kind:"collator"},Ta={kind:"formatted"},Ra={kind:"padding"},ao={kind:"resolvedImage"},Sa={kind:"variableAnchorOffsetCollection"};function Mt(n,e){return{kind:"array",itemType:n,N:e}}function Oe(n){if(n.kind==="array"){const e=Oe(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const Mx=[va,N,ie,$,wi,Ca,Ta,Wr,Mt(ee),Ra,ao,Sa];function lo(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!lo(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const t of Mx)if(!lo(t,e))return null}}return`Expected ${Oe(n)} but found ${Oe(e)} instead.`}function ch(n,e){return e.some(t=>t.kind===n.kind)}function tr(n,e){return e.some(t=>t==="null"?n===null:t==="array"?Array.isArray(n):t==="object"?n&&!Array.isArray(n)&&typeof n=="object":t===typeof n)}function Hr(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const Qf=.96422,qf=1,Jf=.82521,$f=4/29,Xr=6/29,eg=3*Xr*Xr,Fx=Xr*Xr*Xr,Lx=Math.PI/180,kx=180/Math.PI;function tg(n){return n=n%360,n<0&&(n+=360),n}function ig([n,e,t,i]){n=hh(n),e=hh(e),t=hh(t);let r,s;const o=uh((.2225045*n+.7168786*e+.0606169*t)/qf);n===e&&e===t?r=s=o:(r=uh((.4360747*n+.3850649*e+.1430804*t)/Qf),s=uh((.0139322*n+.0971045*e+.7141733*t)/Jf));const a=116*o-16;return[a<0?0:a,500*(r-o),200*(o-s),i]}function hh(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function uh(n){return n>Fx?Math.pow(n,1/3):n/eg+$f}function ng([n,e,t,i]){let r=(n+16)/116,s=isNaN(e)?r:r+e/500,o=isNaN(t)?r:r-t/200;return r=qf*fh(r),s=Qf*fh(s),o=Jf*fh(o),[dh(3.1338561*s-1.6168667*r-.4906146*o),dh(-.9787684*s+1.9161415*r+.033454*o),dh(.0719453*s-.2289914*r+1.4052427*o),i]}function dh(n){return n=n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055,n<0?0:n>1?1:n}function fh(n){return n>Xr?n*n*n:eg*(n-$f)}function Dx(n){const[e,t,i,r]=ig(n),s=Math.sqrt(t*t+i*i);return[Math.round(s*1e4)?tg(Math.atan2(i,t)*kx):NaN,s,e,r]}function Ox([n,e,t,i]){return n=isNaN(n)?0:n*Lx,ng([t,Math.cos(n)*e,Math.sin(n)*e,i])}function Gx([n,e,t,i]){n=tg(n),e/=100,t/=100;function r(s){const o=(s+n/30)%12,a=e*Math.min(t,1-t);return t-a*Math.max(-1,Math.min(o-3,9-o,1))}return[r(0),r(8),r(4),i]}function Bx(n){if(n=n.toLowerCase().trim(),n==="transparent")return[0,0,0,0];const e=Nx[n];if(e){const[r,s,o]=e;return[r/255,s/255,o/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){const s=n.length<6?1:2;let o=1;return[Ia(n.slice(o,o+=s)),Ia(n.slice(o,o+=s)),Ia(n.slice(o,o+=s)),Ia(n.slice(o,o+s)||"ff")]}if(n.startsWith("rgb")){const r=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,s=n.match(r);if(s){const[o,a,l,c,h,u,d,g,f,p,A,m]=s,y=[c||" ",d||" ",p].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){const E=[l,u,f].join(""),x=E==="%%%"?100:E===""?255:0;if(x){const _=[Yr(+a/x,0,1),Yr(+h/x,0,1),Yr(+g/x,0,1),A?rg(+A,m):1];if(sg(_))return _}}return}}const t=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,i=n.match(t);if(i){const[r,s,o,a,l,c,h,u,d]=i,g=[o||" ",l||" ",h].join("");if(g===" "||g===" /"||g===",,"||g===",,,"){const f=[+s,Yr(+a,0,100),Yr(+c,0,100),u?rg(+u,d):1];if(sg(f))return Gx(f)}}}function Ia(n){return parseInt(n.padEnd(2,n),16)/255}function rg(n,e){return Yr(e?n/100:n,0,1)}function Yr(n,e,t){return Math.min(Math.max(e,n),t)}function sg(n){return!n.some(Number.isNaN)}const Nx={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 ir(n,e,t){return n+t*(e-n)}function Pa(n,e,t){return n.map((i,r)=>ir(i,e[r],t))}class Se{constructor(e,t,i,r=1,s=!0){this.r=e,this.g=t,this.b=i,this.a=r,s||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[e,t,i,r]))}static parse(e){if(e instanceof Se)return e;if(typeof e!="string")return;const t=Bx(e);if(t)return new Se(...t,!1)}get rgb(){const{r:e,g:t,b:i,a:r}=this,s=r||1/0;return this.overwriteGetter("rgb",[e/s,t/s,i/s,r])}get hcl(){return this.overwriteGetter("hcl",Dx(this.rgb))}get lab(){return this.overwriteGetter("lab",ig(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,i,r]=this.rgb;return`rgba(${[e,t,i].map(s=>Math.round(s*255)).join(",")},${r})`}static interpolate(e,t,i,r="rgb"){switch(r){case"rgb":{const[s,o,a,l]=Pa(e.rgb,t.rgb,i);return new Se(s,o,a,l,!1)}case"hcl":{const[s,o,a,l]=e.hcl,[c,h,u,d]=t.hcl;let g,f;if(!isNaN(s)&&!isNaN(c)){let E=c-s;c>s&&E>180?E-=360:c<s&&s-c>180&&(E+=360),g=s+i*E}else isNaN(s)?isNaN(c)?g=NaN:(g=c,(a===1||a===0)&&(f=h)):(g=s,(u===1||u===0)&&(f=o));const[p,A,m,y]=Ox([g,f??ir(o,h,i),ir(a,u,i),ir(l,d,i)]);return new Se(p,A,m,y,!1)}case"lab":{const[s,o,a,l]=ng(Pa(e.lab,t.lab,i));return new Se(s,o,a,l,!1)}}}}Se.black=new Se(0,0,0,1),Se.white=new Se(1,1,1,1),Se.transparent=new Se(0,0,0,0),Se.red=new Se(1,0,0,1);class gh{constructor(e,t,i){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=i,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}}const jx=["bottom","center","top"];class ph{constructor(e,t,i,r,s,o){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=s,this.verticalAlign=o}}class Vi{constructor(e){this.sections=e}static fromString(e){return new Vi([new ph(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Vi?e:Vi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class si{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof si)return e;if(typeof e=="number")return new si([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if(typeof t!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new si(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new si(Pa(e.values,t.values,i))}}class We{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const zx=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class vi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof vi)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let t=0;t<e.length;t+=2){const i=e[t],r=e[t+1];if(typeof i!="string"||!zx.has(i)||!Array.isArray(r)||r.length!==2||typeof r[0]!="number"||typeof r[1]!="number")return}return new vi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){const r=e.values,s=t.values;if(r.length!==s.length)throw new We(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const o=[];for(let a=0;a<r.length;a+=2){if(r[a]!==s[a])throw new We(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${r[a]}, to[${a}]: ${s[a]}`);o.push(r[a]);const[l,c]=r[a+1],[h,u]=s[a+1];o.push([ir(l,h,i),ir(c,u,i)])}return new vi(o)}}class yn{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new yn({name:e,available:!1}):null}}class oi{constructor(e,t,i){this.from=e,this.to=t,this.transition=i}static interpolate(e,t,i){return new oi(e,t,i)}static parse(e){if(e instanceof oi)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new oi(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new oi(e.from,e.to,e.transition);if(typeof e=="string")return new oi(e,e,1)}}function og(n,e,t,i){return typeof n=="number"&&n>=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof i>"u"||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[n,e,t,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[n,e,t,i]:[n,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function co(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof oi||n instanceof Se||n instanceof gh||n instanceof Vi||n instanceof si||n instanceof vi||n instanceof yn)return!0;if(Array.isArray(n)){for(const e of n)if(!co(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!co(n[e]))return!1;return!0}else return!1}function qe(n){if(n===null)return va;if(typeof n=="string")return ie;if(typeof n=="boolean")return $;if(typeof n=="number")return N;if(n instanceof Se)return wi;if(n instanceof oi)return Ca;if(n instanceof gh)return ba;if(n instanceof Vi)return Ta;if(n instanceof si)return Ra;if(n instanceof vi)return Sa;if(n instanceof yn)return ao;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=qe(i);if(!t)t=r;else{if(t===r)continue;t=ee;break}}return Mt(t||ee,e)}else return Wr}function ho(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof Se||n instanceof oi||n instanceof Vi||n instanceof si||n instanceof vi||n instanceof yn?n.toString():JSON.stringify(n)}class Kr{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!co(e[1]))return t.error("invalid value");const i=e[1];let r=qe(i);const s=t.expectedType;return r.kind==="array"&&r.N===0&&s&&s.kind==="array"&&(typeof s.N!="number"||s.N===0)&&(r=s),new Kr(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Ma={string:ie,number:N,boolean:$,object:Wr};class ai{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=1,r;const s=e[0];if(s==="array"){let a;if(e.length>2){const c=e[1];if(typeof c!="string"||!(c in Ma)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ma[c],i++}else a=ee;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],i++}r=Mt(a,l)}else{if(!Ma[s])throw new Error(`Types doesn't contain name = ${s}`);r=Ma[s]}const o=[];for(;i<e.length;i++){const a=t.parse(e[i],i,ee);if(!a)return null;o.push(a)}return new ai(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(lo(this.type,qe(i))){if(t===this.args.length-1)throw new We(`Expected value to be of type ${Oe(this.type)}, but found ${Oe(qe(i))} instead.`)}else return i}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ag={"to-boolean":$,"to-color":wi,"to-number":N,"to-string":ie};class _n{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0];if(!ag[i])throw new Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return t.error("Expected one argument.");const r=ag[i],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,ee);if(!a)return null;s.push(a)}return new _n(r,s)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,i;for(const r of this.args){if(t=r.evaluate(e),i=null,t instanceof Se)return t;if(typeof t=="string"){const s=e.parseColor(t);if(s)return s}else if(Array.isArray(t)&&(t.length<3||t.length>4?i=`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:i=og(t[0],t[1],t[2],t[3]),!i))return new Se(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new We(i||`Could not parse color from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const i of this.args){t=i.evaluate(e);const r=si.parse(t);if(r)return r}throw new We(`Could not parse padding from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const i of this.args){t=i.evaluate(e);const r=vi.parse(t);if(r)return r}throw new We(`Could not parse variableAnchorOffsetCollection from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const i of this.args){if(t=i.evaluate(e),t===null)return 0;const r=Number(t);if(!isNaN(r))return r}throw new We(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Vi.fromString(ho(this.args[0].evaluate(e)));case"resolvedImage":return yn.fromString(ho(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ho(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Ux=["Unknown","Point","LineString","Polygon"];class lg{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ux[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Se.parse(e)),t}}class Fa{constructor(e,t,i=[],r,s=new lh,o=[]){this.registry=e,this.path=i,this.key=i.map(a=>`[${a}]`).join(""),this.scope=s,this.errors=o,this.expectedType=r,this._isConstant=t}parse(e,t,i,r,s={}){return t?this.concat(t,i,r)._parse(e,s):this._parse(e,s)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function i(r,s,o){return o==="assert"?new ai(s,[r]):o==="coerce"?new _n(s,[r]):r}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=e[0];if(typeof r!="string")return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[r];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){const a=this.expectedType,l=o.type;if((a.kind==="string"||a.kind==="number"||a.kind==="boolean"||a.kind==="object"||a.kind==="array")&&l.kind==="value")o=i(o,a,t.typeAnnotation||"assert");else if(a.kind==="projectionDefinition"&&(l.kind==="string"||l.kind==="array"))o=i(o,a,t.typeAnnotation||"coerce");else if((a.kind==="color"||a.kind==="formatted"||a.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))o=i(o,a,t.typeAnnotation||"coerce");else if(a.kind==="padding"&&(l.kind==="value"||l.kind==="number"||l.kind==="array"))o=i(o,a,t.typeAnnotation||"coerce");else if(a.kind==="variableAnchorOffsetCollection"&&(l.kind==="value"||l.kind==="array"))o=i(o,a,t.typeAnnotation||"coerce");else if(this.checkSubtype(a,l))return null}if(!(o instanceof Kr)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){const a=new lg;try{o=new Kr(o.type,o.evaluate(a))}catch(l){return this.error(l.message),null}}return o}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i){const r=typeof e=="number"?this.path.concat(e):this.path,s=i?this.scope.concat(i):this.scope;return new Fa(this.registry,this._isConstant,r,t||null,s,this.errors)}error(e,...t){const i=`${this.key}${t.map(r=>`[${r}]`).join("")}`;this.errors.push(new Ei(i,e))}checkSubtype(e,t){const i=lo(e,t);return i&&this.error(i),i}}class La{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let s=1;s<e.length-1;s+=2){const o=e[s];if(typeof o!="string")return t.error(`Expected string, but found ${typeof o} instead.`,s);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",s);const a=t.parse(e[s+1],s+1);if(!a)return null;i.push([o,a])}const r=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return r?new La(i,r):null}outputDefined(){return this.result.outputDefined()}}class ka{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new ka(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Ah{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,N),r=t.parse(e[2],2,Mt(t.expectedType||ee));if(!i||!r)return null;const s=r.type;return new Ah(s.itemType,i,r)}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new We(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new We(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new We(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class mh{constructor(e,t){this.type=$,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,ee),r=t.parse(e[2],2,ee);return!i||!r?null:ch(i.type,[$,ie,N,va,ee])?new mh(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!tr(t,["boolean","string","number","null"]))throw new We(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(qe(t))} instead.`);if(!tr(i,["string","array"]))throw new We(`Expected second argument to be of type array or string, but found ${Oe(qe(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Da{constructor(e,t,i){this.type=N,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,ee),r=t.parse(e[2],2,ee);if(!i||!r)return null;if(!ch(i.type,[$,ie,N,va,ee]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new Da(i,r,s):null}else return new Da(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!tr(t,["boolean","string","number","null"]))throw new We(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(qe(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),tr(i,["string"])){const s=i.indexOf(t,r);return s===-1?-1:[...i.slice(0,s)].length}else{if(tr(i,["array"]))return i.indexOf(t,r);throw new We(`Expected second argument to be of type array or string, but found ${Oe(qe(i))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class yh{constructor(e,t,i,r,s,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=s,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let i,r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);const s={},o=[];for(let c=2;c<e.length-1;c+=2){let h=e[c];const u=e[c+1];Array.isArray(h)||(h=[h]);const d=t.concat(c);if(h.length===0)return d.error("Expected at least one branch label.");for(const f of h){if(typeof f!="number"&&typeof f!="string")return d.error("Branch labels must be numbers or strings.");if(typeof f=="number"&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return d.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof f=="number"&&Math.floor(f)!==f)return d.error("Numeric branch labels must be integer values.");if(!i)i=qe(f);else if(d.checkSubtype(i,qe(f)))return null;if(typeof s[String(f)]<"u")return d.error("Branch labels must be unique.");s[String(f)]=o.length}const g=t.parse(u,c,r);if(!g)return null;r=r||g.type,o.push(g)}const a=t.parse(e[1],1,ee);if(!a)return null;const l=t.parse(e[e.length-1],e.length-1,r);return!l||a.type.kind!=="value"&&t.concat(1).checkSubtype(i,a.type)?null:new yh(i,r,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(qe(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class _h{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const r=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,$);if(!a)return null;const l=t.parse(e[o+1],o+1,i);if(!l)return null;r.push([a,l]),i=i||l.type}const s=t.parse(e[e.length-1],e.length-1,i);if(!s)return null;if(!i)throw new Error("Can't infer output type");return new _h(i,r,s)}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class Oa{constructor(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,ee),r=t.parse(e[2],2,N);if(!i||!r)return null;if(!ch(i.type,[Mt(ee),ie,ee]))return t.error(`Expected first argument to be of type array or string, but found ${Oe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new Oa(i.type,i,r,s):null}else return new Oa(i.type,i,r)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);let r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),tr(t,["string"]))return[...t].slice(i,r).join("");if(tr(t,["array"]))return t.slice(i,r);throw new We(`Expected first argument to be of type array or string, but found ${Oe(qe(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function cg(n,e){const t=n.length-1;let i=0,r=t,s=0,o,a;for(;i<=r;)if(s=Math.floor((i+r)/2),o=n[s],a=n[s+1],o<=e){if(s===t||e<a)return s;i=s+1}else if(o>e)r=s-1;else throw new We("Input is not a number.");return 0}class Ga{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[r,s]of i)this.labels.push(r),this.outputs.push(s)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,N);if(!i)return null;const r=[];let s=null;t.expectedType&&t.expectedType.kind!=="value"&&(s=t.expectedType);for(let o=1;o<e.length;o+=2){const a=o===1?-1/0:e[o],l=e[o+1],c=o,h=o+1;if(typeof a!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(r.length&&r[r.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);const u=t.parse(l,h,s);if(!u)return null;s=s||u.type,r.push([a,u])}return new Ga(s,i,r)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=cg(t,r);return i[o].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Vx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xh,hg;function Wx(){if(hg)return xh;hg=1,xh=n;function n(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=i,this.p2y=r}return n.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,r=0;r<8;r++){var s=this.sampleCurveX(i)-e;if(Math.abs(s)<t)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i=i-s/o}var a=0,l=1;for(i=e,r=0;r<20&&(s=this.sampleCurveX(i),!(Math.abs(s-e)<t));r++)e>s?a=i:l=i,i=(l-a)*.5+a;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},xh}var Hx=Wx(),Xx=Vx(Hx);class Ci{constructor(e,t,i,r,s){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of s)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(e,t,i,r){let s=0;if(e.name==="exponential")s=Eh(t,e.base,i,r);else if(e.name==="linear")s=Eh(t,1,i,r);else if(e.name==="cubic-bezier"){const o=e.controlPoints;s=new Xx(o[0],o[1],o[2],o[3]).solve(Eh(t,1,i,r))}return s}static parse(e,t){let[i,r,s,...o]=e;if(!Array.isArray(r)||r.length===0)return t.error("Expected an interpolation type expression.",1);if(r[0]==="linear")r={name:"linear"};else if(r[0]==="exponential"){const c=r[1];if(typeof c!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:c}}else if(r[0]==="cubic-bezier"){const c=r.slice(1);if(c.length!==4||c.some(h=>typeof h!="number"||h<0||h>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:c}}else return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(s=t.parse(s,2,N),!s)return null;const a=[];let l=null;i==="interpolate-hcl"||i==="interpolate-lab"?l=wi:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c<o.length;c+=2){const h=o[c],u=o[c+1],d=c+3,g=c+4;if(typeof h!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);const f=t.parse(u,g,l);if(!f)return null;l=l||f.type,a.push([h,f])}return!Hr(l,N)&&!Hr(l,Ca)&&!Hr(l,wi)&&!Hr(l,Ra)&&!Hr(l,Sa)&&!Hr(l,Mt(N))?t.error(`Type ${Oe(l)} is not interpolatable.`):new Ci(l,i,r,s,a)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=cg(t,r),a=t[o],l=t[o+1],c=Ci.interpolationFactor(this.interpolation,r,a,l),h=i[o].evaluate(e),u=i[o+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return ir(h,u,c);case"color":return Se.interpolate(h,u,c);case"padding":return si.interpolate(h,u,c);case"variableAnchorOffsetCollection":return vi.interpolate(h,u,c);case"array":return Pa(h,u,c);case"projectionDefinition":return oi.interpolate(h,u,c)}case"interpolate-hcl":return Se.interpolate(h,u,c,"hcl");case"interpolate-lab":return Se.interpolate(h,u,c,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Eh(n,e,t,i){const r=i-t,s=n-t;return r===0?0:e===1?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class uo{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=null;const r=t.expectedType;r&&r.kind!=="value"&&(i=r);const s=[];for(const a of e.slice(1)){const l=t.parse(a,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,s.push(l)}if(!i)throw new Error("No output type");return r&&s.some(a=>lo(r,a.type))?new uo(ee,s):new uo(i,s)}evaluate(e){let t=null,i=0,r;for(const s of this.args)if(i++,t=s.evaluate(e),t&&t instanceof yn&&!t.available&&(r||(r=t.name),t=null,i===this.args.length&&(t=r)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function ug(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Yx(n,e,t){return e===t}function Kx(n,e,t){return e!==t}function Zx(n,e,t){return e<t}function Qx(n,e,t){return e>t}function qx(n,e,t){return e<=t}function Jx(n,e,t){return e>=t}function dg(n,e,t,i){return i.compare(e,t)===0}function $x(n,e,t,i){return!dg(n,e,t,i)}function eE(n,e,t,i){return i.compare(e,t)<0}function tE(n,e,t,i){return i.compare(e,t)>0}function iE(n,e,t,i){return i.compare(e,t)<=0}function nE(n,e,t,i){return i.compare(e,t)>=0}function Zr(n,e,t){const i=n!=="=="&&n!=="!=";return class vA{constructor(s,o,a){this.type=$,this.lhs=s,this.rhs=o,this.collator=a,this.hasUntypedArgument=s.type.kind==="value"||o.type.kind==="value"}static parse(s,o){if(s.length!==3&&s.length!==4)return o.error("Expected two or three arguments.");const a=s[0];let l=o.parse(s[1],1,ee);if(!l)return null;if(!ug(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${Oe(l.type)}'.`);let c=o.parse(s[2],2,ee);if(!c)return null;if(!ug(a,c.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${Oe(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error(`Cannot compare types '${Oe(l.type)}' and '${Oe(c.type)}'.`);i&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new ai(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new ai(l.type,[c])));let h=null;if(s.length===4){if(l.type.kind!=="string"&&c.type.kind!=="string"&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(h=o.parse(s[3],3,ba),!h)return null}return new vA(l,c,h)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const l=qe(o),c=qe(a);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new We(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${l.kind}, ${c.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const l=qe(o),c=qe(a);if(l.kind!=="string"||c.kind!=="string")return e(s,o,a)}return this.collator?t(s,o,a,this.collator.evaluate(s)):e(s,o,a)}eachChild(s){s(this.lhs),s(this.rhs),this.collator&&s(this.collator)}outputDefined(){return!0}}}const rE=Zr("==",Yx,dg),sE=Zr("!=",Kx,$x),oE=Zr("<",Zx,eE),aE=Zr(">",Qx,tE),lE=Zr("<=",qx,iE),cE=Zr(">=",Jx,nE);class Ba{constructor(e,t,i){this.type=ba,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");const i=e[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");const r=t.parse(i["case-sensitive"]===void 0?!1:i["case-sensitive"],1,$);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,$);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,ie),!o)?null:new Ba(r,s,o)}evaluate(e){return new gh(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class wh{constructor(e,t,i,r,s){this.type=ie,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const i=t.parse(e[1],1,N);if(!i)return null;const r=e[2];if(typeof r!="object"||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let s=null;if(r.locale&&(s=t.parse(r.locale,1,ie),!s))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,ie),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=t.parse(r["min-fraction-digits"],1,N),!a))return null;let l=null;return r["max-fraction-digits"]&&(l=t.parse(r["max-fraction-digits"],1,N),!l)?null:new wh(i,s,o,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class vh{constructor(e){this.type=Ta,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");const r=[];let s=!1;for(let o=1;o<=e.length-1;++o){const a=e[o];if(s&&typeof a=="object"&&!Array.isArray(a)){s=!1;let l=null;if(a["font-scale"]&&(l=t.parse(a["font-scale"],1,N),!l))return null;let c=null;if(a["text-font"]&&(c=t.parse(a["text-font"],1,Mt(ie)),!c))return null;let h=null;if(a["text-color"]&&(h=t.parse(a["text-color"],1,wi),!h))return null;let u=null;if(a["vertical-align"]){if(typeof a["vertical-align"]=="string"&&!jx.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(u=t.parse(a["vertical-align"],1,ie),!u)return null}const d=r[r.length-1];d.scale=l,d.font=c,d.textColor=h,d.verticalAlign=u}else{const l=t.parse(e[o],1,ee);if(!l)return null;const c=l.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,r.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new vh(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return qe(r)===ao?new ph("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new ph(ho(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)};return new Vi(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Ch{constructor(e){this.type=ao,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const i=t.parse(e[1],1,ie);return i?new Ch(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=yn.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}}class bh{constructor(e){this.type=N,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${Oe(i.type)} instead.`):new bh(i):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return[...t].length;if(Array.isArray(t))return t.length;throw new We(`Expected value to be of type string or array, but found ${Oe(qe(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const bi=8192;function hE(n,e){const t=uE(n[0]),i=fE(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*bi),Math.round(i*r*bi)]}function Th(n,e){const t=Math.pow(2,e.z),i=(n[0]/bi+e.x)/t,r=(n[1]/bi+e.y)/t;return[dE(i),gE(r)]}function uE(n){return(180+n)/360}function dE(n){return n*360-180}function fE(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function gE(n){return 360/Math.PI*Math.atan(Math.exp((180-n*360)*Math.PI/180))-90}function fo(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function go(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function pE(n,e,t){return e[1]>n[1]!=t[1]>n[1]&&n[0]<(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1])+e[0]}function AE(n,e,t){const i=n[0]-e[0],r=n[1]-e[1],s=n[0]-t[0],o=n[1]-t[1];return i*o-s*r===0&&i*s<=0&&r*o<=0}function Na(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]],s=[i[0]-t[0],i[1]-t[1]];return xE(s,r)===0?!1:!!(gg(n,e,t,i)&&gg(t,i,n,e))}function mE(n,e,t){for(const i of t)for(let r=0;r<i.length-1;++r)if(Na(n,e,i[r],i[r+1]))return!0;return!1}function Qr(n,e,t=!1){let i=!1;for(const r of e)for(let s=0;s<r.length-1;s++){if(AE(n,r[s],r[s+1]))return t;pE(n,r[s],r[s+1])&&(i=!i)}return i}function yE(n,e){for(const t of e)if(Qr(n,t))return!0;return!1}function fg(n,e){for(const t of n)if(!Qr(t,e))return!1;for(let t=0;t<n.length-1;++t)if(mE(n[t],n[t+1],e))return!1;return!0}function _E(n,e){for(const t of e)if(fg(n,t))return!0;return!1}function xE(n,e){return n[0]*e[1]-n[1]*e[0]}function gg(n,e,t,i){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1],l=i[0]-t[0],c=i[1]-t[1],h=r*c-l*s,u=o*c-l*a;return h>0&&u<0||h<0&&u>0}function Rh(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=[];for(let o=0;o<n[r].length;o++){const a=hE(n[r][o],t);fo(e,a),s.push(a)}i.push(s)}return i}function pg(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=Rh(n[r],e,t);i.push(s)}return i}function Ag(n,e,t,i){if(n[0]<t[0]||n[0]>t[2]){const r=i*.5;let s=n[0]-t[0]>r?-i:t[0]-n[0]>r?i:0;s===0&&(s=n[0]-t[2]>r?-i:t[2]-n[0]>r?i:0),n[0]+=s}fo(e,n)}function EE(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function mg(n,e,t,i){const r=Math.pow(2,i.z)*bi,s=[i.x*bi,i.y*bi],o=[];for(const a of n)for(const l of a){const c=[l.x+s[0],l.y+s[1]];Ag(c,e,t,r),o.push(c)}return o}function yg(n,e,t,i){const r=Math.pow(2,i.z)*bi,s=[i.x*bi,i.y*bi],o=[];for(const a of n){const l=[];for(const c of a){const h=[c.x+s[0],c.y+s[1]];fo(e,h),l.push(h)}o.push(l)}if(e[2]-e[0]<=r/2){EE(e);for(const a of o)for(const l of a)Ag(l,e,t,r)}return o}function wE(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=Rh(e.coordinates,i,r),o=mg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!Qr(a,s))return!1}if(e.type==="MultiPolygon"){const s=pg(e.coordinates,i,r),o=mg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!yE(a,s))return!1}return!0}function vE(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=Rh(e.coordinates,i,r),o=yg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!fg(a,s))return!1}if(e.type==="MultiPolygon"){const s=pg(e.coordinates,i,r),o=yg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!_E(a,s))return!1}return!0}class nr{constructor(e,t){this.type=$,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(co(e[1])){const i=e[1];if(i.type==="FeatureCollection"){const r=[];for(const s of i.features){const{type:o,coordinates:a}=s.geometry;o==="Polygon"&&r.push(a),o==="MultiPolygon"&&r.push(...a)}if(r.length){const s={type:"MultiPolygon",coordinates:r};return new nr(i,s)}}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new nr(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new nr(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return wE(e,this.geometries);if(e.geometryType()==="LineString")return vE(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class _g{constructor(e=[],t=(i,r)=>i<r?-1:i>r?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,r=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(i(r,o)>=0)break;t[e]=o,e=s}t[e]=r}_down(e){const{data:t,compare:i}=this,r=this.length>>1,s=t[e];for(;e<r;){let o=(e<<1)+1;const a=o+1;if(a<this.length&&i(t[a],t[o])<0&&(o=a),i(t[o],s)>=0)break;t[e]=t[o],e=o}t[e]=s}}function CE(n,e){if(n.length<=1)return[n];const i=[];let r,s;for(const o of n){const a=bE(o);a!==0&&(o.area=Math.abs(a),s===void 0&&(s=a<0),s===a<0?(r&&i.push(r),r=[o]):r.push(o))}return r&&i.push(r),i}function bE(n){let e=0;for(let t=0,i=n.length,r=i-1,s,o;t<i;r=t++)s=n[t],o=n[r],e+=(o.x-s.x)*(s.y+o.y);return e}const TE=6378.137,xg=1/298.257223563,Eg=xg*(2-xg),wg=Math.PI/180;class Sh{constructor(e){const t=wg*TE*1e3,i=Math.cos(e*wg),r=1/(1-Eg*(1-i*i)),s=Math.sqrt(r);this.kx=t*s*i,this.ky=t*s*r*(1-Eg)}distance(e,t){const i=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(e,t){let i=1/0,r,s,o,a;for(let l=0;l<e.length-1;l++){let c=e[l][0],h=e[l][1],u=this.wrap(e[l+1][0]-c)*this.kx,d=(e[l+1][1]-h)*this.ky,g=0;(u!==0||d!==0)&&(g=(this.wrap(t[0]-c)*this.kx*u+(t[1]-h)*this.ky*d)/(u*u+d*d),g>1?(c=e[l+1][0],h=e[l+1][1]):g>0&&(c+=u/this.kx*g,h+=d/this.ky*g)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-h)*this.ky;const f=u*u+d*d;f<i&&(i=f,r=c,s=h,o=l,a=g)}return{point:[r,s],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}const Ih=100,Ph=50;function vg(n,e){return e[0]-n[0]}function ja(n){return n[1]-n[0]+1}function Wi(n,e){return n[1]>=n[0]&&n[1]<e}function Mh(n,e){if(n[0]>n[1])return[null,null];const t=ja(n);if(e){if(t===2)return[n,null];const r=Math.floor(t/2);return[[n[0],n[0]+r],[n[0]+r,n[1]]]}if(t===1)return[n,null];const i=Math.floor(t/2)-1;return[[n[0],n[0]+i],[n[0]+i+1,n[1]]]}function Fh(n,e){if(!Wi(e,n.length))return[1/0,1/0,-1/0,-1/0];const t=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)fo(t,n[i]);return t}function Lh(n){const e=[1/0,1/0,-1/0,-1/0];for(const t of n)for(const i of t)fo(e,i);return e}function Cg(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function kh(n,e,t){if(!Cg(n)||!Cg(e))return NaN;let i=0,r=0;return n[2]<e[0]&&(i=e[0]-n[2]),n[0]>e[2]&&(i=n[0]-e[2]),n[1]>e[3]&&(r=n[1]-e[3]),n[3]<e[1]&&(r=e[1]-n[3]),t.distance([0,0],[i,r])}function rr(n,e,t){const i=t.pointOnLine(e,n);return t.distance(n,i.point)}function Dh(n,e,t,i,r){const s=Math.min(rr(n,[t,i],r),rr(e,[t,i],r)),o=Math.min(rr(t,[n,e],r),rr(i,[n,e],r));return Math.min(s,o)}function RE(n,e,t,i,r){if(!(Wi(e,n.length)&&Wi(i,t.length)))return 1/0;let o=1/0;for(let a=e[0];a<e[1];++a){const l=n[a],c=n[a+1];for(let h=i[0];h<i[1];++h){const u=t[h],d=t[h+1];if(Na(l,c,u,d))return 0;o=Math.min(o,Dh(l,c,u,d,r))}}return o}function SE(n,e,t,i,r){if(!(Wi(e,n.length)&&Wi(i,t.length)))return NaN;let o=1/0;for(let a=e[0];a<=e[1];++a)for(let l=i[0];l<=i[1];++l)if(o=Math.min(o,r.distance(n[a],t[l])),o===0)return o;return o}function IE(n,e,t){if(Qr(n,e,!0))return 0;let i=1/0;for(const r of e){const s=r[0],o=r[r.length-1];if(s!==o&&(i=Math.min(i,rr(n,[o,s],t)),i===0))return i;const a=t.pointOnLine(r,n);if(i=Math.min(i,t.distance(n,a.point)),i===0)return i}return i}function PE(n,e,t,i){if(!Wi(e,n.length))return NaN;for(let s=e[0];s<=e[1];++s)if(Qr(n[s],t,!0))return 0;let r=1/0;for(let s=e[0];s<e[1];++s){const o=n[s],a=n[s+1];for(const l of t)for(let c=0,h=l.length,u=h-1;c<h;u=c++){const d=l[u],g=l[c];if(Na(o,a,d,g))return 0;r=Math.min(r,Dh(o,a,d,g,i))}}return r}function bg(n,e){for(const t of n)for(const i of t)if(Qr(i,e,!0))return!0;return!1}function ME(n,e,t,i=1/0){const r=Lh(n),s=Lh(e);if(i!==1/0&&kh(r,s,t)>=i)return i;if(go(r,s)){if(bg(n,e))return 0}else if(bg(e,n))return 0;let o=1/0;for(const a of n)for(let l=0,c=a.length,h=c-1;l<c;h=l++){const u=a[h],d=a[l];for(const g of e)for(let f=0,p=g.length,A=p-1;f<p;A=f++){const m=g[A],y=g[f];if(Na(u,d,m,y))return 0;o=Math.min(o,Dh(u,d,m,y,t))}}return o}function Tg(n,e,t,i,r,s){if(!s)return;const o=kh(Fh(i,s),r,t);o<e&&n.push([o,s,[0,0]])}function za(n,e,t,i,r,s,o){if(!s||!o)return;const a=kh(Fh(i,s),Fh(r,o),t);a<e&&n.push([a,s,o])}function Ua(n,e,t,i,r=1/0){let s=Math.min(i.distance(n[0],t[0][0]),r);if(s===0)return s;const o=new _g([[0,[0,n.length-1],[0,0]]],vg),a=Lh(t);for(;o.length>0;){const l=o.pop();if(l[0]>=s)continue;const c=l[1],h=e?Ph:Ih;if(ja(c)<=h){if(!Wi(c,n.length))return NaN;if(e){const u=PE(n,c,t,i);if(isNaN(u)||u===0)return u;s=Math.min(s,u)}else for(let u=c[0];u<=c[1];++u){const d=IE(n[u],t,i);if(s=Math.min(s,d),s===0)return 0}}else{const u=Mh(c,e);Tg(o,s,i,n,a,u[0]),Tg(o,s,i,n,a,u[1])}}return s}function Va(n,e,t,i,r,s=1/0){let o=Math.min(s,r.distance(n[0],t[0]));if(o===0)return o;const a=new _g([[0,[0,n.length-1],[0,t.length-1]]],vg);for(;a.length>0;){const l=a.pop();if(l[0]>=o)continue;const c=l[1],h=l[2],u=e?Ph:Ih,d=i?Ph:Ih;if(ja(c)<=u&&ja(h)<=d){if(!Wi(c,n.length)&&Wi(h,t.length))return NaN;let g;if(e&&i)g=RE(n,c,t,h,r),o=Math.min(o,g);else if(e&&!i){const f=n.slice(c[0],c[1]+1);for(let p=h[0];p<=h[1];++p)if(g=rr(t[p],f,r),o=Math.min(o,g),o===0)return o}else if(!e&&i){const f=t.slice(h[0],h[1]+1);for(let p=c[0];p<=c[1];++p)if(g=rr(n[p],f,r),o=Math.min(o,g),o===0)return o}else g=SE(n,c,t,h,r),o=Math.min(o,g)}else{const g=Mh(c,e),f=Mh(h,i);za(a,o,r,n,t,g[0],f[0]),za(a,o,r,n,t,g[0],f[1]),za(a,o,r,n,t,g[1],f[0]),za(a,o,r,n,t,g[1],f[1])}}return o}function FE(n,e){const t=n.geometry(),i=t.flat().map(o=>Th([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Sh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,Va(i,!1,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,Va(i,!1,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Ua(i,!1,o.coordinates,r,s));break}if(s===0)return s}return s}function LE(n,e){const t=n.geometry(),i=t.flat().map(o=>Th([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Sh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,Va(i,!0,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,Va(i,!0,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Ua(i,!0,o.coordinates,r,s));break}if(s===0)return s}return s}function kE(n,e){const t=n.geometry();if(t.length===0||t[0].length===0)return NaN;const i=CE(t).map(o=>o.map(a=>a.map(l=>Th([l.x,l.y],n.canonical)))),r=new Sh(i[0][0][0][1]);let s=1/0;for(const o of e)for(const a of i){switch(o.type){case"Point":s=Math.min(s,Ua([o.coordinates],!1,a,r,s));break;case"LineString":s=Math.min(s,Ua(o.coordinates,!0,a,r,s));break;case"Polygon":s=Math.min(s,ME(a,o.coordinates,r,s));break}if(s===0)return s}return s}function Oh(n){return n.type==="MultiPolygon"?n.coordinates.map(e=>({type:"Polygon",coordinates:e})):n.type==="MultiLineString"?n.coordinates.map(e=>({type:"LineString",coordinates:e})):n.type==="MultiPoint"?n.coordinates.map(e=>({type:"Point",coordinates:e})):[n]}class sr{constructor(e,t){this.type=N,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(co(e[1])){const i=e[1];if(i.type==="FeatureCollection")return new sr(i,i.features.map(r=>Oh(r.geometry)).flat());if(i.type==="Feature")return new sr(i,Oh(i.geometry));if("type"in i&&"coordinates"in i)return new sr(i,Oh(i))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return FE(e,this.geometries);if(e.geometryType()==="LineString")return LE(e,this.geometries);if(e.geometryType()==="Polygon")return kE(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Wa={"==":rE,"!=":sE,">":aE,"<":oE,">=":cE,"<=":lE,array:ai,at:Ah,boolean:ai,case:_h,coalesce:uo,collator:Ba,format:vh,image:Ch,in:mh,"index-of":Da,interpolate:Ci,"interpolate-hcl":Ci,"interpolate-lab":Ci,length:bh,let:La,literal:Kr,match:yh,number:ai,"number-format":wh,object:ai,slice:Oa,step:Ga,string:ai,"to-boolean":_n,"to-color":_n,"to-number":_n,"to-string":_n,var:ka,within:nr,distance:sr};class Ft{constructor(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const i=e[0],r=Ft.definitions[i];if(!r)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter(([c])=>!Array.isArray(c)||c.length===e.length-1);let l=null;for(const[c,h]of a){l=new Fa(t.registry,Ha,t.path,null,t.scope);const u=[];let d=!1;for(let g=1;g<e.length;g++){const f=e[g],p=Array.isArray(c)?c[g-1]:c.type,A=l.parse(f,1+u.length,p);if(!A){d=!0;break}u.push(A)}if(!d){if(Array.isArray(c)&&c.length!==u.length){l.error(`Expected ${c.length} arguments, but found ${u.length} instead.`);continue}for(let g=0;g<u.length;g++){const f=Array.isArray(c)?c[g]:c.type,p=u[g];l.concat(g+1).checkSubtype(f,p.type)}if(l.errors.length===0)return new Ft(i,s,h,u)}}if(a.length===1)t.errors.push(...l.errors);else{const h=(a.length?a:o).map(([d])=>OE(d)).join(" | "),u=[];for(let d=1;d<e.length;d++){const g=t.parse(e[d],1+u.length);if(!g)return null;u.push(Oe(g.type))}t.error(`Expected arguments of type ${h}, but found (${u.join(", ")}) instead.`)}return null}static register(e,t){Ft.definitions=t;for(const i in t)e[i]=Ft}}function Rg(n,[e,t,i,r]){e=e.evaluate(n),t=t.evaluate(n),i=i.evaluate(n);const s=r?r.evaluate(n):1,o=og(e,t,i,s);if(o)throw new We(o);return new Se(e/255,t/255,i/255,s,!1)}function Sg(n,e){return n in e}function Gh(n,e){const t=e[n];return typeof t>"u"?null:t}function DE(n,e,t,i){for(;t<=i;){const r=t+i>>1;if(e[r]===n)return!0;e[r]>n?i=r-1:t=r+1}return!1}function or(n){return{type:n}}Ft.register(Wa,{error:[Px,[ie],(n,[e])=>{throw new We(e.evaluate(n))}],typeof:[ie,[ee],(n,[e])=>Oe(qe(e.evaluate(n)))],"to-rgba":[Mt(N,4),[wi],(n,[e])=>{const[t,i,r,s]=e.evaluate(n).rgb;return[t*255,i*255,r*255,s]}],rgb:[wi,[N,N,N],Rg],rgba:[wi,[N,N,N,N],Rg],has:{type:$,overloads:[[[ie],(n,[e])=>Sg(e.evaluate(n),n.properties())],[[ie,Wr],(n,[e,t])=>Sg(e.evaluate(n),t.evaluate(n))]]},get:{type:ee,overloads:[[[ie],(n,[e])=>Gh(e.evaluate(n),n.properties())],[[ie,Wr],(n,[e,t])=>Gh(e.evaluate(n),t.evaluate(n))]]},"feature-state":[ee,[ie],(n,[e])=>Gh(e.evaluate(n),n.featureState||{})],properties:[Wr,[],n=>n.properties()],"geometry-type":[ie,[],n=>n.geometryType()],id:[ee,[],n=>n.id()],zoom:[N,[],n=>n.globals.zoom],"heatmap-density":[N,[],n=>n.globals.heatmapDensity||0],"line-progress":[N,[],n=>n.globals.lineProgress||0],accumulated:[ee,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[N,or(N),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[N,or(N),(n,e)=>{let t=1;for(const i of e)t*=i.evaluate(n);return t}],"-":{type:N,overloads:[[[N,N],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[N],(n,[e])=>-e.evaluate(n)]]},"/":[N,[N,N],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[N,[N,N],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[N,[],()=>Math.LN2],pi:[N,[],()=>Math.PI],e:[N,[],()=>Math.E],"^":[N,[N,N],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[N,[N],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[N,[N],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[N,[N],(n,[e])=>Math.log(e.evaluate(n))],log2:[N,[N],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[N,[N],(n,[e])=>Math.sin(e.evaluate(n))],cos:[N,[N],(n,[e])=>Math.cos(e.evaluate(n))],tan:[N,[N],(n,[e])=>Math.tan(e.evaluate(n))],asin:[N,[N],(n,[e])=>Math.asin(e.evaluate(n))],acos:[N,[N],(n,[e])=>Math.acos(e.evaluate(n))],atan:[N,[N],(n,[e])=>Math.atan(e.evaluate(n))],min:[N,or(N),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[N,or(N),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[N,[N],(n,[e])=>Math.abs(e.evaluate(n))],round:[N,[N],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[N,[N],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[N,[N],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[$,[ie,ee],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[$,[ee],(n,[e])=>n.id()===e.value],"filter-type-==":[$,[ie],(n,[e])=>n.geometryType()===e.value],"filter-<":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<r}],"filter-id-<":[$,[ee],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<i}],"filter->":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>r}],"filter-id->":[$,[ee],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[$,[ee],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[$,[ee],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[$,[ee],(n,[e])=>e.value in n.properties()],"filter-has-id":[$,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[$,[Mt(ie)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[$,[Mt(ee)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[$,[ie,Mt(ee)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[$,[ie,Mt(ee)],(n,[e,t])=>DE(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:$,overloads:[[[$,$],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[or($),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:$,overloads:[[[$,$],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[or($),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[$,[$],(n,[e])=>!e.evaluate(n)],"is-supported-script":[$,[ie],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[ie,[ie],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[ie,[ie],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[ie,or(ee),(n,e)=>e.map(t=>ho(t.evaluate(n))).join("")],"resolved-locale":[ie,[ba],(n,[e])=>e.evaluate(n).resolvedLocale()]});function OE(n){return Array.isArray(n)?`(${n.map(Oe).join(", ")})`:`(${Oe(n.type)}...)`}function Ha(n){if(n instanceof ka)return Ha(n.boundExpression);if(n instanceof Ft&&n.name==="error")return!1;if(n instanceof Ba)return!1;if(n instanceof nr)return!1;if(n instanceof sr)return!1;const e=n instanceof _n||n instanceof ai;let t=!0;return n.eachChild(i=>{e?t=t&&Ha(i):t=t&&i instanceof Kr}),t?Bh(n)&&jh(n,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Bh(n){if(n instanceof Ft){if(n.name==="get"&&n.args.length===1)return!1;if(n.name==="feature-state")return!1;if(n.name==="has"&&n.args.length===1)return!1;if(n.name==="properties"||n.name==="geometry-type"||n.name==="id")return!1;if(/^filter-/.test(n.name))return!1}if(n instanceof nr||n instanceof sr)return!1;let e=!0;return n.eachChild(t=>{e&&!Bh(t)&&(e=!1)}),e}function Nh(n){if(n instanceof Ft&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!Nh(t)&&(e=!1)}),e}function jh(n,e){if(n instanceof Ft&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!jh(i,e)&&(t=!1)}),t}function zh(n){return{result:"success",value:n}}function qr(n){return{result:"error",value:n}}function GE(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function BE(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function NE(n){return!!n.expression&&n.expression.interpolated}function Ig(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}class jE{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new lg,this._defaultValue=t?WE(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,r,s,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null;try{const a=this.expression.evaluate(this._evaluator);if(a==null||typeof a=="number"&&a!==a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new We(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(a)} instead.`);return a}catch(a){return this._warningHistory[a.message]||(this._warningHistory[a.message]=!0,typeof console<"u"&&console.warn(a.message)),this._defaultValue}}}function zE(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in Wa}function Pg(n,e){const t=new Fa(Wa,Ha,[],e?VE(e):void 0),i=t.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?zh(new jE(i,e)):qr(t.errors)}class Mg{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Nh(t.expression)}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}}class Fg{constructor(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Nh(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}interpolationFactor(e,t,i){return this.interpolationType?Ci.interpolationFactor(this.interpolationType,e,t,i):0}}function UE(n,e){const t=Pg(n,e);if(t.result==="error")return t;const i=t.value.expression,r=Bh(i);if(!r&&!GE(e))return qr([new Ei("","data expressions not supported")]);const s=jh(i,["zoom"]);if(!s&&!BE(e))return qr([new Ei("","zoom expressions not supported")]);const o=Xa(i);if(!o&&!s)return qr([new Ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Ei)return qr([o]);if(o instanceof Ci&&!NE(e))return qr([new Ei("",'"interpolate" expressions cannot be used with this property')]);if(!o)return zh(r?new Mg("constant",t.value):new Mg("source",t.value));const a=o instanceof Ci?o.interpolation:void 0;return zh(r?new Fg("camera",t.value,o.labels,a):new Fg("composite",t.value,o.labels,a))}function Xa(n){let e=null;if(n instanceof La)e=Xa(n.result);else if(n instanceof uo){for(const t of n.args)if(e=Xa(t),e)break}else(n instanceof Ga||n instanceof Ci)&&n.input instanceof Ft&&n.input.name==="zoom"&&(e=n);return e instanceof Ei||n.eachChild(t=>{const i=Xa(t);i instanceof Ei?e=i:!e&&i?e=new Ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Ei("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function VE(n){const e={color:wi,string:ie,number:N,enum:ie,boolean:$,formatted:Ta,padding:Ra,projectionDefinition:Ca,resolvedImage:ao,variableAnchorOffsetCollection:Sa};return n.type==="array"?Mt(e[n.value]||ee,n.length):e[n.type]}function WE(n){return n.type==="color"&&Ig(n.default)?new Se(0,0,0,0):n.type==="color"?Se.parse(n.default)||null:n.type==="padding"?si.parse(n.default)||null:n.type==="variableAnchorOffsetCollection"?vi.parse(n.default)||null:n.type==="projectionDefinition"?oi.parse(n.default)||null:n.default===void 0?null:n.default}function Lg(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!Lg(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const HE={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function XE(n){if(n==null)return{filter:()=>!0,needGeometry:!1};Lg(n)||(n=Ya(n));const e=Pg(n,HE);if(e.result==="error")throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));{const t=kg(n);return{filter:(i,r,s)=>e.value.evaluate(i,r,{},s),needGeometry:t}}}function YE(n,e){return n<e?-1:n>e?1:0}function kg(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let e=1;e<n.length;e++)if(kg(n[e]))return!0;return!1}function Ya(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?Uh(n[1],n[2],"=="):e==="!="?Ka(Uh(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Uh(n[1],n[2],e):e==="any"?KE(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(Ya)):e==="none"?["all"].concat(n.slice(1).map(Ya).map(Ka)):e==="in"?Dg(n[1],n.slice(2)):e==="!in"?Ka(Dg(n[1],n.slice(2))):e==="has"?Og(n[1]):e==="!has"?Ka(Og(n[1])):!0}function Uh(n,e,t){switch(n){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,n,e]}}function KE(n){return["any"].concat(n.map(Ya))}function Dg(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",n,["literal",e.sort(YE)]]:["filter-in-small",n,["literal",e]]}}function Og(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function Ka(n){return["!",n]}function po(n){return typeof n=="object"?["literal",n]:n}function ZE(n,e){let t=n.stops;if(!t)return QE(n,e);const i=t&&typeof t[0][0]=="object",r=i||n.property!==void 0,s=i||!r;return t=t.map(o=>!r&&e.tokens&&typeof o[1]=="string"?[o[0],e1(o[1])]:[o[0],po(o[1])]),i?qE(n,e,t):s?$E(n,e,t):Wh(n,e,t)}function QE(n,e){const t=["get",n.property];if(n.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,n.default];{const i=[e.type==="color"?"to-color":e.type,t,po(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function Vh(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function qE(n,e,t){const i={},r={},s=[];for(let a=0;a<t.length;a++){const l=t[a],c=l[0].zoom;i[c]===void 0&&(i[c]={zoom:c,type:n.type,property:n.property,default:n.default},r[c]=[],s.push(c)),r[c].push([l[0].value,l[1]])}if(Xh({},e)==="exponential"){const a=[Vh(n),["linear"],["zoom"]];for(const l of s){const c=Wh(i[l],e,r[l]);Jr(a,l,c,!1)}return a}else{const a=["step",["zoom"]];for(const l of s){const c=Wh(i[l],e,r[l]);Jr(a,l,c,!0)}return Hh(a),a}}function JE(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function Gg(n,e){const t=po(JE(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function Wh(n,e,t){const i=Xh(n,e),r=["get",n.property];if(i==="categorical"&&typeof t[0][0]=="boolean"){const s=["case"];for(const o of t)s.push(["==",r,o[0]],o[1]);return s.push(Gg(n,e)),s}else if(i==="categorical"){const s=["match",r];for(const o of t)Jr(s,o[0],o[1],!1);return s.push(Gg(n,e)),s}else if(i==="interval"){const s=["step",["number",r]];for(const o of t)Jr(s,o[0],o[1],!0);return Hh(s),n.default===void 0?s:["case",["==",["typeof",r],"number"],s,po(n.default)]}else if(i==="exponential"){const s=n.base!==void 0?n.base:1,o=[Vh(n),s===1?["linear"]:["exponential",s],["number",r]];for(const a of t)Jr(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",r],"number"],o,po(n.default)]}else throw new Error(`Unknown property function type ${i}`)}function $E(n,e,t,i=["zoom"]){const r=Xh(n,e);let s,o=!1;if(r==="interval")s=["step",i],o=!0;else if(r==="exponential"){const a=n.base!==void 0?n.base:1;s=[Vh(n),a===1?["linear"]:["exponential",a],i]}else throw new Error(`Unknown zoom function type "${r}"`);for(const a of t)Jr(s,a[0],a[1],o);return Hh(s),s}function Hh(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function Jr(n,e,t,i){n.length>3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function Xh(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function e1(n){const e=["concat"],t=/{([^{}]+)}/g;let i=0;for(let r=t.exec(n);r!==null;r=t.exec(n)){const s=n.slice(i,t.lastIndex-r[0].length);i=t.lastIndex,s.length>0&&e.push(s),e.push(["get",r[1]])}if(e.length===1)return n;if(i<n.length)e.push(n.slice(i));else if(e.length===2)return["to-string",e[1]];return e}const t1=Rx;var Bg={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},Ao=" ",Ng=/(italic|oblique)$/i,jg={};function Yh(n,e,t){var i=jg[n];if(!i){Array.isArray(n)||(n=[n]);for(var r=400,s="normal",o=[],a,l,c=0,h=n.length;c<h;++c){var u=n[c],d=u.split(" "),g=d[d.length-1].toLowerCase();g=="normal"||g=="italic"||g=="oblique"?(s=l?s:g,l=!0,d.pop(),g=d[d.length-1].toLowerCase()):Ng.test(g)&&(g=g.replace(Ng,""),s=l?s:d[d.length-1].replace(g,""),l=!0);for(var f in Bg){var p=d.length>1?d[d.length-2].toLowerCase():"";if(g==f||g==f.replace("-","")||p+"-"+g==f){r=a?r:Bg[f],d.pop(),p&&f.startsWith(p)&&d.pop();break}}!a&&typeof g=="number"&&(r=g,a=!0);var A=d.join(Ao).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");A.indexOf(Ao)!==-1&&(A='"'+A+'"'),o.push(A)}i=jg[n]=[s,r,o]}return i[0]+Ao+i[1]+Ao+e+"px"+(t?"/"+t:"")+Ao+i[2]}class zg{drawCustom(e,t,i,r,s){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,i){}drawFeature(e,t,i){}drawGeometryCollection(e,t,i){}drawLineString(e,t,i){}drawMultiLineString(e,t,i){}drawMultiPoint(e,t,i){}drawMultiPolygon(e,t,i){}drawPoint(e,t,i){}drawPolygon(e,t,i){}drawText(e,t,i){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}}class i1 extends zg{constructor(e,t,i,r,s,o,a){super(),this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.transformRotation_=r?Is(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=mt()}drawImages_(e,t,i,r){if(!this.image_)return;const s=hn(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let h=0,u=s.length;h<u;h+=2){const d=s[h]-this.imageAnchorX_,g=s[h+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const f=d+this.imageAnchorX_,p=g+this.imageAnchorY_;mi(a,f,p,1,1,c,-f,-p),o.save(),o.transform.apply(o,a),o.translate(f,p),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.restore()}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,g,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=l)}drawText_(e,t,i,r){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const s=hn(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);t<i;t+=r){const l=s[t]+this.textOffsetX_,c=s[t+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.save(),o.translate(l-this.textOffsetX_,c-this.textOffsetY_),o.rotate(a),o.translate(this.textOffsetX_,this.textOffsetY_),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.restore()):(this.textStrokeState_&&o.strokeText(this.text_,l,c),this.textFillState_&&o.fillText(this.text_,l,c))}}moveToLineTo_(e,t,i,r,s){const o=this.context_,a=hn(e,t,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;s&&(l-=2);for(let c=2;c<l;c+=2)o.lineTo(a[c],a[c+1]);return s&&o.closePath(),i}drawRings_(e,t,i,r){for(let s=0,o=i.length;s<o;++s)t=this.moveToLineTo_(e,t,i[s],r,!0);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Be(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=fy(e,this.transform_,this.pixelCoordinates_),i=t[2]-t[0],r=t[3]-t[1],s=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(t[0],t[1],s,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case"Point":this.drawPoint(e);break;case"LineString":this.drawLineString(e);break;case"Polygon":this.drawPolygon(e);break;case"MultiPoint":this.drawMultiPoint(e);break;case"MultiLineString":this.drawMultiLineString(e);break;case"MultiPolygon":this.drawMultiPolygon(e);break;case"GeometryCollection":this.drawGeometryCollection(e);break;case"Circle":this.drawCircle(e);break}}drawFeature(e,t){const i=t.getGeometryFunction()(e);i&&(this.setStyle(t),this.drawGeometry(i))}drawGeometryCollection(e){const t=e.getGeometriesArray();for(let i=0,r=t.length;i<r;++i)this.drawGeometry(t[i])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Be(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(i,0,i.length,e.getStride(),!1),t.stroke()}if(this.text_!==""){const t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getExtent();if(Be(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,r=e.getFlatCoordinates();let s=0;const o=e.getEnds(),a=e.getStride();i.beginPath();for(let l=0,c=o.length;l<c;++l)s=this.moveToLineTo_(r,s,o[l],a,!1);i.stroke()}if(this.text_!==""){const i=e.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Be(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Be(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getOrientedFlatCoordinates();let r=0;const s=e.getEndss(),o=e.getStride();t.beginPath();for(let a=0,l=s.length;a<l;++a){const c=s[a];r=this.drawRings_(i,r,c,o)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){const t=this.context_,i=this.contextFillState_;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){const t=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=e.lineCap&&(i.lineCap=e.lineCap,t.lineCap=e.lineCap),Fi(i.lineDash,e.lineDash)||t.setLineDash(i.lineDash=e.lineDash),i.lineDashOffset!=e.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),i.lineJoin!=e.lineJoin&&(i.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){const t=this.context_,i=this.contextTextState_,r=e.textAlign?e.textAlign:to;i?(i.font!=e.font&&(i.font=e.font,t.font=e.font),i.textAlign!=r&&(i.textAlign=r,t.textAlign=r),i.textBaseline!=e.textBaseline&&(i.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{const i=e.getColor();this.fillState_={fillStyle:_i(i||xt)}}if(!t)this.strokeState_=null;else{const i=t.getColor(),r=t.getLineCap(),s=t.getLineDash(),o=t.getLineDashOffset(),a=t.getLineJoin(),l=t.getWidth(),c=t.getMiterLimit(),h=s||ji;this.strokeState_={lineCap:r!==void 0?r:jr,lineDash:this.pixelRatio_===1?h:h.map(u=>u*this.pixelRatio_),lineDashOffset:(o||zi)*this.pixelRatio_,lineJoin:a!==void 0?a:zr,lineWidth:(l!==void 0?l:io)*this.pixelRatio_,miterLimit:c!==void 0?c:$s,strokeStyle:_i(i||eo)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}const i=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),s=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*i,this.imageAnchorY_=r[1]*i,this.imageHeight_=t[1]*i,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();const o=e.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=t[0]*i}setTextStyle(e){if(!e)this.text_="";else{const t=e.getFill();if(!t)this.textFillState_=null;else{const g=t.getColor();this.textFillState_={fillStyle:_i(g||xt)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const g=i.getColor(),f=i.getLineCap(),p=i.getLineDash(),A=i.getLineDashOffset(),m=i.getLineJoin(),y=i.getWidth(),E=i.getMiterLimit();this.textStrokeState_={lineCap:f!==void 0?f:jr,lineDash:p||ji,lineDashOffset:A||zi,lineJoin:m!==void 0?m:zr,lineWidth:y!==void 0?y:io,miterLimit:E!==void 0?E:$s,strokeStyle:_i(g||eo)}}const r=e.getFont(),s=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),c=e.getScaleArray(),h=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r!==void 0?r:bf,textAlign:u!==void 0?u:to,textBaseline:d!==void 0?d:ca},this.text_=h!==void 0?Array.isArray(h)?h.reduce((g,f,p)=>g+=p%2?" ":f,""):h:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const n1=.5,Ug={Point:u1,LineString:l1,Polygon:f1,MultiPoint:d1,MultiLineString:c1,MultiPolygon:h1,GeometryCollection:a1,Circle:s1};function r1(n,e){return parseInt(Y(n),10)-parseInt(Y(e),10)}function Kh(n,e){const t=Vg(n,e);return t*t}function Vg(n,e){return n1*n/e}function s1(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),"Circle");l.setFillStrokeStyle(s,o),l.drawCircle(e,i,r)}const a=t.getText();if(a&&a.getText()){const l=n.getBuilder(t.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i)}}function Za(n,e,t,i,r,s,o,a){const l=[],c=t.getImage();if(c){let d=!0;const g=c.getImageState();g==V.LOADED||g==V.ERROR?d=!1:g==V.IDLE&&c.load(),d&&l.push(c.ready())}const h=t.getFill();h&&h.loading()&&l.push(h.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>r(null)),o1(n,e,t,i,s,o,a),u}function o1(n,e,t,i,r,s,o){const a=t.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,r);if(t.getRenderer())Wg(n,l,t,e,o);else{const h=Ug[l.getType()];h(n,l,t,e,o,s)}}function Wg(n,e,t,i,r){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a<l;++a)Wg(n,o[a],t,i,r);return}n.getBuilder(t.getZIndex(),"Default").drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer(),r)}function a1(n,e,t,i,r,s){const o=e.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const c=Ug[o[a].getType()];c(n,o[a],t,i,r,s)}}function l1(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawLineString(e,i,r)}const o=t.getText();if(o&&o.getText()){const a=n.getBuilder(t.getZIndex(),"Text");a.setTextStyle(o),a.drawText(e,i,r)}}function c1(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawMultiLineString(e,i,r)}const o=t.getText();if(o&&o.getText()){const a=n.getBuilder(t.getZIndex(),"Text");a.setTextStyle(o),a.drawText(e,i,r)}}function h1(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(o||s){const l=n.getBuilder(t.getZIndex(),"Polygon");l.setFillStrokeStyle(s,o),l.drawMultiPolygon(e,i,r)}const a=t.getText();if(a&&a.getText()){const l=n.getBuilder(t.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i,r)}}function u1(n,e,t,i,r,s){const o=t.getImage(),a=t.getText(),l=a&&a.getText(),c=s&&o&&l?{}:void 0;if(o){if(o.getImageState()!=V.LOADED)return;const h=n.getBuilder(t.getZIndex(),"Image");h.setImageStyle(o,c),h.drawPoint(e,i,r)}if(l){const h=n.getBuilder(t.getZIndex(),"Text");h.setTextStyle(a,c),h.drawText(e,i,r)}}function d1(n,e,t,i,r,s){const o=t.getImage(),a=o&&o.getOpacity()!==0,l=t.getText(),c=l&&l.getText(),h=s&&a&&c?{}:void 0;if(a){if(o.getImageState()!=V.LOADED)return;const u=n.getBuilder(t.getZIndex(),"Image");u.setImageStyle(o,h),u.drawMultiPoint(e,i,r)}if(c){const u=n.getBuilder(t.getZIndex(),"Text");u.setTextStyle(l,h),u.drawText(e,i,r)}}function f1(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),"Polygon");l.setFillStrokeStyle(s,o),l.drawPolygon(e,i,r)}const a=t.getText();if(a&&a.getText()){const l=n.getBuilder(t.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i,r)}}let g1=!1;function Hg(n,e,t,i,r,s,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(t,i,r):n,!0),e.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=g1,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=e.getType();try{let h;c=="text"||c=="json"?h=a.responseText:c=="xml"?h=a.responseXML||a.responseText:c=="arraybuffer"&&(h=a.response),h?s(e.readFeatures(h,{extent:t,featureProjection:r}),e.readProjection(h)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function Xg(n,e){return function(t,i,r,s,o){Hg(n,e,t,i,r,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}function p1(n,e){return[[-1/0,-1/0,1/0,1/0]]}function A1(n,e){return[n]}class Zh{constructor(e){this.rbush_=new ff(e),this.items_={}}insert(e,t){const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(i),this.items_[Y(t)]=i}load(e,t){const i=new Array(t.length);for(let r=0,s=t.length;r<s;r++){const o=e[r],a=t[r],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};i[r]=l,this.items_[Y(a)]=l}this.rbush_.load(i)}remove(e){const t=Y(e),i=this.items_[t];return delete this.items_[t],this.rbush_.remove(i)!==null}update(e,t){const i=this.items_[Y(t)],r=[i.minX,i.minY,i.maxX,i.maxY];Gi(r,e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(r){return r.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let i;for(let r=0,s=e.length;r<s;r++)if(i=t(e[r]),i)return i;return i}isEmpty(){return rn(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return Ai(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const t in e.items_)this.items_[t]=e.items_[t]}}class $r extends pi{constructor(e){super(),this.projection=pe(e.projection),this.attributions_=Yg(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const t=this;this.viewPromise_=new Promise(function(i,r){t.viewResolver=i,t.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=Yg(e),this.changed()}setState(e){this.state_=e,this.changed()}}function Yg(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),e=>n):null}const wt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class xn extends Tt{constructor(e,t,i){super(e),this.feature=t,this.features=i}}class En extends $r{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=bs,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(ge(this.format_,"`format` must be set when `url` is set"),this.loader_=Xg(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:p1;const t=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=t?new Zh:null,this.loadedExtentsRtree_=new Zh,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,r;Array.isArray(e.features)?r=e.features:e.features&&(i=e.features,r=i.getArray()),!t&&i===void 0&&(i=new Gt(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=Y(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);const i=e.getGeometry();if(i){const r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new xn(wt.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof tt||(this.featureChangeKeys_[e]=[oe(t,H.CHANGE,this.handleFeatureChange_,this),oe(t,vr.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let i=!0;if(t.getId()!==void 0){const r=String(t.getId());if(!(r in this.idIndex_))this.idIndex_[r]=t;else if(t instanceof tt){const s=this.idIndex_[r];s instanceof tt?Array.isArray(s)?s.push(t):this.idIndex_[r]=[s,t]:i=!1}else i=!1}return i&&(ge(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const t=[],i=[],r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s],l=Y(a);this.addToIndex_(l,a)&&i.push(a)}for(let s=0,o=i.length;s<o;s++){const a=i[s],l=Y(a);this.setupChangeEvents_(l,a);const c=a.getGeometry();if(c){const h=c.getExtent();t.push(h),r.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(wt.ADDFEATURE))for(let s=0,o=i.length;s<o;s++)this.dispatchEvent(new xn(wt.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(wt.ADDFEATURE,function(i){t||(t=!0,e.push(i.feature),t=!1)}),this.addEventListener(wt.REMOVEFEATURE,function(i){t||(t=!0,e.remove(i.feature),t=!1)}),e.addEventListener(ot.ADD,i=>{t||(t=!0,this.addFeature(i.element),t=!1)}),e.addEventListener(ot.REMOVE,i=>{t||(t=!0,this.removeFeature(i.element),t=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(ve);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(i=>{this.removeFeatureInternal(i)});for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const t=new xn(wt.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(r){const s=r.getGeometry();if(s instanceof tt||s.intersectsCoordinate(e))return t(r)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(i){const r=i.getGeometry();if(r instanceof tt||r.intersectsExtent(e)){const s=t(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),rn(this.nullGeometryFeatures_)||gi(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const t=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){t.push(i)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const r=zl(e,t);return[].concat(...r.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){const i=e[0],r=e[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return t=t||Cr,this.featuresRtree_.forEachInExtent(l,function(c){if(t(c)){const h=c.getGeometry(),u=a;if(a=h instanceof tt?0:h.closestPointXY(i,r,o,a),a<u){s=c;const d=Math.sqrt(a);l[0]=i-d,l[1]=r-d,l[2]=i+d,l[3]=r+d}}}),s}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const t=this.idIndex_[e.toString()];return t!==void 0?t:null}getFeatureByUid(e){const t=this.uidIndex_[e];return t!==void 0?t:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const t=e.target,i=Y(t),r=t.getGeometry();if(!r)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[i]=t);else{const o=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,t)):this.featuresRtree_&&this.featuresRtree_.update(o,t)}const s=t.getId();if(s!==void 0){const o=s.toString();this.idIndex_[o]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[o]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[i]=t;this.changed(),this.dispatchEvent(new xn(wt.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:Y(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&rn(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,i){const r=this.loadedExtentsRtree_,s=this.strategy_(e,t,i);for(let o=0,a=s.length;o<a;++o){const l=s[o];r.forEachInExtent(l,function(h){return Oi(h.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new xn(wt.FEATURESLOADSTART)),this.loader_.call(this,l,t,i,h=>{--this.loadingExtentsCount_,this.dispatchEvent(new xn(wt.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new xn(wt.FEATURESLOADERROR))}),r.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const t=this.loadedExtentsRtree_,i=t.forEachInExtent(e,function(r){if(Gi(r.extent,e))return r});i&&t.remove(i)}removeFeatures(e){let t=!1;for(let i=0,r=e.length;i<r;++i)t=this.removeFeatureInternal(e[i])||t;t&&this.changed()}removeFeature(e){if(!e)return;this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const t=Y(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e);const i=this.featureChangeKeys_[t];i==null||i.forEach(ve),delete this.featureChangeKeys_[t];const r=e.getId();if(r!==void 0){const s=r.toString(),o=this.idIndex_[s];o===e?delete this.idIndex_[s]:Array.isArray(o)&&(o.splice(o.indexOf(e),1),o.length===1&&(this.idIndex_[s]=o[0]))}return delete this.uidIndex_[t],this.hasListener(wt.REMOVEFEATURE)&&this.dispatchEvent(new xn(wt.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(const t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){ge(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(Xg(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const K={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Qa=[K.FILL],wn=[K.STROKE],ar=[K.BEGIN_PATH],Kg=[K.CLOSE_PATH];class mo extends zg{constructor(e,t,i,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){const t=this.pixelRatio;return t==1?e:e.map(function(i){return i*t})}appendFlatPointCoordinates(e,t){const i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let o=s.length;for(let a=0,l=e.length;a<l;a+=t)r[0]=e[a],r[1]=e[a+1],Nn(i,r)&&(s[o++]=r[0],s[o++]=r[1]);return o}appendFlatLineCoordinates(e,t,i,r,s,o){const a=this.coordinates;let l=a.length;const c=this.getBufferedMaxExtent();o&&(t+=r);let h=e[t],u=e[t+1];const d=this.tmpCoordinate_;let g=!0,f,p,A;for(f=t+r;f<i;f+=r)d[0]=e[f],d[1]=e[f+1],A=Gl(c,d),A!==p?(g&&(a[l++]=h,a[l++]=u,g=!1),a[l++]=d[0],a[l++]=d[1]):A===et.INTERSECTING?(a[l++]=d[0],a[l++]=d[1],g=!1):g=!0,h=d[0],u=d[1],p=A;return(s&&g||f===t+r)&&(a[l++]=h,a[l++]=u),l}drawCustomCoordinates_(e,t,i,r,s){for(let o=0,a=i.length;o<a;++o){const l=i[o],c=this.appendFlatLineCoordinates(e,t,l,r,!1,!1);s.push(c),t=l}return t}drawCustom(e,t,i,r,s){this.beginGeometry(e,t,s);const o=e.getType(),a=e.getStride(),l=this.coordinates.length;let c,h,u,d,g;switch(o){case"MultiPolygon":c=e.getOrientedFlatCoordinates(),d=[];const f=e.getEndss();g=0;for(let p=0,A=f.length;p<A;++p){const m=[];g=this.drawCustomCoordinates_(c,g,f[p],a,m),d.push(m)}this.instructions.push([K.CUSTOM,l,d,e,i,lc,s]),this.hitDetectionInstructions.push([K.CUSTOM,l,d,e,r||i,lc,s]);break;case"Polygon":case"MultiLineString":u=[],c=o=="Polygon"?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),g=this.drawCustomCoordinates_(c,0,e.getEnds(),a,u),this.instructions.push([K.CUSTOM,l,u,e,i,Ns,s]),this.hitDetectionInstructions.push([K.CUSTOM,l,u,e,r||i,Ns,s]);break;case"LineString":case"Circle":c=e.getFlatCoordinates(),h=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([K.CUSTOM,l,h,e,i,dn,s]),this.hitDetectionInstructions.push([K.CUSTOM,l,h,e,r||i,dn,s]);break;case"MultiPoint":c=e.getFlatCoordinates(),h=this.appendFlatPointCoordinates(c,a),h>l&&(this.instructions.push([K.CUSTOM,l,h,e,i,dn,s]),this.hitDetectionInstructions.push([K.CUSTOM,l,h,e,r||i,dn,s]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([K.CUSTOM,l,h,e,i,void 0,s]),this.hitDetectionInstructions.push([K.CUSTOM,l,h,e,r||i,void 0,s]);break}this.endGeometry(t)}beginGeometry(e,t,i){this.beginGeometryInstruction1_=[K.BEGIN_GEOMETRY,t,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[K.BEGIN_GEOMETRY,t,0,e,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let t;const i=e.length;let r,s,o=-1;for(t=0;t<i;++t)r=e[t],s=r[0],s==K.END_GEOMETRY?o=t:s==K.BEGIN_GEOMETRY&&(r[2]=t,im(this.hitDetectionInstructions,o,t),o=-1)}fillStyleToState(e,t={}){if(e){const i=e.getColor();t.fillPatternScale=i&&typeof i=="object"&&"src"in i?this.pixelRatio:1,t.fillStyle=_i(i||xt)}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){const i=e.getColor();t.strokeStyle=_i(i||eo);const r=e.getLineCap();t.lineCap=r!==void 0?r:jr;const s=e.getLineDash();t.lineDash=s?s.slice():ji;const o=e.getLineDashOffset();t.lineDashOffset=o||zi;const a=e.getLineJoin();t.lineJoin=a!==void 0?a:zr;const l=e.getWidth();t.lineWidth=l!==void 0?l:io;const c=e.getMiterLimit();t.miterLimit=c!==void 0?c:$s,t.lineWidth>this.maxLineWidth&&(this.maxLineWidth=t.lineWidth,this.bufferedMaxExtent_=null)}else t.strokeStyle=void 0,t.lineCap=void 0,t.lineDash=null,t.lineDashOffset=void 0,t.lineJoin=void 0,t.lineWidth=void 0,t.miterLimit=void 0;return t}setFillStrokeStyle(e,t){const i=this.state;this.fillStyleToState(e,i),this.strokeStyleToState(t,i)}createFill(e){const t=e.fillStyle,i=[K.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[K.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(t.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,t){const i=e.strokeStyle,r=e.lineCap,s=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,l=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!Fi(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c)&&(i!==void 0&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=s,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=l,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const t=[K.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=hd(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;Di(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class m1 extends mo{constructor(e,t,i,r){super(e,t,i,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t,i){if(!this.image_||this.maxExtent&&!Nn(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,i);const r=e.getFlatCoordinates(),s=e.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,s);this.instructions.push([K.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([K.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t,i){if(!this.image_)return;this.beginGeometry(e,t,i);const r=e.getFlatCoordinates(),s=[];for(let l=0,c=r.length;l<c;l+=e.getStride())(!this.maxExtent||Nn(this.maxExtent,r.slice(l,l+2)))&&s.push(r[l],r[l+1]);const o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,2);this.instructions.push([K.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([K.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){const i=e.getAnchor(),r=e.getSize(),s=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}class y1 extends mo{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinates_(e,t,i,r){const s=this.coordinates.length,o=this.appendFlatLineCoordinates(e,t,i,r,!1,!1),a=[K.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ji,zi],ar);const a=e.getFlatCoordinates(),l=e.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(wn),this.endGeometry(t)}drawMultiLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ji,zi],ar);const a=e.getEnds(),l=e.getFlatCoordinates(),c=e.getStride();let h=0;for(let u=0,d=a.length;u<d;++u)h=this.drawFlatCoordinates_(l,h,a[u],c);this.hitDetectionInstructions.push(wn),this.endGeometry(t)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(wn),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(wn),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(ar)}}class Zg extends mo{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinatess_(e,t,i,r){const s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,l=i.length;this.instructions.push(ar),this.hitDetectionInstructions.push(ar);for(let c=0;c<l;++c){const h=i[c],u=this.coordinates.length,d=this.appendFlatLineCoordinates(e,t,h,r,!0,!a),g=[K.MOVE_TO_LINE_TO,u,d];this.instructions.push(g),this.hitDetectionInstructions.push(g),a&&(this.instructions.push(Kg),this.hitDetectionInstructions.push(Kg)),t=h}return o&&(this.instructions.push(Qa),this.hitDetectionInstructions.push(Qa)),a&&(this.instructions.push(wn),this.hitDetectionInstructions.push(wn)),t}drawCircle(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_FILL_STYLE,xt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ji,zi]);const a=e.getFlatCoordinates(),l=e.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);const h=[K.CIRCLE,c];this.instructions.push(ar,h),this.hitDetectionInstructions.push(ar,h),r.fillStyle!==void 0&&(this.instructions.push(Qa),this.hitDetectionInstructions.push(Qa)),r.strokeStyle!==void 0&&(this.instructions.push(wn),this.hitDetectionInstructions.push(wn)),this.endGeometry(t)}drawPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_FILL_STYLE,xt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ji,zi]);const a=e.getEnds(),l=e.getOrientedFlatCoordinates(),c=e.getStride();this.drawFlatCoordinatess_(l,0,a,c),this.endGeometry(t)}drawMultiPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_FILL_STYLE,xt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ji,zi]);const a=e.getEndss(),l=e.getOrientedFlatCoordinates(),c=e.getStride();let h=0;for(let u=0,d=a.length;u<d;++u)h=this.drawFlatCoordinatess_(l,h,a[u],c);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const e=this.tolerance;if(e!==0){const t=this.coordinates;for(let i=0,r=t.length;i<r;++i)t[i]=Hn(t[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;e.fillStyle!==void 0&&this.updateFillStyle(e,this.createFill),e.strokeStyle!==void 0&&this.updateStrokeStyle(e,this.applyStroke)}}function _1(n,e,t,i,r){const s=[];let o=t,a=0,l=e.slice(t,2);for(;a<n&&o+r<i;){const[c,h]=l.slice(-2),u=e[o+r],d=e[o+r+1],g=Math.sqrt((u-c)*(u-c)+(d-h)*(d-h));if(a+=g,a>=n){const f=(n-a+g)/g,p=Rt(c,u,f),A=Rt(h,d,f);l.push(p,A),s.push(l),l=[p,A],a==n&&(o+=r),a=0}else if(a<n)l.push(e[o+r],e[o+r+1]),o+=r;else{const f=g-a,p=Rt(c,u,f/g),A=Rt(h,d,f/g);l.push(p,A),s.push(l),l=[p,A],a=0,o+=r}}return a>0&&s.push(l),s}function x1(n,e,t,i,r){let s=t,o=t,a=0,l=0,c=t,h,u,d,g,f,p,A,m,y,E;for(u=t;u<i;u+=r){const x=e[u],_=e[u+1];f!==void 0&&(y=x-f,E=_-p,g=Math.sqrt(y*y+E*E),A!==void 0&&(l+=d,h=Math.acos((A*y+m*E)/(d*g)),h>n&&(l>a&&(a=l,s=c,o=u),l=0,c=u-r)),d=g,A=y,m=E),f=x,p=_}return l+=g,l>a?[c,u]:[s,o]}const qa={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class E1 extends mo{constructor(e,t,i,r){super(e,t,i,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[xt]={fillStyle:xt},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,i){const r=this.textFillState_,s=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!r&&!s)return;const a=this.coordinates;let l=a.length;const c=e.getType();let h=null,u=e.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!Be(this.maxExtent,e.getExtent()))return;let d;if(h=e.getFlatCoordinates(),c=="LineString")d=[h.length];else if(c=="MultiLineString")d=e.getEnds();else if(c=="Polygon")d=e.getEnds().slice(0,1);else if(c=="MultiPolygon"){const A=e.getEndss();d=[];for(let m=0,y=A.length;m<y;++m)d.push(A[m][0])}this.beginGeometry(e,t,i);const g=o.repeat,f=g?void 0:o.textAlign;let p=0;for(let A=0,m=d.length;A<m;++A){let y;g?y=_1(g*this.resolution,h,p,d[A],u):y=[h.slice(p,d[A])];for(let E=0,x=y.length;E<x;++E){const _=y[E];let w=0,v=_.length;if(f==null){const b=x1(o.maxAngle,_,0,_.length,2);w=b[0],v=b[1]}for(let b=w;b<v;b+=u)a.push(_[b],_[b+1]);const C=a.length;p=d[A],this.drawChars_(l,C),l=C}}this.endGeometry(t)}else{let d=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":h=e.getFlatCoordinates();break;case"LineString":h=e.getFlatMidpoint();break;case"Circle":h=e.getCenter();break;case"MultiLineString":h=e.getFlatMidpoints(),u=2;break;case"Polygon":h=e.getFlatInteriorPoint(),o.overflow||d.push(h[2]/this.resolution),u=3;break;case"MultiPolygon":const x=e.getFlatInteriorPoints();h=[];for(let _=0,w=x.length;_<w;_+=3)o.overflow||d.push(x[_+2]/this.resolution),h.push(x[_],x[_+1]);if(h.length===0)return;u=2;break}const g=this.appendFlatPointCoordinates(h,u);if(g===l)return;if(d&&(g-l)/2!==h.length/u){let x=l/2;d=d.filter((_,w)=>{const v=a[(x+w)*2]===h[w*u]&&a[(x+w)*2+1]===h[w*u+1];return v||--x,v})}this.saveTextStates_();const f=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,p=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(e,t,i);let A=o.padding;if(A!=qn&&(o.scale[0]<0||o.scale[1]<0)){let x=o.padding[0],_=o.padding[1],w=o.padding[2],v=o.padding[3];o.scale[0]<0&&(_=-_,v=-v),o.scale[1]<0&&(x=-x,w=-w),A=[x,_,w,v]}const m=this.pixelRatio;this.instructions.push([K.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,A==qn?qn:A.map(function(x){return x*m}),f,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const y=1/m,E=f?f.slice(0):null;E&&(E[1]=xt),this.hitDetectionInstructions.push([K.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,A,E,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?xt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),this.endGeometry(t)}}saveTextStates_(){const e=this.textStrokeState_,t=this.textState_,i=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:t.font,textAlign:t.textAlign||to,justify:t.justify,textBaseline:t.textBaseline||ca,scale:t.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(e,t){const i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=qa[r.textBaseline],h=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([K.DRAW_CHARS,e,t,c,r.overflow,a,r.maxAngle,l,h,s,d*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([K.DRAW_CHARS,e,t,c,r.overflow,a&&xt,r.maxAngle,l,h,s,d*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,t){let i,r,s;if(!e)this.text_="";else{const o=e.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=_i(o.getColor()||xt)):(r=null,this.textFillState_=r);const a=e.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const p=a.getLineDash(),A=a.getLineDashOffset(),m=a.getWidth(),y=a.getMiterLimit();s.lineCap=a.getLineCap()||jr,s.lineDash=p?p.slice():ji,s.lineDashOffset=A===void 0?zi:A,s.lineJoin=a.getLineJoin()||zr,s.lineWidth=m===void 0?io:m,s.miterLimit=y===void 0?$s:y,s.strokeStyle=_i(a.getColor()||eo)}i=this.textState_;const l=e.getFont()||bf;K0(l);const c=e.getScaleArray();i.overflow=e.getOverflow(),i.font=l,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.repeat=e.getRepeat(),i.justify=e.getJustify(),i.textBaseline=e.getTextBaseline()||ca,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||qn,i.scale=c===void 0?[1,1]:c;const h=e.getOffsetX(),u=e.getOffsetY(),d=e.getRotateWithView(),g=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=h===void 0?0:h,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textKeepUpright_=g===void 0?!0:g,this.textRotation_=f===void 0?0:f,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:Y(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle=="string"?r.fillStyle:"|"+Y(r.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}const w1={Circle:Zg,Default:mo,Image:m1,LineString:y1,Polygon:Zg,Text:E1};class Qg{constructor(e,t,i,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const t in this.buildersByZIndex_){e[t]=e[t]||{};const i=this.buildersByZIndex_[t];for(const r in i){const s=i[r].finish();e[t][r]=s}}return e}getBuilder(e,t){const i=e!==void 0?e.toString():"0";let r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[t];if(s===void 0){const o=w1[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}function v1(n,e,t,i,r,s,o,a,l,c,h,u,d=!0){let g=n[e],f=n[e+1],p=0,A=0,m=0,y=0;function E(){p=g,A=f,e+=i,g=n[e],f=n[e+1],y+=m,m=Math.sqrt((g-p)*(g-p)+(f-A)*(f-A))}do E();while(e<t-i&&y+m<s);let x=m===0?0:(s-y)/m;const _=Rt(p,g,x),w=Rt(A,f,x),v=e-i,C=y,b=s+a*l(c,r,h);for(;e<t-i&&y+m<b;)E();x=m===0?0:(b-y)/m;const T=Rt(p,g,x),P=Rt(A,f,x);let M=!1;if(d)if(u){const D=[_,w,T,P];nc(D,0,4,2,u,D,D),M=D[0]>D[2]}else M=_>T;const k=Math.PI,I=[],R=v+i===e;e=v,m=0,y=C,g=n[e],f=n[e+1];let B;if(R){E(),B=Math.atan2(f-A,g-p),M&&(B+=B>0?-k:k);const D=(T+_)/2,z=(P+w)/2;return I[0]=[D,z,(b-s)/2,B,r],I}r=r.replace(/\n/g," ");for(let D=0,z=r.length;D<z;){E();let U=Math.atan2(f-A,g-p);if(M&&(U+=U>0?-k:k),B!==void 0){let J=U-B;if(J+=J>k?-2*k:J<-k?2*k:0,Math.abs(J)>o)return null}B=U;const S=D;let X=0;for(;D<z;++D){const J=M?z-D-1:D,he=a*l(c,r[J],h);if(e+i<t&&y+m<s+X+he/2)break;X+=he}if(D===S)continue;const O=M?r.substring(z-S,z-D):r.substring(S,D);x=m===0?0:(s+X/2-y)/m;const Z=Rt(p,g,x),ce=Rt(A,f,x);I.push([Z,ce,X/2,U,O]),s+=X}return I}class Qh{constructor(){Mi(this,"pushMethodArgs_",(...e)=>(this.push_(e),this));this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(ta(),{get:(e,t)=>{if(typeof ta()[t]=="function")return this.push_(t),this.pushMethodArgs_},set:(e,t,i)=>(this.push_(t,i),!0)})}push_(...e){const t=this.instructions_,i=this.zIndex+this.offset_;t[i]||(t[i]=[]),t[i].push(...e)}pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let i=0,r=t.length;i<r;++i){const s=t[i];if(typeof s=="function"){s(e);continue}const o=t[++i];if(typeof e[s]=="function")e[s](...o);else{if(typeof o=="function"){e[s]=o(e);continue}e[s]=o}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const es=St(),vn=[],Hi=[],Xi=[],Cn=[];function qg(n){return n[3].declutterBox}const Jg=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]");function qh(n,e){return e==="start"?e=Jg.test(n)?"right":"left":e==="end"&&(e=Jg.test(n)?"left":"right"),qa[e]}function C1(n,e,t){return t>0&&n.push(`
|
|
25
|
+
`,""),n.push(e,""),n}function b1(n,e,t){return t%2===0&&(n+=e),n}class T1{constructor(e,t,i,r,s){this.overlaps=i,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=mt(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new Qh:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,i,r){const s=e+t+i+r;if(this.labels_[s])return this.labels_[s];const o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,l=this.textStates[t],c=this.pixelRatio,h=[l.scale[0]*c,l.scale[1]*c],u=l.justify?qa[l.justify]:qh(Array.isArray(e)?e[0]:e,l.textAlign||to),d=r&&o.lineWidth?o.lineWidth:0,g=Array.isArray(e)?e:String(e).split(`
|
|
26
|
+
`).reduce(C1,[]),{width:f,height:p,widths:A,heights:m,lineWidths:y}=Q0(l,g),E=f+d,x=[],_=(E+2)*h[0],w=(p+d)*h[1],v={width:_<0?Math.floor(_):Math.ceil(_),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:x};(h[0]!=1||h[1]!=1)&&x.push("scale",h),r&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",d),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)),i&&x.push("fillStyle",a.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");const C=.5-u;let b=u*E+C*d;const T=[],P=[];let M=0,k=0,I=0,R=0,B;for(let D=0,z=g.length;D<z;D+=2){const U=g[D];if(U===`
|
|
27
|
+
`){k+=M,M=0,b=u*E+C*d,++R;continue}const S=g[D+1]||l.font;S!==B&&(r&&T.push("font",S),i&&P.push("font",S),B=S),M=Math.max(M,m[I]);const X=[U,b+C*A[I]+u*(A[I]-y[R]),.5*(d+M)+k];b+=A[I],r&&T.push("strokeText",X),i&&P.push("fillText",X),++I}return Array.prototype.push.apply(x,T),Array.prototype.push.apply(x,P),this.labels_[s]=v,v}replayTextBackground_(e,t,i,r,s,o,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,s),e.lineTo.apply(e,t),o&&(this.alignAndScaleFill_=o[2],e.fillStyle=o[1],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())}calculateImageOrLabelDimensions_(e,t,i,r,s,o,a,l,c,h,u,d,g,f,p,A){a*=d[0],l*=d[1];let m=i-a,y=r-l;const E=s+c>e?e-c:s,x=o+h>t?t-h:o,_=f[3]+E*d[0]+f[1],w=f[0]+x*d[1]+f[2],v=m-f[3],C=y-f[0];(p||u!==0)&&(vn[0]=v,Cn[0]=v,vn[1]=C,Hi[1]=C,Hi[0]=v+_,Xi[0]=Hi[0],Xi[1]=C+w,Cn[1]=Xi[1]);let b;return u!==0?(b=mi(mt(),i,r,1,1,u,-i,-r),Ye(b,vn),Ye(b,Hi),Ye(b,Xi),Ye(b,Cn),Ai(Math.min(vn[0],Hi[0],Xi[0],Cn[0]),Math.min(vn[1],Hi[1],Xi[1],Cn[1]),Math.max(vn[0],Hi[0],Xi[0],Cn[0]),Math.max(vn[1],Hi[1],Xi[1],Cn[1]),es)):Ai(Math.min(v,v+_),Math.min(C,C+w),Math.max(v,v+_),Math.max(C,C+w),es),g&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:E,drawImageH:x,originX:c,originY:h,declutterBox:{minX:es[0],minY:es[1],maxX:es[2],maxY:es[3],value:A},canvasTransform:b,scale:d}}replayImageOrLabel_(e,t,i,r,s,o,a){const l=!!(o||a),c=r.declutterBox,h=a?a[2]*r.scale[0]/2:0;return c.minX-h<=t[0]&&c.maxX+h>=0&&c.minY-h<=t[1]&&c.maxY+h>=0&&(l&&this.replayTextBackground_(e,vn,Hi,Xi,Cn,o,a),q0(e,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){const t=this.alignAndScaleFill_;if(t){const i=Ye(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(i[0]%r,i[1]%r),t!==1&&e.scale(t,t),e.rotate(this.viewRotation_)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6])}drawLabelWithPointPlacement_(e,t,i,r){const s=this.textStates[t],o=this.createLabel(e,t,r,i),a=this.strokeStates[i],l=this.pixelRatio,c=qh(Array.isArray(e)?e[0]:e,s.textAlign||to),h=qa[s.textBaseline||ca],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*s.scale[0],g=c*d+2*(.5-c)*u,f=h*o.height/l+2*(.5-h)*u;return{label:o,anchorX:g,anchorY:f}}execute_(e,t,i,r,s,o,a,l){const c=this.zIndexContext_;let h;this.pixelCoordinates_&&Fi(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=hn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),ry(this.renderedTransform_,i));let u=0;const d=r.length;let g=0,f,p,A,m,y,E,x,_,w,v,C,b,T,P=0,M=0;const k=this.coordinateCache_,I=this.viewRotation_,R=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,B={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},D=this.instructions!=r||this.overlaps?0:200;let z,U,S,X;for(;u<d;){const O=r[u];switch(O[0]){case K.BEGIN_GEOMETRY:z=O[1],X=O[3],z.getGeometry()?a!==void 0&&!Be(a,X.getExtent())?u=O[2]+1:++u:u=O[2],c&&(c.zIndex=O[4]);break;case K.BEGIN_PATH:P>D&&(this.fill_(e),P=0),M>D&&(e.stroke(),M=0),!P&&!M&&(e.beginPath(),y=NaN,E=NaN),++u;break;case K.CIRCLE:g=O[1];const ce=h[g],J=h[g+1],he=h[g+2],me=h[g+3],Ee=he-ce,Me=me-J,j=Math.sqrt(Ee*Ee+Me*Me);e.moveTo(ce+j,J),e.arc(ce,J,j,0,2*Math.PI,!0),++u;break;case K.CLOSE_PATH:e.closePath(),++u;break;case K.CUSTOM:g=O[1],f=O[2];const Dt=O[3],Si=O[4],re=O[5];B.geometry=Dt,B.feature=z,u in k||(k[u]=[]);const Kt=k[u];re?re(h,g,f,2,Kt):(Kt[0]=h[g],Kt[1]=h[g+1],Kt.length=2),c&&(c.zIndex=O[6]),Si(Kt,B),++u;break;case K.DRAW_IMAGE:g=O[1],f=O[2],w=O[3],p=O[4],A=O[5];let He=O[6];const Ce=O[7],Ii=O[8],Ge=O[9],di=O[10];let Ot=O[11];const gt=O[12];let Zt=O[13];m=O[14]||"declutter";const je=O[15];if(!w&&O.length>=20){v=O[19],C=O[20],b=O[21],T=O[22];const bt=this.drawLabelWithPointPlacement_(v,C,b,T);w=bt.label,O[3]=w;const qi=O[23];p=(bt.anchorX-qi)*this.pixelRatio,O[4]=p;const qt=O[24];A=(bt.anchorY-qt)*this.pixelRatio,O[5]=A,He=w.height,O[6]=He,Zt=w.width,O[13]=Zt}let Ie;O.length>25&&(Ie=O[25]);let be,ye,de;O.length>17?(be=O[16],ye=O[17],de=O[18]):(be=qn,ye=null,de=null),di&&R?Ot+=I:!di&&!R&&(Ot-=I);let Xe=0;for(;g<f;g+=2){if(Ie&&Ie[Xe++]<Zt/this.pixelRatio)continue;const bt=this.calculateImageOrLabelDimensions_(w.width,w.height,h[g],h[g+1],Zt,He,p,A,Ii,Ge,Ot,gt,s,be,!!ye||!!de,z),qi=[e,t,w,bt,Ce,ye,de];if(l){let qt,Pi,Jt;if(je){const Ue=f-g;if(!je[Ue]){je[Ue]={args:qi,declutterMode:m};continue}const pt=je[Ue];qt=pt.args,Pi=pt.declutterMode,delete je[Ue],Jt=qg(qt)}let Ji,$i;if(qt&&(Pi!=="declutter"||!l.collides(Jt))&&(Ji=!0),(m!=="declutter"||!l.collides(bt.declutterBox))&&($i=!0),Pi==="declutter"&&m==="declutter"){const Ue=Ji&&$i;Ji=Ue,$i=Ue}Ji&&(Pi!=="none"&&l.insert(Jt),this.replayImageOrLabel_.apply(this,qt)),$i&&(m!=="none"&&l.insert(bt.declutterBox),this.replayImageOrLabel_.apply(this,qi))}else this.replayImageOrLabel_.apply(this,qi)}++u;break;case K.DRAW_CHARS:const se=O[1],ue=O[2],ze=O[3],Je=O[4];T=O[5];const Qt=O[6],vt=O[7],it=O[8];b=O[9];const st=O[10];v=O[11],Array.isArray(v)&&(v=v.reduce(b1,"")),C=O[12];const Le=[O[13],O[13]];m=O[14]||"declutter";const nt=O[15],ct=this.textStates[C],Te=ct.font,Ct=[ct.scale[0]*vt,ct.scale[1]*vt];let _r;Te in this.widths_?_r=this.widths_[Te]:(_r={},this.widths_[Te]=_r);const Cl=nh(h,se,ue,2),ps=Math.abs(Ct[0])*Rf(Te,v,_r);if(Je||ps<=Cl){const bt=this.textStates[C].textAlign,qi=(Cl-ps)*qh(v,bt),qt=v1(h,se,ue,2,v,qi,Qt,Math.abs(Ct[0]),Rf,Te,_r,R?0:this.viewRotation_,nt);e:if(qt){const Pi=[];let Jt,Ji,$i,Ue,pt;if(b)for(Jt=0,Ji=qt.length;Jt<Ji;++Jt){pt=qt[Jt],$i=pt[4],Ue=this.createLabel($i,C,"",b),p=pt[2]+(Ct[0]<0?-st:st),A=ze*Ue.height+(.5-ze)*2*st*Ct[1]/Ct[0]-it;const en=this.calculateImageOrLabelDimensions_(Ue.width,Ue.height,pt[0],pt[1],Ue.width,Ue.height,p,A,0,0,pt[3],Le,!1,qn,!1,z);if(l&&m==="declutter"&&l.collides(en.declutterBox))break e;Pi.push([e,t,Ue,en,1,null,null])}if(T)for(Jt=0,Ji=qt.length;Jt<Ji;++Jt){pt=qt[Jt],$i=pt[4],Ue=this.createLabel($i,C,T,""),p=pt[2],A=ze*Ue.height-it;const en=this.calculateImageOrLabelDimensions_(Ue.width,Ue.height,pt[0],pt[1],Ue.width,Ue.height,p,A,0,0,pt[3],Le,!1,qn,!1,z);if(l&&m==="declutter"&&l.collides(en.declutterBox))break e;Pi.push([e,t,Ue,en,1,null,null])}l&&m!=="none"&&l.load(Pi.map(qg));for(let en=0,$v=Pi.length;en<$v;++en)this.replayImageOrLabel_.apply(this,Pi[en])}}++u;break;case K.END_GEOMETRY:if(o!==void 0){z=O[1];const bt=o(z,X,m);if(bt)return bt}++u;break;case K.FILL:D?P++:this.fill_(e),++u;break;case K.MOVE_TO_LINE_TO:for(g=O[1],f=O[2],U=h[g],S=h[g+1],e.moveTo(U,S),y=U+.5|0,E=S+.5|0,g+=2;g<f;g+=2)U=h[g],S=h[g+1],x=U+.5|0,_=S+.5|0,(g==f-2||x!==y||_!==E)&&(e.lineTo(U,S),y=x,E=_);++u;break;case K.SET_FILL_STYLE:this.alignAndScaleFill_=O[2],P&&(this.fill_(e),P=0,M&&(e.stroke(),M=0)),e.fillStyle=O[1],++u;break;case K.SET_STROKE_STYLE:M&&(e.stroke(),M=0),this.setStrokeStyle_(e,O),++u;break;case K.STROKE:D?M++:e.stroke(),++u;break;default:++u;break}}P&&this.fill_(e),M&&e.stroke()}execute(e,t,i,r,s,o){this.viewRotation_=r,this.execute_(e,t,i,this.instructions,s,void 0,void 0,o)}executeHitDetection(e,t,i,r,s){return this.viewRotation_=i,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,r,s)}}const ts=["Polygon","Circle","LineString","Image","Text","Default"],Ja=["Image","Text"],R1=ts.filter(n=>!Ja.includes(n));class $g{constructor(e,t,i,r,s,o,a){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=t,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=mt(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(e,t){const i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e,t){for(const i in e){let r=this.executorsByZIndex_[i];r===void 0&&(r={},this.executorsByZIndex_[i]=r);const s=e[i];for(const o in s){const a=s[o];r[o]=new T1(this.resolution_,this.pixelRatio_,this.overlaps_,a,t)}}}hasExecutors(e){for(const t in this.executorsByZIndex_){const i=this.executorsByZIndex_[t];for(let r=0,s=e.length;r<s;++r)if(e[r]in i)return!0}return!1}forEachFeatureAtCoordinate(e,t,i,r,s,o){r=Math.round(r);const a=r*2+1,l=mi(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=Fe(a,a));const h=this.hitDetectionContext_;h.canvas.width!==a||h.canvas.height!==a?(h.canvas.width=a,h.canvas.height=a):c||h.clearRect(0,0,a,a);let u;this.renderBuffer_!==void 0&&(u=St(),Ms(u,e),Di(u,t*(this.renderBuffer_+r),u));const d=S1(r);let g;function f(_,w,v){const C=h.getImageData(0,0,a,a).data;for(let b=0,T=d.length;b<T;b++)if(C[d[b]]>0){if(!o||v==="none"||g!=="Image"&&g!=="Text"||o.includes(_)){const P=(d[b]-3)/4,M=r-P%a,k=r-(P/a|0),I=s(_,w,M*M+k*k);if(I)return I}h.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(fi);let A,m,y,E,x;for(A=p.length-1;A>=0;--A){const _=p[A].toString();for(y=this.executorsByZIndex_[_],m=ts.length-1;m>=0;--m)if(g=ts[m],E=y[g],E!==void 0&&(x=E.executeHitDetection(h,l,i,f,u),x))return x}}getClipCoords(e){const t=this.maxExtent_;if(!t)return null;const i=t[0],r=t[1],s=t[2],o=t[3],a=[i,r,i,o,s,o,s,r];return hn(a,0,8,2,e,a),a}isEmpty(){return rn(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?tm:fi),o=o||ts;const c=ts.length;for(let h=0,u=l.length;h<u;++h){const d=l[h].toString(),g=this.executorsByZIndex_[d];for(let f=0,p=o.length;f<p;++f){const A=o[f],m=g[A];if(m!==void 0){const y=a===null?void 0:m.getZIndexContext(),E=y?y.getContext():e,x=this.maxExtent_&&A!=="Image"&&A!=="Text";if(x&&(E.save(),this.clip(E,i)),!y||A==="Text"||A==="Image"?m.execute(E,t,i,r,s,a):y.pushFunction(_=>m.execute(_,t,i,r,s,a)),x&&E.restore(),y){y.offset();const _=l[h]*c+f;this.deferredZIndexContexts_[_]||(this.deferredZIndexContexts_[_]=[]),this.deferredZIndexContexts_[_].push(y)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(fi);for(let i=0,r=t.length;i<r;++i)e[t[i]].forEach(s=>{s.draw(this.renderedContext_),s.clear()}),e[t[i]].length=0}}const Jh={};function S1(n){if(Jh[n]!==void 0)return Jh[n];const e=n*2+1,t=n*n,i=new Array(t+1);for(let s=0;s<=n;++s)for(let o=0;o<=n;++o){const a=s*s+o*o;if(a>t)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+s)*e+(n+o))*4+3),s>0&&l.push(((n-s)*e+(n+o))*4+3),o>0&&(l.push(((n+s)*e+(n-o))*4+3),s>0&&l.push(((n-s)*e+(n-o))*4+3))}const r=[];for(let s=0,o=i.length;s<o;++s)i[s]&&r.push(...i[s]);return Jh[n]=r,r}const Lt=.5;function ep(n,e,t,i,r,s,o,a,l){const c=l?Xo(r):r,h=n[0]*Lt,u=n[1]*Lt,d=Fe(h,u);d.imageSmoothingEnabled=!1;const g=d.canvas,f=new i1(d,Lt,r,null,o,a,l?Os(iy(),l):null),p=t.length,A=Math.floor((256*256*256-1)/p),m={};for(let E=1;E<=p;++E){const x=t[E-1],_=x.getStyleFunction()||i;if(!_)continue;let w=_(x,s);if(!w)continue;Array.isArray(w)||(w=[w]);const C=(E*A).toString(16).padStart(7,"#00000");for(let b=0,T=w.length;b<T;++b){const P=w[b],M=P.getGeometryFunction()(x);if(!M||!Be(c,M.getExtent()))continue;const k=P.clone(),I=k.getFill();I&&I.setColor(C);const R=k.getStroke();R&&(R.setColor(C),R.setLineDash(null)),k.setText(void 0);const B=P.getImage();if(B){const S=B.getImageSize();if(!S)continue;const X=Fe(S[0],S[1],void 0,{alpha:!1}),O=X.canvas;X.fillStyle=C,X.fillRect(0,0,O.width,O.height),k.setImage(new $n({img:O,anchor:B.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:B.getOrigin(),opacity:1,size:B.getSize(),scale:B.getScale(),rotation:B.getRotation(),rotateWithView:B.getRotateWithView()}))}const D=k.getZIndex()||0;let z=m[D];z||(z={},m[D]=z,z.Polygon=[],z.Circle=[],z.LineString=[],z.Point=[]);const U=M.getType();if(U==="GeometryCollection"){const S=M.getGeometriesArrayRecursive();for(let X=0,O=S.length;X<O;++X){const Z=S[X];z[Z.getType().replace("Multi","")].push(Z,k)}}else z[U.replace("Multi","")].push(M,k)}}const y=Object.keys(m).map(Number).sort(fi);for(let E=0,x=y.length;E<x;++E){const _=m[y[E]];for(const w in _){const v=_[w];for(let C=0,b=v.length;C<b;C+=2){f.setStyle(v[C+1]);for(let T=0,P=e.length;T<P;++T)f.setTransform(e[T]),f.drawGeometry(v[C])}}}return d.getImageData(0,0,g.width,g.height)}function tp(n,e,t){const i=[];if(t){const r=Math.floor(Math.round(n[0])*Lt),s=Math.floor(Math.round(n[1])*Lt),o=(Pe(r,0,t.width-1)+Pe(s,0,t.height-1)*t.width)*4,a=t.data[o],l=t.data[o+1],h=t.data[o+2]+256*(l+256*a),u=Math.floor((256*256*256-1)/e.length);h&&h%u===0&&i.push(e[h/u-1])}return i}const I1=5;class P1 extends Ss{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=I1}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return Q()}getData(e){return null}prepareFrame(e){return Q()}renderFrame(e,t){return Q()}forEachFeatureAtCoordinate(e,t,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const t=e.target;(t.getState()===V.LOADED||t.getState()===V.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=V.LOADED&&t!=V.ERROR&&e.addEventListener(H.CHANGE,this.boundHandleImageChange_),t==V.IDLE&&(e.load(),t=e.getState()),t==V.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const ip=[];let is=null;function M1(){is=Fe(1,1,void 0,{willReadFrequently:!0})}class $h extends P1{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=mt(),this.pixelTransform=mt(),this.inversePixelTransform=mt(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,i){is||M1(),is.clearRect(0,0,1,1);let r;try{is.drawImage(e,t,i,1,1,0,0,1,1),r=is.getImageData(0,0,1,1).data}catch{return is=null,null}return r}getBackground(e){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(e.viewState.resolution)),i||void 0}useContainer(e,t,i){const r=this.getLayer().getClassName();let s,o;if(e&&e.className===r&&(!i||e&&e.style.backgroundColor&&Fi(Br(e.style.backgroundColor),Br(i)))){const a=e.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&cy(o.canvas.style.transform,t)?(this.container=e,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=Fe();const l=o.canvas;s.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(e,t,i){const r=ei(i),s=Go(i),o=Do(i),a=ko(i);Ye(t.coordinateToPixelTransform,r),Ye(t.coordinateToPixelTransform,s),Ye(t.coordinateToPixelTransform,o),Ye(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;Ye(l,r),Ye(l,s),Ye(l,o),Ye(l,a),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(s[0]),Math.round(s[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.clip()}prepareContainer(e,t){const i=e.extent,r=e.viewState.resolution,s=e.viewState.rotation,o=e.pixelRatio,a=Math.round(ne(i)/r*o),l=Math.round(De(i)/r*o);mi(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/o,1/o,s,-a/2,-l/2),Dd(this.inversePixelTransform,this.pixelTransform);const c=ly(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){const h=this.context.canvas;h.width!=a||h.height!=l?(h.width=a,h.height=l):this.context.clearRect(0,0,a,l),c!==h.style.transform&&(h.style.transform=c)}}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){const s=new zf(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(jt.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(jt.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Qh),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(jt.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(jt.POSTRENDER,this.context,e))}getRenderTransform(e,t,i,r,s,o,a){const l=s/2,c=o/2,h=r/t,u=-h,d=-e[0]+a,g=-e[1];return mi(this.tempTransform,l,c,h,u,-i,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class F1 extends $h{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=St(),this.wrappedRenderedExtent_=St(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(e,t,i){const r=t.extent,s=t.viewState,o=s.center,a=s.resolution,l=s.projection,c=s.rotation,h=l.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),g=t.pixelRatio,f=t.viewHints,p=!(f[ke.ANIMATING]||f[ke.INTERACTING]),A=this.context,m=Math.round(ne(r)/a*g),y=Math.round(De(r)/a*g),E=u.getWrapX()&&l.canWrapX(),x=E?ne(h):null,_=E?Math.ceil((r[2]-h[2])/x)+1:1;let w=E?Math.floor((r[0]-h[0])/x):0;do{let v=this.getRenderTransform(o,a,0,g,m,y,w*x);t.declutter&&(v=v.slice(0)),e.execute(A,[A.canvas.width,A.canvas.height],v,c,p,i===void 0?ts:i?Ja:R1,i?d&&t.declutter[d]:void 0)}while(++w<_)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=Fe(this.context.canvas.width,this.context.canvas.height,ip))}resetDrawContext_(){if(this.opacity_!==1){const e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,zs(this.context),ip.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(e){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,e,!0)}renderDeferredInternal(e){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(e,t){const i=e.layerStatesArray[e.layerIndex];this.opacity_=i.opacity;const r=e.viewState;this.prepareContainer(e,t);const s=this.context,o=this.replayGroup_;let a=o&&!o.isEmpty();if(!a&&!(this.getLayer().hasListener(jt.PRERENDER)||this.getLayer().hasListener(jt.POSTRENDER)))return this.container;if(this.setDrawContext_(),this.preRender(s,e),r.projection,this.clipped_=!1,a&&i.extent&&this.clipping){const l=ii(i.extent);a=Be(l,e.extent),this.clipped_=a&&!Oi(l,e.extent),this.clipped_&&this.clipUnrotated(s,e,l)}return a&&this.renderWorlds(o,e,this.getLayer().getDeclutter()?!1:void 0),!e.declutter&&this.clipped_&&s.restore(),this.postRender(s,e),this.renderedRotation_!==r.rotation&&(this.renderedRotation_=r.rotation,this.hitDetectionImageData_=null),e.declutter||this.resetDrawContext_(),this.container}getFeatures(e){return new Promise(t=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],u=i[0]*Lt,d=i[1]*Lt;h.push(this.getRenderTransform(r,s,o,Lt,u,d,0).slice());const g=c.getSource(),f=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Oi(f,l)){let p=l[0];const A=ne(f);let m=0,y;for(;p<f[0];)--m,y=A*m,h.push(this.getRenderTransform(r,s,o,Lt,u,d,y).slice()),p+=A;for(m=0,p=l[2];p>f[2];)++m,y=A*m,h.push(this.getRenderTransform(r,s,o,Lt,u,d,y).slice()),p-=A}this.hitDetectionImageData_=ep(i,h,this.renderedFeatures_,c.getStyleFunction(),l,s,o,Kh(s,this.renderedPixelRatio_),null)}t(tp(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,i,r,s){var d,g;if(!this.replayGroup_)return;const o=t.viewState.resolution,a=t.viewState.rotation,l=this.getLayer(),c={},h=function(f,p,A){const m=Y(f),y=c[m];if(y){if(y!==!0&&A<y.distanceSq){if(A===0)return c[m]=!0,s.splice(s.lastIndexOf(y),1),r(f,l,p);y.geometry=p,y.distanceSq=A}}else{if(A===0)return c[m]=!0,r(f,l,p);s.push(c[m]={feature:f,layer:l,geometry:p,distanceSq:A,callback:r})}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,o,a,i,h,u?(g=(d=t.declutter)==null?void 0:d[u])==null?void 0:g.all().map(f=>f.value):null)}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const t=this.getLayer(),i=t.getSource();if(!i)return!1;const r=e.viewHints[ke.ANIMATING],s=e.viewHints[ke.INTERACTING],o=t.getUpdateWhileAnimating(),a=t.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,c=e.viewState,h=c.projection,u=c.resolution,d=e.pixelRatio,g=t.getRevision(),f=t.getRenderBuffer();let p=t.getRenderOrder();p===void 0&&(p=r1);const A=c.center.slice(),m=Di(l,f*u),y=m.slice(),E=[m.slice()],x=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!Oi(x,e.extent)){const I=ne(x),R=Math.max(ne(m)/2,I);m[0]=x[0]-R,m[2]=x[2]+R,Vl(A,h);const B=fd(E[0],h);B[0]<x[0]&&B[2]<x[2]?E.push([B[0]+I,B[1],B[2]+I,B[3]]):B[0]>x[0]&&B[2]>x[2]&&E.push([B[0]-I,B[1],B[2]-I,B[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&Oi(this.wrappedRenderedExtent_,m))return Fi(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=A,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const _=new Qg(Vg(u,d),m,u,d);let w;for(let I=0,R=E.length;I<R;++I)i.loadFeatures(E[I],u,h);const v=Kh(u,d);let C=!0;const b=(I,R)=>{let B;const D=I.getStyleFunction()||t.getStyleFunction();if(D&&(B=D(I,u)),B){const z=this.renderFeature(I,v,B,_,w,this.getLayer().getDeclutter(),R);C=C&&!z}},T=Xo(m),P=i.getFeaturesInExtent(T);p&&P.sort(p);for(let I=0,R=P.length;I<R;++I)b(P[I],I);this.renderedFeatures_=P,this.ready=C;const M=_.finish(),k=new $g(m,u,d,i.getOverlaps(),M,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=u,this.renderedRevision_=g,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=y,this.wrappedRenderedExtent_=m,this.renderedCenter_=A,this.renderedProjection_=h,this.renderedPixelRatio_=d,this.replayGroup_=k,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,i,r,s,o,a){if(!i)return!1;let l=!1;if(Array.isArray(i))for(let c=0,h=i.length;c<h;++c)l=Za(r,e,i[c],t,this.boundHandleStyleImageChange_,s,o,a)||l;else l=Za(r,e,i,t,this.boundHandleStyleImageChange_,s,o,a);return l}}class bn extends eh{constructor(e){super(e)}createRenderer(){return new F1(this)}}class L1 extends Hc{constructor(e,t,i,r,s){const o=s!==void 0?V.IDLE:V.LOADED;super(e,t,i,o),this.loader_=s!==void 0?s:null,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=V.ERROR):this.state=V.LOADED,this.changed()}load(){this.state==V.IDLE&&(this.state=V.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}class yo extends Rs{constructor(e,t,i){super(),i=i||{},this.tileCoord=e,this.state=t,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(H.CHANGE)}release(){this.setState(G.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==G.EMPTY){if(this.state!==G.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}}load(){Q()}getAlpha(e,t){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=t,this.transitionStarts_[e]=i;else if(i===-1)return 1;const r=t-i+1e3/60;return r>=this.transition_?1:pd(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class np extends yo{constructor(e,t,i,r,s,o){super(e,t,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=G.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=G.ERROR,this.unlistenImage_(),this.image_=k1(),this.changed()}handleImageLoad_(){const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=G.LOADED:this.state=G.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==G.ERROR&&(this.state=G.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=V0(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function k1(){const n=Fe(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}class eu{constructor(e,t,i,r){this.minX=e,this.maxX=t,this.minY=i,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function ns(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new eu(n,e,t,i)}const rp=[];class D1 extends yo{constructor(e,t,i,r,s){super(e,t,{transition:0}),this.context_=null,this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=r.bind(void 0,this),this.removeSourceTiles_=s,this.wrappedTileCoord=i}getContext(){return this.context_||(this.context_=Fe(1,1,rp)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=Y(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&(zs(this.context_),rp.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let sp=class extends yo{constructor(e,t,i,r,s,o){super(e,t,o),this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=i,this.key=i}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==G.IDLE&&(this.setState(G.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(G.ERROR)}setFeatures(e){this.features_=e,this.setState(G.LOADED)}setLoader(e){this.loader_=e}};const op="https://api.mapbox.com";function tu(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function O1(n,e,t){if(typeof n=="string")return[{id:"default",url:ap(n,e,t)}];for(const i of n)i.url=ap(i.url,e,t);return n}function ap(n,e,t){const i=tu(n);if(!i)return decodeURI(new URL(n,t).href);const r="sprites/";if(i.indexOf(r)!==0)throw new Error(`unexpected sprites url: ${n}`);const s=i.slice(r.length);return`${op}/styles/v1/${s}/sprite?access_token=${e}`}function $a(n,e){const t=tu(n);if(!t)return decodeURI(new URL(n,location.href).href);const i="styles/";if(t.indexOf(i)!==0)throw new Error(`unexpected style url: ${n}`);const r=t.slice(i.length);return`${op}/styles/v1/${r}?&access_token=${e}`}const G1=["a","b","c","d"];function el(n,e,t,i){const r=new URL(n,i||location.href),s=tu(n);if(!s)return e?(r.searchParams.has(t)||r.searchParams.set(t,e),[decodeURI(r.href)]):[decodeURI(r.href)];if(s==="mapbox.satellite"){const o=window.devicePixelRatio>=1.5?"@2x":"";return[`https://api.mapbox.com/v4/${s}/{z}/{x}/{y}${o}.webp?access_token=${e}`]}return G1.map(o=>`https://${o}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}const li=Object.freeze({}),lp={},cp={};let B1=0;function iu(n){return n.id||(n.id=B1++),n.id}function nu(n,e){return iu(n)+"."+Y(e)}function ru(n){let e=lp[n.id];return e||(e={},lp[iu(n)]=e),e}function hp(n){let e=cp[n.id];return e||(e={},cp[iu(n)]=e),e}function su(n){return n*Math.PI/180}const Ti=function(){const n=[];for(let e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n}();function tl(n,e){if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(n,e);const t=document.createElement("canvas");return t.width=n,t.height=e,t}function ou(n,e){let t=0;const i=e.length;for(;t<i;++t)if(e[t]<n&&t+1<i){const s=e[t]/e[t+1];return t+Math.log(e[t]/n)/Math.log(s)}return i-1}function _o(n,e){const t=Math.floor(n),i=Math.pow(2,n-t);return e[t]/i}const rs={};function ss(n,e,t={},i){if(e in rs)return i&&(i.url=rs[e][0].url),rs[e][1];const r=t.transformRequest&&t.transformRequest(e,n)||e,s=function(l){return delete rs[e],Promise.reject(new Error("Error fetching source "+e))},o=function(l){return delete rs[e],l.ok?l.json():Promise.reject(new Error("Error fetching source "+e))},a=On(()=>r).then(l=>l instanceof Response?(i&&(i.url=l.url),o(l)):(l instanceof Request||(l=new Request(l)),l.headers.get("Accept")||l.headers.set("Accept","application/json"),i&&(i.url=l.url),fetch(l).then(o).catch(s))).catch(s);return rs[e]=[r,a],a}function up(n,e){if(typeof n=="string")if(n.trim().startsWith("{"))try{const t=JSON.parse(n);return Promise.resolve(t)}catch(t){return Promise.reject(t)}else return n=$a(n,e.accessToken),ss("Style",n,e);else return Promise.resolve(n)}const dp={};function fp(n,e,t={}){const i=[e,JSON.stringify(n)].toString();let r=dp[i];if(!r||t.transformRequest){let s;t.transformRequest&&(s=(a,l)=>{const c=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(a instanceof sp)a.setLoader((h,u,d)=>{const g=function(f){f.arrayBuffer().then(p=>{const m=a.getFormat().readFeatures(p,{extent:h,featureProjection:d});a.setFeatures(m)})};On(()=>c).then(f=>{if(f instanceof Response)return g(f);fetch(f).then(g).catch(p=>a.setState(G.ERROR))}).catch(f=>a.setState(G.ERROR))});else{const h=a.getImage();On(()=>c).then(u=>{if(typeof u=="string"){h.src=u;return}const d=g=>g.blob().then(f=>{const p=URL.createObjectURL(f);h.addEventListener("load",()=>URL.revokeObjectURL(p)),h.addEventListener("error",()=>URL.revokeObjectURL(p)),h.src=p});if(u instanceof Response)return d(u);fetch(u).then(d).catch(g=>a.setState(G.ERROR))}).catch(u=>a.setState(G.ERROR))}});const o=n.url;if(o&&!n.tiles){const a=el(o,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(o.startsWith("mapbox://"))r=Promise.resolve({tileJson:Object.assign({},n,{url:void 0,tiles:a}),tileLoadFunction:s});else{const l={};r=ss("Source",a[0],t,l).then(function(c){return c.tiles=c.tiles.map(function(h){return c.scheme==="tms"&&(h=h.replace("{y}","{-y}")),el(h,t.accessToken,t.accessTokenParam||"access_token",l.url)[0]}),Promise.resolve({tileJson:c,tileLoadFunction:s})})}}else n.tiles?(n=Object.assign({},n,{tiles:n.tiles.map(function(a){return n.scheme==="tms"&&(a=a.replace("{y}","{-y}")),el(a,t.accessToken,t.accessTokenParam||"access_token",e||location.href)[0]})}),r=Promise.resolve({tileJson:Object.assign({},n),tileLoadFunction:s})):r=Promise.reject(new Error("source has no `tiles` nor `url`"));dp[i]=r}return r}function gp(n,e,t,i){const r=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],s=tl(r[0],r[1]),o=s.getContext("2d");o.drawImage(n,e.x,e.y,e.width,e.height,t*e.pixelRatio,t*e.pixelRatio,e.width,e.height);const a=o.getImageData(0,0,r[0],r[1]);o.globalCompositeOperation="destination-over",o.fillStyle=`rgba(${i.r*255},${i.g*255},${i.b*255},${i.a})`;const l=a.data;for(let c=0,h=a.width;c<h;++c)for(let u=0,d=a.height;u<d;++u){const g=(u*h+c)*4;l[g+3]>0&&o.arc(c,u,t*e.pixelRatio,0,2*Math.PI)}return o.fill(),s}function N1(n,e,t){const i=Math.max(0,Math.min(1,(t-n)/(e-n)));return i*i*(3-2*i)}function pp(n,e,t){const i=tl(e.width,e.height),r=i.getContext("2d");r.drawImage(n,e.x,e.y,e.width,e.height,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let a=0,l=s.width;a<l;++a)for(let c=0,h=s.height;c<h;++c){const u=(c*l+a)*4,d=o[u+3]/255,g=.75,f=.1,p=N1(g-f,g+f,d);p>0?(o[u+0]=Math.round(255*t.r*p),o[u+1]=Math.round(255*t.g*p),o[u+2]=Math.round(255*t.b*p),o[u+3]=Math.round(255*p)):o[u+3]=0}return r.putImageData(s,0,0),i}const j1=Array(256).join(" ");function au(n,e){if(e>=.05){let t="";const i=n.split(`
|
|
28
|
+
`),r=j1.slice(0,Math.round(e/.1));for(let s=0,o=i.length;s<o;++s)s>0&&(t+=`
|
|
29
|
+
`),t+=i[s].split("").join(r);return t}return n}let lu;function Ap(){return lu||(lu=tl(1,1).getContext("2d")),lu}function lr(n,e){return Ap().measureText(n).width+(n.length-1)*e}const il={};xi.on("propertychange",()=>{for(const n in il)delete il[n]});function cu(n,e,t,i){if(n.indexOf(`
|
|
30
|
+
`)!==-1){const o=n.split(`
|
|
31
|
+
`),a=[];for(let l=0,c=o.length;l<c;++l)a.push(cu(o[l],e,t,i));return a.join(`
|
|
32
|
+
`)}const r=t+","+e+","+n+","+i;let s=il[r];if(!s){const o=n.split(" ");if(o.length>1){const a=Ap();a.font=e;const c=a.measureText("M").width*t;let h="";const u=[];for(let d=0,g=o.length;d<g;++d){const f=o[d],p=h+(h?" ":"")+f;lr(p,i)<=c?h=p:(h&&u.push(h),h=f)}h&&u.push(h);for(let d=0,g=u.length;d<g&&g>1;++d){const f=u[d];if(lr(f,i)<c*.35){const p=d>0?lr(u[d-1],i):1/0,A=d<g-1?lr(u[d+1],i):1/0;u.splice(d,1),g-=1,p<A?(u[d-1]+=" "+f,d-=1):u[d]=f+" "+u[d]}}for(let d=0,g=u.length-1;d<g;++d){const f=u[d],p=u[d+1];if(lr(f,i)>c*.7&&lr(p,i)<c*.6){const A=f.split(" "),m=A.pop();lr(m,i)<c*.2&&(u[d]=A.join(" "),u[d+1]=m+" "+p),g-=1}}s=u.join(`
|
|
33
|
+
`)}else s=n;s=au(s,i),il[r]=s}return s}const z1=["Arial","Courier New","Times New Roman","Verdana","sans-serif","serif","monospace","cursive","fantasy"],mp={};function U1(n,e="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){let t;for(let i=0,r=n.length;i<r;++i){const s=n[i];if(s in mp)continue;mp[s]=!0;const a=Yh(s,16).split(" ");t||(t=[]),t.push([a.slice(3).join(" ").replace(/"/g,""),a[1],a[0]])}return t&&(async()=>{await document.fonts.ready;for(let i=0,r=t.length;i<r;++i){const s=t[i],o=s[0];if(z1.includes(o))continue;const a=s[1],l=s[2];if(!(await document.fonts.load(`${l} ${a} 16px "${o}"`)).some(h=>h.family.replace(/^['"]|['"]$/g,"").toLowerCase()===o.toLowerCase()&&h.weight==a&&h.style===l)){const h=e.replace("{font-family}",o.replace(/ /g,"-").toLowerCase()).replace("{Font+Family}",o.replace(/ /g,"+")).replace("{fontweight}",a).replace("{-fontstyle}",l.replace("normal","").replace(/(.+)/,"-$1")).replace("{fontstyle}",l);if(!document.querySelector('link[href="'+h+'"]')){const u=document.createElement("link");u.href=h,u.rel="stylesheet",document.head.appendChild(u)}}}})(),n}const V1={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},W1={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},H1=function(n,e){const t=UE(n,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return t.value},kt={zoom:0,distanceFromCenter:0};Ft.register(Wa,{...Ft.definitions,pitch:[{kind:"number"},[],n=>kt.pitch||90],"distance-from-center":[{kind:"number"},[],n=>kt.distanceFromCenter||0]});let nl,hu;function W(n,e,t,i,r,s){const o=n.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[o]||(r[o]={});const a=r[o];if(!a[t]){let l=(n[e]||li)[t];const c=t1[`${e}_${n.type}`][t];l===void 0&&(l=c.default);let h=zE(l);if(!h&&Ig(l)&&(l=ZE(l,c),h=!0),h){const u=H1(l,c);a[t]=u.evaluate.bind(u)}else c.type=="color"&&(l=Se.parse(l)),a[t]=function(){return l}}return a[t](kt,i,s)}function yp(n,e,t,i){return W(n,"layout",`${t}-allow-overlap`,e,i)?W(n,"layout",`${t}-ignore-placement`,e,i)?"none":"obstacle":"declutter"}function X1(n,e,t,i){if(i||console.warn("No filterCache provided to evaluateFilter()"),!(n in i))try{i[n]=XE(e).filter}catch(r){console.warn("Filter will evaluate to false: "+r.message),i[n]=function(){return!1}}return i[n](kt,t)}function Tn(n,e){if(n){if(n.a===0||e===0)return;const t=n.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(n.r*255/t)+","+Math.round(n.g*255/t)+","+Math.round(n.b*255/t)+","+t*e+")"}return n}const Y1=/\{[^{}}]*\}/g;function uu(n,e){return n.replace(Y1,function(t){return e[t.slice(1,-1)]||""})}function _p(n,e){let t=n.split(":")[0];return t===n&&(t="default"),e[t]}const du={};function fu(n,e,t,i=Ti,r=void 0,s=void 0,o=void 0,a=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");du[nu(e,n)]=Array.from(arguments);const l={};(typeof s=="string"||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const _ in s){const w=s[_];On(()=>w).then(async v=>{let C;if(typeof Image<"u"){const b=new Image;if(typeof v=="string")b.crossOrigin="anonymous",b.src=v;else{let T;v instanceof Request?T=await fetch(v):v instanceof Response&&(T=v);const P=await T.blob();C=URL.createObjectURL(P),b.src=C}b.addEventListener("load",function T(){b.removeEventListener("load",T),l[_]={image:b,size:[b.width,b.height]},n.changed(),C&&URL.revokeObjectURL(C)}),b.addEventListener("error",function T(){URL.revokeObjectURL(C),b.removeEventListener("error",T)})}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const b=self;b.postMessage({action:"loadImage",src:v}),b.addEventListener("message",function(P){P.data.action==="imageLoaded"&&P.data.src===v&&(l[_]={image:P.data.image,size:[P.data.image.width,P.data.image.height]})})}})}const c=Zf(e.layers),h={},u=[],d={},g={},f=ru(e),p=hp(e);let A;for(let _=0,w=c.length;_<w;++_){const v=c[_],C=v.id;if(typeof t=="string"&&v.source==t||Array.isArray(t)&&t.indexOf(C)!==-1){const b=v["source-layer"];if(A){if(v.source!==A)throw new Error(`Layer "${C}" does not use source "${A}`)}else{A=v.source;const P=e.sources[A];if(!P)throw new Error(`Source "${A}" is not defined`);const M=P.type;if(M!=="vector"&&M!=="geojson")throw new Error(`Source "${A}" is not of type "vector" or "geojson", but "${M}"`)}let T=h[b];T||(T=[],h[b]=T),T.push({layer:v,index:_}),u.push(C)}}const m=new Vt,y=new Ut,E=[],x=function(_,w,v){const C=_.getProperties(),b=h[C["mvt:layer"]];if(!b)return;let T=i.indexOf(w);T==-1&&(T=ou(w,i)),kt.zoom=T,kt.distanceFromCenter=0;const P=_.getGeometry(),M=V1[P.getType()],k=n.get("map");if(k&&k instanceof ya&&M===1){const D=k.getSize();if(D){const z=k.getView().getCenter(),U=It(P.getExtent());kt.distanceFromCenter=Ls(z,U)/w/D[1]}}const I={id:_.getId(),properties:C,type:M},R=n.get("mapbox-featurestate")[_.getId()];let B=-1;for(let D=0,z=b.length;D<z;++D){const U=b[D],S=U.layer,X=S.id;if(v!==void 0&&v!==X)continue;const O=S.layout||li,Z=S.paint||li;if(O.visibility==="none"||"minzoom"in S&&T<S.minzoom||"maxzoom"in S&&T>=S.maxzoom)continue;const ce=S.filter;if(!ce||X1(X,ce,I,p)){let J,he,me,Ee,Me,j;const Dt=U.index;if(M==3&&(S.type=="fill"||S.type=="fill-extrusion"))if(he=W(S,"paint",S.type+"-opacity",I,f,R),S.type+"-pattern"in Z){const Ie=W(S,"paint",S.type+"-pattern",I,f,R);if(Ie){const be=typeof Ie=="string"?uu(Ie,C):Ie.toString(),ye=_p(be,l);if(r&&r[be]&&ye){++B,j=E[B],(!j||!j.getFill()||j.getStroke()||j.getText())&&(j=new Qe({fill:new Ut}),E[B]=j),me=j.getFill(),j.setZIndex(Dt);const de=be+"."+he;let Xe=g[de];if(!Xe){const se=r[be],ue=tl(se.width,se.height),ze=ue.getContext("2d");ze.globalAlpha=he,ze.drawImage(ye.image,se.x,se.y,se.width,se.height,0,0,se.width,se.height),Xe=ze.createPattern(ue,"repeat"),g[de]=Xe}me.setColor(Xe)}}}else J=Tn(W(S,"paint",S.type+"-color",I,f,R),he),S.type+"-outline-color"in Z&&(Me=Tn(W(S,"paint",S.type+"-outline-color",I,f,R),he)),Me||(Me=J),(J||Me)&&(++B,j=E[B],(!j||J&&!j.getFill()||!J&&j.getFill()||Me&&!j.getStroke()||!Me&&j.getStroke()||j.getText())&&(j=new Qe({fill:J?new Ut:void 0,stroke:Me?new Vt:void 0}),E[B]=j),J&&(me=j.getFill(),me.setColor(J)),Me&&(Ee=j.getStroke(),Ee.setColor(Me),Ee.setWidth(.5)),j.setZIndex(Dt));if(M!=1&&S.type=="line"){"line-pattern"in Z?J=void 0:J=Tn(W(S,"paint","line-color",I,f,R),W(S,"paint","line-opacity",I,f,R));const Ie=W(S,"paint","line-width",I,f,R);J&&Ie>0&&(++B,j=E[B],(!j||!j.getStroke()||j.getFill()||j.getText())&&(j=new Qe({stroke:new Vt}),E[B]=j),Ee=j.getStroke(),Ee.setLineCap(W(S,"layout","line-cap",I,f,R)),Ee.setLineJoin(W(S,"layout","line-join",I,f,R)),Ee.setMiterLimit(W(S,"layout","line-miter-limit",I,f,R)),Ee.setColor(J),Ee.setWidth(Ie),Ee.setLineDash(Z["line-dasharray"]?W(S,"paint","line-dasharray",I,f,R).map(function(be){return be*Ie}):null),j.setZIndex(Dt))}let Si=!1,re=null,Kt=0,He,Ce,Ii;if((M==1||M==2)&&"icon-image"in O){const Ie=W(S,"layout","icon-image",I,f,R);if(Ie){He=typeof Ie=="string"?uu(Ie,C):Ie.toString();let be;const ye=a?a(n,He):void 0,de=_p(He,l);if(r&&r[He]&&de||ye){const Xe=W(S,"layout","icon-rotation-alignment",I,f,R);if(M==2){const se=_.getGeometry();if(se.getFlatMidpoint||se.getFlatMidpoints){const ue=se.getExtent();if(Math.sqrt(Math.max(Math.pow((ue[2]-ue[0])/w,2),Math.pow((ue[3]-ue[1])/w,2)))>150){const Je=se.getType()==="MultiLineString"?se.getFlatMidpoints():se.getFlatMidpoint();if(hu||(nl=[NaN,NaN],hu=new tt("Point",nl,[],2,{},void 0)),be=hu,nl[0]=Je[0],nl[1]=Je[1],W(S,"layout","symbol-placement",I,f,R)==="line"&&Xe==="map"){const vt=se.getStride(),it=se.getFlatCoordinates();for(let st=0,Le=it.length-vt;st<Le;st+=vt){const nt=it[st],ct=it[st+1],Te=it[st+vt],Ct=it[st+vt+1],_r=Math.min(nt,Te),Cl=Math.max(nt,Te),ps=Je[0],bt=Je[1],qi=(Ct-ct)*(ps-nt)-(Te-nt)*(bt-ct);if(Math.abs(qi)<.001&&ps<=Cl&&ps>=_r){Kt=Math.atan2(ct-Ct,Te-nt);break}}}}}}if(M!==2||be){const se=W(S,"layout","icon-size",I,f,R),ue=Z["icon-color"]!==void 0?W(S,"paint","icon-color",I,f,R):null;if(!ue||ue.a!==0){const ze=W(S,"paint","icon-halo-color",I,f,R),Je=W(S,"paint","icon-halo-width",I,f,R);let Qt=`${He}.${se}.${Je}.${ze}`;if(ue!==null&&(Qt+=`.${ue}`),Ce=d[Qt],!Ce){const vt=yp(S,I,"icon",f);let it;"icon-offset"in O&&(it=W(S,"layout","icon-offset",I,f,R).slice(0),it[0]*=se,it[1]*=-se);let st=ue?[ue.r*255,ue.g*255,ue.b*255,ue.a]:void 0;if(ye){const Le={color:st,rotateWithView:Xe==="map",displacement:it,declutterMode:vt,scale:se};typeof ye=="string"?Le.src=ye:(Le.img=ye,Le.imgSize=[ye.width,ye.height]),Ce=new $n(Le)}else{const Le=r[He];let nt,ct,Te;if(Je)Le.sdf?(nt=gp(pp(de.image,Le,ue||[0,0,0,1]),{x:0,y:0,width:Le.width,height:Le.height,pixelRatio:Le.pixelRatio},Je,ze),st=void 0):nt=gp(de.image,Le,Je,ze);else{if(Le.sdf&&!de.unSDFed){const Ct=pp(de.image,{x:0,y:0,width:de.size[0],height:de.size[1]},{r:1,g:1,b:1});de.image=Ct,de.unSDFed=!0}nt=de.image,ct=[Le.width,Le.height],Te=[Le.x,Le.y]}Ce=new $n({color:st,img:nt,imgSize:de.size,size:ct,offset:Te,rotateWithView:Xe==="map",scale:se/Le.pixelRatio,displacement:it,declutterMode:vt})}d[Qt]=Ce}}Ce&&(++B,j=E[B],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new Qe,E[B]=j),j.setGeometry(be),Ce.setRotation(Kt+su(W(S,"layout","icon-rotate",I,f,R))),Ce.setOpacity(W(S,"paint","icon-opacity",I,f,R)),Ce.setAnchor(W1[W(S,"layout","icon-anchor",I,f,R)]),j.setImage(Ce),re=j.getText(),j.setText(void 0),j.setZIndex(Dt),Si=!0,Ii=!1)}else Ii=!0}}}if(M==1&&S.type==="circle"){++B,j=E[B],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new Qe,E[B]=j);const Ie="circle-radius"in Z?W(S,"paint","circle-radius",I,f,R):5,be=Tn(W(S,"paint","circle-stroke-color",I,f,R),W(S,"paint","circle-stroke-opacity",I,f,R)),ye=W(S,"paint","circle-translate",I,f,R),de=Tn(W(S,"paint","circle-color",I,f,R),W(S,"paint","circle-opacity",I,f,R)),Xe=W(S,"paint","circle-stroke-width",I,f,R),se=Ie+"."+be+"."+de+"."+Xe+"."+ye[0]+"."+ye[1];Ce=d[se],Ce||(Ce=new Jn({radius:Ie,displacement:[ye[0],-ye[1]],stroke:be&&Xe>0?new Vt({width:Xe,color:be}):void 0,fill:de?new Ut({color:de}):void 0,declutterMode:"none"}),d[se]=Ce),j.setImage(Ce),re=j.getText(),j.setText(void 0),j.setGeometry(void 0),j.setZIndex(Dt),Si=!0}let Ge,di,Ot,gt,Zt,je;if("text-field"in O){gt=Math.round(W(S,"layout","text-size",I,f,R));const Ie=W(S,"layout","text-font",I,f,R);Ot=W(S,"layout","text-line-height",I,f,R),di=Yh(o?o(Ie,e.metadata?e.metadata["ol:webfonts"]:void 0):Ie,gt,Ot),di.includes("sans-serif")||(di+=",sans-serif"),Zt=W(S,"layout","text-letter-spacing",I,f,R),je=W(S,"layout","text-max-width",I,f,R);const be=W(S,"layout","text-field",I,f,R);typeof be=="object"&&be.sections?be.sections.length===1?Ge=be.toString():Ge=be.sections.reduce((ye,de,Xe)=>{const se=de.fontStack?de.fontStack.split(","):Ie,ue=Yh(o?o(se):se,gt*(de.scale||1),Ot);let ze=de.text;if(ze===`
|
|
34
|
+
`)return ye.push(`
|
|
35
|
+
`,""),ye;if(M==2)return ye.push(au(ze,Zt),ue),ye;ze=cu(ze,ue,je,Zt).split(`
|
|
36
|
+
`);for(let Je=0,Qt=ze.length;Je<Qt;++Je)Je>0&&ye.push(`
|
|
37
|
+
`,""),ye.push(ze[Je],ue);return ye},[]):Ge=uu(be,C).trim(),he=W(S,"paint","text-opacity",I,f,R)}if(Ge&&he&&!Ii){Si||(++B,j=E[B],(!j||!j.getText()||j.getFill()||j.getStroke())&&(j=new Qe,E[B]=j),j.setImage(void 0),j.setGeometry(void 0));const Ie=yp(S,I,"text",f);j.getText()||j.setText(re),re=j.getText(),(!re||"getDeclutterMode"in re&&re.getDeclutterMode()!==Ie)&&(re=new fa({padding:[2,2,2,2],declutterMode:Ie}),j.setText(re));const be=W(S,"layout","text-transform",I,f,R);be=="uppercase"?Ge=Array.isArray(Ge)?Ge.map((Te,Ct)=>Ct%2?Te:Te.toUpperCase()):Ge.toUpperCase():be=="lowercase"&&(Ge=Array.isArray(Ge)?Ge.map((Te,Ct)=>Ct%2?Te:Te.toLowerCase()):Ge.toLowerCase());const ye=Array.isArray(Ge)?Ge:M==2?au(Ge,Zt):cu(Ge,di,je,Zt);if(re.setText(ye),re.setFont(di),re.setRotation(su(W(S,"layout","text-rotate",I,f,R))),typeof re.setKeepUpright=="function"){const Te=W(S,"layout","text-keep-upright",I,f,R);re.setKeepUpright(Te)}const de=W(S,"layout","text-anchor",I,f,R),Xe=Si||M==1?"point":W(S,"layout","symbol-placement",I,f,R);let se;if(Xe==="line-center"?(re.setPlacement("line"),se="center"):re.setPlacement(Xe),Xe==="line"&&typeof re.setRepeat=="function"){const Te=W(S,"layout","symbol-spacing",I,f,R);re.setRepeat(Te*2)}re.setOverflow(Xe==="point");let ue=W(S,"paint","text-halo-width",I,f,R);const ze=W(S,"layout","text-offset",I,f,R),Je=W(S,"paint","text-translate",I,f,R);let Qt=0,vt=0;if(Xe=="point"){se="center",de.indexOf("left")!==-1?(se="left",vt=ue):de.indexOf("right")!==-1&&(se="right",vt=-ue);const Te=W(S,"layout","text-rotation-alignment",I,f,R);re.setRotateWithView(Te=="map")}else re.setMaxAngle(su(W(S,"layout","text-max-angle",I,f,R))*Ge.length/ye.length),re.setRotateWithView(!1);re.setTextAlign(se);let it="middle";de.indexOf("bottom")==0?(it="bottom",Qt=-ue-.5*(Ot-1)*gt):de.indexOf("top")==0&&(it="top",Qt=ue+.5*(Ot-1)*gt),re.setTextBaseline(it);const st=W(S,"layout","text-justify",I,f,R);re.setJustify(st==="auto"?void 0:st),re.setOffsetX(ze[0]*gt+vt+Je[0]),re.setOffsetY(ze[1]*gt+Qt+Je[1]),y.setColor(Tn(W(S,"paint","text-color",I,f,R),he)),re.setFill(y);const Le=Tn(W(S,"paint","text-halo-color",I,f,R),he);if(Le&&ue>0){m.setColor(Le),ue*=2;const Te=.5*gt;m.setWidth(ue<=Te?ue:Te),re.setStroke(m)}else re.setStroke(void 0);const nt=W(S,"layout","text-padding",I,f,R),ct=re.getPadding();nt!==ct[0]&&(ct[0]=nt,ct[1]=nt,ct[2]=nt,ct[3]=nt),j.setZIndex(Dt)}}}if(B>-1)return E.length=B+1,E};return n.setStyle(x),n.set("mapbox-layers",u),n.set("mapbox-source",A),n.set("mapbox-featurestate",n.get("mapbox-featurestate")||{}),x}const gu=65536*65536,xp=1/gu,K1=12,Ep=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),pu=0,rl=1,xo=2,sl=5;class Z1{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,i=this.length){for(;this.pos<i;){const r=this.readVarint(),s=r>>3,o=this.pos;this.type=r&7,e(s,t,this),this.pos===o&&this.skip(r)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*gu;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*gu;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let i,r;return r=t[this.pos++],i=r&127,r<128||(r=t[this.pos++],i|=(r&127)<<7,r<128)||(r=t[this.pos++],i|=(r&127)<<14,r<128)||(r=t[this.pos++],i|=(r&127)<<21,r<128)?i:(r=t[this.pos],i|=(r&15)<<28,Q1(i,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=K1&&Ep?Ep.decode(this.buf.subarray(t,e)):cw(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===xo?this.readVarint()+this.pos:this.pos+1}skip(e){const t=e&7;if(t===pu)for(;this.buf[this.pos++]>127;);else if(t===xo)this.pos=this.readVarint()+this.pos;else if(t===sl)this.pos+=4;else if(t===rl)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xp),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xp),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){q1(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;const t=this.pos;this.pos=hw(this.buf,e,this.pos);const i=this.pos-t;i>=128&&wp(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let i=0;i<t;i++)this.buf[this.pos++]=e[i]}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const r=this.pos-i;r>=128&&wp(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,i){this.writeTag(e,xo),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,ew,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,tw,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,rw,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,iw,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,nw,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,sw,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,ow,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,aw,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,lw,t)}writeBytesField(e,t){this.writeTag(e,xo),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,sl),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,sl),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,rl),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,rl),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,pu),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,pu),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,xo),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,sl),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,rl),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function Q1(n,e,t){const i=t.buf;let r,s;if(s=i[t.pos++],r=(s&112)>>4,s<128||(s=i[t.pos++],r|=(s&127)<<3,s<128)||(s=i[t.pos++],r|=(s&127)<<10,s<128)||(s=i[t.pos++],r|=(s&127)<<17,s<128)||(s=i[t.pos++],r|=(s&127)<<24,s<128)||(s=i[t.pos++],r|=(s&1)<<31,s<128))return os(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function os(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function q1(n,e){let t,i;if(n>=0?(t=n%4294967296|0,i=n/4294967296|0):(t=~(-n%4294967296),i=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,i=i+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),J1(t,i,e),$1(i,e)}function J1(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function $1(n,e){const t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))))}function wp(n,e,t){const i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(i);for(let r=t.pos-1;r>=n;r--)t.buf[r+i]=t.buf[r]}function ew(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t])}function tw(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t])}function iw(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t])}function nw(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t])}function rw(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t])}function sw(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t])}function ow(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t])}function aw(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t])}function lw(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t])}function cw(n,e,t){let i="",r=e;for(;r<t;){const s=n[r];let o=null,a=s>239?4:s>223?3:s>191?2:1;if(r+a>t)break;let l,c,h;a===1?s<128&&(o=s):a===2?(l=n[r+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):a===3?(l=n[r+1],c=n[r+2],(l&192)===128&&(c&192)===128&&(o=(s&15)<<12|(l&63)<<6|c&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(l=n[r+1],c=n[r+2],h=n[r+3],(l&192)===128&&(c&192)===128&&(h&192)===128&&(o=(s&15)<<18|(l&63)<<12|(c&63)<<6|h&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),r+=a}return i}function hw(n,e,t){for(let i=0,r,s;i<e.length;i++){if(r=e.charCodeAt(i),r>55295&&r<57344)if(s)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,s=r;continue}else r=s-55296<<10|r-56320|65536,s=null;else{r>56319||i+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):s=r;continue}else s&&(n[t++]=239,n[t++]=191,n[t++]=189,s=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128)}return t}class uw extends Yf{constructor(e){super(),e=e||{},this.dataProjection=new Bo({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:tt,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,i,r){e.pos=t.geometry;const s=e.readVarint()+e.pos;let o=1,a=0,l=0,c=0,h=0,u=0;for(;e.pos<s;){if(!a){const d=e.readVarint();o=d&7,a=d>>3}if(a--,o===1||o===2)l+=e.readSVarint(),c+=e.readSVarint(),o===1&&h>u&&(r.push(h),u=h),i.push(l,c),h+=2;else if(o===7)h>u&&(i.push(i[u],i[u+1]),h+=2);else throw new Error("Invalid command found in the PBF")}h>u&&(r.push(h),u=h)}createFeature_(e,t,i){const r=t.type;if(r===0)return null;let s;const o=t.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=t.id,o[this.layerName_]=t.layer.name;const l=[],c=[];this.readRawGeometry_(e,t,l,c);const h=Aw(r,c.length);if(this.featureClass===tt)s=new this.featureClass(h,l,c,2,o,a),s.transform(i.dataProjection);else{let u;if(h=="Polygon"){const f=pc(l,c);u=f.length>1?new mn(l,"XY",f):new Nt(l,"XY",c)}else u=h==="Point"?new yt(l,"XY"):h==="LineString"?new Wt(l,"XY"):h==="MultiPoint"?new er(l,"XY"):h==="MultiLineString"?new An(l,"XY",c):null;const d=this.featureClass;s=new d,this.geometryName_&&s.setGeometryName(this.geometryName_);const g=Ea(u,!1,i);s.setGeometry(g),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return"arraybuffer"}readFeatures(e,t){const i=this.layers_;t=this.adaptOptions(t);const r=pe(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;const s=new Z1(e),o=s.readFields(dw,{}),a=[];for(const l in o){if(i&&!i.includes(l))continue;const c=o[l],h=c?[0,0,c.extent,c.extent]:null;r.setExtent(h);for(let u=0,d=c.length;u<d;++u){const g=pw(s,c,u),f=this.createFeature_(s,g,t);f!==null&&a.push(f)}}return a}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function dw(n,e,t){if(n===3){const i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(fw,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function fw(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){let i=null;const r=t.readVarint()+t.pos;for(;t.pos<r;)n=t.readVarint()>>3,i=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(i)}}function gw(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2){const i=t.readVarint()+t.pos;for(;t.pos<i;){const r=e.layer.keys[t.readVarint()],s=e.layer.values[t.readVarint()];e.properties[r]=s}}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function pw(n,e,t){n.pos=e.features[t];const i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(gw,r,i),r}function Aw(n,e){let t;return n===1?t=e===1?"Point":"MultiPoint":n===2?t=e===1?"LineString":"MultiLineString":n===3&&(t="Polygon"),t}class mw extends $h{constructor(e){super(e),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(e){const t=e.layerStatesArray[e.layerIndex],i=e.pixelRatio,r=e.viewState,s=r.resolution,o=this.getLayer().getSource(),a=e.viewHints;let l=e.extent;if(t.extent!==void 0&&(l=ut(l,ii(t.extent,r.projection))),!a[ke.ANIMATING]&&!a[ke.INTERACTING]&&!jn(l))if(o){const c=r.projection,h=o.getImage(l,s,i,c);h&&(this.loadImage(h)?this.image=h:h.getState()===V.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=Ye(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!Nn(s,r))return null;const o=this.image.getExtent(),a=this.image.getImage(),l=ne(o),c=Math.floor(a.width*((r[0]-o[0])/l));if(c<0||c>=a.width)return null;const h=De(o),u=Math.floor(a.height*((o[3]-r[1])/h));return u<0||u>=a.height?null:this.getImageData(a,c,u)}renderFrame(e,t){const i=this.image,r=i.getExtent(),s=i.getResolution(),[o,a]=Array.isArray(s)?s:[s,s],l=i.getPixelRatio(),c=e.layerStatesArray[e.layerIndex],h=e.pixelRatio,u=e.viewState,d=u.center,g=u.resolution,f=h*o/(g*l),p=h*a/(g*l);this.prepareContainer(e,t);const A=this.context.canvas.width,m=this.context.canvas.height,y=this.getRenderContext(e);let E=!1,x=!0;if(c.extent){const b=ii(c.extent,u.projection);x=Be(b,e.extent),E=x&&!Oi(b,e.extent),E&&this.clipUnrotated(y,e,b)}const _=i.getImage(),w=mi(this.tempTransform,A/2,m/2,f,p,0,l*(r[0]-d[0])/o,l*(d[1]-r[3])/a);this.renderedResolution=a*h/l;const v=_.width*w[0],C=_.height*w[3];if(this.getLayer().getSource().getInterpolate()||(y.imageSmoothingEnabled=!1),this.preRender(y,e),x&&v>=.5&&C>=.5){const b=w[4],T=w[5],P=c.opacity;P!==1&&(y.save(),y.globalAlpha=P),y.drawImage(_,0,0,+_.width,+_.height,b,T,v,C),P!==1&&y.restore()}return this.postRender(this.context,e),E&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}class yw extends Dr{constructor(e){e=e||{},super(e)}}class vp extends yw{constructor(e){super(e)}createRenderer(){return new mw(this)}getData(e){return super.getData(e)}}function ol(n){return n instanceof Image||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageBitmap?n:null}function _w(n){return n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Float32Array||n instanceof DataView?n:null}const xw=new Error("disposed");let as=null;function Ew(n){as||(as=Fe(n.width,n.height,void 0,{willReadFrequently:!0}));const e=as.canvas,t=n.width;e.width!==t&&(e.width=t);const i=n.height;return e.height!==i&&(e.height=i),as.clearRect(0,0,t,i),as.drawImage(n,0,0),as.getImageData(0,0,t,i).data}const ww=[256,256];class al extends yo{constructor(e){const t=G.IDLE;super(e.tileCoord,t,{transition:e.transition,interpolate:e.interpolate}),this.loader_=e.loader,this.data_=null,this.error_=null,this.size_=e.size||null,this.controller_=e.controller||null}getSize(){if(this.size_)return this.size_;const e=ol(this.data_);return e?[e.width,e.height]:ww}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;this.state=G.LOADING,this.changed();const e=this;this.loader_().then(function(t){e.data_=t,e.state=G.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=G.ERROR,e.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(xw),this.controller_=null),super.disposeInternal()}}let Au;const ls=[];function Cp(n,e,t,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,i)+1,Math.max(t,r)),n.restore()}function mu(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function vw(){if(Au===void 0){const n=Fe(6,6,ls);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Cp(n,4,5,4,0),Cp(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Au=mu(e,0)||mu(e,4)||mu(e,8),zs(n),ls.push(n.canvas)}return Au}function yu(n,e,t,i){const r=Ho(t,e,n);let s=ql(e,i,t);const o=e.getMetersPerUnit();o!==void 0&&(s*=o);const a=n.getMetersPerUnit();a!==void 0&&(s/=a);const l=n.getExtent();if(!l||Nn(l,r)){const c=ql(n,s,r)/s;isFinite(c)&&c>0&&(s/=c)}return s}function bp(n,e,t,i){const r=It(t);let s=yu(n,e,r,i);return(!isFinite(s)||s<=0)&&jl(t,function(o){return s=yu(n,e,o,i),isFinite(s)&&s>0}),s}function Tp(n,e,t,i,r,s,o,a,l,c,h,u,d,g){const f=Fe(Math.round(t*n),Math.round(t*e),ls);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(t,t);function p(_){return Math.round(_*t)/t}f.globalCompositeOperation="lighter";const A=St();l.forEach(function(_,w,v){Nl(A,_.extent)});let m;const y=t/i,E=(u?1:1+Math.pow(2,-24))/y;if(!d||l.length!==1||c!==0){if(m=Fe(Math.round(ne(A)*y),Math.round(De(A)*y),ls),u||(m.imageSmoothingEnabled=!1),r&&g){const _=(r[0]-A[0])*y,w=-(r[3]-A[3])*y,v=ne(r)*y,C=De(r)*y;m.rect(_,w,v,C),m.clip()}l.forEach(function(_,w,v){if(_.image.width>0&&_.image.height>0){if(_.clipExtent){m.save();const M=(_.clipExtent[0]-A[0])*y,k=-(_.clipExtent[3]-A[3])*y,I=ne(_.clipExtent)*y,R=De(_.clipExtent)*y;m.rect(u?M:Math.round(M),u?k:Math.round(k),u?I:Math.round(M+I)-Math.round(M),u?R:Math.round(k+R)-Math.round(k)),m.clip()}const C=(_.extent[0]-A[0])*y,b=-(_.extent[3]-A[3])*y,T=ne(_.extent)*y,P=De(_.extent)*y;m.drawImage(_.image,c,c,_.image.width-2*c,_.image.height-2*c,u?C:Math.round(C),u?b:Math.round(b),u?T:Math.round(C+T)-Math.round(C),u?P:Math.round(b+P)-Math.round(b)),_.clipExtent&&m.restore()}})}const x=ei(o);return a.getTriangles().forEach(function(_,w,v){const C=_.source,b=_.target;let T=C[0][0],P=C[0][1],M=C[1][0],k=C[1][1],I=C[2][0],R=C[2][1];const B=p((b[0][0]-x[0])/s),D=p(-(b[0][1]-x[1])/s),z=p((b[1][0]-x[0])/s),U=p(-(b[1][1]-x[1])/s),S=p((b[2][0]-x[0])/s),X=p(-(b[2][1]-x[1])/s),O=T,Z=P;T=0,P=0,M-=O,k-=Z,I-=O,R-=Z;const ce=[[M,k,0,0,z-B],[I,R,0,0,S-B],[0,0,M,k,U-D],[0,0,I,R,X-D]],J=fm(ce);if(!J)return;if(f.save(),f.beginPath(),vw()||!u){f.moveTo(z,U);const me=4,Ee=B-z,Me=D-U;for(let j=0;j<me;j++)f.lineTo(z+p((j+1)*Ee/me),U+p(j*Me/(me-1))),j!=me-1&&f.lineTo(z+p((j+1)*Ee/me),U+p((j+1)*Me/(me-1)));f.lineTo(S,X)}else f.moveTo(z,U),f.lineTo(B,D),f.lineTo(S,X);f.clip(),f.transform(J[0],J[2],J[1],J[3],B,D),f.translate(A[0]-O,A[3]-Z);let he;if(m)he=m.canvas,f.scale(E,-E);else{const me=l[0],Ee=me.extent;he=me.image,f.scale(ne(Ee)/he.width,-De(Ee)/he.height)}f.drawImage(he,0,0),f.restore()}),m&&(zs(m),ls.push(m.canvas)),h&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(_,w,v){const C=_.target,b=(C[0][0]-x[0])/s,T=-(C[0][1]-x[1])/s,P=(C[1][0]-x[0])/s,M=-(C[1][1]-x[1])/s,k=(C[2][0]-x[0])/s,I=-(C[2][1]-x[1])/s;f.beginPath(),f.moveTo(P,M),f.lineTo(b,T),f.lineTo(k,I),f.closePath(),f.stroke()}),f.restore()),f.canvas}const Cw=10,Rp=.25;class _u{constructor(e,t,i,r,s,o,a){this.sourceProj_=e,this.targetProj_=t;let l={};const c=a?ey(E=>Ye(a,Ho(E,this.targetProj_,this.sourceProj_))):Gs(this.targetProj_,this.sourceProj_);this.transformInv_=function(E){const x=E[0]+"/"+E[1];return l[x]||(l[x]=c(E)),l[x]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&ne(r)>=ne(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ne(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ne(this.targetProj_.getExtent()):null;const h=ei(i),u=Go(i),d=Do(i),g=ko(i),f=this.transformInv_(h),p=this.transformInv_(u),A=this.transformInv_(d),m=this.transformInv_(g),y=Cw+(o?Math.max(0,Math.ceil(Math.log2(Fs(i)/(o*o*256*256)))):0);if(this.addQuad_(h,u,d,g,f,p,A,m,y),this.wrapsXInSource_){let E=1/0;this.triangles_.forEach(function(x,_,w){E=Math.min(E,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-E>this.sourceWorldWidth_/2){const _=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];_[0][0]-E>this.sourceWorldWidth_/2&&(_[0][0]-=this.sourceWorldWidth_),_[1][0]-E>this.sourceWorldWidth_/2&&(_[1][0]-=this.sourceWorldWidth_),_[2][0]-E>this.sourceWorldWidth_/2&&(_[2][0]-=this.sourceWorldWidth_);const w=Math.min(_[0][0],_[1][0],_[2][0]);Math.max(_[0][0],_[1][0],_[2][0])-w<this.sourceWorldWidth_/2&&(x.source=_)}})}l={}}addTriangle_(e,t,i,r,s,o){this.triangles_.push({source:[r,s,o],target:[e,t,i]})}addQuad_(e,t,i,r,s,o,a,l,c){const h=ht([s,o,a,l]),u=this.sourceWorldWidth_?ne(h)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,g=this.sourceProj_.canWrapX()&&u>.5&&u<1;let f=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const A=ht([e,t,i,r]);f=ne(A)/this.targetWorldWidth_>Rp||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>Rp||f)}if(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Be(h,this.maxSourceExtent_))return;let p=0;if(!f&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)f=!0;else if(p=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),p!=1&&p!=2&&p!=4&&p!=8)return}if(c>0){if(!f){const A=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(A);let y;g?y=(an(s[0],d)+an(a[0],d))/2-an(m[0],d):y=(s[0]+a[0])/2-m[0];const E=(s[1]+a[1])/2-m[1];f=y*y+E*E>this.errorThresholdSquared_}if(f){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const A=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(A),y=[(r[0]+e[0])/2,(r[1]+e[1])/2],E=this.transformInv_(y);this.addQuad_(e,t,A,y,s,o,m,E,c-1),this.addQuad_(y,A,i,r,E,m,a,l,c-1)}else{const A=[(e[0]+t[0])/2,(e[1]+t[1])/2],m=this.transformInv_(A),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],E=this.transformInv_(y);this.addQuad_(e,A,y,r,s,m,E,l,c-1),this.addQuad_(A,t,i,y,m,o,a,E,c-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(p&11)==0&&this.addTriangle_(e,i,r,s,a,l),(p&14)==0&&this.addTriangle_(e,i,t,s,a,o),p&&((p&13)==0&&this.addTriangle_(t,r,e,o,l,s),(p&7)==0&&this.addTriangle_(t,r,i,o,l,a))}calculateSourceExtent(){const e=St();return this.triangles_.forEach(function(t,i,r){const s=t.source;Ms(e,s[0]),Ms(e,s[1]),Ms(e,s[2])}),e}getTriangles(){return this.triangles_}}const xu=.5;class Sp extends yo{constructor(e,t,i,r,s,o,a,l,c,h,u,d){super(s,G.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;const g=r.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const A=f?ut(g,f):g;if(Fs(A)===0){this.state=G.EMPTY;return}const m=e.getExtent();m&&(p?p=ut(p,m):p=m);const y=r.getResolution(this.wrappedTileCoord_[0]),E=bp(e,i,A,y);if(!isFinite(E)||E<=0){this.state=G.EMPTY;return}const x=h!==void 0?h:xu;if(this.triangulation_=new _u(e,i,A,p,E*x,y),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=t.getZForResolution(E);let _=this.triangulation_.calculateSourceExtent();if(p&&(e.canWrapX()?(_[1]=Pe(_[1],p[1],p[3]),_[3]=Pe(_[3],p[1],p[3])):_=ut(_,p)),!Fs(_))this.state=G.EMPTY;else{let w=0,v=0;e.canWrapX()&&(w=ne(m),v=Math.floor((_[0]-m[0])/w)),zl(_.slice(),e,!0).forEach(b=>{const T=t.getTileRangeForExtentAndZ(b,this.sourceZ_);for(let P=T.minX;P<=T.maxX;P++)for(let M=T.minY;M<=T.maxY;M++){const k=c(this.sourceZ_,P,M,a);if(k){const I=v*w;this.sourceTiles_.push({tile:k,offset:I})}}++v}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(t=>{var r;const i=t.tile;if(i&&i.getState()==G.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=t.offset,s[2]+=t.offset;const o=(r=this.clipExtent_)==null?void 0:r.slice();o&&(o[0]+=t.offset,o[2]+=t.offset),e.push({extent:s,clipExtent:o,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=G.ERROR;else{const t=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(t),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(t),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Tp(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=G.LOADED}this.changed()}load(){if(this.state==G.IDLE){this.state=G.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{const i=t.getState();if(i==G.IDLE||i==G.LOADING){e++;const r=oe(t,H.CHANGE,s=>{const o=t.getState();(o==G.LOADED||o==G.ERROR||o==G.EMPTY)&&(ve(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t},i,r){t.getState()==G.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(ve),this.sourcesListenerKeys_=null}release(){this.canvas_&&(zs(this.canvas_.getContext("2d")),ls.push(this.canvas_),this.canvas_=null),super.release()}}class bw{constructor(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const e=this.pop();e instanceof Cs&&e.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){const i=this.entries_[e];return ge(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const t=this.entries_[e];return ge(t!==void 0,"Tried to get a value for a key that does not exist in the cache"),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.key_;return e}getValues(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){var t;return(t=this.entries_[e])==null?void 0:t.value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){ge(!(e in this.entries_),"Tried to set a value for a key that is used already");const i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}function ll(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function Tw(n,e,t){return n+"/"+e+"/"+t}function Rw(n){return Ip(n[0],n[1],n[2])}function Ip(n,e,t){return(e<<n)+t}function Sw(n,e){const t=n[0],i=n[1],r=n[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;const s=e.getFullTileRange(t);return s?s.containsXY(i,r):!0}function Eu(n,e,t,i){return`${n},${Tw(e,t,i)}`}function wu(n,e,t){if(!(t in n))return n[t]=new Set([e]),!0;const i=n[t],r=i.has(e);return r||i.add(e),!r}function Iw(n,e,t){const i=n[t];return i?i.delete(e):!1}function Pp(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=ut(e,ii(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=ut(e,r))}return e}class Mp extends $h{constructor(e,t){super(e),t=t||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision_,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=St(),this.tempTileRange_=new eu(0,0,0,0),this.tempTileCoord_=ll(0,0,0);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileCache_=new bw(i),this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getOrCreateTile(e,t,i,r){const s=this.tileCache_,a=this.getLayer().getSource(),l=Eu(a.getKey(),e,t,i);let c;if(s.containsKey(l))c=s.get(l);else{if(c=a.getTile(e,t,i,r.pixelRatio,r.viewState.projection),!c)return null;s.set(l,c)}return c}getTile(e,t,i,r){const s=this.getOrCreateTile(e,t,i,r);return s||null}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=Ye(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!Nn(s,r))return null;const o=t.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(t.pixelRatio);for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const u=l.getTileCoordForCoordAndZ(r,h),d=this.getTile(h,u[1],u[2],t);if(!d||d.getState()!==G.LOADED)continue;const g=l.getOrigin(h),f=Ke(l.getTileSize(h)),p=l.getResolution(h);let A;if(d instanceof np||d instanceof Sp)A=d.getImage();else if(d instanceof al){if(A=ol(d.getData()),!A)continue}else continue;const m=Math.floor(c*((r[0]-g[0])/p-u[1]*f[0])),y=Math.floor(c*((g[1]-r[1])/p-u[2]*f[1])),E=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(A,m+E,y+E)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;const t=this.getLayer().getSource();if(!t)return!1;const i=t.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===t.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(e,t,i,r,s){const o=e.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),h=Y(l);h in e.wantedTiles||(e.wantedTiles[h]={});const u=e.wantedTiles[h],d=a.getMapInternal(),g=Math.max(i-s,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection)),f=o.rotation,p=f?dd(o.center,o.resolution,f,e.size):void 0;for(let A=i;A>=g;--A){const m=c.getTileRangeForExtentAndZ(t,A,this.tempTileRange_),y=c.getResolution(A);for(let E=m.minX;E<=m.maxX;++E)for(let x=m.minY;x<=m.maxY;++x){if(f&&!c.tileCoordIntersectsViewport([A,E,x],p))continue;const _=this.getTile(A,E,x,e);if(!_||!wu(r,_,A))continue;const v=_.getKey();if(u[v]=!0,_.getState()===G.IDLE&&!e.tileQueue.isKeyQueued(v)){const C=ll(A,E,x,this.tempTileCoord_);e.tileQueue.enqueue([_,h,c.getTileCoordCenter(C),y])}}}}findStaleTile_(e,t){const i=this.tileCache_,r=e[0],s=e[1],o=e[2],a=this.getStaleKeys();for(let l=0;l<a.length;++l){const c=Eu(a[l],r,s,o);if(i.containsKey(c)){const h=i.peek(c);if(h.getState()===G.LOADED)return h.endTransition(Y(this)),wu(t,h,r),!0}}return!1}findAltTiles_(e,t,i,r){const s=e.getTileRangeForTileCoordAndZ(t,i,this.tempTileRange_);if(!s)return!1;let o=!0;const a=this.tileCache_,c=this.getLayer().getRenderSource().getKey();for(let h=s.minX;h<=s.maxX;++h)for(let u=s.minY;u<=s.maxY;++u){const d=Eu(c,i,h,u);let g=!1;if(a.containsKey(d)){const f=a.peek(d);f.getState()===G.LOADED&&(wu(r,f,i),g=!0)}g||(o=!1)}return o}renderFrame(e,t){this.renderComplete=!0;const i=e.layerStatesArray[e.layerIndex],r=e.viewState,s=r.projection,o=r.resolution,a=r.center,l=e.pixelRatio,c=this.getLayer(),h=c.getSource(),u=h.getTileGridForProjection(s),d=u.getZForResolution(o,h.zDirection),g=u.getResolution(d),f=h.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==f&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=f):this.renderedSourceKey_=f;let p=e.extent;const A=h.getTilePixelRatio(l);this.prepareContainer(e,t);const m=this.context.canvas.width,y=this.context.canvas.height,E=i.extent&&ii(i.extent);E&&(p=ut(p,ii(i.extent)));const x=g*m/2/A,_=g*y/2/A,w=[a[0]-x,a[1]-_,a[0]+x,a[1]+_],v={};this.renderedTiles.length=0;const C=c.getPreload();if(e.nextExtent){const z=u.getZForResolution(r.nextResolution,h.zDirection),U=Pp(e,e.nextExtent);this.enqueueTiles(e,U,z,v,C)}const b=Pp(e,p);if(this.enqueueTiles(e,b,d,v,0),C>0&&setTimeout(()=>{this.enqueueTiles(e,b,d-1,v,C-1)},0),!(d in v))return this.container;const T=Y(this),P=e.time;for(const z of v[d]){const U=z.getState();if(U===G.EMPTY)continue;const S=z.tileCoord;if(U===G.LOADED&&z.getAlpha(T,P)===1){z.endTransition(T);continue}if(U!==G.ERROR&&(this.renderComplete=!1),this.findStaleTile_(S,v)){Iw(v,z,d),e.animate=!0;continue}if(this.findAltTiles_(u,S,d+1,v))continue;const Z=u.getMinZoom();for(let ce=d-1;ce>=Z&&!this.findAltTiles_(u,S,ce,v);--ce);}const M=g/o*l/A,k=this.getRenderContext(e);mi(this.tempTransform,m/2,y/2,M,M,0,-m/2,-y/2),i.extent&&this.clipUnrotated(k,e,E),h.getInterpolate()||(k.imageSmoothingEnabled=!1),this.preRender(k,e);const I=Object.keys(v).map(Number);I.sort(fi);let R;const B=[],D=[];for(let z=I.length-1;z>=0;--z){const U=I[z],S=h.getTilePixelSize(U,l,s),O=u.getResolution(U)/g,Z=S[0]*O*M,ce=S[1]*O*M,J=u.getTileCoordForCoordAndZ(ei(w),U),he=u.getTileCoordExtent(J),me=Ye(this.tempTransform,[A*(he[0]-w[0])/g,A*(w[3]-he[3])/g]),Ee=A*h.getGutterForProjection(s);for(const Me of v[U]){if(Me.getState()!==G.LOADED)continue;const j=Me.tileCoord,Dt=J[1]-j[1],Si=Math.round(me[0]-(Dt-1)*Z),re=J[2]-j[2],Kt=Math.round(me[1]-(re-1)*ce),He=Math.round(me[0]-Dt*Z),Ce=Math.round(me[1]-re*ce),Ii=Si-He,Ge=Kt-Ce,di=I.length===1;let Ot=!1;R=[He,Ce,He+Ii,Ce,He+Ii,Ce+Ge,He,Ce+Ge];for(let gt=0,Zt=B.length;gt<Zt;++gt)if(!di&&U<D[gt]){const je=B[gt];Be([He,Ce,He+Ii,Ce+Ge],[je[0],je[3],je[4],je[7]])&&(Ot||(k.save(),Ot=!0),k.beginPath(),k.moveTo(R[0],R[1]),k.lineTo(R[2],R[3]),k.lineTo(R[4],R[5]),k.lineTo(R[6],R[7]),k.moveTo(je[6],je[7]),k.lineTo(je[4],je[5]),k.lineTo(je[2],je[3]),k.lineTo(je[0],je[1]),k.clip())}B.push(R),D.push(U),this.drawTile(Me,e,He,Ce,Ii,Ge,Ee,di),Ot&&k.restore(),this.renderedTiles.unshift(Me),this.updateUsedTiles(e.usedTiles,h,Me)}}if(this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Gi(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.postRender(this.context,e),i.extent&&k.restore(),k.imageSmoothingEnabled=!0,this.renderComplete){const z=(U,S)=>{const X=Y(h),O=S.wantedTiles[X],Z=O?Object.keys(O).length:0;this.updateCacheSize(Z),this.tileCache_.expireCache()};e.postRenderFunctions.push(z)}return this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,i,r,s,o,a,l){let c;if(e instanceof al){if(c=ol(e.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(e);if(!c)return;const h=this.getRenderContext(t),u=Y(this),d=t.layerStatesArray[t.layerIndex],g=d.opacity*(l?e.getAlpha(u,t.time):1),f=g!==h.globalAlpha;f&&(h.save(),h.globalAlpha=g),h.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,r,s,o),f&&h.restore(),g!==d.opacity?t.animate=!0:l&&e.endTransition(u)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,i){const r=Y(t);r in e||(e[r]={}),e[r][i.getKey()]=!0}}const Rn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Pw extends Dr{constructor(e){e=e||{};const t=Object.assign({},e),i=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(e.preload!==void 0?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Rn.PRELOAD)}setPreload(e){this.set(Rn.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Rn.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Rn.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}class cl extends Pw{constructor(e){super(e)}createRenderer(){return new Mp(this,{cacheSize:this.getCacheSize()})}}const Mw={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},Fp={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class Fw extends Mp{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=mt(),this.tileClipContexts_=null}drawTile(e,t,i,r,s,o,a,l){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,i,r,s,o,a,l)}getTile(e,t,i,r){const s=this.getOrCreateTile(e,t,i,r);if(!s)return null;const a=r.viewState.resolution,l=r.viewHints;return(!(l[ke.ANIMATING]||l[ke.INTERACTING])||!s.wantedResolution)&&(s.wantedResolution=a),s}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,i){const r=this.getLayer(),s=r.getRevision(),o=r.getRenderOrder()||null,a=e.wantedResolution,l=e.getReplayState(r);if(!l.dirty&&l.renderedResolution===a&&l.renderedRevision==s&&l.renderedRenderOrder==o)return;const c=r.getSource(),h=!!r.getDeclutter(),u=c.getTileGrid(),g=c.getTileGridForProjection(i).getTileCoordExtent(e.wrappedTileCoord),f=c.getSourceTiles(t,i,e),p=Y(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],l.dirty=!1;for(let A=0,m=f.length;A<m;++A){const y=f[A];if(y.getState()!=G.LOADED)continue;const E=y.tileCoord,x=u.getTileCoordExtent(E),_=ut(g,x),w=Di(_,r.getRenderBuffer()*a,this.tempExtent),v=Gi(x,_)?null:w,C=new Qg(0,_,a,t),b=Kh(a,t),T=function(R,B){let D;const z=R.getStyleFunction()||r.getStyleFunction();if(z&&(D=z(R,a)),D){const U=this.renderFeature(R,b,D,C,h,B);l.dirty=l.dirty||U}},P=y.getFeatures();o&&o!==l.renderedRenderOrder&&P.sort(o);for(let R=0,B=P.length;R<B;++R){const D=P[R];(!v||Be(v,D.getGeometry().getExtent()))&&T.call(this,D,R)}const M=C.finish(),k=r.getRenderMode()!=="vector"&&h&&f.length===1?null:_,I=new $g(k,a,t,c.getOverlaps(),M,r.getRenderBuffer(),!0);e.executorGroups[p].push(I)}l.renderedRevision=s,l.renderedRenderOrder=o,l.renderedResolution=a}forEachFeatureAtCoordinate(e,t,i,r,s){var E,x;const o=t.viewState.resolution,a=t.viewState.rotation;i=i??0;const l=this.getLayer(),h=l.getSource().getTileGridForProjection(t.viewState.projection),u=ht([e]);Di(u,o*i,u);const d={},g=function(_,w,v){let C=_.getId();C===void 0&&(C=Y(_));const b=d[C];if(b){if(b!==!0&&v<b.distanceSq){if(v===0)return d[C]=!0,s.splice(s.lastIndexOf(b),1),r(_,l,w);b.geometry=w,b.distanceSq=v}}else{if(v===0)return d[C]=!0,r(_,l,w);s.push(d[C]={feature:_,layer:l,geometry:w,distanceSq:v,callback:r})}},f=this.renderedTiles,p=Y(l),A=l.getDeclutter(),m=A?(x=(E=t.declutter)==null?void 0:E[A])==null?void 0:x.all().map(_=>_.value):null;let y;e:for(let _=0,w=f.length;_<w;++_){const v=f[_],C=h.getTileCoordExtent(v.wrappedTileCoord);if(!Be(C,u))continue;const b=v.executorGroups[p];for(let T=0,P=b.length;T<P;++T)if(y=b[T].forEachFeatureAtCoordinate(e,o,a,i,g,m),y)break e}return y}getFeatures(e){return this.renderedTiles.length===0?Promise.resolve([]):new Promise((t,i)=>{const r=this.getLayer(),s=r.getSource(),o=this.renderedProjection,a=o.getExtent(),l=this.renderedResolution,c=s.getTileGridForProjection(o),h=Ye(this.renderedPixelToCoordinateTransform_,e.slice()),u=c.getTileCoordForCoordAndResolution(h,l).toString(),d=this.renderedTiles.find(E=>E.tileCoord.toString()===u&&E.getState()===G.LOADED);if(!d||d.loadingSourceTiles>0){t([]);return}s.getWrapX()&&o.canWrapX()&&!Oi(a,c.getTileCoordExtent(d.tileCoord))&&Vl(h,o);const g=Y(r),f=c.getTileCoordExtent(d.wrappedTileCoord),p=ei(f),A=[(h[0]-p[0])/l,(p[1]-h[1])/l],m=d.getSourceTiles().reduce((E,x)=>E.concat(x.getFeatures()),[]);let y=d.hitDetectionImageData[g];if(!y){const E=Ke(c.getTileSize(c.getZForResolution(l,s.zDirection))),x=this.renderedRotation_,_=[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),l,0,Lt,E[0]*Lt,E[1]*Lt,0)];y=ep(E,_,m,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,x),d.hitDetectionImageData[g]=y}t(tp(A,m,y))})}getFeaturesInExtent(e){const t=[],i=this.getTileCache();if(i.getCount()===0)return t;const s=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),o=s.getZForResolution(this.renderedResolution),a={};return i.forEach(l=>{if(l.tileCoord[0]!==o||l.getState()!==G.LOADED)return;const c=l.getSourceTiles();for(let h=0,u=c.length;h<u;++h){const d=c[h],g=d.getKey();if(g in a)continue;a[g]=!0;const f=d.tileCoord;if(Be(e,s.getTileCoordExtent(f))){const p=d.getFeatures();if(p)for(let A=0,m=p.length;A<m;++A){const y=p[A],E=y.getGeometry();Be(e,E.getExtent())&&t.push(y)}}}}),t}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){var d;const i=this.context,r=i.globalAlpha;i.globalAlpha=t.opacity;const s=e.viewHints,o=!(s[ke.ANIMATING]||s[ke.INTERACTING]),a=[this.context.canvas.width,this.context.canvas.height],l=this.getLayer().getDeclutter(),c=l?(d=e.declutter)==null?void 0:d[l]:void 0,h=Y(this.getLayer()),u=this.renderedTiles;for(let g=0,f=u.length;g<f;++g){const p=u[g],A=p.executorGroups[h];if(A)for(let m=A.length-1;m>=0;--m)A[m].execute(this.context,a,this.getTileRenderTransform(p,e),e.viewState.rotation,o,Ja,c)}i.globalAlpha=r}renderDeferredInternal(e){const t=this.renderedTiles,i=Y(this.getLayer()),r=t.reduce((l,c,h)=>(c.executorGroups[i].forEach(u=>l.push({executorGroup:u,index:h})),l),[]),s=r.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),o={};for(let l=0,c=r.length;l<c;++l){const h=r[l].executorGroup.getDeferredZIndexContexts();for(const u in h)o[u]=!0}Object.keys(o).map(Number).sort(fi).forEach(l=>{s.forEach((c,h)=>{c[l]&&(c[l].forEach(u=>{const{executorGroup:d,index:g}=r[h],f=d.getRenderedContext(),p=f.globalAlpha;f.globalAlpha=this.renderedOpacity_;const A=this.tileClipContexts_[g];A&&A.draw(f),u.draw(f),A&&f.restore(),f.globalAlpha=p,u.clear()}),c[l].length=0)})})}getTileRenderTransform(e,t){const i=t.pixelRatio,r=t.viewState,s=r.center,o=r.resolution,a=r.rotation,l=t.size,c=Math.round(l[0]*i),h=Math.round(l[1]*i),d=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),g=e.tileCoord,f=d.getTileCoordExtent(e.wrappedTileCoord),p=d.getTileCoordExtent(g,this.tempExtent)[0]-f[0];return ec(ic(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,o,a,i,c,h,p))}postRender(e,t){var _;const i=t.viewHints,r=!(i[ke.ANIMATING]||i[ke.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),c=l?Fp[o].filter(w=>!Ja.includes(w)):Fp[o],h=t.viewState,u=h.rotation,d=s.getSource(),f=d.getTileGridForProjection(h.projection).getZForResolution(h.resolution,d.zDirection),p=this.renderedTiles,A=[],m=[],y=[],E=Y(s);let x=!0;for(let w=p.length-1;w>=0;--w){const v=p[w];x=x&&!v.getReplayState(s).dirty;const C=v.executorGroups[E].filter(R=>R.hasExecutors(c));if(C.length===0)continue;const b=this.getTileRenderTransform(v,t),T=v.tileCoord[0];let P=!1;const M=C[0].getClipCoords(b);let k=e,I;if(M){I=new Qh,k=I.getContext();for(let R=0,B=A.length;R<B;++R)if(f!==T&&T<m[R]){const D=A[R];Be([M[0],M[3],M[4],M[7]],[D[0],D[3],D[4],D[7]])&&(P||(k.save(),P=!0),k.beginPath(),k.moveTo(M[0],M[1]),k.lineTo(M[2],M[3]),k.lineTo(M[4],M[5]),k.lineTo(M[6],M[7]),k.moveTo(D[6],D[7]),k.lineTo(D[4],D[5]),k.lineTo(D[2],D[3]),k.lineTo(D[0],D[1]),k.clip())}A.push(M),m.push(T)}for(let R=0,B=C.length;R<B;++R)C[R].execute(e,[e.canvas.width,e.canvas.height],b,u,r,c,(_=t.declutter)==null?void 0:_[l]);P&&(k===e?k.restore():y[w]=I)}e.globalAlpha=a,this.ready=x,this.tileClipContexts_=y,t.declutter||this.renderDeferredInternal(t),super.postRender(e,t)}renderFeature(e,t,i,r,s,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let l=0,c=i.length;l<c;++l)a=Za(r,e,i[l],t,this.boundHandleStyleImageChange_,void 0,s,o)||a;else a=Za(r,e,i,t,this.boundHandleStyleImageChange_,void 0,s,o);return a}tileImageNeedsRender_(e){const t=this.getLayer();if(t.getRenderMode()==="vector")return!1;const i=e.getReplayState(t),r=t.getRevision(),s=e.wantedResolution;return i.renderedTileResolution!==s||i.renderedTileRevision!==r}renderTileImage_(e,t){const i=this.getLayer(),r=e.getReplayState(i),s=i.getRevision(),o=e.executorGroups[Y(i)];r.renderedTileRevision=s;const a=e.wrappedTileCoord,l=a[0],c=i.getSource();let h=t.pixelRatio;const d=t.viewState.projection,g=c.getTileGridForProjection(d),f=g.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*f,A=g.getResolution(l),m=e.getContext();h=Math.round(Math.max(h,p/h));const y=c.getTilePixelSize(l,h,d);m.canvas.width=y[0],m.canvas.height=y[1];const E=h/p;if(E!==1){const v=kd(this.tmpTransform_);ic(v,E,E),m.setTransform.apply(m,v)}const x=g.getTileCoordExtent(a,this.tempExtent),_=p/A,w=kd(this.tmpTransform_);ic(w,_,-_),sy(w,-x[0],-x[3]);for(let v=0,C=o.length;v<C;++v)o[v].execute(m,[m.canvas.width*E,m.canvas.height*E],w,0,!0,Mw[i.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}}class cr extends eh{constructor(e){e=e||{};const t=Object.assign({},e);delete t.preload;const i=e.cacheSize===void 0?0:e.cacheSize;delete e.cacheSize,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=i;const r=e.renderMode||"hybrid";ge(r=="hybrid"||r=="vector","`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=r,this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0),this.getBackground,this.setBackground}createRenderer(){return new Fw(this,{cacheSize:this.cacheSize_})}getFeatures(e){return super.getFeatures(e)}getFeaturesInExtent(e){return this.getRenderer().getFeaturesInExtent(e)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(Rn.PRELOAD)}getUseInterimTilesOnError(){return this.get(Rn.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(Rn.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(Rn.USE_INTERIM_TILES_ON_ERROR,e)}}function vu(n){return Array.isArray(n)?Math.min(...n):n}class Lw extends Hc{constructor(e,t,i,r,s,o,a){let l=e.getExtent();l&&e.canWrapX()&&(l=l.slice(),l[0]=-1/0,l[2]=1/0);let c=t.getExtent();c&&t.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);const h=c?ut(i,c):i,u=It(h),d=yu(e,t,u,r),g=xu,f=new _u(e,t,h,l,d*g,r),p=f.calculateSourceExtent(),A=jn(p)?null:o(p,d,s),m=A?V.IDLE:V.EMPTY,y=A?A.getPixelRatio():1;super(i,r,y,m),this.targetProj_=t,this.maxSourceExtent_=l,this.triangulation_=f,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=A,this.sourcePixelRatio_=y,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==V.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==V.LOADED){const t=ne(this.targetExtent_)/this.targetResolution_,i=De(this.targetExtent_)/this.targetResolution_;this.canvas_=Tp(t,i,this.sourcePixelRatio_,vu(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=e,this.changed()}load(){if(this.state==V.IDLE){this.state=V.LOADING,this.changed();const e=this.sourceImage_.getState();e==V.LOADED||e==V.ERROR?this.reproject_():(this.sourceListenerKey_=oe(this.sourceImage_,H.CHANGE,t=>{const i=this.sourceImage_.getState();(i==V.LOADED||i==V.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){ve(this.sourceListenerKey_),this.sourceListenerKey_=null}}const hl=4,Cu={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class kw extends Tt{constructor(e,t){super(e),this.image=t}}class Lp extends $r{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate!==void 0?e.interpolate:!0}),this.on,this.once,this.un,this.loader=e.loader||null,this.resolutions_=e.resolutions!==void 0?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=e.loader?e.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(e){this.resolutions_=e}findNearestResolution(e){const t=this.getResolutions();if(t){const i=Io(t,e,0);e=t[i]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||ti(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&ti(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&Gi(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Lw(s,r,e,t,i,(o,a,l)=>this.getImageInternal(o,a,l,s),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,i,r){if(this.loader){const s=Dw(e,t,i,1),o=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&Oi(this.wantedExtent_,s)||Oi(this.image.getExtent(),s))&&(this.wantedResolution_&&vu(this.wantedResolution_)===o||vu(this.image.getResolution())===o)))return this.image;this.wantedProjection_=r,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new Hc(s,o,i,this.loader),this.image.addEventListener(H.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case V.LOADING:this.loading=!0,i=Cu.IMAGELOADSTART;break;case V.LOADED:this.loading=!1,i=Cu.IMAGELOADEND;break;case V.ERROR:this.loading=!1,i=Cu.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new kw(i,t))}}function Dw(n,e,t,i){const r=e/t,s=It(n),o=ln(ne(n)/r,hl),a=ln(De(n)/r,hl),l=ln((i-1)*o/2,hl),c=o+2*l,h=ln((i-1)*a/2,hl),u=a+2*h;return Oo(s,r,0,[c,u])}const cs=[0,0,0],Sn=5;class ul{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,ge(nm(this.resolutions_,(r,s)=>s-r),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let r=0,s=this.resolutions_.length-1;r<s;++r)if(!t)t=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,ge(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=ei(i)),ge(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,ge(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:_c,ge(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((r,s)=>{const o=new eu(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,t,i){const r=this.getTileRangeForExtentAndZ(e,t);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,l=r.maxY;a<=l;++a)i([t,s,a])}forEachTileCoordParentTileRange(e,t,i,r){let s,o,a,l=null,c=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=ns(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,c,i),t(c,s))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,i){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const s=e[1]*2,o=e[2]*2;return ns(s,s+1,o,o+1,t)}const r=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,i){if(t>this.maxZoom||t<this.minZoom)return null;const r=e[0],s=e[1],o=e[2];if(t===r)return ns(s,o,s,o,i);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-r),c=Math.floor(s*l),h=Math.floor(o*l);if(t<r)return ns(c,c,h,h,i);const u=Math.floor(l*(s+1))-1,d=Math.floor(l*(o+1))-1;return ns(c,u,h,d,i)}const a=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t,i)}getTileRangeForExtentAndZ(e,t,i){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,cs);const r=cs[1],s=cs[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,cs);const o=cs[1],a=cs[2];return ns(r,o,s,a,i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=Ke(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*i,t[1]-(e[2]+.5)*r[1]*i]}getTileCoordExtent(e,t){const i=this.getOrigin(e[0]),r=this.getResolution(e[0]),s=Ke(this.getTileSize(e[0]),this.tmpSize_),o=i[0]+e[1]*s[0]*r,a=i[1]-(e[2]+1)*s[1]*r,l=o+s[0]*r,c=a+s[1]*r;return Ai(o,a,l,c,t)}getTileCoordForCoordAndResolution(e,t,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,i)}getTileCoordForXYAndResolution_(e,t,i,r,s){const o=this.getZForResolution(i),a=i/this.getResolution(o),l=this.getOrigin(o),c=Ke(this.getTileSize(o),this.tmpSize_);let h=a*(e-l[0])/i/c[0],u=a*(l[1]-t)/i/c[1];return r?(h=ln(h,Sn)-1,u=ln(u,Sn)-1):(h=Lo(h,Sn),u=Lo(u,Sn)),ll(o,h,u,s)}getTileCoordForXYAndZ_(e,t,i,r,s){const o=this.getOrigin(i),a=this.getResolution(i),l=Ke(this.getTileSize(i),this.tmpSize_);let c=(e-o[0])/a/l[0],h=(o[1]-t)/a/l[1];return r?(c=ln(c,Sn)-1,h=ln(h,Sn)-1):(c=Lo(c,Sn),h=Lo(h,Sn)),ll(i,c,h,s)}getTileCoordForCoordAndZ(e,t,i){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,i)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const i=Io(this.resolutions_,e,t||0);return Pe(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return Yd(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const t=this.resolutions_.length,i=new Array(t);for(let r=this.minZoom;r<t;++r)i[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=i}}function bu(n){let e=n.getDefaultTileGrid();return e||(e=Bw(n),n.setDefaultTileGrid(e)),e}function Ow(n,e,t){const i=e[0],r=n.getTileCoordCenter(e),s=Eo(t);if(!Nn(s,r)){const o=ne(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}return e}function Gw(n,e,t,i){i=i!==void 0?i:"top-left";const r=kp(n,e,t);return new ul({extent:n,origin:mm(n,i),resolutions:r,tileSize:t})}function dl(n){const e=n||{},t=e.extent||pe("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:kp(t,e.maxZoom,e.tileSize,e.maxResolution)};return new ul(i)}function kp(n,e,t,i){e=e!==void 0?e:$d,t=Ke(t!==void 0?t:_c);const r=De(n),s=ne(n);i=i>0?i:Math.max(s/t[0],r/t[1]);const o=e+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=i/Math.pow(2,l);return a}function Bw(n,e,t,i){const r=Eo(n);return Gw(r,e,t,i)}function Eo(n){n=pe(n);let e=n.getExtent();if(!e){const t=180*cn.degrees/n.getMetersPerUnit();e=Ai(-t,-t,t,t)}return e}class Tu extends $r{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const t=[256,256];this.tileGrid&&Ke(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tmpSize=[0,0],this.key_=e.key||Y(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,i,r,s){return Q()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:bu(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(t),o=Ke(r.getTileSize(e),this.tmpSize);return s==1?o:y0(o,s,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){const i=t!==void 0?t:this.getProjection(),r=t!==void 0?this.getTileGridForProjection(i):this.tileGrid||this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=Ow(r,e,i)),Sw(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class Dp extends Tt{constructor(e,t){super(e),this.tile=t}}function Op(n){return function(e){const t=e.buffers,i=e.meta,r=e.imageOps,s=e.width,o=e.height,a=t.length,l=t[0].byteLength;if(r){const d=new Array(a);for(let f=0;f<a;++f)d[f]=new ImageData(new Uint8ClampedArray(t[f]),s,o);return n(d,i).data.buffer}const c=new Uint8ClampedArray(l),h=new Array(a),u=new Array(a);for(let d=0;d<a;++d)h[d]=new Uint8ClampedArray(t[d]),u[d]=[0,0,0,0];for(let d=0;d<l;d+=4){for(let f=0;f<a;++f){const p=h[f];u[f][0]=p[d],u[f][1]=p[d+1],u[f][2]=p[d+2],u[f][3]=p[d+3]}const g=n(u,i);c[d]=g[0],c[d+1]=g[1],c[d+2]=g[2],c[d+3]=g[3]}return c.buffer}}function Nw(n,e){const i=Object.keys(n.lib||{}).map(function(s){return"const "+s+" = "+n.lib[s].toString()+";"}).concat(["const __minion__ = ("+Op.toString()+")(",n.operation.toString(),");",'self.addEventListener("message", function(event) {'," const buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker(typeof Blob>"u"?"data:text/javascript;base64,"+Buffer.from(i.join(`
|
|
38
|
+
`),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function jw(n,e){const t=Op(n.operation);let i=!1;return{postMessage:function(r){setTimeout(function(){i||e({data:{buffer:t(r),meta:r.meta}})},0)},terminate:function(){i=!0}}}class zw extends Cs{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;e.threads===0?t=0:this.imageOps_?t=1:t=e.threads||1;const i=new Array(t);if(t)for(let r=0;r<t;++r)i[r]=Nw(e,this.onWorkerMessage_.bind(this,r));else i[0]=jw(e,this.onWorkerMessage_.bind(this,0));this.workers_=i,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,i){this.enqueue_({inputs:e,meta:t,callback:i}),this.dispatch_()}enqueue_(e){for(this.queue_.push(e);this.queue_.length>this.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||this.queue_.length===0)return;const e=this.queue_.shift();this.job_=e;const t=e.inputs[0].width,i=e.inputs[0].height,r=e.inputs.map(function(l){return l.data.buffer}),s=this.workers_.length;if(this.running_=s,s===1){this.workers_[0].postMessage({buffers:r,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},r);return}const o=e.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let l=0;l<s;++l){const c=l*a,h=[];for(let u=0,d=r.length;u<d;++u)h.push(r[u].slice(c,c+a));this.workers_[l].postMessage({buffers:h,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},h)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){const e=this.job_,t=this.workers_.length;let i,r;if(t===1)i=new Uint8ClampedArray(this.dataLookup_[0].buffer),r=this.dataLookup_[0].meta;else{const s=e.inputs[0].data.length;i=new Uint8ClampedArray(s),r=new Array(t);const o=4*Math.ceil(s/4/t);for(let a=0;a<t;++a){const l=this.dataLookup_[a].buffer,c=a*o;i.set(new Uint8ClampedArray(l),c),r[a]=this.dataLookup_[a].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(i,e.inputs[0].width,e.inputs[0].height),r),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}}const Gp={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"};class Bp extends Tt{constructor(e,t,i){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=i}}class Np extends Lp{constructor(e){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType!==void 0?e.operationType:"pixel",this.threads_=e.threads!==void 0?e.threads:1,this.layers_=Ww(e.sources);const t=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(H.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new ad(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:mt(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:Vw(this.layers_),pixelRatio:1,pixelToCoordinateTransform:mt(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:Y(this),renderTargets:{}},this.setAttributions(function(i){var s;const r=[];for(let o=0,a=e.sources.length;o<a;++o){const l=e.sources[o],c=l instanceof $r?l:l.getSource();if(!c)continue;const h=(s=c.getAttributions())==null?void 0:s(i);typeof h=="string"?r.push(h):h!==void 0&&r.push(...h)}return r}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new zw({operation:e,imageOps:this.operationType_==="image",queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,i){const r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);const s=It(e);r.size[0]=Math.ceil(ne(e)/t),r.size[1]=Math.ceil(De(e)/t),r.extent=[s[0]-r.size[0]*t/2,s[1]-r.size[1]*t/2,s[0]+r.size[0]*t/2,s[1]+r.size[1]*t/2],r.time=Date.now();const o=r.viewState;return o.center=s,o.projection=i,o.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let i=0,r=this.layers_.length;i<r;++i)if(t=this.layers_[i].getSource(),!t||t.getState()!=="ready"){e=!1;break}return e}getImage(e,t,i,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);const s=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=s,this.renderedImageCanvas_){const o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();(t!==o||!Gi(s.extent,a))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),s.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const e=this.requestedFrameState_,t=this.layers_.length,i=new Array(t);for(let s=0;s<t;++s){e.layerIndex=s,e.renderTargets={};const o=Uw(this.layers_[s],e);if(o)i[s]=o;else return}const r={};this.dispatchEvent(new Bp(Gp.BEFOREOPERATIONS,e,r)),this.processor_.process(i,r,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,i,r){if(t||!i)return;const s=e.extent,o=e.viewState.resolution;if(o!==this.requestedFrameState_.viewState.resolution||!Gi(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const l=Math.round(ne(s)/o),c=Math.round(De(s)/o);a=Fe(l,c),this.renderedImageCanvas_=new L1(s,o,1,a.canvas)}a.putImageData(i,0,0),e.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Bp(Gp.AFTEROPERATIONS,e,r))}getResolutions(e){if(!this.useResolutions_)return null;let t=super.getResolutions();if(!t)for(let i=0,r=this.layers_.length;i<r&&(t=this.layers_[i].getSource().getResolutions(e),!t);++i);return t}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}Np.prototype.dispose;let hr=null;function Uw(n,e){const t=n.getRenderer();if(!t)throw new Error("Unsupported layer type: "+n);if(!t.prepareFrame(e))return null;const i=e.size[0],r=e.size[1];if(i===0||r===0)return null;const s=t.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===i&&o.height===r)return o.getContext("2d").getImageData(0,0,i,r)}if(!hr)hr=Fe(i,r,void 0,{willReadFrequently:!0});else{const a=hr.canvas;a.width!==i||a.height!==r?hr=Fe(i,r,void 0,{willReadFrequently:!0}):hr.clearRect(0,0,i,r)}return hr.drawImage(o,0,0,i,r),hr.getImageData(0,0,i,r)}function Vw(n){return n.map(function(e){return e.getLayerState()})}function Ww(n){const e=n.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=Hw(n[i]);return t}function Hw(n){let e;return n instanceof $r?n instanceof Tu?e=new cl({source:n}):n instanceof Lp&&(e=new vp({source:n})):e=n,e}function Xw(n,e,t,i){const r=document.createElement("script"),s="olc_"+Y(e);function o(){delete window[s],r.parentNode.removeChild(r)}r.async=!0,r.src=n+(n.includes("?")?"&":"?")+"callback="+s;const a=setTimeout(function(){o(),t&&t()},1e4);window[s]=function(l){clearTimeout(a),o(),e(l)},document.head.appendChild(r)}const Yw=/\{z\}/g,Kw=/\{x\}/g,Zw=/\{y\}/g,Qw=/\{-y\}/g;function jp(n,e,t,i,r){return n.replace(Yw,e.toString()).replace(Kw,t.toString()).replace(Zw,i.toString()).replace(Qw,function(){if(r===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(r-i).toString()})}function qw(n,e,t,i){const r=Ip(e,t,i),s=an(r,n.length);return n[s]}function zp(n){const e=[];let t=/\{([a-z])-([a-z])\}/.exec(n);if(t){const i=t[1].charCodeAt(0),r=t[2].charCodeAt(0);let s;for(s=i;s<=r;++s)e.push(n.replace(t[0],String.fromCharCode(s)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){const i=parseInt(t[2],10);for(let r=parseInt(t[1],10);r<=i;r++)e.push(n.replace(t[0],r.toString()));return e}return e.push(n),e}function Jw(n,e){return function(t,i,r){if(!t)return;let s;const o=t[0];if(e){const a=e.getFullTileRange(o);a&&(s=a.getHeight()-1)}return jp(n,o,t[1],t[2],s)}}function Up(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=Jw(n[r],e);return $w(i)}function $w(n){return n.length===1?n[0]:function(e,t,i){if(!e)return;const r=Rw(e),s=an(r,n.length);return n[s](e,t,i)}}const hs={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class fl extends Tu{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===fl.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const t=e.target,i=Y(t),r=t.getState();let s;r==G.LOADING?(this.tileLoadingKeys_[i]=!0,s=hs.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==G.ERROR?hs.TILELOADERROR:r==G.LOADED?hs.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new Dp(s,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,typeof t<"u"?this.setKey(t):this.changed()}setUrl(e){const t=zp(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
|
|
39
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Up(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,i){}}class ev extends fl{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:tv,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:np,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!ti(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||ti(t,e)))return this.tileGrid;const i=Y(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=bu(e)),this.tileGridForProjection[i]}createTile_(e,t,i,r,s,o){const a=[e,t,i],l=this.getTileCoordForTileUrlFunction(a,s),c=l?this.tileUrlFunction(l,r,s):void 0,h=new this.tileClass(a,c!==void 0?G.IDLE:G.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(H.CHANGE,this.handleTileChange.bind(this)),h}getTile(e,t,i,r,s){const o=this.getProjection();if(!o||!s||ti(o,s))return this.getTileInternal(e,t,i,r,o||s);const a=[e,t,i],l=this.getKey(),c=this.getTileGridForProjection(o),h=this.getTileGridForProjection(s),u=this.getTileCoordForTileUrlFunction(a,s),d=new Sp(o,c,s,h,a,u,this.getTilePixelRatio(r),this.getGutter(),(g,f,p,A)=>this.getTileInternal(g,f,p,A,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(e,t,i,r,s){const o=this.getKey();return this.createTile_(e,t,i,r,s,o)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){const i=pe(e);if(i){const r=Y(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}function tv(n,e){n.getImage().src=e}class Vp extends ev{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:pe("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:"loading",tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)Xw(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",e.url),t.send()}else if(e.tileJSON)this.handleTileJSONResponse(e.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(i)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=pe("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const c=Os(t,i);r=xm(e.bounds,c)}const s=Eo(i),o=e.minzoom||0,a=e.maxzoom||22,l=dl({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Up(e.tiles,l),e.attribution&&!this.getAttributions()){const c=r!==void 0?r:s;this.setAttributions(function(h){return Be(c,h.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}class Wp extends fl{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||Eo(t),r=e.tileGrid||dl({extent:i,maxResolution:e.maxResolution,maxZoom:e.maxZoom!==void 0?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,projection:t,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Hp,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection===void 0?1:e.zDirection}),this.format_=e.format?e.format:null,this.tileKeysBySourceTileUrl_={},this.sourceTiles_={},this.overlaps_=e.overlaps==null?!0:e.overlaps,this.tileClass=e.tileClass?e.tileClass:sp,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,i){if(i.getState()===G.IDLE){i.setState(G.LOADING);const r=i.wrappedTileCoord,s=this.getTileGridForProjection(t),o=s.getTileCoordExtent(r),a=r[0],l=s.getResolution(a);Di(o,-l,o);const c=this.tileGrid,h=c.getExtent();h&&ut(o,h,o);const u=c.getZForResolution(l,this.zDirection);c.forEachTileCoord(o,u,d=>{const g=this.tileUrlFunction(d,e,t);this.sourceTiles_[g]||(this.sourceTiles_[g]=new this.tileClass(d,g?G.IDLE:G.EMPTY,g,this.format_,this.tileLoadFunction));const f=this.sourceTiles_[g];i.sourceTiles.push(f),this.tileKeysBySourceTileUrl_[g]||(this.tileKeysBySourceTileUrl_[g]=[]),this.tileKeysBySourceTileUrl_[g].push(i.getKey());const p=f.getState();if(p<G.LOADED){const A=m=>{this.handleTileChange(m);const y=f.getState();if(y===G.LOADED||y===G.ERROR){const E=f.getKey();E in i.errorTileKeys?f.getState()===G.LOADED&&delete i.errorTileKeys[E]:i.loadingSourceTiles--,y===G.ERROR?i.errorTileKeys[E]=!0:f.removeEventListener(H.CHANGE,A),i.loadingSourceTiles===0&&i.setState(rn(i.errorTileKeys)?G.LOADED:G.ERROR)}};f.addEventListener(H.CHANGE,A),i.loadingSourceTiles++}p===G.IDLE&&(f.extent=c.getTileCoordExtent(d),f.projection=t,f.resolution=c.getResolution(d[0]),f.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(d=>d.getState()===G.ERROR)?G.ERROR:G.LOADED)}return i.sourceTiles}removeSourceTiles(e){const t=e.getKey(),i=e.sourceTiles;for(let r=0,s=i.length;r<s;++r){const o=i[r].getTileUrl();if(!this.tileKeysBySourceTileUrl_[o])return;const a=this.tileKeysBySourceTileUrl_[o].indexOf(t);a!==-1&&(this.tileKeysBySourceTileUrl_[o].splice(a,1),this.tileKeysBySourceTileUrl_[o].length===0&&(delete this.tileKeysBySourceTileUrl_[o],delete this.sourceTiles_[o]))}}getTile(e,t,i,r,s){const o=[e,t,i];let a=this.getTileCoordForTileUrlFunction(o,s);const l=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(s);if(a&&l){const d=c.getTileCoordExtent(a);Di(d,-c.getResolution(e),d),Be(l,d)||(a=null)}let h=!0;if(a!==null){const d=this.tileGrid,g=c.getResolution(e),f=d.getZForResolution(g,1),p=c.getTileCoordExtent(a);Di(p,-g,p),d.forEachTileCoord(p,f,A=>{h=h&&!this.tileUrlFunction(A,r,s)})}const u=new D1(o,h?G.EMPTY:G.IDLE,a,this.getSourceTiles.bind(this,r,s),this.removeSourceTiles.bind(this));return u.key=this.getKey(),u}getTileGridForProjection(e){const t=e.getCode();let i=this.tileGrids_[t];if(!i){const r=this.getProjection();ge(r===null||ti(r,e),"A VectorTile source can only be rendered if it has a projection compatible with the view projection.");const s=this.tileGrid,o=s.getResolutions().slice(),a=o.map(function(h,u){return s.getOrigin(u)}),l=o.map(function(h,u){return s.getTileSize(u)}),c=$d+1;for(let h=o.length;h<c;++h)o.push(o[h-1]/2),a.push(a[h-1]),l.push(l[h-1]);i=new ul({extent:s.getExtent(),origins:a,resolutions:o,tileSizes:l}),this.tileGrids_[t]=i}return i}getTilePixelRatio(e){return e}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=Ke(r.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}}function Hp(n,e){n.setLoader(function(t,i,r){Hg(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}function iv(n,e){const t=n[0],i=t.width,r=t.height,s=t.data,o=new Uint8ClampedArray(s.length),a=e.resolution*2,l=i-1,c=r-1,h=[0,0,0,0],u=2*Math.PI,d=Math.PI/2,g=Math.PI*e.sunEl/180,f=Math.PI*e.sunAz/180,p=Math.cos(g),A=Math.sin(g),m=e.highlightColor,y=e.shadowColor,E=e.accentColor,x=e.encoding;let _,w,v,C,b,T,P,M,k,I,R,B,D,z,U,S,X,O,Z,ce,J,he;function me(Ee,Me="mapbox"){if(Me==="mapbox")return(Ee[0]*256*256+Ee[1]*256+Ee[2])*.1-1e4;if(Me==="terrarium")return Ee[0]*256+Ee[1]+Ee[2]/256-32768}for(w=0;w<=c;++w)for(b=w===0?0:w-1,T=w===c?c:w+1,_=0;_<=l;++_)v=_===0?0:_-1,C=_===l?l:_+1,P=(w*i+v)*4,h[0]=s[P],h[1]=s[P+1],h[2]=s[P+2],h[3]=s[P+3],M=e.vert*me(h,x),P=(w*i+C)*4,h[0]=s[P],h[1]=s[P+1],h[2]=s[P+2],h[3]=s[P+3],k=e.vert*me(h,x),I=(k-M)/a,P=(b*i+_)*4,h[0]=s[P],h[1]=s[P+1],h[2]=s[P+2],h[3]=s[P+3],M=e.vert*me(h,x),P=(T*i+_)*4,h[0]=s[P],h[1]=s[P+1],h[2]=s[P+2],h[3]=s[P+3],k=e.vert*me(h,x),R=(k-M)/a,D=Math.atan2(R,-I),D<0?D=d-D:D>d?D=u-D+d:D=d-D,B=Math.atan(Math.sqrt(I*I+R*R)),he=A*Math.cos(B)+p*Math.sin(B)*Math.cos(f-D),z=Math.cos(B),U=255*he,Z=Math.min(Math.max(2*e.sunEl,0),1),ce=1.875-e.opacity*1.75,J=e.opacity!==.5?d*((Math.pow(ce,B)-1)/(Math.pow(ce,d)-1)):B,X={r:(1-z)*E.r*Z*255,g:(1-z)*E.g*Z*255,b:(1-z)*E.b*Z*255,a:(1-z)*E.a*Z*255},S=Math.abs(((D+f)/Math.PI+.5)%2-1),O={r:(m.r*(1-S)+y.r*S)*U,g:(m.g*(1-S)+y.g*S)*U,b:(m.b*(1-S)+y.b*S)*U,a:(m.a*(1-S)+y.a*S)*U},P=(w*i+_)*4,o[P]=X.r*(1-S)+O.r,o[P+1]=X.g*(1-S)+O.g,o[P+2]=X.b*(1-S)+O.b,o[P+3]=s[P+3]*e.opacity*Z*Math.sin(J);return new ImageData(o,i,r)}function nv(n,e=512){return n.getExtent()?dl({extent:n.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Ti}function Xp(n,e){return e.accessToken||(e=Object.assign({},e),new URL(n).searchParams.forEach((i,r)=>{e.accessToken=i,e.accessTokenParam=r})),e}function rv(n,e,t="",i={},r=void 0){let s,o,a,l,c=!0;return typeof t!="string"&&!Array.isArray(t)?(a=t,l=a.source||a.layers,i=a):l=t,typeof i=="string"?(s=i,a={}):(s=i.styleUrl,a=i),a.updateSource===!1&&(c=!1),r||(r=a.resolutions),!s&&typeof e=="string"&&!e.trim().startsWith("{")&&(s=e),s&&(s=s.startsWith("data:")?location.href:$a(s,a.accessToken),a=Xp(s,a)),new Promise(function(h,u){up(e,a).then(function(d){if(d.version!=8)return u(new Error("glStyle version 8 required."));if(!(n instanceof bn||n instanceof cr))return u(new Error("Can only apply to VectorLayer or VectorTileLayer"));const g=n instanceof cr?"vector":"geojson";if(l?Array.isArray(l)?o=d.layers.find(function(x){return x.id===l[0]}).source:o=l:(o=d.layers.find(function(x){return x.source&&d.sources[x.source].type===g}).source,l=o),!o)return u(new Error(`No ${g} source found in the glStyle.`));function f(){if(!c)return Promise.resolve();if(n instanceof cr)return Ru(d.sources[o],s,a).then(function(v){const C=n.getSource();C?v!==C&&(C.setTileUrlFunction(v.getTileUrlFunction()),typeof C.setUrls=="function"&&typeof v.getUrls=="function"&&C.setUrls(v.getUrls()),C.format_||(C.format_=v.format_),C.getAttributions()||C.setAttributions(v.getAttributions()),C.getTileLoadFunction()===Hp&&C.setTileLoadFunction(v.getTileLoadFunction()),ti(C.getProjection(),v.getProjection())&&(C.tileGrid=v.getTileGrid())):n.setSource(v);const b=n.getSource().getTileGrid();!isFinite(n.getMaxResolution())&&!isFinite(n.getMinZoom())&&b.getMinZoom()>0&&n.setMaxResolution(_o(Math.max(0,b.getMinZoom()-1e-12),b.getResolutions()))});const x=d.sources[o];let _=n.getSource();(!_||_.get("mapbox-source")!==x)&&(_=Su(x,s,a));const w=n.getSource();return w?_!==w&&(w.getAttributions()||w.setAttributions(_.getAttributions()),w.format_||(w.format_=_.getFormat()),w.url_=_.getUrl()):n.setSource(_),Promise.resolve()}let p,A;const m={},y={};function E(){if(!A&&(!d.sprite||m)){if(a.projection&&!r){const _=pe(a.projection).getUnits();_!=="m"&&(r=Ti.map(w=>w/cn[_]))}A=fu(n,d,l,r,m,y,(x,_=a.webfonts)=>U1(x,_),a.getImage),n.getStyle()?f().then(h).catch(u):u(new Error(`Nothing to show for source [${o}]`))}else A?(n.setStyle(A),f().then(h).catch(u)):u(new Error("Something went wrong trying to apply style."))}if(d.sprite){const x=O1(d.sprite,a.accessToken,s||location.href);p=window.devicePixelRatio>=1.5?.5:1;const _=p==.5?"@2x":"";Promise.all(x.map(function(w){const v=new URL(w.url);let C=v.origin+v.pathname+_+".json"+v.search;return new Promise(function(b,T){ss("Sprite",C,a).then(b).catch(function(P){C=v.origin+v.pathname+".json"+v.search,ss("Sprite",C,a).then(b).catch(T)})}).then(function(b){b===void 0&&u(new Error("No sprites found."));let T;if(T=v.origin+v.pathname+_+".png"+v.search,a.transformRequest){const P=a.transformRequest(T,"SpriteImage")||T;(P instanceof Request||P instanceof Promise)&&(T=P)}y[w.id]=T;for(const P in b){const M=w.id=="default"?P:`${w.id}:${P}`;m[M]=b[P]}}).catch(function(b){u(new Error(`Sprites cannot be loaded: ${C}: ${b.message}`))})})).then(E).catch(u)}else E()}).catch(u)})}function Yp(n,e){let t;return n.some(function(i){if(i.id==e)return t=i.source,!0}),t}function sv(n,e){const t=n.bounds;if(t){const i=Wo([t[0],t[1]],e),r=Wo([t[2],t[3]],e);return[i[0],i[1],r[0],r[1]]}return pe(e).getExtent()}function Kp(n,e,t){const i=new Vp({tileJSON:e,tileSize:n.tileSize||e.tileSize||512}),r=i.getTileJSON(),s=i.getTileGrid(),o=pe(t.projection||"EPSG:3857"),a=sv(r,o),l=o.getExtent(),c=r.minzoom||0,h=r.maxzoom||22,u={attributions:i.getAttributions(),projection:o,tileGrid:new ul({origin:l?ei(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:nv(o,e.tileSize).slice(0,h+1),tileSize:s.getTileSize(0)})};return Array.isArray(r.tiles)?u.urls=r.tiles:u.url=r.tiles,u}function ov(n,e,t,i){const r={id:n.id,type:n.type},s=n.layout||{},o=n.paint||{};r.paint=o,kt.zoom=ou(e,t.resolutions||Ti),kt.distanceFromCenter=0;let a;const l=W(r,"paint","background-color",li,i);return o["background-opacity"]!==void 0&&(a=W(r,"paint","background-opacity",li,i)),s.visibility=="none"?void 0:Tn(l,a)}function av(n,e,t){const i=document.createElement("div");return i.className="ol-mapbox-style-background",i.style.position="absolute",i.style.width="100%",i.style.height="100%",new Dr({source:new $r({}),render(r){const s=ov(n,r.viewState.resolution,e,t);return i.style.backgroundColor=s,i}})}function Ru(n,e,t){return new Promise(function(i,r){fp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=Kp(n,s,t);a.tileLoadFunction=o,a.format=new uw({layerName:"mvt:layer"});const l=new Wp(a);l.set("mapbox-source",n),i(l)}).catch(r)})}function lv(n,e,t){const i=new cr({declutter:!0,visible:!1});return Ru(n,e,t).then(function(r){i.setSource(r)}).catch(function(r){i.setSource(void 0)}),i}function Zp(n){return`{bbox-${(n?n.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function Qp(n,e,t){return new Promise(function(i,r){fp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=new Vp({interpolate:t.interpolate===void 0?!0:t.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:s});a.tileGrid=Kp(n,s,t).tileGrid,t.projection&&(a.projection=pe(t.projection));const l=a.getTileUrlFunction();o&&a.setTileLoadFunction(o),a.setTileUrlFunction(function(c,h,u){const d=Zp(u);let g=l(c,h,u);if(g.indexOf(d)!=-1){const f=a.getTileGrid().getTileCoordExtent(c);g=g.replace(d,f.toString())}return g}),a.set("mapbox-source",n),i(a)}).catch(function(s){r(s)})})}function qp(n,e,t){const i=new cl;return Qp(n,e,t).then(function(r){i.setSource(r)}).catch(function(){i.setSource(void 0)}),i}function cv(n,e,t){const i=qp(n,e,t);return new vp({source:new Np({operationType:"image",operation:iv,sources:[i]})})}function Su(n,e,t){const i=t.projection?new sh({dataProjection:t.projection}):new sh,r=n.data,s={};if(typeof r=="string"){const[a]=el(r,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){const c=(u,d,g)=>{const f=Zp(g);return a.replace(f,`${u.join(",")}`)},h=new En({attributions:n.attribution,format:i,loader:(u,d,g,f,p)=>{const A=typeof c=="function"?c(u,d,g):c;ss("GeoJSON",A,t).then(m=>{const y=h.getFormat().readFeatures(m,{featureProjection:g});h.addFeatures(y),f(y)}).catch(m=>{h.removeLoadedExtent(u),p()})},strategy:A1});return h.set("mapbox-source",n),h}const l=new En({attributions:n.attribution,format:i,url:a,loader:(c,h,u,d,g)=>{ss("GeoJSON",a,t).then(f=>{const p=l.getFormat().readFeatures(f,{featureProjection:u});l.addFeatures(p),d(p)}).catch(f=>{l.removeLoadedExtent(c),g()})}});return l}s.features=i.readFeatures(r,{featureProjection:"EPSG:3857"});const o=new En(Object.assign({attributions:n.attribution,format:i},s));return o.set("mapbox-source",n),o}function hv(n,e,t){return new bn({declutter:!0,source:Su(n,e,t),visible:!1})}function uv(n,e,t){let i=null;return function(r){n.paint&&"raster-opacity"in n.paint&&r.frameState.viewState.zoom!==i&&(i=r.frameState.viewState.zoom,delete t[n.id],dv(n,e,i,t))}}function dv(n,e,t,i){kt.zoom=t,kt.distanceFromCenter=0;const r=W(n,"paint","raster-opacity",li,i);e.setOpacity(r)}function fv(n,e){function t(){const i=e.get("mapbox-style");if(!i)return;const r=Zf(i.layers),s=n.get("mapbox-layers"),o=r.filter(function(a){return s.includes(a.id)}).some(function(a){return!a.layout||!a.layout.visibility||a.layout.visibility==="visible"});n.get("visible")!==o&&n.setVisible(o)}n.on("change",t),t()}function Jp(n,e,t,i){const r=ru(n),s=n.layers,o=t.type,a=t.source||Yp(s,t.ref),l=n.sources[a];let c;if(o=="background")c=av(t,i,r);else if(l.type=="vector")c=lv(l,e,i);else if(l.type=="raster")c=qp(l,e,i),c.setVisible(t.layout?t.layout.visibility!=="none":!0),c.on("prerender",uv(t,c,r));else if(l.type=="geojson")c=hv(l,e,i);else if(l.type=="raster-dem"&&t.type=="hillshade"){const u=cv(l,e,i);c=u,u.getSource().on("beforeoperations",function(d){const g=d.data;g.resolution=ql(i.projection||"EPSG:3857",d.resolution,It(d.extent),"m"),kt.zoom=ou(d.resolution,i.resolutions||Ti),kt.distanceFromCenter=0,g.encoding=l.encoding,g.vert=5*W(t,"paint","hillshade-exaggeration",li,r),g.sunAz=W(t,"paint","hillshade-illumination-direction",li,r),g.sunEl=35,g.opacity=.3,g.highlightColor=W(t,"paint","hillshade-highlight-color",li,r),g.shadowColor=W(t,"paint","hillshade-shadow-color",li,r),g.accentColor=W(t,"paint","hillshade-accent-color",li,r)}),c.setVisible(t.layout?t.layout.visibility!=="none":!0)}const h=a;return c&&c.set("mapbox-source",h),c}function $p(n,e,t,i){const r=[];let s=null;if(e instanceof ya){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const u=i.projection?pe(i.projection):s.getProjection();s=new yi(Object.assign(s.getProperties(),{maxResolution:Ti[0]/cn[u.getUnits()],projection:i.projection||s.getProjection()})),e.setView(s)}"center"in n&&!s.getCenter()&&s.setCenter(Wo(n.center,s.getProjection())),"zoom"in n&&s.getZoom()===void 0&&s.setResolution(Ti[0]/cn[s.getProjection().getUnits()]/Math.pow(2,n.zoom)),(!s.getCenter()||s.getZoom()===void 0)&&s.fit(s.getProjection().getExtent(),{nearest:!0,size:e.getSize()})}e.set("mapbox-style",n),e.set("mapbox-metadata",{styleUrl:t,options:i});const o=n.layers;let a=[],l,c,h;for(let u=0,d=o.length;u<d;++u){const g=o[u],f=g.type;if(f=="heatmap"){console.debug(`layers[${u}].type "${f}" not supported`);continue}else h=g.source||Yp(o,g.ref),(!h||h!=c)&&(a.length&&(r.push(Iu(l,a,n,t,e,i)),a=[]),l=Jp(n,t,g,i),l instanceof bn||l instanceof cr||(a=[]),c=l.get("mapbox-source")),a.push(g.id)}return r.push(Iu(l,a,n,t,e,i)),Promise.all(r)}function eA(n,e,t={}){let i,r;if(typeof n=="string"||n instanceof HTMLElement?r=new ya({target:n}):r=n,typeof e=="string"){const s=e.startsWith("data:")?location.href:$a(e,t.accessToken);t=Xp(s,t),i=new Promise(function(o,a){up(e,t).then(function(l){$p(l,r,s,t).then(function(){o(r)}).catch(a)}).catch(function(l){a(new Error(`Could not load ${e}: ${l.message}`))})})}else i=new Promise(function(s,o){$p(e,r,!t.styleUrl||t.styleUrl.startsWith("data:")?location.href:$a(t.styleUrl,t.accessToken),t).then(function(){s(r)}).catch(o)});return i}function Iu(n,e,t,i,r,s={}){let o=24,a=0;const l=t.layers;for(let c=0,h=l.length;c<h;++c){const u=l[c];e.indexOf(u.id)!==-1&&(o=Math.min("minzoom"in u?u.minzoom:0,o),a=Math.max("maxzoom"in u?u.maxzoom:24,a))}return new Promise(function(c,h){const u=function(){const g=n.getSource();if(!g||g.getState()==="error"){h(new Error("Error accessing data for source "+n.get("mapbox-source")));return}if("getTileGrid"in g){const f=g.getTileGrid();if(f){const p=f.getMinZoom();(o>0||p>0)&&n.setMaxResolution(Math.min(_o(Math.max(0,o-1e-12),Ti),_o(Math.max(0,p-1e-12),f.getResolutions()))),a<24&&n.setMinResolution(_o(a,Ti))}}else o>0&&n.setMaxResolution(_o(Math.max(0,o-1e-12),Ti));g instanceof En||g instanceof Wp?rv(n,t,e,Object.assign({styleUrl:i},s)).then(function(){fv(n,r),c()}).catch(h):c()};n.set("mapbox-layers",e);const d=r.getLayers();d.getArray().indexOf(n)===-1&&d.push(n),n.getSource()?u():n.once("change:source",u)})}function gv(n,e,t){const i=n.get("mapbox-style"),r=i.layers;let s,o=-1;s=r.length;let a;if(s>0&&r[s-1].source===e.source?(o=s-1,a=-1):s<r.length&&r[s].source===e.source&&(o=s,a=0),o===-1){const{options:h,styleUrl:u}=n.get("mapbox-metadata"),d=Jp(i,u,e,h);return r.splice(s,0,e),Iu(d,[e.id],i,u,n,h)}if(r.some(h=>h.id===e.id))throw new Error(`Layer with id "${e.id}" already exists.`);const l=r[o].id,c=du[nu(n.get("mapbox-style"),gl(n,l))];if(r.splice(s,0,e),c){const[h,u,d,g,f,p,A,m]=c;if(Array.isArray(d)){const y=d.indexOf(l)+a;d.splice(y,0,e.id)}fu(h,u,d,g,f,p,A,m)}else gl(n,r[o].id).changed();return Promise.resolve()}function pv(n,e){const t=n.get("mapbox-style"),i=t.layers,r=i.findIndex(function(a){return a.id===e.id});if(r===-1)throw new Error(`Layer with id "${e.id}" not found.`);if(i[r].source!==e.source)throw new Error("Updated layer and previous version must use the same source.");delete ru(t)[e.id],delete hp(t)[e.id],i[r]=e;const o=du[nu(n.get("mapbox-style"),gl(n,e.id))];o?fu.apply(void 0,o):gl(n,e.id).changed()}function Av(n,e,t){const i=iA(n,e),r=n.getLayers().getArray().filter(function(a){return(a instanceof bn||a instanceof cl||a instanceof cr)&&a.getSource()===i}),s=n.get("mapbox-metadata");let o;switch(t.type){case"vector":o=Ru(t,s.styleUrl,s.options);break;case"geojson":o=Promise.resolve(Su(t,s.styleUrl,s.options));break;case"raster":case"raster-dem":o=Qp(t,s.styleUrl,s.options);break;default:return Promise.reject(new Error("Unsupported source type "+t.type))}return o.then(function(a){r.forEach(function(l){l.setSource(a)})}),o}function gl(n,e){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i){const s=t[i].get("mapbox-layers");if(s&&s.indexOf(e)!==-1)return t[i]}}function tA(n,e){const t=[],i=n.getLayers().getArray();for(let r=0,s=i.length;r<s;++r)i[r].get("mapbox-source")===e&&t.push(i[r]);return t}function iA(n,e){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i){const s=t[i].getSource();if(t[i].get("mapbox-source")===e)return s}}function pl(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Pu(n,e,t,i,r,s,o){o=o??pl();const a=1/(n-e),l=1/(t-i),c=1/(r-s);return o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*l,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*c,o[11]=0,o[12]=(n+e)*a,o[13]=(i+t)*l,o[14]=(s+r)*c,o[15]=1,o}function nA(n,e,t,i,r){return r=r??pl(),r[0]=n[0]*e,r[1]=n[1]*e,r[2]=n[2]*e,r[3]=n[3]*e,r[4]=n[4]*t,r[5]=n[5]*t,r[6]=n[6]*t,r[7]=n[7]*t,r[8]=n[8]*i,r[9]=n[9]*i,r[10]=n[10]*i,r[11]=n[11]*i,r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15],r}function mv(n,e,t,i,r){r=r??pl();let s,o,a,l,c,h,u,d,g,f,p,A;return n===r?(r[12]=n[0]*e+n[4]*t+n[8]*i+n[12],r[13]=n[1]*e+n[5]*t+n[9]*i+n[13],r[14]=n[2]*e+n[6]*t+n[10]*i+n[14],r[15]=n[3]*e+n[7]*t+n[11]*i+n[15]):(s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],h=n[5],u=n[6],d=n[7],g=n[8],f=n[9],p=n[10],A=n[11],r[0]=s,r[1]=o,r[2]=a,r[3]=l,r[4]=c,r[5]=h,r[6]=u,r[7]=d,r[8]=g,r[9]=f,r[10]=p,r[11]=A,r[12]=s*e+c*t+g*i+n[12],r[13]=o*e+h*t+f*i+n[13],r[14]=a*e+u*t+p*i+n[14],r[15]=l*e+d*t+A*i+n[15]),r}function yv(n,e,t,i){return i=i??pl(),i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=n,i[13]=e,i[14]=t,i[15]=1,i}const _v=`
|
|
40
|
+
attribute vec4 a_position;
|
|
41
|
+
attribute vec4 a_texcoord;
|
|
42
|
+
|
|
43
|
+
uniform mat4 u_matrix;
|
|
44
|
+
uniform mat4 u_textureMatrix;
|
|
45
|
+
|
|
46
|
+
varying vec2 v_texcoord;
|
|
47
|
+
|
|
48
|
+
void main() {
|
|
49
|
+
gl_Position = u_matrix * a_position;
|
|
50
|
+
vec2 texcoord = (u_textureMatrix * a_texcoord).xy;
|
|
51
|
+
v_texcoord = texcoord;
|
|
52
|
+
}
|
|
53
|
+
`,xv=`
|
|
54
|
+
precision mediump float;
|
|
55
|
+
|
|
56
|
+
varying vec2 v_texcoord;
|
|
57
|
+
|
|
58
|
+
uniform sampler2D u_texture;
|
|
59
|
+
|
|
60
|
+
void main() {
|
|
61
|
+
if (
|
|
62
|
+
v_texcoord.x < 0.0 ||
|
|
63
|
+
v_texcoord.y < 0.0 ||
|
|
64
|
+
v_texcoord.x > 1.0 ||
|
|
65
|
+
v_texcoord.y > 1.0
|
|
66
|
+
) {
|
|
67
|
+
discard;
|
|
68
|
+
}
|
|
69
|
+
gl_FragColor = texture2D(u_texture, v_texcoord);
|
|
70
|
+
}
|
|
71
|
+
`;class Ev{constructor(e){this.gl_=e,this.program_=Mu(e,xv,_v),this.positionLocation=e.getAttribLocation(this.program_,"a_position"),this.texcoordLocation=e.getAttribLocation(this.program_,"a_texcoord"),this.matrixLocation=e.getUniformLocation(this.program_,"u_matrix"),this.textureMatrixLocation=e.getUniformLocation(this.program_,"u_textureMatrix"),this.textureLocation=e.getUniformLocation(this.program_,"u_texture"),this.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.positionBuffer),this.positions=[0,0,0,1,1,0,1,0,0,1,1,1],e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.positions),e.STATIC_DRAW),this.texcoordBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.texcoordBuffer),this.texcoords=[0,0,0,1,1,0,1,0,0,1,1,1],e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.texcoords),e.STATIC_DRAW)}drawImage(e,t,i,r,s,o,a,l,c,h,u,d,g){const f=this.gl_;l===void 0&&(l=r),c===void 0&&(c=s),o===void 0&&(o=t),a===void 0&&(a=i),h===void 0&&(h=o),u===void 0&&(u=a),d===void 0&&(d=f.canvas.width),g===void 0&&(g=f.canvas.height),f.bindTexture(f.TEXTURE_2D,e),f.useProgram(this.program_),f.bindBuffer(f.ARRAY_BUFFER,this.positionBuffer),f.enableVertexAttribArray(this.positionLocation),f.vertexAttribPointer(this.positionLocation,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.texcoordBuffer),f.enableVertexAttribArray(this.texcoordLocation),f.vertexAttribPointer(this.texcoordLocation,2,f.FLOAT,!1,0,0);let p=Pu(0,d,0,g,-1,1);p=mv(p,l,c,0),p=nA(p,h,u,1),f.uniformMatrix4fv(this.matrixLocation,!1,p);let A=yv(r/t,s/i,0);A=nA(A,o/t,a/i,1),f.uniformMatrix4fv(this.textureMatrixLocation,!1,A),f.uniform1i(this.textureLocation,0),f.drawArrays(f.TRIANGLES,0,this.positions.length/2)}}function rA(n,e,t){const i=n.createShader(e);if(i===null)throw new Error("Shader compilation failed");if(n.shaderSource(i,t),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const r=n.getShaderInfoLog(i);throw r===null?new Error("Shader info log creation failed"):new Error(r)}return i}function Mu(n,e,t){const i=n.createProgram(),r=rA(n,n.VERTEX_SHADER,t),s=rA(n,n.FRAGMENT_SHADER,e);if(i===null)throw new Error("Program creation failed");if(n.attachShader(i,r),n.attachShader(i,s),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw n.getProgramInfoLog(i)===null?new Error("Program info log creation failed"):new Error;return i}const wv=`
|
|
72
|
+
attribute vec4 a_position;
|
|
73
|
+
|
|
74
|
+
uniform mat4 u_matrix;
|
|
75
|
+
|
|
76
|
+
void main() {
|
|
77
|
+
gl_Position = u_matrix * a_position;
|
|
78
|
+
}
|
|
79
|
+
`,vv=`
|
|
80
|
+
precision mediump float;
|
|
81
|
+
|
|
82
|
+
uniform vec4 u_val;
|
|
83
|
+
void main() {
|
|
84
|
+
gl_FragColor = u_val;
|
|
85
|
+
}
|
|
86
|
+
`,Cv=`
|
|
87
|
+
attribute vec4 a_position;
|
|
88
|
+
attribute vec2 a_texcoord;
|
|
89
|
+
|
|
90
|
+
varying vec2 v_texcoord;
|
|
91
|
+
|
|
92
|
+
uniform mat4 u_matrix;
|
|
93
|
+
|
|
94
|
+
void main() {
|
|
95
|
+
gl_Position = u_matrix * a_position;
|
|
96
|
+
v_texcoord = a_texcoord;
|
|
97
|
+
}
|
|
98
|
+
`,bv=`
|
|
99
|
+
precision mediump float;
|
|
100
|
+
|
|
101
|
+
varying vec2 v_texcoord;
|
|
102
|
+
|
|
103
|
+
uniform sampler2D u_texture;
|
|
104
|
+
|
|
105
|
+
void main() {
|
|
106
|
+
if (v_texcoord.x < 0.0 || v_texcoord.x > 1.0 || v_texcoord.y < 0.0 || v_texcoord.y > 1.0) {
|
|
107
|
+
discard;
|
|
108
|
+
}
|
|
109
|
+
gl_FragColor = texture2D(u_texture, v_texcoord);
|
|
110
|
+
}
|
|
111
|
+
`;function Tv(n,e,t,i){let r;return t&&t.length?r=t.shift():Ll?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("webgl",i)}function Rv(n){const e=n.canvas;e.width=1,e.height=1,n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT|n.STENCIL_BUFFER_BIT)}const sA=[];function Sv(n,e,t,i,r,s,o,a,l,c,h,u,d,g){const f=Math.round(i*e),p=Math.round(i*t);n.canvas.width=f,n.canvas.height=p;let A,m;if(m=n.createTexture(),n.bindTexture(n.TEXTURE_2D,m),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),d?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,f,p,0,n.RGBA,h,null),A=n.createFramebuffer(),n.bindFramebuffer(n.FRAMEBUFFER,A),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,m,0),A===null)throw new Error("Could not create framebuffer");if(m===null)throw new Error("Could not create texture");if(l.length===0)return{width:f,height:p,framebuffer:A,texture:m};const y=St();l.forEach(function(T,P,M){Nl(y,T.extent)});let E,x,_;const w=1/r;{if(E=n.createTexture(),m===null)throw new Error("Could not create texture");x=Math.round(ne(y)*w),_=Math.round(De(y)*w);const T=n.getParameter(n.MAX_TEXTURE_SIZE),P=Math.max(x,_),M=P>T?T/P:1,k=Math.round(x*M),I=Math.round(_*M);n.bindTexture(n.TEXTURE_2D,E),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),d?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,k,I,0,n.RGBA,h,null);const R=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,R),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,E,0);const B=new Ev(n);l.forEach(function(D,z,U){const S=(D.extent[0]-y[0])*w*M,X=-(D.extent[3]-y[3])*w*M,O=ne(D.extent)*w*M,Z=De(D.extent)*w*M;if(n.bindFramebuffer(n.FRAMEBUFFER,R),n.viewport(0,0,k,I),D.clipExtent){const ce=(D.clipExtent[0]-y[0])*w*M,J=-(D.clipExtent[3]-y[3])*w*M,he=ne(D.clipExtent)*w*M,me=De(D.clipExtent)*w*M;n.enable(n.SCISSOR_TEST),n.scissor(d?ce:Math.round(ce),d?J:Math.round(J),d?he:Math.round(ce+he)-Math.round(ce),d?me:Math.round(J+me)-Math.round(J))}B.drawImage(D.texture,D.width,D.height,c,c,D.width-2*c,D.height-2*c,d?S:Math.round(S),d?X:Math.round(X),d?O:Math.round(S+O)-Math.round(S),d?Z:Math.round(X+Z)-Math.round(X),k,I),n.disable(n.SCISSOR_TEST)}),n.deleteFramebuffer(R)}const v=ei(o),C=ei(y),b=T=>{const P=(T[0][0]-v[0])/s*i,M=-(T[0][1]-v[1])/s*i,k=(T[1][0]-v[0])/s*i,I=-(T[1][1]-v[1])/s*i,R=(T[2][0]-v[0])/s*i,B=-(T[2][1]-v[1])/s*i;return{u1:k,v1:I,u0:P,v0:M,u2:R,v2:B}};n.bindFramebuffer(n.FRAMEBUFFER,A),n.viewport(0,0,f,p);{const T=[],P=[],M=Mu(n,bv,Cv);n.useProgram(M);const k=n.getUniformLocation(M,"u_texture");n.bindTexture(n.TEXTURE_2D,E),n.uniform1i(k,0),a.getTriangles().forEach(function(S,X,O){const Z=S.source,ce=S.target,{u1:J,v1:he,u0:me,v0:Ee,u2:Me,v2:j}=b(ce),Dt=(Z[0][0]-C[0])/r/x,Si=-(Z[0][1]-C[1])/r/_,re=(Z[1][0]-C[0])/r/x,Kt=-(Z[1][1]-C[1])/r/_,He=(Z[2][0]-C[0])/r/x,Ce=-(Z[2][1]-C[1])/r/_;T.push(J,he,me,Ee,Me,j),P.push(re,Kt,Dt,Si,He,Ce)});const I=Pu(0,f,p,0,-1,1),R=n.getUniformLocation(M,"u_matrix");n.uniformMatrix4fv(R,!1,I);const B=n.getAttribLocation(M,"a_position"),D=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,D),n.bufferData(n.ARRAY_BUFFER,new Float32Array(T),n.STATIC_DRAW),n.vertexAttribPointer(B,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(B);const z=n.getAttribLocation(M,"a_texcoord"),U=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,U),n.bufferData(n.ARRAY_BUFFER,new Float32Array(P),n.STATIC_DRAW),n.vertexAttribPointer(z,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(z),n.drawArrays(n.TRIANGLES,0,T.length/2)}if(u){const T=Mu(n,vv,wv);n.useProgram(T);const P=Pu(0,f,p,0,-1,1),M=n.getUniformLocation(T,"u_matrix");n.uniformMatrix4fv(M,!1,P);const k=Array.isArray(u)?u:[0,0,0,255],I=n.getUniformLocation(T,"u_val");n.uniform4fv(I,k);const R=n.getAttribLocation(T,"a_position"),B=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,B),n.vertexAttribPointer(R,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(R);const D=a.getTriangles().reduce(function(z,U){const S=U.target,{u1:X,v1:O,u0:Z,v0:ce,u2:J,v2:he}=b(S);return z.concat([X,O,Z,ce,Z,ce,J,he,J,he,X,O])},[]);n.bufferData(n.ARRAY_BUFFER,new Float32Array(D),n.STATIC_DRAW),n.drawArrays(n.LINES,0,D.length/2)}return{width:f,height:p,framebuffer:A,texture:m}}class Iv extends al{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.renderEdges_=e.renderEdges!==void 0?e.renderEdges:!1,this.pixelRatio_=e.pixelRatio,this.gutter_=e.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=e.sourceTileGrid,this.targetTileGrid_=e.targetTileGrid,this.wrappedTileCoord_=e.wrappedTileCoord||e.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const t=e.sourceProj,i=t.getExtent(),r=e.sourceTileGrid.getExtent();this.clipExtent_=t.canWrapX()?r?ut(i,r):i:r;const s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?ut(s,o):s;if(Fs(l)===0){this.state=G.EMPTY;return}i&&(a?a=ut(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=e.targetProj,u=bp(t,h,l,c);if(!isFinite(u)||u<=0){this.state=G.EMPTY;return}const d=e.errorThreshold!==void 0?e.errorThreshold:xu;if(this.triangulation_=new _u(t,h,l,a,u*d,c,e.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let g=this.triangulation_.calculateSourceExtent();if(a&&(t.canWrapX()?(g[1]=Pe(g[1],a[1],a[3]),g[3]=Pe(g[3],a[1],a[3])):g=ut(g,a)),!Fs(g))this.state=G.EMPTY;else{let f=0,p=0;t.canWrapX()&&(f=ne(i),p=Math.floor((g[0]-i[0])/f)),zl(g.slice(),t,!0).forEach(m=>{const y=this.sourceTileGrid_.getTileRangeForExtentAndZ(m,this.sourceZ_),E=e.getTileFunction;for(let x=y.minX;x<=y.maxX;x++)for(let _=y.minY;_<=y.maxY;_++){const w=E(this.sourceZ_,x,_,this.pixelRatio_);if(w){const v=p*f;this.sourceTiles_.push({tile:w,offset:v})}}++p}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const e=[];let t=!1;if(this.sourceTiles_.forEach(x=>{var X;const _=x.tile;if(!_||_.getState()!==G.LOADED)return;const w=_.getSize(),v=this.gutter_;let C;const b=_w(_.getData());b?C=b:(t=!0,C=Ew(ol(_.getData())));const T=[w[0]+2*v,w[1]+2*v],P=C instanceof Float32Array,M=T[0]*T[1],k=P?Float32Array:Uint8ClampedArray,I=new k(C.buffer),R=k.BYTES_PER_ELEMENT,B=R*I.length/M,D=I.byteLength/T[1],z=Math.floor(D/R/T[0]),U=this.sourceTileGrid_.getTileCoordExtent(_.tileCoord);U[0]+=x.offset,U[2]+=x.offset;const S=(X=this.clipExtent_)==null?void 0:X.slice();S&&(S[0]+=x.offset,S[2]+=x.offset),e.push({extent:U,clipExtent:S,data:I,dataType:k,bytesPerPixel:B,pixelSize:T,bandCount:z})}),this.sourceTiles_.length=0,e.length===0){this.state=G.ERROR,this.changed();return}const i=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(i),s=typeof r=="number"?r:r[0],o=typeof r=="number"?r:r[1],a=s*this.pixelRatio_,l=o*this.pixelRatio_,c=this.targetTileGrid_.getResolution(i),h=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),d=e[0].bandCount,g=new e[0].dataType(d*a*l),f=Tv(a,l,sA,{premultipliedAlpha:!1,antialias:!1});let p;const A=f.RGBA;let m;e[0].dataType==Float32Array?(m=f.FLOAT,f.getExtension("WEBGL_color_buffer_float"),f.getExtension("OES_texture_float"),f.getExtension("EXT_float_blend"),p=f.getExtension("OES_texture_float_linear")!==null&&this.interpolate):(m=f.UNSIGNED_BYTE,p=this.interpolate);const y=4,E=Math.ceil(d/y);for(let x=E-1;x>=0;--x){const _=[];for(let k=0,I=e.length;k<I;++k){const R=e[k],B=R.pixelSize,D=B[0],z=B[1],U=new R.dataType(y*D*z),S=R.data;let X=x*y;for(let Z=0,ce=U.length;Z<ce;Z+=y)U[Z]=S[X],U[Z+1]=S[X+1],U[Z+2]=S[X+2],U[Z+3]=S[X+3],X+=d;const O=f.createTexture();f.bindTexture(f.TEXTURE_2D,O),p?(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR)):(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST)),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texImage2D(f.TEXTURE_2D,0,A,D,z,0,A,m,U),_.push({extent:R.extent,clipExtent:R.clipExtent,texture:O,width:D,height:z})}const{framebuffer:w,width:v,height:C}=Sv(f,s,o,this.pixelRatio_,h,c,u,this.triangulation_,_,this.gutter_,m,this.renderEdges_,p),b=v,T=C*y,P=new e[0].dataType(b*T);f.bindFramebuffer(f.FRAMEBUFFER,w),f.readPixels(0,0,v,C,f.RGBA,m,P);let M=x*y;for(let k=0,I=P.length;k<I;k+=y){const R=(b-1-(k/T|0))*T+k%T;g[M]=P[R],g[M+1]=P[R+1],g[M+2]=P[R+2],g[M+3]=P[R+3],M+=d}}if(Rv(f),sA.push(f.canvas),t){const x=Fe(s,o),_=new ImageData(g,s);x.putImageData(_,0,0),this.reprojData_=x.canvas}else this.reprojData_=g;this.reprojSize_=[Math.round(a),Math.round(l)],this.state=G.LOADED,this.changed()}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;this.state=G.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{const i=t.getState();if(i!==G.IDLE&&i!==G.LOADING)return;e++;const r=oe(t,H.CHANGE,()=>{const s=t.getState();(s==G.LOADED||s==G.ERROR||s==G.EMPTY)&&(ve(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t}){t.getState()==G.IDLE&&t.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(ve),this.sourcesListenerKeys_=null}}class Pv extends Tu{constructor(e){const t=e.projection===void 0?"EPSG:3857":e.projection;let i=e.tileGrid;i===void 0&&t&&(i=dl({extent:Eo(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize})),super({cacheSize:.1,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:t,tileGrid:i,state:e.state,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0,this.tileSize_=e.tileSize?Ke(e.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=e.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=e.bandCount===void 0?4:e.bandCount,this.tileGridForProjection_={},this.crossOrigin_=e.crossOrigin||"anonymous",this.transformMatrix=null}setTileSizes(e){this.tileSizes_=e}getTileSize(e){if(this.tileSizes_)return this.tileSizes_[e];if(this.tileSize_)return this.tileSize_;const t=this.getTileGrid();return t?Ke(t.getTileSize(e)):[256,256]}getGutterForProjection(e){const t=this.getProjection();return(!t||ti(t,e))&&!this.transformMatrix?this.gutter_:0}setLoader(e){this.loader_=e}getReprojTile_(e,t,i,r,s){const o=this.tileGrid||this.getTileGridForProjection(s||r),a=Math.max.apply(null,o.getResolutions().map((g,f)=>{const p=Ke(o.getTileSize(f)),A=this.getTileSize(f);return Math.max(A[0]/p[0],A[1]/p[1])})),l=this.getTileGridForProjection(r),c=[e,t,i],h=this.getTileCoordForTileUrlFunction(c,r),u=Object.assign({sourceProj:s||r,sourceTileGrid:o,targetProj:r,targetTileGrid:l,tileCoord:c,wrappedTileCoord:h,pixelRatio:a,gutter:this.gutter_,getTileFunction:(g,f,p,A)=>this.getTile(g,f,p,A),transformMatrix:this.transformMatrix},this.tileOptions),d=new Iv(u);return d.key=this.getKey(),d}getTile(e,t,i,r,s){var E;const o=this.getProjection();if(s&&(o&&!ti(o,s)||this.transformMatrix))return this.getReprojTile_(e,t,i,s,o);const a=this.getTileSize(e),l=this.loader_,c=new AbortController,h={signal:c.signal,crossOrigin:this.crossOrigin_},u=this.getTileCoordForTileUrlFunction([e,t,i]);if(!u)return null;const d=u[0],g=u[1],f=u[2],p=(E=this.getTileGrid())==null?void 0:E.getFullTileRange(d);p&&(h.maxY=p.getHeight()-1);function A(){return On(function(){return l(d,g,f,h)})}const m=Object.assign({tileCoord:[e,t,i],loader:A,size:a,controller:c},this.tileOptions),y=new al(m);return y.key=this.getKey(),y.addEventListener(H.CHANGE,this.handleTileChange_),y}handleTileChange_(e){const t=e.target,i=Y(t),r=t.getState();let s;r==G.LOADING?(this.tileLoadingKeys_[i]=!0,s=hs.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==G.ERROR?hs.TILELOADERROR:r==G.LOADED?hs.TILELOADEND:void 0),s&&this.dispatchEvent(new Dp(s,t))}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||ti(t,e))&&!this.transformMatrix)return this.tileGrid;const i=Y(e);return i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=bu(e)),this.tileGridForProjection_[i]}setTileGridForProjection(e,t){const i=pe(e);if(i){const r=Y(i);r in this.tileGridForProjection_||(this.tileGridForProjection_[r]=t)}}}const Mv=new Error("Image failed to load");function oA(n,e,t,i,r){return new Promise((s,o)=>{const a=new Image;a.crossOrigin=r.crossOrigin??null,a.addEventListener("load",()=>s(a)),a.addEventListener("error",()=>o(Mv)),a.src=jp(n,e,t,i,r.maxY)})}function aA(n){return function(e,t,i,r){const s=qw(n,e,t,i);return oA(s,e,t,i,r)}}function Fv(n){return function(e,t,i,r){const s=n(e,t,i,r);return oA(s,e,t,i,r)}}function lA(n){let e;if(Array.isArray(n))e=aA(n);else if(typeof n=="string"){const t=zp(n);e=aA(t)}else if(typeof n=="function")e=Fv(n);else throw new Error("The url option must be a single template, an array of templates, or a function for getting a URL");return e}let cA=0;function hA(n){return Array.isArray(n)?n.join(`
|
|
112
|
+
`):typeof n=="string"?n:(++cA,"url-function-key-"+cA)}class Lv extends Pv{constructor(e){e=e||{};let t=e.loader,i;e.url&&(t=lA(e.url),i=hA(e.url));const r=t?e.state:"loading",s=e.wrapX===void 0?!0:e.wrapX;super({loader:t,key:i,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize,gutter:e.gutter,maxResolution:e.maxResolution,projection:e.projection,tileGrid:e.tileGrid,state:r,wrapX:s,transition:e.transition,interpolate:e.interpolate!==!1,crossOrigin:e.crossOrigin,zDirection:e.zDirection})}setUrl(e){const t=lA(e);this.setLoader(t),this.setKey(hA(e)),this.getState()!=="ready"&&this.setState("ready")}}const kv="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCeRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOShgAHAAAAEgAAAISgAgAEAAAAAQAAAMigAwAEAAAAAQAAAMgAAAAAQVNDSUkAAABTY3JlZW5zaG90/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDShJQ0NfUFJPRklMRQABAQAADRhhcHBsAhAAAG1udHJSR0IgWFlaIAfpAAIAHAAJAB4AD2Fjc3BBUFBMAAAAAEFQUEwAAAAAAAAAAAAAAAAAAAAAAAD21gABAAAA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0EVoVMPhRvi3erN+b/ADI/KiznYMn29aBFEuCqAYyRx0z1qSiqOcKzNQS6UpdWkYldFZChOOHK5IPtjOO9adFRUjdWMq9Pmg1cqWIKWscRVl8pQnzAAnaMZwCat0UU4LRDpK0Ugqu1tGXMseY3PUr3+o6H+dWKKbinuVKClujkNUgfT531A232i1fLXMSpvDYH+tReSHAHIH3h33AZ2YLHTrm3jntXcwyqrIY5nClSOCMN0xVu/wD+PKf/AHG/lWZ4V/5FjSP+vSD/ANFinTqzTcUzGm3zuL6F7+y7FiDLH5uP+ejGQfkxIq+AFGFGAKWiqlNvdnRYKKKKkCCdGIEkX+sj5Hv6j8akjkWVFkTowzT6q2X/AB7J+P8AOo+0ZbT9f0sWqKKKs1P/2Q==";class Gv extends ia{constructor(t){const i=t||{},r=document.createElement("button");r.innerHTML=`<div class="svgContainer"><svg width="22" height="22" viewBox="0 0 22 22" fill="rgb(102, 102, 102)" xmlns="http://www.w3.org/2000/svg">
|
|
113
|
+
<path d="M11 4.7 16.9 9.4 11 14.1 5.1 9.4 11 4.7ZM11 16.7 20.4 9.4 11 2.1 1.6 9.4 11 16.7M11 19.3 3.5 13.3 1.6 14.7 11 21.9 20.4 14.7 18.5 13.3 11 19.3"/>
|
|
114
|
+
</svg></div>`;const s=document.createElement("div");s.className="layer-control ol-unselectable ol-control",s.appendChild(r);const o=document.createElement("div");o.classList.add("layer-selection","hidden"),s.appendChild(o);super({element:s,target:i.target});Mi(this,"baseLayers",[{name:"positron",image:kv,styleUrl:"https://tiles.openfreemap.org/styles/positron"},{name:"orthofoto",image:Dv,layer:new cl({visible:!1,source:new Lv({maxZoom:19,url:"https://mapsneu.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpg",attributions:'<a href="https://basemap.at">© basemap.at</a>'})}),visible:!1},{name:"kataster",image:Ov,styleUrl:"https://kataster.bev.gv.at/styles/kataster/style_basic.json"}].map((t,i)=>{t.styleUrl&&(t.layer=new Bi({visible:i===0}),t.styleUrl&&eA(t.layer,t.styleUrl));const r=document.createElement("div");r.classList.add("image-box"),i===0&&r.classList.add("selected");const s=document.createElement("img");return s.src=t.image,s.alt=t.name,r.appendChild(s),r.addEventListener("click",o=>{this.baseLayers.forEach(a=>{o.target===a.thumbnailBox?a.thumbnailBox.classList.add("selected"):a.thumbnailBox.classList.remove("selected")}),this.baseLayers.forEach(a=>{a.layer.setVisible(a.name===t.name)})}),t.thumbnailBox=r,t}));Mi(this,"baseLayerGroup");Mi(this,"layerControlElement",null);this.baseLayers.forEach(a=>{o.appendChild(a.thumbnailBox)}),this.layerControlElement=o,r.addEventListener("click",this.toggleLayerSelection.bind(this),!1)}setMap(t){this.getMap()&&this.getMap().removeLayer(this.baseLayerGroup),t&&(this.baseLayerGroup=new Bi({layers:this.baseLayers.map(i=>i.layer)}),t.addLayer(this.baseLayerGroup)),super.setMap(t)}set displayLayerSelection(t){if(t){this.layerControlElement.classList.remove("hidden");const i=()=>{this.displayLayerSelection=!1,this.getMap().getTargetElement().removeEventListener("click",i)};setTimeout(()=>{this.getMap().getTargetElement().addEventListener("click",i)}),this.getMap().once("moveend",()=>{this.displayLayerSelection&&(this.displayLayerSelection=!1,document.body.removeEventListener("click",i))})}else this.fadeOutAndHide()}get displayLayerSelection(){return!this.layerControlElement.classList.contains("hidden")}toggleLayerSelection(){this.displayLayerSelection=!this.displayLayerSelection}fadeOutAndHide(){this.layerControlElement.classList.add("fade-out"),setTimeout(()=>{this.layerControlElement.classList.remove("fade-out"),this.layerControlElement.classList.add("hidden")},150)}}class Bv extends fn{constructor(t){super();_e(this,gs);_e(this,ci,null);_e(this,In,new bn({source:new En}));Re(this,ci,t.yioMap);const i=L(this,In).getSource();i.addEventListener("change",r=>{L(this,ci).userSelect=i.getFeatures().map(s=>s.getProperties())})}setMap(t){const i=this.getMap();i&&i.removeLayer(L(this,In)),t&&(t.addLayer(L(this,In)),super.setMap(t))}handleEvent(t){return t.type==="pointermove"&&At(this,gs,CA).call(this,t),t.type==="click"?At(this,gs,bA).call(this,t):!0}setActive(t){super.setActive(t),t||(L(this,In).getSource().clear(),L(this,ci)&&(L(this,ci).userSelect.length=0))}}ci=new WeakMap,In=new WeakMap,gs=new WeakSet,CA=function(t){const i=this.getMap(),r=L(this,ci)._getContentLayer();i.getFeaturesAtPixel(t.pixel,{layerFilter:o=>r.getLayers().getArray().includes(o)}).filter(o=>o.get("id")!==void 0).length?i.getTargetElement().classList.add("cursor-pointer"):i.getTargetElement().classList.remove("cursor-pointer")},bA=function(t){const i=this.getMap(),r=L(this,ci)._getContentLayer(),s=L(this,In).getSource(),o=i.getFeaturesAtPixel(t.pixel,{layerFilter:a=>r.getLayers().getArray().includes(a)}).filter(a=>a.get("id")!==void 0);return s.clear(),s.addFeatures(o.map(a=>a instanceof tt?Xf(a):a)),L(this,ci).notifyNextChange=!0,L(this,ci)._handleClick(t.originalEvent),o.length===0};const Al={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class ml extends Tt{constructor(e,t){super(e),this.feature=t}}function Nv(n,e){const t=[];for(let i=0;i<e.length;++i){const s=e[i].getGeometry();uA(n,s,t)}return t}function yl(n,e){return ki(n[0],n[1],e[0],e[1])}function us(n,e){const t=n.length;return e<0?n[e+t]:e>=t?n[e-t]:n[e]}function _l(n,e,t){let i,r;e<t?(i=e,r=t):(i=t,r=e);const s=Math.ceil(i),o=Math.floor(r);if(s>o){const l=ds(n,i),c=ds(n,r);return yl(l,c)}let a=0;if(i<s){const l=ds(n,i),c=us(n,s);a+=yl(l,c)}if(o<r){const l=us(n,o),c=ds(n,r);a+=yl(l,c)}for(let l=s;l<o-1;++l){const c=us(n,l),h=us(n,l+1);a+=yl(c,h)}return a}function uA(n,e,t){if(e instanceof Wt){xl(n,e.getCoordinates(),!1,t);return}if(e instanceof An){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r)xl(n,i[r],!1,t);return}if(e instanceof Nt){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r)xl(n,i[r],!0,t);return}if(e instanceof mn){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a)xl(n,o[a],!0,t)}return}if(e instanceof oo){const i=e.getGeometries();for(let r=0;r<i.length;++r)uA(n,i[r],t);return}}const Fu={index:-1,endIndex:NaN};function jv(n,e,t,i){const r=n[0],s=n[1];let o=1/0,a=-1,l=NaN;for(let u=0;u<e.targets.length;++u){const d=e.targets[u],g=d.coordinates;let f=1/0,p;for(let A=0;A<g.length-1;++A){const m=g[A],y=g[A+1],E=dA(r,s,m,y);E.squaredDistance<f&&(f=E.squaredDistance,p=A+E.along)}f<o&&(o=f,d.ring&&e.targetIndex===u&&(d.endIndex>d.startIndex?p<d.startIndex&&(p+=g.length):d.endIndex<d.startIndex&&p>d.startIndex&&(p-=g.length)),l=p,a=u)}const c=e.targets[a];let h=c.ring;if(e.targetIndex===a&&h){const u=ds(c.coordinates,l),d=t.getPixelFromCoordinate(u);Ls(d,e.startPx)>i&&(h=!1)}if(h){const u=c.coordinates,d=u.length,g=c.startIndex,f=l;if(g<f){const p=_l(u,g,f);_l(u,g,f-d)<p&&(l-=d)}else{const p=_l(u,g,f);_l(u,g,f+d)<p&&(l+=d)}}return Fu.index=a,Fu.endIndex=l,Fu}function xl(n,e,t,i){const r=n[0],s=n[1];for(let o=0,a=e.length-1;o<a;++o){const l=e[o],c=e[o+1],h=dA(r,s,l,c);if(h.squaredDistance===0){const u=o+h.along;i.push({coordinates:e,ring:t,startIndex:u,endIndex:u});return}}}const Lu={along:0,squaredDistance:0};function dA(n,e,t,i){const r=t[0],s=t[1],o=i[0],a=i[1],l=o-r,c=a-s;let h=0,u=r,d=s;return(l!==0||c!==0)&&(h=Pe(((n-r)*l+(e-s)*c)/(l*l+c*c),0,1),u+=l*h,d+=c*h),Lu.along=h,Lu.squaredDistance=Is(ki(n,e,u,d),10),Lu}function ds(n,e){const t=n.length;let i=Math.floor(e);const r=e-i;i>=t?i-=t:i<0&&(i+=t);let s=i+1;s>=t&&(s-=t);const o=n[i],a=o[0],l=o[1],c=n[s],h=c[0]-a,u=c[1]-l;return[a+h*r,l+u*r]}class zv extends Yn{constructor(e){const t=e;t.stopDown||(t.stopDown=br),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=Vv(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Cr,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let i=e.geometryFunction;if(!i){const r=this.mode_;if(r==="Circle")i=(s,o,a)=>{const l=o||new xa([NaN,NaN]),c=Ne(s[0]),h=Sr(c,Ne(s[s.length-1]));return l.setCenterAndRadius(c,Math.sqrt(h),this.geometryLayout_),l};else{let s;r==="Point"?s=yt:r==="LineString"?s=Wt:r==="Polygon"&&(s=Nt),i=(o,a,l)=>(a?r==="Polygon"?o[0].length?a.setCoordinates([o[0].concat([o[0][0]])],this.geometryLayout_):a.setCoordinates([],this.geometryLayout_):a.setCoordinates(o,this.geometryLayout_):a=new s(o,this.geometryLayout_),a)}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new bn({source:new En({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:Uv(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:ra,this.freehandCondition_,e.freehand?this.freehandCondition_=na:this.freehandCondition_=e.freehandCondition?e.freehandCondition:cf,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Cc.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=na:t=e:t=Vy,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===H.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===ae.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===ae.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===ae.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===ae.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===ae.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===ae.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===ae.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new Li(ae.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const t=this.getMap(),i=t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),r=t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),s=ht([i,r]),o=this.traceSource_.getFeaturesInExtent(s);if(o.length===0)return;const a=Nv(e.coordinate,o);a.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:a,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,r=e.startIndex<=t;i===r?i&&t>e.endIndex||!i&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(i&&t<e.endIndex||!i&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let i=0;if(e<t){const r=Math.ceil(e);let s=Math.floor(t);s===t&&(s-=1),i=s-r+1}else{const r=Math.floor(e);let s=Math.ceil(t);s===t&&(s+=1),i=r-s+1}i>0&&this.removeLastPoints_(i)}addTracedCoordinates_(e,t,i){if(t===i)return;const r=[];if(t<i){const s=Math.ceil(t);let o=Math.floor(i);o===i&&(o-=1);for(let a=s;a<=o;++a)r.push(us(e.coordinates,a))}else{const s=Math.floor(t);let o=Math.ceil(i);o===i&&(o+=1);for(let a=s;a>=o;--a)r.push(us(e.coordinates,a))}r.length&&this.appendCoordinates(r)}updateTrace_(e){const t=this.traceState_;if(!t.active||t.targetIndex===-1&&Ls(t.startPx,e.pixel)<this.snapTolerance_)return;const i=jv(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==i.index){if(t.targetIndex!==-1){const l=t.targets[t.targetIndex];this.removeTracedCoordinates_(l.startIndex,l.endIndex)}const a=t.targets[i.index];this.addTracedCoordinates_(a,a.startIndex,i.endIndex)}else{const a=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(a,i.endIndex)}t.targetIndex=i.index;const r=t.targets[t.targetIndex];r.endIndex=i.endIndex;const s=ds(r.coordinates,r.endIndex),o=this.getMap().getPixelFromCoordinate(s);e.coordinate=s,e.pixel=[Math.round(o[0]),Math.round(o[1])]}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const i=this.traceState_.active;if(this.toggleTraceState_(e),this.shouldHandle_){const r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_==="Point")&&(this.atFinish_(e.pixel,i)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const t=this.downPx_,i=e.pixel,r=t[0]-i[0],s=t[1]-i[1],o=r*r+s*s;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let i=!1;if(this.sketchFeature_){let r=!1,s=[this.finishCoordinate_];const o=this.mode_;if(o==="Point")i=!0;else if(o==="Circle")i=this.sketchCoords_.length===2;else if(o==="LineString")r=!t&&this.sketchCoords_.length>this.minPoints_;else if(o==="Polygon"){const a=this.sketchCoords_;r=a[0].length>this.minPoints_,s=[a[0][0],a[0][a[0].length-2]],t?s=[a[0][0]]:s=[a[0][0],a[0][a[0].length-2]]}if(r){const a=this.getMap();for(let l=0,c=s.length;l<c;l++){const h=s[l],u=a.getPixelFromCoordinate(h),d=e[0]-u[0],g=e[1]-u[1],f=this.freehand_?1:this.snapTolerance_;if(i=Math.sqrt(d*d+g*g)<=f,i){this.finishCoordinate_=h;break}}}}return i}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new Pt(new yt(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new Pt);const t=e.getLinearRing(0);let i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),i.changed()):(i=new Wt(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(e){const t=this.getMap().getView().getProjection(),i=Yo(this.geometryLayout_);for(;e.length<i;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Pt(new Wt(this.sketchLineCoords_)));const r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new Pt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new ml(Al.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const t=this.getMap(),i=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),s=Yo(this.geometryLayout_);let o,a;for(;e.length<s;)e.push(0);this.mode_==="Point"?a=this.sketchCoords_:this.mode_==="Polygon"?(o=this.sketchCoords_[0],a=o[o.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(o=this.sketchCoords_,a=o[o.length-1]),a[0]=e[0],a[1]=e[1],this.geometryFunction_(this.sketchCoords_,i,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),i.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(i):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();let r,s;const o=this.mode_;return o==="LineString"||o==="Circle"?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),this.geometryFunction_(s,t,i)):o==="Polygon"&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),r&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),r=this.mode_;for(let s=0;s<e;++s){let o;if(r==="LineString"||r==="Circle"){if(o=this.sketchCoords_,o.splice(-2,1),o.length>=2){this.finishCoordinate_=o[o.length-2].slice();const a=this.finishCoordinate_.slice();o[o.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(o,t,i),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r==="Polygon"){o=this.sketchCoords_[0],o.splice(-2,1);const a=this.sketchLine_.getGeometry();if(o.length>=2){const l=o[o.length-2].slice();o[o.length-1]=l,this.createOrUpdateSketchPoint_(l)}a.setCoordinates(o),this.geometryFunction_(this.sketchCoords_,t,i)}if(o.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_;const i=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_==="LineString"?(t.pop(),this.geometryFunction_(t,i,r)):this.mode_==="Polygon"&&(t[0].pop(),this.geometryFunction_(t,i,r),t=i.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new er([t])):this.type_==="MultiLineString"?e.setGeometry(new An([t])):this.type_==="MultiPolygon"&&e.setGeometry(new mn([t])),this.dispatchEvent(new ml(Al.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new ml(Al.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let r;if(t==="LineString"||t==="Circle")r=this.sketchCoords_;else if(t==="Polygon")r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&r.shift(),r.pop();for(let o=0;o<e.length;o++)this.addToDrawing_(e[o]);const s=e[e.length-1];this.sketchFeature_=this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const i=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=i.getCoordinates();const r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new Pt(new yt(r)),this.updateSketchFeatures_(),this.dispatchEvent(new ml(Al.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){const e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}}function Uv(){const n=Pf();return function(e,t){return n[e.getGeometry().getType()]}}function Vv(n){switch(n){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+n)}}const fA=0,wo=1,gA=[0,0,0,0],fs=[],ku={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class Du extends Tt{constructor(e,t,i){super(e),this.features=t,this.mapBrowserEvent=i}}class Wv extends Yn{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:Sc,this.defaultDeleteCondition_=function(i){return jy(i)&&Wy(i)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:na,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new Zh,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new bn({source:new En({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Xv(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new Gt(this.source_.getFeatures()),this.source_.addEventListener(wt.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(wt.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(ot.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(ot.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(i.getCoordinateFromPixel(this.lastPixel_)),e.addEventListener(H.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Gt;const i=this.featuresBeingModified_.getArray();for(let r=0,s=t.length;r<s;++r){const o=t[r].feature;o&&!i.includes(o)&&this.featuresBeingModified_.push(o)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new Du(ku.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(H.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){const t=this.rBush_,i=[];t.forEach(function(r){e===r.feature&&i.push(r)});for(let r=i.length-1;r>=0;--r){const s=i[r];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===s&&this.dragSegments_.splice(o,1);t.remove(s)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const i=t.getCoordinates(),r={feature:e,geometry:t,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length-1;r<s;++r){const o=i.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:o};this.rBush_.insert(ht(o),a)}}writeMultiLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),h={feature:e,geometry:t,depth:[r],index:a,segment:c};this.rBush_.insert(ht(c),h)}}}writePolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),h={feature:e,geometry:t,depth:[r],index:a,segment:c};this.rBush_.insert(ht(c),h)}}}writeMultiPolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a){const c=o[a];for(let h=0,u=c.length-1;h<u;++h){const d=c.slice(h,h+2),g={feature:e,geometry:t,depth:[a,r],index:h,segment:d};this.rBush_.insert(ht(d),g)}}}}writeCircleGeometry_(e,t){const i=t.getCenter(),r={feature:e,geometry:t,index:fA,segment:[i,i]},s={feature:e,geometry:t,index:wo,segment:[i,i]},o=[r,s];r.featureSegments=o,s.featureSegments=o,this.rBush_.insert(Ps(i),r);let a=t;this.rBush_.insert(a.getExtent(),s)}writeGeometryCollectionGeometry_(e,t){const i=t.getGeometriesArray();for(let r=0;r<i.length;++r){const s=i[r],o=this.SEGMENT_WRITERS_[s.getType()];o(e,s)}}createOrUpdateVertexFeature_(e,t,i,r){let s=this.vertexFeature_;return s?s.getGeometry().setCoordinates(e):(s=new Pt(new yt(e)),this.vertexFeature_=s,this.overlay_.getSource().addFeature(s)),s.set("features",t),s.set("geometries",i),s.set("existing",r),s}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==ae.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(e.type!=ae.SINGLECLICK||!this.ignoreNextSingleClick_?t=this.removePoint():t=!0),e.type==ae.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null;const t=this.vertexFeature_;if(!t)return;this.getMap().getView().getProjection();const i=[],r=t.getGeometry().getCoordinates(),s=ht([r]),o=this.rBush_.getInExtent(s),a={};o.sort(Hv);for(let l=0,c=o.length;l<c;++l){const h=o[l],u=h.segment;let d=Y(h.geometry);const g=h.depth;if(g&&(d+="-"+g.join("-")),a[d]||(a[d]=new Array(2)),h.geometry.getType()==="Circle"&&h.index===wo){const f=AA(e,h);dt(f,r)&&!a[d][0]&&(this.dragSegments_.push([h,0]),a[d][0]=h);continue}if(dt(u[0],r)&&!a[d][0]){this.dragSegments_.push([h,0]),a[d][0]=h;continue}if(dt(u[1],r)&&!a[d][1]){if(a[d][0]&&a[d][0].index===0){let f=h.geometry.getCoordinates();switch(h.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":f=f[g[1]];case"Polygon":if(h.index!==f[g[0]].length-2)continue;break}}this.dragSegments_.push([h,1]),a[d][1]=h;continue}Y(u)in this.vertexSegments_&&!a[d][0]&&!a[d][1]&&i.push(h)}return i}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([s])=>s));const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],i=[],r=[];for(let s=0,o=this.dragSegments_.length;s<o;++s){const a=this.dragSegments_[s],l=a[0],c=l.feature;i.includes(c)||i.push(c);const h=l.geometry;r.includes(h)||r.push(h);const u=l.depth;let d;const g=l.segment,f=a[1];for(;t.length<h.getStride();)t.push(g[f][t.length]);switch(h.getType()){case"Point":d=t,g[0]=t,g[1]=t;break;case"MultiPoint":d=h.getCoordinates(),d[l.index]=t,g[0]=t,g[1]=t;break;case"LineString":d=h.getCoordinates(),d[l.index+f]=t,g[f]=t;break;case"MultiLineString":d=h.getCoordinates(),d[u[0]][l.index+f]=t,g[f]=t;break;case"Polygon":d=h.getCoordinates(),d[u[0]][l.index+f]=t,g[f]=t;break;case"MultiPolygon":d=h.getCoordinates(),d[u[1]][u[0]][l.index+f]=t,g[f]=t;break;case"Circle":const p=h;if(g[0]=t,g[1]=t,l.index===fA)this.changingFeature_=!0,p.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0,e.map.getView().getProjection();let A=Ls(Ne(p.getCenter()),Ne(t));p.setRadius(A),this.changingFeature_=!1}break}d&&this.setGeometryCoordinates_(h,d)}this.createOrUpdateVertexFeature_(t,i,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;const t=e.coordinate,i=this.findInsertVerticesAndUpdateDragSegments_(t);if(i!=null&&i.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,i),this.vertexFeature_)){const r=this.vertexFeature_.getGeometry().getCoordinates();for(let s=i.length-1;s>=0;--s)this.insertVertex_(i[s],r);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const i=this.dragSegments_[t][0],r=i.geometry;if(r.getType()==="Circle"){const s=r,o=s.getCenter(),a=i.featureSegments[0],l=i.featureSegments[1];a.segment[0]=o,a.segment[1]=o,l.segment[0]=o,l.segment[1]=o,this.rBush_.update(Ps(o),a);let c=s;this.rBush_.update(c.getExtent(),l)}else this.rBush_.update(ht(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Du(ku.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.coordinate)}handlePointerAtPixel_(e){const t=this.getMap(),i=t.getPixelFromCoordinate(e);t.getView().getProjection();const r=function(a,l){return pA(e,a)-pA(e,l)};let s,o;if(this.hitDetection_){const a=typeof this.hitDetection_=="object"?l=>l===this.hitDetection_:void 0;t.forEachFeatureAtPixel(i,(l,c,h)=>{h&&h.getType()==="Point"&&(h=new yt(Vn(h.getCoordinates())));const u=h||l.getGeometry();if(u&&u.getType()==="Point"&&l instanceof Pt&&this.features_.getArray().includes(l)){o=u;const d=l.getGeometry().getFlatCoordinates().slice(0,2);s=[{feature:l,geometry:o,segment:[d,d]}]}return!0},{layerFilter:a})}if(!s){const a=ii(Ps(e,gA)),l=t.getView().getResolution()*this.pixelTolerance_,c=Xo(Di(a,l,gA));s=this.rBush_.getInExtent(c)}if(s&&s.length>0){const a=s.sort(r)[0],l=a.segment;let c=AA(e,a);const h=t.getPixelFromCoordinate(c);let u=Ls(i,h);if(o||u<=this.pixelTolerance_){const d={};if(d[Y(l)]=!0,this.snapToPointer_||(this.delta_[0]=c[0]-e[0],this.delta_[1]=c[1]-e[1]),a.geometry.getType()==="Circle"&&a.index===wo)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(c,[a.feature],[a.geometry],this.snappedToVertex_);else{const g=t.getPixelFromCoordinate(l[0]),f=t.getPixelFromCoordinate(l[1]),p=Sr(h,g),A=Sr(h,f);if(u=Math.sqrt(Math.min(p,A)),this.snappedToVertex_=u<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);return}this.snappedToVertex_&&(c=p>A?l[1]:l[0]),this.createOrUpdateVertexFeature_(c,[a.feature],[a.geometry],this.snappedToVertex_);const m={};m[Y(a.geometry)]=!0;for(let y=1,E=s.length;y<E;++y){const x=s[y].segment;if(dt(l[0],x[0])&&dt(l[1],x[1])||dt(l[0],x[1])&&dt(l[1],x[0])){const _=Y(s[y].geometry);_ in m||(m[_]=!0,d[Y(x)]=!0)}else break}}this.vertexSegments_=d;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(e,t){const i=e.segment,r=e.feature,s=e.geometry,o=e.depth,a=e.index;let l;for(;t.length<s.getStride();)t.push(0);switch(s.getType()){case"MultiLineString":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"Polygon":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"MultiPolygon":l=s.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,t);break;case"LineString":l=s.getCoordinates(),l.splice(a+1,0,t);break;default:return!1}this.setGeometryCoordinates_(s,l);const c=this.rBush_;c.remove(e),this.updateSegmentIndices_(s,a,o,1);const h={segment:[i[0],t],feature:r,geometry:s,depth:o,index:a};c.insert(ht(h.segment),h),this.dragSegments_.push([h,1]);const u={segment:[t,i[1]],feature:r,geometry:s,depth:o,index:a+1};return c.insert(ht(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){var t;return e&&this.findInsertVerticesAndUpdateDragSegments_(e),(t=this.vertexFeature_)==null?void 0:t.getGeometry().getCoordinates()}getPoint(){var t;const e=(t=this.vertexFeature_)==null?void 0:t.getGeometry().getCoordinates();return e?Vn(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(i=>i.getType()==="Circle"||i.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(ht([e])).some(({segment:i})=>dt(i[0],e)||dt(i[1],e))}removePoint(e){if(e&&(e=Ne(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=ae.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_.map(([r])=>r));const i=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new Du(ku.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,i}return!1}removeVertex_(){const e=this.dragSegments_,t={};let i=!1,r,s,o,a,l,c,h,u,d,g,f;for(l=e.length-1;l>=0;--l)o=e[l],g=o[0],f=Y(g.feature),g.depth&&(f+="-"+g.depth.join("-")),f in t||(t[f]={}),o[1]===0?(t[f].right=g,t[f].index=g.index):o[1]==1&&(t[f].left=g,t[f].index=g.index+1);for(f in t){switch(d=t[f].right,h=t[f].left,c=t[f].index,u=c-1,h!==void 0?g=h:g=d,u<0&&(u=0),a=g.geometry,s=a.getCoordinates(),r=s,i=!1,a.getType()){case"MultiLineString":s[g.depth[0]].length>2&&(s[g.depth[0]].splice(c,1),i=!0);break;case"LineString":s.length>2&&(s.splice(c,1),i=!0);break;case"MultiPolygon":r=r[g.depth[1]];case"Polygon":r=r[g.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),i=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1));break}if(i){this.setGeometryCoordinates_(a,s);const p=[];if(h!==void 0&&(this.rBush_.remove(h),p.push(h.segment[0])),d!==void 0&&(this.rBush_.remove(d),p.push(d.segment[1])),h!==void 0&&d!==void 0){const A={depth:g.depth,feature:g.feature,geometry:g.geometry,index:u,segment:p};this.rBush_.insert(ht(A.segment),A)}this.updateSegmentIndices_(a,c,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return i}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(i=>i.getType()==="Circle"||i.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(ht([e])).some(({segment:i})=>!(dt(i[0],e)||dt(i[1],e)))}insertPoint(e){var r;const t=e?Ne(e,this.getMap().getView().getProjection()):(r=this.vertexFeature_)==null?void 0:r.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((s,o)=>s||this.insertVertex_(o,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,i,r){this.rBush_.forEachInExtent(e.getExtent(),function(s){s.geometry===e&&(i===void 0||s.depth===void 0||Fi(s.depth,i))&&s.index>t&&(s.index+=r)})}}function Hv(n,e){return n.index-e.index}function pA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"){let s=i;if(e.index===wo){const o=Sr(s.getCenter(),Ne(n)),a=Math.sqrt(o)-s.getRadius();return a*a}}const r=Ne(n);return fs[0]=Ne(e.segment[0]),fs[1]=Ne(e.segment[1]),vm(r,fs)}function AA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"&&e.index===wo)return Vn(i.getClosestPoint(Ne(n)));const r=Ne(n);return fs[0]=Ne(e.segment[0]),fs[1]=Ne(e.segment[1]),Vn(gd(r,fs))}function Xv(){const n=Pf();return function(e,t){return n.Point}}const mA=new Ut({color:"rgba(255,255,255,0.4)"}),yA=new Vt({color:"#3399CC",width:1.25}),_A=[new Qe({image:new Jn({fill:mA,stroke:yA,radius:5}),fill:mA,stroke:yA})],Yv=`
|
|
115
|
+
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="%23fb484b" viewBox="0 0 24 24">
|
|
116
|
+
<path fill-rule="evenodd" d="M11.906 1.994a8.002 8.002 0 0 1 8.09 8.421 7.996 7.996 0 0 1-1.297 3.957.996.996 0 0 1-.133.204l-.108.129c-.178.243-.37.477-.573.699l-5.112 6.224a1 1 0 0 1-1.545 0L5.982 15.26l-.002-.002a18.146 18.146 0 0 1-.309-.38l-.133-.163a.999.999 0 0 1-.13-.202 7.995 7.995 0 0 1 6.498-12.518ZM15 9.997a3 3 0 1 1-5.999 0 3 3 0 0 1 5.999 0Z" clip-rule="evenodd" />
|
|
117
|
+
</svg>
|
|
118
|
+
`,Kv=new Qe({image:new $n({opacity:1,src:"data:image/svg+xml;utf8,"+Yv,anchor:[.5,1]})});class Zv extends fn{constructor(t){super();_e(this,ui);_e(this,ur,null);_e(this,Ht,null);_e(this,hi,null);_e(this,Ri);_e(this,Pn,null);_e(this,dr,new Set);Mi(this,"drawInteraction");Mi(this,"modifyInteraction");_e(this,Yi,null);_e(this,Ki,!1);_e(this,Zi,null);Re(this,ur,t.yioMap)}getEditLayer(){return L(this,Ht)}clearModifiedFeatures(){const t=L(this,Ht).getSource(),i=t.getFeatures().filter(r=>r.get("id")!==void 0);t.removeFeatures(i),L(this,dr).clear()}clearCreatedFeatures(){const t=L(this,Ht).getSource(),i=t.getFeatures().filter(r=>r.get("id")===void 0);t.removeFeatures(i)}async setActive(t){var r;if(t===this.getActive())return;const i=this.getMap();if(i){if(t){const s=await L(this,ur)._getContentLayerPromise();if(!tA(s,"edits").length){console.warn('No edits source found in content layer. Please add a source with key "edits" and at least one layer that uses it.');const a=s.get("mapbox-style");a.sources.edits={type:"geojson",data:{type:"FeatureCollection",features:[]}};for(const l of a.layers)((r=a.sources[l.source])==null?void 0:r.type)!=="vector"&&(l.type!=="circle"||l.type!=="symbol")||await gv(s,{id:"edits-"+l.id,source:"edits","source-layer":l["source-layer"],type:"circle",paint:{"circle-radius":5,"circle-color":"#ff0000","circle-stroke-width":1}})}Re(this,Ht,tA(s,"edits")[0]),Re(this,hi,L(this,ur)._getContentLayer().getLayers().getArray().filter(a=>a instanceof cr).pop()),L(this,Yi)||(Re(this,Yi,L(this,hi).getStyle()),L(this,hi).setStyle((a,l)=>{if(!L(this,dr).has(a.get("id")))return L(this,Yi).call(this,a,l)})),L(this,Zi)||(Re(this,Zi,a=>{if(!this.modifyEnabled)return i.getTargetElement().style.cursor="",Re(this,Ki,!1),null;Re(this,Ki,!!At(this,ui,Gu).call(this,a.pixel)),L(this,Ki)?i.getTargetElement().classList.add("cursor-move"):i.getTargetElement().classList.remove("cursor-move")}),i.on("pointermove",L(this,Zi))),At(this,ui,RA).call(this)}else L(this,Yi)&&(L(this,hi).setStyle(L(this,Yi)),Re(this,Yi,null)),Re(this,Ri,null),L(this,Zi)&&(i.un("pointermove",L(this,Zi)),Re(this,Zi,null)),At(this,ui,SA).call(this);super.setActive(t)}}get createEnabled(){return!!L(this,Ri)}async setCreateEnabled(t){Re(this,Ri,t||void 0),t||(this.clearCreatedFeatures(),L(this,hi).getSource().refresh()),await this.setActive(!!t||!!L(this,Pn)),this.drawInteraction&&this.drawInteraction.setMap(t?this.getMap():null),this.modifyInteraction&&this.modifyInteraction.setMap(t||L(this,Pn)?this.getMap():null)}get modifyEnabled(){return!!L(this,Pn)||!!L(this,Ri)}async setModifyEnabled(t){t&&t.length===0&&(t=null),t||(this.clearModifiedFeatures(),L(this,hi).getSource().refresh()),Re(this,Pn,t),await this.setActive(!!t||!!L(this,Ri)),this.modifyInteraction&&this.modifyInteraction.setMap(t||L(this,Ri)?this.getMap():null)}handleEvent(t){let i=!0;if(t.type==="pointerdown"){const r=At(this,ui,Gu).call(this,t.pixel);if(r&&r instanceof tt&&this.modifyEnabled){const s=r.get("id");L(this,dr).has(s)||L(this,dr).add(s),L(this,hi).changed();const o=Xf(r);L(this,Ht).getSource().addFeature(o)}}return i&&this.modifyEnabled&&(i=this.modifyInteraction.handleEvent(t)),i&&this.createEnabled&&(i=this.drawInteraction.handleEvent(t)),i&&t.type==="click"&&At(this,ui,TA).call(this,t),i}}ur=new WeakMap,Ht=new WeakMap,hi=new WeakMap,Ri=new WeakMap,Pn=new WeakMap,dr=new WeakMap,ui=new WeakSet,TA=function(t){L(this,ur)._handleClick(t.originalEvent)},Yi=new WeakMap,Ki=new WeakMap,RA=function(){this.drawInteraction=new zv({source:L(this,Ht).getSource(),condition:t=>ra(t)?this.createEnabled&&!L(this,Ki):!1,type:"Point",style:()=>L(this,Ki)?null:_A}),this.getMap().addInteraction(this.drawInteraction),this.drawInteraction.on("drawend",t=>{t.feature.set("mvt:layer",L(this,Ri))}),this.modifyInteraction=new Wv({source:L(this,Ht).getSource(),condition:t=>Sc(t)?this.modifyEnabled:!1,style:()=>L(this,Ki)?null:_A}),this.getMap().addInteraction(this.modifyInteraction)},SA=function(){this.drawInteraction&&(this.drawInteraction.setMap(null),this.drawInteraction=null),this.modifyInteraction&&(this.modifyInteraction.setMap(null),this.modifyInteraction=null)},Zi=new WeakMap,Gu=function(t){const r=this.getMap().getFeaturesAtPixel(t,{layerFilter:s=>s===L(this,Ht)||s==L(this,hi)}).filter(s=>{var o;return s.getGeometry().getType()==="Point"&&(L(this,Ht).getSource().hasFeature(s)||((o=L(this,Pn))==null?void 0:o.includes(s.get("id"))))});return r.length?r[0]:null};class Qv extends fn{constructor(t){super();_e(this,vl);_e(this,vo,null);_e(this,fr,new bn({source:new En}));Re(this,vo,t.yioMap),this.setActive(!1)}setMap(t){const i=this.getMap();i&&i.removeLayer(L(this,fr)),t&&(t.addLayer(L(this,fr)),super.setMap(t))}setActive(t){t||L(this,fr).getSource().clear(),super.setActive(t)}handleEvent(t){return t.type==="click"&&At(this,vl,IA).call(this,t),!0}}vo=new WeakMap,fr=new WeakMap,vl=new WeakSet,IA=function(t){const i=this.getMap(),r=L(this,vo)._getContentLayer(),s=L(this,fr).getSource(),o=i.getFeaturesAtPixel(t.pixel,{layerFilter:a=>r.getLayers().getArray().includes(a)});if(s.clear(),o.length===0){const a=new Pt(new yt(t.coordinate));a.setStyle(Kv),s.addFeature(a)}};const qv="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20256%20256'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cg%20id='favicon'%3e%3crect%20x='0'%20y='0'%20width='256'%20height='256'%20style='fill:none;'/%3e%3cg%3e%3cpath%20d='M54.77,244.669C59.16,246.864%2071.078,250.001%2083.623,250.001C125.022,250.001%20142.585,223.029%20152.621,191.98L212.21,6L163.284,6L146.662,66.216C140.076,90.051%20135.999,112.005%20133.49,128L132.235,128C130.04,112.946%20123.14,86.288%20116.554,66.216L96.796,6L43.793,6L110.282,182.571C108.713,200.448%2098.677,210.17%2081.742,210.17C73.901,210.17%2067.315,208.288%2062.61,205.779L54.77,244.669Z'%20style='fill:rgb(223,72,110);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",El=document.createElement("img");El.src=qv,El.alt="yio.at",El.style.height="1em";const Jv=new sf({label:El,render:function(n){const e=this.element;if(!e||!n.frameState)return;const t=this.collectSourceAttributions_(n.frameState)??[],i=[];i.push(`
|
|
119
|
+
<a href="https://yio.at" target="_blank" rel="noopener">
|
|
120
|
+
<b>yio gmbh</b>
|
|
121
|
+
</a>
|
|
122
|
+
`);for(const o of t)i.push(o);const r=i.map((o,a)=>a===0?`<li>${o}</li>`:`<li><span style="margin: 0 4px 0 2px;">|</span>${o}</li>`).join("");let s=e.querySelector("ul");s||(s=document.createElement("ul"),e.appendChild(s)),s.innerHTML=r}});class wl extends vs{constructor(){super();_e(this,Yt);Mi(this,"notifyNextChange",!1);_e(this,lt,null);_e(this,Co,"");_e(this,gr,new Bi);_e(this,Qi,null);_e(this,pr,null);_e(this,Ar,null);_e(this,Xt,null);_e(this,bo,null);_e(this,To,null);_e(this,mr,!1);_e(this,yr,!1);_e(this,Mn,null);_e(this,Fn,null);this.center=[0,0],this.zoom=2,this.userSelect=[],Re(this,Qi,new Zv({yioMap:this})),Re(this,pr,new Bv({yioMap:this})),Re(this,Ar,new Qv({yioMap:this}))}_getContentLayer(){return L(this,gr)}_getContentLayerPromise(){return L(this,Xt)}_handleClick(t){t instanceof PointerEvent&&(this.lastClickCoordinate=Fd(L(this,lt).getEventCoordinate(t))),this.dispatchEvent(new PointerEvent("click",t))}get contentMap(){return L(this,Co)}set contentMap(t){Re(this,Co,t),At(this,Yt,PA).call(this)}get editCreate(){return L(this,bo)}set editCreate(t){Re(this,bo,t),L(this,Qi).setCreateEnabled(t)}set editModify(t){Re(this,To,t),L(this,Qi).setModifyEnabled(t)}get editModify(){return L(this,To)}get enableSelect(){return L(this,mr)}set enableSelect(t){Re(this,mr,t),L(this,pr).setActive(!!L(this,mr))}get enablePinning(){return L(this,yr)}set enablePinning(t){Re(this,yr,t),L(this,Ar).setActive(!!L(this,yr))}get geojsonSources(){return L(this,Mn)}set geojsonSources(t){Re(this,Mn,t)}get sourceLayerVisibility(){return L(this,Fn)}set sourceLayerVisibility(t){Re(this,Fn,t)}get editFeatures(){var r,s;const t=(s=(r=L(this,Qi).getEditLayer())==null?void 0:r.getSource())==null?void 0:s.getFeatures();return t?new sh().writeFeaturesObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}):null}firstUpdated(t){super.firstUpdated(t),At(this,Yt,MA).call(this);const i=this.shadowRoot.querySelector(".map");this.shadowRoot.addEventListener("click",r=>r.stopPropagation()),L(this,lt).setTarget(i)}updated(t){super.updated(t),t.has("sourceLayerVisibility")&&!t.has("contentMap")&&L(this,Xt)&&At(this,Yt,Nu).call(this),t.has("geojsonSources")&&!t.has("contentMap")&&L(this,Xt)&&At(this,Yt,Bu).call(this),!this.notifyNextChange&&(t.has("center")||t.has("zoom"))&&L(this,lt).getView().animate({center:Wo(this.center),zoom:this.zoom,duration:500}),this.notifyNextChange&&(this.notifyNextChange=!1,this.dispatchEvent(new CustomEvent("change",{composed:!0,bubbles:!0,detail:{changedProperties:t}})))}render(){return WA` <div class="map"></div> `}}return lt=new WeakMap,Co=new WeakMap,gr=new WeakMap,Qi=new WeakMap,pr=new WeakMap,Ar=new WeakMap,Xt=new WeakMap,bo=new WeakMap,To=new WeakMap,mr=new WeakMap,yr=new WeakMap,Mn=new WeakMap,Fn=new WeakMap,Yt=new WeakSet,PA=async function(){await L(this,Xt),L(this,gr).getLayers().clear(),Re(this,Xt,null),this.contentMap&&(Re(this,Xt,eA(L(this,gr),this.contentMap).catch(t=>{console.error("Error applying content to yiomap:",t)})),await L(this,Xt),await At(this,Yt,Nu).call(this),await At(this,Yt,Bu).call(this))},Bu=async function(){if(!L(this,Mn))return;const t=await L(this,Xt);if(!t)return;const i=Object.keys(L(this,Mn));try{await Promise.all(i.map(r=>{const s=L(this,Mn)[r];if(!iA(t,r))throw new Error("Geojson source '"+r+"' does not exist.");return Av(t,r,{type:"geojson",data:s})}))}catch(r){console.error("Error updating GeoJSON sources:",r)}},Nu=async function(){if(!L(this,Fn))return;const t=await L(this,Xt);if(!t)return;const i=t.get("mapbox-style"),r=Object.keys(i.layers);try{await Promise.all(r.map(s=>{const o=i.layers[s],a=o["source-layer"];if(!a||!(a in L(this,Fn)))return;const l=L(this,Fn)[a]?"visible":"none";pv(t,{...o,layout:{...o.layout,visibility:l}})}))}catch(s){console.error("Error updating source layer visibility:",s)}},MA=function(){Re(this,lt,new ya({controls:of({attribution:!1})})),L(this,lt).addControl(Jv),L(this,lt).addControl(new Gv({map:L(this,lt)})),L(this,lt).addLayer(L(this,gr)),L(this,lt).addInteraction(L(this,pr)),L(this,pr).setActive(L(this,mr)),L(this,lt).addInteraction(L(this,Ar)),L(this,Ar).setActive(L(this,yr)),L(this,lt).addInteraction(L(this,Qi)),L(this,Qi).setActive(!!this.editCreate||!!this.editModify);let t=!0;L(this,lt).on("moveend",()=>{if(t){t=!1;return}const i=L(this,lt).getView();this.notifyNextChange=!0,this.center=Fd(i.getCenter()),this.zoom=i.getZoom()})},Mi(wl,"styles",[bl(JA),bl($A),FA`
|
|
123
|
+
:host {
|
|
124
|
+
display: block;
|
|
125
|
+
height: 200px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.map {
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: 100%;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.cursor-pointer {
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.cursor-move {
|
|
138
|
+
cursor: move;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.cursor-pointer.cursor-move {
|
|
142
|
+
cursor: grab;
|
|
143
|
+
}
|
|
144
|
+
`]),Mi(wl,"properties",{center:{type:Array,reflect:!0},zoom:{type:Number,reflect:!0},contentMap:{type:String},editCreate:{type:String},editModify:{type:Array},enablePinning:{type:Boolean},enableSelect:{type:Boolean},geojsonSources:{type:Object},editFeatures:{attribute:!1},lastClickCoordinate:{type:Array,attribute:!1},userSelect:{attribute:!1},sourceLayerVisibility:{type:Object}}),window.customElements.define("yio-map",wl),wl});
|