@maptiler/geocoding-control 3.0.0-rc.6 → 3.0.0-rc.8

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.
Files changed (39) hide show
  1. package/check-version.js +69 -0
  2. package/dist/check-version.d.ts +1 -0
  3. package/dist/index.js +188 -178
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.umd.js +55 -50
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/leaflet.public.js +313 -303
  8. package/dist/leaflet.public.js.map +1 -1
  9. package/dist/leaflet.public.umd.js +51 -46
  10. package/dist/leaflet.public.umd.js.map +1 -1
  11. package/dist/maplibregl.js +188 -178
  12. package/dist/maplibregl.js.map +1 -1
  13. package/dist/maplibregl.umd.js +50 -45
  14. package/dist/maplibregl.umd.js.map +1 -1
  15. package/dist/maptilersdk.js +243 -233
  16. package/dist/maptilersdk.js.map +1 -1
  17. package/dist/maptilersdk.umd.js +62 -57
  18. package/dist/maptilersdk.umd.js.map +1 -1
  19. package/dist/openlayers.public.js +225 -214
  20. package/dist/openlayers.public.js.map +1 -1
  21. package/dist/openlayers.public.umd.js +51 -46
  22. package/dist/openlayers.public.umd.js.map +1 -1
  23. package/dist/src/components/clear-icon.d.ts +1 -0
  24. package/dist/src/components/fail-icon.d.ts +1 -0
  25. package/dist/src/components/loading-icon.d.ts +1 -0
  26. package/dist/src/components/marker.d.ts +1 -0
  27. package/dist/src/components/reverse-geocoding-icon.d.ts +1 -0
  28. package/dist/src/components/search-icon.d.ts +1 -0
  29. package/dist/src/controls/maplibregl-control.d.ts +2 -7
  30. package/dist/src/controls/maplibregl-events.d.ts +2 -3
  31. package/dist/src/controls/maplibregl-options.d.ts +1 -9
  32. package/dist/src/geocoder/geocoder-feature-item.d.ts +1 -0
  33. package/dist/src/geocoder/geocoder.d.ts +5 -2
  34. package/dist/src/index.d.ts +1 -0
  35. package/dist/src/leaflet.public.d.ts +1 -0
  36. package/dist/src/maplibregl.d.ts +1 -0
  37. package/dist/src/maptilersdk.d.ts +1 -0
  38. package/dist/src/openlayers.public.d.ts +1 -0
  39. package/package.json +20 -10
@@ -1,22 +1,22 @@
1
- (function(_,ne){typeof exports=="object"&&typeof module<"u"?ne(exports,require("ol"),require("ol/control"),require("ol/events/Event"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol","ol/control","ol/events/Event","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],ne):(_=typeof globalThis<"u"?globalThis:_||self,ne(_.maptilerGeocoder={},_.ol,_.ol.control,_.ol.events.Event,_.ol.geom,_.ol.layer.Vector,_.ol.proj,_.ol.source.Vector,_.ol.style.Fill,_.ol.style.Icon,_.ol.style.Stroke,_.ol.style.Style,_.ol.style.Text))})(this,(function(_,ne,br,Er,le,wr,ot,xr,di,Sr,fi,Lr,_r){"use strict";/**
1
+ (function(_,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("ol"),require("ol/control"),require("ol/events/Event"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol","ol/control","ol/events/Event","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],se):(_=typeof globalThis<"u"?globalThis:_||self,se(_.maptilerGeocoder={},_.ol,_.ol.control,_.ol.events.Event,_.ol.geom,_.ol.layer.Vector,_.ol.proj,_.ol.source.Vector,_.ol.style.Fill,_.ol.style.Icon,_.ol.style.Stroke,_.ol.style.Style,_.ol.style.Text))})(this,(function(_,se,br,Er,oe,wr,ot,xr,ui,Sr,di,Lr,_r){"use strict";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const lt=globalThis,kt=lt.ShadowRoot&&(lt.ShadyCSS===void 0||lt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,It=Symbol(),pi=new WeakMap;let mi=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==It)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(kt&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=pi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&pi.set(t,e))}return e}toString(){return this.cssText}};const at=r=>new mi(typeof r=="string"?r:r+"",void 0,It),_e=(r,...e)=>{const t=r.length===1?r[0]:e.reduce(((i,s,n)=>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 undefined, but take care to ensure page security.")})(s)+r[n+1]),r[0]);return new mi(t,r,It)},$r=(r,e)=>{if(kt)r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const i=document.createElement("style"),s=lt.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,r.appendChild(i)}},gi=kt?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return at(t)})(r):r;/**
5
+ */const lt=globalThis,Ct=lt.ShadowRoot&&(lt.ShadyCSS===void 0||lt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ot=Symbol(),fi=new WeakMap;let pi=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Ot)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(Ct&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=fi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&fi.set(t,e))}return e}toString(){return this.cssText}};const at=r=>new pi(typeof r=="string"?r:r+"",void 0,Ot),_e=(r,...e)=>{const t=r.length===1?r[0]:e.reduce(((i,s,n)=>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 undefined, but take care to ensure page security.")})(s)+r[n+1]),r[0]);return new pi(t,r,Ot)},$r=(r,e)=>{if(Ct)r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const i=document.createElement("style"),s=lt.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,r.appendChild(i)}},mi=Ct?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return at(t)})(r):r;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:Mr,defineProperty:Tr,getOwnPropertyDescriptor:Ar,getOwnPropertyNames:Cr,getOwnPropertySymbols:Or,getPrototypeOf:kr}=Object,ct=globalThis,yi=ct.trustedTypes,Ir=yi?yi.emptyScript:"",Nr=ct.reactiveElementPolyfillSupport,ze=(r,e)=>r,ht={toAttribute(r,e){switch(e){case Boolean:r=r?Ir:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Nt=(r,e)=>!Mr(r,e),vi={attribute:!0,type:String,converter:ht,reflect:!1,useDefault:!1,hasChanged:Nt};Symbol.metadata??=Symbol("metadata"),ct.litPropertyMetadata??=new WeakMap;let Ge=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=vi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&Tr(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:n}=Ar(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const l=s?.call(this);n?.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vi}static _$Ei(){if(this.hasOwnProperty(ze("elementProperties")))return;const e=kr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ze("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ze("properties"))){const t=this.properties,i=[...Cr(t),...Or(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,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 s of i)t.unshift(gi(s))}else e!==void 0&&t.push(gi(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(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.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 $r(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const n=(i.converter?.toAttribute!==void 0?i.converter:ht).toAttribute(t,i.type);this._$Em=e,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const n=i.getPropertyOptions(s),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:ht;this._$Em=s;const l=o.fromAttribute(t,n.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){const s=this.constructor,n=this[e];if(i??=s.getPropertyOptions(e),!((i.hasChanged??Nt)(n,t)||i.useDefault&&i.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:n},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){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(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[s,n]of this._$Ep)this[s]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,n]of i){const{wrapped:o}=n,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,n,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((i=>i.hostUpdate?.())),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ge.elementStyles=[],Ge.shadowRootOptions={mode:"open"},Ge[ze("elementProperties")]=new Map,Ge[ze("finalized")]=new Map,Nr?.({ReactiveElement:Ge}),(ct.reactiveElementVersions??=[]).push("2.1.1");/**
9
+ */const{is:Mr,defineProperty:Tr,getOwnPropertyDescriptor:Ar,getOwnPropertyNames:Cr,getOwnPropertySymbols:Or,getPrototypeOf:kr}=Object,ct=globalThis,gi=ct.trustedTypes,Ir=gi?gi.emptyScript:"",Pr=ct.reactiveElementPolyfillSupport,De=(r,e)=>r,ht={toAttribute(r,e){switch(e){case Boolean:r=r?Ir:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},kt=(r,e)=>!Mr(r,e),yi={attribute:!0,type:String,converter:ht,reflect:!1,useDefault:!1,hasChanged:kt};Symbol.metadata??=Symbol("metadata"),ct.litPropertyMetadata??=new WeakMap;let Ge=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=yi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&Tr(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:n}=Ar(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const l=s?.call(this);n?.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??yi}static _$Ei(){if(this.hasOwnProperty(De("elementProperties")))return;const e=kr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(De("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(De("properties"))){const t=this.properties,i=[...Cr(t),...Or(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,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 s of i)t.unshift(mi(s))}else e!==void 0&&t.push(mi(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(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.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 $r(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const n=(i.converter?.toAttribute!==void 0?i.converter:ht).toAttribute(t,i.type);this._$Em=e,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const n=i.getPropertyOptions(s),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:ht;this._$Em=s;const l=o.fromAttribute(t,n.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){const s=this.constructor,n=this[e];if(i??=s.getPropertyOptions(e),!((i.hasChanged??kt)(n,t)||i.useDefault&&i.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:n},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){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(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[s,n]of this._$Ep)this[s]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,n]of i){const{wrapped:o}=n,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,n,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((i=>i.hostUpdate?.())),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ge.elementStyles=[],Ge.shadowRootOptions={mode:"open"},Ge[De("elementProperties")]=new Map,Ge[De("finalized")]=new Map,Pr?.({ReactiveElement:Ge}),(ct.reactiveElementVersions??=[]).push("2.1.1");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const Pt=globalThis,ut=Pt.trustedTypes,bi=ut?ut.createPolicy("lit-html",{createHTML:r=>r}):void 0,Ei="$lit$",$e=`lit$${Math.random().toFixed(9).slice(2)}$`,wi="?"+$e,Pr=`<${wi}>`,Ce=document,qe=()=>Ce.createComment(""),He=r=>r===null||typeof r!="object"&&typeof r!="function",Rt=Array.isArray,Rr=r=>Rt(r)||typeof r?.[Symbol.iterator]=="function",Gt=`[
14
- \f\r]`,je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xi=/-->/g,Si=/>/g,Oe=RegExp(`>|${Gt}(?:([^\\s"'>=/]+)(${Gt}*=${Gt}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Li=/'/g,_i=/"/g,$i=/^(?:script|style|textarea|title)$/i,Mi=r=>(e,...t)=>({_$litType$:r,strings:e,undefined:t}),Z=Mi(1),Ve=Mi(2),we=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),Ti=new WeakMap,ke=Ce.createTreeWalker(Ce,129);function Ai(r,e){if(!Rt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return bi!==void 0?bi.createHTML(e):e}const Gr=(r,e)=>{const t=r.length-1,i=[];let s,n=e===2?"<svg>":e===3?"<math>":"",o=je;for(let l=0;l<t;l++){const u=r[l];let f,x,w=-1,$=0;for(;$<u.length&&(o.lastIndex=$,x=o.exec(u),x!==null);)$=o.lastIndex,o===je?x[1]==="!--"?o=xi:x[1]!==void 0?o=Si:x[2]!==void 0?($i.test(x[2])&&(s=RegExp("</"+x[2],"g")),o=Oe):x[3]!==void 0&&(o=Oe):o===Oe?x[0]===">"?(o=s??je,w=-1):x[1]===void 0?w=-2:(w=o.lastIndex-x[2].length,f=x[1],o=x[3]===void 0?Oe:x[3]==='"'?_i:Li):o===_i||o===Li?o=Oe:o===xi||o===Si?o=je:(o=Oe,s=void 0);const M=o===Oe&&r[l+1].startsWith("/>")?" ":"";n+=o===je?u+Pr:w>=0?(i.push(f),u.slice(0,w)+Ei+u.slice(w)+$e+M):u+$e+(w===-2?l:M)}return[Ai(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class Ze{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,o=0;const l=e.length-1,u=this.parts,[f,x]=Gr(e,t);if(this.el=Ze.createElement(f,i),ke.currentNode=this.el.content,t===2||t===3){const w=this.el.content.firstChild;w.replaceWith(...w.childNodes)}for(;(s=ke.nextNode())!==null&&u.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const w of s.getAttributeNames())if(w.endsWith(Ei)){const $=x[o++],M=s.getAttribute(w).split($e),T=/([.?@])?(.*)/.exec($);u.push({type:1,index:n,name:T[2],strings:M,ctor:T[1]==="."?Ur:T[1]==="?"?Br:T[1]==="@"?Dr:dt}),s.removeAttribute(w)}else w.startsWith($e)&&(u.push({type:6,index:n}),s.removeAttribute(w));if($i.test(s.tagName)){const w=s.textContent.split($e),$=w.length-1;if($>0){s.textContent=ut?ut.emptyScript:"";for(let M=0;M<$;M++)s.append(w[M],qe()),ke.nextNode(),u.push({type:2,index:++n});s.append(w[$],qe())}}}else if(s.nodeType===8)if(s.data===wi)u.push({type:2,index:n});else{let w=-1;for(;(w=s.data.indexOf($e,w+1))!==-1;)u.push({type:7,index:n}),w+=$e.length-1}n++}}static createElement(e,t){const i=Ce.createElement("template");return i.innerHTML=e,i}}function Fe(r,e,t=r,i){if(e===we)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl;const n=He(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=Fe(r,s._$AS(r,e.undefined),s,i)),e}let Fr=class{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,s=(e?.creationScope??Ce).importNode(t,!0);ke.currentNode=s;let n=ke.nextNode(),o=0,l=0,u=i[0];for(;u!==void 0;){if(o===u.index){let f;u.type===2?f=new Ue(n,n.nextSibling,this,e):u.type===1?f=new u.ctor(n,u.name,u.strings,this,e):u.type===6&&(f=new Wr(n,this,e)),this._$AV.push(f),u=i[++l]}o!==u?.index&&(n=ke.nextNode(),o++)}return ke.currentNode=Ce,s}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++}};class Ue{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Fe(this,e,t),He(e)?e===V||e==null||e===""?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==we&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Rr(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!==V&&He(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ce.createTextNode(e)),this._$AH=e}$(e){const{undefined:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ze.createElement(Ai(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{const n=new Fr(s,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=Ti.get(e.strings);return t===void 0&&Ti.set(e.strings,t=new Ze(e)),t}k(e){Rt(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const n of e)s===t.length?t.push(i=new Ue(this.O(qe()),this.O(qe()),this,this.options)):i=t[s],i._$AI(n),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class dt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,n){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}_$AI(e,t=this,i,s){const n=this.strings;let o=!1;if(n===void 0)e=Fe(this,e,t,0),o=!He(e)||e!==this._$AH&&e!==we,o&&(this._$AH=e);else{const l=e;let u,f;for(e=n[0],u=0;u<n.length-1;u++)f=Fe(this,l[i+u],t,u),f===we&&(f=this._$AH[u]),o||=!He(f)||f!==this._$AH[u],f===V?e=V:e!==V&&(e+=(f??"")+n[u+1]),this._$AH[u]=f}o&&!s&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Ur extends dt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class Br extends dt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class Dr extends dt{constructor(e,t,i,s,n){super(e,t,i,s,n),this.type=5}_$AI(e,t=this){if((e=Fe(this,e,t,0)??V)===we)return;const i=this._$AH,s=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==V&&(i===V||s);s&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Wr{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){Fe(this,e)}}const zr={I:Ue},qr=Pt.litHtmlPolyfillSupport;qr?.(Ze,Ue),(Pt.litHtmlVersions??=[]).push("3.3.1");const Hr=(r,e,t)=>{const i=t?.renderBefore??e;let s=i._$litPart$;if(s===void 0){const n=t?.renderBefore??null;i._$litPart$=s=new Ue(e.insertBefore(qe(),n),n,void 0,t??{})}return s._$AI(r),s};/**
13
+ */const It=globalThis,ut=It.trustedTypes,vi=ut?ut.createPolicy("lit-html",{createHTML:r=>r}):void 0,bi="$lit$",$e=`lit$${Math.random().toFixed(9).slice(2)}$`,Ei="?"+$e,Nr=`<${Ei}>`,Ce=document,ze=()=>Ce.createComment(""),qe=r=>r===null||typeof r!="object"&&typeof r!="function",Pt=Array.isArray,Rr=r=>Pt(r)||typeof r?.[Symbol.iterator]=="function",Nt=`[
14
+ \f\r]`,He=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wi=/-->/g,xi=/>/g,Oe=RegExp(`>|${Nt}(?:([^\\s"'>=/]+)(${Nt}*=${Nt}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Si=/'/g,Li=/"/g,_i=/^(?:script|style|textarea|title)$/i,$i=r=>(e,...t)=>({_$litType$:r,strings:e,undefined:t}),Z=$i(1),je=$i(2),we=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),Mi=new WeakMap,ke=Ce.createTreeWalker(Ce,129);function Ti(r,e){if(!Pt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return vi!==void 0?vi.createHTML(e):e}const Gr=(r,e)=>{const t=r.length-1,i=[];let s,n=e===2?"<svg>":e===3?"<math>":"",o=He;for(let l=0;l<t;l++){const u=r[l];let f,x,w=-1,$=0;for(;$<u.length&&(o.lastIndex=$,x=o.exec(u),x!==null);)$=o.lastIndex,o===He?x[1]==="!--"?o=wi:x[1]!==void 0?o=xi:x[2]!==void 0?(_i.test(x[2])&&(s=RegExp("</"+x[2],"g")),o=Oe):x[3]!==void 0&&(o=Oe):o===Oe?x[0]===">"?(o=s??He,w=-1):x[1]===void 0?w=-2:(w=o.lastIndex-x[2].length,f=x[1],o=x[3]===void 0?Oe:x[3]==='"'?Li:Si):o===Li||o===Si?o=Oe:o===wi||o===xi?o=He:(o=Oe,s=void 0);const M=o===Oe&&r[l+1].startsWith("/>")?" ":"";n+=o===He?u+Nr:w>=0?(i.push(f),u.slice(0,w)+bi+u.slice(w)+$e+M):u+$e+(w===-2?l:M)}return[Ti(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class Ve{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,o=0;const l=e.length-1,u=this.parts,[f,x]=Gr(e,t);if(this.el=Ve.createElement(f,i),ke.currentNode=this.el.content,t===2||t===3){const w=this.el.content.firstChild;w.replaceWith(...w.childNodes)}for(;(s=ke.nextNode())!==null&&u.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const w of s.getAttributeNames())if(w.endsWith(bi)){const $=x[o++],M=s.getAttribute(w).split($e),T=/([.?@])?(.*)/.exec($);u.push({type:1,index:n,name:T[2],strings:M,ctor:T[1]==="."?Ur:T[1]==="?"?Br:T[1]==="@"?Wr:dt}),s.removeAttribute(w)}else w.startsWith($e)&&(u.push({type:6,index:n}),s.removeAttribute(w));if(_i.test(s.tagName)){const w=s.textContent.split($e),$=w.length-1;if($>0){s.textContent=ut?ut.emptyScript:"";for(let M=0;M<$;M++)s.append(w[M],ze()),ke.nextNode(),u.push({type:2,index:++n});s.append(w[$],ze())}}}else if(s.nodeType===8)if(s.data===Ei)u.push({type:2,index:n});else{let w=-1;for(;(w=s.data.indexOf($e,w+1))!==-1;)u.push({type:7,index:n}),w+=$e.length-1}n++}}static createElement(e,t){const i=Ce.createElement("template");return i.innerHTML=e,i}}function Fe(r,e,t=r,i){if(e===we)return e;let s=i!==void 0?t._$Co?.[i]:t._$Cl;const n=qe(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,t,i)),i!==void 0?(t._$Co??=[])[i]=s:t._$Cl=s),s!==void 0&&(e=Fe(r,s._$AS(r,e.undefined),s,i)),e}let Fr=class{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,s=(e?.creationScope??Ce).importNode(t,!0);ke.currentNode=s;let n=ke.nextNode(),o=0,l=0,u=i[0];for(;u!==void 0;){if(o===u.index){let f;u.type===2?f=new Ue(n,n.nextSibling,this,e):u.type===1?f=new u.ctor(n,u.name,u.strings,this,e):u.type===6&&(f=new Dr(n,this,e)),this._$AV.push(f),u=i[++l]}o!==u?.index&&(n=ke.nextNode(),o++)}return ke.currentNode=Ce,s}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++}};class Ue{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Fe(this,e,t),qe(e)?e===V||e==null||e===""?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==we&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Rr(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!==V&&qe(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ce.createTextNode(e)),this._$AH=e}$(e){const{undefined:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ve.createElement(Ti(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{const n=new Fr(s,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=Mi.get(e.strings);return t===void 0&&Mi.set(e.strings,t=new Ve(e)),t}k(e){Pt(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const n of e)s===t.length?t.push(i=new Ue(this.O(ze()),this.O(ze()),this,this.options)):i=t[s],i._$AI(n),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class dt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,n){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}_$AI(e,t=this,i,s){const n=this.strings;let o=!1;if(n===void 0)e=Fe(this,e,t,0),o=!qe(e)||e!==this._$AH&&e!==we,o&&(this._$AH=e);else{const l=e;let u,f;for(e=n[0],u=0;u<n.length-1;u++)f=Fe(this,l[i+u],t,u),f===we&&(f=this._$AH[u]),o||=!qe(f)||f!==this._$AH[u],f===V?e=V:e!==V&&(e+=(f??"")+n[u+1]),this._$AH[u]=f}o&&!s&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Ur extends dt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class Br extends dt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class Wr extends dt{constructor(e,t,i,s,n){super(e,t,i,s,n),this.type=5}_$AI(e,t=this){if((e=Fe(this,e,t,0)??V)===we)return;const i=this._$AH,s=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==V&&(i===V||s);s&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Dr{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){Fe(this,e)}}const zr={I:Ue},qr=It.litHtmlPolyfillSupport;qr?.(Ve,Ue),(It.litHtmlVersions??=[]).push("3.3.1");const Hr=(r,e,t)=>{const i=t?.renderBefore??e;let s=i._$litPart$;if(s===void 0){const n=t?.renderBefore??null;i._$litPart$=s=new Ue(e.insertBefore(ze(),n),n,void 0,t??{})}return s._$AI(r),s};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */const Ft=globalThis;let ae=class extends Ge{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Hr(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return we}};ae._$litElement$=!0,ae.finalized=!0,Ft.litElementHydrateSupport?.({LitElement:ae});const jr=Ft.litElementPolyfillSupport;jr?.({LitElement:ae}),(Ft.litElementVersions??=[]).push("4.2.1");/**
19
+ */const Rt=globalThis;let le=class extends Ge{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Hr(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return we}};le._$litElement$=!0,le.finalized=!0,Rt.litElementHydrateSupport?.({LitElement:le});const jr=Rt.litElementPolyfillSupport;jr?.({LitElement:le}),(Rt.litElementVersions??=[]).push("4.2.1");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
@@ -24,11 +24,11 @@
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Vr={attribute:!0,type:String,converter:ht,reflect:!1,hasChanged:Nt},Zr=(r=Vr,e,t)=>{const{kind:i,metadata:s}=t;let n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),i==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(t.name,r),i==="accessor"){const{name:o}=t;return{set(l){const u=e.get.call(this);e.set.call(this,l),this.requestUpdate(o,u,r)},init(l){return l!==void 0&&this.C(o,void 0,r,l),l}}}if(i==="setter"){const{name:o}=t;return function(l){const u=this[o];e.call(this,l),this.requestUpdate(o,u,r)}}throw Error("Unsupported decorator location: "+i)};function I(r){return(e,t)=>typeof t=="object"?Zr(r,e,t):((i,s,n)=>{const o=s.hasOwnProperty(n);return s.constructor.createProperty(n,i),o?Object.getOwnPropertyDescriptor(s,n):void 0})(r,e,t)}/**
27
+ */const Vr={attribute:!0,type:String,converter:ht,reflect:!1,hasChanged:kt},Zr=(r=Vr,e,t)=>{const{kind:i,metadata:s}=t;let n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),i==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(t.name,r),i==="accessor"){const{name:o}=t;return{set(l){const u=e.get.call(this);e.set.call(this,l),this.requestUpdate(o,u,r)},init(l){return l!==void 0&&this.C(o,void 0,r,l),l}}}if(i==="setter"){const{name:o}=t;return function(l){const u=this[o];e.call(this,l),this.requestUpdate(o,u,r)}}throw Error("Unsupported decorator location: "+i)};function P(r){return(e,t)=>typeof t=="object"?Zr(r,e,t):((i,s,n)=>{const o=s.hasOwnProperty(n);return s.constructor.createProperty(n,i),o?Object.getOwnPropertyDescriptor(s,n):void 0})(r,e,t)}/**
28
28
  * @license
29
29
  * Copyright 2017 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */function ie(r){return I({...r,state:!0,attribute:!1})}/**
31
+ */function ee(r){return P({...r,state:!0,attribute:!1})}/**
32
32
  * @license
33
33
  * Copyright 2017 Google LLC
34
34
  * SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
36
36
  * @license
37
37
  * Copyright 2017 Google LLC
38
38
  * SPDX-License-Identifier: BSD-3-Clause
39
- */function Yr(r,e){return(t,i,s)=>{const n=o=>o.renderRoot?.querySelector(r)??null;return Kr(t,i,{get(){return n(this)}})}}var Xr=Object.getOwnPropertyDescriptor,Qr=(r,e,t,i)=>{for(var s=i>1?void 0:i?Xr(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeClearIconElement=class extends ae{render(){return Ve`
39
+ */function Yr(r,e){return(t,i,s)=>{const n=o=>o.renderRoot?.querySelector(r)??null;return Kr(t,i,{get(){return n(this)}})}}var Xr=Object.getOwnPropertyDescriptor,Qr=(r,e,t,i)=>{for(var s=i>1?void 0:i?Xr(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeClearIconElement=class extends le{render(){return je`
40
40
  <svg viewBox="0 0 14 14" width="13" height="13">
41
41
  <path
42
42
  d="M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"
@@ -47,7 +47,7 @@
47
47
  display: block;
48
48
  fill: var(--color-icon-button);
49
49
  }
50
- `,_.MaptilerGeocodeClearIconElement=Qr([Me("maptiler-geocode-clear-icon")],_.MaptilerGeocodeClearIconElement);var Jr=Object.getOwnPropertyDescriptor,es=(r,e,t,i)=>{for(var s=i>1?void 0:i?Jr(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeFailIconElement=class extends ae{render(){return Ve`
50
+ `,_.MaptilerGeocodeClearIconElement=Qr([Me("maptiler-geocode-clear-icon")],_.MaptilerGeocodeClearIconElement);var Jr=Object.getOwnPropertyDescriptor,es=(r,e,t,i)=>{for(var s=i>1?void 0:i?Jr(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeFailIconElement=class extends le{render(){return je`
51
51
  <svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
52
52
  <path
53
53
  d="M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"
@@ -58,7 +58,7 @@
58
58
  display: block;
59
59
  fill: #e15042;
60
60
  }
61
- `,_.MaptilerGeocodeFailIconElement=es([Me("maptiler-geocode-fail-icon")],_.MaptilerGeocodeFailIconElement);var ts=Object.getOwnPropertyDescriptor,is=(r,e,t,i)=>{for(var s=i>1?void 0:i?ts(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeLoadingIconElement=class extends ae{render(){return Z`
61
+ `,_.MaptilerGeocodeFailIconElement=es([Me("maptiler-geocode-fail-icon")],_.MaptilerGeocodeFailIconElement);var ts=Object.getOwnPropertyDescriptor,is=(r,e,t,i)=>{for(var s=i>1?void 0:i?ts(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeLoadingIconElement=class extends le{render(){return Z`
62
62
  <div>
63
63
  <svg viewBox="0 0 18 18" width="24" height="24" class="loading-icon">
64
64
  <path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z" />
@@ -91,7 +91,7 @@
91
91
  transform: rotate(360deg);
92
92
  }
93
93
  }
94
- `,_.MaptilerGeocodeLoadingIconElement=is([Me("maptiler-geocode-loading-icon")],_.MaptilerGeocodeLoadingIconElement);var rs=Object.getOwnPropertyDescriptor,ss=(r,e,t,i)=>{for(var s=i>1?void 0:i?rs(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeReverseGeocodingIconElement=class extends ae{render(){return Ve`
94
+ `,_.MaptilerGeocodeLoadingIconElement=is([Me("maptiler-geocode-loading-icon")],_.MaptilerGeocodeLoadingIconElement);var rs=Object.getOwnPropertyDescriptor,ss=(r,e,t,i)=>{for(var s=i>1?void 0:i?rs(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeReverseGeocodingIconElement=class extends le{render(){return je`
95
95
  <svg viewBox="0 0 60.006 21.412" width="14" height="20">
96
96
  <path
97
97
  d="M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"
@@ -102,7 +102,7 @@
102
102
  display: block;
103
103
  fill: var(--color-icon-button);
104
104
  }
105
- `,_.MaptilerGeocodeReverseGeocodingIconElement=ss([Me("maptiler-geocode-reverse-geocoding-icon")],_.MaptilerGeocodeReverseGeocodingIconElement);var ns=Object.getOwnPropertyDescriptor,os=(r,e,t,i)=>{for(var s=i>1?void 0:i?ns(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeSearchIconElement=class extends ae{render(){return Ve`
105
+ `,_.MaptilerGeocodeReverseGeocodingIconElement=ss([Me("maptiler-geocode-reverse-geocoding-icon")],_.MaptilerGeocodeReverseGeocodingIconElement);var ns=Object.getOwnPropertyDescriptor,os=(r,e,t,i)=>{for(var s=i>1?void 0:i?ns(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeSearchIconElement=class extends le{render(){return je`
106
106
  <svg
107
107
  xmlns="http://www.w3.org/2000/svg"
108
108
  width="13"
@@ -127,27 +127,27 @@
127
127
  display: block;
128
128
  stroke: var(--color-icon-button);
129
129
  }
130
- `,_.MaptilerGeocodeSearchIconElement=os([Me("maptiler-geocode-search-icon")],_.MaptilerGeocodeSearchIconElement);const ls=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,Ci=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,Oi=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,ki=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,Ii=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,Ni=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function as(r){if(!["DMS","DM","DD"].includes(r))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(M=>Number(M.trim())),t=Number(e[0]),i=Number(e[1]),s=Math.abs(t),n=Math.abs(i),o=t>0?"N":"S",l=i>0?"E":"W";let u;r=="DD"&&(u=`${s}° ${o}, ${n}° ${l}`);const f=Math.floor(s),x=Math.floor(n),w=(s-f)*60,$=(n-x)*60;if(r=="DM"){let M=Pi(w,3).toFixed(3).padStart(6,"0"),T=Pi($,3).toFixed(3).padStart(6,"0");M.endsWith(".000")&&T.endsWith(".000")&&(M=M.replace(/\.000$/,""),T=T.replace(/\.000$/,"")),u=`${f}° ${M}' ${o}, ${x}° ${T}' ${l}`}if(r=="DMS"){const M=Math.floor(w),T=Math.floor($);let R=((w-M)*60).toFixed(1).padStart(4,"0"),F=(($-T)*60).toFixed(1).padStart(4,"0");const G=M.toString().padStart(2,"0"),L=T.toString().padStart(2,"0");R.endsWith(".0")&&F.endsWith(".0")&&(R=R.replace(/\.0$/,""),F=F.replace(/\.0$/,"")),u=`${f}° ${G}' ${R}" ${o}, ${x}° ${L}' ${F}" ${l}`}return u}else throw new Error("no decimal coordinates to convert")}function Pi(r,e){const t=Math.pow(10,e);return Math.round((r+Number.EPSILON)*t)/t}function Ut(r,e){e||(e=5),r=r.replace(/\s+/g," ").trim();let t=null,i=null,s="",n="",o=null,l=[],u=!1;if(ls.test(r))throw new Error("invalid coordinate value");if(Ci.test(r))if(l=Ci.exec(r),u=Ke(l),u)t=Math.abs(l[1])+l[2]/60,Number(l[1])<0&&(t*=-1),i=Math.abs(l[3])+l[4]/60,Number(l[3])<0&&(i*=-1),o="DM";else throw new Error("invalid coordinate format");else if(Oi.test(r))if(l=Oi.exec(r),u=Ke(l),u){if(t=l[2],i=l[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),o="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");l[1]?(s=l[1],n=l[5]):l[4]&&(s=l[4],n=l[8])}else throw new Error("invalid decimal coordinate format");else if(ki.test(r))if(l=ki.exec(r),u=Ke(l),u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4]/60,o="DM"),l[6]&&(t+=l[6].replace(",",".")/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),i=Math.abs(parseInt(l[9])),l[11]&&(i+=l[11]/60),l[13]&&(i+=l[13].replace(",",".")/3600),parseInt(l[9])<0&&(i=-1*i),l[1]?(s=l[1],n=l[8]):l[7]&&(s=l[7],n=l[14]);else throw new Error("invalid DMS coordinates format");else if(Ii.test(r))if(l=Ii.exec(r),u=Ke(l),u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4]/60,o="DM"),l[6]&&(t+=l[6]/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),i=Math.abs(parseInt(l[10])),l[12]&&(i+=l[12]/60),l[14]&&(i+=l[14]/3600),parseInt(l[10])<0&&(i=-1*i),l[1]?(s=l[1],n=l[9]):l[8]&&(s=l[8],n=l[16]);else throw new Error("invalid DMS coordinates format");else if(Ni.test(r)){if(l=Ni.exec(r),u=Ke(l),l.filter(f=>f).length<=5)throw new Error("invalid coordinates format");if(u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4].replace(",",".")/60,o="DM"),l[6]&&(t+=l[6].replace(",",".")/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),i=Math.abs(parseInt(l[10])),l[12]&&(i+=l[12].replace(",",".")/60),l[14]&&(i+=l[14].replace(",",".")/3600),parseInt(l[10])<0&&(i=-1*i),l[1]?(s=l[1],n=l[9]):l[8]&&(s=l[8],n=l[16]);else throw new Error("invalid coordinates format")}if(u){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(s&&!n||!s&&n)throw new Error("invalid coordinates value");if(s&&s==n)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let f=/S|SOUTH/i;f.test(s)&&t>0&&(t=-1*t),f=/W|WEST/i,f.test(n)&&i>0&&(i=-1*i);const x=l[0].trim();let w,$;const M=/[,/;\u0020]/g,T=x.match(M);if(T==null){const G=Math.floor(r.length/2);w=x.substring(0,G).trim(),$=x.substring(G).trim()}else{let G;T.length%2==1?G=Math.floor(T.length/2):G=T.length/2-1;let L=0;if(G==0)L=x.indexOf(T[0]),w=x.substring(0,L).trim(),$=x.substring(L+1).trim();else{let Q=0,oe=0;for(;Q<=G;)L=x.indexOf(T[Q],oe),oe=L+1,Q++;w=x.substring(0,L).trim(),$=x.substring(L+1).trim()}}const R=w.split(".");if(R.length==2&&R[1]==0&&R[1].length!=2)throw new Error("invalid coordinates format");const F=$.split(".");if(F.length==2&&F[1]==0&&F[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(w)||/^\d+$/.test($))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:x,verbatimLatitude:w,verbatimLongitude:$,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:o,closeEnough:cs,toCoordinateFormat:as})}else throw new Error("coordinates pattern match failed")}function Ke(r){if(!isNaN(r[0]))return!1;const e=[...r];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,s=e.length/2;for(let n=0;n<s;n++){const o=e[n],l=e[n+s],u=t.test(o)&&t.test(l),f=i.test(o)&&i.test(l),x=o==l;if(!(o==null&&l==null)){if(o==null||l==null)return!1;if(u||f||x)continue;return!1}}return!0}function Ri(r,e){const t=Math.abs(r-e);return Number(t.toFixed(6))<=1e-5}function cs(r){if(!r)throw new Error("coords must be provided");if(r.includes(",")){const e=r.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return Ri(this.decimalLatitude,Number(e[0]))&&Ri(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const hs=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Ut.to=hs;const us=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],ds={decimalLatitude:40.123,decimalLongitude:-74.123},fs=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],ps=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function ms(){const r=[];return us.forEach(e=>{e.decimalLatitude?r.push(e):r.push({...e,...ds})}),[...r,...fs,...ps]}const gs=ms();Ut.formats=gs.map(r=>r.verbatimCoordinates);const ys=Ut;/**
130
+ `,_.MaptilerGeocodeSearchIconElement=os([Me("maptiler-geocode-search-icon")],_.MaptilerGeocodeSearchIconElement);const ls=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,Ai=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,Ci=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,Oi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,ki=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,Ii=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function as(r){if(!["DMS","DM","DD"].includes(r))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(M=>Number(M.trim())),t=Number(e[0]),i=Number(e[1]),s=Math.abs(t),n=Math.abs(i),o=t>0?"N":"S",l=i>0?"E":"W";let u;r=="DD"&&(u=`${s}° ${o}, ${n}° ${l}`);const f=Math.floor(s),x=Math.floor(n),w=(s-f)*60,$=(n-x)*60;if(r=="DM"){let M=Pi(w,3).toFixed(3).padStart(6,"0"),T=Pi($,3).toFixed(3).padStart(6,"0");M.endsWith(".000")&&T.endsWith(".000")&&(M=M.replace(/\.000$/,""),T=T.replace(/\.000$/,"")),u=`${f}° ${M}' ${o}, ${x}° ${T}' ${l}`}if(r=="DMS"){const M=Math.floor(w),T=Math.floor($);let R=((w-M)*60).toFixed(1).padStart(4,"0"),F=(($-T)*60).toFixed(1).padStart(4,"0");const G=M.toString().padStart(2,"0"),L=T.toString().padStart(2,"0");R.endsWith(".0")&&F.endsWith(".0")&&(R=R.replace(/\.0$/,""),F=F.replace(/\.0$/,"")),u=`${f}° ${G}' ${R}" ${o}, ${x}° ${L}' ${F}" ${l}`}return u}else throw new Error("no decimal coordinates to convert")}function Pi(r,e){const t=Math.pow(10,e);return Math.round((r+Number.EPSILON)*t)/t}function Gt(r,e){e||(e=5),r=r.replace(/\s+/g," ").trim();let t=null,i=null,s="",n="",o=null,l=[],u=!1;if(ls.test(r))throw new Error("invalid coordinate value");if(Ai.test(r))if(l=Ai.exec(r),u=Ze(l),u)t=Math.abs(l[1])+l[2]/60,Number(l[1])<0&&(t*=-1),i=Math.abs(l[3])+l[4]/60,Number(l[3])<0&&(i*=-1),o="DM";else throw new Error("invalid coordinate format");else if(Ci.test(r))if(l=Ci.exec(r),u=Ze(l),u){if(t=l[2],i=l[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),o="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");l[1]?(s=l[1],n=l[5]):l[4]&&(s=l[4],n=l[8])}else throw new Error("invalid decimal coordinate format");else if(Oi.test(r))if(l=Oi.exec(r),u=Ze(l),u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4]/60,o="DM"),l[6]&&(t+=l[6].replace(",",".")/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),i=Math.abs(parseInt(l[9])),l[11]&&(i+=l[11]/60),l[13]&&(i+=l[13].replace(",",".")/3600),parseInt(l[9])<0&&(i=-1*i),l[1]?(s=l[1],n=l[8]):l[7]&&(s=l[7],n=l[14]);else throw new Error("invalid DMS coordinates format");else if(ki.test(r))if(l=ki.exec(r),u=Ze(l),u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4]/60,o="DM"),l[6]&&(t+=l[6]/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),i=Math.abs(parseInt(l[10])),l[12]&&(i+=l[12]/60),l[14]&&(i+=l[14]/3600),parseInt(l[10])<0&&(i=-1*i),l[1]?(s=l[1],n=l[9]):l[8]&&(s=l[8],n=l[16]);else throw new Error("invalid DMS coordinates format");else if(Ii.test(r)){if(l=Ii.exec(r),u=Ze(l),l.filter(f=>f).length<=5)throw new Error("invalid coordinates format");if(u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4].replace(",",".")/60,o="DM"),l[6]&&(t+=l[6].replace(",",".")/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),i=Math.abs(parseInt(l[10])),l[12]&&(i+=l[12].replace(",",".")/60),l[14]&&(i+=l[14].replace(",",".")/3600),parseInt(l[10])<0&&(i=-1*i),l[1]?(s=l[1],n=l[9]):l[8]&&(s=l[8],n=l[16]);else throw new Error("invalid coordinates format")}if(u){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(s&&!n||!s&&n)throw new Error("invalid coordinates value");if(s&&s==n)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let f=/S|SOUTH/i;f.test(s)&&t>0&&(t=-1*t),f=/W|WEST/i,f.test(n)&&i>0&&(i=-1*i);const x=l[0].trim();let w,$;const M=/[,/;\u0020]/g,T=x.match(M);if(T==null){const G=Math.floor(r.length/2);w=x.substring(0,G).trim(),$=x.substring(G).trim()}else{let G;T.length%2==1?G=Math.floor(T.length/2):G=T.length/2-1;let L=0;if(G==0)L=x.indexOf(T[0]),w=x.substring(0,L).trim(),$=x.substring(L+1).trim();else{let Q=0,ne=0;for(;Q<=G;)L=x.indexOf(T[Q],ne),ne=L+1,Q++;w=x.substring(0,L).trim(),$=x.substring(L+1).trim()}}const R=w.split(".");if(R.length==2&&R[1]==0&&R[1].length!=2)throw new Error("invalid coordinates format");const F=$.split(".");if(F.length==2&&F[1]==0&&F[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(w)||/^\d+$/.test($))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:x,verbatimLatitude:w,verbatimLongitude:$,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:o,closeEnough:cs,toCoordinateFormat:as})}else throw new Error("coordinates pattern match failed")}function Ze(r){if(!isNaN(r[0]))return!1;const e=[...r];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,s=e.length/2;for(let n=0;n<s;n++){const o=e[n],l=e[n+s],u=t.test(o)&&t.test(l),f=i.test(o)&&i.test(l),x=o==l;if(!(o==null&&l==null)){if(o==null||l==null)return!1;if(u||f||x)continue;return!1}}return!0}function Ni(r,e){const t=Math.abs(r-e);return Number(t.toFixed(6))<=1e-5}function cs(r){if(!r)throw new Error("coords must be provided");if(r.includes(",")){const e=r.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return Ni(this.decimalLatitude,Number(e[0]))&&Ni(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const hs=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Gt.to=hs;const us=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],ds={decimalLatitude:40.123,decimalLongitude:-74.123},fs=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],ps=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function ms(){const r=[];return us.forEach(e=>{e.decimalLatitude?r.push(e):r.push({...e,...ds})}),[...r,...fs,...ps]}const gs=ms();Gt.formats=gs.map(r=>r.verbatimCoordinates);const ys=Gt;/**
131
131
  * @license
132
132
  * Copyright 2017 Google LLC
133
133
  * SPDX-License-Identifier: BSD-3-Clause
134
- */const Bt={ATTRIBUTE:1,CHILD:2},Dt=r=>(...e)=>({_$litDirective$:r,undefined:e});let Wt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
134
+ */const Ft={ATTRIBUTE:1,CHILD:2},Ut=r=>(...e)=>({_$litDirective$:r,undefined:e});let Bt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
135
135
  * @license
136
136
  * Copyright 2018 Google LLC
137
137
  * SPDX-License-Identifier: BSD-3-Clause
138
- */const ft=Dt(class extends Wt{constructor(r){if(super(r),r.type!==Bt.ATTRIBUTE||r.name!=="class"||r.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter((e=>r[e])).join(" ")+" "}update(r,[e]){if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter((i=>i!==""))));for(const i in e)e[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(e)}const t=r.element.classList;for(const i of this.st)i in e||(t.remove(i),this.st.delete(i));for(const i in e){const s=!!e[i];s===this.st.has(i)||this.nt?.has(i)||(s?(t.add(i),this.st.add(i)):(t.remove(i),this.st.delete(i)))}return we}});/**
138
+ */const ft=Ut(class extends Bt{constructor(r){if(super(r),r.type!==Ft.ATTRIBUTE||r.name!=="class"||r.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter((e=>r[e])).join(" ")+" "}update(r,[e]){if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter((i=>i!==""))));for(const i in e)e[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(e)}const t=r.element.classList;for(const i of this.st)i in e||(t.remove(i),this.st.delete(i));for(const i in e){const s=!!e[i];s===this.st.has(i)||this.nt?.has(i)||(s?(t.add(i),this.st.add(i)):(t.remove(i),this.st.delete(i)))}return we}});/**
139
139
  * @license
140
140
  * Copyright 2020 Google LLC
141
141
  * SPDX-License-Identifier: BSD-3-Clause
142
- */const{I:vs}=zr,Gi=()=>document.createComment(""),Ye=(r,e,t)=>{const i=r._$AA.parentNode,s=e===void 0?r._$AB:e._$AA;if(t===void 0){const n=i.insertBefore(Gi(),s),o=i.insertBefore(Gi(),s);t=new vs(n,o,r,r.options)}else{const n=t._$AB.nextSibling,o=t._$AM,l=o!==r;if(l){let u;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(u=r._$AU)!==o._$AU&&t._$AP(u)}if(n!==s||l){let u=t._$AA;for(;u!==n;){const f=u.nextSibling;i.insertBefore(u,s),u=f}}}return t},Ie=(r,e,t=r)=>(r._$AI(e,t),r),bs={},Es=(r,e=bs)=>r._$AH=e,ws=r=>r._$AH,zt=r=>{r._$AR(),r._$AA.remove()};/**
142
+ */const{I:vs}=zr,Ri=()=>document.createComment(""),Ke=(r,e,t)=>{const i=r._$AA.parentNode,s=e===void 0?r._$AB:e._$AA;if(t===void 0){const n=i.insertBefore(Ri(),s),o=i.insertBefore(Ri(),s);t=new vs(n,o,r,r.options)}else{const n=t._$AB.nextSibling,o=t._$AM,l=o!==r;if(l){let u;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(u=r._$AU)!==o._$AU&&t._$AP(u)}if(n!==s||l){let u=t._$AA;for(;u!==n;){const f=u.nextSibling;i.insertBefore(u,s),u=f}}}return t},Ie=(r,e,t=r)=>(r._$AI(e,t),r),bs={},Es=(r,e=bs)=>r._$AH=e,ws=r=>r._$AH,Wt=r=>{r._$AR(),r._$AA.remove()};/**
143
143
  * @license
144
144
  * Copyright 2017 Google LLC
145
145
  * SPDX-License-Identifier: BSD-3-Clause
146
- */const Fi=(r,e,t)=>{const i=new Map;for(let s=e;s<=t;s++)i.set(r[s],s);return i},xs=Dt(class extends Wt{constructor(r){if(super(r),r.type!==Bt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const s=[],n=[];let o=0;for(const l of r)s[o]=i?i(l,o):o,n[o]=t(l,o),o++;return{undefined:n,keys:s}}render(r,e,t){return this.dt(r,e,t).undefined}update(r,[e,t,i]){const s=ws(r),{undefined:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(s))return this.ut=o,n;const l=this.ut??=[],u=[];let f,x,w=0,$=s.length-1,M=0,T=n.length-1;for(;w<=$&&M<=T;)if(s[w]===null)w++;else if(s[$]===null)$--;else if(l[w]===o[M])u[M]=Ie(s[w],n[M]),w++,M++;else if(l[$]===o[T])u[T]=Ie(s[$],n[T]),$--,T--;else if(l[w]===o[T])u[T]=Ie(s[w],n[T]),Ye(r,u[T+1],s[w]),w++,T--;else if(l[$]===o[M])u[M]=Ie(s[$],n[M]),Ye(r,s[w],s[$]),$--,M++;else if(f===void 0&&(f=Fi(o,M,T),x=Fi(l,w,$)),f.has(l[w]))if(f.has(l[$])){const R=x.get(o[M]),F=R!==void 0?s[R]:null;if(F===null){const G=Ye(r,s[w]);Ie(G,n[M]),u[M]=G}else u[M]=Ie(F,n[M]),Ye(r,s[w],F),s[R]=null;M++}else zt(s[$]),$--;else zt(s[w]),w++;for(;M<=T;){const R=Ye(r,u[T+1]);Ie(R,n[M]),u[M++]=R}for(;w<=$;){const R=s[w++];R!==null&&zt(R)}return this.ut=o,Es(r,u),we}});function Ss(r,e,t){const i=e[1],s=e[0],n=i-s;return r===i&&t?r:((r-s)%n+n)%n+s}function pt(r){const e=[...r];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Xe;async function Ls(r,e,t){for(const i of e??[])if(!(r&&(i.minZoom!=null&&i.minZoom>r[0]||i.maxZoom!=null&&i.maxZoom<r[0]))){if(i.type==="fixed")return i.coordinates.join(",");if(i.type==="client-geolocation")if(Xe&&i.cachedLocationExpiry&&Xe.time+i.cachedLocationExpiry>Date.now()){if(Xe.coords)return Xe.coords}else{let s;try{return s=await new Promise((n,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(l=>{n([l.coords.longitude,l.coords.latitude].map(u=>u.toFixed(6)).join(","))},l=>{o(l)},i)}),s}catch{}finally{i.cachedLocationExpiry&&(Xe={time:Date.now(),coords:s})}if(t.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}/**
146
+ */const Gi=(r,e,t)=>{const i=new Map;for(let s=e;s<=t;s++)i.set(r[s],s);return i},xs=Ut(class extends Bt{constructor(r){if(super(r),r.type!==Ft.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const s=[],n=[];let o=0;for(const l of r)s[o]=i?i(l,o):o,n[o]=t(l,o),o++;return{undefined:n,keys:s}}render(r,e,t){return this.dt(r,e,t).undefined}update(r,[e,t,i]){const s=ws(r),{undefined:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(s))return this.ut=o,n;const l=this.ut??=[],u=[];let f,x,w=0,$=s.length-1,M=0,T=n.length-1;for(;w<=$&&M<=T;)if(s[w]===null)w++;else if(s[$]===null)$--;else if(l[w]===o[M])u[M]=Ie(s[w],n[M]),w++,M++;else if(l[$]===o[T])u[T]=Ie(s[$],n[T]),$--,T--;else if(l[w]===o[T])u[T]=Ie(s[w],n[T]),Ke(r,u[T+1],s[w]),w++,T--;else if(l[$]===o[M])u[M]=Ie(s[$],n[M]),Ke(r,s[w],s[$]),$--,M++;else if(f===void 0&&(f=Gi(o,M,T),x=Gi(l,w,$)),f.has(l[w]))if(f.has(l[$])){const R=x.get(o[M]),F=R!==void 0?s[R]:null;if(F===null){const G=Ke(r,s[w]);Ie(G,n[M]),u[M]=G}else u[M]=Ie(F,n[M]),Ke(r,s[w],F),s[R]=null;M++}else Wt(s[$]),$--;else Wt(s[w]),w++;for(;M<=T;){const R=Ke(r,u[T+1]);Ie(R,n[M]),u[M++]=R}for(;w<=$;){const R=s[w++];R!==null&&Wt(R)}return this.ut=o,Es(r,u),we}});function Ss(r,e,t){const i=e[1],s=e[0],n=i-s;return r===i&&t?r:((r-s)%n+n)%n+s}function pt(r){const e=[...r];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Ye;async function Ls(r,e,t){for(const i of e??[])if(!(r&&(i.minZoom!=null&&i.minZoom>r[0]||i.maxZoom!=null&&i.maxZoom<r[0]))){if(i.type==="fixed")return i.coordinates.join(",");if(i.type==="client-geolocation")if(Ye&&i.cachedLocationExpiry&&Ye.time+i.cachedLocationExpiry>Date.now()){if(Ye.coords)return Ye.coords}else{let s;try{return s=await new Promise((n,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(l=>{n([l.coords.longitude,l.coords.latitude].map(u=>u.toFixed(6)).join(","))},l=>{o(l)},i)}),s}catch{}finally{i.cachedLocationExpiry&&(Ye={time:Date.now(),coords:s})}if(t.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}/**
147
147
  * @license
148
148
  * Copyright 2018 Google LLC
149
149
  * SPDX-License-Identifier: BSD-3-Clause
150
- */const Ui="important",_s=" !"+Ui,$s=Dt(class extends Wt{constructor(r){if(super(r),r.type!==Bt.ATTRIBUTE||r.name!=="style"||r.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce(((e,t)=>{const i=r[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(r,[e]){const{style:t}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const n=typeof s=="string"&&s.endsWith(_s);i.includes("-")||n?t.setProperty(i,n?s.slice(0,-11):s,n?Ui:""):t[i]=s}}return we}}),Ms=".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";var Ts=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Bi=r=>{throw TypeError(r)},ge=(r,e,t,i)=>{for(var s=i>1?void 0:i?As(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(e,t,s):o(s))||s);return i&&s&&Ts(e,t,s),s},Di=(r,e,t)=>e.has(r)||Bi("Cannot "+t),z=(r,e,t)=>(Di(r,e,"read from private field"),t?t.call(r):e.get(r)),Cs=(r,e,t)=>e.has(r)?Bi("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Be=(r,e,t)=>(Di(r,e,"access private method"),t),B,mt,Qe,Y,Wi,zi,qt,Ht;const qi=typeof devicePixelRatio>"u"||devicePixelRatio>1.25,Hi=qi?"@2x":"",De=qi?2:1;let Ne,ji,ce=class extends ae{constructor(){super(...arguments),Cs(this,B),this.itemStyle="default",this.showPlaceType="if-needed",this.missingIconsCache=new Set,this.iconsBaseUrl="",this.index=0}willUpdate(r){r.has("feature")&&z(this,B,mt)&&(this.index=z(this,B,mt).length,Be(this,B,qt).call(this))}render(){return Z`
150
+ */const Fi="important",_s=" !"+Fi,$s=Ut(class extends Bt{constructor(r){if(super(r),r.type!==Ft.ATTRIBUTE||r.name!=="style"||r.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce(((e,t)=>{const i=r[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(r,[e]){const{style:t}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const n=typeof s=="string"&&s.endsWith(_s);i.includes("-")||n?t.setProperty(i,n?s.slice(0,-11):s,n?Fi:""):t[i]=s}}return we}}),Ms=".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";var Ts=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Ui=r=>{throw TypeError(r)},ge=(r,e,t,i)=>{for(var s=i>1?void 0:i?As(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(e,t,s):o(s))||s);return i&&s&&Ts(e,t,s),s},Bi=(r,e,t)=>e.has(r)||Ui("Cannot "+t),z=(r,e,t)=>(Bi(r,e,"read from private field"),t?t.call(r):e.get(r)),Cs=(r,e,t)=>e.has(r)?Ui("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Be=(r,e,t)=>(Bi(r,e,"access private method"),t),B,mt,Xe,Y,Wi,Di,Dt,zt;const zi=typeof devicePixelRatio>"u"||devicePixelRatio>1.25,qi=zi?"@2x":"",We=zi?2:1;let Pe,Hi,ae=class extends le{constructor(){super(...arguments),Cs(this,B),this.itemStyle="default",this.showPlaceType="if-needed",this.missingIconsCache=new Set,this.iconsBaseUrl="",this.index=0}willUpdate(r){r.has("feature")&&z(this,B,mt)&&(this.index=z(this,B,mt).length,Be(this,B,Dt).call(this))}render(){return Z`
151
151
  <li
152
152
  tabindex="-1"
153
153
  role="option"
@@ -156,28 +156,28 @@
156
156
  class=${this.itemStyle}
157
157
  @click=${()=>this.dispatchEvent(new CustomEvent("select"))}
158
158
  >
159
- ${Ne&&this.spriteIcon?Z`
159
+ ${Pe&&this.spriteIcon?Z`
160
160
  <div
161
161
  class="sprite-icon"
162
- style=${$s({width:`${this.spriteIcon.width/De}px`,height:`${this.spriteIcon.height/De}px`,backgroundImage:`url(${this.iconsBaseUrl}sprite${Hi}.png)`,backgroundPosition:`-${this.spriteIcon.x/De}px -${this.spriteIcon.y/De}px`,backgroundSize:`${Ne.width/De}px ${Ne.height/De}px`})}
162
+ style=${$s({width:`${this.spriteIcon.width/We}px`,height:`${this.spriteIcon.height/We}px`,backgroundImage:`url(${this.iconsBaseUrl}sprite${qi}.png)`,backgroundPosition:`-${this.spriteIcon.x/We}px -${this.spriteIcon.y/We}px`,backgroundSize:`${Pe.width/We}px ${Pe.height/We}px`})}
163
163
  title=${z(this,B,Y)}
164
164
  />
165
- `:this.imageUrl?Z` <img src=${this.imageUrl} alt=${this.category} title=${z(this,B,Y)} @error=${Be(this,B,zi)} />`:this.feature?.address?Z` <img src=${this.iconsBaseUrl+"housenumber.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("road.")?Z` <img src=${this.iconsBaseUrl+"road.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("address.")?Z` <img src=${this.iconsBaseUrl+"street.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("postal_code.")?Z` <img src=${this.iconsBaseUrl+"postal_code.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("poi.")?Z` <img src=${this.iconsBaseUrl+"poi.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:z(this,B,Qe)?Z` <img src=${this.iconsBaseUrl+"reverse.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:Z` <img src=${this.iconsBaseUrl+"area.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `}
165
+ `:this.imageUrl?Z` <img src=${this.imageUrl} alt=${this.category} title=${z(this,B,Y)} @error=${Be(this,B,Di)} />`:this.feature?.address?Z` <img src=${this.iconsBaseUrl+"housenumber.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("road.")?Z` <img src=${this.iconsBaseUrl+"road.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("address.")?Z` <img src=${this.iconsBaseUrl+"street.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("postal_code.")?Z` <img src=${this.iconsBaseUrl+"postal_code.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("poi.")?Z` <img src=${this.iconsBaseUrl+"poi.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:z(this,B,Xe)?Z` <img src=${this.iconsBaseUrl+"reverse.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:Z` <img src=${this.iconsBaseUrl+"area.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `}
166
166
 
167
167
  <span class="texts">
168
168
  <span>
169
- <span class="primary"> ${z(this,B,Qe)?this.feature?.place_name:this.feature?.place_name.replace(/,.*/,"")} </span>
169
+ <span class="primary"> ${z(this,B,Xe)?this.feature?.place_name:this.feature?.place_name.replace(/,.*/,"")} </span>
170
170
 
171
- ${this.showPlaceType==="always"||this.showPlaceType!=="never"&&!this.feature?.address&&!this.feature?.id.startsWith("road.")&&!this.feature?.id.startsWith("address.")&&!this.feature?.id.startsWith("postal_code.")&&(!this.feature?.id.startsWith("poi.")||!this.imageUrl)&&!z(this,B,Qe)?Z` <span class="secondary"> ${z(this,B,Y)} </span> `:V}
171
+ ${this.showPlaceType==="always"||this.showPlaceType!=="never"&&!this.feature?.address&&!this.feature?.id.startsWith("road.")&&!this.feature?.id.startsWith("address.")&&!this.feature?.id.startsWith("postal_code.")&&(!this.feature?.id.startsWith("poi.")||!this.imageUrl)&&!z(this,B,Xe)?Z` <span class="secondary"> ${z(this,B,Y)} </span> `:V}
172
172
  </span>
173
173
 
174
- <span class="line2"> ${z(this,B,Qe)?this.feature?.text:this.feature?.place_name.replace(/[^,]*,?s*/,"")} </span>
174
+ <span class="line2"> ${z(this,B,Xe)?this.feature?.text:this.feature?.place_name.replace(/[^,]*,?s*/,"")} </span>
175
175
  </span>
176
176
  </li>
177
- `}};B=new WeakSet,mt=function(){return this.feature?.properties?.categories},Qe=function(){return this.feature?.place_type[0]==="reverse"},Y=function(){return this.feature?.properties?.categories?.join(", ")??this.feature?.place_type_name?.[0]??this.feature?.place_type[0]},Wi=function(){ji??=fetch(`${this.iconsBaseUrl}sprite${Hi}.json`).then(r=>r.json()).then(r=>{Ne=r}).catch(()=>{Ne=null})},zi=function(){this.imageUrl&&this.missingIconsCache.add(this.imageUrl),Be(this,B,qt).call(this)},qt=function(){Ne!==void 0?Be(this,B,Ht).call(this):(Be(this,B,Wi).call(this),ji?.then(()=>{Be(this,B,Ht).call(this)}))},Ht=function(){do{if(this.index--,this.category=z(this,B,mt)?.[this.index],this.spriteIcon=this.category?Ne?.icons[this.category]:void 0,this.spriteIcon)break;this.imageUrl=this.category?this.iconsBaseUrl+this.category.replace(/ /g,"_")+".svg":void 0}while(this.index>-1&&(!this.imageUrl||this.missingIconsCache.has(this.imageUrl)))},ce.styles=_e`
177
+ `}};B=new WeakSet,mt=function(){return this.feature?.properties?.categories},Xe=function(){return this.feature?.place_type[0]==="reverse"},Y=function(){return this.feature?.properties?.categories?.join(", ")??this.feature?.place_type_name?.[0]??this.feature?.place_type[0]},Wi=function(){Hi??=fetch(`${this.iconsBaseUrl}sprite${qi}.json`).then(r=>r.json()).then(r=>{Pe=r}).catch(()=>{Pe=null})},Di=function(){this.imageUrl&&this.missingIconsCache.add(this.imageUrl),Be(this,B,Dt).call(this)},Dt=function(){Pe!==void 0?Be(this,B,zt).call(this):(Be(this,B,Wi).call(this),Hi?.then(()=>{Be(this,B,zt).call(this)}))},zt=function(){do{if(this.index--,this.category=z(this,B,mt)?.[this.index],this.spriteIcon=this.category?Pe?.icons[this.category]:void 0,this.spriteIcon)break;this.imageUrl=this.category?this.iconsBaseUrl+this.category.replace(/ /g,"_")+".svg":void 0}while(this.index>-1&&(!this.imageUrl||this.missingIconsCache.has(this.imageUrl)))},ae.styles=_e`
178
178
  ${at(Ms)}
179
- `,ge([I({type:Object})],ce.prototype,"feature",2),ge([I({type:String})],ce.prototype,"itemStyle",2),ge([I({type:String})],ce.prototype,"showPlaceType",2),ge([I({attribute:!1})],ce.prototype,"missingIconsCache",2),ge([I({type:String})],ce.prototype,"iconsBaseUrl",2),ge([ie()],ce.prototype,"category",2),ge([ie()],ce.prototype,"imageUrl",2),ge([ie()],ce.prototype,"spriteIcon",2),ge([ie()],ce.prototype,"index",2),ce=ge([Me("maptiler-geocoder-feature-item")],ce);const Os="form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";var ks=Object.defineProperty,Is=Object.getOwnPropertyDescriptor,Vi=r=>{throw TypeError(r)},k=(r,e,t,i)=>{for(var s=i>1?void 0:i?Is(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(e,t,s):o(s))||s);return i&&s&&ks(e,t,s),s},jt=(r,e,t)=>e.has(r)||Vi("Cannot "+t),re=(r,e,t)=>(jt(r,e,"read from private field"),t?t.call(r):e.get(r)),We=(r,e,t)=>e.has(r)?Vi("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),gt=(r,e,t,i)=>(jt(r,e,"write to private field"),e.set(r,t),t),N=(r,e,t)=>(jt(r,e,"access private method"),t),yt,vt,Je,Vt,et,O,bt,Zi,Ki,Zt,ee,Kt,Et,Yt,Xt,Te,Qt,wt,Yi,Jt,Xi,Qi,Ji,er,tr;_.MaptilerGeocoderElement=class extends ae{constructor(){super(...arguments),We(this,O),this.clearListOnPick=!1,this.clearOnBlur=!1,this.collapsed=!1,this.excludeTypes=!1,this.exhaustiveReverseGeocoding=!1,this.fetchFullGeometryOnPick=!1,this.keepListOpen=!1,this.openListOnTop=!1,this.reverseActive=!1,this.searchValue="",this.selectedItemIndex=-1,this.cachedFeatures=[],this.lastSearchUrl="",this.focused=!1,this.focusedDelayed=!1,We(this,yt,!1),We(this,vt,!1),We(this,Je),We(this,Vt,new Set),We(this,et)}firstUpdated(){gt(this,yt,!0)}setOptions(e){const t={...e};for(const i of Object.keys(t))Ns.includes(i)||delete t[i];Object.assign(this,t)}setQuery(e){N(this,O,Xt).call(this,e,{external:!0}),N(this,O,Yt).call(this)}submitQuery(e){N(this,O,Qt).call(this,e)}clearList(){N(this,O,Te).call(this),this.picked=void 0,this.selectedItemIndex=-1}focus(e){this.input.focus(e)}blur(){this.input.blur()}addEventListener(e,t,i){super.addEventListener(e,t,i)}removeEventListener(e,t,i){super.removeEventListener(e,t,i)}handleMapChange(e){gt(this,et,e)}handleMapClick(e){this.reverseActive&&N(this,O,Yi).call(this,e)}willUpdate(e){e.has("error")&&this.error&&console.error("[MapTilerGeocodingControl] Error:",this.error),e.has("enableReverse")&&(this.reverseActive=this.enableReverse==="always"),["picked"].some(t=>e.has(t))&&this.picked&&(this.clearListOnPick&&N(this,O,Te).call(this),this.selectedItemIndex=-1),["searchValue","minLength"].some(t=>e.has(t))&&re(this,O,Zt)&&(N(this,O,Te).call(this),this.error=void 0),["focused"].some(t=>e.has(t))&&setTimeout(()=>{this.focusedDelayed=this.focused,this.clearOnBlur&&!this.focused&&(this.searchValue="")},100),["selectFirst","listFeatures","selectedItemIndex","picked"].some(t=>e.has(t))&&this.selectFirst!==!1&&this.listFeatures?.length&&this.selectedItemIndex==-1&&!this.picked&&(this.selectedItemIndex=0),["listFeatures","selectedItemIndex"].some(t=>e.has(t))&&N(this,O,ee).call(this,"select",{feature:re(this,O,bt)}),["picked"].some(t=>e.has(t))&&this.picked&&this.picked.id!==e.get("picked")?.id&&(this.fetchFullGeometryOnPick&&!this.picked.address&&this.picked.geometry.type==="Point"&&this.picked.place_type[0]!=="reverse"?N(this,O,wt).call(this,this.picked.id,{byId:!0}):Promise.resolve()).then(()=>{N(this,O,ee).call(this,"pick",{feature:this.picked})},t=>{t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"||(this.error=t,N(this,O,ee).call(this,"pick",{feature:this.picked}))}),["listFeatures","focusedDelayed"].some(t=>e.has(t))&&(re(this,O,Zi)?(N(this,O,ee).call(this,"featuresshow"),gt(this,vt,!0)):re(this,vt)&&N(this,O,ee).call(this,"featureshide")),["reverseActive"].some(t=>e.has(t))&&N(this,O,ee).call(this,"reversetoggle",{reverse:this.reverseActive})}render(){return Z`
180
- <form @submit=${N(this,O,Kt)} class=${ft({"can-collapse":this.collapsed&&this.searchValue===""})}>
179
+ `,ge([P({type:Object})],ae.prototype,"feature",2),ge([P({type:String})],ae.prototype,"itemStyle",2),ge([P({type:String})],ae.prototype,"showPlaceType",2),ge([P({attribute:!1})],ae.prototype,"missingIconsCache",2),ge([P({type:String})],ae.prototype,"iconsBaseUrl",2),ge([ee()],ae.prototype,"category",2),ge([ee()],ae.prototype,"imageUrl",2),ge([ee()],ae.prototype,"spriteIcon",2),ge([ee()],ae.prototype,"index",2),ae=ge([Me("maptiler-geocoder-feature-item")],ae);const Os="form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";var ks=Object.defineProperty,Is=Object.getOwnPropertyDescriptor,ji=r=>{throw TypeError(r)},k=(r,e,t,i)=>{for(var s=i>1?void 0:i?Is(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(e,t,s):o(s))||s);return i&&s&&ks(e,t,s),s},qt=(r,e,t)=>e.has(r)||ji("Cannot "+t),ce=(r,e,t)=>(qt(r,e,"read from private field"),t?t.call(r):e.get(r)),Qe=(r,e,t)=>e.has(r)?ji("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Ht=(r,e,t,i)=>(qt(r,e,"write to private field"),e.set(r,t),t),I=(r,e,t)=>(qt(r,e,"access private method"),t),gt,Je,jt,et,C,yt,Vi,Vt,te,Zt,vt,Kt,Yt,Te,Xt,bt,Zi,Qt,Ki,Yi,Xi,Qi,Ji,er,tr;_.MaptilerGeocoderElement=class extends le{constructor(){super(...arguments),Qe(this,C),this.clearListOnPick=!1,this.clearOnBlur=!1,this.collapsed=!1,this.excludeTypes=!1,this.exhaustiveReverseGeocoding=!1,this.fetchFullGeometryOnPick=!1,this.keepListOpen=!1,this.openListOnTop=!1,this.reverseActive=!1,this.searchValue="",this.selectedItemIndex=-1,this.cachedFeatures=[],this.lastSearchUrl="",this.focused=!1,this.isFeatureListVisible=!1,this.isFeatureListInteractedWith=!1,Qe(this,gt,!1),Qe(this,Je),Qe(this,jt,new Set),Qe(this,et)}firstUpdated(){Ht(this,gt,!0)}setOptions(e){const t={...e};for(const i of Object.keys(t))Ps.includes(i)||delete t[i];Object.assign(this,t)}setQuery(e){I(this,C,Yt).call(this,e,{external:!0}),I(this,C,Kt).call(this)}submitQuery(e){I(this,C,Xt).call(this,e,{external:!0})}clearList(){I(this,C,Te).call(this),this.picked=void 0,this.selectedItemIndex=-1}focus(e){this.input.focus(e)}blur(){this.input.blur()}addEventListener(e,t,i){super.addEventListener(e,t,i)}removeEventListener(e,t,i){super.removeEventListener(e,t,i)}handleMapChange(e){Ht(this,et,e)}handleMapClick(e){this.reverseActive&&I(this,C,Zi).call(this,e)}willUpdate(e){e.has("error")&&this.error&&console.error("[MapTilerGeocodingControl] Error:",this.error),e.has("enableReverse")&&(this.reverseActive=this.enableReverse==="always"),["picked"].some(t=>e.has(t))&&this.picked&&(this.clearListOnPick&&I(this,C,Te).call(this),this.selectedItemIndex=-1),["searchValue","minLength"].some(t=>e.has(t))&&ce(this,C,Vt)&&(I(this,C,Te).call(this),this.error=void 0),["focused","listIsInteractedWith"].some(t=>e.has(t))&&this.clearOnBlur&&!this.focused&&!this.isFeatureListInteractedWith&&(this.searchValue=""),["selectFirst","listFeatures","selectedItemIndex","picked"].some(t=>e.has(t))&&this.selectFirst!==!1&&this.listFeatures?.length&&this.selectedItemIndex==-1&&!this.picked&&(this.selectedItemIndex=0),["listFeatures","selectedItemIndex"].some(t=>e.has(t))&&I(this,C,te).call(this,"select",{feature:ce(this,C,yt)}),["picked"].some(t=>e.has(t))&&this.picked&&this.picked.id!==e.get("picked")?.id&&(this.fetchFullGeometryOnPick&&!this.picked.address&&this.picked.geometry.type==="Point"&&this.picked.place_type[0]!=="reverse"?I(this,C,bt).call(this,this.picked.id,{byId:!0}):Promise.resolve()).then(()=>{I(this,C,te).call(this,"pick",{feature:this.picked})},t=>{t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"||(this.error=t,I(this,C,te).call(this,"pick",{feature:this.picked}))}),["listFeatures","focused","isFeatureListInteractedWith","keepListOpen"].some(t=>e.has(t))&&(this.isFeatureListVisible=!!this.listFeatures?.length&&(this.focused||this.isFeatureListInteractedWith||this.keepListOpen)),["isFeatureListVisible"].some(t=>e.has(t))&&(this.isFeatureListVisible?I(this,C,te).call(this,"featuresshow"):I(this,C,te).call(this,"featureshide")),["reverseActive"].some(t=>e.has(t))&&I(this,C,te).call(this,"reversetoggle",{reverse:this.reverseActive})}render(){return Z`
180
+ <form @submit=${I(this,C,Zt)} class=${ft({"can-collapse":this.collapsed&&this.searchValue===""})}>
181
181
  <div class="input-group">
182
182
  <button
183
183
  class="search-button"
@@ -192,16 +192,16 @@
192
192
  @focus=${()=>this.focused=!0}
193
193
  @blur=${()=>this.focused=!1}
194
194
  @click=${()=>this.focused=!0}
195
- @keydown=${N(this,O,Jt)}
196
- @input=${N(this,O,Xi)}
195
+ @keydown=${I(this,C,Qt)}
196
+ @input=${I(this,C,Ki)}
197
197
  @change=${()=>this.picked=void 0}
198
198
  placeholder=${this.placeholder??"Search"}
199
199
  aria-label=${this.placeholder??"Search"}
200
200
  />
201
201
 
202
202
  <div class="clear-button-container ${ft({displayable:this.searchValue!==""})}">
203
- ${re(this,O,Ki)?Z`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>`:Z`
204
- <button type="button" @click=${N(this,O,tr)} title=${this.clearButtonTitle??"clear"}>
203
+ ${ce(this,C,Vi)?Z`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>`:Z`
204
+ <button type="button" @click=${I(this,C,tr)} title=${this.clearButtonTitle??"clear"}>
205
205
  <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
206
206
  </button>
207
207
  `}
@@ -231,7 +231,7 @@
231
231
  <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
232
232
  </button>
233
233
  </div>
234
- `:!this.focusedDelayed&&!this.keepListOpen||this.listFeatures===void 0?V:this.listFeatures.length===0?Z`
234
+ `:!this.focused&&!this.isFeatureListInteractedWith&&!this.keepListOpen||this.listFeatures===void 0?V:this.listFeatures.length===0?Z`
235
235
  <div class="no-results">
236
236
  <maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
237
237
 
@@ -240,26 +240,31 @@
240
240
  </div>
241
241
  </div>
242
242
  `:Z`
243
- <ul class="options ${ft({"open-on-top":this.openListOnTop})}" @mouseleave=${N(this,O,er)} @keydown=${N(this,O,Jt)} role="listbox">
243
+ <ul
244
+ class="options ${ft({"open-on-top":this.openListOnTop})}"
245
+ @pointerleave=${I(this,C,Qi)}
246
+ @pointerdown=${I(this,C,Ji)}
247
+ @pointerup=${I(this,C,er)}
248
+ @keydown=${I(this,C,Qt)}
249
+ role="listbox"
250
+ >
244
251
  ${xs(this.listFeatures,e=>e.id+(e.address?","+e.address:""),(e,t)=>Z`
245
252
  <maptiler-geocoder-feature-item
246
253
  .feature=${e}
247
254
  .showPlaceType=${this.showPlaceType??"if-needed"}
248
255
  itemStyle=${this.selectedItemIndex===t?"selected":this.picked?.id===e.id?"picked":"default"}
249
- @mouseenter=${()=>{N(this,O,Ji).call(this,t)}}
250
- @select=${()=>{N(this,O,Qi).call(this,e)}}
251
- .missingIconsCache=${re(this,Vt)}
252
- .iconsBaseUrl=${this.iconsBaseUrl??"https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.6/icons/"}
253
- >
254
- ${e.place_name}
255
- </maptiler-geocoder-feature-item>
256
+ @pointerenter=${()=>{I(this,C,Xi).call(this,t)}}
257
+ @select=${()=>{I(this,C,Yi).call(this,e)}}
258
+ .missingIconsCache=${ce(this,jt)}
259
+ .iconsBaseUrl=${this.iconsBaseUrl??"https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.8/icons/"}
260
+ />
256
261
  `)}
257
262
  </ul>
258
263
  `}
259
264
  </form>
260
- `}},yt=new WeakMap,vt=new WeakMap,Je=new WeakMap,Vt=new WeakMap,et=new WeakMap,O=new WeakSet,bt=function(){return this.listFeatures?.[this.selectedItemIndex]},Zi=function(){return!!this.listFeatures?.length&&(this.focusedDelayed||this.keepListOpen)},Ki=function(){return this.abortController!==void 0},Zt=function(){return this.searchValue.length<(this.minLength??2)},ee=function(r,...[e]){re(this,yt)&&this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0,detail:e}))},Kt=function(r){r?.preventDefault(),this.focused=!1,clearTimeout(re(this,Je)),this.selectedItemIndex>-1&&this.listFeatures?(this.picked=this.listFeatures[this.selectedItemIndex],this.searchValue=this.picked.place_type[0]==="reverse"?this.picked.place_name:this.picked.place_name.replace(/,.*/,""),this.error=void 0,this.selectedItemIndex=-1):this.searchValue&&N(this,O,wt).call(this,this.searchValue,{exact:!0,external:r===void 0}).then(()=>{this.picked=void 0}).catch(e=>this.error=e)},Et=function(r){try{return ys(r,6)}catch{return!1}},Yt=function(){setTimeout(()=>{this.input.focus(),this.focused=!0,this.input.select()})},Xt=function(r,{external:e=!1}={}){if(this.searchValue=r,N(this,O,ee).call(this,"querychange",{query:this.searchValue,reverseCoords:N(this,O,Et).call(this,r)}),this.error=void 0,this.picked=void 0,this.showResultsWhileTyping!==!1){if(clearTimeout(re(this,Je)),re(this,O,Zt))return;const t=this.searchValue;gt(this,Je,window.setTimeout(()=>{N(this,O,wt).call(this,t,{external:e}).catch(i=>this.error=i)},this.debounceSearch??200))}else N(this,O,Te).call(this)},Te=function(){this.listFeatures!==void 0&&(this.listFeatures=void 0,N(this,O,ee).call(this,"featuresclear"))},Qt=function(r){this.searchValue=r,N(this,O,ee).call(this,"querychange",{query:this.searchValue,reverseCoords:N(this,O,Et).call(this,r)}),this.selectedItemIndex=-1,N(this,O,Kt).call(this)},wt=async function(r,{byId:e=!1,exact:t=!1,external:i=!1}={}){this.error=void 0,this.abortController?.abort();const s=new AbortController;this.abortController=s;try{const n=this.apiUrl??"https://api.maptiler.com/geocoding",o=N(this,O,Et).call(this,r),l=new URL(n+"/"+encodeURIComponent(o?`${o.decimalLongitude},${o.decimalLatitude}`:r)+".json"),u=l.searchParams;this.language!==void 0&&u.set("language",Array.isArray(this.language)?this.language.join(","):this.language??"");const[f]=re(this,et)??[void 0];let x=(!o||this.reverseGeocodingTypes===void 0?this.types:this.reverseGeocodingTypes)?.map(G=>typeof G=="string"?G:f===void 0||(G[0]??0)<=f&&f<(G[1]??1/0)?G[2]:void 0).filter(G=>G!==void 0);x&&(x=[...new Set(x)],u.set("types",x.join(",")));const w=!o||this.reverseGeocodingExcludeTypes===void 0?this.excludeTypes:this.reverseGeocodingExcludeTypes;if(w&&u.set("excludeTypes",String(w)),this.bbox&&u.set("bbox",this.bbox.map(G=>G.toFixed(6)).join(",")),this.country&&u.set("country",Array.isArray(this.country)?this.country.join(","):this.country),this.worldview&&u.set("worldview",this.worldview),!e&&!o){const G=this.proximity??[{type:"server-geolocation"}],L=await Ls(re(this,et),G,s);L&&u.set("proximity",L),(t||this.showResultsWhileTyping===!1)&&u.set("autocomplete","false"),u.set("fuzzyMatch",String(this.fuzzyMatch!==!1))}const $=this.limit??5,M=this.reverseGeocodingLimit??$;M>1&&x?.length!==1&&console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."),o?(M===1||this.exhaustiveReverseGeocoding||x?.length===1)&&u.set("limit",String(M)):u.set("limit",String($)),this.apiKey&&u.set("key",this.apiKey),this.adjustUrl?.(l);const T=l.searchParams.get("types")===""&&l.searchParams.get("excludeTypes")!=="true",R=l.toString();if(R===this.lastSearchUrl){e?(this.clearListOnPick&&N(this,O,Te).call(this),this.picked=this.cachedFeatures[0]):(this.listFeatures=this.cachedFeatures,N(this,O,ee).call(this,"featureslisted",{features:this.listFeatures,external:i}),this.listFeatures[this.selectedItemIndex]?.id!==re(this,O,bt)?.id&&(this.selectedItemIndex=-1));return}N(this,O,ee).call(this,"request",{urlObj:l}),this.lastSearchUrl=R;let F;if(T)F={type:"FeatureCollection",features:[]};else{const G=await fetch(R,{signal:s.signal,...this.fetchParameters});if(!G.ok)throw new Error(await G.text());F=await G.json()}N(this,O,ee).call(this,"response",{url:R,featureCollection:F}),e?(this.clearListOnPick&&N(this,O,Te).call(this),this.picked=F.features[0],this.cachedFeatures=[this.picked]):(this.listFeatures=F.features.filter(this.filter??(()=>!0)),o&&this.listFeatures.unshift({type:"Feature",properties:{},id:`reverse_${o.decimalLongitude}_${o.decimalLatitude}`,text:`${o.decimalLatitude}, ${o.decimalLongitude}`,place_name:o.toCoordinateFormat("DMS"),place_type:["reverse"],place_type_name:["reverse"],center:[o.decimalLongitude,o.decimalLatitude],bbox:[o.decimalLongitude,o.decimalLatitude,o.decimalLongitude,o.decimalLatitude],geometry:{type:"Point",coordinates:[o.decimalLongitude,o.decimalLatitude]}}),N(this,O,ee).call(this,"featureslisted",{features:this.listFeatures,external:i}),this.cachedFeatures=this.listFeatures,this.listFeatures[this.selectedItemIndex]?.id!==re(this,O,bt)?.id&&(this.selectedItemIndex=-1),o&&this.input.focus())}catch(n){if(n&&typeof n=="object"&&"name"in n&&n.name==="AbortError")return;throw n}finally{s===this.abortController&&(this.abortController=void 0)}},Yi=function(r){this.reverseActive=this.enableReverse==="always",N(this,O,Te).call(this),this.picked=void 0,N(this,O,Qt).call(this,`${r[1].toFixed(6)}, ${Ss(r[0],[-180,180],!0).toFixed(6)}`),N(this,O,Yt).call(this)},Jt=function(r){if(!this.listFeatures)return;const e=r.key==="ArrowDown"?1:r.key==="ArrowUp"?-1:0;e&&(this.input.focus(),this.focused=!0,r.preventDefault(),this.picked&&this.selectedItemIndex===-1&&(this.selectedItemIndex=this.listFeatures.findIndex(t=>t.id===this.picked?.id)),this.selectedItemIndex===(this.picked||this.selectFirst!==!1?0:-1)&&e===-1&&(this.selectedItemIndex=this.listFeatures.length),this.selectedItemIndex+=e,this.selectedItemIndex>=this.listFeatures.length&&(this.selectedItemIndex=-1),this.selectedItemIndex<0&&(this.picked||this.selectFirst!==!1)&&(this.selectedItemIndex=0))},Xi=function(r){N(this,O,Xt).call(this,r.target.value)},Qi=function(r){(!this.picked||this.picked.id!==r.id)&&(this.picked=r,this.searchValue=r.place_name)},Ji=function(r){this.selectedItemIndex=r},er=function(){(!this.selectFirst||this.picked)&&(this.selectedItemIndex=-1)},tr=function(){this.searchValue="",N(this,O,ee).call(this,"queryclear"),this.picked=void 0,this.input.focus()},_.MaptilerGeocoderElement.styles=_e`
265
+ `}},gt=new WeakMap,Je=new WeakMap,jt=new WeakMap,et=new WeakMap,C=new WeakSet,yt=function(){return this.listFeatures?.[this.selectedItemIndex]},Vi=function(){return this.abortController!==void 0},Vt=function(){return this.searchValue.length<(this.minLength??2)},te=function(r,...[e]){ce(this,gt)&&this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0,detail:e}))},Zt=function(r,{external:e=!1}={}){r?.preventDefault(),this.focused=!1,clearTimeout(ce(this,Je)),this.selectedItemIndex>-1&&this.listFeatures?(this.picked=this.listFeatures[this.selectedItemIndex],this.searchValue=this.picked.place_type[0]==="reverse"?this.picked.place_name:this.picked.place_name.replace(/,.*/,""),this.error=void 0,this.selectedItemIndex=-1):this.searchValue&&I(this,C,bt).call(this,this.searchValue,{exact:!0,external:e}).then(()=>{this.picked=void 0}).catch(t=>this.error=t)},vt=function(r){try{return ys(r,6)}catch{return!1}},Kt=function(){setTimeout(()=>{this.input.focus(),this.focused=!0,this.input.select()})},Yt=function(r,{external:e=!1}={}){if(this.searchValue=r,I(this,C,te).call(this,"querychange",{query:this.searchValue,reverseCoords:I(this,C,vt).call(this,r)}),this.error=void 0,this.picked=void 0,this.showResultsWhileTyping!==!1){if(clearTimeout(ce(this,Je)),ce(this,C,Vt))return;const t=this.searchValue;Ht(this,Je,window.setTimeout(()=>{I(this,C,bt).call(this,t,{external:e}).catch(i=>this.error=i)},this.debounceSearch??200))}else I(this,C,Te).call(this)},Te=function(){this.listFeatures!==void 0&&(this.listFeatures=void 0,I(this,C,te).call(this,"featuresclear"))},Xt=function(r,{external:e=!1}={}){this.searchValue=r,I(this,C,te).call(this,"querychange",{query:this.searchValue,reverseCoords:I(this,C,vt).call(this,r)}),this.selectedItemIndex=-1,I(this,C,Zt).call(this,void 0,{external:e})},bt=async function(r,{byId:e=!1,exact:t=!1,external:i=!1}={}){this.error=void 0,this.abortController?.abort();const s=new AbortController;this.abortController=s;try{const n=this.apiUrl??"https://api.maptiler.com/geocoding",o=I(this,C,vt).call(this,r),l=new URL(n+"/"+encodeURIComponent(o?`${o.decimalLongitude},${o.decimalLatitude}`:r)+".json"),u=l.searchParams;this.language!==void 0&&u.set("language",Array.isArray(this.language)?this.language.join(","):this.language??"");const[f]=ce(this,et)??[void 0];let x=(!o||this.reverseGeocodingTypes===void 0?this.types:this.reverseGeocodingTypes)?.map(G=>typeof G=="string"?G:f===void 0||(G[0]??0)<=f&&f<(G[1]??1/0)?G[2]:void 0).filter(G=>G!==void 0);x&&(x=[...new Set(x)],u.set("types",x.join(",")));const w=!o||this.reverseGeocodingExcludeTypes===void 0?this.excludeTypes:this.reverseGeocodingExcludeTypes;if(w&&u.set("excludeTypes",String(w)),this.bbox&&u.set("bbox",this.bbox.map(G=>G.toFixed(6)).join(",")),this.country&&u.set("country",Array.isArray(this.country)?this.country.join(","):this.country),this.worldview&&u.set("worldview",this.worldview),!e&&!o){const G=this.proximity??[{type:"server-geolocation"}],L=await Ls(ce(this,et),G,s);L&&u.set("proximity",L),(t||this.showResultsWhileTyping===!1)&&u.set("autocomplete","false"),u.set("fuzzyMatch",String(this.fuzzyMatch!==!1))}const $=this.limit??5,M=this.reverseGeocodingLimit??$;M>1&&x?.length!==1&&console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."),o?(M===1||this.exhaustiveReverseGeocoding||x?.length===1)&&u.set("limit",String(M)):u.set("limit",String($)),this.apiKey&&u.set("key",this.apiKey),this.adjustUrl?.(l);const T=l.searchParams.get("types")===""&&l.searchParams.get("excludeTypes")!=="true",R=l.toString();if(R===this.lastSearchUrl){e?(this.clearListOnPick&&I(this,C,Te).call(this),this.picked=this.cachedFeatures[0]):(this.listFeatures=this.cachedFeatures,I(this,C,te).call(this,"featureslisted",{features:this.listFeatures,external:i}),this.listFeatures[this.selectedItemIndex]?.id!==ce(this,C,yt)?.id&&(this.selectedItemIndex=-1));return}I(this,C,te).call(this,"request",{urlObj:l}),this.lastSearchUrl=R;let F;if(T)F={type:"FeatureCollection",features:[]};else{const G=await fetch(R,{signal:s.signal,...this.fetchParameters});if(!G.ok)throw new Error(await G.text());F=await G.json()}I(this,C,te).call(this,"response",{url:R,featureCollection:F}),e?(this.clearListOnPick&&I(this,C,Te).call(this),this.picked=F.features[0],this.cachedFeatures=[this.picked]):(this.listFeatures=F.features.filter(this.filter??(()=>!0)),o&&this.listFeatures.unshift({type:"Feature",properties:{},id:`reverse_${o.decimalLongitude}_${o.decimalLatitude}`,place_name:`${o.decimalLatitude}, ${o.decimalLongitude}`,text:o.toCoordinateFormat("DMS"),place_type:["reverse"],place_type_name:["reverse"],center:[o.decimalLongitude,o.decimalLatitude],bbox:[o.decimalLongitude,o.decimalLatitude,o.decimalLongitude,o.decimalLatitude],geometry:{type:"Point",coordinates:[o.decimalLongitude,o.decimalLatitude]}}),I(this,C,te).call(this,"featureslisted",{features:this.listFeatures,external:i}),this.cachedFeatures=this.listFeatures,this.listFeatures[this.selectedItemIndex]?.id!==ce(this,C,yt)?.id&&(this.selectedItemIndex=-1),o&&this.input.focus())}catch(n){if(n&&typeof n=="object"&&"name"in n&&n.name==="AbortError")return;throw n}finally{s===this.abortController&&(this.abortController=void 0)}},Zi=function(r){this.reverseActive=this.enableReverse==="always",I(this,C,Te).call(this),this.picked=void 0,I(this,C,Xt).call(this,`${r[1].toFixed(6)}, ${Ss(r[0],[-180,180],!0).toFixed(6)}`),I(this,C,Kt).call(this)},Qt=function(r){if(!this.listFeatures)return;const e=r.key==="ArrowDown"?1:r.key==="ArrowUp"?-1:0;e&&(this.input.focus(),this.focused=!0,r.preventDefault(),this.picked&&this.selectedItemIndex===-1&&(this.selectedItemIndex=this.listFeatures.findIndex(t=>t.id===this.picked?.id)),this.selectedItemIndex===(this.picked||this.selectFirst!==!1?0:-1)&&e===-1&&(this.selectedItemIndex=this.listFeatures.length),this.selectedItemIndex+=e,this.selectedItemIndex>=this.listFeatures.length&&(this.selectedItemIndex=-1),this.selectedItemIndex<0&&(this.picked||this.selectFirst!==!1)&&(this.selectedItemIndex=0))},Ki=function(r){I(this,C,Yt).call(this,r.target.value)},Yi=function(r){(!this.picked||this.picked.id!==r.id)&&(this.picked=r,this.searchValue=r.place_name)},Xi=function(r){this.selectedItemIndex=r},Qi=function(){(!this.selectFirst||this.picked)&&(this.selectedItemIndex=-1),this.isFeatureListInteractedWith&&(this.isFeatureListInteractedWith=!1)},Ji=function(){this.isFeatureListInteractedWith=!0},er=function(){setTimeout(()=>{this.isFeatureListInteractedWith=!1})},tr=function(){this.searchValue="",I(this,C,te).call(this,"queryclear"),this.picked=void 0,this.input.focus()},_.MaptilerGeocoderElement.styles=_e`
261
266
  ${at(Os)}
262
- `,k([I({attribute:!1})],_.MaptilerGeocoderElement.prototype,"adjustUrl",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"apiKey",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"apiUrl",2),k([I({type:Array})],_.MaptilerGeocoderElement.prototype,"bbox",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"clearButtonTitle",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"clearListOnPick",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"clearOnBlur",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"collapsed",2),k([I({attribute:!1})],_.MaptilerGeocoderElement.prototype,"country",2),k([I({type:Number})],_.MaptilerGeocoderElement.prototype,"debounceSearch",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"enableReverse",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"errorMessage",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"excludeTypes",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"exhaustiveReverseGeocoding",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"fetchFullGeometryOnPick",2),k([I({type:Object})],_.MaptilerGeocoderElement.prototype,"fetchParameters",2),k([I({attribute:!1})],_.MaptilerGeocoderElement.prototype,"filter",2),k([I({type:Object})],_.MaptilerGeocoderElement.prototype,"fuzzyMatch",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"iconsBaseUrl",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"keepListOpen",2),k([I({attribute:!1})],_.MaptilerGeocoderElement.prototype,"language",2),k([I({type:Number})],_.MaptilerGeocoderElement.prototype,"limit",2),k([I({type:Number})],_.MaptilerGeocoderElement.prototype,"minLength",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"noResultsMessage",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"openListOnTop",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"placeholder",2),k([I({type:Array})],_.MaptilerGeocoderElement.prototype,"proximity",2),k([I({type:Boolean})],_.MaptilerGeocoderElement.prototype,"reverseActive",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"reverseButtonTitle",2),k([I({type:Object})],_.MaptilerGeocoderElement.prototype,"reverseGeocodingExcludeTypes",2),k([I({type:Number})],_.MaptilerGeocoderElement.prototype,"reverseGeocodingLimit",2),k([I({type:Array})],_.MaptilerGeocoderElement.prototype,"reverseGeocodingTypes",2),k([I({type:Object})],_.MaptilerGeocoderElement.prototype,"selectFirst",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"showPlaceType",2),k([I({type:Object})],_.MaptilerGeocoderElement.prototype,"showResultsWhileTyping",2),k([I({type:Array})],_.MaptilerGeocoderElement.prototype,"types",2),k([I({type:String})],_.MaptilerGeocoderElement.prototype,"worldview",2),k([Yr("input")],_.MaptilerGeocoderElement.prototype,"input",2),k([ie()],_.MaptilerGeocoderElement.prototype,"searchValue",2),k([ie()],_.MaptilerGeocoderElement.prototype,"listFeatures",2),k([ie()],_.MaptilerGeocoderElement.prototype,"selectedItemIndex",2),k([ie()],_.MaptilerGeocoderElement.prototype,"picked",2),k([ie()],_.MaptilerGeocoderElement.prototype,"cachedFeatures",2),k([ie()],_.MaptilerGeocoderElement.prototype,"lastSearchUrl",2),k([ie()],_.MaptilerGeocoderElement.prototype,"error",2),k([ie()],_.MaptilerGeocoderElement.prototype,"abortController",2),k([ie()],_.MaptilerGeocoderElement.prototype,"focused",2),k([ie()],_.MaptilerGeocoderElement.prototype,"focusedDelayed",2),_.MaptilerGeocoderElement=k([Me("maptiler-geocoder")],_.MaptilerGeocoderElement);const Ns=["adjustUrl","apiKey","apiUrl","bbox","clearButtonTitle","clearListOnPick","clearOnBlur","collapsed","country","debounceSearch","enableReverse","errorMessage","excludeTypes","reverseGeocodingExcludeTypes","exhaustiveReverseGeocoding","fetchParameters","fetchFullGeometryOnPick","filter","fuzzyMatch","iconsBaseUrl","keepListOpen","language","limit","reverseGeocodingLimit","minLength","noResultsMessage","openListOnTop","placeholder","proximity","reverseActive","reverseButtonTitle","selectFirst","showPlaceType","showResultsWhileTyping","types","reverseGeocodingTypes","worldview"],Ps="svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";var Rs=Object.getOwnPropertyDescriptor,Gs=(r,e,t,i)=>{for(var s=i>1?void 0:i?Rs(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeMarkerElement=class extends ae{render(){return Ve`
267
+ `,k([P({attribute:!1})],_.MaptilerGeocoderElement.prototype,"adjustUrl",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"apiKey",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"apiUrl",2),k([P({type:Array})],_.MaptilerGeocoderElement.prototype,"bbox",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"clearButtonTitle",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"clearListOnPick",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"clearOnBlur",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"collapsed",2),k([P({attribute:!1})],_.MaptilerGeocoderElement.prototype,"country",2),k([P({type:Number})],_.MaptilerGeocoderElement.prototype,"debounceSearch",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"enableReverse",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"errorMessage",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"excludeTypes",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"exhaustiveReverseGeocoding",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"fetchFullGeometryOnPick",2),k([P({type:Object})],_.MaptilerGeocoderElement.prototype,"fetchParameters",2),k([P({attribute:!1})],_.MaptilerGeocoderElement.prototype,"filter",2),k([P({type:Object})],_.MaptilerGeocoderElement.prototype,"fuzzyMatch",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"iconsBaseUrl",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"keepListOpen",2),k([P({attribute:!1})],_.MaptilerGeocoderElement.prototype,"language",2),k([P({type:Number})],_.MaptilerGeocoderElement.prototype,"limit",2),k([P({type:Number})],_.MaptilerGeocoderElement.prototype,"minLength",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"noResultsMessage",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"openListOnTop",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"placeholder",2),k([P({type:Array})],_.MaptilerGeocoderElement.prototype,"proximity",2),k([P({type:Boolean})],_.MaptilerGeocoderElement.prototype,"reverseActive",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"reverseButtonTitle",2),k([P({type:Object})],_.MaptilerGeocoderElement.prototype,"reverseGeocodingExcludeTypes",2),k([P({type:Number})],_.MaptilerGeocoderElement.prototype,"reverseGeocodingLimit",2),k([P({type:Array})],_.MaptilerGeocoderElement.prototype,"reverseGeocodingTypes",2),k([P({type:Object})],_.MaptilerGeocoderElement.prototype,"selectFirst",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"showPlaceType",2),k([P({type:Object})],_.MaptilerGeocoderElement.prototype,"showResultsWhileTyping",2),k([P({type:Array})],_.MaptilerGeocoderElement.prototype,"types",2),k([P({type:String})],_.MaptilerGeocoderElement.prototype,"worldview",2),k([Yr("input")],_.MaptilerGeocoderElement.prototype,"input",2),k([ee()],_.MaptilerGeocoderElement.prototype,"searchValue",2),k([ee()],_.MaptilerGeocoderElement.prototype,"listFeatures",2),k([ee()],_.MaptilerGeocoderElement.prototype,"selectedItemIndex",2),k([ee()],_.MaptilerGeocoderElement.prototype,"picked",2),k([ee()],_.MaptilerGeocoderElement.prototype,"cachedFeatures",2),k([ee()],_.MaptilerGeocoderElement.prototype,"lastSearchUrl",2),k([ee()],_.MaptilerGeocoderElement.prototype,"error",2),k([ee()],_.MaptilerGeocoderElement.prototype,"abortController",2),k([ee()],_.MaptilerGeocoderElement.prototype,"focused",2),k([ee()],_.MaptilerGeocoderElement.prototype,"isFeatureListVisible",2),k([ee()],_.MaptilerGeocoderElement.prototype,"isFeatureListInteractedWith",2),_.MaptilerGeocoderElement=k([Me("maptiler-geocoder")],_.MaptilerGeocoderElement);const Ps=["adjustUrl","apiKey","apiUrl","bbox","clearButtonTitle","clearListOnPick","clearOnBlur","collapsed","country","debounceSearch","enableReverse","errorMessage","excludeTypes","reverseGeocodingExcludeTypes","exhaustiveReverseGeocoding","fetchParameters","fetchFullGeometryOnPick","filter","fuzzyMatch","iconsBaseUrl","keepListOpen","language","limit","reverseGeocodingLimit","minLength","noResultsMessage","openListOnTop","placeholder","proximity","reverseActive","reverseButtonTitle","selectFirst","showPlaceType","showResultsWhileTyping","types","reverseGeocodingTypes","worldview"],Ns="svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";var Rs=Object.getOwnPropertyDescriptor,Gs=(r,e,t,i)=>{for(var s=i>1?void 0:i?Rs(e,t):e,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(s)||s);return s};_.MaptilerGeocodeMarkerElement=class extends le{render(){return je`
263
268
  <svg
264
269
  viewBox="0 0 70 85"
265
270
  fill="none"
@@ -271,6 +276,6 @@
271
276
  />
272
277
  </svg>
273
278
  `}},_.MaptilerGeocodeMarkerElement.styles=_e`
274
- ${at(Ps)}
275
- `,_.MaptilerGeocodeMarkerElement=Gs([Me("maptiler-geocode-marker")],_.MaptilerGeocodeMarkerElement);function xt(r,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}function ei(r,e,t={}){for(const s of r){if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(s[s.length-1].length!==s[0].length)throw new Error("First and last Position are not equivalent.");for(let n=0;n<s[s.length-1].length;n++)if(s[s.length-1][n]!==s[0][n])throw new Error("First and last Position are not equivalent.")}return xt({type:"Polygon",coordinates:r},e,t)}function ti(r,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}function ir(r,e,t={}){return xt({type:"MultiPolygon",coordinates:r},e,t)}function rr(r,e,t){if(r!==null)for(var i,s,n,o,l,u,f,x=0,w=0,$,M=r.type,T=M==="FeatureCollection",R=M==="Feature",F=T?r.features.length:1,G=0;G<F;G++){f=T?r.features[G].geometry:R?r.geometry:r,$=f?f.type==="GeometryCollection":!1,l=$?f.geometries.length:1;for(var L=0;L<l;L++){var Q=0,oe=0;if(o=$?f.geometries[L]:f,o!==null){u=o.coordinates;var be=o.type;switch(x=0,be){case null:break;case"Point":if(e(u,w,G,Q,oe)===!1)return!1;w++,Q++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(e(u[i],w,G,Q,oe)===!1)return!1;w++,be==="MultiPoint"&&Q++}be==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(s=0;s<u[i].length-x;s++){if(e(u[i][s],w,G,Q,oe)===!1)return!1;w++}be==="MultiLineString"&&Q++,be==="Polygon"&&oe++}be==="Polygon"&&Q++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for(oe=0,s=0;s<u[i].length;s++){for(n=0;n<u[i][s].length-x;n++){if(e(u[i][s][n],w,G,Q,oe)===!1)return!1;w++}oe++}Q++}break;case"GeometryCollection":for(i=0;i<o.geometries.length;i++)if(rr(o.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ii(r,e){var t,i,s,n,o,l,u,f,x,w,$=0,M=r.type==="FeatureCollection",T=r.type==="Feature",R=M?r.features.length:1;for(t=0;t<R;t++){for(l=M?r.features[t].geometry:T?r.geometry:r,f=M?r.features[t].properties:T?r.properties:{},x=M?r.features[t].bbox:T?r.bbox:void 0,w=M?r.features[t].id:T?r.id:void 0,u=l?l.type==="GeometryCollection":!1,o=u?l.geometries.length:1,s=0;s<o;s++){if(n=u?l.geometries[s]:l,n===null){if(e(null,$,f,x,w)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(n,$,f,x,w)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(e(n.geometries[i],$,f,x,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}$++}}function Fs(r,e){ii(r,function(t,i,s,n,o){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return e(xt(t,s,{bbox:n,id:o}),i,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var f=0;f<t.coordinates.length;f++){var x=t.coordinates[f],w={type:u,coordinates:x};if(e(xt(w,s),i,f)===!1)return!1}})}function Us(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;const t=[1/0,1/0,-1/0,-1/0];return rr(r,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var sr=Us,Bs=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ri=Math.ceil,he=Math.floor,se="[BigNumber Error] ",nr=se+"Number primitive has more than 15 significant digits: ",me=1e14,P=14,si=9007199254740991,ni=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ae=1e7,X=1e9;function or(r){var e,t,i,s=L.prototype={constructor:L,toString:null,valueOf:null},n=new L(1),o=20,l=4,u=-7,f=21,x=-1e7,w=1e7,$=!1,M=1,T=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function L(a,c){var h,v,p,g,E,d,m,b,y=this;if(!(y instanceof L))return new L(a,c);if(c==null){if(a&&a._isBigNumber===!0){y.s=a.s,!a.c||a.e>w?y.c=y.e=null:a.e<x?y.c=[y.e=0]:(y.e=a.e,y.c=a.c.slice());return}if((d=typeof a=="number")&&a*0==0){if(y.s=1/a<0?(a=-a,-1):1,a===~~a){for(g=0,E=a;E>=10;E/=10,g++);g>w?y.c=y.e=null:(y.e=g,y.c=[a]);return}b=String(a)}else{if(!Bs.test(b=String(a)))return i(y,b,d);y.s=b.charCodeAt(0)==45?(b=b.slice(1),-1):1}(g=b.indexOf("."))>-1&&(b=b.replace(".","")),(E=b.search(/e/i))>0?(g<0&&(g=E),g+=+b.slice(E+1),b=b.substring(0,E)):g<0&&(g=b.length)}else{if(q(c,2,F.length,"Base"),c==10&&G)return y=new L(a),fe(y,o+y.e+1,l);if(b=String(a),d=typeof a=="number"){if(a*0!=0)return i(y,b,d,c);if(y.s=1/a<0?(b=b.slice(1),-1):1,L.DEBUG&&b.replace(/^0\.0*|\./,"").length>15)throw Error(nr+a)}else y.s=b.charCodeAt(0)===45?(b=b.slice(1),-1):1;for(h=F.slice(0,c),g=E=0,m=b.length;E<m;E++)if(h.indexOf(v=b.charAt(E))<0){if(v=="."){if(E>g){g=m;continue}}else if(!p&&(b==b.toUpperCase()&&(b=b.toLowerCase())||b==b.toLowerCase()&&(b=b.toUpperCase()))){p=!0,E=-1,g=0;continue}return i(y,String(a),d,c)}d=!1,b=t(b,c,10,y.s),(g=b.indexOf("."))>-1?b=b.replace(".",""):g=b.length}for(E=0;b.charCodeAt(E)===48;E++);for(m=b.length;b.charCodeAt(--m)===48;);if(b=b.slice(E,++m)){if(m-=E,d&&L.DEBUG&&m>15&&(a>si||a!==he(a)))throw Error(nr+y.s*a);if((g=g-E-1)>w)y.c=y.e=null;else if(g<x)y.c=[y.e=0];else{if(y.e=g,y.c=[],E=(g+1)%P,g<0&&(E+=P),E<m){for(E&&y.c.push(+b.slice(0,E)),m-=P;E<m;)y.c.push(+b.slice(E,E+=P));E=P-(b=b.slice(E)).length}else E-=m;for(;E--;b+="0");y.c.push(+b)}}else y.c=[y.e=0]}L.clone=or,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(a){var c,h;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(c="DECIMAL_PLACES")&&(h=a[c],q(h,0,X,c),o=h),a.hasOwnProperty(c="ROUNDING_MODE")&&(h=a[c],q(h,0,8,c),l=h),a.hasOwnProperty(c="EXPONENTIAL_AT")&&(h=a[c],h&&h.pop?(q(h[0],-X,0,c),q(h[1],0,X,c),u=h[0],f=h[1]):(q(h,-X,X,c),u=-(f=h<0?-h:h))),a.hasOwnProperty(c="RANGE"))if(h=a[c],h&&h.pop)q(h[0],-X,-1,c),q(h[1],1,X,c),x=h[0],w=h[1];else if(q(h,-X,X,c),h)x=-(w=h<0?-h:h);else throw Error(se+c+" cannot be zero: "+h);if(a.hasOwnProperty(c="CRYPTO"))if(h=a[c],h===!!h)if(h)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))$=h;else throw $=!h,Error(se+"crypto unavailable");else $=h;else throw Error(se+c+" not true or false: "+h);if(a.hasOwnProperty(c="MODULO_MODE")&&(h=a[c],q(h,0,9,c),M=h),a.hasOwnProperty(c="POW_PRECISION")&&(h=a[c],q(h,0,X,c),T=h),a.hasOwnProperty(c="FORMAT"))if(h=a[c],typeof h=="object")R=h;else throw Error(se+c+" not an object: "+h);if(a.hasOwnProperty(c="ALPHABET"))if(h=a[c],typeof h=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(h))G=h.slice(0,10)=="0123456789",F=h;else throw Error(se+c+" invalid: "+h)}else throw Error(se+"Object expected: "+a);return{DECIMAL_PLACES:o,ROUNDING_MODE:l,EXPONENTIAL_AT:[u,f],RANGE:[x,w],CRYPTO:$,MODULO_MODE:M,POW_PRECISION:T,FORMAT:R,ALPHABET:F}},L.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!L.DEBUG)return!0;var c,h,v=a.c,p=a.e,g=a.s;e:if({}.toString.call(v)=="[object Array]"){if((g===1||g===-1)&&p>=-X&&p<=X&&p===he(p)){if(v[0]===0){if(p===0&&v.length===1)return!0;break e}if(c=(p+1)%P,c<1&&(c+=P),String(v[0]).length==c){for(c=0;c<v.length;c++)if(h=v[c],h<0||h>=me||h!==he(h))break e;if(h!==0)return!0}}}else if(v===null&&p===null&&(g===null||g===1||g===-1))return!0;throw Error(se+"Invalid BigNumber: "+a)},L.maximum=L.max=function(){return oe(arguments,-1)},L.minimum=L.min=function(){return oe(arguments,1)},L.random=(function(){var a=9007199254740992,c=Math.random()*a&2097151?function(){return he(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(h){var v,p,g,E,d,m=0,b=[],y=new L(n);if(h==null?h=o:q(h,0,X),E=ri(h/P),$)if(crypto.getRandomValues){for(v=crypto.getRandomValues(new Uint32Array(E*=2));m<E;)d=v[m]*131072+(v[m+1]>>>11),d>=9e15?(p=crypto.getRandomValues(new Uint32Array(2)),v[m]=p[0],v[m+1]=p[1]):(b.push(d%1e14),m+=2);m=E/2}else if(crypto.randomBytes){for(v=crypto.randomBytes(E*=7);m<E;)d=(v[m]&31)*281474976710656+v[m+1]*1099511627776+v[m+2]*4294967296+v[m+3]*16777216+(v[m+4]<<16)+(v[m+5]<<8)+v[m+6],d>=9e15?crypto.randomBytes(7).copy(v,m):(b.push(d%1e14),m+=7);m=E/7}else throw $=!1,Error(se+"crypto unavailable");if(!$)for(;m<E;)d=c(),d<9e15&&(b[m++]=d%1e14);for(E=b[--m],h%=P,E&&h&&(d=ni[P-h],b[m]=he(E/d)*d);b[m]===0;b.pop(),m--);if(m<0)b=[g=0];else{for(g=-1;b[0]===0;b.splice(0,1),g-=P);for(m=1,d=b[0];d>=10;d/=10,m++);m<P&&(g-=P-m)}return y.e=g,y.c=b,y}})(),L.sum=function(){for(var a=1,c=arguments,h=new L(c[0]);a<c.length;)h=h.plus(c[a++]);return h},t=(function(){var a="0123456789";function c(h,v,p,g){for(var E,d=[0],m,b=0,y=h.length;b<y;){for(m=d.length;m--;d[m]*=v);for(d[0]+=g.indexOf(h.charAt(b++)),E=0;E<d.length;E++)d[E]>p-1&&(d[E+1]==null&&(d[E+1]=0),d[E+1]+=d[E]/p|0,d[E]%=p)}return d.reverse()}return function(h,v,p,g,E){var d,m,b,y,S,A,C,D,H=h.indexOf("."),K=o,U=l;for(H>=0&&(y=T,T=0,h=h.replace(".",""),D=new L(v),A=D.pow(h.length-H),T=y,D.c=c(xe(de(A.c),A.e,"0"),10,p,a),D.e=D.c.length),C=c(h,v,p,E?(d=F,a):(d=a,F)),b=y=C.length;C[--y]==0;C.pop());if(!C[0])return d.charAt(0);if(H<0?--b:(A.c=C,A.e=b,A.s=g,A=e(A,D,K,U,p),C=A.c,S=A.r,b=A.e),m=b+K+1,H=C[m],y=p/2,S=S||m<0||C[m+1]!=null,S=U<4?(H!=null||S)&&(U==0||U==(A.s<0?3:2)):H>y||H==y&&(U==4||S||U==6&&C[m-1]&1||U==(A.s<0?8:7)),m<1||!C[0])h=S?xe(d.charAt(1),-K,d.charAt(0)):d.charAt(0);else{if(C.length=m,S)for(--p;++C[--m]>p;)C[m]=0,m||(++b,C=[1].concat(C));for(y=C.length;!C[--y];);for(H=0,h="";H<=y;h+=d.charAt(C[H++]));h=xe(h,b,d.charAt(0))}return h}})(),e=(function(){function a(v,p,g){var E,d,m,b,y=0,S=v.length,A=p%Ae,C=p/Ae|0;for(v=v.slice();S--;)m=v[S]%Ae,b=v[S]/Ae|0,E=C*m+b*A,d=A*m+E%Ae*Ae+y,y=(d/g|0)+(E/Ae|0)+C*b,v[S]=d%g;return y&&(v=[y].concat(v)),v}function c(v,p,g,E){var d,m;if(g!=E)m=g>E?1:-1;else for(d=m=0;d<g;d++)if(v[d]!=p[d]){m=v[d]>p[d]?1:-1;break}return m}function h(v,p,g,E){for(var d=0;g--;)v[g]-=d,d=v[g]<p[g]?1:0,v[g]=d*E+v[g]-p[g];for(;!v[0]&&v.length>1;v.splice(0,1));}return function(v,p,g,E,d){var m,b,y,S,A,C,D,H,K,U,W,J,Ct,ci,hi,Ee,st,pe=v.s==p.s?1:-1,te=v.c,j=p.c;if(!te||!te[0]||!j||!j[0])return new L(!v.s||!p.s||(te?j&&te[0]==j[0]:!j)?NaN:te&&te[0]==0||!j?pe*0:pe/0);for(H=new L(pe),K=H.c=[],b=v.e-p.e,pe=g+b+1,d||(d=me,b=ue(v.e/P)-ue(p.e/P),pe=pe/P|0),y=0;j[y]==(te[y]||0);y++);if(j[y]>(te[y]||0)&&b--,pe<0)K.push(1),S=!0;else{for(ci=te.length,Ee=j.length,y=0,pe+=2,A=he(d/(j[0]+1)),A>1&&(j=a(j,A,d),te=a(te,A,d),Ee=j.length,ci=te.length),Ct=Ee,U=te.slice(0,Ee),W=U.length;W<Ee;U[W++]=0);st=j.slice(),st=[0].concat(st),hi=j[0],j[1]>=d/2&&hi++;do{if(A=0,m=c(j,U,Ee,W),m<0){if(J=U[0],Ee!=W&&(J=J*d+(U[1]||0)),A=he(J/hi),A>1)for(A>=d&&(A=d-1),C=a(j,A,d),D=C.length,W=U.length;c(C,U,D,W)==1;)A--,h(C,Ee<D?st:j,D,d),D=C.length,m=1;else A==0&&(m=A=1),C=j.slice(),D=C.length;if(D<W&&(C=[0].concat(C)),h(U,C,W,d),W=U.length,m==-1)for(;c(j,U,Ee,W)<1;)A++,h(U,Ee<W?st:j,W,d),W=U.length}else m===0&&(A++,U=[0]);K[y++]=A,U[0]?U[W++]=te[Ct]||0:(U=[te[Ct]],W=1)}while((Ct++<ci||U[0]!=null)&&pe--);S=U[0]!=null,K[0]||K.splice(0,1)}if(d==me){for(y=1,pe=K[0];pe>=10;pe/=10,y++);fe(H,g+(H.e=y+b*P-1)+1,E,S)}else H.e=b,H.r=+S;return H}})();function Q(a,c,h,v){var p,g,E,d,m;if(h==null?h=l:q(h,0,8),!a.c)return a.toString();if(p=a.c[0],E=a.e,c==null)m=de(a.c),m=v==1||v==2&&(E<=u||E>=f)?Lt(m,E):xe(m,E,"0");else if(a=fe(new L(a),c,h),g=a.e,m=de(a.c),d=m.length,v==1||v==2&&(c<=g||g<=u)){for(;d<c;m+="0",d++);m=Lt(m,g)}else if(c-=E+(v===2&&g>E),m=xe(m,g,"0"),g+1>d){if(--c>0)for(m+=".";c--;m+="0");}else if(c+=g-d,c>0)for(g+1==d&&(m+=".");c--;m+="0");return a.s<0&&p?"-"+m:m}function oe(a,c){for(var h,v,p=1,g=new L(a[0]);p<a.length;p++)v=new L(a[p]),(!v.s||(h=Pe(g,v))===c||h===0&&g.s===c)&&(g=v);return g}function be(a,c,h){for(var v=1,p=c.length;!c[--p];c.pop());for(p=c[0];p>=10;p/=10,v++);return(h=v+h*P-1)>w?a.c=a.e=null:h<x?a.c=[a.e=0]:(a.e=h,a.c=c),a}i=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,h=/^\.([^.]+)$/,v=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(g,E,d,m){var b,y=d?E:E.replace(p,"");if(v.test(y))g.s=isNaN(y)?null:y<0?-1:1;else{if(!d&&(y=y.replace(a,function(S,A,C){return b=(C=C.toLowerCase())=="x"?16:C=="b"?2:8,!m||m==b?A:S}),m&&(b=m,y=y.replace(c,"$1").replace(h,"0.$1")),E!=y))return new L(y,b);if(L.DEBUG)throw Error(se+"Not a"+(m?" base "+m:"")+" number: "+E);g.s=null}g.c=g.e=null}})();function fe(a,c,h,v){var p,g,E,d,m,b,y,S=a.c,A=ni;if(S){e:{for(p=1,d=S[0];d>=10;d/=10,p++);if(g=c-p,g<0)g+=P,E=c,m=S[b=0],y=he(m/A[p-E-1]%10);else if(b=ri((g+1)/P),b>=S.length)if(v){for(;S.length<=b;S.push(0));m=y=0,p=1,g%=P,E=g-P+1}else break e;else{for(m=d=S[b],p=1;d>=10;d/=10,p++);g%=P,E=g-P+p,y=E<0?0:he(m/A[p-E-1]%10)}if(v=v||c<0||S[b+1]!=null||(E<0?m:m%A[p-E-1]),v=h<4?(y||v)&&(h==0||h==(a.s<0?3:2)):y>5||y==5&&(h==4||v||h==6&&(g>0?E>0?m/A[p-E]:0:S[b-1])%10&1||h==(a.s<0?8:7)),c<1||!S[0])return S.length=0,v?(c-=a.e+1,S[0]=A[(P-c%P)%P],a.e=-c||0):S[0]=a.e=0,a;if(g==0?(S.length=b,d=1,b--):(S.length=b+1,d=A[P-g],S[b]=E>0?he(m/A[p-E]%A[E])*d:0),v)for(;;)if(b==0){for(g=1,E=S[0];E>=10;E/=10,g++);for(E=S[0]+=d,d=1;E>=10;E/=10,d++);g!=d&&(a.e++,S[0]==me&&(S[0]=1));break}else{if(S[b]+=d,S[b]!=me)break;S[b--]=0,d=1}for(g=S.length;S[--g]===0;S.pop());}a.e>w?a.c=a.e=null:a.e<x&&(a.c=[a.e=0])}return a}function Le(a){var c,h=a.e;return h===null?a.toString():(c=de(a.c),c=h<=u||h>=f?Lt(c,h):xe(c,h,"0"),a.s<0?"-"+c:c)}return s.absoluteValue=s.abs=function(){var a=new L(this);return a.s<0&&(a.s=1),a},s.comparedTo=function(a,c){return Pe(this,new L(a,c))},s.decimalPlaces=s.dp=function(a,c){var h,v,p,g=this;if(a!=null)return q(a,0,X),c==null?c=l:q(c,0,8),fe(new L(g),a+g.e+1,c);if(!(h=g.c))return null;if(v=((p=h.length-1)-ue(this.e/P))*P,p=h[p])for(;p%10==0;p/=10,v--);return v<0&&(v=0),v},s.dividedBy=s.div=function(a,c){return e(this,new L(a,c),o,l)},s.dividedToIntegerBy=s.idiv=function(a,c){return e(this,new L(a,c),0,1)},s.exponentiatedBy=s.pow=function(a,c){var h,v,p,g,E,d,m,b,y,S=this;if(a=new L(a),a.c&&!a.isInteger())throw Error(se+"Exponent not an integer: "+Le(a));if(c!=null&&(c=new L(c)),d=a.e>14,!S.c||!S.c[0]||S.c[0]==1&&!S.e&&S.c.length==1||!a.c||!a.c[0])return y=new L(Math.pow(+Le(S),d?a.s*(2-St(a)):+Le(a))),c?y.mod(c):y;if(m=a.s<0,c){if(c.c?!c.c[0]:!c.s)return new L(NaN);v=!m&&S.isInteger()&&c.isInteger(),v&&(S=S.mod(c))}else{if(a.e>9&&(S.e>0||S.e<-1||(S.e==0?S.c[0]>1||d&&S.c[1]>=24e7:S.c[0]<8e13||d&&S.c[0]<=9999975e7)))return g=S.s<0&&St(a)?-0:0,S.e>-1&&(g=1/g),new L(m?1/g:g);T&&(g=ri(T/P+2))}for(d?(h=new L(.5),m&&(a.s=1),b=St(a)):(p=Math.abs(+Le(a)),b=p%2),y=new L(n);;){if(b){if(y=y.times(S),!y.c)break;g?y.c.length>g&&(y.c.length=g):v&&(y=y.mod(c))}if(p){if(p=he(p/2),p===0)break;b=p%2}else if(a=a.times(h),fe(a,a.e+1,1),a.e>14)b=St(a);else{if(p=+Le(a),p===0)break;b=p%2}S=S.times(S),g?S.c&&S.c.length>g&&(S.c.length=g):v&&(S=S.mod(c))}return v?y:(m&&(y=n.div(y)),c?y.mod(c):g?fe(y,T,l,E):y)},s.integerValue=function(a){var c=new L(this);return a==null?a=l:q(a,0,8),fe(c,c.e+1,a)},s.isEqualTo=s.eq=function(a,c){return Pe(this,new L(a,c))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(a,c){return Pe(this,new L(a,c))>0},s.isGreaterThanOrEqualTo=s.gte=function(a,c){return(c=Pe(this,new L(a,c)))===1||c===0},s.isInteger=function(){return!!this.c&&ue(this.e/P)>this.c.length-2},s.isLessThan=s.lt=function(a,c){return Pe(this,new L(a,c))<0},s.isLessThanOrEqualTo=s.lte=function(a,c){return(c=Pe(this,new L(a,c)))===-1||c===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(a,c){var h,v,p,g,E=this,d=E.s;if(a=new L(a,c),c=a.s,!d||!c)return new L(NaN);if(d!=c)return a.s=-c,E.plus(a);var m=E.e/P,b=a.e/P,y=E.c,S=a.c;if(!m||!b){if(!y||!S)return y?(a.s=-c,a):new L(S?E:NaN);if(!y[0]||!S[0])return S[0]?(a.s=-c,a):new L(y[0]?E:l==3?-0:0)}if(m=ue(m),b=ue(b),y=y.slice(),d=m-b){for((g=d<0)?(d=-d,p=y):(b=m,p=S),p.reverse(),c=d;c--;p.push(0));p.reverse()}else for(v=(g=(d=y.length)<(c=S.length))?d:c,d=c=0;c<v;c++)if(y[c]!=S[c]){g=y[c]<S[c];break}if(g&&(p=y,y=S,S=p,a.s=-a.s),c=(v=S.length)-(h=y.length),c>0)for(;c--;y[h++]=0);for(c=me-1;v>d;){if(y[--v]<S[v]){for(h=v;h&&!y[--h];y[h]=c);--y[h],y[v]+=me}y[v]-=S[v]}for(;y[0]==0;y.splice(0,1),--b);return y[0]?be(a,y,b):(a.s=l==3?-1:1,a.c=[a.e=0],a)},s.modulo=s.mod=function(a,c){var h,v,p=this;return a=new L(a,c),!p.c||!a.s||a.c&&!a.c[0]?new L(NaN):!a.c||p.c&&!p.c[0]?new L(p):(M==9?(v=a.s,a.s=1,h=e(p,a,0,3),a.s=v,h.s*=v):h=e(p,a,0,M),a=p.minus(h.times(a)),!a.c[0]&&M==1&&(a.s=p.s),a)},s.multipliedBy=s.times=function(a,c){var h,v,p,g,E,d,m,b,y,S,A,C,D,H,K,U=this,W=U.c,J=(a=new L(a,c)).c;if(!W||!J||!W[0]||!J[0])return!U.s||!a.s||W&&!W[0]&&!J||J&&!J[0]&&!W?a.c=a.e=a.s=null:(a.s*=U.s,!W||!J?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(v=ue(U.e/P)+ue(a.e/P),a.s*=U.s,m=W.length,S=J.length,m<S&&(D=W,W=J,J=D,p=m,m=S,S=p),p=m+S,D=[];p--;D.push(0));for(H=me,K=Ae,p=S;--p>=0;){for(h=0,A=J[p]%K,C=J[p]/K|0,E=m,g=p+E;g>p;)b=W[--E]%K,y=W[E]/K|0,d=C*b+y*A,b=A*b+d%K*K+D[g]+h,h=(b/H|0)+(d/K|0)+C*y,D[g--]=b%H;D[g]=h}return h?++v:D.splice(0,1),be(a,D,v)},s.negated=function(){var a=new L(this);return a.s=-a.s||null,a},s.plus=function(a,c){var h,v=this,p=v.s;if(a=new L(a,c),c=a.s,!p||!c)return new L(NaN);if(p!=c)return a.s=-c,v.minus(a);var g=v.e/P,E=a.e/P,d=v.c,m=a.c;if(!g||!E){if(!d||!m)return new L(p/0);if(!d[0]||!m[0])return m[0]?a:new L(d[0]?v:p*0)}if(g=ue(g),E=ue(E),d=d.slice(),p=g-E){for(p>0?(E=g,h=m):(p=-p,h=d),h.reverse();p--;h.push(0));h.reverse()}for(p=d.length,c=m.length,p-c<0&&(h=m,m=d,d=h,c=p),p=0;c;)p=(d[--c]=d[c]+m[c]+p)/me|0,d[c]=me===d[c]?0:d[c]%me;return p&&(d=[p].concat(d),++E),be(a,d,E)},s.precision=s.sd=function(a,c){var h,v,p,g=this;if(a!=null&&a!==!!a)return q(a,1,X),c==null?c=l:q(c,0,8),fe(new L(g),a,c);if(!(h=g.c))return null;if(p=h.length-1,v=p*P+1,p=h[p]){for(;p%10==0;p/=10,v--);for(p=h[0];p>=10;p/=10,v++);}return a&&g.e+1>v&&(v=g.e+1),v},s.shiftedBy=function(a){return q(a,-si,si),this.times("1e"+a)},s.squareRoot=s.sqrt=function(){var a,c,h,v,p,g=this,E=g.c,d=g.s,m=g.e,b=o+4,y=new L("0.5");if(d!==1||!E||!E[0])return new L(!d||d<0&&(!E||E[0])?NaN:E?g:1/0);if(d=Math.sqrt(+Le(g)),d==0||d==1/0?(c=de(E),(c.length+m)%2==0&&(c+="0"),d=Math.sqrt(+c),m=ue((m+1)/2)-(m<0||m%2),d==1/0?c="5e"+m:(c=d.toExponential(),c=c.slice(0,c.indexOf("e")+1)+m),h=new L(c)):h=new L(d+""),h.c[0]){for(m=h.e,d=m+b,d<3&&(d=0);;)if(p=h,h=y.times(p.plus(e(g,p,b,1))),de(p.c).slice(0,d)===(c=de(h.c)).slice(0,d))if(h.e<m&&--d,c=c.slice(d-3,d+1),c=="9999"||!v&&c=="4999"){if(!v&&(fe(p,p.e+o+2,0),p.times(p).eq(g))){h=p;break}b+=4,d+=4,v=1}else{(!+c||!+c.slice(1)&&c.charAt(0)=="5")&&(fe(h,h.e+o+2,1),a=!h.times(h).eq(g));break}}return fe(h,h.e+o+1,l,a)},s.toExponential=function(a,c){return a!=null&&(q(a,0,X),a++),Q(this,a,c,1)},s.toFixed=function(a,c){return a!=null&&(q(a,0,X),a=a+this.e+1),Q(this,a,c)},s.toFormat=function(a,c,h){var v,p=this;if(h==null)a!=null&&c&&typeof c=="object"?(h=c,c=null):a&&typeof a=="object"?(h=a,a=c=null):h=R;else if(typeof h!="object")throw Error(se+"Argument not an object: "+h);if(v=p.toFixed(a,c),p.c){var g,E=v.split("."),d=+h.groupSize,m=+h.secondaryGroupSize,b=h.groupSeparator||"",y=E[0],S=E[1],A=p.s<0,C=A?y.slice(1):y,D=C.length;if(m&&(g=d,d=m,m=g,D-=g),d>0&&D>0){for(g=D%d||d,y=C.substr(0,g);g<D;g+=d)y+=b+C.substr(g,d);m>0&&(y+=b+C.slice(g)),A&&(y="-"+y)}v=S?y+(h.decimalSeparator||"")+((m=+h.fractionGroupSize)?S.replace(new RegExp("\\d{"+m+"}\\B","g"),"$&"+(h.fractionGroupSeparator||"")):S):y}return(h.prefix||"")+v+(h.suffix||"")},s.toFraction=function(a){var c,h,v,p,g,E,d,m,b,y,S,A,C=this,D=C.c;if(a!=null&&(d=new L(a),!d.isInteger()&&(d.c||d.s!==1)||d.lt(n)))throw Error(se+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+Le(d));if(!D)return new L(C);for(c=new L(n),b=h=new L(n),v=m=new L(n),A=de(D),g=c.e=A.length-C.e-1,c.c[0]=ni[(E=g%P)<0?P+E:E],a=!a||d.comparedTo(c)>0?g>0?c:b:d,E=w,w=1/0,d=new L(A),m.c[0]=0;y=e(d,c,0,1),p=h.plus(y.times(v)),p.comparedTo(a)!=1;)h=v,v=p,b=m.plus(y.times(p=b)),m=p,c=d.minus(y.times(p=c)),d=p;return p=e(a.minus(h),v,0,1),m=m.plus(p.times(b)),h=h.plus(p.times(v)),m.s=b.s=C.s,g=g*2,S=e(b,v,g,l).minus(C).abs().comparedTo(e(m,h,g,l).minus(C).abs())<1?[b,v]:[m,h],w=E,S},s.toNumber=function(){return+Le(this)},s.toPrecision=function(a,c){return a!=null&&q(a,1,X),Q(this,a,c,2)},s.toString=function(a){var c,h=this,v=h.s,p=h.e;return p===null?v?(c="Infinity",v<0&&(c="-"+c)):c="NaN":(a==null?c=p<=u||p>=f?Lt(de(h.c),p):xe(de(h.c),p,"0"):a===10&&G?(h=fe(new L(h),o+p+1,l),c=xe(de(h.c),h.e,"0")):(q(a,2,F.length,"Base"),c=t(xe(de(h.c),p,"0"),10,a,v,!0)),v<0&&h.c[0]&&(c="-"+c)),c},s.valueOf=s.toJSON=function(){return Le(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,r!=null&&L.set(r),L}function ue(r){var e=r|0;return r>0||r===e?e:e-1}function de(r){for(var e,t,i=1,s=r.length,n=r[0]+"";i<s;){for(e=r[i++]+"",t=P-e.length;t--;e="0"+e);n+=e}for(s=n.length;n.charCodeAt(--s)===48;);return n.slice(0,s+1||1)}function Pe(r,e){var t,i,s=r.c,n=e.c,o=r.s,l=e.s,u=r.e,f=e.e;if(!o||!l)return null;if(t=s&&!s[0],i=n&&!n[0],t||i)return t?i?0:-l:o;if(o!=l)return o;if(t=o<0,i=u==f,!s||!n)return i?0:!s^t?1:-1;if(!i)return u>f^t?1:-1;for(l=(u=s.length)<(f=n.length)?u:f,o=0;o<l;o++)if(s[o]!=n[o])return s[o]>n[o]^t?1:-1;return u==f?0:u>f^t?1:-1}function q(r,e,t,i){if(r<e||r>t||r!==he(r))throw Error(se+(i||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function St(r){var e=r.c.length-1;return ue(r.e/P)==e&&r.c[e]%2!=0}function Lt(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function xe(r,e,t){var i,s;if(e<0){for(s=t+".";++e;s+=t);r=s+r}else if(i=r.length,++e>i){for(s=t,e-=i;--e;s+=t);r+=s}else e<i&&(r=r.slice(0,e)+"."+r.slice(e));return r}var ye=or(),Ds=class{key;left=null;right=null;constructor(r){this.key=r}},tt=class extends Ds{constructor(r){super(r)}},Ws=class{size=0;modificationCount=0;splayCount=0;splay(r){const e=this.root;if(e==null)return this.compare(r,r),-1;let t=null,i=null,s=null,n=null,o=e;const l=this.compare;let u;for(;;)if(u=l(o.key,r),u>0){let f=o.left;if(f==null||(u=l(f.key,r),u>0&&(o.left=f.right,f.right=o,o=f,f=o.left,f==null)))break;t==null?i=o:t.left=o,t=o,o=f}else if(u<0){let f=o.right;if(f==null||(u=l(f.key,r),u<0&&(o.right=f.left,f.left=o,o=f,f=o.right,f==null)))break;s==null?n=o:s.right=o,s=o,o=f}else break;return s!=null&&(s.right=o.left,o.left=n),t!=null&&(t.left=o.right,o.right=i),this.root!==o&&(this.root=o,this.splayCount++),u}splayMin(r){let e=r,t=e.left;for(;t!=null;){const i=t;e.left=i.right,i.right=e,e=i,t=e.left}return e}splayMax(r){let e=r,t=e.right;for(;t!=null;){const i=t;e.right=i.left,i.left=e,e=i,t=e.right}return e}_delete(r){if(this.root==null||this.splay(r)!=0)return null;let t=this.root;const i=t,s=t.left;if(this.size--,s==null)this.root=t.right;else{const n=t.right;t=this.splayMax(s),t.right=n,this.root=t}return this.modificationCount++,i}addNewRoot(r,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=r;return}e<0?(r.left=t,r.right=t.right,t.right=null):(r.right=t,r.left=t.left,t.left=null),this.root=r}_first(){const r=this.root;return r==null?null:(this.root=this.splayMin(r),this.root)}_last(){const r=this.root;return r==null?null:(this.root=this.splayMax(r),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(r){return this.validKey(r)&&this.splay(r)==0}defaultCompare(){return(r,e)=>r<e?-1:r>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:r=>{this.root=r},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:r=>{this.splayCount=r},splay:r=>this.splay(r),has:r=>this.has(r)}}},_t=class nt extends Ws{root=null;compare;validKey;constructor(e,t){super(),this.compare=e??this.defaultCompare(),this.validKey=t??(i=>i!=null&&i!=null)}delete(e){return this.validKey(e)?this._delete(e)!=null:!1}deleteAll(e){for(const t of e)this.delete(t)}forEach(e){const t=this[Symbol.iterator]();let i;for(;i=t.next(),!i.done;)e(i.value,i.value,this)}add(e){const t=this.splay(e);return t!=0&&this.addNewRoot(new tt(e),t),this}addAndReturn(e){const t=this.splay(e);return t!=0&&this.addNewRoot(new tt(e),t),this.root.key}addAll(e){for(const t of e)this.add(t)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)<0)return this.root.key;let i=this.root.left;if(i==null)return null;let s=i.right;for(;s!=null;)i=s,s=i.right;return i.key}firstAfter(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)>0)return this.root.key;let i=this.root.right;if(i==null)return null;let s=i.left;for(;s!=null;)i=s,s=i.left;return i.key}retainAll(e){const t=new nt(this.compare,this.validKey),i=this.modificationCount;for(const s of e){if(i!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(s)&&this.splay(s)==0&&t.add(this.root.key)}t.size!=this.size&&(this.root=t.root,this.size=t.size,this.modificationCount++)}lookup(e){return!this.validKey(e)||this.splay(e)!=0?null:this.root.key}intersection(e){const t=new nt(this.compare,this.validKey);for(const i of this)e.has(i)&&t.add(i);return t}difference(e){const t=new nt(this.compare,this.validKey);for(const i of this)e.has(i)||t.add(i);return t}union(e){const t=this.clone();return t.addAll(e),t}clone(){const e=new nt(this.compare,this.validKey);return e.size=this.size,e.root=this.copyNode(this.root),e}copyNode(e){if(e==null)return null;function t(s,n){let o,l;do{if(o=s.left,l=s.right,o!=null){const u=new tt(o.key);n.left=u,t(o,u)}if(l!=null){const u=new tt(l.key);n.right=u,s=l,n=u}}while(l!=null)}const i=new tt(e.key);return t(e,i),i}toSet(){return this.clone()}entries(){return new qs(this.wrap())}keys(){return this[Symbol.iterator]()}undefined(){return this[Symbol.iterator]()}[Symbol.iterator](){return new zs(this.wrap())}[Symbol.toStringTag]="[object Set]"},lr=class{tree;path=new Array;modificationCount=null;splayCount;constructor(r){this.tree=r,this.splayCount=r.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const r=this.path[this.path.length-1];return this.getValue(r)}rebuildPath(r){this.path.splice(0,this.path.length),this.tree.splay(r),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(r){for(;r!=null;)this.path.push(r),r=r.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let r=this.path[this.path.length-1],e=r.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===r;)r=this.path.pop();return this.path.length>0}},zs=class extends lr{getValue(r){return r.key}},qs=class extends lr{getValue(r){return[r.key,r.key]}},ar=r=>()=>r,oi=r=>{const e=r?(t,i)=>i.minus(t).abs().isLessThanOrEqualTo(r):ar(!1);return(t,i)=>e(t,i)?0:t.comparedTo(i)};function Hs(r){const e=r?(t,i,s,n,o)=>t.exponentiatedBy(2).isLessThanOrEqualTo(n.minus(i).exponentiatedBy(2).plus(o.minus(s).exponentiatedBy(2)).times(r)):ar(!1);return(t,i,s)=>{const n=t.x,o=t.y,l=s.x,u=s.y,f=o.minus(u).times(i.x.minus(l)).minus(n.minus(l).times(i.y.minus(u)));return e(f,n,o,l,u)?0:f.comparedTo(0)}}var js=r=>r,Vs=r=>{if(r){const e=new _t(oi(r)),t=new _t(oi(r)),i=(n,o)=>o.addAndReturn(n),s=n=>({x:i(n.x,e),y:i(n.y,t)});return s({x:new ye(0),y:new ye(0)}),s}return js},li=r=>({set:e=>{Se=li(e)},reset:()=>li(r),compare:oi(r),snap:Vs(r),orient:Hs(r)}),Se=li(),it=(r,e)=>r.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(r.ur.x)&&r.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(r.ur.y),ai=(r,e)=>{if(e.ur.x.isLessThan(r.ll.x)||r.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(r.ll.y)||r.ur.y.isLessThan(e.ll.y))return null;const t=r.ll.x.isLessThan(e.ll.x)?e.ll.x:r.ll.x,i=r.ur.x.isLessThan(e.ur.x)?r.ur.x:e.ur.x,s=r.ll.y.isLessThan(e.ll.y)?e.ll.y:r.ll.y,n=r.ur.y.isLessThan(e.ur.y)?r.ur.y:e.ur.y;return{ll:{x:t,y:s},ur:{x:i,y:n}}},$t=(r,e)=>r.x.times(e.y).minus(r.y.times(e.x)),cr=(r,e)=>r.x.times(e.x).plus(r.y.times(e.y)),Mt=r=>cr(r,r).sqrt(),Zs=(r,e,t)=>{const i={x:e.x.minus(r.x),y:e.y.minus(r.y)},s={x:t.x.minus(r.x),y:t.y.minus(r.y)};return $t(s,i).div(Mt(s)).div(Mt(i))},Ks=(r,e,t)=>{const i={x:e.x.minus(r.x),y:e.y.minus(r.y)},s={x:t.x.minus(r.x),y:t.y.minus(r.y)};return cr(s,i).div(Mt(s)).div(Mt(i))},hr=(r,e,t)=>e.y.isZero()?null:{x:r.x.plus(e.x.div(e.y).times(t.minus(r.y))),y:t},ur=(r,e,t)=>e.x.isZero()?null:{x:t,y:r.y.plus(e.y.div(e.x).times(t.minus(r.x)))},Ys=(r,e,t,i)=>{if(e.x.isZero())return ur(t,i,r.x);if(i.x.isZero())return ur(r,e,t.x);if(e.y.isZero())return hr(t,i,r.y);if(i.y.isZero())return hr(r,e,t.y);const s=$t(e,i);if(s.isZero())return null;const n={x:t.x.minus(r.x),y:t.y.minus(r.y)},o=$t(n,e).div(s),l=$t(n,i).div(s),u=r.x.plus(l.times(e.x)),f=t.x.plus(o.times(i.x)),x=r.y.plus(l.times(e.y)),w=t.y.plus(o.times(i.y)),$=u.plus(f).div(2),M=x.plus(w).div(2);return{x:$,y:M}},ve=class vr{point;isLeft;segment;otherSE;consumedBy;static compare(e,t){const i=vr.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:At.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,s=t.length;i<s;i++){const n=t[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let s=t+1;s<e;s++){const n=this.point.events[s];n.consumedBy===void 0&&i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;t++){const s=this.point.events[t];s!==this&&!s.segment.ringOut&&s.segment.isInResult()&&e.push(s)}return e}getLeftmostComparator(e){const t=new Map,i=s=>{const n=s.otherSE;t.set(s,{sine:Zs(this.point,e.point,n.point),cosine:Ks(this.point,e.point,n.point)})};return(s,n)=>{t.has(s)||i(s),t.has(n)||i(n);const{sine:o,cosine:l}=t.get(s),{sine:u,cosine:f}=t.get(n);return o.isGreaterThanOrEqualTo(0)&&u.isGreaterThanOrEqualTo(0)?l.isLessThan(f)?1:l.isGreaterThan(f)?-1:0:o.isLessThan(0)&&u.isLessThan(0)?l.isLessThan(f)?-1:l.isGreaterThan(f)?1:0:u.isLessThan(o)?-1:u.isGreaterThan(o)?1:0}}},Xs=class ui{events;poly;_isExteriorRing;_enclosingRing;static factory(e){const t=[];for(let i=0,s=e.length;i<s;i++){const n=e[i];if(!n.isInResult()||n.ringOut)continue;let o=null,l=n.leftSE,u=n.rightSE;const f=[l],x=l.point,w=[];for(;o=l,l=u,f.push(l),l.point!==x;)for(;;){const $=l.getAvailableLinkedEvents();if($.length===0){const R=f[0].point,F=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${R.x}, ${R.y}]. Last matching segment found ends at [${F.x}, ${F.y}].`)}if($.length===1){u=$[0].otherSE;break}let M=null;for(let R=0,F=w.length;R<F;R++)if(w[R].point===l.point){M=R;break}if(M!==null){const R=w.splice(M)[0],F=f.splice(R.index);F.unshift(F[0].otherSE),t.push(new ui(F.reverse()));continue}w.push({index:f.length,point:l.point});const T=l.getLeftmostComparator(o);u=$.sort(T)[0].otherSE;break}t.push(new ui(f))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let f=1,x=this.events.length-1;f<x;f++){const w=this.events[f].point,$=this.events[f+1].point;Se.orient(w,e,$)!==0&&(t.push(w),e=w)}if(t.length===1)return null;const i=t[0],s=t[1];Se.orient(i,e,s)===0&&t.shift(),t.push(t[0]);const n=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:t.length-1,l=this.isExteriorRing()?t.length:-1,u=[];for(let f=o;f!=l;f+=n)u.push([t[f].x.toNumber(),t[f].y.toNumber()]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let s=1,n=this.events.length;s<n;s++){const o=this.events[s];ve.compare(e,o)>0&&(e=o)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut?.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut?.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}},dr=class{exteriorRing;interiorRings;constructor(r){this.exteriorRing=r,r.poly=this,this.interiorRings=[]}addInterior(r){this.interiorRings.push(r),r.poly=this}getGeom(){const r=this.exteriorRing.getGeom();if(r===null)return null;const e=[r];for(let t=0,i=this.interiorRings.length;t<i;t++){const s=this.interiorRings[t].getGeom();s!==null&&e.push(s)}return e}},Qs=class{rings;polys;constructor(r){this.rings=r,this.polys=this._composePolys(r)}getGeom(){const r=[];for(let e=0,t=this.polys.length;e<t;e++){const i=this.polys[e].getGeom();i!==null&&r.push(i)}return r}_composePolys(r){const e=[];for(let t=0,i=r.length;t<i;t++){const s=r[t];if(!s.poly)if(s.isExteriorRing())e.push(new dr(s));else{const n=s.enclosingRing();n?.poly||e.push(new dr(n)),n?.poly?.addInterior(s)}}return e}},Js=class{queue;tree;segments;constructor(r,e=At.compare){this.queue=r,this.tree=new _t(e),this.segments=[]}process(r){const e=r.segment,t=[];if(r.consumedBy)return r.isLeft?this.queue.delete(r.otherSE):this.tree.delete(e),t;r.isLeft&&this.tree.add(e);let i=e,s=e;do i=this.tree.lastBefore(i);while(i!=null&&i.consumedBy!=null);do s=this.tree.firstAfter(s);while(s!=null&&s.consumedBy!=null);if(r.isLeft){let n=null;if(i){const l=i.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(n=l),!i.isAnEndpoint(l))){const u=this._splitSafely(i,l);for(let f=0,x=u.length;f<x;f++)t.push(u[f])}}let o=null;if(s){const l=s.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(o=l),!s.isAnEndpoint(l))){const u=this._splitSafely(s,l);for(let f=0,x=u.length;f<x;f++)t.push(u[f])}}if(n!==null||o!==null){let l=null;n===null?l=o:o===null?l=n:l=ve.comparePoints(n,o)<=0?n:o,this.queue.delete(e.rightSE),t.push(e.rightSE);const u=e.split(l);for(let f=0,x=u.length;f<x;f++)t.push(u[f])}t.length>0?(this.tree.delete(e),t.push(r)):(this.segments.push(e),e.prev=i)}else{if(i&&s){const n=i.getIntersection(s);if(n!==null){if(!i.isAnEndpoint(n)){const o=this._splitSafely(i,n);for(let l=0,u=o.length;l<u;l++)t.push(o[l])}if(!s.isAnEndpoint(n)){const o=this._splitSafely(s,n);for(let l=0,u=o.length;l<u;l++)t.push(o[l])}}}this.tree.delete(e)}return t}_splitSafely(r,e){this.tree.delete(r);const t=r.rightSE;this.queue.delete(t);const i=r.split(e);return i.push(t),r.consumedBy===void 0&&this.tree.add(r),i}},en=class{type;numMultiPolys;run(r,e,t){rt.type=r;const i=[new pr(e,!0)];for(let f=0,x=t.length;f<x;f++)i.push(new pr(t[f],!1));if(rt.numMultiPolys=i.length,rt.type==="difference"){const f=i[0];let x=1;for(;x<i.length;)ai(i[x].bbox,f.bbox)!==null?x++:i.splice(x,1)}if(rt.type==="intersection")for(let f=0,x=i.length;f<x;f++){const w=i[f];for(let $=f+1,M=i.length;$<M;$++)if(ai(w.bbox,i[$].bbox)===null)return[]}const s=new _t(ve.compare);for(let f=0,x=i.length;f<x;f++){const w=i[f].getSweepEvents();for(let $=0,M=w.length;$<M;$++)s.add(w[$])}const n=new Js(s);let o=null;for(s.size!=0&&(o=s.first(),s.delete(o));o;){const f=n.process(o);for(let x=0,w=f.length;x<w;x++){const $=f[x];$.consumedBy===void 0&&s.add($)}s.size!=0?(o=s.first(),s.delete(o)):o=null}Se.reset();const l=Xs.factory(n.segments);return new Qs(l).getGeom()}},rt=new en,Tt=rt,tn=0,At=class Ot{id;leftSE;rightSE;rings;windings;ringOut;consumedBy;prev;_prevInResult;_beforeState;_afterState;_isInResult;static compare(e,t){const i=e.leftSE.point.x,s=t.leftSE.point.x,n=e.rightSE.point.x,o=t.rightSE.point.x;if(o.isLessThan(i))return 1;if(n.isLessThan(s))return-1;const l=e.leftSE.point.y,u=t.leftSE.point.y,f=e.rightSE.point.y,x=t.rightSE.point.y;if(i.isLessThan(s)){if(u.isLessThan(l)&&u.isLessThan(f))return 1;if(u.isGreaterThan(l)&&u.isGreaterThan(f))return-1;const w=e.comparePoint(t.leftSE.point);if(w<0)return 1;if(w>0)return-1;const $=t.comparePoint(e.rightSE.point);return $!==0?$:-1}if(i.isGreaterThan(s)){if(l.isLessThan(u)&&l.isLessThan(x))return-1;if(l.isGreaterThan(u)&&l.isGreaterThan(x))return 1;const w=t.comparePoint(e.leftSE.point);if(w!==0)return w;const $=e.comparePoint(t.rightSE.point);return $<0?1:$>0?-1:1}if(l.isLessThan(u))return-1;if(l.isGreaterThan(u))return 1;if(n.isLessThan(o)){const w=t.comparePoint(e.rightSE.point);if(w!==0)return w}if(n.isGreaterThan(o)){const w=e.comparePoint(t.rightSE.point);if(w<0)return 1;if(w>0)return-1}if(!n.eq(o)){const w=f.minus(l),$=n.minus(i),M=x.minus(u),T=o.minus(s);if(w.isGreaterThan($)&&M.isLessThan(T))return 1;if(w.isLessThan($)&&M.isGreaterThan(T))return-1}return n.isGreaterThan(o)?1:n.isLessThan(o)||f.isLessThan(x)?-1:f.isGreaterThan(x)?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,s){this.id=++tn,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=s}static fromRing(e,t,i){let s,n,o;const l=ve.comparePoints(e,t);if(l<0)s=e,n=t,o=1;else if(l>0)s=t,n=e,o=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const u=new ve(s,!0),f=new ve(n,!1);return new Ot(u,f,[i],[o])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return Se.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),i=e.bbox(),s=ai(t,i);if(s===null)return null;const n=this.leftSE.point,o=this.rightSE.point,l=e.leftSE.point,u=e.rightSE.point,f=it(t,l)&&this.comparePoint(l)===0,x=it(i,n)&&e.comparePoint(n)===0,w=it(t,u)&&this.comparePoint(u)===0,$=it(i,o)&&e.comparePoint(o)===0;if(x&&f)return $&&!w?o:!$&&w?u:null;if(x)return w&&n.x.eq(u.x)&&n.y.eq(u.y)?null:n;if(f)return $&&o.x.eq(l.x)&&o.y.eq(l.y)?null:l;if($&&w)return null;if($)return o;if(w)return u;const M=Ys(n,this.vector(),l,e.vector());return M===null||!it(s,M)?null:Se.snap(M)}split(e){const t=[],i=e.events!==void 0,s=new ve(e,!0),n=new ve(e,!1),o=this.rightSE;this.replaceRightSE(n),t.push(n),t.push(s);const l=new Ot(s,o,this.rings.slice(),this.windings.slice());return ve.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),ve.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(s.checkForConsuming(),n.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const s=Ot.compare(t,i);if(s!==0){if(s>0){const n=t;t=i,i=n}if(t.prev===i){const n=t;t=i,i=n}for(let n=0,o=i.rings.length;n<o;n++){const l=i.rings[n],u=i.windings[n],f=t.rings.indexOf(l);f===-1?(t.rings.push(l),t.windings.push(u)):t.windings[f]+=u}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,s=this._afterState.multiPolys;for(let l=0,u=this.rings.length;l<u;l++){const f=this.rings[l],x=this.windings[l],w=t.indexOf(f);w===-1?(t.push(f),i.push(x)):i[w]+=x}const n=[],o=[];for(let l=0,u=t.length;l<u;l++){if(i[l]===0)continue;const f=t[l],x=f.poly;if(o.indexOf(x)===-1)if(f.isExterior)n.push(x);else{o.indexOf(x)===-1&&o.push(x);const w=n.indexOf(f.poly);w!==-1&&n.splice(w,1)}}for(let l=0,u=n.length;l<u;l++){const f=n[l].multiPoly;s.indexOf(f)===-1&&s.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(Tt.type){case"union":{const i=e.length===0,s=t.length===0;this._isInResult=i!==s;break}case"intersection":{let i,s;e.length<t.length?(i=e.length,s=t.length):(i=t.length,s=e.length),this._isInResult=s===Tt.numMultiPolys&&i<s;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=s=>s.length===1&&s[0].isSubject;this._isInResult=i(e)!==i(t);break}}return this._isInResult}},fr=class{poly;isExterior;segments;bbox;constructor(r,e,t){if(!Array.isArray(r)||r.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof r[0][0]!="number"||typeof r[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=Se.snap({x:new ye(r[0][0]),y:new ye(r[0][1])});this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let n=1,o=r.length;n<o;n++){if(typeof r[n][0]!="number"||typeof r[n][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=Se.snap({x:new ye(r[n][0]),y:new ye(r[n][1])});l.x.eq(s.x)&&l.y.eq(s.y)||(this.segments.push(At.fromRing(s,l,this)),l.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=l.x),l.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=l.y),l.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=l.x),l.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=l.y),s=l)}(!i.x.eq(s.x)||!i.y.eq(s.y))&&this.segments.push(At.fromRing(s,i,this))}getSweepEvents(){const r=[];for(let e=0,t=this.segments.length;e<t;e++){const i=this.segments[e];r.push(i.leftSE),r.push(i.rightSE)}return r}},rn=class{multiPoly;exteriorRing;interiorRings;bbox;constructor(r,e){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new fr(r[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let t=1,i=r.length;t<i;t++){const s=new fr(r[t],this,!1);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const r=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const i=this.interiorRings[e].getSweepEvents();for(let s=0,n=i.length;s<n;s++)r.push(i[s])}return r}},pr=class{isSubject;polys;bbox;constructor(r,e){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof r[0][0][0]=="number"&&(r=[r])}catch{}this.polys=[],this.bbox={ll:{x:new ye(Number.POSITIVE_INFINITY),y:new ye(Number.POSITIVE_INFINITY)},ur:{x:new ye(Number.NEGATIVE_INFINITY),y:new ye(Number.NEGATIVE_INFINITY)}};for(let t=0,i=r.length;t<i;t++){const s=new rn(r[t],this);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const r=[];for(let e=0,t=this.polys.length;e<t;e++){const i=this.polys[e].getSweepEvents();for(let s=0,n=i.length;s<n;s++)r.push(i[s])}return r}},sn=(r,...e)=>Tt.run("union",r,e),nn=(r,...e)=>Tt.run("difference",r,e);Se.set;function on(r){const e=[];if(ii(r,s=>{e.push(s.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=r.features[0].properties||{},i=nn(e[0],...e.slice(1));return i.length===0?null:i.length===1?ei(i[0],t):ir(i,t)}var ln=on;function an(r){if(!r)throw new Error("geojson is required");var e=[];return Fs(r,function(t){e.push(t)}),ti(e)}var cn=an;function hn(r,e={}){const t=[];if(ii(r,s=>{t.push(s.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=sn(t[0],...t.slice(1));return i.length===0?null:i.length===1?ei(i[0],e.properties):ir(i,e.properties)}var un=hn;function dn(r){const e=ln(ti([ei([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),r]));if(!e)return;e.properties={isMask:!0};const t=pt(sr(r)),i=(t[2]-t[0])/360/1e3,s=t[0]<-180,n=t[2]>180,o=cn(r);if(o.features.length>1&&(s||n))for(const l of o.features){const u=pt(sr(l));if(n&&u[0]<-180+i)for(const f of l.geometry.coordinates)for(const x of f)x[0]+=360-i;if(s&&u[2]>180-i)for(const f of l.geometry.coordinates)for(const x of f)x[0]-=360-i}return ti([o.features.length<2?r:un(o)??r,e])}const mr={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13},gr=r=>e=>{const t=r.iconsBaseUrl??"https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.6/icons/",i=e.getProperties(),s=e.getGeometry()?.getType(),n=i.isMask?0:s==="LineString"||s==="MultiLineString"?3:2;return new Lr({stroke:i.isMask?void 0:new fi({color:"#3170fe",lineDash:[n,n],width:n,lineCap:"butt"}),fill:i.isMask?new di({color:"#00000020"}):void 0,image:new Sr({src:`${t}marker_${i.isReverse?"reverse":i.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:i.isSelected?2:i.isReverse?0:1,text:(i.isSelected||i.isMouseOver)&&i.tooltip?new _r({backgroundFill:new di({color:"white"}),text:i.tooltip,offsetY:-40,backgroundStroke:new fi({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})},Re="EPSG:4326";class yr extends br.Control{#e;#t;#s;constructor(e={}){const t=document.createElement("div");super({element:t,...e}),this.#e=e,this.#s=document.createElement("maptiler-geocoder"),this.#s.classList.add("openlayers-geocoder"),this.#E(),t.classList.add("openlayers-ctrl-geocoder"),t.style.zIndex="3",t.appendChild(this.#s)}setMap(e){super.setMap(e),this.#t&&this.#t!==e&&(this.#$(),this.#I(),this.#t=void 0),e&&(this.#t=e,this.#_(),this.#k())}getOptions(){return{...this.#e}}setOptions(e){Object.assign(this.#e,e),this.#E()}setQuery(e){this.#s.setQuery(e)}submitQuery(e){this.#s.submitQuery(e)}clearMap(){this.#o=[],this.#f(void 0,void 0)}clearList(){this.#s.clearList()}setReverseMode(e){this.setOptions({reverseActive:e})}focus(e){this.#s.focus(e)}blur(){this.#s.blur()}#c=new Map;#h;#n;#o;#g;#a;#r;#u;#y=!1;#v={reversetoggle:e=>{this.#y=e.detail.reverse,this.#i("reversetoggle",e.detail)},querychange:e=>{const t=e.detail.reverseCoords;this.#S(t?[t.decimalLongitude,t.decimalLatitude]:void 0),this.#i("querychange",e.detail)},queryclear:()=>{this.#S(void 0),this.#i("queryclear")},request:e=>{this.#i("request",e.detail)},response:e=>{this.#i("response",e.detail)},select:e=>{const t=e.detail.feature;t&&this.#m&&this.#e.flyToSelected&&this.#w(t.center,this.#d(t)),this.#o&&t&&this.#O(t),this.#i("select",e.detail)},pick:e=>{const t=e.detail.feature;t&&t.id!==this.#g&&this.#m&&(this.#M(t),this.#f(this.#o,t)),this.#g=t?.id,this.#i("pick",e.detail)},featuresshow:()=>{this.#i("featuresshow")},featureshide:()=>{this.#i("featureshide")},featureslisted:e=>{const t=e.detail.features;this.#o=t,this.#f(this.#o,void 0),this.#T(e),this.#i("featureslisted",e.detail)},featuresclear:()=>{this.#o=void 0,this.#f(void 0,void 0),this.#i("featuresclear")},focusin:()=>{this.#i("focusin")},focusout:()=>{this.#i("focusout")}};#b={postrender:()=>{const e=this.#t?.getView().getZoom(),t=this.#t?.getView().getCenter();this.#s.handleMapChange(e&&t?[e,...this.#L(t)]:void 0)},click:e=>{this.#s.handleMapClick(this.#L(e.coordinate)),this.#t?.forEachFeatureAtPixel(e.pixel,t=>{const i=t.getId(),s=this.#o?.find(n=>n.id===i);if(!(!i||!s))return e.stopPropagation(),this.#i("markerclick",{feature:s,marker:t}),!0})},pointermove:e=>{if(!this.#t)return;const t=this.#t.forEachFeatureAtPixel(e.pixel,s=>s.getId()?s:void 0);this.#t.getTargetElement().style.cursor=t?"pointer":this.#y?"crosshair":"";const i=t?.getId();if(this.#u!==i){if(this.#u){const s=this.#o?.find(o=>o.id===this.#u),n=this.#c.get(s);n?.set("isMouseOver",!1),s&&n&&this.#i("markermouseleave",{feature:s,marker:n})}if(t){const s=this.#o?.find(n=>n.id===i);this.#i("markermouseenter",{feature:s,marker:t}),t.set("isMouseOver",!0)}this.#u=i}}};#E(){this.#s.setOptions(this.#e),this.#s.fetchFullGeometryOnPick=this.#e.pickedResultStyle!=="marker-only"}#_(){if(this.#t){for(const[e,t]of Object.entries(this.#v))this.#s.addEventListener(e,t);for(const[e,t]of Object.entries(this.#b))this.#t.on([e],t)}}#$(){if(this.#t){for(const[e,t]of Object.entries(this.#v))this.#s.removeEventListener(e,t);for(const[e,t]of Object.entries(this.#b))this.#t.un([e],t)}}#i(e,t){this.dispatchEvent(Object.assign(new Er(e),t))}#M(e){e.bbox[0]===e.bbox[2]&&e.bbox[1]===e.bbox[3]?this.#w(e.center,this.#d(e)):this.#x(pt(e.bbox),50,this.#d(e))}#T({detail:{features:e,external:t}}){if(!e||e.length===0||!this.#m||this.#e.flyToFeatures===!1||this.#e.flyToFeatures==="never"||!t&&(this.#e.flyToFeatures===void 0||this.#e.flyToFeatures==="external"))return;const i=e.every(o=>o.matching_text),s=e.reduce((o,l)=>i||!l.matching_text?[Math.min(o[0],l.bbox[0]),Math.min(o[1],l.bbox[1]),Math.max(o[2],l.bbox[2]),Math.max(o[3],l.bbox[3])]:o,[180,90,-180,-90]),n=e.map(o=>this.#d(o)).filter(o=>o!==void 0).reduce((o,l)=>o===void 0?l:Math.max(o,l),void 0);this.#x(pt(s),50,n)}#d(e){if(e.bbox[0]!==e.bbox[2]||e.bbox[1]!==e.bbox[3])return;const t=e.id.replace(/\..*/,""),i=this.#e.zoom??mr;return(Array.isArray(e.properties?.categories)?e.properties.categories.reduce((s,n)=>{const o=i[t+"."+n];return s===void 0?o:o===void 0?s:Math.max(s,o)},void 0):void 0)??i[t]}get#m(){return!!this.#e.flyTo||this.#e.flyTo===void 0}get#A(){return typeof this.#e.flyTo=="boolean"?{}:this.#e.flyTo}get#C(){return typeof this.#e.flyTo=="boolean"?{}:this.#e.flyTo}#w(e,t){this.#t?.getView().animate({center:this.#p(e),...t?{zoom:t}:{},duration:2e3,...this.#A})}#x(e,t,i){this.#t?.getView().fit(ot.transformExtent(e,Re,this.#l()),{padding:[t,t,t,t],...i?{maxZoom:i}:{},duration:2e3,...this.#C})}#S(e){if(this.#e.marker===!1||!this.#t||!this.#r)return;if(!e){this.#n&&(this.#r.removeFeature(this.#n),this.#n.dispose(),this.#n=void 0);return}const t=this.#p(e);if(!this.#n){this.#n=new ne.Feature(new le.Point(t)),this.#n.set("isReverse",!0),this.#r.addFeature(this.#n);return}this.#n.getGeometry().setCoordinates(t)}#f(e,t){if(!this.#t||!this.#r)return;this.#r.removeFeatures([...this.#c.undefined()]),this.#c=new Map;const i=()=>{if(!t||!this.#t||this.#e.marker===!1)return;const s=new ne.Feature(new le.Point(this.#p(t.center)));s.setId(t.id),this.#c.set(t,s),this.#r?.addFeature(s)};if(t?.geometry.type==="GeometryCollection"){const s=t.geometry.geometries.map(n=>n.type==="Polygon"?new le.Polygon(n.coordinates):n.type==="MultiPolygon"?new le.MultiPolygon(n.coordinates):null).filter(n=>!!n);if(s.length>0)this.#r.addFeature(new ne.Feature(new le.GeometryCollection(s).transform(Re,this.#l())));else for(const n of t.geometry.geometries)n.type==="LineString"?this.#r.addFeature(new ne.Feature(new le.LineString(n.coordinates).transform(Re,this.#l()))):n.type==="MultiLineString"&&this.#r.addFeature(new ne.Feature(new le.MultiLineString(n.coordinates).transform(Re,this.#l())))}else if(t?.geometry.type.endsWith("Polygon")){const s=dn(t);if(s)for(const n of s.features){const o=n.geometry.type==="Polygon"?new le.Polygon(n.geometry.coordinates):new le.MultiPolygon(n.geometry.coordinates);this.#r.addFeature(new ne.Feature({isMask:!!n.properties?.isMask,geometry:o.transform(Re,this.#l())}))}this.#e.pickedResultStyle==="full-geometry-including-polygon-center-marker"&&i()}else t?.geometry.type==="LineString"?this.#r.addFeature(new ne.Feature(new le.LineString(t.geometry.coordinates).transform(Re,this.#l()))):t?.geometry.type==="MultiLineString"?this.#r.addFeature(new ne.Feature(new le.MultiLineString(t.geometry.coordinates).transform(Re,this.#l()))):t?.geometry.type.endsWith("Point")&&i();if(this.#e.showResultMarkers!==!1)for(const s of e??[]){if(s.id===t?.id||s.place_type.includes("reverse"))continue;const n=new ne.Feature(new le.Point(this.#p(s.center)));n.setId(s.id),n.setProperties({fuzzy:!!s.matching_text,tooltip:s.place_type[0]==="reverse"?s.place_name:s.place_name.replace(/,.*/,"")}),this.#r.addFeature(n),this.#c.set(s,n)}}#O(e){this.#h?.set("isSelected",!1),this.#h=void 0,this.#e.markerOnSelected!==!1&&(this.#h=this.#c.get(e),this.#h?.setProperties({isSelected:!0}))}#k(){this.#t&&(this.#r=new xr({}),this.#a=new wr({updateWhileAnimating:!0}),this.#a.setSource(this.#r),this.#a.setStyle(this.#N()),this.#t.addLayer(this.#a))}#I(){!this.#t||!this.#a||(this.#t.removeLayer(this.#a),this.#a=void 0)}#l(){return ot.getUserProjection()??this.#t?.getView().getProjection()}#p(e){return ot.fromLonLat(e,this.#l())}#L(e){return ot.toLonLat(e,this.#l())}#N(){const{fullGeometryStyle:e}=this.#e;if(e===!0||e===void 0)return gr(this.#e);if(!(e===!1||e===null))return e}}_.DEFAULT_GEOMETRY_STYLE=gr,_.GeocodingControl=yr,_.OpenLayersGeocodingControl=yr,_.ZOOM_DEFAULTS=mr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
279
+ ${at(Ns)}
280
+ `,_.MaptilerGeocodeMarkerElement=Gs([Me("maptiler-geocode-marker")],_.MaptilerGeocodeMarkerElement);function Et(r,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}function Jt(r,e,t={}){for(const s of r){if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(s[s.length-1].length!==s[0].length)throw new Error("First and last Position are not equivalent.");for(let n=0;n<s[s.length-1].length;n++)if(s[s.length-1][n]!==s[0][n])throw new Error("First and last Position are not equivalent.")}return Et({type:"Polygon",coordinates:r},e,t)}function ei(r,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}function ir(r,e,t={}){return Et({type:"MultiPolygon",coordinates:r},e,t)}function rr(r,e,t){if(r!==null)for(var i,s,n,o,l,u,f,x=0,w=0,$,M=r.type,T=M==="FeatureCollection",R=M==="Feature",F=T?r.features.length:1,G=0;G<F;G++){f=T?r.features[G].geometry:R?r.geometry:r,$=f?f.type==="GeometryCollection":!1,l=$?f.geometries.length:1;for(var L=0;L<l;L++){var Q=0,ne=0;if(o=$?f.geometries[L]:f,o!==null){u=o.coordinates;var be=o.type;switch(x=0,be){case null:break;case"Point":if(e(u,w,G,Q,ne)===!1)return!1;w++,Q++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(e(u[i],w,G,Q,ne)===!1)return!1;w++,be==="MultiPoint"&&Q++}be==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(s=0;s<u[i].length-x;s++){if(e(u[i][s],w,G,Q,ne)===!1)return!1;w++}be==="MultiLineString"&&Q++,be==="Polygon"&&ne++}be==="Polygon"&&Q++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for(ne=0,s=0;s<u[i].length;s++){for(n=0;n<u[i][s].length-x;n++){if(e(u[i][s][n],w,G,Q,ne)===!1)return!1;w++}ne++}Q++}break;case"GeometryCollection":for(i=0;i<o.geometries.length;i++)if(rr(o.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ti(r,e){var t,i,s,n,o,l,u,f,x,w,$=0,M=r.type==="FeatureCollection",T=r.type==="Feature",R=M?r.features.length:1;for(t=0;t<R;t++){for(l=M?r.features[t].geometry:T?r.geometry:r,f=M?r.features[t].properties:T?r.properties:{},x=M?r.features[t].bbox:T?r.bbox:void 0,w=M?r.features[t].id:T?r.id:void 0,u=l?l.type==="GeometryCollection":!1,o=u?l.geometries.length:1,s=0;s<o;s++){if(n=u?l.geometries[s]:l,n===null){if(e(null,$,f,x,w)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(n,$,f,x,w)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(e(n.geometries[i],$,f,x,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}$++}}function Fs(r,e){ti(r,function(t,i,s,n,o){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return e(Et(t,s,{bbox:n,id:o}),i,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var f=0;f<t.coordinates.length;f++){var x=t.coordinates[f],w={type:u,coordinates:x};if(e(Et(w,s),i,f)===!1)return!1}})}function Us(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;const t=[1/0,1/0,-1/0,-1/0];return rr(r,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var sr=Us,Bs=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ii=Math.ceil,he=Math.floor,re="[BigNumber Error] ",nr=re+"Number primitive has more than 15 significant digits: ",me=1e14,N=14,ri=9007199254740991,si=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ae=1e7,X=1e9;function or(r){var e,t,i,s=L.prototype={constructor:L,toString:null,valueOf:null},n=new L(1),o=20,l=4,u=-7,f=21,x=-1e7,w=1e7,$=!1,M=1,T=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function L(a,c){var h,v,p,g,E,d,m,b,y=this;if(!(y instanceof L))return new L(a,c);if(c==null){if(a&&a._isBigNumber===!0){y.s=a.s,!a.c||a.e>w?y.c=y.e=null:a.e<x?y.c=[y.e=0]:(y.e=a.e,y.c=a.c.slice());return}if((d=typeof a=="number")&&a*0==0){if(y.s=1/a<0?(a=-a,-1):1,a===~~a){for(g=0,E=a;E>=10;E/=10,g++);g>w?y.c=y.e=null:(y.e=g,y.c=[a]);return}b=String(a)}else{if(!Bs.test(b=String(a)))return i(y,b,d);y.s=b.charCodeAt(0)==45?(b=b.slice(1),-1):1}(g=b.indexOf("."))>-1&&(b=b.replace(".","")),(E=b.search(/e/i))>0?(g<0&&(g=E),g+=+b.slice(E+1),b=b.substring(0,E)):g<0&&(g=b.length)}else{if(q(c,2,F.length,"Base"),c==10&&G)return y=new L(a),fe(y,o+y.e+1,l);if(b=String(a),d=typeof a=="number"){if(a*0!=0)return i(y,b,d,c);if(y.s=1/a<0?(b=b.slice(1),-1):1,L.DEBUG&&b.replace(/^0\.0*|\./,"").length>15)throw Error(nr+a)}else y.s=b.charCodeAt(0)===45?(b=b.slice(1),-1):1;for(h=F.slice(0,c),g=E=0,m=b.length;E<m;E++)if(h.indexOf(v=b.charAt(E))<0){if(v=="."){if(E>g){g=m;continue}}else if(!p&&(b==b.toUpperCase()&&(b=b.toLowerCase())||b==b.toLowerCase()&&(b=b.toUpperCase()))){p=!0,E=-1,g=0;continue}return i(y,String(a),d,c)}d=!1,b=t(b,c,10,y.s),(g=b.indexOf("."))>-1?b=b.replace(".",""):g=b.length}for(E=0;b.charCodeAt(E)===48;E++);for(m=b.length;b.charCodeAt(--m)===48;);if(b=b.slice(E,++m)){if(m-=E,d&&L.DEBUG&&m>15&&(a>ri||a!==he(a)))throw Error(nr+y.s*a);if((g=g-E-1)>w)y.c=y.e=null;else if(g<x)y.c=[y.e=0];else{if(y.e=g,y.c=[],E=(g+1)%N,g<0&&(E+=N),E<m){for(E&&y.c.push(+b.slice(0,E)),m-=N;E<m;)y.c.push(+b.slice(E,E+=N));E=N-(b=b.slice(E)).length}else E-=m;for(;E--;b+="0");y.c.push(+b)}}else y.c=[y.e=0]}L.clone=or,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(a){var c,h;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(c="DECIMAL_PLACES")&&(h=a[c],q(h,0,X,c),o=h),a.hasOwnProperty(c="ROUNDING_MODE")&&(h=a[c],q(h,0,8,c),l=h),a.hasOwnProperty(c="EXPONENTIAL_AT")&&(h=a[c],h&&h.pop?(q(h[0],-X,0,c),q(h[1],0,X,c),u=h[0],f=h[1]):(q(h,-X,X,c),u=-(f=h<0?-h:h))),a.hasOwnProperty(c="RANGE"))if(h=a[c],h&&h.pop)q(h[0],-X,-1,c),q(h[1],1,X,c),x=h[0],w=h[1];else if(q(h,-X,X,c),h)x=-(w=h<0?-h:h);else throw Error(re+c+" cannot be zero: "+h);if(a.hasOwnProperty(c="CRYPTO"))if(h=a[c],h===!!h)if(h)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))$=h;else throw $=!h,Error(re+"crypto unavailable");else $=h;else throw Error(re+c+" not true or false: "+h);if(a.hasOwnProperty(c="MODULO_MODE")&&(h=a[c],q(h,0,9,c),M=h),a.hasOwnProperty(c="POW_PRECISION")&&(h=a[c],q(h,0,X,c),T=h),a.hasOwnProperty(c="FORMAT"))if(h=a[c],typeof h=="object")R=h;else throw Error(re+c+" not an object: "+h);if(a.hasOwnProperty(c="ALPHABET"))if(h=a[c],typeof h=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(h))G=h.slice(0,10)=="0123456789",F=h;else throw Error(re+c+" invalid: "+h)}else throw Error(re+"Object expected: "+a);return{DECIMAL_PLACES:o,ROUNDING_MODE:l,EXPONENTIAL_AT:[u,f],RANGE:[x,w],CRYPTO:$,MODULO_MODE:M,POW_PRECISION:T,FORMAT:R,ALPHABET:F}},L.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!L.DEBUG)return!0;var c,h,v=a.c,p=a.e,g=a.s;e:if({}.toString.call(v)=="[object Array]"){if((g===1||g===-1)&&p>=-X&&p<=X&&p===he(p)){if(v[0]===0){if(p===0&&v.length===1)return!0;break e}if(c=(p+1)%N,c<1&&(c+=N),String(v[0]).length==c){for(c=0;c<v.length;c++)if(h=v[c],h<0||h>=me||h!==he(h))break e;if(h!==0)return!0}}}else if(v===null&&p===null&&(g===null||g===1||g===-1))return!0;throw Error(re+"Invalid BigNumber: "+a)},L.maximum=L.max=function(){return ne(arguments,-1)},L.minimum=L.min=function(){return ne(arguments,1)},L.random=(function(){var a=9007199254740992,c=Math.random()*a&2097151?function(){return he(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(h){var v,p,g,E,d,m=0,b=[],y=new L(n);if(h==null?h=o:q(h,0,X),E=ii(h/N),$)if(crypto.getRandomValues){for(v=crypto.getRandomValues(new Uint32Array(E*=2));m<E;)d=v[m]*131072+(v[m+1]>>>11),d>=9e15?(p=crypto.getRandomValues(new Uint32Array(2)),v[m]=p[0],v[m+1]=p[1]):(b.push(d%1e14),m+=2);m=E/2}else if(crypto.randomBytes){for(v=crypto.randomBytes(E*=7);m<E;)d=(v[m]&31)*281474976710656+v[m+1]*1099511627776+v[m+2]*4294967296+v[m+3]*16777216+(v[m+4]<<16)+(v[m+5]<<8)+v[m+6],d>=9e15?crypto.randomBytes(7).copy(v,m):(b.push(d%1e14),m+=7);m=E/7}else throw $=!1,Error(re+"crypto unavailable");if(!$)for(;m<E;)d=c(),d<9e15&&(b[m++]=d%1e14);for(E=b[--m],h%=N,E&&h&&(d=si[N-h],b[m]=he(E/d)*d);b[m]===0;b.pop(),m--);if(m<0)b=[g=0];else{for(g=-1;b[0]===0;b.splice(0,1),g-=N);for(m=1,d=b[0];d>=10;d/=10,m++);m<N&&(g-=N-m)}return y.e=g,y.c=b,y}})(),L.sum=function(){for(var a=1,c=arguments,h=new L(c[0]);a<c.length;)h=h.plus(c[a++]);return h},t=(function(){var a="0123456789";function c(h,v,p,g){for(var E,d=[0],m,b=0,y=h.length;b<y;){for(m=d.length;m--;d[m]*=v);for(d[0]+=g.indexOf(h.charAt(b++)),E=0;E<d.length;E++)d[E]>p-1&&(d[E+1]==null&&(d[E+1]=0),d[E+1]+=d[E]/p|0,d[E]%=p)}return d.reverse()}return function(h,v,p,g,E){var d,m,b,y,S,A,O,W,H=h.indexOf("."),K=o,U=l;for(H>=0&&(y=T,T=0,h=h.replace(".",""),W=new L(v),A=W.pow(h.length-H),T=y,W.c=c(xe(de(A.c),A.e,"0"),10,p,a),W.e=W.c.length),O=c(h,v,p,E?(d=F,a):(d=a,F)),b=y=O.length;O[--y]==0;O.pop());if(!O[0])return d.charAt(0);if(H<0?--b:(A.c=O,A.e=b,A.s=g,A=e(A,W,K,U,p),O=A.c,S=A.r,b=A.e),m=b+K+1,H=O[m],y=p/2,S=S||m<0||O[m+1]!=null,S=U<4?(H!=null||S)&&(U==0||U==(A.s<0?3:2)):H>y||H==y&&(U==4||S||U==6&&O[m-1]&1||U==(A.s<0?8:7)),m<1||!O[0])h=S?xe(d.charAt(1),-K,d.charAt(0)):d.charAt(0);else{if(O.length=m,S)for(--p;++O[--m]>p;)O[m]=0,m||(++b,O=[1].concat(O));for(y=O.length;!O[--y];);for(H=0,h="";H<=y;h+=d.charAt(O[H++]));h=xe(h,b,d.charAt(0))}return h}})(),e=(function(){function a(v,p,g){var E,d,m,b,y=0,S=v.length,A=p%Ae,O=p/Ae|0;for(v=v.slice();S--;)m=v[S]%Ae,b=v[S]/Ae|0,E=O*m+b*A,d=A*m+E%Ae*Ae+y,y=(d/g|0)+(E/Ae|0)+O*b,v[S]=d%g;return y&&(v=[y].concat(v)),v}function c(v,p,g,E){var d,m;if(g!=E)m=g>E?1:-1;else for(d=m=0;d<g;d++)if(v[d]!=p[d]){m=v[d]>p[d]?1:-1;break}return m}function h(v,p,g,E){for(var d=0;g--;)v[g]-=d,d=v[g]<p[g]?1:0,v[g]=d*E+v[g]-p[g];for(;!v[0]&&v.length>1;v.splice(0,1));}return function(v,p,g,E,d){var m,b,y,S,A,O,W,H,K,U,D,J,Tt,ai,ci,Ee,st,pe=v.s==p.s?1:-1,ie=v.c,j=p.c;if(!ie||!ie[0]||!j||!j[0])return new L(!v.s||!p.s||(ie?j&&ie[0]==j[0]:!j)?NaN:ie&&ie[0]==0||!j?pe*0:pe/0);for(H=new L(pe),K=H.c=[],b=v.e-p.e,pe=g+b+1,d||(d=me,b=ue(v.e/N)-ue(p.e/N),pe=pe/N|0),y=0;j[y]==(ie[y]||0);y++);if(j[y]>(ie[y]||0)&&b--,pe<0)K.push(1),S=!0;else{for(ai=ie.length,Ee=j.length,y=0,pe+=2,A=he(d/(j[0]+1)),A>1&&(j=a(j,A,d),ie=a(ie,A,d),Ee=j.length,ai=ie.length),Tt=Ee,U=ie.slice(0,Ee),D=U.length;D<Ee;U[D++]=0);st=j.slice(),st=[0].concat(st),ci=j[0],j[1]>=d/2&&ci++;do{if(A=0,m=c(j,U,Ee,D),m<0){if(J=U[0],Ee!=D&&(J=J*d+(U[1]||0)),A=he(J/ci),A>1)for(A>=d&&(A=d-1),O=a(j,A,d),W=O.length,D=U.length;c(O,U,W,D)==1;)A--,h(O,Ee<W?st:j,W,d),W=O.length,m=1;else A==0&&(m=A=1),O=j.slice(),W=O.length;if(W<D&&(O=[0].concat(O)),h(U,O,D,d),D=U.length,m==-1)for(;c(j,U,Ee,D)<1;)A++,h(U,Ee<D?st:j,D,d),D=U.length}else m===0&&(A++,U=[0]);K[y++]=A,U[0]?U[D++]=ie[Tt]||0:(U=[ie[Tt]],D=1)}while((Tt++<ai||U[0]!=null)&&pe--);S=U[0]!=null,K[0]||K.splice(0,1)}if(d==me){for(y=1,pe=K[0];pe>=10;pe/=10,y++);fe(H,g+(H.e=y+b*N-1)+1,E,S)}else H.e=b,H.r=+S;return H}})();function Q(a,c,h,v){var p,g,E,d,m;if(h==null?h=l:q(h,0,8),!a.c)return a.toString();if(p=a.c[0],E=a.e,c==null)m=de(a.c),m=v==1||v==2&&(E<=u||E>=f)?xt(m,E):xe(m,E,"0");else if(a=fe(new L(a),c,h),g=a.e,m=de(a.c),d=m.length,v==1||v==2&&(c<=g||g<=u)){for(;d<c;m+="0",d++);m=xt(m,g)}else if(c-=E+(v===2&&g>E),m=xe(m,g,"0"),g+1>d){if(--c>0)for(m+=".";c--;m+="0");}else if(c+=g-d,c>0)for(g+1==d&&(m+=".");c--;m+="0");return a.s<0&&p?"-"+m:m}function ne(a,c){for(var h,v,p=1,g=new L(a[0]);p<a.length;p++)v=new L(a[p]),(!v.s||(h=Ne(g,v))===c||h===0&&g.s===c)&&(g=v);return g}function be(a,c,h){for(var v=1,p=c.length;!c[--p];c.pop());for(p=c[0];p>=10;p/=10,v++);return(h=v+h*N-1)>w?a.c=a.e=null:h<x?a.c=[a.e=0]:(a.e=h,a.c=c),a}i=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,h=/^\.([^.]+)$/,v=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(g,E,d,m){var b,y=d?E:E.replace(p,"");if(v.test(y))g.s=isNaN(y)?null:y<0?-1:1;else{if(!d&&(y=y.replace(a,function(S,A,O){return b=(O=O.toLowerCase())=="x"?16:O=="b"?2:8,!m||m==b?A:S}),m&&(b=m,y=y.replace(c,"$1").replace(h,"0.$1")),E!=y))return new L(y,b);if(L.DEBUG)throw Error(re+"Not a"+(m?" base "+m:"")+" number: "+E);g.s=null}g.c=g.e=null}})();function fe(a,c,h,v){var p,g,E,d,m,b,y,S=a.c,A=si;if(S){e:{for(p=1,d=S[0];d>=10;d/=10,p++);if(g=c-p,g<0)g+=N,E=c,m=S[b=0],y=he(m/A[p-E-1]%10);else if(b=ii((g+1)/N),b>=S.length)if(v){for(;S.length<=b;S.push(0));m=y=0,p=1,g%=N,E=g-N+1}else break e;else{for(m=d=S[b],p=1;d>=10;d/=10,p++);g%=N,E=g-N+p,y=E<0?0:he(m/A[p-E-1]%10)}if(v=v||c<0||S[b+1]!=null||(E<0?m:m%A[p-E-1]),v=h<4?(y||v)&&(h==0||h==(a.s<0?3:2)):y>5||y==5&&(h==4||v||h==6&&(g>0?E>0?m/A[p-E]:0:S[b-1])%10&1||h==(a.s<0?8:7)),c<1||!S[0])return S.length=0,v?(c-=a.e+1,S[0]=A[(N-c%N)%N],a.e=-c||0):S[0]=a.e=0,a;if(g==0?(S.length=b,d=1,b--):(S.length=b+1,d=A[N-g],S[b]=E>0?he(m/A[p-E]%A[E])*d:0),v)for(;;)if(b==0){for(g=1,E=S[0];E>=10;E/=10,g++);for(E=S[0]+=d,d=1;E>=10;E/=10,d++);g!=d&&(a.e++,S[0]==me&&(S[0]=1));break}else{if(S[b]+=d,S[b]!=me)break;S[b--]=0,d=1}for(g=S.length;S[--g]===0;S.pop());}a.e>w?a.c=a.e=null:a.e<x&&(a.c=[a.e=0])}return a}function Le(a){var c,h=a.e;return h===null?a.toString():(c=de(a.c),c=h<=u||h>=f?xt(c,h):xe(c,h,"0"),a.s<0?"-"+c:c)}return s.absoluteValue=s.abs=function(){var a=new L(this);return a.s<0&&(a.s=1),a},s.comparedTo=function(a,c){return Ne(this,new L(a,c))},s.decimalPlaces=s.dp=function(a,c){var h,v,p,g=this;if(a!=null)return q(a,0,X),c==null?c=l:q(c,0,8),fe(new L(g),a+g.e+1,c);if(!(h=g.c))return null;if(v=((p=h.length-1)-ue(this.e/N))*N,p=h[p])for(;p%10==0;p/=10,v--);return v<0&&(v=0),v},s.dividedBy=s.div=function(a,c){return e(this,new L(a,c),o,l)},s.dividedToIntegerBy=s.idiv=function(a,c){return e(this,new L(a,c),0,1)},s.exponentiatedBy=s.pow=function(a,c){var h,v,p,g,E,d,m,b,y,S=this;if(a=new L(a),a.c&&!a.isInteger())throw Error(re+"Exponent not an integer: "+Le(a));if(c!=null&&(c=new L(c)),d=a.e>14,!S.c||!S.c[0]||S.c[0]==1&&!S.e&&S.c.length==1||!a.c||!a.c[0])return y=new L(Math.pow(+Le(S),d?a.s*(2-wt(a)):+Le(a))),c?y.mod(c):y;if(m=a.s<0,c){if(c.c?!c.c[0]:!c.s)return new L(NaN);v=!m&&S.isInteger()&&c.isInteger(),v&&(S=S.mod(c))}else{if(a.e>9&&(S.e>0||S.e<-1||(S.e==0?S.c[0]>1||d&&S.c[1]>=24e7:S.c[0]<8e13||d&&S.c[0]<=9999975e7)))return g=S.s<0&&wt(a)?-0:0,S.e>-1&&(g=1/g),new L(m?1/g:g);T&&(g=ii(T/N+2))}for(d?(h=new L(.5),m&&(a.s=1),b=wt(a)):(p=Math.abs(+Le(a)),b=p%2),y=new L(n);;){if(b){if(y=y.times(S),!y.c)break;g?y.c.length>g&&(y.c.length=g):v&&(y=y.mod(c))}if(p){if(p=he(p/2),p===0)break;b=p%2}else if(a=a.times(h),fe(a,a.e+1,1),a.e>14)b=wt(a);else{if(p=+Le(a),p===0)break;b=p%2}S=S.times(S),g?S.c&&S.c.length>g&&(S.c.length=g):v&&(S=S.mod(c))}return v?y:(m&&(y=n.div(y)),c?y.mod(c):g?fe(y,T,l,E):y)},s.integerValue=function(a){var c=new L(this);return a==null?a=l:q(a,0,8),fe(c,c.e+1,a)},s.isEqualTo=s.eq=function(a,c){return Ne(this,new L(a,c))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(a,c){return Ne(this,new L(a,c))>0},s.isGreaterThanOrEqualTo=s.gte=function(a,c){return(c=Ne(this,new L(a,c)))===1||c===0},s.isInteger=function(){return!!this.c&&ue(this.e/N)>this.c.length-2},s.isLessThan=s.lt=function(a,c){return Ne(this,new L(a,c))<0},s.isLessThanOrEqualTo=s.lte=function(a,c){return(c=Ne(this,new L(a,c)))===-1||c===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(a,c){var h,v,p,g,E=this,d=E.s;if(a=new L(a,c),c=a.s,!d||!c)return new L(NaN);if(d!=c)return a.s=-c,E.plus(a);var m=E.e/N,b=a.e/N,y=E.c,S=a.c;if(!m||!b){if(!y||!S)return y?(a.s=-c,a):new L(S?E:NaN);if(!y[0]||!S[0])return S[0]?(a.s=-c,a):new L(y[0]?E:l==3?-0:0)}if(m=ue(m),b=ue(b),y=y.slice(),d=m-b){for((g=d<0)?(d=-d,p=y):(b=m,p=S),p.reverse(),c=d;c--;p.push(0));p.reverse()}else for(v=(g=(d=y.length)<(c=S.length))?d:c,d=c=0;c<v;c++)if(y[c]!=S[c]){g=y[c]<S[c];break}if(g&&(p=y,y=S,S=p,a.s=-a.s),c=(v=S.length)-(h=y.length),c>0)for(;c--;y[h++]=0);for(c=me-1;v>d;){if(y[--v]<S[v]){for(h=v;h&&!y[--h];y[h]=c);--y[h],y[v]+=me}y[v]-=S[v]}for(;y[0]==0;y.splice(0,1),--b);return y[0]?be(a,y,b):(a.s=l==3?-1:1,a.c=[a.e=0],a)},s.modulo=s.mod=function(a,c){var h,v,p=this;return a=new L(a,c),!p.c||!a.s||a.c&&!a.c[0]?new L(NaN):!a.c||p.c&&!p.c[0]?new L(p):(M==9?(v=a.s,a.s=1,h=e(p,a,0,3),a.s=v,h.s*=v):h=e(p,a,0,M),a=p.minus(h.times(a)),!a.c[0]&&M==1&&(a.s=p.s),a)},s.multipliedBy=s.times=function(a,c){var h,v,p,g,E,d,m,b,y,S,A,O,W,H,K,U=this,D=U.c,J=(a=new L(a,c)).c;if(!D||!J||!D[0]||!J[0])return!U.s||!a.s||D&&!D[0]&&!J||J&&!J[0]&&!D?a.c=a.e=a.s=null:(a.s*=U.s,!D||!J?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(v=ue(U.e/N)+ue(a.e/N),a.s*=U.s,m=D.length,S=J.length,m<S&&(W=D,D=J,J=W,p=m,m=S,S=p),p=m+S,W=[];p--;W.push(0));for(H=me,K=Ae,p=S;--p>=0;){for(h=0,A=J[p]%K,O=J[p]/K|0,E=m,g=p+E;g>p;)b=D[--E]%K,y=D[E]/K|0,d=O*b+y*A,b=A*b+d%K*K+W[g]+h,h=(b/H|0)+(d/K|0)+O*y,W[g--]=b%H;W[g]=h}return h?++v:W.splice(0,1),be(a,W,v)},s.negated=function(){var a=new L(this);return a.s=-a.s||null,a},s.plus=function(a,c){var h,v=this,p=v.s;if(a=new L(a,c),c=a.s,!p||!c)return new L(NaN);if(p!=c)return a.s=-c,v.minus(a);var g=v.e/N,E=a.e/N,d=v.c,m=a.c;if(!g||!E){if(!d||!m)return new L(p/0);if(!d[0]||!m[0])return m[0]?a:new L(d[0]?v:p*0)}if(g=ue(g),E=ue(E),d=d.slice(),p=g-E){for(p>0?(E=g,h=m):(p=-p,h=d),h.reverse();p--;h.push(0));h.reverse()}for(p=d.length,c=m.length,p-c<0&&(h=m,m=d,d=h,c=p),p=0;c;)p=(d[--c]=d[c]+m[c]+p)/me|0,d[c]=me===d[c]?0:d[c]%me;return p&&(d=[p].concat(d),++E),be(a,d,E)},s.precision=s.sd=function(a,c){var h,v,p,g=this;if(a!=null&&a!==!!a)return q(a,1,X),c==null?c=l:q(c,0,8),fe(new L(g),a,c);if(!(h=g.c))return null;if(p=h.length-1,v=p*N+1,p=h[p]){for(;p%10==0;p/=10,v--);for(p=h[0];p>=10;p/=10,v++);}return a&&g.e+1>v&&(v=g.e+1),v},s.shiftedBy=function(a){return q(a,-ri,ri),this.times("1e"+a)},s.squareRoot=s.sqrt=function(){var a,c,h,v,p,g=this,E=g.c,d=g.s,m=g.e,b=o+4,y=new L("0.5");if(d!==1||!E||!E[0])return new L(!d||d<0&&(!E||E[0])?NaN:E?g:1/0);if(d=Math.sqrt(+Le(g)),d==0||d==1/0?(c=de(E),(c.length+m)%2==0&&(c+="0"),d=Math.sqrt(+c),m=ue((m+1)/2)-(m<0||m%2),d==1/0?c="5e"+m:(c=d.toExponential(),c=c.slice(0,c.indexOf("e")+1)+m),h=new L(c)):h=new L(d+""),h.c[0]){for(m=h.e,d=m+b,d<3&&(d=0);;)if(p=h,h=y.times(p.plus(e(g,p,b,1))),de(p.c).slice(0,d)===(c=de(h.c)).slice(0,d))if(h.e<m&&--d,c=c.slice(d-3,d+1),c=="9999"||!v&&c=="4999"){if(!v&&(fe(p,p.e+o+2,0),p.times(p).eq(g))){h=p;break}b+=4,d+=4,v=1}else{(!+c||!+c.slice(1)&&c.charAt(0)=="5")&&(fe(h,h.e+o+2,1),a=!h.times(h).eq(g));break}}return fe(h,h.e+o+1,l,a)},s.toExponential=function(a,c){return a!=null&&(q(a,0,X),a++),Q(this,a,c,1)},s.toFixed=function(a,c){return a!=null&&(q(a,0,X),a=a+this.e+1),Q(this,a,c)},s.toFormat=function(a,c,h){var v,p=this;if(h==null)a!=null&&c&&typeof c=="object"?(h=c,c=null):a&&typeof a=="object"?(h=a,a=c=null):h=R;else if(typeof h!="object")throw Error(re+"Argument not an object: "+h);if(v=p.toFixed(a,c),p.c){var g,E=v.split("."),d=+h.groupSize,m=+h.secondaryGroupSize,b=h.groupSeparator||"",y=E[0],S=E[1],A=p.s<0,O=A?y.slice(1):y,W=O.length;if(m&&(g=d,d=m,m=g,W-=g),d>0&&W>0){for(g=W%d||d,y=O.substr(0,g);g<W;g+=d)y+=b+O.substr(g,d);m>0&&(y+=b+O.slice(g)),A&&(y="-"+y)}v=S?y+(h.decimalSeparator||"")+((m=+h.fractionGroupSize)?S.replace(new RegExp("\\d{"+m+"}\\B","g"),"$&"+(h.fractionGroupSeparator||"")):S):y}return(h.prefix||"")+v+(h.suffix||"")},s.toFraction=function(a){var c,h,v,p,g,E,d,m,b,y,S,A,O=this,W=O.c;if(a!=null&&(d=new L(a),!d.isInteger()&&(d.c||d.s!==1)||d.lt(n)))throw Error(re+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+Le(d));if(!W)return new L(O);for(c=new L(n),b=h=new L(n),v=m=new L(n),A=de(W),g=c.e=A.length-O.e-1,c.c[0]=si[(E=g%N)<0?N+E:E],a=!a||d.comparedTo(c)>0?g>0?c:b:d,E=w,w=1/0,d=new L(A),m.c[0]=0;y=e(d,c,0,1),p=h.plus(y.times(v)),p.comparedTo(a)!=1;)h=v,v=p,b=m.plus(y.times(p=b)),m=p,c=d.minus(y.times(p=c)),d=p;return p=e(a.minus(h),v,0,1),m=m.plus(p.times(b)),h=h.plus(p.times(v)),m.s=b.s=O.s,g=g*2,S=e(b,v,g,l).minus(O).abs().comparedTo(e(m,h,g,l).minus(O).abs())<1?[b,v]:[m,h],w=E,S},s.toNumber=function(){return+Le(this)},s.toPrecision=function(a,c){return a!=null&&q(a,1,X),Q(this,a,c,2)},s.toString=function(a){var c,h=this,v=h.s,p=h.e;return p===null?v?(c="Infinity",v<0&&(c="-"+c)):c="NaN":(a==null?c=p<=u||p>=f?xt(de(h.c),p):xe(de(h.c),p,"0"):a===10&&G?(h=fe(new L(h),o+p+1,l),c=xe(de(h.c),h.e,"0")):(q(a,2,F.length,"Base"),c=t(xe(de(h.c),p,"0"),10,a,v,!0)),v<0&&h.c[0]&&(c="-"+c)),c},s.valueOf=s.toJSON=function(){return Le(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,r!=null&&L.set(r),L}function ue(r){var e=r|0;return r>0||r===e?e:e-1}function de(r){for(var e,t,i=1,s=r.length,n=r[0]+"";i<s;){for(e=r[i++]+"",t=N-e.length;t--;e="0"+e);n+=e}for(s=n.length;n.charCodeAt(--s)===48;);return n.slice(0,s+1||1)}function Ne(r,e){var t,i,s=r.c,n=e.c,o=r.s,l=e.s,u=r.e,f=e.e;if(!o||!l)return null;if(t=s&&!s[0],i=n&&!n[0],t||i)return t?i?0:-l:o;if(o!=l)return o;if(t=o<0,i=u==f,!s||!n)return i?0:!s^t?1:-1;if(!i)return u>f^t?1:-1;for(l=(u=s.length)<(f=n.length)?u:f,o=0;o<l;o++)if(s[o]!=n[o])return s[o]>n[o]^t?1:-1;return u==f?0:u>f^t?1:-1}function q(r,e,t,i){if(r<e||r>t||r!==he(r))throw Error(re+(i||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function wt(r){var e=r.c.length-1;return ue(r.e/N)==e&&r.c[e]%2!=0}function xt(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function xe(r,e,t){var i,s;if(e<0){for(s=t+".";++e;s+=t);r=s+r}else if(i=r.length,++e>i){for(s=t,e-=i;--e;s+=t);r+=s}else e<i&&(r=r.slice(0,e)+"."+r.slice(e));return r}var ye=or(),Ws=class{key;left=null;right=null;constructor(r){this.key=r}},tt=class extends Ws{constructor(r){super(r)}},Ds=class{size=0;modificationCount=0;splayCount=0;splay(r){const e=this.root;if(e==null)return this.compare(r,r),-1;let t=null,i=null,s=null,n=null,o=e;const l=this.compare;let u;for(;;)if(u=l(o.key,r),u>0){let f=o.left;if(f==null||(u=l(f.key,r),u>0&&(o.left=f.right,f.right=o,o=f,f=o.left,f==null)))break;t==null?i=o:t.left=o,t=o,o=f}else if(u<0){let f=o.right;if(f==null||(u=l(f.key,r),u<0&&(o.right=f.left,f.left=o,o=f,f=o.right,f==null)))break;s==null?n=o:s.right=o,s=o,o=f}else break;return s!=null&&(s.right=o.left,o.left=n),t!=null&&(t.left=o.right,o.right=i),this.root!==o&&(this.root=o,this.splayCount++),u}splayMin(r){let e=r,t=e.left;for(;t!=null;){const i=t;e.left=i.right,i.right=e,e=i,t=e.left}return e}splayMax(r){let e=r,t=e.right;for(;t!=null;){const i=t;e.right=i.left,i.left=e,e=i,t=e.right}return e}_delete(r){if(this.root==null||this.splay(r)!=0)return null;let t=this.root;const i=t,s=t.left;if(this.size--,s==null)this.root=t.right;else{const n=t.right;t=this.splayMax(s),t.right=n,this.root=t}return this.modificationCount++,i}addNewRoot(r,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=r;return}e<0?(r.left=t,r.right=t.right,t.right=null):(r.right=t,r.left=t.left,t.left=null),this.root=r}_first(){const r=this.root;return r==null?null:(this.root=this.splayMin(r),this.root)}_last(){const r=this.root;return r==null?null:(this.root=this.splayMax(r),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(r){return this.validKey(r)&&this.splay(r)==0}defaultCompare(){return(r,e)=>r<e?-1:r>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:r=>{this.root=r},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:r=>{this.splayCount=r},splay:r=>this.splay(r),has:r=>this.has(r)}}},St=class nt extends Ds{root=null;compare;validKey;constructor(e,t){super(),this.compare=e??this.defaultCompare(),this.validKey=t??(i=>i!=null&&i!=null)}delete(e){return this.validKey(e)?this._delete(e)!=null:!1}deleteAll(e){for(const t of e)this.delete(t)}forEach(e){const t=this[Symbol.iterator]();let i;for(;i=t.next(),!i.done;)e(i.value,i.value,this)}add(e){const t=this.splay(e);return t!=0&&this.addNewRoot(new tt(e),t),this}addAndReturn(e){const t=this.splay(e);return t!=0&&this.addNewRoot(new tt(e),t),this.root.key}addAll(e){for(const t of e)this.add(t)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)<0)return this.root.key;let i=this.root.left;if(i==null)return null;let s=i.right;for(;s!=null;)i=s,s=i.right;return i.key}firstAfter(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)>0)return this.root.key;let i=this.root.right;if(i==null)return null;let s=i.left;for(;s!=null;)i=s,s=i.left;return i.key}retainAll(e){const t=new nt(this.compare,this.validKey),i=this.modificationCount;for(const s of e){if(i!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(s)&&this.splay(s)==0&&t.add(this.root.key)}t.size!=this.size&&(this.root=t.root,this.size=t.size,this.modificationCount++)}lookup(e){return!this.validKey(e)||this.splay(e)!=0?null:this.root.key}intersection(e){const t=new nt(this.compare,this.validKey);for(const i of this)e.has(i)&&t.add(i);return t}difference(e){const t=new nt(this.compare,this.validKey);for(const i of this)e.has(i)||t.add(i);return t}union(e){const t=this.clone();return t.addAll(e),t}clone(){const e=new nt(this.compare,this.validKey);return e.size=this.size,e.root=this.copyNode(this.root),e}copyNode(e){if(e==null)return null;function t(s,n){let o,l;do{if(o=s.left,l=s.right,o!=null){const u=new tt(o.key);n.left=u,t(o,u)}if(l!=null){const u=new tt(l.key);n.right=u,s=l,n=u}}while(l!=null)}const i=new tt(e.key);return t(e,i),i}toSet(){return this.clone()}entries(){return new qs(this.wrap())}keys(){return this[Symbol.iterator]()}undefined(){return this[Symbol.iterator]()}[Symbol.iterator](){return new zs(this.wrap())}[Symbol.toStringTag]="[object Set]"},lr=class{tree;path=new Array;modificationCount=null;splayCount;constructor(r){this.tree=r,this.splayCount=r.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const r=this.path[this.path.length-1];return this.getValue(r)}rebuildPath(r){this.path.splice(0,this.path.length),this.tree.splay(r),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(r){for(;r!=null;)this.path.push(r),r=r.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let r=this.path[this.path.length-1],e=r.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===r;)r=this.path.pop();return this.path.length>0}},zs=class extends lr{getValue(r){return r.key}},qs=class extends lr{getValue(r){return[r.key,r.key]}},ar=r=>()=>r,ni=r=>{const e=r?(t,i)=>i.minus(t).abs().isLessThanOrEqualTo(r):ar(!1);return(t,i)=>e(t,i)?0:t.comparedTo(i)};function Hs(r){const e=r?(t,i,s,n,o)=>t.exponentiatedBy(2).isLessThanOrEqualTo(n.minus(i).exponentiatedBy(2).plus(o.minus(s).exponentiatedBy(2)).times(r)):ar(!1);return(t,i,s)=>{const n=t.x,o=t.y,l=s.x,u=s.y,f=o.minus(u).times(i.x.minus(l)).minus(n.minus(l).times(i.y.minus(u)));return e(f,n,o,l,u)?0:f.comparedTo(0)}}var js=r=>r,Vs=r=>{if(r){const e=new St(ni(r)),t=new St(ni(r)),i=(n,o)=>o.addAndReturn(n),s=n=>({x:i(n.x,e),y:i(n.y,t)});return s({x:new ye(0),y:new ye(0)}),s}return js},oi=r=>({set:e=>{Se=oi(e)},reset:()=>oi(r),compare:ni(r),snap:Vs(r),orient:Hs(r)}),Se=oi(),it=(r,e)=>r.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(r.ur.x)&&r.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(r.ur.y),li=(r,e)=>{if(e.ur.x.isLessThan(r.ll.x)||r.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(r.ll.y)||r.ur.y.isLessThan(e.ll.y))return null;const t=r.ll.x.isLessThan(e.ll.x)?e.ll.x:r.ll.x,i=r.ur.x.isLessThan(e.ur.x)?r.ur.x:e.ur.x,s=r.ll.y.isLessThan(e.ll.y)?e.ll.y:r.ll.y,n=r.ur.y.isLessThan(e.ur.y)?r.ur.y:e.ur.y;return{ll:{x:t,y:s},ur:{x:i,y:n}}},Lt=(r,e)=>r.x.times(e.y).minus(r.y.times(e.x)),cr=(r,e)=>r.x.times(e.x).plus(r.y.times(e.y)),_t=r=>cr(r,r).sqrt(),Zs=(r,e,t)=>{const i={x:e.x.minus(r.x),y:e.y.minus(r.y)},s={x:t.x.minus(r.x),y:t.y.minus(r.y)};return Lt(s,i).div(_t(s)).div(_t(i))},Ks=(r,e,t)=>{const i={x:e.x.minus(r.x),y:e.y.minus(r.y)},s={x:t.x.minus(r.x),y:t.y.minus(r.y)};return cr(s,i).div(_t(s)).div(_t(i))},hr=(r,e,t)=>e.y.isZero()?null:{x:r.x.plus(e.x.div(e.y).times(t.minus(r.y))),y:t},ur=(r,e,t)=>e.x.isZero()?null:{x:t,y:r.y.plus(e.y.div(e.x).times(t.minus(r.x)))},Ys=(r,e,t,i)=>{if(e.x.isZero())return ur(t,i,r.x);if(i.x.isZero())return ur(r,e,t.x);if(e.y.isZero())return hr(t,i,r.y);if(i.y.isZero())return hr(r,e,t.y);const s=Lt(e,i);if(s.isZero())return null;const n={x:t.x.minus(r.x),y:t.y.minus(r.y)},o=Lt(n,e).div(s),l=Lt(n,i).div(s),u=r.x.plus(l.times(e.x)),f=t.x.plus(o.times(i.x)),x=r.y.plus(l.times(e.y)),w=t.y.plus(o.times(i.y)),$=u.plus(f).div(2),M=x.plus(w).div(2);return{x:$,y:M}},ve=class vr{point;isLeft;segment;otherSE;consumedBy;static compare(e,t){const i=vr.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Mt.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,s=t.length;i<s;i++){const n=t[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let s=t+1;s<e;s++){const n=this.point.events[s];n.consumedBy===void 0&&i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;t++){const s=this.point.events[t];s!==this&&!s.segment.ringOut&&s.segment.isInResult()&&e.push(s)}return e}getLeftmostComparator(e){const t=new Map,i=s=>{const n=s.otherSE;t.set(s,{sine:Zs(this.point,e.point,n.point),cosine:Ks(this.point,e.point,n.point)})};return(s,n)=>{t.has(s)||i(s),t.has(n)||i(n);const{sine:o,cosine:l}=t.get(s),{sine:u,cosine:f}=t.get(n);return o.isGreaterThanOrEqualTo(0)&&u.isGreaterThanOrEqualTo(0)?l.isLessThan(f)?1:l.isGreaterThan(f)?-1:0:o.isLessThan(0)&&u.isLessThan(0)?l.isLessThan(f)?-1:l.isGreaterThan(f)?1:0:u.isLessThan(o)?-1:u.isGreaterThan(o)?1:0}}},Xs=class hi{events;poly;_isExteriorRing;_enclosingRing;static factory(e){const t=[];for(let i=0,s=e.length;i<s;i++){const n=e[i];if(!n.isInResult()||n.ringOut)continue;let o=null,l=n.leftSE,u=n.rightSE;const f=[l],x=l.point,w=[];for(;o=l,l=u,f.push(l),l.point!==x;)for(;;){const $=l.getAvailableLinkedEvents();if($.length===0){const R=f[0].point,F=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${R.x}, ${R.y}]. Last matching segment found ends at [${F.x}, ${F.y}].`)}if($.length===1){u=$[0].otherSE;break}let M=null;for(let R=0,F=w.length;R<F;R++)if(w[R].point===l.point){M=R;break}if(M!==null){const R=w.splice(M)[0],F=f.splice(R.index);F.unshift(F[0].otherSE),t.push(new hi(F.reverse()));continue}w.push({index:f.length,point:l.point});const T=l.getLeftmostComparator(o);u=$.sort(T)[0].otherSE;break}t.push(new hi(f))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let f=1,x=this.events.length-1;f<x;f++){const w=this.events[f].point,$=this.events[f+1].point;Se.orient(w,e,$)!==0&&(t.push(w),e=w)}if(t.length===1)return null;const i=t[0],s=t[1];Se.orient(i,e,s)===0&&t.shift(),t.push(t[0]);const n=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:t.length-1,l=this.isExteriorRing()?t.length:-1,u=[];for(let f=o;f!=l;f+=n)u.push([t[f].x.toNumber(),t[f].y.toNumber()]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let s=1,n=this.events.length;s<n;s++){const o=this.events[s];ve.compare(e,o)>0&&(e=o)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut?.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut?.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}},dr=class{exteriorRing;interiorRings;constructor(r){this.exteriorRing=r,r.poly=this,this.interiorRings=[]}addInterior(r){this.interiorRings.push(r),r.poly=this}getGeom(){const r=this.exteriorRing.getGeom();if(r===null)return null;const e=[r];for(let t=0,i=this.interiorRings.length;t<i;t++){const s=this.interiorRings[t].getGeom();s!==null&&e.push(s)}return e}},Qs=class{rings;polys;constructor(r){this.rings=r,this.polys=this._composePolys(r)}getGeom(){const r=[];for(let e=0,t=this.polys.length;e<t;e++){const i=this.polys[e].getGeom();i!==null&&r.push(i)}return r}_composePolys(r){const e=[];for(let t=0,i=r.length;t<i;t++){const s=r[t];if(!s.poly)if(s.isExteriorRing())e.push(new dr(s));else{const n=s.enclosingRing();n?.poly||e.push(new dr(n)),n?.poly?.addInterior(s)}}return e}},Js=class{queue;tree;segments;constructor(r,e=Mt.compare){this.queue=r,this.tree=new St(e),this.segments=[]}process(r){const e=r.segment,t=[];if(r.consumedBy)return r.isLeft?this.queue.delete(r.otherSE):this.tree.delete(e),t;r.isLeft&&this.tree.add(e);let i=e,s=e;do i=this.tree.lastBefore(i);while(i!=null&&i.consumedBy!=null);do s=this.tree.firstAfter(s);while(s!=null&&s.consumedBy!=null);if(r.isLeft){let n=null;if(i){const l=i.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(n=l),!i.isAnEndpoint(l))){const u=this._splitSafely(i,l);for(let f=0,x=u.length;f<x;f++)t.push(u[f])}}let o=null;if(s){const l=s.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(o=l),!s.isAnEndpoint(l))){const u=this._splitSafely(s,l);for(let f=0,x=u.length;f<x;f++)t.push(u[f])}}if(n!==null||o!==null){let l=null;n===null?l=o:o===null?l=n:l=ve.comparePoints(n,o)<=0?n:o,this.queue.delete(e.rightSE),t.push(e.rightSE);const u=e.split(l);for(let f=0,x=u.length;f<x;f++)t.push(u[f])}t.length>0?(this.tree.delete(e),t.push(r)):(this.segments.push(e),e.prev=i)}else{if(i&&s){const n=i.getIntersection(s);if(n!==null){if(!i.isAnEndpoint(n)){const o=this._splitSafely(i,n);for(let l=0,u=o.length;l<u;l++)t.push(o[l])}if(!s.isAnEndpoint(n)){const o=this._splitSafely(s,n);for(let l=0,u=o.length;l<u;l++)t.push(o[l])}}}this.tree.delete(e)}return t}_splitSafely(r,e){this.tree.delete(r);const t=r.rightSE;this.queue.delete(t);const i=r.split(e);return i.push(t),r.consumedBy===void 0&&this.tree.add(r),i}},en=class{type;numMultiPolys;run(r,e,t){rt.type=r;const i=[new pr(e,!0)];for(let f=0,x=t.length;f<x;f++)i.push(new pr(t[f],!1));if(rt.numMultiPolys=i.length,rt.type==="difference"){const f=i[0];let x=1;for(;x<i.length;)li(i[x].bbox,f.bbox)!==null?x++:i.splice(x,1)}if(rt.type==="intersection")for(let f=0,x=i.length;f<x;f++){const w=i[f];for(let $=f+1,M=i.length;$<M;$++)if(li(w.bbox,i[$].bbox)===null)return[]}const s=new St(ve.compare);for(let f=0,x=i.length;f<x;f++){const w=i[f].getSweepEvents();for(let $=0,M=w.length;$<M;$++)s.add(w[$])}const n=new Js(s);let o=null;for(s.size!=0&&(o=s.first(),s.delete(o));o;){const f=n.process(o);for(let x=0,w=f.length;x<w;x++){const $=f[x];$.consumedBy===void 0&&s.add($)}s.size!=0?(o=s.first(),s.delete(o)):o=null}Se.reset();const l=Xs.factory(n.segments);return new Qs(l).getGeom()}},rt=new en,$t=rt,tn=0,Mt=class At{id;leftSE;rightSE;rings;windings;ringOut;consumedBy;prev;_prevInResult;_beforeState;_afterState;_isInResult;static compare(e,t){const i=e.leftSE.point.x,s=t.leftSE.point.x,n=e.rightSE.point.x,o=t.rightSE.point.x;if(o.isLessThan(i))return 1;if(n.isLessThan(s))return-1;const l=e.leftSE.point.y,u=t.leftSE.point.y,f=e.rightSE.point.y,x=t.rightSE.point.y;if(i.isLessThan(s)){if(u.isLessThan(l)&&u.isLessThan(f))return 1;if(u.isGreaterThan(l)&&u.isGreaterThan(f))return-1;const w=e.comparePoint(t.leftSE.point);if(w<0)return 1;if(w>0)return-1;const $=t.comparePoint(e.rightSE.point);return $!==0?$:-1}if(i.isGreaterThan(s)){if(l.isLessThan(u)&&l.isLessThan(x))return-1;if(l.isGreaterThan(u)&&l.isGreaterThan(x))return 1;const w=t.comparePoint(e.leftSE.point);if(w!==0)return w;const $=e.comparePoint(t.rightSE.point);return $<0?1:$>0?-1:1}if(l.isLessThan(u))return-1;if(l.isGreaterThan(u))return 1;if(n.isLessThan(o)){const w=t.comparePoint(e.rightSE.point);if(w!==0)return w}if(n.isGreaterThan(o)){const w=e.comparePoint(t.rightSE.point);if(w<0)return 1;if(w>0)return-1}if(!n.eq(o)){const w=f.minus(l),$=n.minus(i),M=x.minus(u),T=o.minus(s);if(w.isGreaterThan($)&&M.isLessThan(T))return 1;if(w.isLessThan($)&&M.isGreaterThan(T))return-1}return n.isGreaterThan(o)?1:n.isLessThan(o)||f.isLessThan(x)?-1:f.isGreaterThan(x)?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,s){this.id=++tn,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=s}static fromRing(e,t,i){let s,n,o;const l=ve.comparePoints(e,t);if(l<0)s=e,n=t,o=1;else if(l>0)s=t,n=e,o=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const u=new ve(s,!0),f=new ve(n,!1);return new At(u,f,[i],[o])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return Se.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),i=e.bbox(),s=li(t,i);if(s===null)return null;const n=this.leftSE.point,o=this.rightSE.point,l=e.leftSE.point,u=e.rightSE.point,f=it(t,l)&&this.comparePoint(l)===0,x=it(i,n)&&e.comparePoint(n)===0,w=it(t,u)&&this.comparePoint(u)===0,$=it(i,o)&&e.comparePoint(o)===0;if(x&&f)return $&&!w?o:!$&&w?u:null;if(x)return w&&n.x.eq(u.x)&&n.y.eq(u.y)?null:n;if(f)return $&&o.x.eq(l.x)&&o.y.eq(l.y)?null:l;if($&&w)return null;if($)return o;if(w)return u;const M=Ys(n,this.vector(),l,e.vector());return M===null||!it(s,M)?null:Se.snap(M)}split(e){const t=[],i=e.events!==void 0,s=new ve(e,!0),n=new ve(e,!1),o=this.rightSE;this.replaceRightSE(n),t.push(n),t.push(s);const l=new At(s,o,this.rings.slice(),this.windings.slice());return ve.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),ve.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(s.checkForConsuming(),n.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const s=At.compare(t,i);if(s!==0){if(s>0){const n=t;t=i,i=n}if(t.prev===i){const n=t;t=i,i=n}for(let n=0,o=i.rings.length;n<o;n++){const l=i.rings[n],u=i.windings[n],f=t.rings.indexOf(l);f===-1?(t.rings.push(l),t.windings.push(u)):t.windings[f]+=u}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,s=this._afterState.multiPolys;for(let l=0,u=this.rings.length;l<u;l++){const f=this.rings[l],x=this.windings[l],w=t.indexOf(f);w===-1?(t.push(f),i.push(x)):i[w]+=x}const n=[],o=[];for(let l=0,u=t.length;l<u;l++){if(i[l]===0)continue;const f=t[l],x=f.poly;if(o.indexOf(x)===-1)if(f.isExterior)n.push(x);else{o.indexOf(x)===-1&&o.push(x);const w=n.indexOf(f.poly);w!==-1&&n.splice(w,1)}}for(let l=0,u=n.length;l<u;l++){const f=n[l].multiPoly;s.indexOf(f)===-1&&s.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch($t.type){case"union":{const i=e.length===0,s=t.length===0;this._isInResult=i!==s;break}case"intersection":{let i,s;e.length<t.length?(i=e.length,s=t.length):(i=t.length,s=e.length),this._isInResult=s===$t.numMultiPolys&&i<s;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=s=>s.length===1&&s[0].isSubject;this._isInResult=i(e)!==i(t);break}}return this._isInResult}},fr=class{poly;isExterior;segments;bbox;constructor(r,e,t){if(!Array.isArray(r)||r.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof r[0][0]!="number"||typeof r[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=Se.snap({x:new ye(r[0][0]),y:new ye(r[0][1])});this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let n=1,o=r.length;n<o;n++){if(typeof r[n][0]!="number"||typeof r[n][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=Se.snap({x:new ye(r[n][0]),y:new ye(r[n][1])});l.x.eq(s.x)&&l.y.eq(s.y)||(this.segments.push(Mt.fromRing(s,l,this)),l.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=l.x),l.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=l.y),l.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=l.x),l.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=l.y),s=l)}(!i.x.eq(s.x)||!i.y.eq(s.y))&&this.segments.push(Mt.fromRing(s,i,this))}getSweepEvents(){const r=[];for(let e=0,t=this.segments.length;e<t;e++){const i=this.segments[e];r.push(i.leftSE),r.push(i.rightSE)}return r}},rn=class{multiPoly;exteriorRing;interiorRings;bbox;constructor(r,e){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new fr(r[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let t=1,i=r.length;t<i;t++){const s=new fr(r[t],this,!1);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const r=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const i=this.interiorRings[e].getSweepEvents();for(let s=0,n=i.length;s<n;s++)r.push(i[s])}return r}},pr=class{isSubject;polys;bbox;constructor(r,e){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof r[0][0][0]=="number"&&(r=[r])}catch{}this.polys=[],this.bbox={ll:{x:new ye(Number.POSITIVE_INFINITY),y:new ye(Number.POSITIVE_INFINITY)},ur:{x:new ye(Number.NEGATIVE_INFINITY),y:new ye(Number.NEGATIVE_INFINITY)}};for(let t=0,i=r.length;t<i;t++){const s=new rn(r[t],this);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const r=[];for(let e=0,t=this.polys.length;e<t;e++){const i=this.polys[e].getSweepEvents();for(let s=0,n=i.length;s<n;s++)r.push(i[s])}return r}},sn=(r,...e)=>$t.run("union",r,e),nn=(r,...e)=>$t.run("difference",r,e);Se.set;function on(r){const e=[];if(ti(r,s=>{e.push(s.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=r.features[0].properties||{},i=nn(e[0],...e.slice(1));return i.length===0?null:i.length===1?Jt(i[0],t):ir(i,t)}var ln=on;function an(r){if(!r)throw new Error("geojson is required");var e=[];return Fs(r,function(t){e.push(t)}),ei(e)}var cn=an;function hn(r,e={}){const t=[];if(ti(r,s=>{t.push(s.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=sn(t[0],...t.slice(1));return i.length===0?null:i.length===1?Jt(i[0],e.properties):ir(i,e.properties)}var un=hn;function dn(r){const e=ln(ei([Jt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),r]));if(!e)return;e.properties={isMask:!0};const t=pt(sr(r)),i=(t[2]-t[0])/360/1e3,s=t[0]<-180,n=t[2]>180,o=cn(r);if(o.features.length>1&&(s||n))for(const l of o.features){const u=pt(sr(l));if(n&&u[0]<-180+i)for(const f of l.geometry.coordinates)for(const x of f)x[0]+=360-i;if(s&&u[2]>180-i)for(const f of l.geometry.coordinates)for(const x of f)x[0]-=360-i}return ei([o.features.length<2?r:un(o)??r,e])}const mr={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13},gr=r=>e=>{const t=r.iconsBaseUrl??"https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.8/icons/",i=e.getProperties(),s=e.getGeometry()?.getType(),n=i.isMask?0:s==="LineString"||s==="MultiLineString"?3:2;return new Lr({stroke:i.isMask?void 0:new di({color:"#3170fe",lineDash:[n,n],width:n,lineCap:"butt"}),fill:i.isMask?new ui({color:"#00000020"}):void 0,image:new Sr({src:`${t}marker_${i.isReverse?"reverse":i.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:i.isSelected?2:i.isReverse?0:1,text:(i.isSelected||i.isMouseOver)&&i.tooltip?new _r({backgroundFill:new ui({color:"white"}),text:i.tooltip,offsetY:-40,backgroundStroke:new di({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})},Re="EPSG:4326";class yr extends br.Control{#e;#t;#s;constructor(e={}){const t=document.createElement("div");super({element:t,...e}),this.#e=e,this.#s=document.createElement("maptiler-geocoder"),this.#s.classList.add("openlayers-geocoder"),this.#E(),t.classList.add("openlayers-ctrl-geocoder"),t.style.zIndex="3",t.appendChild(this.#s)}setMap(e){super.setMap(e),this.#t&&this.#t!==e&&(this.#$(),this.#I(),this.#t=void 0),e&&(this.#t=e,this.#_(),this.#k())}getOptions(){return{...this.#e}}setOptions(e){Object.assign(this.#e,e),this.#E()}setQuery(e){this.#s.setQuery(e)}submitQuery(e){this.#s.submitQuery(e)}clearMap(){this.#o=[],this.#f(void 0,void 0)}clearList(){this.#s.clearList()}setReverseMode(e){this.setOptions({reverseActive:e})}focus(e){this.#s.focus(e)}blur(){this.#s.blur()}#c=new Map;#h;#n;#o;#g;#a;#r;#u;#y=!1;#v={reversetoggle:e=>{this.#y=e.detail.reverse,this.#i("reversetoggle",e.detail)},querychange:e=>{const t=e.detail.reverseCoords;this.#S(t?[t.decimalLongitude,t.decimalLatitude]:void 0),this.#i("querychange",e.detail)},queryclear:()=>{this.#S(void 0),this.#i("queryclear")},request:e=>{this.#i("request",e.detail)},response:e=>{this.#i("response",e.detail)},select:e=>{const t=e.detail.feature;t&&this.#m&&this.#e.flyToSelected&&this.#w(t.center,this.#d(t)),this.#o&&t&&this.#O(t),this.#i("select",e.detail)},pick:e=>{const t=e.detail.feature;t&&t.id!==this.#g&&this.#m&&(this.#M(t),this.#f(this.#o,t)),this.#g=t?.id,this.#i("pick",e.detail)},featuresshow:()=>{this.#i("featuresshow")},featureshide:()=>{this.#i("featureshide")},featureslisted:e=>{const t=e.detail.features;this.#o=t,this.#f(this.#o,void 0),this.#T(e),this.#i("featureslisted",e.detail)},featuresclear:()=>{this.#o=void 0,this.#f(void 0,void 0),this.#i("featuresclear")},focusin:()=>{this.#i("focusin")},focusout:()=>{this.#i("focusout")}};#b={postrender:()=>{const e=this.#t?.getView().getZoom(),t=this.#t?.getView().getCenter();this.#s.handleMapChange(e&&t?[e,...this.#L(t)]:void 0)},click:e=>{this.#s.handleMapClick(this.#L(e.coordinate)),this.#t?.forEachFeatureAtPixel(e.pixel,t=>{const i=t.getId(),s=this.#o?.find(n=>n.id===i);if(!(!i||!s))return e.stopPropagation(),this.#i("markerclick",{feature:s,marker:t}),!0})},pointermove:e=>{if(!this.#t)return;const t=this.#t.forEachFeatureAtPixel(e.pixel,s=>s.getId()?s:void 0);this.#t.getTargetElement().style.cursor=t?"pointer":this.#y?"crosshair":"";const i=t?.getId();if(this.#u!==i){if(this.#u){const s=this.#o?.find(o=>o.id===this.#u),n=this.#c.get(s);n?.set("isMouseOver",!1),s&&n&&this.#i("markermouseleave",{feature:s,marker:n})}if(t){const s=this.#o?.find(n=>n.id===i);this.#i("markermouseenter",{feature:s,marker:t}),t.set("isMouseOver",!0)}this.#u=i}}};#E(){this.#s.setOptions(this.#e),this.#s.fetchFullGeometryOnPick=this.#e.pickedResultStyle!=="marker-only"}#_(){if(this.#t){for(const[e,t]of Object.entries(this.#v))this.#s.addEventListener(e,t);for(const[e,t]of Object.entries(this.#b))this.#t.on([e],t)}}#$(){if(this.#t){for(const[e,t]of Object.entries(this.#v))this.#s.removeEventListener(e,t);for(const[e,t]of Object.entries(this.#b))this.#t.un([e],t)}}#i(e,t){this.dispatchEvent(Object.assign(new Er(e),t))}#M(e){e.bbox[0]===e.bbox[2]&&e.bbox[1]===e.bbox[3]?this.#w(e.center,this.#d(e)):this.#x(pt(e.bbox),50,this.#d(e))}#T({detail:{features:e,external:t}}){if(!e||e.length===0||!this.#m||this.#e.flyToFeatures===!1||this.#e.flyToFeatures==="never"||!t&&(this.#e.flyToFeatures===void 0||this.#e.flyToFeatures==="external"))return;const i=e.every(o=>o.matching_text),s=e.reduce((o,l)=>i||!l.matching_text?[Math.min(o[0],l.bbox[0]),Math.min(o[1],l.bbox[1]),Math.max(o[2],l.bbox[2]),Math.max(o[3],l.bbox[3])]:o,[180,90,-180,-90]),n=e.map(o=>this.#d(o)).filter(o=>o!==void 0).reduce((o,l)=>o===void 0?l:Math.max(o,l),void 0);this.#x(pt(s),50,n)}#d(e){if(e.bbox[0]!==e.bbox[2]||e.bbox[1]!==e.bbox[3])return;const t=e.id.replace(/\..*/,""),i=this.#e.zoom??mr;return(Array.isArray(e.properties?.categories)?e.properties.categories.reduce((s,n)=>{const o=i[t+"."+n];return s===void 0?o:o===void 0?s:Math.max(s,o)},void 0):void 0)??i[t]}get#m(){return!!this.#e.flyTo||this.#e.flyTo===void 0}get#A(){return typeof this.#e.flyTo=="boolean"?{}:this.#e.flyTo}get#C(){return typeof this.#e.flyTo=="boolean"?{}:this.#e.flyTo}#w(e,t){this.#t?.getView().animate({center:this.#p(e),...t?{zoom:t}:{},duration:2e3,...this.#A})}#x(e,t,i){this.#t?.getView().fit(ot.transformExtent(e,Re,this.#l()),{padding:[t,t,t,t],...i?{maxZoom:i}:{},duration:2e3,...this.#C})}#S(e){if(this.#e.marker===!1||!this.#t||!this.#r)return;if(!e){this.#n&&(this.#r.removeFeature(this.#n),this.#n.dispose(),this.#n=void 0);return}const t=this.#p(e);if(!this.#n){this.#n=new se.Feature(new oe.Point(t)),this.#n.set("isReverse",!0),this.#r.addFeature(this.#n);return}this.#n.getGeometry().setCoordinates(t)}#f(e,t){if(!this.#t||!this.#r)return;this.#r.removeFeatures([...this.#c.undefined()]),this.#c=new Map;const i=()=>{if(!t||!this.#t||this.#e.marker===!1)return;const s=new se.Feature(new oe.Point(this.#p(t.center)));s.setId(t.id),this.#c.set(t,s),this.#r?.addFeature(s)};if(t?.geometry.type==="GeometryCollection"){const s=t.geometry.geometries.map(n=>n.type==="Polygon"?new oe.Polygon(n.coordinates):n.type==="MultiPolygon"?new oe.MultiPolygon(n.coordinates):null).filter(n=>!!n);if(s.length>0)this.#r.addFeature(new se.Feature(new oe.GeometryCollection(s).transform(Re,this.#l())));else for(const n of t.geometry.geometries)n.type==="LineString"?this.#r.addFeature(new se.Feature(new oe.LineString(n.coordinates).transform(Re,this.#l()))):n.type==="MultiLineString"&&this.#r.addFeature(new se.Feature(new oe.MultiLineString(n.coordinates).transform(Re,this.#l())))}else if(t?.geometry.type.endsWith("Polygon")){const s=dn(t);if(s)for(const n of s.features){const o=n.geometry.type==="Polygon"?new oe.Polygon(n.geometry.coordinates):new oe.MultiPolygon(n.geometry.coordinates);this.#r.addFeature(new se.Feature({isMask:!!n.properties?.isMask,geometry:o.transform(Re,this.#l())}))}this.#e.pickedResultStyle==="full-geometry-including-polygon-center-marker"&&i()}else t?.geometry.type==="LineString"?this.#r.addFeature(new se.Feature(new oe.LineString(t.geometry.coordinates).transform(Re,this.#l()))):t?.geometry.type==="MultiLineString"?this.#r.addFeature(new se.Feature(new oe.MultiLineString(t.geometry.coordinates).transform(Re,this.#l()))):t?.geometry.type.endsWith("Point")&&i();if(this.#e.showResultMarkers!==!1)for(const s of e??[]){if(s.id===t?.id||s.place_type.includes("reverse"))continue;const n=new se.Feature(new oe.Point(this.#p(s.center)));n.setId(s.id),n.setProperties({fuzzy:!!s.matching_text,tooltip:s.place_type[0]==="reverse"?s.place_name:s.place_name.replace(/,.*/,"")}),this.#r.addFeature(n),this.#c.set(s,n)}}#O(e){this.#h?.set("isSelected",!1),this.#h=void 0,this.#e.markerOnSelected!==!1&&(this.#h=this.#c.get(e),this.#h?.setProperties({isSelected:!0}))}#k(){this.#t&&(this.#r=new xr({}),this.#a=new wr({updateWhileAnimating:!0}),this.#a.setSource(this.#r),this.#a.setStyle(this.#P()),this.#t.addLayer(this.#a))}#I(){!this.#t||!this.#a||(this.#t.removeLayer(this.#a),this.#a=void 0)}#l(){return ot.getUserProjection()??this.#t?.getView().getProjection()}#p(e){return ot.fromLonLat(e,this.#l())}#L(e){return ot.toLonLat(e,this.#l())}#P(){const{fullGeometryStyle:e}=this.#e;if(e===!0||e===void 0)return gr(this.#e);if(!(e===!1||e===null))return e}}_.DEFAULT_GEOMETRY_STYLE=gr,_.GeocodingControl=yr,_.OpenLayersGeocodingControl=yr,_.ZOOM_DEFAULTS=mr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
276
281
  //# sourceMappingURL=openlayers.public.umd.js.map