@maptiler/geocoding-control 2.1.3-rc1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/leaflet.js +914 -931
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +13 -13
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +911 -928
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +13 -13
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +912 -929
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +13 -13
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +932 -949
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +13 -13
- package/openlayers.umd.js.map +1 -1
- package/package.json +1 -1
- package/react.js +642 -659
- package/react.js.map +1 -1
- package/react.umd.js +13 -13
- package/react.umd.js.map +1 -1
- package/svelte/FeatureItem.svelte +1 -1
- package/svelte/GeocodingControl.svelte +17 -45
- package/svelte/GeocodingControl.svelte.d.ts +0 -1
- package/svelte/info.json +1 -1
- package/svelte/types.d.ts +0 -1
- package/types.d.ts +0 -1
- package/vanilla.js +770 -787
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +12 -12
- package/vanilla.umd.js.map +1 -1
package/maptilersdk.umd.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(j,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],$):(j=typeof globalThis<"u"?globalThis:j||self,$(j.maptilersdkMaptilerGeocoder={},j.maptilersdk))})(this,function(j,$){"use strict";var qs=Object.defineProperty;var En=j=>{throw TypeError(j)};var Fs=(j,$,me)=>$ in j?qs(j,$,{enumerable:!0,configurable:!0,writable:!0,value:me}):j[$]=me;var P=(j,$,me)=>Fs(j,typeof $!="symbol"?$+"":$,me),Ln=(j,$,me)=>$.has(j)||En("Cannot "+me);var he=(j,$,me)=>(Ln(j,$,"read from private field"),me?me.call(j):$.get(j)),pi=(j,$,me)=>$.has(j)?En("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(j):$.set(j,me),yi=(j,$,me,gt)=>(Ln(j,$,"write to private field"),gt?gt.call(j,me):$.set(j,me),me);var cn,hn;function me(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const gt=me($);function ne(){}function Sn(i,e){for(const t in e)i[t]=e[t];return i}function bi(i){return i()}function wi(){return Object.create(null)}function Ue(i){i.forEach(bi)}function Ei(i){return typeof i=="function"}function Ve(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Ot;function ve(i,e){return i===e?!0:(Ot||(Ot=document.createElement("a")),Ot.href=e,i===Ot.href)}function xn(i){return Object.keys(i).length===0}function Tn(i,e,t,n){if(i){const r=Li(i,e,t,n);return i[0](r)}}function Li(i,e,t,n){return i[1]&&n?Sn(t.ctx.slice(),i[1](n(e))):t.ctx}function Mn(i,e,t,n){return i[2],e.dirty}function Cn(i,e,t,n,r,u){if(r){const h=Li(e,t,n,u);i.p(h,r)}}function Nn(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Rt(i){return i??""}function V(i,e){i.appendChild(e)}function re(i,e,t){i.insertBefore(e,t||null)}function ee(i){i.parentNode&&i.parentNode.removeChild(i)}function Q(i){return document.createElement(i)}function ke(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ke(i){return document.createTextNode(i)}function Le(){return Ke(" ")}function kn(){return Ke("")}function de(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function On(i){return function(e){return e.preventDefault(),i.call(this,e)}}function x(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Rn(i){return Array.from(i.childNodes)}function mt(i,e){e=""+e,i.data!==e&&(i.data=e)}function _i(i,e){i.value=e??""}function Ae(i,e,t){i.classList.toggle(e,!!t)}function Pn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let pt;function yt(i){pt=i}function Si(){if(!pt)throw new Error("Function called outside component initialization");return pt}function In(i){Si().$$.on_destroy.push(i)}function xi(){const i=Si();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const u=Pn(e,t,{cancelable:n});return r.slice().forEach(h=>{h.call(i,u)}),!u.defaultPrevented}return!0}}function An(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const ft=[],Yt=[];let ct=[];const Ti=[],Bn=Promise.resolve();let Qt=!1;function Wn(){Qt||(Qt=!0,Bn.then(Mi))}function Xt(i){ct.push(i)}const Jt=new Set;let ht=0;function Mi(){if(ht!==0)return;const i=pt;do{try{for(;ht<ft.length;){const e=ft[ht];ht++,yt(e),Gn(e.$$)}}catch(e){throw ft.length=0,ht=0,e}for(yt(null),ft.length=0,ht=0;Yt.length;)Yt.pop()();for(let e=0;e<ct.length;e+=1){const t=ct[e];Jt.has(t)||(Jt.add(t),t())}ct.length=0}while(ft.length);for(;Ti.length;)Ti.pop()();Qt=!1,Jt.clear(),yt(i)}function Gn(i){if(i.fragment!==null){i.update(),Ue(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Xt)}}function Dn(i){const e=[],t=[];ct.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),ct=e}const Pt=new Set;let st;function It(){st={r:0,c:[],p:st}}function At(){st.r||Ue(st.c),st=st.p}function le(i,e){i&&i.i&&(Pt.delete(i),i.i(e))}function ge(i,e,t,n){if(i&&i.o){if(Pt.has(i))return;Pt.add(i),st.c.push(()=>{Pt.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Ci(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function zn(i,e){ge(i,1,1,()=>{e.delete(i.key)})}function Un(i,e,t,n,r,u,h,o,g,c,E,S){let C=i.length,R=u.length,O=C;const A={};for(;O--;)A[i[O].key]=O;const M=[],k=new Map,y=new Map,N=[];for(O=R;O--;){const B=S(r,u,O),s=t(B);let l=h.get(s);l?N.push(()=>l.p(B,e)):(l=c(s,B),l.c()),k.set(s,M[O]=l),s in A&&y.set(s,Math.abs(O-A[s]))}const D=new Set,q=new Set;function U(B){le(B,1),B.m(o,E),h.set(B.key,B),E=B.first,R--}for(;C&&R;){const B=M[R-1],s=i[C-1],l=B.key,f=s.key;B===s?(E=B.first,C--,R--):k.has(f)?!h.has(l)||D.has(l)?U(B):q.has(f)?C--:y.get(l)>y.get(f)?(q.add(l),U(B)):(D.add(f),C--):(g(s,h),C--)}for(;C--;){const B=i[C];k.has(B.key)||g(B,h)}for(;R;)U(M[R-1]);return Ue(N),M}function Ye(i){i&&i.c()}function qe(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Xt(()=>{const u=i.$$.on_mount.map(bi).filter(Ei);i.$$.on_destroy?i.$$.on_destroy.push(...u):Ue(u),i.$$.on_mount=[]}),r.forEach(Xt)}function Fe(i,e){const t=i.$$;t.fragment!==null&&(Dn(t.after_update),Ue(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function qn(i,e){i.$$.dirty[0]===-1&&(ft.push(i),Wn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Qe(i,e,t,n,r,u,h=null,o=[-1]){const g=pt;yt(i);const c=i.$$={fragment:null,ctx:[],props:u,update:ne,not_equal:r,bound:wi(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:wi(),dirty:o,skip_bound:!1,root:e.target||g.$$.root};h&&h(c.root);let E=!1;if(c.ctx=t?t(i,e.props||{},(S,C,...R)=>{const O=R.length?R[0]:C;return c.ctx&&r(c.ctx[S],c.ctx[S]=O)&&(!c.skip_bound&&c.bound[S]&&c.bound[S](O),E&&qn(i,S)),C}):[],c.update(),E=!0,Ue(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const S=Rn(e.target);c.fragment&&c.fragment.l(S),S.forEach(ee)}else c.fragment&&c.fragment.c();e.intro&&le(i.$$.fragment),qe(i,e.target,e.anchor),Mi()}yt(g)}class Xe{constructor(){P(this,"$$");P(this,"$$set")}$destroy(){Fe(this,1),this.$destroy=ne}$on(e,t){if(!Ei(t))return ne;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!xn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Fn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Fn);function jn(i){let e,t;return{c(){e=ke("svg"),t=ke("path"),x(t,"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"),x(e,"viewBox","0 0 14 14"),x(e,"width","13"),x(e,"height","13"),x(e,"class","svelte-en2qvf")},m(n,r){re(n,e,r),V(e,t)},p:ne,i:ne,o:ne,d(n){n&&ee(e)}}}class Ni extends Xe{constructor(e){super(),Qe(this,e,null,jn,Ve,{})}}function Zn(i){let e,t;return{c(){e=ke("svg"),t=ke("path"),x(t,"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"),x(e,"viewBox","0 0 30 30"),x(e,"fill","none"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"class","svelte-d2loi5")},m(n,r){re(n,e,r),V(e,t)},p:ne,i:ne,o:ne,d(n){n&&ee(e)}}}class ki extends Xe{constructor(e){super(),Qe(this,e,null,Zn,Ve,{})}}function Hn(i){let e,t;return{c(){e=Q("img"),ve(e.src,t=i[3]+"area.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"area.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Vn(i){let e,t;return{c(){e=Q("img"),ve(e.src,t=i[3]+"reverse.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"reverse.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Kn(i){let e,t;return{c(){e=Q("img"),ve(e.src,t=i[3]+"poi.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"poi.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Yn(i){let e,t;return{c(){e=Q("img"),ve(e.src,t=i[3]+"postal_code.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"postal_code.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Qn(i){let e,t;return{c(){e=Q("img"),ve(e.src,t=i[3]+"street.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"street.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Xn(i){let e,t;return{c(){e=Q("img"),ve(e.src,t=i[3]+"road.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"road.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Jn(i){let e,t;return{c(){e=Q("img"),ve(e.src,t=i[3]+"housenumber.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"housenumber.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function $n(i){let e,t,n,r;return{c(){e=Q("img"),ve(e.src,t=i[5])||x(e,"src",t),x(e,"alt",i[4]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(u,h){re(u,e,h),n||(r=de(e,"error",i[14]),n=!0)},p(u,h){h&32&&!ve(e.src,t=u[5])&&x(e,"src",t),h&16&&x(e,"alt",u[4]),h&128&&x(e,"title",u[7])},d(u){u&&ee(e),n=!1,r()}}}function er(i){let e,t;return{c(){e=Q("div"),x(e,"class","sprite-icon svelte-w9y5n9"),x(e,"style",t=`
|
|
2
|
-
width: ${i[6].width/
|
|
3
|
-
height: ${i[6].height/
|
|
4
|
-
background-image: url(${i[3]}sprite${
|
|
5
|
-
background-position: -${i[6].x/
|
|
6
|
-
background-size: ${Oe.width/
|
|
7
|
-
`),x(e,"title",i[7])},m(n,r){
|
|
8
|
-
width: ${n[6].width/
|
|
9
|
-
height: ${n[6].height/
|
|
10
|
-
background-image: url(${n[3]}sprite${
|
|
11
|
-
background-position: -${n[6].x/
|
|
12
|
-
background-size: ${Oe.width/
|
|
13
|
-
`)&&x(e,"style",t),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Oi(i){let e,t;return{c(){e=Q("span"),t=Ke(i[7]),x(e,"class","secondary svelte-w9y5n9")},m(n,r){re(n,e,r),V(e,t)},p(n,r){r&128&&mt(t,n[7])},d(n){n&&ee(e)}}}function tr(i){let e,t,n,r,u,h,o,g,c,E=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",S,C,R=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[8],O,A,M=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",k,y,N,D,q,U;function B(m,a){return a&1&&(t=null),a&1&&(n=null),a&1&&(r=null),a&1&&(u=null),Oe&&m[6]?er:m[5]?$n:m[0].address?Jn:(t==null&&(t=!!m[0].id.startsWith("road.")),t?Xn:(n==null&&(n=!!m[0].id.startsWith("address.")),n?Qn:(r==null&&(r=!!m[0].id.startsWith("postal_code.")),r?Yn:(u==null&&(u=!!m[0].id.startsWith("poi.")),u?Kn:m[8]?Vn:Hn))))}let s=B(i,-1),l=s(i),f=R&&Oi(i);return{c(){e=Q("li"),l.c(),h=Le(),o=Q("span"),g=Q("span"),c=Q("span"),S=Ke(E),C=Le(),f&&f.c(),O=Le(),A=Q("span"),k=Ke(M),x(c,"class","primary svelte-w9y5n9"),x(g,"class","svelte-w9y5n9"),x(A,"class","line2 svelte-w9y5n9"),x(o,"class","texts svelte-w9y5n9"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",y=i[1]==="selected"),x(e,"aria-checked",N=i[1]==="picked"),x(e,"class",D=Rt(i[1])+" svelte-w9y5n9")},m(m,a){re(m,e,a),l.m(e,null),V(e,h),V(e,o),V(o,g),V(g,c),V(c,S),V(g,C),f&&f.m(g,null),V(o,O),V(o,A),V(A,k),q||(U=[de(e,"mouseenter",i[13]),de(e,"focus",i[15]),de(e,"click",i[16])],q=!0)},p(m,[a]){s===(s=B(m,a))&&l?l.p(m,a):(l.d(1),l=s(m),l&&(l.c(),l.m(e,h))),a&257&&E!==(E=(m[8]?m[0].place_name:m[0].place_name.replace(/,.*/,""))+"")&&mt(S,E),a&293&&(R=m[2]==="always"||m[2]!=="never"&&!m[0].address&&!m[0].id.startsWith("road.")&&!m[0].id.startsWith("address.")&&!m[0].id.startsWith("postal_code.")&&(!m[0].id.startsWith("poi.")||!m[5])&&!m[8]),R?f?f.p(m,a):(f=Oi(m),f.c(),f.m(g,null)):f&&(f.d(1),f=null),a&257&&M!==(M=(m[8]?"":m[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&mt(k,M),a&2&&y!==(y=m[1]==="selected")&&x(e,"aria-selected",y),a&2&&N!==(N=m[1]==="picked")&&x(e,"aria-checked",N),a&2&&D!==(D=Rt(m[1])+" svelte-w9y5n9")&&x(e,"class",D)},i:ne,o:ne,d(m){m&&ee(e),l.d(),f&&f.d(),q=!1,Ue(U)}}}const Ri=devicePixelRatio>1.25,$t=Ri?"@2x":"",Se=Ri?2:1;let Oe,Bt;function ir(i,e,t){let n,r,u,{feature:h}=e,{style:o="default"}=e,{showPlaceType:g}=e,{missingIconsCache:c}=e,{iconsBaseUrl:E}=e;const S=xi();let C,R,O,A;function M(){Bt??(Bt=fetch(`${E}/sprite${$t}.json`).then(s=>s.json()).then(s=>{Oe=s}).catch(()=>{Oe=null}))}function k(){R&&c.add(R),y()}function y(){Oe!==void 0?N():(M(),Bt==null||Bt.then(N))}function N(){do{if(A--,t(4,C=n==null?void 0:n[A]),t(6,O=C?Oe==null?void 0:Oe.icons[C]:void 0),O)break;t(5,R=C?E+C.replace(/ /g,"_")+".svg":void 0)}while(A>-1&&(!R||c.has(R)))}function D(s){An.call(this,i,s)}const q=()=>k(),U=()=>S("select",void 0),B=s=>{document.activeElement!==s.target&&S("select",void 0)};return i.$$set=s=>{"feature"in s&&t(0,h=s.feature),"style"in s&&t(1,o=s.style),"showPlaceType"in s&&t(2,g=s.showPlaceType),"missingIconsCache"in s&&t(11,c=s.missingIconsCache),"iconsBaseUrl"in s&&t(3,E=s.iconsBaseUrl)},i.$$.update=()=>{var s,l,f,m,a;i.$$.dirty&1&&t(12,n=(s=h.properties)==null?void 0:s.categories),i.$$.dirty&1&&t(8,r=h.place_type[0]==="reverse"),i.$$.dirty&1&&t(7,u=((f=(l=h.properties)==null?void 0:l.categories)==null?void 0:f.join(", "))??((a=(m=h.properties)==null?void 0:m.place_type_name)==null?void 0:a[0])??h.place_type[0]),i.$$.dirty&4096&&(A=(n==null?void 0:n.length)??0,y())},[h,o,g,E,C,R,O,u,r,S,k,c,n,D,q,U,B]}class nr extends Xe{constructor(e){super(),Qe(this,e,ir,tr,Ve,{feature:0,style:1,showPlaceType:2,missingIconsCache:11,iconsBaseUrl:3})}}function rr(i){let e;return{c(){e=Q("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><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"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',x(e,"class","svelte-7cmwmc")},m(t,n){re(t,e,n)},p:ne,i:ne,o:ne,d(t){t&&ee(e)}}}class sr extends Xe{constructor(e){super(),Qe(this,e,null,rr,Ve,{})}}function or(i){let e,t,n;return{c(){e=ke("svg"),t=ke("path"),x(t,"stroke-width","4"),x(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),x(t,"class","svelte-gzo3ar"),x(e,"width",n=i[0]==="list"?20:void 0),x(e,"viewBox","0 0 70 85"),x(e,"fill","none"),x(e,"class","svelte-gzo3ar"),Ae(e,"in-map",i[0]!=="list"),Ae(e,"list-icon",i[0]==="list")},m(r,u){re(r,e,u),V(e,t)},p(r,[u]){u&1&&n!==(n=r[0]==="list"?20:void 0)&&x(e,"width",n),u&1&&Ae(e,"in-map",r[0]!=="list"),u&1&&Ae(e,"list-icon",r[0]==="list")},i:ne,o:ne,d(r){r&&ee(e)}}}function lr(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class ur extends Xe{constructor(e){super(),Qe(this,e,lr,or,Ve,{displayIn:0})}}function ar(i){let e,t;return{c(){e=ke("svg"),t=ke("path"),x(t,"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"),x(e,"viewBox","0 0 60.006 21.412"),x(e,"width","14"),x(e,"height","20"),x(e,"class","svelte-en2qvf")},m(n,r){re(n,e,r),V(e,t)},p:ne,i:ne,o:ne,d(n){n&&ee(e)}}}class fr extends Xe{constructor(e){super(),Qe(this,e,null,ar,Ve,{})}}function cr(i){let e,t,n;return{c(){e=ke("svg"),t=ke("circle"),n=ke("path"),x(t,"cx","4.789"),x(t,"cy","4.787"),x(t,"r","3.85"),x(t,"class","svelte-1aq105l"),x(n,"d","M12.063 12.063 7.635 7.635"),x(n,"class","svelte-1aq105l"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"width","13"),x(e,"height","13"),x(e,"viewBox","0 0 13 13"),x(e,"class","svelte-1aq105l")},m(r,u){re(r,e,u),V(e,t),V(e,n)},p:ne,i:ne,o:ne,d(r){r&&ee(e)}}}class hr extends Xe{constructor(e){super(),Qe(this,e,null,cr,Ve,{})}}function dr(i,e,t){const n=e[1],r=e[0],u=n-r;return i===n&&t?i:((i-r)%u+u)%u+r}function Wt(i){const e=[...i];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 vt;async function gr(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(vt&&r.cachedLocationExpiry&&vt.time+r.cachedLocationExpiry>Date.now()){if(!vt.coords)break e;return vt.coords}let u;try{return u=await new Promise((h,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(g=>{h([g.coords.longitude,g.coords.latitude].map(c=>c.toFixed(6)).join(","))},g=>{o(g)},r)}),u}catch{}finally{r.cachedLocationExpiry&&(vt={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const mr=/^(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,Pi=/^([+-]?[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,})$/,Ii=/^(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,Ai=/^(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,Bi=/^(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,Wi=/^(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 pr(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(R=>Number(R.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),u=Math.abs(n),h=t>0?"N":"S",o=n>0?"E":"W";let g;i=="DD"&&(g=`${r}° ${h}, ${u}° ${o}`);const c=Math.floor(r),E=Math.floor(u),S=(r-c)*60,C=(u-E)*60;if(i=="DM"){let R=Gi(S,3).toFixed(3).padStart(6,"0"),O=Gi(C,3).toFixed(3).padStart(6,"0");R.endsWith(".000")&&O.endsWith(".000")&&(R=R.replace(/\.000$/,""),O=O.replace(/\.000$/,"")),g=`${c}° ${R}' ${h}, ${E}° ${O}' ${o}`}if(i=="DMS"){const R=Math.floor(S),O=Math.floor(C);let A=((S-R)*60).toFixed(1).padStart(4,"0"),M=((C-O)*60).toFixed(1).padStart(4,"0");const k=R.toString().padStart(2,"0"),y=O.toString().padStart(2,"0");A.endsWith(".0")&&M.endsWith(".0")&&(A=A.replace(/\.0$/,""),M=M.replace(/\.0$/,"")),g=`${c}° ${k}' ${A}" ${h}, ${E}° ${y}' ${M}" ${o}`}return g}else throw new Error("no decimal coordinates to convert")}function Gi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function ei(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",u="",h=null,o=[],g=!1;if(mr.test(i))throw new Error("invalid coordinate value");if(Pi.test(i))if(o=Pi.exec(i),g=bt(o),g)t=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(t*=-1),n=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(n*=-1),h="DM";else throw new Error("invalid coordinate format");else if(Ii.test(i))if(o=Ii.exec(i),g=bt(o),g){if(t=o[2],n=o[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),h="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");o[1]?(r=o[1],u=o[5]):o[4]&&(r=o[4],u=o[8])}else throw new Error("invalid decimal coordinate format");else if(Ai.test(i))if(o=Ai.exec(i),g=bt(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,h="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,h="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[9])),o[11]&&(n+=o[11]/60),o[13]&&(n+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(n=-1*n),o[1]?(r=o[1],u=o[8]):o[7]&&(r=o[7],u=o[14]);else throw new Error("invalid DMS coordinates format");else if(Bi.test(i))if(o=Bi.exec(i),g=bt(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,h="DM"),o[6]&&(t+=o[6]/3600,h="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12]/60),o[14]&&(n+=o[14]/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid DMS coordinates format");else if(Wi.test(i)){if(o=Wi.exec(i),g=bt(o),o.filter(c=>c).length<=5)throw new Error("invalid coordinates format");if(g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4].replace(",",".")/60,h="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,h="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12].replace(",",".")/60),o[14]&&(n+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid coordinates format")}if(g){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!u||!r&&u)throw new Error("invalid coordinates value");if(r&&r==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let c=/S|SOUTH/i;c.test(r)&&t>0&&(t=-1*t),c=/W|WEST/i,c.test(u)&&n>0&&(n=-1*n);const E=o[0].trim();let S,C;const R=/[,/;\u0020]/g,O=E.match(R);if(O==null){const k=Math.floor(i.length/2);S=E.substring(0,k).trim(),C=E.substring(k).trim()}else{let k;O.length%2==1?k=Math.floor(O.length/2):k=O.length/2-1;let y=0;if(k==0)y=E.indexOf(O[0]),S=E.substring(0,y).trim(),C=E.substring(y+1).trim();else{let N=0,D=0;for(;N<=k;)y=E.indexOf(O[N],D),D=y+1,N++;S=E.substring(0,y).trim(),C=E.substring(y+1).trim()}}const A=S.split(".");if(A.length==2&&A[1]==0&&A[1].length!=2)throw new Error("invalid coordinates format");const M=C.split(".");if(M.length==2&&M[1]==0&&M[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(C))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:E,verbatimLatitude:S,verbatimLongitude:C,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:h,closeEnough:yr,toCoordinateFormat:pr})}else throw new Error("coordinates pattern match failed")}function bt(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let u=0;u<r;u++){const h=e[u],o=e[u+r],g=t.test(h)&&t.test(o),c=n.test(h)&&n.test(o),E=h==o;if(!(h==null&&o==null)){if(h==null||o==null)return!1;if(g||c||E)continue;return!1}}return!0}function Di(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function yr(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return Di(this.decimalLatitude,Number(e[0]))&&Di(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const vr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});ei.to=vr;const br=[{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"}],wr={decimalLatitude:40.123,decimalLongitude:-74.123},Er=[{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}],Lr=[{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 _r(){const i=[];return br.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...wr})}),[...i,...Er,...Lr]}const Sr=_r();ei.formats=Sr.map(i=>i.verbatimCoordinates);const xr=ei;function zi(i,e,t){const n=i.slice();return n[100]=e[t],n[102]=t,n}function Ui(i){let e,t;return e=new sr({}),{c(){Ye(e.$$.fragment)},m(n,r){qe(e,n,r),t=!0},i(n){t||(le(e.$$.fragment,n),t=!0)},o(n){ge(e.$$.fragment,n),t=!1},d(n){Fe(e,n)}}}function qi(i){let e,t,n,r,u;return t=new fr({}),{c(){e=Q("button"),Ye(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),Ae(e,"active",i[0])},m(h,o){re(h,e,o),qe(t,e,null),n=!0,r||(u=de(e,"click",i[81]),r=!0)},p(h,o){(!n||o[0]&1024)&&x(e,"title",h[10]),(!n||o[0]&1)&&Ae(e,"active",h[0])},i(h){n||(le(t.$$.fragment,h),n=!0)},o(h){ge(t.$$.fragment,h),n=!1},d(h){h&&ee(e),Fe(t),r=!1,u()}}}function Tr(i){let e,t=[],n=new Map,r,u,h,o=Ci(i[13]);const g=c=>c[100].id+(c[100].address?","+c[100].address:"");for(let c=0;c<o.length;c+=1){let E=zi(i,o,c),S=g(E);n.set(S,t[c]=Fi(S,E))}return{c(){e=Q("ul");for(let c=0;c<t.length;c+=1)t[c].c();x(e,"class","options svelte-bz0zu3"),x(e,"role","listbox")},m(c,E){re(c,e,E);for(let S=0;S<t.length;S+=1)t[S]&&t[S].m(e,null);r=!0,u||(h=[de(e,"mouseleave",i[27]),de(e,"blur",i[85]),de(e,"keydown",i[23])],u=!0)},p(c,E){E[0]&102823936&&(o=Ci(c[13]),It(),t=Un(t,E,g,1,c,o,n,e,zn,Fi,null,zi),At())},i(c){if(!r){for(let E=0;E<o.length;E+=1)le(t[E]);r=!0}},o(c){for(let E=0;E<t.length;E+=1)ge(t[E]);r=!1},d(c){c&&ee(e);for(let E=0;E<t.length;E+=1)t[E].d();u=!1,Ue(h)}}}function Mr(i){let e,t,n,r,u,h;return t=new ki({}),{c(){e=Q("div"),Ye(t.$$.fragment),n=Le(),r=Q("div"),u=Ke(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(o,g){re(o,e,g),qe(t,e,null),V(e,n),V(e,r),V(r,u),h=!0},p(o,g){(!h||g[0]&256)&&mt(u,o[8])},i(o){h||(le(t.$$.fragment,o),h=!0)},o(o){ge(t.$$.fragment,o),h=!1},d(o){o&&ee(e),Fe(t)}}}function Cr(i){let e="",t;return{c(){t=Ke(e)},m(n,r){re(n,t,r)},p:ne,i:ne,o:ne,d(n){n&&ee(t)}}}function Nr(i){let e,t,n,r,u,h,o,g,c,E,S;return t=new ki({}),g=new Ni({}),{c(){e=Q("div"),Ye(t.$$.fragment),n=Le(),r=Q("div"),u=Ke(i[7]),h=Le(),o=Q("button"),Ye(g.$$.fragment),x(r,"class","svelte-bz0zu3"),x(o,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(C,R){re(C,e,R),qe(t,e,null),V(e,n),V(e,r),V(r,u),V(e,h),V(e,o),qe(g,o,null),c=!0,E||(S=de(o,"click",i[82]),E=!0)},p(C,R){(!c||R[0]&128)&&mt(u,C[7])},i(C){c||(le(t.$$.fragment,C),le(g.$$.fragment,C),c=!0)},o(C){ge(t.$$.fragment,C),ge(g.$$.fragment,C),c=!1},d(C){C&&ee(e),Fe(t),Fe(g),E=!1,S()}}}function Fi(i,e){var o;let t,n,r;function u(){return e[83](e[102])}function h(){return e[84](e[100])}return n=new nr({props:{feature:e[100],showPlaceType:e[11],style:e[15]===e[102]?"selected":((o=e[14])==null?void 0:o.id)===e[100].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",u),n.$on("select",h),{key:i,first:null,c(){t=kn(),Ye(n.$$.fragment),this.first=t},m(g,c){re(g,t,c),qe(n,g,c),r=!0},p(g,c){var S;e=g;const E={};c[0]&8192&&(E.feature=e[100]),c[0]&2048&&(E.showPlaceType=e[11]),c[0]&57344&&(E.style=e[15]===e[102]?"selected":((S=e[14])==null?void 0:S.id)===e[100].id?"picked":"default"),c[0]&4096&&(E.iconsBaseUrl=e[12]),n.$set(E)},i(g){r||(le(n.$$.fragment,g),r=!0)},o(g){ge(n.$$.fragment,g),r=!1},d(g){g&&ee(t),Fe(n,g)}}}function kr(i){let e,t,n,r,u,h,o,g,c,E,S,C,R,O,A,M,k,y,N,D,q,U=!1;u=new hr({}),S=new Ni({});let B=i[20]&&Ui(),s=i[6]==="button"&&qi(i);const l=i[72].default,f=Tn(l,i,i[71],null),m=[Nr,Cr,Mr,Tr],a=[];function b(p,d){var v,w;return p[19]?0:!p[16]&&!p[4]?1:((v=p[13])==null?void 0:v.length)===0?2:(w=p[13])!=null&&w.length&&(p[16]||p[4])?3:-1}return~(M=b(i))&&(k=a[M]=m[M](i)),{c(){e=Le(),t=Q("form"),n=Q("div"),r=Q("button"),Ye(u.$$.fragment),h=Le(),o=Q("input"),g=Le(),c=Q("div"),E=Q("button"),Ye(S.$$.fragment),C=Le(),B&&B.c(),R=Le(),s&&s.c(),O=Le(),f&&f.c(),A=Le(),k&&k.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(o,"placeholder",i[9]),x(o,"aria-label",i[9]),x(o,"class","svelte-bz0zu3"),x(E,"type","button"),x(E,"title",i[3]),x(E,"class","svelte-bz0zu3"),x(c,"class","clear-button-container svelte-bz0zu3"),Ae(c,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",y=Rt(i[2])+" svelte-bz0zu3"),Ae(t,"can-collapse",i[5]&&i[1]==="")},m(p,d){re(p,e,d),re(p,t,d),V(t,n),V(n,r),qe(u,r,null),V(n,h),V(n,o),i[74](o),_i(o,i[1]),V(n,g),V(n,c),V(c,E),qe(S,E,null),V(c,C),B&&B.m(c,null),V(n,R),s&&s.m(n,null),V(n,O),f&&f.m(n,null),V(t,A),~M&&a[M].m(t,null),N=!0,D||(q=[de(r,"click",i[73]),de(o,"input",i[75]),de(o,"focus",i[76]),de(o,"blur",i[77]),de(o,"click",i[78]),de(o,"keydown",i[23]),de(o,"input",i[24]),de(o,"change",i[79]),de(E,"click",i[80]),de(t,"submit",On(i[22]))],D=!0)},p(p,d){(!N||d[0]&512)&&x(o,"placeholder",p[9]),(!N||d[0]&512)&&x(o,"aria-label",p[9]),d[0]&2&&o.value!==p[1]&&_i(o,p[1]),(!N||d[0]&8)&&x(E,"title",p[3]),p[20]?B?d[0]&1048576&&le(B,1):(B=Ui(),B.c(),le(B,1),B.m(c,null)):B&&(It(),ge(B,1,1,()=>{B=null}),At()),(!N||d[0]&2)&&Ae(c,"displayable",p[1]!==""),p[6]==="button"?s?(s.p(p,d),d[0]&64&&le(s,1)):(s=qi(p),s.c(),le(s,1),s.m(n,O)):s&&(It(),ge(s,1,1,()=>{s=null}),At()),f&&f.p&&(!N||d[2]&512)&&Cn(f,l,p,p[71],N?Mn(l,p[71],d,null):Nn(p[71]),null);let v=M;M=b(p),M===v?~M&&a[M].p(p,d):(k&&(It(),ge(a[v],1,1,()=>{a[v]=null}),At()),~M?(k=a[M],k?k.p(p,d):(k=a[M]=m[M](p),k.c()),le(k,1),k.m(t,null)):k=null),(!N||d[0]&4&&y!==(y=Rt(p[2])+" svelte-bz0zu3"))&&x(t,"class",y),(!N||d[0]&38)&&Ae(t,"can-collapse",p[5]&&p[1]==="")},i(p){N||(le(U),le(u.$$.fragment,p),le(S.$$.fragment,p),le(B),le(s),le(f,p),le(k),N=!0)},o(p){ge(U),ge(u.$$.fragment,p),ge(S.$$.fragment,p),ge(B),ge(s),ge(f,p),ge(k),N=!1},d(p){p&&(ee(e),ee(t)),Fe(u),i[74](null),Fe(S),B&&B.d(),s&&s.d(),f&&f.d(p),~M&&a[M].d(),D=!1,Ue(q)}}}function Or(i,e,t){let n,r,u,{$$slots:h={},$$scope:o}=e;const g={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};let{class:c=void 0}=e,{apiKey:E}=e,{bbox:S=void 0}=e,{clearButtonTitle:C="clear"}=e,{clearOnBlur:R=!1}=e,{clearListOnPick:O=!1}=e,{keepListOpen:A=!1}=e,{collapsed:M=!1}=e,{country:k=void 0}=e,{debounceSearch:y=200}=e,{enableReverse:N="never"}=e,{errorMessage:D="Something went wrong…"}=e,{filter:q=()=>!0}=e,{flyTo:U=!0}=e,{fuzzyMatch:B=!0}=e,{language:s=void 0}=e,{limit:l=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:m=f}=e,{mapController:a=void 0}=e,{minLength:b=2}=e,{noResultsMessage:p="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:d="Search"}=e,{proximity:v=[{type:"server-geolocation"}]}=e,{reverseActive:w=N==="always"}=e,{reverseButtonTitle:L="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:I="full-geometry"}=e,{showPlaceType:W="if-needed"}=e,{showResultsWhileTyping:H=!0}=e,{autocompleteTimeout:te=void 0}=e,{selectFirst:J=!0}=e,{flyToSelected:Z=!1}=e,{markerOnSelected:K=!0}=e,{types:ae=void 0}=e;const lt=[];let{reverseGeocodingTypes:et=lt}=e,{exhaustiveReverseGeocoding:ut=!1}=e,{excludeTypes:Ee=!1}=e;const tt=void 0;let{reverseGeocodingExcludeTypes:pe=tt}=e,{zoom:fe=g}=e,{apiUrl:ie="https://api.maptiler.com/geocoding"}=e,{fetchParameters:ui={}}=e,{iconsBaseUrl:dn="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.3-rc1/icons/"}=e,{adjustUrlQuery:ai=()=>{}}=e,{adjustUrl:fi=()=>{}}=e;function vs(_){Pe.focus(_)}function bs(){Pe.blur()}function gn(_,oe=!0,ue=!1){t(1,T=_),oe?(t(15,Y=-1),pn()):(yn(void 0,!ue,ue),setTimeout(()=>{Pe.focus(),Pe.select()}))}function ws(){t(13,F=void 0),t(14,G=void 0),t(15,Y=-1)}function Es(){t(65,ce=[]),t(14,G=void 0)}let F,ce,G,mn="",Pe,Y=-1,Ge,Ht=[],at,it,Ce,dt,ci,He=!1;const Ls=new Set,nt=xi();function _s(){return!!Ce}In(()=>{a&&(a.setEventHandler(void 0),a.indicateReverse(!1),a.setSelectedMarker(-1),a.setFeatures(void 0,void 0,!1))});function pn(_){if(t(17,He=!1),it&&(window.clearTimeout(it),it=void 0),Ce){window.clearTimeout(Ce),t(66,Ce=void 0),xt(T,{appendSpace:!0});return}if(Y>-1&&F)t(14,G=F[Y]),t(1,T=G.place_type[0]==="reverse"?G.place_name:G.place_name.replace(/,.*/,"")),t(19,Ge=void 0),t(65,ce=void 0),t(15,Y=-1);else if(T){const oe=_||!hi(T);xt(T,{exact:!0}).then(()=>{t(65,ce=F),t(14,G=void 0),oe&&Ss()}).catch(ue=>t(19,Ge=ue))}}function hi(_){try{return xr(_,6)}catch{return!1}}async function xt(_,{byId:oe=!1,exact:ue=!1,appendSpace:Ie=!1}={}){var De,rt,bn;t(19,Ge=void 0),at==null||at.abort();const ye=new AbortController;t(20,at=ye);try{const X=hi(_),Mt=new URL(ie+"/"+encodeURIComponent(X?X.decimalLongitude+","+X.decimalLatitude:_+(Ie?" ":""))+".json"),Ne=Mt.searchParams;s!==void 0&&Ne.set("language",Array.isArray(s)?s.join(","):s??"");const[mi]=(a==null?void 0:a.getCenterAndZoom())??[];let ze=(De=!X||et===lt?ae:et)==null?void 0:De.map(be=>typeof be=="string"?be:mi===void 0||(be[0]??0)<=mi&&mi<(be[1]??1/0)?be[2]:void 0).filter(be=>be!==void 0);ze&&(ze=[...new Set(ze)],Ne.set("types",ze.join(",")));const wn=!X||pe===tt?Ee:pe;if(wn&&Ne.set("excludeTypes",String(wn)),S&&Ne.set("bbox",S.map(be=>be.toFixed(6)).join(",")),k&&Ne.set("country",Array.isArray(k)?k.join(","):k),!oe&&!X){const be=await gr(a,v,ye);be&&Ne.set("proximity",be),(ue||!H)&&Ne.set("autocomplete","false"),Ne.set("fuzzyMatch",String(B))}const Ct=m===f?l:m;Ct!==void 0&&Ct>1&&(ze==null?void 0:ze.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),X?(Ct===1||Ct!==void 0&&(ut||(ze==null?void 0:ze.length)===1))&&Ne.set("limit",String(Ct)):l!==void 0&&Ne.set("limit",String(l)),Ne.set("key",E),ai(Ne),fi(Mt);const Us=Mt.searchParams.get("types")===""&&Mt.searchParams.get("excludeTypes")!=="true",Vt=Mt.toString();if(Vt===mn){oe?(O&&t(13,F=void 0),t(14,G=Ht[0])):(t(13,F=Ht),((rt=F[Y])==null?void 0:rt.id)!==(r==null?void 0:r.id)&&t(15,Y=-1));return}mn=Vt;let Nt;if(Us)Nt={type:"FeatureCollection",features:[]};else{const be=await fetch(Vt,{signal:ye.signal,...ui});if(!be.ok)throw new Error(await be.text());Nt=await be.json()}nt("response",{url:Vt,featureCollection:Nt}),oe?(O&&t(13,F=void 0),t(14,G=Nt.features[0]),Ht=[G]):(t(13,F=Nt.features.filter(q)),X&&F.unshift({type:"Feature",properties:{},id:"reverse_"+X.decimalLongitude+"_"+X.decimalLatitude,text:X.decimalLatitude+", "+X.decimalLongitude,place_name:X.decimalLatitude+", "+X.decimalLongitude,place_type:["reverse"],center:[X.decimalLongitude,X.decimalLatitude],bbox:[X.decimalLongitude,X.decimalLatitude,X.decimalLongitude,X.decimalLatitude],geometry:{type:"Point",coordinates:[X.decimalLongitude,X.decimalLatitude]}}),Ht=F,((bn=F[Y])==null?void 0:bn.id)!==(r==null?void 0:r.id)&&t(15,Y=-1),X&&Pe.focus())}catch(X){if(X&&typeof X=="object"&&"name"in X&&X.name==="AbortError")return;throw X}finally{ye===at&&t(20,at=void 0)}}function Ss(){var Ie;if(!(ce!=null&&ce.length)||!U)return;const _=[180,90,-180,-90],oe=!ce.some(ye=>!ye.matching_text);let ue;for(const ye of ce){const De=Tt(ye);if(ue=ue===void 0?De:De===void 0?ue:Math.max(ue,De),oe||!ye.matching_text)for(const rt of[0,1,2,3])_[rt]=Math[rt<2?"min":"max"](_[rt],((Ie=ye.bbox)==null?void 0:Ie[rt])??ye.center[rt%2])}a&&ce.length>0&&(G&&_[0]===_[2]&&_[1]===_[3]?a.flyTo(G.center,Tt(G)):a.fitBounds(Wt(_),50,ue))}function di(){!G||!a||(!G.bbox||G.bbox[0]===G.bbox[2]&&G.bbox[1]===G.bbox[3]?a.flyTo(G.center,Tt(G)):a.fitBounds(Wt(G.bbox),50,Tt(G)))}function Tt(_){var ue;if(!_.bbox||_.bbox[0]!==_.bbox[2]&&_.bbox[1]!==_.bbox[3])return;const oe=_.id.replace(/\..*/,"");return(Array.isArray((ue=_.properties)==null?void 0:ue.categories)?_.properties.categories.reduce((Ie,ye)=>{const De=fe[oe+"."+ye];return Ie===void 0?De:De===void 0?Ie:Math.max(Ie,De)},void 0):void 0)??fe[oe]}function xs(_){t(0,w=N==="always"),t(13,F=void 0),t(14,G=void 0),t(15,Y=-1),gn(_[1].toFixed(6)+", "+dr(_[0],[-180,180],!0).toFixed(6),!1,!0)}function Ts(_){if(!F)return;let oe=_.key==="ArrowDown"?1:_.key==="ArrowUp"?-1:0;oe&&(Pe.focus(),t(17,He=!0),_.preventDefault(),G&&Y===-1&&t(15,Y=F.findIndex(ue=>ue.id===(G==null?void 0:G.id))),Y===(G||J?0:-1)&&oe===-1&&t(15,Y=F.length),t(15,Y+=oe),Y>=F.length&&t(15,Y=-1),Y<0&&(G||J)&&t(15,Y=0))}function yn(_,oe=!0,ue=!1){if(t(19,Ge=void 0),t(14,G=void 0),t(17,He=!0),it&&(window.clearTimeout(it),it=void 0),Ce&&(window.clearTimeout(Ce),t(66,Ce=void 0)),!H&&!ue||T.length<b){t(13,F=void 0);return}const Ie=T;it=window.setTimeout(()=>{it=void 0,xt(Ie).catch(ye=>t(19,Ge=ye))},oe?y:0),T.endsWith(" ")||t(66,Ce=window.setTimeout(()=>{t(66,Ce=void 0),xt(Ie,{appendSpace:!0}).catch(ye=>t(19,Ge=ye))},te))}function gi(_){G&&(G==null?void 0:G.id)===(_==null?void 0:_.id)?di():(t(14,G=_),t(1,T=_.place_name))}function vn(_){t(15,Y=_)}function Ms(){(!J||G)&&t(15,Y=-1),Z&&di()}const Cs=()=>Pe.focus();function Ns(_){Yt[_?"unshift":"push"](()=>{Pe=_,t(18,Pe)})}function ks(){T=this.value,t(1,T),t(17,He),t(31,R),t(16,dt)}const Os=()=>t(17,He=!0),Rs=()=>t(17,He=!1),Ps=()=>t(17,He=!0),Is=()=>t(14,G=void 0),As=()=>{t(1,T=""),t(14,G=void 0),Pe.focus()},Bs=()=>t(0,w=!w),Ws=()=>t(19,Ge=void 0),Gs=_=>vn(_),Ds=_=>gi(_),zs=()=>{};return i.$$set=_=>{"class"in _&&t(2,c=_.class),"apiKey"in _&&t(29,E=_.apiKey),"bbox"in _&&t(30,S=_.bbox),"clearButtonTitle"in _&&t(3,C=_.clearButtonTitle),"clearOnBlur"in _&&t(31,R=_.clearOnBlur),"clearListOnPick"in _&&t(32,O=_.clearListOnPick),"keepListOpen"in _&&t(4,A=_.keepListOpen),"collapsed"in _&&t(5,M=_.collapsed),"country"in _&&t(33,k=_.country),"debounceSearch"in _&&t(34,y=_.debounceSearch),"enableReverse"in _&&t(6,N=_.enableReverse),"errorMessage"in _&&t(7,D=_.errorMessage),"filter"in _&&t(35,q=_.filter),"flyTo"in _&&t(36,U=_.flyTo),"fuzzyMatch"in _&&t(37,B=_.fuzzyMatch),"language"in _&&t(38,s=_.language),"limit"in _&&t(39,l=_.limit),"reverseGeocodingLimit"in _&&t(40,m=_.reverseGeocodingLimit),"mapController"in _&&t(41,a=_.mapController),"minLength"in _&&t(42,b=_.minLength),"noResultsMessage"in _&&t(8,p=_.noResultsMessage),"placeholder"in _&&t(9,d=_.placeholder),"proximity"in _&&t(43,v=_.proximity),"reverseActive"in _&&t(0,w=_.reverseActive),"reverseButtonTitle"in _&&t(10,L=_.reverseButtonTitle),"searchValue"in _&&t(1,T=_.searchValue),"pickedResultStyle"in _&&t(44,I=_.pickedResultStyle),"showPlaceType"in _&&t(11,W=_.showPlaceType),"showResultsWhileTyping"in _&&t(45,H=_.showResultsWhileTyping),"autocompleteTimeout"in _&&t(46,te=_.autocompleteTimeout),"selectFirst"in _&&t(47,J=_.selectFirst),"flyToSelected"in _&&t(48,Z=_.flyToSelected),"markerOnSelected"in _&&t(49,K=_.markerOnSelected),"types"in _&&t(50,ae=_.types),"reverseGeocodingTypes"in _&&t(51,et=_.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in _&&t(52,ut=_.exhaustiveReverseGeocoding),"excludeTypes"in _&&t(53,Ee=_.excludeTypes),"reverseGeocodingExcludeTypes"in _&&t(54,pe=_.reverseGeocodingExcludeTypes),"zoom"in _&&t(55,fe=_.zoom),"apiUrl"in _&&t(56,ie=_.apiUrl),"fetchParameters"in _&&t(57,ui=_.fetchParameters),"iconsBaseUrl"in _&&t(12,dn=_.iconsBaseUrl),"adjustUrlQuery"in _&&t(58,ai=_.adjustUrlQuery),"adjustUrl"in _&&t(59,fi=_.adjustUrl),"$$scope"in _&&t(71,o=_.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,w=N==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&I!=="marker-only"&&G&&!G.address&&G.geometry.type==="Point"&&G.place_type[0]!=="reverse"&&xt(G.id,{byId:!0}).catch(_=>t(19,Ge=_)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&32&&(a&&G&&G.id!==ci&&U&&(di(),O&&t(13,F=void 0),t(65,ce=void 0),t(15,Y=-1)),t(67,ci=G==null?void 0:G.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,dt=He),R&&!dt&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<b&&(t(13,F=void 0),t(19,Ge=void 0),t(65,ce=F)),i.$$.dirty[0]&8192|i.$$.dirty[1]&65536&&J&&F!=null&&F.length&&(_s()||t(15,Y=0)),i.$$.dirty[0]&57344|i.$$.dirty[1]&65536&&J&&F!=null&&F.length&&Y==-1&&!G&&t(15,Y=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&8&&ce!==F&&t(65,ce=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&8&&a&&a.setEventHandler(_=>{switch(_.type){case"mapClick":w&&xs(_.coordinates);break;case"markerClick":{const oe=F==null?void 0:F.find(ue=>ue.id===_.id);oe&&gi(oe)}break;case"markerMouseEnter":ce&&t(15,Y=dt?(F==null?void 0:F.findIndex(oe=>oe.id===_.id))??-1:-1);break;case"markerMouseLeave":ce&&t(15,Y=-1);break}}),i.$$.dirty[0]&40960&&t(68,r=F==null?void 0:F[Y]),i.$$.dirty[1]&132128|i.$$.dirty[2]&64&&a&&r&&U&&Z&&a.flyTo(r.center,Tt(r)),i.$$.dirty[1]&8192&&t(70,n=I==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&263168|i.$$.dirty[2]&256&&(K||a==null||a.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&263168|i.$$.dirty[2]&328&&a&&K&&!ce&&(a.setFeatures(r?[r]:void 0,G,n),a.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&264&&a&&a.setFeatures(ce,G,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&8&&ce&&a&&a.setSelectedMarker(Y),i.$$.dirty[2]&80&&r&&(window.clearTimeout(Ce),t(66,Ce=void 0)),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&a){const _=hi(T);a.setReverseMarker(_?[_.decimalLongitude,_.decimalLatitude]:void 0)}i.$$.dirty[2]&64&&nt("select",{feature:r}),i.$$.dirty[0]&16384&&nt("pick",{feature:G}),i.$$.dirty[0]&73744&&t(69,u=!!(F!=null&&F.length)&&(dt||A)),i.$$.dirty[2]&128&&nt("optionsvisibilitychange",{optionsVisible:u}),i.$$.dirty[0]&8192&&nt("featureslisted",{features:F}),i.$$.dirty[2]&8&&nt("featuresmarked",{features:ce}),i.$$.dirty[0]&1&&nt("reversetoggle",{reverse:w}),i.$$.dirty[0]&2&&nt("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&a&&a.indicateReverse(w)},[w,T,c,C,A,M,N,D,p,d,L,W,dn,F,G,Y,dt,He,Pe,Ge,at,Ls,pn,Ts,yn,gi,vn,Ms,g,E,S,R,O,k,y,q,U,B,s,l,m,a,b,v,I,H,te,J,Z,K,ae,et,ut,Ee,pe,fe,ie,ui,ai,fi,vs,bs,gn,ws,Es,ce,Ce,ci,r,u,n,o,h,Cs,Ns,ks,Os,Rs,Ps,Is,As,Bs,Ws,Gs,Ds,zs]}let Rr=class extends Xe{constructor(e){super(),Qe(this,e,Or,kr,Ve,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,reverseGeocodingLimit:40,mapController:41,minLength:42,noResultsMessage:8,placeholder:9,proximity:43,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:44,showPlaceType:11,showResultsWhileTyping:45,autocompleteTimeout:46,selectFirst:47,flyToSelected:48,markerOnSelected:49,types:50,reverseGeocodingTypes:51,exhaustiveReverseGeocoding:52,excludeTypes:53,reverseGeocodingExcludeTypes:54,zoom:55,apiUrl:56,fetchParameters:57,iconsBaseUrl:12,adjustUrlQuery:58,adjustUrl:59,focus:60,blur:61,setQuery:62,clearList:63,clearMap:64},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[60]}get blur(){return this.$$.ctx[61]}get setQuery(){return this.$$.ctx[62]}get clearList(){return this.$$.ctx[63]}get clearMap(){return this.$$.ctx[64]}};function wt(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function ti(i,e,t={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;u<r[r.length-1].length;u++)if(r[r.length-1][u]!==r[0][u])throw new Error("First and last Position are not equivalent.")}return wt({type:"Polygon",coordinates:i},e,t)}function Et(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function ji(i,e,t={}){return wt({type:"MultiPolygon",coordinates:i},e,t)}var Pr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ii=Math.ceil,xe=Math.floor,we="[BigNumber Error] ",Zi=we+"Number primitive has more than 15 significant digits: ",Re=1e14,z=14,Hi=9007199254740991,ni=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Je=1e7,_e=1e9;function Vi(i){var e,t,n,r=y.prototype={constructor:y,toString:null,valueOf:null},u=new y(1),h=20,o=4,g=-7,c=21,E=-1e7,S=1e7,C=!1,R=1,O=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function y(s,l){var f,m,a,b,p,d,v,w,L=this;if(!(L instanceof y))return new y(s,l);if(l==null){if(s&&s._isBigNumber===!0){L.s=s.s,!s.c||s.e>S?L.c=L.e=null:s.e<E?L.c=[L.e=0]:(L.e=s.e,L.c=s.c.slice());return}if((d=typeof s=="number")&&s*0==0){if(L.s=1/s<0?(s=-s,-1):1,s===~~s){for(b=0,p=s;p>=10;p/=10,b++);b>S?L.c=L.e=null:(L.e=b,L.c=[s]);return}w=String(s)}else{if(!Pr.test(w=String(s)))return n(L,w,d);L.s=w.charCodeAt(0)==45?(w=w.slice(1),-1):1}(b=w.indexOf("."))>-1&&(w=w.replace(".","")),(p=w.search(/e/i))>0?(b<0&&(b=p),b+=+w.slice(p+1),w=w.substring(0,p)):b<0&&(b=w.length)}else{if(se(l,2,M.length,"Base"),l==10&&k)return L=new y(s),U(L,h+L.e+1,o);if(w=String(s),d=typeof s=="number"){if(s*0!=0)return n(L,w,d,l);if(L.s=1/s<0?(w=w.slice(1),-1):1,y.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(Zi+s)}else L.s=w.charCodeAt(0)===45?(w=w.slice(1),-1):1;for(f=M.slice(0,l),b=p=0,v=w.length;p<v;p++)if(f.indexOf(m=w.charAt(p))<0){if(m=="."){if(p>b){b=v;continue}}else if(!a&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){a=!0,p=-1,b=0;continue}return n(L,String(s),d,l)}d=!1,w=t(w,l,10,L.s),(b=w.indexOf("."))>-1?w=w.replace(".",""):b=w.length}for(p=0;w.charCodeAt(p)===48;p++);for(v=w.length;w.charCodeAt(--v)===48;);if(w=w.slice(p,++v)){if(v-=p,d&&y.DEBUG&&v>15&&(s>Hi||s!==xe(s)))throw Error(Zi+L.s*s);if((b=b-p-1)>S)L.c=L.e=null;else if(b<E)L.c=[L.e=0];else{if(L.e=b,L.c=[],p=(b+1)%z,b<0&&(p+=z),p<v){for(p&&L.c.push(+w.slice(0,p)),v-=z;p<v;)L.c.push(+w.slice(p,p+=z));p=z-(w=w.slice(p)).length}else p-=v;for(;p--;w+="0");L.c.push(+w)}}else L.c=[L.e=0]}y.clone=Vi,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(s){var l,f;if(s!=null)if(typeof s=="object"){if(s.hasOwnProperty(l="DECIMAL_PLACES")&&(f=s[l],se(f,0,_e,l),h=f),s.hasOwnProperty(l="ROUNDING_MODE")&&(f=s[l],se(f,0,8,l),o=f),s.hasOwnProperty(l="EXPONENTIAL_AT")&&(f=s[l],f&&f.pop?(se(f[0],-1e9,0,l),se(f[1],0,_e,l),g=f[0],c=f[1]):(se(f,-1e9,_e,l),g=-(c=f<0?-f:f))),s.hasOwnProperty(l="RANGE"))if(f=s[l],f&&f.pop)se(f[0],-1e9,-1,l),se(f[1],1,_e,l),E=f[0],S=f[1];else if(se(f,-1e9,_e,l),f)E=-(S=f<0?-f:f);else throw Error(we+l+" cannot be zero: "+f);if(s.hasOwnProperty(l="CRYPTO"))if(f=s[l],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))C=f;else throw C=!f,Error(we+"crypto unavailable");else C=f;else throw Error(we+l+" not true or false: "+f);if(s.hasOwnProperty(l="MODULO_MODE")&&(f=s[l],se(f,0,9,l),R=f),s.hasOwnProperty(l="POW_PRECISION")&&(f=s[l],se(f,0,_e,l),O=f),s.hasOwnProperty(l="FORMAT"))if(f=s[l],typeof f=="object")A=f;else throw Error(we+l+" not an object: "+f);if(s.hasOwnProperty(l="ALPHABET"))if(f=s[l],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))k=f.slice(0,10)=="0123456789",M=f;else throw Error(we+l+" invalid: "+f)}else throw Error(we+"Object expected: "+s);return{DECIMAL_PLACES:h,ROUNDING_MODE:o,EXPONENTIAL_AT:[g,c],RANGE:[E,S],CRYPTO:C,MODULO_MODE:R,POW_PRECISION:O,FORMAT:A,ALPHABET:M}},y.isBigNumber=function(s){if(!s||s._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var l,f,m=s.c,a=s.e,b=s.s;e:if({}.toString.call(m)=="[object Array]"){if((b===1||b===-1)&&a>=-1e9&&a<=_e&&a===xe(a)){if(m[0]===0){if(a===0&&m.length===1)return!0;break e}if(l=(a+1)%z,l<1&&(l+=z),String(m[0]).length==l){for(l=0;l<m.length;l++)if(f=m[l],f<0||f>=Re||f!==xe(f))break e;if(f!==0)return!0}}}else if(m===null&&a===null&&(b===null||b===1||b===-1))return!0;throw Error(we+"Invalid BigNumber: "+s)},y.maximum=y.max=function(){return D(arguments,-1)},y.minimum=y.min=function(){return D(arguments,1)},y.random=function(){var s=9007199254740992,l=Math.random()*s&2097151?function(){return xe(Math.random()*s)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var m,a,b,p,d,v=0,w=[],L=new y(u);if(f==null?f=h:se(f,0,_e),p=ii(f/z),C)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(p*=2));v<p;)d=m[v]*131072+(m[v+1]>>>11),d>=9e15?(a=crypto.getRandomValues(new Uint32Array(2)),m[v]=a[0],m[v+1]=a[1]):(w.push(d%1e14),v+=2);v=p/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(p*=7);v<p;)d=(m[v]&31)*281474976710656+m[v+1]*1099511627776+m[v+2]*4294967296+m[v+3]*16777216+(m[v+4]<<16)+(m[v+5]<<8)+m[v+6],d>=9e15?crypto.randomBytes(7).copy(m,v):(w.push(d%1e14),v+=7);v=p/7}else throw C=!1,Error(we+"crypto unavailable");if(!C)for(;v<p;)d=l(),d<9e15&&(w[v++]=d%1e14);for(p=w[--v],f%=z,p&&f&&(d=ni[z-f],w[v]=xe(p/d)*d);w[v]===0;w.pop(),v--);if(v<0)w=[b=0];else{for(b=-1;w[0]===0;w.splice(0,1),b-=z);for(v=1,d=w[0];d>=10;d/=10,v++);v<z&&(b-=z-v)}return L.e=b,L.c=w,L}}(),y.sum=function(){for(var s=1,l=arguments,f=new y(l[0]);s<l.length;)f=f.plus(l[s++]);return f},t=function(){var s="0123456789";function l(f,m,a,b){for(var p,d=[0],v,w=0,L=f.length;w<L;){for(v=d.length;v--;d[v]*=m);for(d[0]+=b.indexOf(f.charAt(w++)),p=0;p<d.length;p++)d[p]>a-1&&(d[p+1]==null&&(d[p+1]=0),d[p+1]+=d[p]/a|0,d[p]%=a)}return d.reverse()}return function(f,m,a,b,p){var d,v,w,L,T,I,W,H,te=f.indexOf("."),J=h,Z=o;for(te>=0&&(L=O,O=0,f=f.replace(".",""),H=new y(m),I=H.pow(f.length-te),O=L,H.c=l(je(Me(I.c),I.e,"0"),10,a,s),H.e=H.c.length),W=l(f,m,a,p?(d=M,s):(d=s,M)),w=L=W.length;W[--L]==0;W.pop());if(!W[0])return d.charAt(0);if(te<0?--w:(I.c=W,I.e=w,I.s=b,I=e(I,H,J,Z,a),W=I.c,T=I.r,w=I.e),v=w+J+1,te=W[v],L=a/2,T=T||v<0||W[v+1]!=null,T=Z<4?(te!=null||T)&&(Z==0||Z==(I.s<0?3:2)):te>L||te==L&&(Z==4||T||Z==6&&W[v-1]&1||Z==(I.s<0?8:7)),v<1||!W[0])f=T?je(d.charAt(1),-J,d.charAt(0)):d.charAt(0);else{if(W.length=v,T)for(--a;++W[--v]>a;)W[v]=0,v||(++w,W=[1].concat(W));for(L=W.length;!W[--L];);for(te=0,f="";te<=L;f+=d.charAt(W[te++]));f=je(f,w,d.charAt(0))}return f}}(),e=function(){function s(m,a,b){var p,d,v,w,L=0,T=m.length,I=a%Je,W=a/Je|0;for(m=m.slice();T--;)v=m[T]%Je,w=m[T]/Je|0,p=W*v+w*I,d=I*v+p%Je*Je+L,L=(d/b|0)+(p/Je|0)+W*w,m[T]=d%b;return L&&(m=[L].concat(m)),m}function l(m,a,b,p){var d,v;if(b!=p)v=b>p?1:-1;else for(d=v=0;d<b;d++)if(m[d]!=a[d]){v=m[d]>a[d]?1:-1;break}return v}function f(m,a,b,p){for(var d=0;b--;)m[b]-=d,d=m[b]<a[b]?1:0,m[b]=d*p+m[b]-a[b];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,a,b,p,d){var v,w,L,T,I,W,H,te,J,Z,K,ae,lt,et,ut,Ee,tt,pe=m.s==a.s?1:-1,fe=m.c,ie=a.c;if(!fe||!fe[0]||!ie||!ie[0])return new y(!m.s||!a.s||(fe?ie&&fe[0]==ie[0]:!ie)?NaN:fe&&fe[0]==0||!ie?pe*0:pe/0);for(te=new y(pe),J=te.c=[],w=m.e-a.e,pe=b+w+1,d||(d=Re,w=Te(m.e/z)-Te(a.e/z),pe=pe/z|0),L=0;ie[L]==(fe[L]||0);L++);if(ie[L]>(fe[L]||0)&&w--,pe<0)J.push(1),T=!0;else{for(et=fe.length,Ee=ie.length,L=0,pe+=2,I=xe(d/(ie[0]+1)),I>1&&(ie=s(ie,I,d),fe=s(fe,I,d),Ee=ie.length,et=fe.length),lt=Ee,Z=fe.slice(0,Ee),K=Z.length;K<Ee;Z[K++]=0);tt=ie.slice(),tt=[0].concat(tt),ut=ie[0],ie[1]>=d/2&&ut++;do{if(I=0,v=l(ie,Z,Ee,K),v<0){if(ae=Z[0],Ee!=K&&(ae=ae*d+(Z[1]||0)),I=xe(ae/ut),I>1)for(I>=d&&(I=d-1),W=s(ie,I,d),H=W.length,K=Z.length;l(W,Z,H,K)==1;)I--,f(W,Ee<H?tt:ie,H,d),H=W.length,v=1;else I==0&&(v=I=1),W=ie.slice(),H=W.length;if(H<K&&(W=[0].concat(W)),f(Z,W,K,d),K=Z.length,v==-1)for(;l(ie,Z,Ee,K)<1;)I++,f(Z,Ee<K?tt:ie,K,d),K=Z.length}else v===0&&(I++,Z=[0]);J[L++]=I,Z[0]?Z[K++]=fe[lt]||0:(Z=[fe[lt]],K=1)}while((lt++<et||Z[0]!=null)&&pe--);T=Z[0]!=null,J[0]||J.splice(0,1)}if(d==Re){for(L=1,pe=J[0];pe>=10;pe/=10,L++);U(te,b+(te.e=L+w*z-1)+1,p,T)}else te.e=w,te.r=+T;return te}}();function N(s,l,f,m){var a,b,p,d,v;if(f==null?f=o:se(f,0,8),!s.c)return s.toString();if(a=s.c[0],p=s.e,l==null)v=Me(s.c),v=m==1||m==2&&(p<=g||p>=c)?Dt(v,p):je(v,p,"0");else if(s=U(new y(s),l,f),b=s.e,v=Me(s.c),d=v.length,m==1||m==2&&(l<=b||b<=g)){for(;d<l;v+="0",d++);v=Dt(v,b)}else if(l-=p,v=je(v,b,"0"),b+1>d){if(--l>0)for(v+=".";l--;v+="0");}else if(l+=b-d,l>0)for(b+1==d&&(v+=".");l--;v+="0");return s.s<0&&a?"-"+v:v}function D(s,l){for(var f,m,a=1,b=new y(s[0]);a<s.length;a++)m=new y(s[a]),(!m.s||(f=ot(b,m))===l||f===0&&b.s===l)&&(b=m);return b}function q(s,l,f){for(var m=1,a=l.length;!l[--a];l.pop());for(a=l[0];a>=10;a/=10,m++);return(f=m+f*z-1)>S?s.c=s.e=null:f<E?s.c=[s.e=0]:(s.e=f,s.c=l),s}n=function(){var s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,f=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,a=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(b,p,d,v){var w,L=d?p:p.replace(a,"");if(m.test(L))b.s=isNaN(L)?null:L<0?-1:1;else{if(!d&&(L=L.replace(s,function(T,I,W){return w=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!v||v==w?I:T}),v&&(w=v,L=L.replace(l,"$1").replace(f,"0.$1")),p!=L))return new y(L,w);if(y.DEBUG)throw Error(we+"Not a"+(v?" base "+v:"")+" number: "+p);b.s=null}b.c=b.e=null}}();function U(s,l,f,m){var a,b,p,d,v,w,L,T=s.c,I=ni;if(T){e:{for(a=1,d=T[0];d>=10;d/=10,a++);if(b=l-a,b<0)b+=z,p=l,v=T[w=0],L=xe(v/I[a-p-1]%10);else if(w=ii((b+1)/z),w>=T.length)if(m){for(;T.length<=w;T.push(0));v=L=0,a=1,b%=z,p=b-z+1}else break e;else{for(v=d=T[w],a=1;d>=10;d/=10,a++);b%=z,p=b-z+a,L=p<0?0:xe(v/I[a-p-1]%10)}if(m=m||l<0||T[w+1]!=null||(p<0?v:v%I[a-p-1]),m=f<4?(L||m)&&(f==0||f==(s.s<0?3:2)):L>5||L==5&&(f==4||m||f==6&&(b>0?p>0?v/I[a-p]:0:T[w-1])%10&1||f==(s.s<0?8:7)),l<1||!T[0])return T.length=0,m?(l-=s.e+1,T[0]=I[(z-l%z)%z],s.e=-l||0):T[0]=s.e=0,s;if(b==0?(T.length=w,d=1,w--):(T.length=w+1,d=I[z-b],T[w]=p>0?xe(v/I[a-p]%I[p])*d:0),m)for(;;)if(w==0){for(b=1,p=T[0];p>=10;p/=10,b++);for(p=T[0]+=d,d=1;p>=10;p/=10,d++);b!=d&&(s.e++,T[0]==Re&&(T[0]=1));break}else{if(T[w]+=d,T[w]!=Re)break;T[w--]=0,d=1}for(b=T.length;T[--b]===0;T.pop());}s.e>S?s.c=s.e=null:s.e<E&&(s.c=[s.e=0])}return s}function B(s){var l,f=s.e;return f===null?s.toString():(l=Me(s.c),l=f<=g||f>=c?Dt(l,f):je(l,f,"0"),s.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var s=new y(this);return s.s<0&&(s.s=1),s},r.comparedTo=function(s,l){return ot(this,new y(s,l))},r.decimalPlaces=r.dp=function(s,l){var f,m,a,b=this;if(s!=null)return se(s,0,_e),l==null?l=o:se(l,0,8),U(new y(b),s+b.e+1,l);if(!(f=b.c))return null;if(m=((a=f.length-1)-Te(this.e/z))*z,a=f[a])for(;a%10==0;a/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(s,l){return e(this,new y(s,l),h,o)},r.dividedToIntegerBy=r.idiv=function(s,l){return e(this,new y(s,l),0,1)},r.exponentiatedBy=r.pow=function(s,l){var f,m,a,b,p,d,v,w,L,T=this;if(s=new y(s),s.c&&!s.isInteger())throw Error(we+"Exponent not an integer: "+B(s));if(l!=null&&(l=new y(l)),d=s.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!s.c||!s.c[0])return L=new y(Math.pow(+B(T),d?s.s*(2-Gt(s)):+B(s))),l?L.mod(l):L;if(v=s.s<0,l){if(l.c?!l.c[0]:!l.s)return new y(NaN);m=!v&&T.isInteger()&&l.isInteger(),m&&(T=T.mod(l))}else{if(s.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||d&&T.c[1]>=24e7:T.c[0]<8e13||d&&T.c[0]<=9999975e7)))return b=T.s<0&&Gt(s)?-0:0,T.e>-1&&(b=1/b),new y(v?1/b:b);O&&(b=ii(O/z+2))}for(d?(f=new y(.5),v&&(s.s=1),w=Gt(s)):(a=Math.abs(+B(s)),w=a%2),L=new y(u);;){if(w){if(L=L.times(T),!L.c)break;b?L.c.length>b&&(L.c.length=b):m&&(L=L.mod(l))}if(a){if(a=xe(a/2),a===0)break;w=a%2}else if(s=s.times(f),U(s,s.e+1,1),s.e>14)w=Gt(s);else{if(a=+B(s),a===0)break;w=a%2}T=T.times(T),b?T.c&&T.c.length>b&&(T.c.length=b):m&&(T=T.mod(l))}return m?L:(v&&(L=u.div(L)),l?L.mod(l):b?U(L,O,o,p):L)},r.integerValue=function(s){var l=new y(this);return s==null?s=o:se(s,0,8),U(l,l.e+1,s)},r.isEqualTo=r.eq=function(s,l){return ot(this,new y(s,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(s,l){return ot(this,new y(s,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(s,l){return(l=ot(this,new y(s,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Te(this.e/z)>this.c.length-2},r.isLessThan=r.lt=function(s,l){return ot(this,new y(s,l))<0},r.isLessThanOrEqualTo=r.lte=function(s,l){return(l=ot(this,new y(s,l)))===-1||l===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(s,l){var f,m,a,b,p=this,d=p.s;if(s=new y(s,l),l=s.s,!d||!l)return new y(NaN);if(d!=l)return s.s=-l,p.plus(s);var v=p.e/z,w=s.e/z,L=p.c,T=s.c;if(!v||!w){if(!L||!T)return L?(s.s=-l,s):new y(T?p:NaN);if(!L[0]||!T[0])return T[0]?(s.s=-l,s):new y(L[0]?p:o==3?-0:0)}if(v=Te(v),w=Te(w),L=L.slice(),d=v-w){for((b=d<0)?(d=-d,a=L):(w=v,a=T),a.reverse(),l=d;l--;a.push(0));a.reverse()}else for(m=(b=(d=L.length)<(l=T.length))?d:l,d=l=0;l<m;l++)if(L[l]!=T[l]){b=L[l]<T[l];break}if(b&&(a=L,L=T,T=a,s.s=-s.s),l=(m=T.length)-(f=L.length),l>0)for(;l--;L[f++]=0);for(l=Re-1;m>d;){if(L[--m]<T[m]){for(f=m;f&&!L[--f];L[f]=l);--L[f],L[m]+=Re}L[m]-=T[m]}for(;L[0]==0;L.splice(0,1),--w);return L[0]?q(s,L,w):(s.s=o==3?-1:1,s.c=[s.e=0],s)},r.modulo=r.mod=function(s,l){var f,m,a=this;return s=new y(s,l),!a.c||!s.s||s.c&&!s.c[0]?new y(NaN):!s.c||a.c&&!a.c[0]?new y(a):(R==9?(m=s.s,s.s=1,f=e(a,s,0,3),s.s=m,f.s*=m):f=e(a,s,0,R),s=a.minus(f.times(s)),!s.c[0]&&R==1&&(s.s=a.s),s)},r.multipliedBy=r.times=function(s,l){var f,m,a,b,p,d,v,w,L,T,I,W,H,te,J,Z=this,K=Z.c,ae=(s=new y(s,l)).c;if(!K||!ae||!K[0]||!ae[0])return!Z.s||!s.s||K&&!K[0]&&!ae||ae&&!ae[0]&&!K?s.c=s.e=s.s=null:(s.s*=Z.s,!K||!ae?s.c=s.e=null:(s.c=[0],s.e=0)),s;for(m=Te(Z.e/z)+Te(s.e/z),s.s*=Z.s,v=K.length,T=ae.length,v<T&&(H=K,K=ae,ae=H,a=v,v=T,T=a),a=v+T,H=[];a--;H.push(0));for(te=Re,J=Je,a=T;--a>=0;){for(f=0,I=ae[a]%J,W=ae[a]/J|0,p=v,b=a+p;b>a;)w=K[--p]%J,L=K[p]/J|0,d=W*w+L*I,w=I*w+d%J*J+H[b]+f,f=(w/te|0)+(d/J|0)+W*L,H[b--]=w%te;H[b]=f}return f?++m:H.splice(0,1),q(s,H,m)},r.negated=function(){var s=new y(this);return s.s=-s.s||null,s},r.plus=function(s,l){var f,m=this,a=m.s;if(s=new y(s,l),l=s.s,!a||!l)return new y(NaN);if(a!=l)return s.s=-l,m.minus(s);var b=m.e/z,p=s.e/z,d=m.c,v=s.c;if(!b||!p){if(!d||!v)return new y(a/0);if(!d[0]||!v[0])return v[0]?s:new y(d[0]?m:a*0)}if(b=Te(b),p=Te(p),d=d.slice(),a=b-p){for(a>0?(p=b,f=v):(a=-a,f=d),f.reverse();a--;f.push(0));f.reverse()}for(a=d.length,l=v.length,a-l<0&&(f=v,v=d,d=f,l=a),a=0;l;)a=(d[--l]=d[l]+v[l]+a)/Re|0,d[l]=Re===d[l]?0:d[l]%Re;return a&&(d=[a].concat(d),++p),q(s,d,p)},r.precision=r.sd=function(s,l){var f,m,a,b=this;if(s!=null&&s!==!!s)return se(s,1,_e),l==null?l=o:se(l,0,8),U(new y(b),s,l);if(!(f=b.c))return null;if(a=f.length-1,m=a*z+1,a=f[a]){for(;a%10==0;a/=10,m--);for(a=f[0];a>=10;a/=10,m++);}return s&&b.e+1>m&&(m=b.e+1),m},r.shiftedBy=function(s){return se(s,-9007199254740991,Hi),this.times("1e"+s)},r.squareRoot=r.sqrt=function(){var s,l,f,m,a,b=this,p=b.c,d=b.s,v=b.e,w=h+4,L=new y("0.5");if(d!==1||!p||!p[0])return new y(!d||d<0&&(!p||p[0])?NaN:p?b:1/0);if(d=Math.sqrt(+B(b)),d==0||d==1/0?(l=Me(p),(l.length+v)%2==0&&(l+="0"),d=Math.sqrt(+l),v=Te((v+1)/2)-(v<0||v%2),d==1/0?l="5e"+v:(l=d.toExponential(),l=l.slice(0,l.indexOf("e")+1)+v),f=new y(l)):f=new y(d+""),f.c[0]){for(v=f.e,d=v+w,d<3&&(d=0);;)if(a=f,f=L.times(a.plus(e(b,a,w,1))),Me(a.c).slice(0,d)===(l=Me(f.c)).slice(0,d))if(f.e<v&&--d,l=l.slice(d-3,d+1),l=="9999"||!m&&l=="4999"){if(!m&&(U(a,a.e+h+2,0),a.times(a).eq(b))){f=a;break}w+=4,d+=4,m=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(U(f,f.e+h+2,1),s=!f.times(f).eq(b));break}}return U(f,f.e+h+1,o,s)},r.toExponential=function(s,l){return s!=null&&(se(s,0,_e),s++),N(this,s,l,1)},r.toFixed=function(s,l){return s!=null&&(se(s,0,_e),s=s+this.e+1),N(this,s,l)},r.toFormat=function(s,l,f){var m,a=this;if(f==null)s!=null&&l&&typeof l=="object"?(f=l,l=null):s&&typeof s=="object"?(f=s,s=l=null):f=A;else if(typeof f!="object")throw Error(we+"Argument not an object: "+f);if(m=a.toFixed(s,l),a.c){var b,p=m.split("."),d=+f.groupSize,v=+f.secondaryGroupSize,w=f.groupSeparator||"",L=p[0],T=p[1],I=a.s<0,W=I?L.slice(1):L,H=W.length;if(v&&(b=d,d=v,v=b,H-=b),d>0&&H>0){for(b=H%d||d,L=W.substr(0,b);b<H;b+=d)L+=w+W.substr(b,d);v>0&&(L+=w+W.slice(b)),I&&(L="-"+L)}m=T?L+(f.decimalSeparator||"")+((v=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+v+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):L}return(f.prefix||"")+m+(f.suffix||"")},r.toFraction=function(s){var l,f,m,a,b,p,d,v,w,L,T,I,W=this,H=W.c;if(s!=null&&(d=new y(s),!d.isInteger()&&(d.c||d.s!==1)||d.lt(u)))throw Error(we+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+B(d));if(!H)return new y(W);for(l=new y(u),w=f=new y(u),m=v=new y(u),I=Me(H),b=l.e=I.length-W.e-1,l.c[0]=ni[(p=b%z)<0?z+p:p],s=!s||d.comparedTo(l)>0?b>0?l:w:d,p=S,S=1/0,d=new y(I),v.c[0]=0;L=e(d,l,0,1),a=f.plus(L.times(m)),a.comparedTo(s)!=1;)f=m,m=a,w=v.plus(L.times(a=w)),v=a,l=d.minus(L.times(a=l)),d=a;return a=e(s.minus(f),m,0,1),v=v.plus(a.times(w)),f=f.plus(a.times(m)),v.s=w.s=W.s,b=b*2,T=e(w,m,b,o).minus(W).abs().comparedTo(e(v,f,b,o).minus(W).abs())<1?[w,m]:[v,f],S=p,T},r.toNumber=function(){return+B(this)},r.toPrecision=function(s,l){return s!=null&&se(s,1,_e),N(this,s,l,2)},r.toString=function(s){var l,f=this,m=f.s,a=f.e;return a===null?m?(l="Infinity",m<0&&(l="-"+l)):l="NaN":(s==null?l=a<=g||a>=c?Dt(Me(f.c),a):je(Me(f.c),a,"0"):s===10&&k?(f=U(new y(f),h+a+1,o),l=je(Me(f.c),f.e,"0")):(se(s,2,M.length,"Base"),l=t(je(Me(f.c),a,"0"),10,s,m,!0)),m<0&&f.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return B(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&y.set(i),y}function Te(i){var e=i|0;return i>0||i===e?e:e-1}function Me(i){for(var e,t,n=1,r=i.length,u=i[0]+"";n<r;){for(e=i[n++]+"",t=z-e.length;t--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function ot(i,e){var t,n,r=i.c,u=e.c,h=i.s,o=e.s,g=i.e,c=e.e;if(!h||!o)return null;if(t=r&&!r[0],n=u&&!u[0],t||n)return t?n?0:-o:h;if(h!=o)return h;if(t=h<0,n=g==c,!r||!u)return n?0:!r^t?1:-1;if(!n)return g>c^t?1:-1;for(o=(g=r.length)<(c=u.length)?g:c,h=0;h<o;h++)if(r[h]!=u[h])return r[h]>u[h]^t?1:-1;return g==c?0:g>c^t?1:-1}function se(i,e,t,n){if(i<e||i>t||i!==xe(i))throw Error(we+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function Gt(i){var e=i.c.length-1;return Te(i.e/z)==e&&i.c[e]%2!=0}function Dt(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function je(i,e,t){var n,r;if(e<0){for(r=t+".";++e;r+=t);i=r+i}else if(n=i.length,++e>n){for(r=t,e-=n;--e;r+=t);i+=r}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Be=Vi(),Ir=class{constructor(i){P(this,"key");P(this,"left",null);P(this,"right",null);this.key=i}},Lt=class extends Ir{constructor(i){super(i)}},Ar=class{constructor(){P(this,"size",0);P(this,"modificationCount",0);P(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,r=null,u=null,h=e;const o=this.compare;let g;for(;;)if(g=o(h.key,i),g>0){let c=h.left;if(c==null||(g=o(c.key,i),g>0&&(h.left=c.right,c.right=h,h=c,c=h.left,c==null)))break;t==null?n=h:t.left=h,t=h,h=c}else if(g<0){let c=h.right;if(c==null||(g=o(c.key,i),g<0&&(h.right=c.left,c.left=h,h=c,c=h.right,c==null)))break;r==null?u=h:r.right=h,r=h,h=c}else break;return r!=null&&(r.right=h.left,h.left=u),t!=null&&(t.left=h.right,h.right=n),this.root!==h&&(this.root=h,this.splayCount++),g}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,r=t.left;if(this.size--,r==null)this.root=t.right;else{const u=t.right;t=this.splayMax(r),t.right=u,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},zt=class kt extends Ar{constructor(t,n){super();P(this,"root",null);P(this,"compare");P(this,"validKey");P(this,cn,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(r=>r!=null&&r!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let r;for(;r=n.next(),!r.done;)t(r.value,r.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new Lt(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new Lt(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}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(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let r=this.root.left;if(r==null)return null;let u=r.right;for(;u!=null;)r=u,u=r.right;return r.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let r=this.root.right;if(r==null)return null;let u=r.left;for(;u!=null;)r=u,u=r.left;return r.key}retainAll(t){const n=new kt(this.compare,this.validKey),r=this.modificationCount;for(const u of t){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(u)&&this.splay(u)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new kt(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new kt(this.compare,this.validKey);for(const r of this)t.has(r)||n.add(r);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new kt(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(u,h){let o,g;do{if(o=u.left,g=u.right,o!=null){const c=new Lt(o.key);h.left=c,n(o,c)}if(g!=null){const c=new Lt(g.key);h.right=c,u=g,h=c}}while(g!=null)}const r=new Lt(t.key);return n(t,r),r}toSet(){return this.clone()}entries(){return new Wr(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(hn=Symbol.iterator,cn=Symbol.toStringTag,hn)](){return new Br(this.wrap())}},Ki=class{constructor(i){P(this,"tree");P(this,"path",new Array);P(this,"modificationCount",null);P(this,"splayCount");this.tree=i,this.splayCount=i.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 i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.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 i=this.path[this.path.length-1],e=i.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===i;)i=this.path.pop();return this.path.length>0}},Br=class extends Ki{getValue(i){return i.key}},Wr=class extends Ki{getValue(i){return[i.key,i.key]}},Yi=i=>()=>i,ri=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):Yi(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function Gr(i){const e=i?(t,n,r,u,h)=>t.exponentiatedBy(2).isLessThanOrEqualTo(u.minus(n).exponentiatedBy(2).plus(h.minus(r).exponentiatedBy(2)).times(i)):Yi(!1);return(t,n,r)=>{const u=t.x,h=t.y,o=r.x,g=r.y,c=h.minus(g).times(n.x.minus(o)).minus(u.minus(o).times(n.y.minus(g)));return e(c,u,h,o,g)?0:c.comparedTo(0)}}var Dr=i=>i,zr=i=>{if(i){const e=new zt(ri(i)),t=new zt(ri(i)),n=(u,h)=>h.addAndReturn(u),r=u=>({x:n(u.x,e),y:n(u.y,t)});return r({x:new Be(0),y:new Be(0)}),r}return Dr},si=i=>({set:e=>{Ze=si(e)},reset:()=>si(i),compare:ri(i),snap:zr(i),orient:Gr(i)}),Ze=si(),_t=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),oi=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,r=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,u=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:u}}},Ut=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),Qi=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),qt=i=>Qi(i,i).sqrt(),Ur=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Ut(r,n).div(qt(r)).div(qt(n))},qr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Qi(r,n).div(qt(r)).div(qt(n))},Xi=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},Ji=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},Fr=(i,e,t,n)=>{if(e.x.isZero())return Ji(t,n,i.x);if(n.x.isZero())return Ji(i,e,t.x);if(e.y.isZero())return Xi(t,n,i.y);if(n.y.isZero())return Xi(i,e,t.y);const r=Ut(e,n);if(r.isZero())return null;const u={x:t.x.minus(i.x),y:t.y.minus(i.y)},h=Ut(u,e).div(r),o=Ut(u,n).div(r),g=i.x.plus(o.times(e.x)),c=t.x.plus(h.times(n.x)),E=i.y.plus(o.times(e.y)),S=t.y.plus(h.times(n.y)),C=g.plus(c).div(2),R=E.plus(S).div(2);return{x:C,y:R}},We=class _n{constructor(e,t){P(this,"point");P(this,"isLeft");P(this,"segment");P(this,"otherSE");P(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}static compare(e,t){const n=_n.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:jt.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}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const u=t[n];this.point.events.push(u),u.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const u=this.point.events[r];u.consumedBy===void 0&&n.otherSE.point.events===u.otherSE.point.events&&n.segment.consume(u.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const u=r.otherSE;t.set(r,{sine:Ur(this.point,e.point,u.point),cosine:qr(this.point,e.point,u.point)})};return(r,u)=>{t.has(r)||n(r),t.has(u)||n(u);const{sine:h,cosine:o}=t.get(r),{sine:g,cosine:c}=t.get(u);return h.isGreaterThanOrEqualTo(0)&&g.isGreaterThanOrEqualTo(0)?o.isLessThan(c)?1:o.isGreaterThan(c)?-1:0:h.isLessThan(0)&&g.isLessThan(0)?o.isLessThan(c)?-1:o.isGreaterThan(c)?1:0:g.isLessThan(h)?-1:g.isGreaterThan(h)?1:0}}},jr=class vi{constructor(e){P(this,"events");P(this,"poly");P(this,"_isExteriorRing");P(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const u=e[n];if(!u.isInResult()||u.ringOut)continue;let h=null,o=u.leftSE,g=u.rightSE;const c=[o],E=o.point,S=[];for(;h=o,o=g,c.push(o),o.point!==E;)for(;;){const C=o.getAvailableLinkedEvents();if(C.length===0){const A=c[0].point,M=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${A.x}, ${A.y}]. Last matching segment found ends at [${M.x}, ${M.y}].`)}if(C.length===1){g=C[0].otherSE;break}let R=null;for(let A=0,M=S.length;A<M;A++)if(S[A].point===o.point){R=A;break}if(R!==null){const A=S.splice(R)[0],M=c.splice(A.index);M.unshift(M[0].otherSE),t.push(new vi(M.reverse()));continue}S.push({index:c.length,point:o.point});const O=o.getLeftmostComparator(h);g=C.sort(O)[0].otherSE;break}t.push(new vi(c))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let c=1,E=this.events.length-1;c<E;c++){const S=this.events[c].point,C=this.events[c+1].point;Ze.orient(S,e,C)!==0&&(t.push(S),e=S)}if(t.length===1)return null;const n=t[0],r=t[1];Ze.orient(n,e,r)===0&&t.shift(),t.push(t[0]);const u=this.isExteriorRing()?1:-1,h=this.isExteriorRing()?0:t.length-1,o=this.isExteriorRing()?t.length:-1,g=[];for(let c=h;c!=o;c+=u)g.push([t[c].x.toNumber(),t[c].y.toNumber()]);return g}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(){var r,u;let e=this.events[0];for(let h=1,o=this.events.length;h<o;h++){const g=this.events[h];We.compare(e,g)>0&&(e=g)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return((r=n.ringOut)==null?void 0:r.enclosingRing())!==t.ringOut?t.ringOut:(u=t.ringOut)==null?void 0:u.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},$i=class{constructor(i){P(this,"exteriorRing");P(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}},Zr=class{constructor(i){P(this,"rings");P(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,r=i.length;n<r;n++){const u=i[n];if(!u.poly)if(u.isExteriorRing())e.push(new $i(u));else{const h=u.enclosingRing();h!=null&&h.poly||e.push(new $i(h)),(t=h==null?void 0:h.poly)==null||t.addInterior(u)}}return e}},Hr=class{constructor(i,e=jt.compare){P(this,"queue");P(this,"tree");P(this,"segments");this.queue=i,this.tree=new zt(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,r=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do r=this.tree.firstAfter(r);while(r!=null&&r.consumedBy!=null);if(i.isLeft){let u=null;if(n){const o=n.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(u=o),!n.isAnEndpoint(o))){const g=this._splitSafely(n,o);for(let c=0,E=g.length;c<E;c++)t.push(g[c])}}let h=null;if(r){const o=r.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(h=o),!r.isAnEndpoint(o))){const g=this._splitSafely(r,o);for(let c=0,E=g.length;c<E;c++)t.push(g[c])}}if(u!==null||h!==null){let o=null;u===null?o=h:h===null?o=u:o=We.comparePoints(u,h)<=0?u:h,this.queue.delete(e.rightSE),t.push(e.rightSE);const g=e.split(o);for(let c=0,E=g.length;c<E;c++)t.push(g[c])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&r){const u=n.getIntersection(r);if(u!==null){if(!n.isAnEndpoint(u)){const h=this._splitSafely(n,u);for(let o=0,g=h.length;o<g;o++)t.push(h[o])}if(!r.isAnEndpoint(u)){const h=this._splitSafely(r,u);for(let o=0,g=h.length;o<g;o++)t.push(h[o])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},Vr=class{constructor(){P(this,"type");P(this,"numMultiPolys")}run(i,e,t){St.type=i;const n=[new tn(e,!0)];for(let c=0,E=t.length;c<E;c++)n.push(new tn(t[c],!1));if(St.numMultiPolys=n.length,St.type==="difference"){const c=n[0];let E=1;for(;E<n.length;)oi(n[E].bbox,c.bbox)!==null?E++:n.splice(E,1)}if(St.type==="intersection")for(let c=0,E=n.length;c<E;c++){const S=n[c];for(let C=c+1,R=n.length;C<R;C++)if(oi(S.bbox,n[C].bbox)===null)return[]}const r=new zt(We.compare);for(let c=0,E=n.length;c<E;c++){const S=n[c].getSweepEvents();for(let C=0,R=S.length;C<R;C++)r.add(S[C])}const u=new Hr(r);let h=null;for(r.size!=0&&(h=r.first(),r.delete(h));h;){const c=u.process(h);for(let E=0,S=c.length;E<S;E++){const C=c[E];C.consumedBy===void 0&&r.add(C)}r.size!=0?(h=r.first(),r.delete(h)):h=null}Ze.reset();const o=jr.factory(u.segments);return new Zr(o).getGeom()}},St=new Vr,Ft=St,Kr=0,jt=class Kt{constructor(e,t,n,r){P(this,"id");P(this,"leftSE");P(this,"rightSE");P(this,"rings");P(this,"windings");P(this,"ringOut");P(this,"consumedBy");P(this,"prev");P(this,"_prevInResult");P(this,"_beforeState");P(this,"_afterState");P(this,"_isInResult");this.id=++Kr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,u=e.rightSE.point.x,h=t.rightSE.point.x;if(h.isLessThan(n))return 1;if(u.isLessThan(r))return-1;const o=e.leftSE.point.y,g=t.leftSE.point.y,c=e.rightSE.point.y,E=t.rightSE.point.y;if(n.isLessThan(r)){if(g.isLessThan(o)&&g.isLessThan(c))return 1;if(g.isGreaterThan(o)&&g.isGreaterThan(c))return-1;const S=e.comparePoint(t.leftSE.point);if(S<0)return 1;if(S>0)return-1;const C=t.comparePoint(e.rightSE.point);return C!==0?C:-1}if(n.isGreaterThan(r)){if(o.isLessThan(g)&&o.isLessThan(E))return-1;if(o.isGreaterThan(g)&&o.isGreaterThan(E))return 1;const S=t.comparePoint(e.leftSE.point);if(S!==0)return S;const C=e.comparePoint(t.rightSE.point);return C<0?1:C>0?-1:1}if(o.isLessThan(g))return-1;if(o.isGreaterThan(g))return 1;if(u.isLessThan(h)){const S=t.comparePoint(e.rightSE.point);if(S!==0)return S}if(u.isGreaterThan(h)){const S=e.comparePoint(t.rightSE.point);if(S<0)return 1;if(S>0)return-1}if(!u.eq(h)){const S=c.minus(o),C=u.minus(n),R=E.minus(g),O=h.minus(r);if(S.isGreaterThan(C)&&R.isLessThan(O))return 1;if(S.isLessThan(C)&&R.isGreaterThan(O))return-1}return u.isGreaterThan(h)?1:u.isLessThan(h)||c.isLessThan(E)?-1:c.isGreaterThan(E)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,u,h;const o=We.comparePoints(e,t);if(o<0)r=e,u=t,h=1;else if(o>0)r=t,u=e,h=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const g=new We(r,!0),c=new We(u,!1);return new Kt(g,c,[n],[h])}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 Ze.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=oi(t,n);if(r===null)return null;const u=this.leftSE.point,h=this.rightSE.point,o=e.leftSE.point,g=e.rightSE.point,c=_t(t,o)&&this.comparePoint(o)===0,E=_t(n,u)&&e.comparePoint(u)===0,S=_t(t,g)&&this.comparePoint(g)===0,C=_t(n,h)&&e.comparePoint(h)===0;if(E&&c)return C&&!S?h:!C&&S?g:null;if(E)return S&&u.x.eq(g.x)&&u.y.eq(g.y)?null:u;if(c)return C&&h.x.eq(o.x)&&h.y.eq(o.y)?null:o;if(C&&S)return null;if(C)return h;if(S)return g;const R=Fr(u,this.vector(),o,e.vector());return R===null||!_t(r,R)?null:Ze.snap(R)}split(e){const t=[],n=e.events!==void 0,r=new We(e,!0),u=new We(e,!1),h=this.rightSE;this.replaceRightSE(u),t.push(u),t.push(r);const o=new Kt(r,h,this.rings.slice(),this.windings.slice());return We.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),We.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),u.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,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=Kt.compare(t,n);if(r!==0){if(r>0){const u=t;t=n,n=u}if(t.prev===n){const u=t;t=n,n=u}for(let u=0,h=n.rings.length;u<h;u++){const o=n.rings[u],g=n.windings[u],c=t.rings.indexOf(o);c===-1?(t.rings.push(o),t.windings.push(g)):t.windings[c]+=g}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.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,n=this._afterState.windings,r=this._afterState.multiPolys;for(let o=0,g=this.rings.length;o<g;o++){const c=this.rings[o],E=this.windings[o],S=t.indexOf(c);S===-1?(t.push(c),n.push(E)):n[S]+=E}const u=[],h=[];for(let o=0,g=t.length;o<g;o++){if(n[o]===0)continue;const c=t[o],E=c.poly;if(h.indexOf(E)===-1)if(c.isExterior)u.push(E);else{h.indexOf(E)===-1&&h.push(E);const S=u.indexOf(c.poly);S!==-1&&u.splice(S,1)}}for(let o=0,g=u.length;o<g;o++){const c=u[o].multiPoly;r.indexOf(c)===-1&&r.push(c)}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(Ft.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===Ft.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}}return this._isInResult}},en=class{constructor(i,e,t){P(this,"poly");P(this,"isExterior");P(this,"segments");P(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=Ze.snap({x:new Be(i[0][0]),y:new Be(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let u=1,h=i.length;u<h;u++){if(typeof i[u][0]!="number"||typeof i[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Ze.snap({x:new Be(i[u][0]),y:new Be(i[u][1])});o.x.eq(r.x)&&o.y.eq(r.y)||(this.segments.push(jt.fromRing(r,o,this)),o.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=o.x),o.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=o.y),o.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=o.x),o.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=o.y),r=o)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(jt.fromRing(r,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},Yr=class{constructor(i,e){P(this,"multiPoly");P(this,"exteriorRing");P(this,"interiorRings");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new en(i[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,n=i.length;t<n;t++){const r=new en(i[t],this,!1);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},tn=class{constructor(i,e){P(this,"isSubject");P(this,"polys");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:new Be(Number.POSITIVE_INFINITY),y:new Be(Number.POSITIVE_INFINITY)},ur:{x:new Be(Number.NEGATIVE_INFINITY),y:new Be(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const r=new Yr(i[t],this);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},Qr=(i,...e)=>Ft.run("union",i,e),Xr=(i,...e)=>Ft.run("difference",i,e);Ze.set;function nn(i,e,t){if(i!==null)for(var n,r,u,h,o,g,c,E=0,S=0,C,R=i.type,O=R==="FeatureCollection",A=R==="Feature",M=O?i.features.length:1,k=0;k<M;k++){c=O?i.features[k].geometry:A?i.geometry:i,C=c?c.type==="GeometryCollection":!1,o=C?c.geometries.length:1;for(var y=0;y<o;y++){var N=0,D=0;if(h=C?c.geometries[y]:c,h!==null){g=h.coordinates;var q=h.type;switch(E=0,q){case null:break;case"Point":if(e(g,S,k,N,D)===!1)return!1;S++,N++;break;case"LineString":case"MultiPoint":for(n=0;n<g.length;n++){if(e(g[n],S,k,N,D)===!1)return!1;S++,q==="MultiPoint"&&N++}q==="LineString"&&N++;break;case"Polygon":case"MultiLineString":for(n=0;n<g.length;n++){for(r=0;r<g[n].length-E;r++){if(e(g[n][r],S,k,N,D)===!1)return!1;S++}q==="MultiLineString"&&N++,q==="Polygon"&&D++}q==="Polygon"&&N++;break;case"MultiPolygon":for(n=0;n<g.length;n++){for(D=0,r=0;r<g[n].length;r++){for(u=0;u<g[n][r].length-E;u++){if(e(g[n][r][u],S,k,N,D)===!1)return!1;S++}D++}N++}break;case"GeometryCollection":for(n=0;n<h.geometries.length;n++)if(nn(h.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function li(i,e){var t,n,r,u,h,o,g,c,E,S,C=0,R=i.type==="FeatureCollection",O=i.type==="Feature",A=R?i.features.length:1;for(t=0;t<A;t++){for(o=R?i.features[t].geometry:O?i.geometry:i,c=R?i.features[t].properties:O?i.properties:{},E=R?i.features[t].bbox:O?i.bbox:void 0,S=R?i.features[t].id:O?i.id:void 0,g=o?o.type==="GeometryCollection":!1,h=g?o.geometries.length:1,r=0;r<h;r++){if(u=g?o.geometries[r]:o,u===null){if(e(null,C,c,E,S)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,C,c,E,S)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],C,c,E,S)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function Jr(i,e){li(i,function(t,n,r,u,h){var o=t===null?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return e(wt(t,r,{bbox:u,id:h}),n,0)===!1?!1:void 0}var g;switch(o){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var c=0;c<t.coordinates.length;c++){var E=t.coordinates[c],S={type:g,coordinates:E};if(e(wt(S,r),n,c)===!1)return!1}})}function $r(i,e={}){const t=[];if(li(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Qr(t[0],...t.slice(1));return n.length===0?null:n.length===1?ti(n[0],e.properties):ji(n,e.properties)}var rn=$r;function es(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return nn(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var sn=es;function ts(i){const e=[];if(li(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=Xr(e[0],...e.slice(1));return n.length===0?null:n.length===1?ti(n[0],t):ji(n,t)}var is=ts;function ns(i){if(!i)throw new Error("geojson is required");var e=[];return Jr(i,function(t){e.push(t)}),Et(e)}var rs=ns;function on(i,e){const t=is(Et([ti([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Wt(sn(i)),r=(n[2]-n[0])/360/1e3,u=n[0]<-180,h=n[2]>180,o=rs(i);if(o.features.length>1&&(u||h))for(const g of o.features){const c=Wt(sn(g));if(h&&c[0]<-180+r)for(const E of g.geometry.coordinates)for(const S of E)S[0]+=360-r;if(u&&c[2]>180-r)for(const E of g.geometry.coordinates)for(const S of E)S[0]-=360-r}e(Et([o.features.length<2?i:rn(o)??i,t]))}const ln={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}},Zt="mtlr-gc-full-geom",un="mtlr-gc-full-geom-fill",an="mtlr-gc-full-geom-line";function fn(i,e,t=!0,n=!0,r={},u={},h=ln){let o;const g=[];let c,E,S;function C(){if(!i.loaded){i.once("load",C);return}const M=h?h===!0?ln:h:void 0;if(!(M!=null&&M.fill)&&!(M!=null&&M.line))return;const k=i.getSource(Zt);if(k)k.setData(S??Et([]));else if(S)i.addSource(Zt,{type:"geojson",data:S});else return;!i.getLayer(un)&&(M!=null&&M.fill)&&i.addLayer({...M==null?void 0:M.fill,id:un,type:"fill",source:Zt}),!i.getLayer(an)&&(M!=null&&M.line)&&i.addLayer({...M==null?void 0:M.line,id:an,type:"line",source:Zt})}function R(M){S=M,C()}i.on("styledata",()=>{setTimeout(()=>{S&&C()})});const O=M=>{o==null||o({type:"mapClick",coordinates:[M.lngLat.lng,M.lngLat.lat]})};function A(M=!1){if(!e)throw new Error;const k=document.createElement("div");return M&&k.classList.add("marker-interactive"),new ur({props:{displayIn:"maplibre"},target:k}),new e.Marker({element:k,offset:[1,-13]})}return{setEventHandler(M){M?(o=M,i.on("click",O)):(o=void 0,i.off("click",O))},flyTo(M,k){i.flyTo({center:M,...k?{zoom:k}:{},...r})},fitBounds(M,k,y){i.fitBounds([[M[0],M[1]],[M[2],M[3]]],{padding:k,...y?{maxZoom:y}:{},...u})},indicateReverse(M){i.getCanvasContainer().style.cursor=M?"crosshair":""},setReverseMarker(M){!e||!t||(E?M?E.setLngLat(M):(E.remove(),E=void 0):M&&(t instanceof Function?E=t(i)??void 0:(E=(typeof t=="object"?new e.Marker(t):A()).setLngLat(M).addTo(i),E.getElement().classList.add("marker-reverse"))))},setFeatures(M,k,y){for(const N of g)N.remove();if(g.length=0,R(void 0),!!e){e:if(k){let N=!1;if(k.geometry.type==="GeometryCollection"){const D=k.geometry.geometries.filter(q=>q.type==="Polygon"||q.type==="MultiPolygon");t:if(D.length>0){const q=rn(Et(D.map(U=>wt(U))));if(!q)break t;on({...k,geometry:q.geometry},R),N=!0}else{const q=k.geometry.geometries.filter(U=>U.type==="LineString"||U.type==="MultiLineString");q.length>0&&(R({...k,geometry:{type:"GeometryCollection",geometries:q}}),N=!0)}}if(!N){if(k.geometry.type==="Polygon"||k.geometry.type==="MultiPolygon")on(k,R);else if(k.geometry.type==="LineString"||k.geometry.type==="MultiLineString"){R(k);break e}}if(!y&&k.geometry.type!=="Point")break e;if(t instanceof Function){const D=t(i,k);D&&g.push(D)}else t&&g.push(typeof t=="object"?new e.Marker(t):A().setLngLat(k.center).addTo(i))}if(n)for(const N of M??[]){if(N===k)continue;let D;if(n instanceof Function){if(D=n(i,N),!D)continue}else D=(typeof n=="object"?new e.Marker(n):A(!0)).setLngLat(N.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,""))).addTo(i);const q=D.getElement();q.addEventListener("click",U=>{U.stopPropagation(),o==null||o({type:"markerClick",id:N.id})}),q.addEventListener("mouseenter",()=>{o==null||o({type:"markerMouseEnter",id:N.id}),D.togglePopup()}),q.addEventListener("mouseleave",()=>{o==null||o({type:"markerMouseLeave",id:N.id}),D.togglePopup()}),g.push(D)}}},setSelectedMarker(M){c&&c.getElement().classList.toggle("marker-selected",!1),c=M>-1?g[M]:void 0,c==null||c.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const M=i.getCenter();return[i.getZoom(),M.lng,M.lat]}}}function ss(i,e,t){var O,A;class n{constructor(k,y){P(this,"type");P(this,"target");this.type=y,this.target=k}}class r extends n{constructor(y,N){super(y,"select");P(this,"feature");Object.assign(this,N)}}class u extends n{constructor(y,N){super(y,"featureslisted");P(this,"features");this.features=N}}class h extends n{constructor(y,N){super(y,"featuresmarked");P(this,"features");this.features=N}}class o extends n{constructor(y,N){super(y,"optionsvisibilitychange");P(this,"optionsVisible");this.optionsVisible=N}}class g extends n{constructor(y,N){super(y,"pick");P(this,"feature");this.feature=N}}class c extends n{constructor(y,N){super(y,"querychange");P(this,"query");this.query=N}}class E extends n{constructor(y,N,D){super(y,"response");P(this,"url");P(this,"featureCollection");this.url=N,this.featureCollection=D}}class S extends n{constructor(y,N){super(y,"reversetoggle");P(this,"reverse");this.reverse=N}}class C extends i{constructor(y={}){super();pi(this,O);pi(this,A);yi(this,A,y)}onAddInt(y){const N=document.createElement("div");N.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:D,showResultMarkers:q,flyTo:U,fullGeometryStyle:B,...s}=he(this,A),l=typeof U=="boolean"?{}:U,m={mapController:fn(y,e,D,q,l,l,B),flyTo:U===void 0?!0:!!U,apiKey:"",...t==null?void 0:t(y,N),...s};if(!m.apiKey)throw new Error("no apiKey provided");return yi(this,O,new Rr({target:N,props:m})),he(this,O).$on("select",a=>{this.fire(new r(this,a.detail))}),he(this,O).$on("pick",a=>{this.fire(new g(this,a.detail.feature))}),he(this,O).$on("featureslisted",a=>{this.fire(new u(this,a.detail.features))}),he(this,O).$on("featuresmarked",a=>{this.fire(new h(this,a.detail.features))}),he(this,O).$on("response",a=>{this.fire(new E(this,a.detail.url,a.detail.featureCollection))}),he(this,O).$on("optionsvisibilitychange",a=>{this.fire(new o(this,a.detail.optionsVisible))}),he(this,O).$on("reversetoggle",a=>{this.fire(new S(this,a.detail.reverse))}),he(this,O).$on("querychange",a=>{this.fire(new c(this,a.detail.query))}),N}on(y,N){return super.on(y,N)}once(y,N){return super.once(y,N)}off(y,N){return super.off(y,N)}listens(y){return super.listens(y)}setOptions(y){var s;Object.assign(he(this,A),y);const{marker:N,showResultMarkers:D,flyTo:q,fullGeometryStyle:U,...B}=he(this,A);(s=he(this,O))==null||s.$set(B)}setQuery(y,N=!0){var D;(D=he(this,O))==null||D.setQuery(y,N)}clearMap(){var y;(y=he(this,O))==null||y.clearMap()}clearList(){var y;(y=he(this,O))==null||y.clearList()}setReverseMode(y){var N;(N=he(this,O))==null||N.$set({reverseActive:y})}focus(y){var N;(N=he(this,O))==null||N.focus(y)}blur(){var y;(y=he(this,O))==null||y.blur()}onRemove(){var y;(y=he(this,O))==null||y.$destroy()}}return O=new WeakMap,A=new WeakMap,{MapLibreBasedGeocodingControl:C,events:{SelectEvent:r,FeaturesListedEvent:u,FeaturesMarkedEvent:h,OptionsVisibilityChangeEvent:o,PickEvent:g,QueryChangeEvent:c,ResponseEvent:E,ReverseToggleEvent:S}}}const os="@maptiler/geocoding-control",ls="2.1.3-rc1",{MapLibreBasedGeocodingControl:us,events:$e}=ss(gt.Evented,gt,(i,e)=>{const t={};if(!("getSdkConfig"in i&&typeof i.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:n,apiKey:r}=i.getSdkConfig();t.apiKey=r;const u=/^([a-z]{2})($|_|-)/.exec(n);return u&&(t.language=u[1]),e.className+=" maptiler-ctrl",t});class as extends us{onAdd(e){var t;return(t=e.telemetry)==null||t.registerModule(os,ls),super.onAddInt(e)}}const fs=$e.SelectEvent,cs=$e.FeaturesListedEvent,hs=$e.FeaturesMarkedEvent,ds=$e.OptionsVisibilityChangeEvent,gs=$e.PickEvent,ms=$e.QueryChangeEvent,ps=$e.ResponseEvent,ys=$e.ReverseToggleEvent;j.FeaturesListedEvent=cs,j.FeaturesMarkedEvent=hs,j.GeocodingControl=as,j.OptionsVisibilityChangeEvent=ds,j.PickEvent=gs,j.QueryChangeEvent=ms,j.ResponseEvent=ps,j.ReverseToggleEvent=ys,j.SelectEvent=fs,j.createMapLibreGlMapController=fn,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(j,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],$):(j=typeof globalThis<"u"?globalThis:j||self,$(j.maptilersdkMaptilerGeocoder={},j.maptilersdk))})(this,function(j,$){"use strict";var Gs=Object.defineProperty;var vn=j=>{throw TypeError(j)};var Ds=(j,$,me)=>$ in j?Gs(j,$,{enumerable:!0,configurable:!0,writable:!0,value:me}):j[$]=me;var P=(j,$,me)=>Ds(j,typeof $!="symbol"?$+"":$,me),bn=(j,$,me)=>$.has(j)||vn("Cannot "+me);var fe=(j,$,me)=>(bn(j,$,"read from private field"),me?me.call(j):$.get(j)),gi=(j,$,me)=>$.has(j)?vn("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(j):$.set(j,me),mi=(j,$,me,dt)=>(bn(j,$,"write to private field"),dt?dt.call(j,me):$.set(j,me),me);var an,fn;function me(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const dt=me($);function ie(){}function En(i,e){for(const t in e)i[t]=e[t];return i}function yi(i){return i()}function vi(){return Object.create(null)}function Ue(i){i.forEach(yi)}function bi(i){return typeof i=="function"}function Ke(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Nt;function ye(i,e){return i===e?!0:(Nt||(Nt=document.createElement("a")),Nt.href=e,i===Nt.href)}function Ln(i){return Object.keys(i).length===0}function _n(i,e,t,n){if(i){const r=wi(i,e,t,n);return i[0](r)}}function wi(i,e,t,n){return i[1]&&n?En(t.ctx.slice(),i[1](n(e))):t.ctx}function Sn(i,e,t,n){return i[2],e.dirty}function xn(i,e,t,n,r,u){if(r){const h=wi(e,t,n,u);i.p(h,r)}}function Tn(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function kt(i){return i??""}function V(i,e){i.appendChild(e)}function ne(i,e,t){i.insertBefore(e,t||null)}function ee(i){i.parentNode&&i.parentNode.removeChild(i)}function Y(i){return document.createElement(i)}function ke(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ye(i){return document.createTextNode(i)}function we(){return Ye(" ")}function Mn(){return Ye("")}function ce(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function Cn(i){return function(e){return e.preventDefault(),i.call(this,e)}}function x(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Nn(i){return Array.from(i.childNodes)}function gt(i,e){e=""+e,i.data!==e&&(i.data=e)}function Ei(i,e){i.value=e??""}function Ie(i,e,t){i.classList.toggle(e,!!t)}function kn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let mt;function pt(i){mt=i}function Li(){if(!mt)throw new Error("Function called outside component initialization");return mt}function On(i){Li().$$.on_destroy.push(i)}function _i(){const i=Li();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const u=kn(e,t,{cancelable:n});return r.slice().forEach(h=>{h.call(i,u)}),!u.defaultPrevented}return!0}}function Rn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const ut=[],Vt=[];let at=[];const Si=[],Pn=Promise.resolve();let Kt=!1;function In(){Kt||(Kt=!0,Pn.then(xi))}function Yt(i){at.push(i)}const Qt=new Set;let ft=0;function xi(){if(ft!==0)return;const i=mt;do{try{for(;ft<ut.length;){const e=ut[ft];ft++,pt(e),An(e.$$)}}catch(e){throw ut.length=0,ft=0,e}for(pt(null),ut.length=0,ft=0;Vt.length;)Vt.pop()();for(let e=0;e<at.length;e+=1){const t=at[e];Qt.has(t)||(Qt.add(t),t())}at.length=0}while(ut.length);for(;Si.length;)Si.pop()();Kt=!1,Qt.clear(),pt(i)}function An(i){if(i.fragment!==null){i.update(),Ue(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Yt)}}function Bn(i){const e=[],t=[];at.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),at=e}const Ot=new Set;let nt;function Rt(){nt={r:0,c:[],p:nt}}function Pt(){nt.r||Ue(nt.c),nt=nt.p}function le(i,e){i&&i.i&&(Ot.delete(i),i.i(e))}function ge(i,e,t,n){if(i&&i.o){if(Ot.has(i))return;Ot.add(i),nt.c.push(()=>{Ot.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Ti(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Wn(i,e){ge(i,1,1,()=>{e.delete(i.key)})}function Gn(i,e,t,n,r,u,h,o,g,c,E,S){let C=i.length,R=u.length,O=C;const A={};for(;O--;)A[i[O].key]=O;const M=[],k=new Map,y=new Map,N=[];for(O=R;O--;){const B=S(r,u,O),s=t(B);let l=h.get(s);l?N.push(()=>l.p(B,e)):(l=c(s,B),l.c()),k.set(s,M[O]=l),s in A&&y.set(s,Math.abs(O-A[s]))}const D=new Set,q=new Set;function U(B){le(B,1),B.m(o,E),h.set(B.key,B),E=B.first,R--}for(;C&&R;){const B=M[R-1],s=i[C-1],l=B.key,f=s.key;B===s?(E=B.first,C--,R--):k.has(f)?!h.has(l)||D.has(l)?U(B):q.has(f)?C--:y.get(l)>y.get(f)?(q.add(l),U(B)):(D.add(f),C--):(g(s,h),C--)}for(;C--;){const B=i[C];k.has(B.key)||g(B,h)}for(;R;)U(M[R-1]);return Ue(N),M}function Qe(i){i&&i.c()}function qe(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Yt(()=>{const u=i.$$.on_mount.map(yi).filter(bi);i.$$.on_destroy?i.$$.on_destroy.push(...u):Ue(u),i.$$.on_mount=[]}),r.forEach(Yt)}function Fe(i,e){const t=i.$$;t.fragment!==null&&(Bn(t.after_update),Ue(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Dn(i,e){i.$$.dirty[0]===-1&&(ut.push(i),In(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Xe(i,e,t,n,r,u,h=null,o=[-1]){const g=mt;pt(i);const c=i.$$={fragment:null,ctx:[],props:u,update:ie,not_equal:r,bound:vi(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:vi(),dirty:o,skip_bound:!1,root:e.target||g.$$.root};h&&h(c.root);let E=!1;if(c.ctx=t?t(i,e.props||{},(S,C,...R)=>{const O=R.length?R[0]:C;return c.ctx&&r(c.ctx[S],c.ctx[S]=O)&&(!c.skip_bound&&c.bound[S]&&c.bound[S](O),E&&Dn(i,S)),C}):[],c.update(),E=!0,Ue(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const S=Nn(e.target);c.fragment&&c.fragment.l(S),S.forEach(ee)}else c.fragment&&c.fragment.c();e.intro&&le(i.$$.fragment),qe(i,e.target,e.anchor),xi()}pt(g)}class Je{constructor(){P(this,"$$");P(this,"$$set")}$destroy(){Fe(this,1),this.$destroy=ie}$on(e,t){if(!bi(t))return ie;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!Ln(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const zn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(zn);function Un(i){let e,t;return{c(){e=ke("svg"),t=ke("path"),x(t,"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"),x(e,"viewBox","0 0 14 14"),x(e,"width","13"),x(e,"height","13"),x(e,"class","svelte-en2qvf")},m(n,r){ne(n,e,r),V(e,t)},p:ie,i:ie,o:ie,d(n){n&&ee(e)}}}class Mi extends Je{constructor(e){super(),Xe(this,e,null,Un,Ke,{})}}function qn(i){let e,t;return{c(){e=ke("svg"),t=ke("path"),x(t,"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"),x(e,"viewBox","0 0 30 30"),x(e,"fill","none"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"class","svelte-d2loi5")},m(n,r){ne(n,e,r),V(e,t)},p:ie,i:ie,o:ie,d(n){n&&ee(e)}}}class Ci extends Je{constructor(e){super(),Xe(this,e,null,qn,Ke,{})}}function Fn(i){let e,t;return{c(){e=Y("img"),ye(e.src,t=i[3]+"area.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!ye(e.src,t=n[3]+"area.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function jn(i){let e,t;return{c(){e=Y("img"),ye(e.src,t=i[3]+"reverse.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!ye(e.src,t=n[3]+"reverse.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Zn(i){let e,t;return{c(){e=Y("img"),ye(e.src,t=i[3]+"poi.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!ye(e.src,t=n[3]+"poi.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Hn(i){let e,t;return{c(){e=Y("img"),ye(e.src,t=i[3]+"postal_code.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!ye(e.src,t=n[3]+"postal_code.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Vn(i){let e,t;return{c(){e=Y("img"),ye(e.src,t=i[3]+"street.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!ye(e.src,t=n[3]+"street.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Kn(i){let e,t;return{c(){e=Y("img"),ye(e.src,t=i[3]+"road.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!ye(e.src,t=n[3]+"road.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Yn(i){let e,t;return{c(){e=Y("img"),ye(e.src,t=i[3]+"housenumber.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){ne(n,e,r)},p(n,r){r&8&&!ye(e.src,t=n[3]+"housenumber.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Qn(i){let e,t,n,r;return{c(){e=Y("img"),ye(e.src,t=i[5])||x(e,"src",t),x(e,"alt",i[4]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(u,h){ne(u,e,h),n||(r=ce(e,"error",i[14]),n=!0)},p(u,h){h&32&&!ye(e.src,t=u[5])&&x(e,"src",t),h&16&&x(e,"alt",u[4]),h&128&&x(e,"title",u[7])},d(u){u&&ee(e),n=!1,r()}}}function Xn(i){let e,t;return{c(){e=Y("div"),x(e,"class","sprite-icon svelte-w9y5n9"),x(e,"style",t=`
|
|
2
|
+
width: ${i[6].width/xe}px;
|
|
3
|
+
height: ${i[6].height/xe}px;
|
|
4
|
+
background-image: url(${i[3]}sprite${Xt}.png);
|
|
5
|
+
background-position: -${i[6].x/xe}px -${i[6].y/xe}px;
|
|
6
|
+
background-size: ${Oe.width/xe}px ${Oe.height/xe}px;
|
|
7
|
+
`),x(e,"title",i[7])},m(n,r){ne(n,e,r)},p(n,r){r&72&&t!==(t=`
|
|
8
|
+
width: ${n[6].width/xe}px;
|
|
9
|
+
height: ${n[6].height/xe}px;
|
|
10
|
+
background-image: url(${n[3]}sprite${Xt}.png);
|
|
11
|
+
background-position: -${n[6].x/xe}px -${n[6].y/xe}px;
|
|
12
|
+
background-size: ${Oe.width/xe}px ${Oe.height/xe}px;
|
|
13
|
+
`)&&x(e,"style",t),r&128&&x(e,"title",n[7])},d(n){n&&ee(e)}}}function Ni(i){let e,t;return{c(){e=Y("span"),t=Ye(i[7]),x(e,"class","secondary svelte-w9y5n9")},m(n,r){ne(n,e,r),V(e,t)},p(n,r){r&128&>(t,n[7])},d(n){n&&ee(e)}}}function Jn(i){let e,t,n,r,u,h,o,g,c,E=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",S,C,R=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[8],O,A,M=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",k,y,N,D,q,U;function B(m,a){return a&1&&(t=null),a&1&&(n=null),a&1&&(r=null),a&1&&(u=null),Oe&&m[6]?Xn:m[5]?Qn:m[0].address?Yn:(t==null&&(t=!!m[0].id.startsWith("road.")),t?Kn:(n==null&&(n=!!m[0].id.startsWith("address.")),n?Vn:(r==null&&(r=!!m[0].id.startsWith("postal_code.")),r?Hn:(u==null&&(u=!!m[0].id.startsWith("poi.")),u?Zn:m[8]?jn:Fn))))}let s=B(i,-1),l=s(i),f=R&&Ni(i);return{c(){e=Y("li"),l.c(),h=we(),o=Y("span"),g=Y("span"),c=Y("span"),S=Ye(E),C=we(),f&&f.c(),O=we(),A=Y("span"),k=Ye(M),x(c,"class","primary svelte-w9y5n9"),x(g,"class","svelte-w9y5n9"),x(A,"class","line2 svelte-w9y5n9"),x(o,"class","texts svelte-w9y5n9"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",y=i[1]==="selected"),x(e,"aria-checked",N=i[1]==="picked"),x(e,"class",D=kt(i[1])+" svelte-w9y5n9")},m(m,a){ne(m,e,a),l.m(e,null),V(e,h),V(e,o),V(o,g),V(g,c),V(c,S),V(g,C),f&&f.m(g,null),V(o,O),V(o,A),V(A,k),q||(U=[ce(e,"mouseenter",i[13]),ce(e,"focus",i[15]),ce(e,"click",i[16])],q=!0)},p(m,[a]){s===(s=B(m,a))&&l?l.p(m,a):(l.d(1),l=s(m),l&&(l.c(),l.m(e,h))),a&257&&E!==(E=(m[8]?m[0].place_name:m[0].place_name.replace(/,.*/,""))+"")&>(S,E),a&293&&(R=m[2]==="always"||m[2]!=="never"&&!m[0].address&&!m[0].id.startsWith("road.")&&!m[0].id.startsWith("address.")&&!m[0].id.startsWith("postal_code.")&&(!m[0].id.startsWith("poi.")||!m[5])&&!m[8]),R?f?f.p(m,a):(f=Ni(m),f.c(),f.m(g,null)):f&&(f.d(1),f=null),a&257&&M!==(M=(m[8]?"":m[0].place_name.replace(/[^,]*,?\s*/,""))+"")&>(k,M),a&2&&y!==(y=m[1]==="selected")&&x(e,"aria-selected",y),a&2&&N!==(N=m[1]==="picked")&&x(e,"aria-checked",N),a&2&&D!==(D=kt(m[1])+" svelte-w9y5n9")&&x(e,"class",D)},i:ie,o:ie,d(m){m&&ee(e),l.d(),f&&f.d(),q=!1,Ue(U)}}}const ki=devicePixelRatio>1.25,Xt=ki?"@2x":"",xe=ki?2:1;let Oe,It;function $n(i,e,t){let n,r,u,{feature:h}=e,{style:o="default"}=e,{showPlaceType:g}=e,{missingIconsCache:c}=e,{iconsBaseUrl:E}=e;const S=_i();let C,R,O,A;function M(){It??(It=fetch(`${E}sprite${Xt}.json`).then(s=>s.json()).then(s=>{Oe=s}).catch(()=>{Oe=null}))}function k(){R&&c.add(R),y()}function y(){Oe!==void 0?N():(M(),It==null||It.then(N))}function N(){do{if(A--,t(4,C=n==null?void 0:n[A]),t(6,O=C?Oe==null?void 0:Oe.icons[C]:void 0),O)break;t(5,R=C?E+C.replace(/ /g,"_")+".svg":void 0)}while(A>-1&&(!R||c.has(R)))}function D(s){Rn.call(this,i,s)}const q=()=>k(),U=()=>S("select",void 0),B=s=>{document.activeElement!==s.target&&S("select",void 0)};return i.$$set=s=>{"feature"in s&&t(0,h=s.feature),"style"in s&&t(1,o=s.style),"showPlaceType"in s&&t(2,g=s.showPlaceType),"missingIconsCache"in s&&t(11,c=s.missingIconsCache),"iconsBaseUrl"in s&&t(3,E=s.iconsBaseUrl)},i.$$.update=()=>{var s,l,f,m,a;i.$$.dirty&1&&t(12,n=(s=h.properties)==null?void 0:s.categories),i.$$.dirty&1&&t(8,r=h.place_type[0]==="reverse"),i.$$.dirty&1&&t(7,u=((f=(l=h.properties)==null?void 0:l.categories)==null?void 0:f.join(", "))??((a=(m=h.properties)==null?void 0:m.place_type_name)==null?void 0:a[0])??h.place_type[0]),i.$$.dirty&4096&&(A=(n==null?void 0:n.length)??0,y())},[h,o,g,E,C,R,O,u,r,S,k,c,n,D,q,U,B]}class er extends Je{constructor(e){super(),Xe(this,e,$n,Jn,Ke,{feature:0,style:1,showPlaceType:2,missingIconsCache:11,iconsBaseUrl:3})}}function tr(i){let e;return{c(){e=Y("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><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"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',x(e,"class","svelte-7cmwmc")},m(t,n){ne(t,e,n)},p:ie,i:ie,o:ie,d(t){t&&ee(e)}}}class ir extends Je{constructor(e){super(),Xe(this,e,null,tr,Ke,{})}}function nr(i){let e,t,n;return{c(){e=ke("svg"),t=ke("path"),x(t,"stroke-width","4"),x(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),x(t,"class","svelte-gzo3ar"),x(e,"width",n=i[0]==="list"?20:void 0),x(e,"viewBox","0 0 70 85"),x(e,"fill","none"),x(e,"class","svelte-gzo3ar"),Ie(e,"in-map",i[0]!=="list"),Ie(e,"list-icon",i[0]==="list")},m(r,u){ne(r,e,u),V(e,t)},p(r,[u]){u&1&&n!==(n=r[0]==="list"?20:void 0)&&x(e,"width",n),u&1&&Ie(e,"in-map",r[0]!=="list"),u&1&&Ie(e,"list-icon",r[0]==="list")},i:ie,o:ie,d(r){r&&ee(e)}}}function rr(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class sr extends Je{constructor(e){super(),Xe(this,e,rr,nr,Ke,{displayIn:0})}}function or(i){let e,t;return{c(){e=ke("svg"),t=ke("path"),x(t,"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"),x(e,"viewBox","0 0 60.006 21.412"),x(e,"width","14"),x(e,"height","20"),x(e,"class","svelte-en2qvf")},m(n,r){ne(n,e,r),V(e,t)},p:ie,i:ie,o:ie,d(n){n&&ee(e)}}}class lr extends Je{constructor(e){super(),Xe(this,e,null,or,Ke,{})}}function ur(i){let e,t,n;return{c(){e=ke("svg"),t=ke("circle"),n=ke("path"),x(t,"cx","4.789"),x(t,"cy","4.787"),x(t,"r","3.85"),x(t,"class","svelte-1aq105l"),x(n,"d","M12.063 12.063 7.635 7.635"),x(n,"class","svelte-1aq105l"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"width","13"),x(e,"height","13"),x(e,"viewBox","0 0 13 13"),x(e,"class","svelte-1aq105l")},m(r,u){ne(r,e,u),V(e,t),V(e,n)},p:ie,i:ie,o:ie,d(r){r&&ee(e)}}}class ar extends Je{constructor(e){super(),Xe(this,e,null,ur,Ke,{})}}function fr(i,e,t){const n=e[1],r=e[0],u=n-r;return i===n&&t?i:((i-r)%u+u)%u+r}function At(i){const e=[...i];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 yt;async function cr(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(yt&&r.cachedLocationExpiry&&yt.time+r.cachedLocationExpiry>Date.now()){if(!yt.coords)break e;return yt.coords}let u;try{return u=await new Promise((h,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(g=>{h([g.coords.longitude,g.coords.latitude].map(c=>c.toFixed(6)).join(","))},g=>{o(g)},r)}),u}catch{}finally{r.cachedLocationExpiry&&(yt={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const hr=/^(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,Oi=/^([+-]?[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,})$/,Ri=/^(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,Pi=/^(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,Ai=/^(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 dr(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(R=>Number(R.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),u=Math.abs(n),h=t>0?"N":"S",o=n>0?"E":"W";let g;i=="DD"&&(g=`${r}° ${h}, ${u}° ${o}`);const c=Math.floor(r),E=Math.floor(u),S=(r-c)*60,C=(u-E)*60;if(i=="DM"){let R=Bi(S,3).toFixed(3).padStart(6,"0"),O=Bi(C,3).toFixed(3).padStart(6,"0");R.endsWith(".000")&&O.endsWith(".000")&&(R=R.replace(/\.000$/,""),O=O.replace(/\.000$/,"")),g=`${c}° ${R}' ${h}, ${E}° ${O}' ${o}`}if(i=="DMS"){const R=Math.floor(S),O=Math.floor(C);let A=((S-R)*60).toFixed(1).padStart(4,"0"),M=((C-O)*60).toFixed(1).padStart(4,"0");const k=R.toString().padStart(2,"0"),y=O.toString().padStart(2,"0");A.endsWith(".0")&&M.endsWith(".0")&&(A=A.replace(/\.0$/,""),M=M.replace(/\.0$/,"")),g=`${c}° ${k}' ${A}" ${h}, ${E}° ${y}' ${M}" ${o}`}return g}else throw new Error("no decimal coordinates to convert")}function Bi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function Jt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",u="",h=null,o=[],g=!1;if(hr.test(i))throw new Error("invalid coordinate value");if(Oi.test(i))if(o=Oi.exec(i),g=vt(o),g)t=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(t*=-1),n=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(n*=-1),h="DM";else throw new Error("invalid coordinate format");else if(Ri.test(i))if(o=Ri.exec(i),g=vt(o),g){if(t=o[2],n=o[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),h="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");o[1]?(r=o[1],u=o[5]):o[4]&&(r=o[4],u=o[8])}else throw new Error("invalid decimal coordinate format");else if(Pi.test(i))if(o=Pi.exec(i),g=vt(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,h="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,h="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[9])),o[11]&&(n+=o[11]/60),o[13]&&(n+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(n=-1*n),o[1]?(r=o[1],u=o[8]):o[7]&&(r=o[7],u=o[14]);else throw new Error("invalid DMS coordinates format");else if(Ii.test(i))if(o=Ii.exec(i),g=vt(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,h="DM"),o[6]&&(t+=o[6]/3600,h="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12]/60),o[14]&&(n+=o[14]/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid DMS coordinates format");else if(Ai.test(i)){if(o=Ai.exec(i),g=vt(o),o.filter(c=>c).length<=5)throw new Error("invalid coordinates format");if(g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4].replace(",",".")/60,h="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,h="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12].replace(",",".")/60),o[14]&&(n+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid coordinates format")}if(g){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!u||!r&&u)throw new Error("invalid coordinates value");if(r&&r==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let c=/S|SOUTH/i;c.test(r)&&t>0&&(t=-1*t),c=/W|WEST/i,c.test(u)&&n>0&&(n=-1*n);const E=o[0].trim();let S,C;const R=/[,/;\u0020]/g,O=E.match(R);if(O==null){const k=Math.floor(i.length/2);S=E.substring(0,k).trim(),C=E.substring(k).trim()}else{let k;O.length%2==1?k=Math.floor(O.length/2):k=O.length/2-1;let y=0;if(k==0)y=E.indexOf(O[0]),S=E.substring(0,y).trim(),C=E.substring(y+1).trim();else{let N=0,D=0;for(;N<=k;)y=E.indexOf(O[N],D),D=y+1,N++;S=E.substring(0,y).trim(),C=E.substring(y+1).trim()}}const A=S.split(".");if(A.length==2&&A[1]==0&&A[1].length!=2)throw new Error("invalid coordinates format");const M=C.split(".");if(M.length==2&&M[1]==0&&M[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(C))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:E,verbatimLatitude:S,verbatimLongitude:C,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:h,closeEnough:gr,toCoordinateFormat:dr})}else throw new Error("coordinates pattern match failed")}function vt(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let u=0;u<r;u++){const h=e[u],o=e[u+r],g=t.test(h)&&t.test(o),c=n.test(h)&&n.test(o),E=h==o;if(!(h==null&&o==null)){if(h==null||o==null)return!1;if(g||c||E)continue;return!1}}return!0}function Wi(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function gr(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return Wi(this.decimalLatitude,Number(e[0]))&&Wi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const mr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Jt.to=mr;const pr=[{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"}],yr={decimalLatitude:40.123,decimalLongitude:-74.123},vr=[{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}],br=[{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 wr(){const i=[];return pr.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...yr})}),[...i,...vr,...br]}const Er=wr();Jt.formats=Er.map(i=>i.verbatimCoordinates);const Lr=Jt;function Gi(i,e,t){const n=i.slice();return n[97]=e[t],n[99]=t,n}function Di(i){let e,t;return e=new ir({}),{c(){Qe(e.$$.fragment)},m(n,r){qe(e,n,r),t=!0},i(n){t||(le(e.$$.fragment,n),t=!0)},o(n){ge(e.$$.fragment,n),t=!1},d(n){Fe(e,n)}}}function zi(i){let e,t,n,r,u;return t=new lr({}),{c(){e=Y("button"),Qe(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),Ie(e,"active",i[0])},m(h,o){ne(h,e,o),qe(t,e,null),n=!0,r||(u=ce(e,"click",i[79]),r=!0)},p(h,o){(!n||o[0]&1024)&&x(e,"title",h[10]),(!n||o[0]&1)&&Ie(e,"active",h[0])},i(h){n||(le(t.$$.fragment,h),n=!0)},o(h){ge(t.$$.fragment,h),n=!1},d(h){h&&ee(e),Fe(t),r=!1,u()}}}function _r(i){let e,t=[],n=new Map,r,u,h,o=Ti(i[13]);const g=c=>c[97].id+(c[97].address?","+c[97].address:"");for(let c=0;c<o.length;c+=1){let E=Gi(i,o,c),S=g(E);n.set(S,t[c]=Ui(S,E))}return{c(){e=Y("ul");for(let c=0;c<t.length;c+=1)t[c].c();x(e,"class","options svelte-bz0zu3"),x(e,"role","listbox")},m(c,E){ne(c,e,E);for(let S=0;S<t.length;S+=1)t[S]&&t[S].m(e,null);r=!0,u||(h=[ce(e,"mouseleave",i[27]),ce(e,"blur",i[83]),ce(e,"keydown",i[23])],u=!0)},p(c,E){E[0]&102823936&&(o=Ti(c[13]),Rt(),t=Gn(t,E,g,1,c,o,n,e,Wn,Ui,null,Gi),Pt())},i(c){if(!r){for(let E=0;E<o.length;E+=1)le(t[E]);r=!0}},o(c){for(let E=0;E<t.length;E+=1)ge(t[E]);r=!1},d(c){c&&ee(e);for(let E=0;E<t.length;E+=1)t[E].d();u=!1,Ue(h)}}}function Sr(i){let e,t,n,r,u,h;return t=new Ci({}),{c(){e=Y("div"),Qe(t.$$.fragment),n=we(),r=Y("div"),u=Ye(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(o,g){ne(o,e,g),qe(t,e,null),V(e,n),V(e,r),V(r,u),h=!0},p(o,g){(!h||g[0]&256)&>(u,o[8])},i(o){h||(le(t.$$.fragment,o),h=!0)},o(o){ge(t.$$.fragment,o),h=!1},d(o){o&&ee(e),Fe(t)}}}function xr(i){let e="",t;return{c(){t=Ye(e)},m(n,r){ne(n,t,r)},p:ie,i:ie,o:ie,d(n){n&&ee(t)}}}function Tr(i){let e,t,n,r,u,h,o,g,c,E,S;return t=new Ci({}),g=new Mi({}),{c(){e=Y("div"),Qe(t.$$.fragment),n=we(),r=Y("div"),u=Ye(i[7]),h=we(),o=Y("button"),Qe(g.$$.fragment),x(r,"class","svelte-bz0zu3"),x(o,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(C,R){ne(C,e,R),qe(t,e,null),V(e,n),V(e,r),V(r,u),V(e,h),V(e,o),qe(g,o,null),c=!0,E||(S=ce(o,"click",i[80]),E=!0)},p(C,R){(!c||R[0]&128)&>(u,C[7])},i(C){c||(le(t.$$.fragment,C),le(g.$$.fragment,C),c=!0)},o(C){ge(t.$$.fragment,C),ge(g.$$.fragment,C),c=!1},d(C){C&&ee(e),Fe(t),Fe(g),E=!1,S()}}}function Ui(i,e){var o;let t,n,r;function u(){return e[81](e[99])}function h(){return e[82](e[97])}return n=new er({props:{feature:e[97],showPlaceType:e[11],style:e[15]===e[99]?"selected":((o=e[14])==null?void 0:o.id)===e[97].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",u),n.$on("select",h),{key:i,first:null,c(){t=Mn(),Qe(n.$$.fragment),this.first=t},m(g,c){ne(g,t,c),qe(n,g,c),r=!0},p(g,c){var S;e=g;const E={};c[0]&8192&&(E.feature=e[97]),c[0]&2048&&(E.showPlaceType=e[11]),c[0]&57344&&(E.style=e[15]===e[99]?"selected":((S=e[14])==null?void 0:S.id)===e[97].id?"picked":"default"),c[0]&4096&&(E.iconsBaseUrl=e[12]),n.$set(E)},i(g){r||(le(n.$$.fragment,g),r=!0)},o(g){ge(n.$$.fragment,g),r=!1},d(g){g&&ee(t),Fe(n,g)}}}function Mr(i){let e,t,n,r,u,h,o,g,c,E,S,C,R,O,A,M,k,y,N,D,q,U=!1;u=new ar({}),S=new Mi({});let B=i[20]&&Di(),s=i[6]==="button"&&zi(i);const l=i[70].default,f=_n(l,i,i[69],null),m=[Tr,xr,Sr,_r],a=[];function b(p,d){var v,w;return p[19]?0:!p[16]&&!p[4]?1:((v=p[13])==null?void 0:v.length)===0?2:(w=p[13])!=null&&w.length&&(p[16]||p[4])?3:-1}return~(M=b(i))&&(k=a[M]=m[M](i)),{c(){e=we(),t=Y("form"),n=Y("div"),r=Y("button"),Qe(u.$$.fragment),h=we(),o=Y("input"),g=we(),c=Y("div"),E=Y("button"),Qe(S.$$.fragment),C=we(),B&&B.c(),R=we(),s&&s.c(),O=we(),f&&f.c(),A=we(),k&&k.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(o,"placeholder",i[9]),x(o,"aria-label",i[9]),x(o,"class","svelte-bz0zu3"),x(E,"type","button"),x(E,"title",i[3]),x(E,"class","svelte-bz0zu3"),x(c,"class","clear-button-container svelte-bz0zu3"),Ie(c,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",y=kt(i[2])+" svelte-bz0zu3"),Ie(t,"can-collapse",i[5]&&i[1]==="")},m(p,d){ne(p,e,d),ne(p,t,d),V(t,n),V(n,r),qe(u,r,null),V(n,h),V(n,o),i[72](o),Ei(o,i[1]),V(n,g),V(n,c),V(c,E),qe(S,E,null),V(c,C),B&&B.m(c,null),V(n,R),s&&s.m(n,null),V(n,O),f&&f.m(n,null),V(t,A),~M&&a[M].m(t,null),N=!0,D||(q=[ce(r,"click",i[71]),ce(o,"input",i[73]),ce(o,"focus",i[74]),ce(o,"blur",i[75]),ce(o,"click",i[76]),ce(o,"keydown",i[23]),ce(o,"input",i[24]),ce(o,"change",i[77]),ce(E,"click",i[78]),ce(t,"submit",Cn(i[22]))],D=!0)},p(p,d){(!N||d[0]&512)&&x(o,"placeholder",p[9]),(!N||d[0]&512)&&x(o,"aria-label",p[9]),d[0]&2&&o.value!==p[1]&&Ei(o,p[1]),(!N||d[0]&8)&&x(E,"title",p[3]),p[20]?B?d[0]&1048576&&le(B,1):(B=Di(),B.c(),le(B,1),B.m(c,null)):B&&(Rt(),ge(B,1,1,()=>{B=null}),Pt()),(!N||d[0]&2)&&Ie(c,"displayable",p[1]!==""),p[6]==="button"?s?(s.p(p,d),d[0]&64&&le(s,1)):(s=zi(p),s.c(),le(s,1),s.m(n,O)):s&&(Rt(),ge(s,1,1,()=>{s=null}),Pt()),f&&f.p&&(!N||d[2]&128)&&xn(f,l,p,p[69],N?Sn(l,p[69],d,null):Tn(p[69]),null);let v=M;M=b(p),M===v?~M&&a[M].p(p,d):(k&&(Rt(),ge(a[v],1,1,()=>{a[v]=null}),Pt()),~M?(k=a[M],k?k.p(p,d):(k=a[M]=m[M](p),k.c()),le(k,1),k.m(t,null)):k=null),(!N||d[0]&4&&y!==(y=kt(p[2])+" svelte-bz0zu3"))&&x(t,"class",y),(!N||d[0]&38)&&Ie(t,"can-collapse",p[5]&&p[1]==="")},i(p){N||(le(U),le(u.$$.fragment,p),le(S.$$.fragment,p),le(B),le(s),le(f,p),le(k),N=!0)},o(p){ge(U),ge(u.$$.fragment,p),ge(S.$$.fragment,p),ge(B),ge(s),ge(f,p),ge(k),N=!1},d(p){p&&(ee(e),ee(t)),Fe(u),i[72](null),Fe(S),B&&B.d(),s&&s.d(),f&&f.d(p),~M&&a[M].d(),D=!1,Ue(q)}}}function Cr(i,e,t){let n,r,u,{$$slots:h={},$$scope:o}=e;const g={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};let{class:c=void 0}=e,{apiKey:E}=e,{bbox:S=void 0}=e,{clearButtonTitle:C="clear"}=e,{clearOnBlur:R=!1}=e,{clearListOnPick:O=!1}=e,{keepListOpen:A=!1}=e,{collapsed:M=!1}=e,{country:k=void 0}=e,{debounceSearch:y=200}=e,{enableReverse:N="never"}=e,{errorMessage:D="Something went wrong…"}=e,{filter:q=()=>!0}=e,{flyTo:U=!0}=e,{fuzzyMatch:B=!0}=e,{language:s=void 0}=e,{limit:l=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:m=f}=e,{mapController:a=void 0}=e,{minLength:b=2}=e,{noResultsMessage:p="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:d="Search"}=e,{proximity:v=[{type:"server-geolocation"}]}=e,{reverseActive:w=N==="always"}=e,{reverseButtonTitle:L="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:I="full-geometry"}=e,{showPlaceType:W="if-needed"}=e,{showResultsWhileTyping:H=!0}=e,{selectFirst:Q=!0}=e,{flyToSelected:re=!1}=e,{markerOnSelected:Z=!0}=e,{types:K=void 0}=e;const he=[];let{reverseGeocodingTypes:He=he}=e,{exhaustiveReverseGeocoding:st=!1}=e,{excludeTypes:ot=!1}=e;const Le=void 0;let{reverseGeocodingExcludeTypes:We=Le}=e,{zoom:pe=g}=e,{apiUrl:de="https://api.maptiler.com/geocoding"}=e,{fetchParameters:te={}}=e,{iconsBaseUrl:cn="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.3/icons/"}=e,{adjustUrlQuery:oi=()=>{}}=e,{adjustUrl:li=()=>{}}=e;function ms(_){Pe.focus(_)}function ps(){Pe.blur()}function hn(_,oe=!0,ue=!1){t(1,T=_),oe?(t(15,X=-1),gn()):(mn(void 0,!ue,ue),setTimeout(()=>{Pe.focus(),Pe.select()}))}function ys(){t(13,F=void 0),t(14,G=void 0),t(15,X=-1)}function vs(){t(64,ae=[]),t(14,G=void 0)}let F,ae,G,dn="",Pe,X=-1,Ge,jt=[],lt,ct,ht,ui,Ve=!1;const bs=new Set,tt=_i();On(()=>{a&&(a.setEventHandler(void 0),a.indicateReverse(!1),a.setSelectedMarker(-1),a.setFeatures(void 0,void 0,!1))});function gn(_){if(t(17,Ve=!1),ct&&(clearTimeout(ct),ct=void 0),X>-1&&F)t(14,G=F[X]),t(1,T=G.place_type[0]==="reverse"?G.place_name:G.place_name.replace(/,.*/,"")),t(19,Ge=void 0),t(64,ae=void 0),t(15,X=-1);else if(T){const oe=_||!ai(T);fi(T,{exact:!0}).then(()=>{t(64,ae=F),t(14,G=void 0),oe&&ws()}).catch(ue=>t(19,Ge=ue))}}function ai(_){try{return Lr(_,6)}catch{return!1}}async function fi(_,{byId:oe=!1,exact:ue=!1}={}){var Se,De,it;t(19,Ge=void 0),lt==null||lt.abort();const _e=new AbortController;t(20,lt=_e);try{const J=ai(_),xt=new URL(de+"/"+encodeURIComponent(J?J.decimalLongitude+","+J.decimalLatitude:_)+".json"),Ne=xt.searchParams;s!==void 0&&Ne.set("language",Array.isArray(s)?s.join(","):s??"");const[di]=(a==null?void 0:a.getCenterAndZoom())??[];let ze=(Se=!J||He===he?K:He)==null?void 0:Se.map(ve=>typeof ve=="string"?ve:di===void 0||(ve[0]??0)<=di&&di<(ve[1]??1/0)?ve[2]:void 0).filter(ve=>ve!==void 0);ze&&(ze=[...new Set(ze)],Ne.set("types",ze.join(",")));const yn=!J||We===Le?ot:We;if(yn&&Ne.set("excludeTypes",String(yn)),S&&Ne.set("bbox",S.map(ve=>ve.toFixed(6)).join(",")),k&&Ne.set("country",Array.isArray(k)?k.join(","):k),!oe&&!J){const ve=await cr(a,v,_e);ve&&Ne.set("proximity",ve),(ue||!H)&&Ne.set("autocomplete","false"),Ne.set("fuzzyMatch",String(B))}const Tt=m===f?l:m;Tt!==void 0&&Tt>1&&(ze==null?void 0:ze.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),J?(Tt===1||Tt!==void 0&&(st||(ze==null?void 0:ze.length)===1))&&Ne.set("limit",String(Tt)):l!==void 0&&Ne.set("limit",String(l)),Ne.set("key",E),oi(Ne),li(xt);const Ws=xt.searchParams.get("types")===""&&xt.searchParams.get("excludeTypes")!=="true",Zt=xt.toString();if(Zt===dn){oe?(O&&t(13,F=void 0),t(14,G=jt[0])):(t(13,F=jt),((De=F[X])==null?void 0:De.id)!==(r==null?void 0:r.id)&&t(15,X=-1));return}dn=Zt;let Mt;if(Ws)Mt={type:"FeatureCollection",features:[]};else{const ve=await fetch(Zt,{signal:_e.signal,...te});if(!ve.ok)throw new Error(await ve.text());Mt=await ve.json()}tt("response",{url:Zt,featureCollection:Mt}),oe?(O&&t(13,F=void 0),t(14,G=Mt.features[0]),jt=[G]):(t(13,F=Mt.features.filter(q)),J&&F.unshift({type:"Feature",properties:{},id:"reverse_"+J.decimalLongitude+"_"+J.decimalLatitude,text:J.decimalLatitude+", "+J.decimalLongitude,place_name:J.decimalLatitude+", "+J.decimalLongitude,place_type:["reverse"],center:[J.decimalLongitude,J.decimalLatitude],bbox:[J.decimalLongitude,J.decimalLatitude,J.decimalLongitude,J.decimalLatitude],geometry:{type:"Point",coordinates:[J.decimalLongitude,J.decimalLatitude]}}),jt=F,((it=F[X])==null?void 0:it.id)!==(r==null?void 0:r.id)&&t(15,X=-1),J&&Pe.focus())}catch(J){if(J&&typeof J=="object"&&"name"in J&&J.name==="AbortError")return;throw J}finally{_e===lt&&t(20,lt=void 0)}}function ws(){var _e;if(!(ae!=null&&ae.length)||!U)return;const _=[180,90,-180,-90],oe=!ae.some(Se=>!Se.matching_text);let ue;for(const Se of ae){const De=St(Se);if(ue=ue===void 0?De:De===void 0?ue:Math.max(ue,De),oe||!Se.matching_text)for(const it of[0,1,2,3])_[it]=Math[it<2?"min":"max"](_[it],((_e=Se.bbox)==null?void 0:_e[it])??Se.center[it%2])}a&&ae.length>0&&(G&&_[0]===_[2]&&_[1]===_[3]?a.flyTo(G.center,St(G)):a.fitBounds(At(_),50,ue))}function ci(){!G||!a||(!G.bbox||G.bbox[0]===G.bbox[2]&&G.bbox[1]===G.bbox[3]?a.flyTo(G.center,St(G)):a.fitBounds(At(G.bbox),50,St(G)))}function St(_){var ue;if(!_.bbox||_.bbox[0]!==_.bbox[2]&&_.bbox[1]!==_.bbox[3])return;const oe=_.id.replace(/\..*/,"");return(Array.isArray((ue=_.properties)==null?void 0:ue.categories)?_.properties.categories.reduce((_e,Se)=>{const De=pe[oe+"."+Se];return _e===void 0?De:De===void 0?_e:Math.max(_e,De)},void 0):void 0)??pe[oe]}function Es(_){t(0,w=N==="always"),t(13,F=void 0),t(14,G=void 0),t(15,X=-1),hn(_[1].toFixed(6)+", "+fr(_[0],[-180,180],!0).toFixed(6),!1,!0)}function Ls(_){if(!F)return;let oe=_.key==="ArrowDown"?1:_.key==="ArrowUp"?-1:0;oe&&(Pe.focus(),t(17,Ve=!0),_.preventDefault(),G&&X===-1&&t(15,X=F.findIndex(ue=>ue.id===(G==null?void 0:G.id))),X===(G||Q?0:-1)&&oe===-1&&t(15,X=F.length),t(15,X+=oe),X>=F.length&&t(15,X=-1),X<0&&(G||Q)&&t(15,X=0))}function mn(_,oe=!0,ue=!1){if(t(19,Ge=void 0),t(14,G=void 0),t(17,Ve=!0),H||ue){if(ct&&clearTimeout(ct),T.length<b)return;const _e=T;ct=window.setTimeout(()=>{fi(_e).catch(Se=>t(19,Ge=Se))},oe?y:0)}else t(13,F=void 0),t(19,Ge=void 0)}function hi(_){G&&(G==null?void 0:G.id)===(_==null?void 0:_.id)?ci():(t(14,G=_),t(1,T=_.place_name))}function pn(_){t(15,X=_)}function _s(){(!Q||G)&&t(15,X=-1),re&&ci()}const Ss=()=>Pe.focus();function xs(_){Vt[_?"unshift":"push"](()=>{Pe=_,t(18,Pe)})}function Ts(){T=this.value,t(1,T),t(17,Ve),t(31,R),t(16,ht)}const Ms=()=>t(17,Ve=!0),Cs=()=>t(17,Ve=!1),Ns=()=>t(17,Ve=!0),ks=()=>t(14,G=void 0),Os=()=>{t(1,T=""),t(14,G=void 0),Pe.focus()},Rs=()=>t(0,w=!w),Ps=()=>t(19,Ge=void 0),Is=_=>pn(_),As=_=>hi(_),Bs=()=>{};return i.$$set=_=>{"class"in _&&t(2,c=_.class),"apiKey"in _&&t(29,E=_.apiKey),"bbox"in _&&t(30,S=_.bbox),"clearButtonTitle"in _&&t(3,C=_.clearButtonTitle),"clearOnBlur"in _&&t(31,R=_.clearOnBlur),"clearListOnPick"in _&&t(32,O=_.clearListOnPick),"keepListOpen"in _&&t(4,A=_.keepListOpen),"collapsed"in _&&t(5,M=_.collapsed),"country"in _&&t(33,k=_.country),"debounceSearch"in _&&t(34,y=_.debounceSearch),"enableReverse"in _&&t(6,N=_.enableReverse),"errorMessage"in _&&t(7,D=_.errorMessage),"filter"in _&&t(35,q=_.filter),"flyTo"in _&&t(36,U=_.flyTo),"fuzzyMatch"in _&&t(37,B=_.fuzzyMatch),"language"in _&&t(38,s=_.language),"limit"in _&&t(39,l=_.limit),"reverseGeocodingLimit"in _&&t(40,m=_.reverseGeocodingLimit),"mapController"in _&&t(41,a=_.mapController),"minLength"in _&&t(42,b=_.minLength),"noResultsMessage"in _&&t(8,p=_.noResultsMessage),"placeholder"in _&&t(9,d=_.placeholder),"proximity"in _&&t(43,v=_.proximity),"reverseActive"in _&&t(0,w=_.reverseActive),"reverseButtonTitle"in _&&t(10,L=_.reverseButtonTitle),"searchValue"in _&&t(1,T=_.searchValue),"pickedResultStyle"in _&&t(44,I=_.pickedResultStyle),"showPlaceType"in _&&t(11,W=_.showPlaceType),"showResultsWhileTyping"in _&&t(45,H=_.showResultsWhileTyping),"selectFirst"in _&&t(46,Q=_.selectFirst),"flyToSelected"in _&&t(47,re=_.flyToSelected),"markerOnSelected"in _&&t(48,Z=_.markerOnSelected),"types"in _&&t(49,K=_.types),"reverseGeocodingTypes"in _&&t(50,He=_.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in _&&t(51,st=_.exhaustiveReverseGeocoding),"excludeTypes"in _&&t(52,ot=_.excludeTypes),"reverseGeocodingExcludeTypes"in _&&t(53,We=_.reverseGeocodingExcludeTypes),"zoom"in _&&t(54,pe=_.zoom),"apiUrl"in _&&t(55,de=_.apiUrl),"fetchParameters"in _&&t(56,te=_.fetchParameters),"iconsBaseUrl"in _&&t(12,cn=_.iconsBaseUrl),"adjustUrlQuery"in _&&t(57,oi=_.adjustUrlQuery),"adjustUrl"in _&&t(58,li=_.adjustUrl),"$$scope"in _&&t(69,o=_.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,w=N==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&I!=="marker-only"&&G&&!G.address&&G.geometry.type==="Point"&&G.place_type[0]!=="reverse"&&fi(G.id,{byId:!0}).catch(_=>t(19,Ge=_)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&8&&(a&&G&&G.id!==ui&&U&&(ci(),O&&t(13,F=void 0),t(64,ae=void 0),t(15,X=-1)),t(65,ui=G==null?void 0:G.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,ht=Ve),R&&!ht&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<b&&(t(13,F=void 0),t(19,Ge=void 0),t(64,ae=F)),i.$$.dirty[0]&57344|i.$$.dirty[1]&32768&&Q&&F!=null&&F.length&&X==-1&&!G&&t(15,X=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&4&&ae!==F&&t(64,ae=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&a&&a.setEventHandler(_=>{switch(_.type){case"mapClick":w&&Es(_.coordinates);break;case"markerClick":{const oe=F==null?void 0:F.find(ue=>ue.id===_.id);oe&&hi(oe)}break;case"markerMouseEnter":ae&&t(15,X=ht?(F==null?void 0:F.findIndex(oe=>oe.id===_.id))??-1:-1);break;case"markerMouseLeave":ae&&t(15,X=-1);break}}),i.$$.dirty[0]&40960&&t(66,r=F==null?void 0:F[X]),i.$$.dirty[1]&66592|i.$$.dirty[2]&16&&a&&r&&U&&re&&a.flyTo(r.center,St(r)),i.$$.dirty[1]&8192&&t(68,n=I==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&132096|i.$$.dirty[2]&64&&(Z||a==null||a.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&132096|i.$$.dirty[2]&84&&a&&Z&&!ae&&(a.setFeatures(r?[r]:void 0,G,n),a.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&68&&a&&a.setFeatures(ae,G,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&ae&&a&&a.setSelectedMarker(X),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&a){const _=ai(T);a.setReverseMarker(_?[_.decimalLongitude,_.decimalLatitude]:void 0)}i.$$.dirty[2]&16&&tt("select",{feature:r}),i.$$.dirty[0]&16384&&tt("pick",{feature:G}),i.$$.dirty[0]&73744&&t(67,u=!!(F!=null&&F.length)&&(ht||A)),i.$$.dirty[2]&32&&tt("optionsvisibilitychange",{optionsVisible:u}),i.$$.dirty[0]&8192&&tt("featureslisted",{features:F}),i.$$.dirty[2]&4&&tt("featuresmarked",{features:ae}),i.$$.dirty[0]&1&&tt("reversetoggle",{reverse:w}),i.$$.dirty[0]&2&&tt("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&a&&a.indicateReverse(w)},[w,T,c,C,A,M,N,D,p,d,L,W,cn,F,G,X,ht,Ve,Pe,Ge,lt,bs,gn,Ls,mn,hi,pn,_s,g,E,S,R,O,k,y,q,U,B,s,l,m,a,b,v,I,H,Q,re,Z,K,He,st,ot,We,pe,de,te,oi,li,ms,ps,hn,ys,vs,ae,ui,r,u,n,o,h,Ss,xs,Ts,Ms,Cs,Ns,ks,Os,Rs,Ps,Is,As,Bs]}let Nr=class extends Je{constructor(e){super(),Xe(this,e,Cr,Mr,Ke,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,reverseGeocodingLimit:40,mapController:41,minLength:42,noResultsMessage:8,placeholder:9,proximity:43,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:44,showPlaceType:11,showResultsWhileTyping:45,selectFirst:46,flyToSelected:47,markerOnSelected:48,types:49,reverseGeocodingTypes:50,exhaustiveReverseGeocoding:51,excludeTypes:52,reverseGeocodingExcludeTypes:53,zoom:54,apiUrl:55,fetchParameters:56,iconsBaseUrl:12,adjustUrlQuery:57,adjustUrl:58,focus:59,blur:60,setQuery:61,clearList:62,clearMap:63},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[59]}get blur(){return this.$$.ctx[60]}get setQuery(){return this.$$.ctx[61]}get clearList(){return this.$$.ctx[62]}get clearMap(){return this.$$.ctx[63]}};function bt(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function $t(i,e,t={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;u<r[r.length-1].length;u++)if(r[r.length-1][u]!==r[0][u])throw new Error("First and last Position are not equivalent.")}return bt({type:"Polygon",coordinates:i},e,t)}function wt(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function qi(i,e,t={}){return bt({type:"MultiPolygon",coordinates:i},e,t)}var kr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ei=Math.ceil,Te=Math.floor,be="[BigNumber Error] ",Fi=be+"Number primitive has more than 15 significant digits: ",Re=1e14,z=14,ji=9007199254740991,ti=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],$e=1e7,Ee=1e9;function Zi(i){var e,t,n,r=y.prototype={constructor:y,toString:null,valueOf:null},u=new y(1),h=20,o=4,g=-7,c=21,E=-1e7,S=1e7,C=!1,R=1,O=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function y(s,l){var f,m,a,b,p,d,v,w,L=this;if(!(L instanceof y))return new y(s,l);if(l==null){if(s&&s._isBigNumber===!0){L.s=s.s,!s.c||s.e>S?L.c=L.e=null:s.e<E?L.c=[L.e=0]:(L.e=s.e,L.c=s.c.slice());return}if((d=typeof s=="number")&&s*0==0){if(L.s=1/s<0?(s=-s,-1):1,s===~~s){for(b=0,p=s;p>=10;p/=10,b++);b>S?L.c=L.e=null:(L.e=b,L.c=[s]);return}w=String(s)}else{if(!kr.test(w=String(s)))return n(L,w,d);L.s=w.charCodeAt(0)==45?(w=w.slice(1),-1):1}(b=w.indexOf("."))>-1&&(w=w.replace(".","")),(p=w.search(/e/i))>0?(b<0&&(b=p),b+=+w.slice(p+1),w=w.substring(0,p)):b<0&&(b=w.length)}else{if(se(l,2,M.length,"Base"),l==10&&k)return L=new y(s),U(L,h+L.e+1,o);if(w=String(s),d=typeof s=="number"){if(s*0!=0)return n(L,w,d,l);if(L.s=1/s<0?(w=w.slice(1),-1):1,y.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(Fi+s)}else L.s=w.charCodeAt(0)===45?(w=w.slice(1),-1):1;for(f=M.slice(0,l),b=p=0,v=w.length;p<v;p++)if(f.indexOf(m=w.charAt(p))<0){if(m=="."){if(p>b){b=v;continue}}else if(!a&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){a=!0,p=-1,b=0;continue}return n(L,String(s),d,l)}d=!1,w=t(w,l,10,L.s),(b=w.indexOf("."))>-1?w=w.replace(".",""):b=w.length}for(p=0;w.charCodeAt(p)===48;p++);for(v=w.length;w.charCodeAt(--v)===48;);if(w=w.slice(p,++v)){if(v-=p,d&&y.DEBUG&&v>15&&(s>ji||s!==Te(s)))throw Error(Fi+L.s*s);if((b=b-p-1)>S)L.c=L.e=null;else if(b<E)L.c=[L.e=0];else{if(L.e=b,L.c=[],p=(b+1)%z,b<0&&(p+=z),p<v){for(p&&L.c.push(+w.slice(0,p)),v-=z;p<v;)L.c.push(+w.slice(p,p+=z));p=z-(w=w.slice(p)).length}else p-=v;for(;p--;w+="0");L.c.push(+w)}}else L.c=[L.e=0]}y.clone=Zi,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(s){var l,f;if(s!=null)if(typeof s=="object"){if(s.hasOwnProperty(l="DECIMAL_PLACES")&&(f=s[l],se(f,0,Ee,l),h=f),s.hasOwnProperty(l="ROUNDING_MODE")&&(f=s[l],se(f,0,8,l),o=f),s.hasOwnProperty(l="EXPONENTIAL_AT")&&(f=s[l],f&&f.pop?(se(f[0],-1e9,0,l),se(f[1],0,Ee,l),g=f[0],c=f[1]):(se(f,-1e9,Ee,l),g=-(c=f<0?-f:f))),s.hasOwnProperty(l="RANGE"))if(f=s[l],f&&f.pop)se(f[0],-1e9,-1,l),se(f[1],1,Ee,l),E=f[0],S=f[1];else if(se(f,-1e9,Ee,l),f)E=-(S=f<0?-f:f);else throw Error(be+l+" cannot be zero: "+f);if(s.hasOwnProperty(l="CRYPTO"))if(f=s[l],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))C=f;else throw C=!f,Error(be+"crypto unavailable");else C=f;else throw Error(be+l+" not true or false: "+f);if(s.hasOwnProperty(l="MODULO_MODE")&&(f=s[l],se(f,0,9,l),R=f),s.hasOwnProperty(l="POW_PRECISION")&&(f=s[l],se(f,0,Ee,l),O=f),s.hasOwnProperty(l="FORMAT"))if(f=s[l],typeof f=="object")A=f;else throw Error(be+l+" not an object: "+f);if(s.hasOwnProperty(l="ALPHABET"))if(f=s[l],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))k=f.slice(0,10)=="0123456789",M=f;else throw Error(be+l+" invalid: "+f)}else throw Error(be+"Object expected: "+s);return{DECIMAL_PLACES:h,ROUNDING_MODE:o,EXPONENTIAL_AT:[g,c],RANGE:[E,S],CRYPTO:C,MODULO_MODE:R,POW_PRECISION:O,FORMAT:A,ALPHABET:M}},y.isBigNumber=function(s){if(!s||s._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var l,f,m=s.c,a=s.e,b=s.s;e:if({}.toString.call(m)=="[object Array]"){if((b===1||b===-1)&&a>=-1e9&&a<=Ee&&a===Te(a)){if(m[0]===0){if(a===0&&m.length===1)return!0;break e}if(l=(a+1)%z,l<1&&(l+=z),String(m[0]).length==l){for(l=0;l<m.length;l++)if(f=m[l],f<0||f>=Re||f!==Te(f))break e;if(f!==0)return!0}}}else if(m===null&&a===null&&(b===null||b===1||b===-1))return!0;throw Error(be+"Invalid BigNumber: "+s)},y.maximum=y.max=function(){return D(arguments,-1)},y.minimum=y.min=function(){return D(arguments,1)},y.random=function(){var s=9007199254740992,l=Math.random()*s&2097151?function(){return Te(Math.random()*s)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var m,a,b,p,d,v=0,w=[],L=new y(u);if(f==null?f=h:se(f,0,Ee),p=ei(f/z),C)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(p*=2));v<p;)d=m[v]*131072+(m[v+1]>>>11),d>=9e15?(a=crypto.getRandomValues(new Uint32Array(2)),m[v]=a[0],m[v+1]=a[1]):(w.push(d%1e14),v+=2);v=p/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(p*=7);v<p;)d=(m[v]&31)*281474976710656+m[v+1]*1099511627776+m[v+2]*4294967296+m[v+3]*16777216+(m[v+4]<<16)+(m[v+5]<<8)+m[v+6],d>=9e15?crypto.randomBytes(7).copy(m,v):(w.push(d%1e14),v+=7);v=p/7}else throw C=!1,Error(be+"crypto unavailable");if(!C)for(;v<p;)d=l(),d<9e15&&(w[v++]=d%1e14);for(p=w[--v],f%=z,p&&f&&(d=ti[z-f],w[v]=Te(p/d)*d);w[v]===0;w.pop(),v--);if(v<0)w=[b=0];else{for(b=-1;w[0]===0;w.splice(0,1),b-=z);for(v=1,d=w[0];d>=10;d/=10,v++);v<z&&(b-=z-v)}return L.e=b,L.c=w,L}}(),y.sum=function(){for(var s=1,l=arguments,f=new y(l[0]);s<l.length;)f=f.plus(l[s++]);return f},t=function(){var s="0123456789";function l(f,m,a,b){for(var p,d=[0],v,w=0,L=f.length;w<L;){for(v=d.length;v--;d[v]*=m);for(d[0]+=b.indexOf(f.charAt(w++)),p=0;p<d.length;p++)d[p]>a-1&&(d[p+1]==null&&(d[p+1]=0),d[p+1]+=d[p]/a|0,d[p]%=a)}return d.reverse()}return function(f,m,a,b,p){var d,v,w,L,T,I,W,H,Q=f.indexOf("."),re=h,Z=o;for(Q>=0&&(L=O,O=0,f=f.replace(".",""),H=new y(m),I=H.pow(f.length-Q),O=L,H.c=l(je(Ce(I.c),I.e,"0"),10,a,s),H.e=H.c.length),W=l(f,m,a,p?(d=M,s):(d=s,M)),w=L=W.length;W[--L]==0;W.pop());if(!W[0])return d.charAt(0);if(Q<0?--w:(I.c=W,I.e=w,I.s=b,I=e(I,H,re,Z,a),W=I.c,T=I.r,w=I.e),v=w+re+1,Q=W[v],L=a/2,T=T||v<0||W[v+1]!=null,T=Z<4?(Q!=null||T)&&(Z==0||Z==(I.s<0?3:2)):Q>L||Q==L&&(Z==4||T||Z==6&&W[v-1]&1||Z==(I.s<0?8:7)),v<1||!W[0])f=T?je(d.charAt(1),-re,d.charAt(0)):d.charAt(0);else{if(W.length=v,T)for(--a;++W[--v]>a;)W[v]=0,v||(++w,W=[1].concat(W));for(L=W.length;!W[--L];);for(Q=0,f="";Q<=L;f+=d.charAt(W[Q++]));f=je(f,w,d.charAt(0))}return f}}(),e=function(){function s(m,a,b){var p,d,v,w,L=0,T=m.length,I=a%$e,W=a/$e|0;for(m=m.slice();T--;)v=m[T]%$e,w=m[T]/$e|0,p=W*v+w*I,d=I*v+p%$e*$e+L,L=(d/b|0)+(p/$e|0)+W*w,m[T]=d%b;return L&&(m=[L].concat(m)),m}function l(m,a,b,p){var d,v;if(b!=p)v=b>p?1:-1;else for(d=v=0;d<b;d++)if(m[d]!=a[d]){v=m[d]>a[d]?1:-1;break}return v}function f(m,a,b,p){for(var d=0;b--;)m[b]-=d,d=m[b]<a[b]?1:0,m[b]=d*p+m[b]-a[b];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,a,b,p,d){var v,w,L,T,I,W,H,Q,re,Z,K,he,He,st,ot,Le,We,pe=m.s==a.s?1:-1,de=m.c,te=a.c;if(!de||!de[0]||!te||!te[0])return new y(!m.s||!a.s||(de?te&&de[0]==te[0]:!te)?NaN:de&&de[0]==0||!te?pe*0:pe/0);for(Q=new y(pe),re=Q.c=[],w=m.e-a.e,pe=b+w+1,d||(d=Re,w=Me(m.e/z)-Me(a.e/z),pe=pe/z|0),L=0;te[L]==(de[L]||0);L++);if(te[L]>(de[L]||0)&&w--,pe<0)re.push(1),T=!0;else{for(st=de.length,Le=te.length,L=0,pe+=2,I=Te(d/(te[0]+1)),I>1&&(te=s(te,I,d),de=s(de,I,d),Le=te.length,st=de.length),He=Le,Z=de.slice(0,Le),K=Z.length;K<Le;Z[K++]=0);We=te.slice(),We=[0].concat(We),ot=te[0],te[1]>=d/2&&ot++;do{if(I=0,v=l(te,Z,Le,K),v<0){if(he=Z[0],Le!=K&&(he=he*d+(Z[1]||0)),I=Te(he/ot),I>1)for(I>=d&&(I=d-1),W=s(te,I,d),H=W.length,K=Z.length;l(W,Z,H,K)==1;)I--,f(W,Le<H?We:te,H,d),H=W.length,v=1;else I==0&&(v=I=1),W=te.slice(),H=W.length;if(H<K&&(W=[0].concat(W)),f(Z,W,K,d),K=Z.length,v==-1)for(;l(te,Z,Le,K)<1;)I++,f(Z,Le<K?We:te,K,d),K=Z.length}else v===0&&(I++,Z=[0]);re[L++]=I,Z[0]?Z[K++]=de[He]||0:(Z=[de[He]],K=1)}while((He++<st||Z[0]!=null)&&pe--);T=Z[0]!=null,re[0]||re.splice(0,1)}if(d==Re){for(L=1,pe=re[0];pe>=10;pe/=10,L++);U(Q,b+(Q.e=L+w*z-1)+1,p,T)}else Q.e=w,Q.r=+T;return Q}}();function N(s,l,f,m){var a,b,p,d,v;if(f==null?f=o:se(f,0,8),!s.c)return s.toString();if(a=s.c[0],p=s.e,l==null)v=Ce(s.c),v=m==1||m==2&&(p<=g||p>=c)?Wt(v,p):je(v,p,"0");else if(s=U(new y(s),l,f),b=s.e,v=Ce(s.c),d=v.length,m==1||m==2&&(l<=b||b<=g)){for(;d<l;v+="0",d++);v=Wt(v,b)}else if(l-=p,v=je(v,b,"0"),b+1>d){if(--l>0)for(v+=".";l--;v+="0");}else if(l+=b-d,l>0)for(b+1==d&&(v+=".");l--;v+="0");return s.s<0&&a?"-"+v:v}function D(s,l){for(var f,m,a=1,b=new y(s[0]);a<s.length;a++)m=new y(s[a]),(!m.s||(f=rt(b,m))===l||f===0&&b.s===l)&&(b=m);return b}function q(s,l,f){for(var m=1,a=l.length;!l[--a];l.pop());for(a=l[0];a>=10;a/=10,m++);return(f=m+f*z-1)>S?s.c=s.e=null:f<E?s.c=[s.e=0]:(s.e=f,s.c=l),s}n=function(){var s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,f=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,a=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(b,p,d,v){var w,L=d?p:p.replace(a,"");if(m.test(L))b.s=isNaN(L)?null:L<0?-1:1;else{if(!d&&(L=L.replace(s,function(T,I,W){return w=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!v||v==w?I:T}),v&&(w=v,L=L.replace(l,"$1").replace(f,"0.$1")),p!=L))return new y(L,w);if(y.DEBUG)throw Error(be+"Not a"+(v?" base "+v:"")+" number: "+p);b.s=null}b.c=b.e=null}}();function U(s,l,f,m){var a,b,p,d,v,w,L,T=s.c,I=ti;if(T){e:{for(a=1,d=T[0];d>=10;d/=10,a++);if(b=l-a,b<0)b+=z,p=l,v=T[w=0],L=Te(v/I[a-p-1]%10);else if(w=ei((b+1)/z),w>=T.length)if(m){for(;T.length<=w;T.push(0));v=L=0,a=1,b%=z,p=b-z+1}else break e;else{for(v=d=T[w],a=1;d>=10;d/=10,a++);b%=z,p=b-z+a,L=p<0?0:Te(v/I[a-p-1]%10)}if(m=m||l<0||T[w+1]!=null||(p<0?v:v%I[a-p-1]),m=f<4?(L||m)&&(f==0||f==(s.s<0?3:2)):L>5||L==5&&(f==4||m||f==6&&(b>0?p>0?v/I[a-p]:0:T[w-1])%10&1||f==(s.s<0?8:7)),l<1||!T[0])return T.length=0,m?(l-=s.e+1,T[0]=I[(z-l%z)%z],s.e=-l||0):T[0]=s.e=0,s;if(b==0?(T.length=w,d=1,w--):(T.length=w+1,d=I[z-b],T[w]=p>0?Te(v/I[a-p]%I[p])*d:0),m)for(;;)if(w==0){for(b=1,p=T[0];p>=10;p/=10,b++);for(p=T[0]+=d,d=1;p>=10;p/=10,d++);b!=d&&(s.e++,T[0]==Re&&(T[0]=1));break}else{if(T[w]+=d,T[w]!=Re)break;T[w--]=0,d=1}for(b=T.length;T[--b]===0;T.pop());}s.e>S?s.c=s.e=null:s.e<E&&(s.c=[s.e=0])}return s}function B(s){var l,f=s.e;return f===null?s.toString():(l=Ce(s.c),l=f<=g||f>=c?Wt(l,f):je(l,f,"0"),s.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var s=new y(this);return s.s<0&&(s.s=1),s},r.comparedTo=function(s,l){return rt(this,new y(s,l))},r.decimalPlaces=r.dp=function(s,l){var f,m,a,b=this;if(s!=null)return se(s,0,Ee),l==null?l=o:se(l,0,8),U(new y(b),s+b.e+1,l);if(!(f=b.c))return null;if(m=((a=f.length-1)-Me(this.e/z))*z,a=f[a])for(;a%10==0;a/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(s,l){return e(this,new y(s,l),h,o)},r.dividedToIntegerBy=r.idiv=function(s,l){return e(this,new y(s,l),0,1)},r.exponentiatedBy=r.pow=function(s,l){var f,m,a,b,p,d,v,w,L,T=this;if(s=new y(s),s.c&&!s.isInteger())throw Error(be+"Exponent not an integer: "+B(s));if(l!=null&&(l=new y(l)),d=s.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!s.c||!s.c[0])return L=new y(Math.pow(+B(T),d?s.s*(2-Bt(s)):+B(s))),l?L.mod(l):L;if(v=s.s<0,l){if(l.c?!l.c[0]:!l.s)return new y(NaN);m=!v&&T.isInteger()&&l.isInteger(),m&&(T=T.mod(l))}else{if(s.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||d&&T.c[1]>=24e7:T.c[0]<8e13||d&&T.c[0]<=9999975e7)))return b=T.s<0&&Bt(s)?-0:0,T.e>-1&&(b=1/b),new y(v?1/b:b);O&&(b=ei(O/z+2))}for(d?(f=new y(.5),v&&(s.s=1),w=Bt(s)):(a=Math.abs(+B(s)),w=a%2),L=new y(u);;){if(w){if(L=L.times(T),!L.c)break;b?L.c.length>b&&(L.c.length=b):m&&(L=L.mod(l))}if(a){if(a=Te(a/2),a===0)break;w=a%2}else if(s=s.times(f),U(s,s.e+1,1),s.e>14)w=Bt(s);else{if(a=+B(s),a===0)break;w=a%2}T=T.times(T),b?T.c&&T.c.length>b&&(T.c.length=b):m&&(T=T.mod(l))}return m?L:(v&&(L=u.div(L)),l?L.mod(l):b?U(L,O,o,p):L)},r.integerValue=function(s){var l=new y(this);return s==null?s=o:se(s,0,8),U(l,l.e+1,s)},r.isEqualTo=r.eq=function(s,l){return rt(this,new y(s,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(s,l){return rt(this,new y(s,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(s,l){return(l=rt(this,new y(s,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Me(this.e/z)>this.c.length-2},r.isLessThan=r.lt=function(s,l){return rt(this,new y(s,l))<0},r.isLessThanOrEqualTo=r.lte=function(s,l){return(l=rt(this,new y(s,l)))===-1||l===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(s,l){var f,m,a,b,p=this,d=p.s;if(s=new y(s,l),l=s.s,!d||!l)return new y(NaN);if(d!=l)return s.s=-l,p.plus(s);var v=p.e/z,w=s.e/z,L=p.c,T=s.c;if(!v||!w){if(!L||!T)return L?(s.s=-l,s):new y(T?p:NaN);if(!L[0]||!T[0])return T[0]?(s.s=-l,s):new y(L[0]?p:o==3?-0:0)}if(v=Me(v),w=Me(w),L=L.slice(),d=v-w){for((b=d<0)?(d=-d,a=L):(w=v,a=T),a.reverse(),l=d;l--;a.push(0));a.reverse()}else for(m=(b=(d=L.length)<(l=T.length))?d:l,d=l=0;l<m;l++)if(L[l]!=T[l]){b=L[l]<T[l];break}if(b&&(a=L,L=T,T=a,s.s=-s.s),l=(m=T.length)-(f=L.length),l>0)for(;l--;L[f++]=0);for(l=Re-1;m>d;){if(L[--m]<T[m]){for(f=m;f&&!L[--f];L[f]=l);--L[f],L[m]+=Re}L[m]-=T[m]}for(;L[0]==0;L.splice(0,1),--w);return L[0]?q(s,L,w):(s.s=o==3?-1:1,s.c=[s.e=0],s)},r.modulo=r.mod=function(s,l){var f,m,a=this;return s=new y(s,l),!a.c||!s.s||s.c&&!s.c[0]?new y(NaN):!s.c||a.c&&!a.c[0]?new y(a):(R==9?(m=s.s,s.s=1,f=e(a,s,0,3),s.s=m,f.s*=m):f=e(a,s,0,R),s=a.minus(f.times(s)),!s.c[0]&&R==1&&(s.s=a.s),s)},r.multipliedBy=r.times=function(s,l){var f,m,a,b,p,d,v,w,L,T,I,W,H,Q,re,Z=this,K=Z.c,he=(s=new y(s,l)).c;if(!K||!he||!K[0]||!he[0])return!Z.s||!s.s||K&&!K[0]&&!he||he&&!he[0]&&!K?s.c=s.e=s.s=null:(s.s*=Z.s,!K||!he?s.c=s.e=null:(s.c=[0],s.e=0)),s;for(m=Me(Z.e/z)+Me(s.e/z),s.s*=Z.s,v=K.length,T=he.length,v<T&&(H=K,K=he,he=H,a=v,v=T,T=a),a=v+T,H=[];a--;H.push(0));for(Q=Re,re=$e,a=T;--a>=0;){for(f=0,I=he[a]%re,W=he[a]/re|0,p=v,b=a+p;b>a;)w=K[--p]%re,L=K[p]/re|0,d=W*w+L*I,w=I*w+d%re*re+H[b]+f,f=(w/Q|0)+(d/re|0)+W*L,H[b--]=w%Q;H[b]=f}return f?++m:H.splice(0,1),q(s,H,m)},r.negated=function(){var s=new y(this);return s.s=-s.s||null,s},r.plus=function(s,l){var f,m=this,a=m.s;if(s=new y(s,l),l=s.s,!a||!l)return new y(NaN);if(a!=l)return s.s=-l,m.minus(s);var b=m.e/z,p=s.e/z,d=m.c,v=s.c;if(!b||!p){if(!d||!v)return new y(a/0);if(!d[0]||!v[0])return v[0]?s:new y(d[0]?m:a*0)}if(b=Me(b),p=Me(p),d=d.slice(),a=b-p){for(a>0?(p=b,f=v):(a=-a,f=d),f.reverse();a--;f.push(0));f.reverse()}for(a=d.length,l=v.length,a-l<0&&(f=v,v=d,d=f,l=a),a=0;l;)a=(d[--l]=d[l]+v[l]+a)/Re|0,d[l]=Re===d[l]?0:d[l]%Re;return a&&(d=[a].concat(d),++p),q(s,d,p)},r.precision=r.sd=function(s,l){var f,m,a,b=this;if(s!=null&&s!==!!s)return se(s,1,Ee),l==null?l=o:se(l,0,8),U(new y(b),s,l);if(!(f=b.c))return null;if(a=f.length-1,m=a*z+1,a=f[a]){for(;a%10==0;a/=10,m--);for(a=f[0];a>=10;a/=10,m++);}return s&&b.e+1>m&&(m=b.e+1),m},r.shiftedBy=function(s){return se(s,-9007199254740991,ji),this.times("1e"+s)},r.squareRoot=r.sqrt=function(){var s,l,f,m,a,b=this,p=b.c,d=b.s,v=b.e,w=h+4,L=new y("0.5");if(d!==1||!p||!p[0])return new y(!d||d<0&&(!p||p[0])?NaN:p?b:1/0);if(d=Math.sqrt(+B(b)),d==0||d==1/0?(l=Ce(p),(l.length+v)%2==0&&(l+="0"),d=Math.sqrt(+l),v=Me((v+1)/2)-(v<0||v%2),d==1/0?l="5e"+v:(l=d.toExponential(),l=l.slice(0,l.indexOf("e")+1)+v),f=new y(l)):f=new y(d+""),f.c[0]){for(v=f.e,d=v+w,d<3&&(d=0);;)if(a=f,f=L.times(a.plus(e(b,a,w,1))),Ce(a.c).slice(0,d)===(l=Ce(f.c)).slice(0,d))if(f.e<v&&--d,l=l.slice(d-3,d+1),l=="9999"||!m&&l=="4999"){if(!m&&(U(a,a.e+h+2,0),a.times(a).eq(b))){f=a;break}w+=4,d+=4,m=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(U(f,f.e+h+2,1),s=!f.times(f).eq(b));break}}return U(f,f.e+h+1,o,s)},r.toExponential=function(s,l){return s!=null&&(se(s,0,Ee),s++),N(this,s,l,1)},r.toFixed=function(s,l){return s!=null&&(se(s,0,Ee),s=s+this.e+1),N(this,s,l)},r.toFormat=function(s,l,f){var m,a=this;if(f==null)s!=null&&l&&typeof l=="object"?(f=l,l=null):s&&typeof s=="object"?(f=s,s=l=null):f=A;else if(typeof f!="object")throw Error(be+"Argument not an object: "+f);if(m=a.toFixed(s,l),a.c){var b,p=m.split("."),d=+f.groupSize,v=+f.secondaryGroupSize,w=f.groupSeparator||"",L=p[0],T=p[1],I=a.s<0,W=I?L.slice(1):L,H=W.length;if(v&&(b=d,d=v,v=b,H-=b),d>0&&H>0){for(b=H%d||d,L=W.substr(0,b);b<H;b+=d)L+=w+W.substr(b,d);v>0&&(L+=w+W.slice(b)),I&&(L="-"+L)}m=T?L+(f.decimalSeparator||"")+((v=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+v+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):L}return(f.prefix||"")+m+(f.suffix||"")},r.toFraction=function(s){var l,f,m,a,b,p,d,v,w,L,T,I,W=this,H=W.c;if(s!=null&&(d=new y(s),!d.isInteger()&&(d.c||d.s!==1)||d.lt(u)))throw Error(be+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+B(d));if(!H)return new y(W);for(l=new y(u),w=f=new y(u),m=v=new y(u),I=Ce(H),b=l.e=I.length-W.e-1,l.c[0]=ti[(p=b%z)<0?z+p:p],s=!s||d.comparedTo(l)>0?b>0?l:w:d,p=S,S=1/0,d=new y(I),v.c[0]=0;L=e(d,l,0,1),a=f.plus(L.times(m)),a.comparedTo(s)!=1;)f=m,m=a,w=v.plus(L.times(a=w)),v=a,l=d.minus(L.times(a=l)),d=a;return a=e(s.minus(f),m,0,1),v=v.plus(a.times(w)),f=f.plus(a.times(m)),v.s=w.s=W.s,b=b*2,T=e(w,m,b,o).minus(W).abs().comparedTo(e(v,f,b,o).minus(W).abs())<1?[w,m]:[v,f],S=p,T},r.toNumber=function(){return+B(this)},r.toPrecision=function(s,l){return s!=null&&se(s,1,Ee),N(this,s,l,2)},r.toString=function(s){var l,f=this,m=f.s,a=f.e;return a===null?m?(l="Infinity",m<0&&(l="-"+l)):l="NaN":(s==null?l=a<=g||a>=c?Wt(Ce(f.c),a):je(Ce(f.c),a,"0"):s===10&&k?(f=U(new y(f),h+a+1,o),l=je(Ce(f.c),f.e,"0")):(se(s,2,M.length,"Base"),l=t(je(Ce(f.c),a,"0"),10,s,m,!0)),m<0&&f.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return B(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&y.set(i),y}function Me(i){var e=i|0;return i>0||i===e?e:e-1}function Ce(i){for(var e,t,n=1,r=i.length,u=i[0]+"";n<r;){for(e=i[n++]+"",t=z-e.length;t--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function rt(i,e){var t,n,r=i.c,u=e.c,h=i.s,o=e.s,g=i.e,c=e.e;if(!h||!o)return null;if(t=r&&!r[0],n=u&&!u[0],t||n)return t?n?0:-o:h;if(h!=o)return h;if(t=h<0,n=g==c,!r||!u)return n?0:!r^t?1:-1;if(!n)return g>c^t?1:-1;for(o=(g=r.length)<(c=u.length)?g:c,h=0;h<o;h++)if(r[h]!=u[h])return r[h]>u[h]^t?1:-1;return g==c?0:g>c^t?1:-1}function se(i,e,t,n){if(i<e||i>t||i!==Te(i))throw Error(be+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function Bt(i){var e=i.c.length-1;return Me(i.e/z)==e&&i.c[e]%2!=0}function Wt(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function je(i,e,t){var n,r;if(e<0){for(r=t+".";++e;r+=t);i=r+i}else if(n=i.length,++e>n){for(r=t,e-=n;--e;r+=t);i+=r}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Ae=Zi(),Or=class{constructor(i){P(this,"key");P(this,"left",null);P(this,"right",null);this.key=i}},Et=class extends Or{constructor(i){super(i)}},Rr=class{constructor(){P(this,"size",0);P(this,"modificationCount",0);P(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,r=null,u=null,h=e;const o=this.compare;let g;for(;;)if(g=o(h.key,i),g>0){let c=h.left;if(c==null||(g=o(c.key,i),g>0&&(h.left=c.right,c.right=h,h=c,c=h.left,c==null)))break;t==null?n=h:t.left=h,t=h,h=c}else if(g<0){let c=h.right;if(c==null||(g=o(c.key,i),g<0&&(h.right=c.left,c.left=h,h=c,c=h.right,c==null)))break;r==null?u=h:r.right=h,r=h,h=c}else break;return r!=null&&(r.right=h.left,h.left=u),t!=null&&(t.left=h.right,h.right=n),this.root!==h&&(this.root=h,this.splayCount++),g}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,r=t.left;if(this.size--,r==null)this.root=t.right;else{const u=t.right;t=this.splayMax(r),t.right=u,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},Gt=class Ct extends Rr{constructor(t,n){super();P(this,"root",null);P(this,"compare");P(this,"validKey");P(this,an,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(r=>r!=null&&r!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let r;for(;r=n.next(),!r.done;)t(r.value,r.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new Et(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new Et(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}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(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let r=this.root.left;if(r==null)return null;let u=r.right;for(;u!=null;)r=u,u=r.right;return r.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let r=this.root.right;if(r==null)return null;let u=r.left;for(;u!=null;)r=u,u=r.left;return r.key}retainAll(t){const n=new Ct(this.compare,this.validKey),r=this.modificationCount;for(const u of t){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(u)&&this.splay(u)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new Ct(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new Ct(this.compare,this.validKey);for(const r of this)t.has(r)||n.add(r);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new Ct(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(u,h){let o,g;do{if(o=u.left,g=u.right,o!=null){const c=new Et(o.key);h.left=c,n(o,c)}if(g!=null){const c=new Et(g.key);h.right=c,u=g,h=c}}while(g!=null)}const r=new Et(t.key);return n(t,r),r}toSet(){return this.clone()}entries(){return new Ir(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(fn=Symbol.iterator,an=Symbol.toStringTag,fn)](){return new Pr(this.wrap())}},Hi=class{constructor(i){P(this,"tree");P(this,"path",new Array);P(this,"modificationCount",null);P(this,"splayCount");this.tree=i,this.splayCount=i.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 i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.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 i=this.path[this.path.length-1],e=i.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===i;)i=this.path.pop();return this.path.length>0}},Pr=class extends Hi{getValue(i){return i.key}},Ir=class extends Hi{getValue(i){return[i.key,i.key]}},Vi=i=>()=>i,ii=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):Vi(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function Ar(i){const e=i?(t,n,r,u,h)=>t.exponentiatedBy(2).isLessThanOrEqualTo(u.minus(n).exponentiatedBy(2).plus(h.minus(r).exponentiatedBy(2)).times(i)):Vi(!1);return(t,n,r)=>{const u=t.x,h=t.y,o=r.x,g=r.y,c=h.minus(g).times(n.x.minus(o)).minus(u.minus(o).times(n.y.minus(g)));return e(c,u,h,o,g)?0:c.comparedTo(0)}}var Br=i=>i,Wr=i=>{if(i){const e=new Gt(ii(i)),t=new Gt(ii(i)),n=(u,h)=>h.addAndReturn(u),r=u=>({x:n(u.x,e),y:n(u.y,t)});return r({x:new Ae(0),y:new Ae(0)}),r}return Br},ni=i=>({set:e=>{Ze=ni(e)},reset:()=>ni(i),compare:ii(i),snap:Wr(i),orient:Ar(i)}),Ze=ni(),Lt=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),ri=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,r=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,u=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:u}}},Dt=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),Ki=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),zt=i=>Ki(i,i).sqrt(),Gr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Dt(r,n).div(zt(r)).div(zt(n))},Dr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Ki(r,n).div(zt(r)).div(zt(n))},Yi=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},Qi=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},zr=(i,e,t,n)=>{if(e.x.isZero())return Qi(t,n,i.x);if(n.x.isZero())return Qi(i,e,t.x);if(e.y.isZero())return Yi(t,n,i.y);if(n.y.isZero())return Yi(i,e,t.y);const r=Dt(e,n);if(r.isZero())return null;const u={x:t.x.minus(i.x),y:t.y.minus(i.y)},h=Dt(u,e).div(r),o=Dt(u,n).div(r),g=i.x.plus(o.times(e.x)),c=t.x.plus(h.times(n.x)),E=i.y.plus(o.times(e.y)),S=t.y.plus(h.times(n.y)),C=g.plus(c).div(2),R=E.plus(S).div(2);return{x:C,y:R}},Be=class wn{constructor(e,t){P(this,"point");P(this,"isLeft");P(this,"segment");P(this,"otherSE");P(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}static compare(e,t){const n=wn.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:qt.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}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const u=t[n];this.point.events.push(u),u.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const u=this.point.events[r];u.consumedBy===void 0&&n.otherSE.point.events===u.otherSE.point.events&&n.segment.consume(u.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const u=r.otherSE;t.set(r,{sine:Gr(this.point,e.point,u.point),cosine:Dr(this.point,e.point,u.point)})};return(r,u)=>{t.has(r)||n(r),t.has(u)||n(u);const{sine:h,cosine:o}=t.get(r),{sine:g,cosine:c}=t.get(u);return h.isGreaterThanOrEqualTo(0)&&g.isGreaterThanOrEqualTo(0)?o.isLessThan(c)?1:o.isGreaterThan(c)?-1:0:h.isLessThan(0)&&g.isLessThan(0)?o.isLessThan(c)?-1:o.isGreaterThan(c)?1:0:g.isLessThan(h)?-1:g.isGreaterThan(h)?1:0}}},Ur=class pi{constructor(e){P(this,"events");P(this,"poly");P(this,"_isExteriorRing");P(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const u=e[n];if(!u.isInResult()||u.ringOut)continue;let h=null,o=u.leftSE,g=u.rightSE;const c=[o],E=o.point,S=[];for(;h=o,o=g,c.push(o),o.point!==E;)for(;;){const C=o.getAvailableLinkedEvents();if(C.length===0){const A=c[0].point,M=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${A.x}, ${A.y}]. Last matching segment found ends at [${M.x}, ${M.y}].`)}if(C.length===1){g=C[0].otherSE;break}let R=null;for(let A=0,M=S.length;A<M;A++)if(S[A].point===o.point){R=A;break}if(R!==null){const A=S.splice(R)[0],M=c.splice(A.index);M.unshift(M[0].otherSE),t.push(new pi(M.reverse()));continue}S.push({index:c.length,point:o.point});const O=o.getLeftmostComparator(h);g=C.sort(O)[0].otherSE;break}t.push(new pi(c))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let c=1,E=this.events.length-1;c<E;c++){const S=this.events[c].point,C=this.events[c+1].point;Ze.orient(S,e,C)!==0&&(t.push(S),e=S)}if(t.length===1)return null;const n=t[0],r=t[1];Ze.orient(n,e,r)===0&&t.shift(),t.push(t[0]);const u=this.isExteriorRing()?1:-1,h=this.isExteriorRing()?0:t.length-1,o=this.isExteriorRing()?t.length:-1,g=[];for(let c=h;c!=o;c+=u)g.push([t[c].x.toNumber(),t[c].y.toNumber()]);return g}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(){var r,u;let e=this.events[0];for(let h=1,o=this.events.length;h<o;h++){const g=this.events[h];Be.compare(e,g)>0&&(e=g)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return((r=n.ringOut)==null?void 0:r.enclosingRing())!==t.ringOut?t.ringOut:(u=t.ringOut)==null?void 0:u.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},Xi=class{constructor(i){P(this,"exteriorRing");P(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}},qr=class{constructor(i){P(this,"rings");P(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,r=i.length;n<r;n++){const u=i[n];if(!u.poly)if(u.isExteriorRing())e.push(new Xi(u));else{const h=u.enclosingRing();h!=null&&h.poly||e.push(new Xi(h)),(t=h==null?void 0:h.poly)==null||t.addInterior(u)}}return e}},Fr=class{constructor(i,e=qt.compare){P(this,"queue");P(this,"tree");P(this,"segments");this.queue=i,this.tree=new Gt(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,r=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do r=this.tree.firstAfter(r);while(r!=null&&r.consumedBy!=null);if(i.isLeft){let u=null;if(n){const o=n.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(u=o),!n.isAnEndpoint(o))){const g=this._splitSafely(n,o);for(let c=0,E=g.length;c<E;c++)t.push(g[c])}}let h=null;if(r){const o=r.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(h=o),!r.isAnEndpoint(o))){const g=this._splitSafely(r,o);for(let c=0,E=g.length;c<E;c++)t.push(g[c])}}if(u!==null||h!==null){let o=null;u===null?o=h:h===null?o=u:o=Be.comparePoints(u,h)<=0?u:h,this.queue.delete(e.rightSE),t.push(e.rightSE);const g=e.split(o);for(let c=0,E=g.length;c<E;c++)t.push(g[c])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&r){const u=n.getIntersection(r);if(u!==null){if(!n.isAnEndpoint(u)){const h=this._splitSafely(n,u);for(let o=0,g=h.length;o<g;o++)t.push(h[o])}if(!r.isAnEndpoint(u)){const h=this._splitSafely(r,u);for(let o=0,g=h.length;o<g;o++)t.push(h[o])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},jr=class{constructor(){P(this,"type");P(this,"numMultiPolys")}run(i,e,t){_t.type=i;const n=[new $i(e,!0)];for(let c=0,E=t.length;c<E;c++)n.push(new $i(t[c],!1));if(_t.numMultiPolys=n.length,_t.type==="difference"){const c=n[0];let E=1;for(;E<n.length;)ri(n[E].bbox,c.bbox)!==null?E++:n.splice(E,1)}if(_t.type==="intersection")for(let c=0,E=n.length;c<E;c++){const S=n[c];for(let C=c+1,R=n.length;C<R;C++)if(ri(S.bbox,n[C].bbox)===null)return[]}const r=new Gt(Be.compare);for(let c=0,E=n.length;c<E;c++){const S=n[c].getSweepEvents();for(let C=0,R=S.length;C<R;C++)r.add(S[C])}const u=new Fr(r);let h=null;for(r.size!=0&&(h=r.first(),r.delete(h));h;){const c=u.process(h);for(let E=0,S=c.length;E<S;E++){const C=c[E];C.consumedBy===void 0&&r.add(C)}r.size!=0?(h=r.first(),r.delete(h)):h=null}Ze.reset();const o=Ur.factory(u.segments);return new qr(o).getGeom()}},_t=new jr,Ut=_t,Zr=0,qt=class Ht{constructor(e,t,n,r){P(this,"id");P(this,"leftSE");P(this,"rightSE");P(this,"rings");P(this,"windings");P(this,"ringOut");P(this,"consumedBy");P(this,"prev");P(this,"_prevInResult");P(this,"_beforeState");P(this,"_afterState");P(this,"_isInResult");this.id=++Zr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,u=e.rightSE.point.x,h=t.rightSE.point.x;if(h.isLessThan(n))return 1;if(u.isLessThan(r))return-1;const o=e.leftSE.point.y,g=t.leftSE.point.y,c=e.rightSE.point.y,E=t.rightSE.point.y;if(n.isLessThan(r)){if(g.isLessThan(o)&&g.isLessThan(c))return 1;if(g.isGreaterThan(o)&&g.isGreaterThan(c))return-1;const S=e.comparePoint(t.leftSE.point);if(S<0)return 1;if(S>0)return-1;const C=t.comparePoint(e.rightSE.point);return C!==0?C:-1}if(n.isGreaterThan(r)){if(o.isLessThan(g)&&o.isLessThan(E))return-1;if(o.isGreaterThan(g)&&o.isGreaterThan(E))return 1;const S=t.comparePoint(e.leftSE.point);if(S!==0)return S;const C=e.comparePoint(t.rightSE.point);return C<0?1:C>0?-1:1}if(o.isLessThan(g))return-1;if(o.isGreaterThan(g))return 1;if(u.isLessThan(h)){const S=t.comparePoint(e.rightSE.point);if(S!==0)return S}if(u.isGreaterThan(h)){const S=e.comparePoint(t.rightSE.point);if(S<0)return 1;if(S>0)return-1}if(!u.eq(h)){const S=c.minus(o),C=u.minus(n),R=E.minus(g),O=h.minus(r);if(S.isGreaterThan(C)&&R.isLessThan(O))return 1;if(S.isLessThan(C)&&R.isGreaterThan(O))return-1}return u.isGreaterThan(h)?1:u.isLessThan(h)||c.isLessThan(E)?-1:c.isGreaterThan(E)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,u,h;const o=Be.comparePoints(e,t);if(o<0)r=e,u=t,h=1;else if(o>0)r=t,u=e,h=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const g=new Be(r,!0),c=new Be(u,!1);return new Ht(g,c,[n],[h])}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 Ze.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=ri(t,n);if(r===null)return null;const u=this.leftSE.point,h=this.rightSE.point,o=e.leftSE.point,g=e.rightSE.point,c=Lt(t,o)&&this.comparePoint(o)===0,E=Lt(n,u)&&e.comparePoint(u)===0,S=Lt(t,g)&&this.comparePoint(g)===0,C=Lt(n,h)&&e.comparePoint(h)===0;if(E&&c)return C&&!S?h:!C&&S?g:null;if(E)return S&&u.x.eq(g.x)&&u.y.eq(g.y)?null:u;if(c)return C&&h.x.eq(o.x)&&h.y.eq(o.y)?null:o;if(C&&S)return null;if(C)return h;if(S)return g;const R=zr(u,this.vector(),o,e.vector());return R===null||!Lt(r,R)?null:Ze.snap(R)}split(e){const t=[],n=e.events!==void 0,r=new Be(e,!0),u=new Be(e,!1),h=this.rightSE;this.replaceRightSE(u),t.push(u),t.push(r);const o=new Ht(r,h,this.rings.slice(),this.windings.slice());return Be.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),Be.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),u.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,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=Ht.compare(t,n);if(r!==0){if(r>0){const u=t;t=n,n=u}if(t.prev===n){const u=t;t=n,n=u}for(let u=0,h=n.rings.length;u<h;u++){const o=n.rings[u],g=n.windings[u],c=t.rings.indexOf(o);c===-1?(t.rings.push(o),t.windings.push(g)):t.windings[c]+=g}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.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,n=this._afterState.windings,r=this._afterState.multiPolys;for(let o=0,g=this.rings.length;o<g;o++){const c=this.rings[o],E=this.windings[o],S=t.indexOf(c);S===-1?(t.push(c),n.push(E)):n[S]+=E}const u=[],h=[];for(let o=0,g=t.length;o<g;o++){if(n[o]===0)continue;const c=t[o],E=c.poly;if(h.indexOf(E)===-1)if(c.isExterior)u.push(E);else{h.indexOf(E)===-1&&h.push(E);const S=u.indexOf(c.poly);S!==-1&&u.splice(S,1)}}for(let o=0,g=u.length;o<g;o++){const c=u[o].multiPoly;r.indexOf(c)===-1&&r.push(c)}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(Ut.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===Ut.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}}return this._isInResult}},Ji=class{constructor(i,e,t){P(this,"poly");P(this,"isExterior");P(this,"segments");P(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=Ze.snap({x:new Ae(i[0][0]),y:new Ae(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let u=1,h=i.length;u<h;u++){if(typeof i[u][0]!="number"||typeof i[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Ze.snap({x:new Ae(i[u][0]),y:new Ae(i[u][1])});o.x.eq(r.x)&&o.y.eq(r.y)||(this.segments.push(qt.fromRing(r,o,this)),o.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=o.x),o.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=o.y),o.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=o.x),o.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=o.y),r=o)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(qt.fromRing(r,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},Hr=class{constructor(i,e){P(this,"multiPoly");P(this,"exteriorRing");P(this,"interiorRings");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ji(i[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,n=i.length;t<n;t++){const r=new Ji(i[t],this,!1);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},$i=class{constructor(i,e){P(this,"isSubject");P(this,"polys");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:new Ae(Number.POSITIVE_INFINITY),y:new Ae(Number.POSITIVE_INFINITY)},ur:{x:new Ae(Number.NEGATIVE_INFINITY),y:new Ae(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const r=new Hr(i[t],this);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},Vr=(i,...e)=>Ut.run("union",i,e),Kr=(i,...e)=>Ut.run("difference",i,e);Ze.set;function en(i,e,t){if(i!==null)for(var n,r,u,h,o,g,c,E=0,S=0,C,R=i.type,O=R==="FeatureCollection",A=R==="Feature",M=O?i.features.length:1,k=0;k<M;k++){c=O?i.features[k].geometry:A?i.geometry:i,C=c?c.type==="GeometryCollection":!1,o=C?c.geometries.length:1;for(var y=0;y<o;y++){var N=0,D=0;if(h=C?c.geometries[y]:c,h!==null){g=h.coordinates;var q=h.type;switch(E=0,q){case null:break;case"Point":if(e(g,S,k,N,D)===!1)return!1;S++,N++;break;case"LineString":case"MultiPoint":for(n=0;n<g.length;n++){if(e(g[n],S,k,N,D)===!1)return!1;S++,q==="MultiPoint"&&N++}q==="LineString"&&N++;break;case"Polygon":case"MultiLineString":for(n=0;n<g.length;n++){for(r=0;r<g[n].length-E;r++){if(e(g[n][r],S,k,N,D)===!1)return!1;S++}q==="MultiLineString"&&N++,q==="Polygon"&&D++}q==="Polygon"&&N++;break;case"MultiPolygon":for(n=0;n<g.length;n++){for(D=0,r=0;r<g[n].length;r++){for(u=0;u<g[n][r].length-E;u++){if(e(g[n][r][u],S,k,N,D)===!1)return!1;S++}D++}N++}break;case"GeometryCollection":for(n=0;n<h.geometries.length;n++)if(en(h.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function si(i,e){var t,n,r,u,h,o,g,c,E,S,C=0,R=i.type==="FeatureCollection",O=i.type==="Feature",A=R?i.features.length:1;for(t=0;t<A;t++){for(o=R?i.features[t].geometry:O?i.geometry:i,c=R?i.features[t].properties:O?i.properties:{},E=R?i.features[t].bbox:O?i.bbox:void 0,S=R?i.features[t].id:O?i.id:void 0,g=o?o.type==="GeometryCollection":!1,h=g?o.geometries.length:1,r=0;r<h;r++){if(u=g?o.geometries[r]:o,u===null){if(e(null,C,c,E,S)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,C,c,E,S)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],C,c,E,S)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function Yr(i,e){si(i,function(t,n,r,u,h){var o=t===null?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return e(bt(t,r,{bbox:u,id:h}),n,0)===!1?!1:void 0}var g;switch(o){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var c=0;c<t.coordinates.length;c++){var E=t.coordinates[c],S={type:g,coordinates:E};if(e(bt(S,r),n,c)===!1)return!1}})}function Qr(i,e={}){const t=[];if(si(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Vr(t[0],...t.slice(1));return n.length===0?null:n.length===1?$t(n[0],e.properties):qi(n,e.properties)}var tn=Qr;function Xr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return en(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var nn=Xr;function Jr(i){const e=[];if(si(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=Kr(e[0],...e.slice(1));return n.length===0?null:n.length===1?$t(n[0],t):qi(n,t)}var $r=Jr;function es(i){if(!i)throw new Error("geojson is required");var e=[];return Yr(i,function(t){e.push(t)}),wt(e)}var ts=es;function rn(i,e){const t=$r(wt([$t([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=At(nn(i)),r=(n[2]-n[0])/360/1e3,u=n[0]<-180,h=n[2]>180,o=ts(i);if(o.features.length>1&&(u||h))for(const g of o.features){const c=At(nn(g));if(h&&c[0]<-180+r)for(const E of g.geometry.coordinates)for(const S of E)S[0]+=360-r;if(u&&c[2]>180-r)for(const E of g.geometry.coordinates)for(const S of E)S[0]-=360-r}e(wt([o.features.length<2?i:tn(o)??i,t]))}const sn={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}},Ft="mtlr-gc-full-geom",on="mtlr-gc-full-geom-fill",ln="mtlr-gc-full-geom-line";function un(i,e,t=!0,n=!0,r={},u={},h=sn){let o;const g=[];let c,E,S;function C(){if(!i.loaded){i.once("load",C);return}const M=h?h===!0?sn:h:void 0;if(!(M!=null&&M.fill)&&!(M!=null&&M.line))return;const k=i.getSource(Ft);if(k)k.setData(S??wt([]));else if(S)i.addSource(Ft,{type:"geojson",data:S});else return;!i.getLayer(on)&&(M!=null&&M.fill)&&i.addLayer({...M==null?void 0:M.fill,id:on,type:"fill",source:Ft}),!i.getLayer(ln)&&(M!=null&&M.line)&&i.addLayer({...M==null?void 0:M.line,id:ln,type:"line",source:Ft})}function R(M){S=M,C()}i.on("styledata",()=>{setTimeout(()=>{S&&C()})});const O=M=>{o==null||o({type:"mapClick",coordinates:[M.lngLat.lng,M.lngLat.lat]})};function A(M=!1){if(!e)throw new Error;const k=document.createElement("div");return M&&k.classList.add("marker-interactive"),new sr({props:{displayIn:"maplibre"},target:k}),new e.Marker({element:k,offset:[1,-13]})}return{setEventHandler(M){M?(o=M,i.on("click",O)):(o=void 0,i.off("click",O))},flyTo(M,k){i.flyTo({center:M,...k?{zoom:k}:{},...r})},fitBounds(M,k,y){i.fitBounds([[M[0],M[1]],[M[2],M[3]]],{padding:k,...y?{maxZoom:y}:{},...u})},indicateReverse(M){i.getCanvasContainer().style.cursor=M?"crosshair":""},setReverseMarker(M){!e||!t||(E?M?E.setLngLat(M):(E.remove(),E=void 0):M&&(t instanceof Function?E=t(i)??void 0:(E=(typeof t=="object"?new e.Marker(t):A()).setLngLat(M).addTo(i),E.getElement().classList.add("marker-reverse"))))},setFeatures(M,k,y){for(const N of g)N.remove();if(g.length=0,R(void 0),!!e){e:if(k){let N=!1;if(k.geometry.type==="GeometryCollection"){const D=k.geometry.geometries.filter(q=>q.type==="Polygon"||q.type==="MultiPolygon");t:if(D.length>0){const q=tn(wt(D.map(U=>bt(U))));if(!q)break t;rn({...k,geometry:q.geometry},R),N=!0}else{const q=k.geometry.geometries.filter(U=>U.type==="LineString"||U.type==="MultiLineString");q.length>0&&(R({...k,geometry:{type:"GeometryCollection",geometries:q}}),N=!0)}}if(!N){if(k.geometry.type==="Polygon"||k.geometry.type==="MultiPolygon")rn(k,R);else if(k.geometry.type==="LineString"||k.geometry.type==="MultiLineString"){R(k);break e}}if(!y&&k.geometry.type!=="Point")break e;if(t instanceof Function){const D=t(i,k);D&&g.push(D)}else t&&g.push(typeof t=="object"?new e.Marker(t):A().setLngLat(k.center).addTo(i))}if(n)for(const N of M??[]){if(N===k)continue;let D;if(n instanceof Function){if(D=n(i,N),!D)continue}else D=(typeof n=="object"?new e.Marker(n):A(!0)).setLngLat(N.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,""))).addTo(i);const q=D.getElement();q.addEventListener("click",U=>{U.stopPropagation(),o==null||o({type:"markerClick",id:N.id})}),q.addEventListener("mouseenter",()=>{o==null||o({type:"markerMouseEnter",id:N.id}),D.togglePopup()}),q.addEventListener("mouseleave",()=>{o==null||o({type:"markerMouseLeave",id:N.id}),D.togglePopup()}),g.push(D)}}},setSelectedMarker(M){c&&c.getElement().classList.toggle("marker-selected",!1),c=M>-1?g[M]:void 0,c==null||c.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const M=i.getCenter();return[i.getZoom(),M.lng,M.lat]}}}function is(i,e,t){var O,A;class n{constructor(k,y){P(this,"type");P(this,"target");this.type=y,this.target=k}}class r extends n{constructor(y,N){super(y,"select");P(this,"feature");Object.assign(this,N)}}class u extends n{constructor(y,N){super(y,"featureslisted");P(this,"features");this.features=N}}class h extends n{constructor(y,N){super(y,"featuresmarked");P(this,"features");this.features=N}}class o extends n{constructor(y,N){super(y,"optionsvisibilitychange");P(this,"optionsVisible");this.optionsVisible=N}}class g extends n{constructor(y,N){super(y,"pick");P(this,"feature");this.feature=N}}class c extends n{constructor(y,N){super(y,"querychange");P(this,"query");this.query=N}}class E extends n{constructor(y,N,D){super(y,"response");P(this,"url");P(this,"featureCollection");this.url=N,this.featureCollection=D}}class S extends n{constructor(y,N){super(y,"reversetoggle");P(this,"reverse");this.reverse=N}}class C extends i{constructor(y={}){super();gi(this,O);gi(this,A);mi(this,A,y)}onAddInt(y){const N=document.createElement("div");N.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:D,showResultMarkers:q,flyTo:U,fullGeometryStyle:B,...s}=fe(this,A),l=typeof U=="boolean"?{}:U,m={mapController:un(y,e,D,q,l,l,B),flyTo:U===void 0?!0:!!U,apiKey:"",...t==null?void 0:t(y,N),...s};if(!m.apiKey)throw new Error("no apiKey provided");return mi(this,O,new Nr({target:N,props:m})),fe(this,O).$on("select",a=>{this.fire(new r(this,a.detail))}),fe(this,O).$on("pick",a=>{this.fire(new g(this,a.detail.feature))}),fe(this,O).$on("featureslisted",a=>{this.fire(new u(this,a.detail.features))}),fe(this,O).$on("featuresmarked",a=>{this.fire(new h(this,a.detail.features))}),fe(this,O).$on("response",a=>{this.fire(new E(this,a.detail.url,a.detail.featureCollection))}),fe(this,O).$on("optionsvisibilitychange",a=>{this.fire(new o(this,a.detail.optionsVisible))}),fe(this,O).$on("reversetoggle",a=>{this.fire(new S(this,a.detail.reverse))}),fe(this,O).$on("querychange",a=>{this.fire(new c(this,a.detail.query))}),N}on(y,N){return super.on(y,N)}once(y,N){return super.once(y,N)}off(y,N){return super.off(y,N)}listens(y){return super.listens(y)}setOptions(y){var s;Object.assign(fe(this,A),y);const{marker:N,showResultMarkers:D,flyTo:q,fullGeometryStyle:U,...B}=fe(this,A);(s=fe(this,O))==null||s.$set(B)}setQuery(y,N=!0){var D;(D=fe(this,O))==null||D.setQuery(y,N)}clearMap(){var y;(y=fe(this,O))==null||y.clearMap()}clearList(){var y;(y=fe(this,O))==null||y.clearList()}setReverseMode(y){var N;(N=fe(this,O))==null||N.$set({reverseActive:y})}focus(y){var N;(N=fe(this,O))==null||N.focus(y)}blur(){var y;(y=fe(this,O))==null||y.blur()}onRemove(){var y;(y=fe(this,O))==null||y.$destroy()}}return O=new WeakMap,A=new WeakMap,{MapLibreBasedGeocodingControl:C,events:{SelectEvent:r,FeaturesListedEvent:u,FeaturesMarkedEvent:h,OptionsVisibilityChangeEvent:o,PickEvent:g,QueryChangeEvent:c,ResponseEvent:E,ReverseToggleEvent:S}}}const ns="@maptiler/geocoding-control",rs="2.1.3",{MapLibreBasedGeocodingControl:ss,events:et}=is(dt.Evented,dt,(i,e)=>{const t={};if(!("getSdkConfig"in i&&typeof i.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:n,apiKey:r}=i.getSdkConfig();t.apiKey=r;const u=/^([a-z]{2})($|_|-)/.exec(n);return u&&(t.language=u[1]),e.className+=" maptiler-ctrl",t});class os extends ss{onAdd(e){var t;return(t=e.telemetry)==null||t.registerModule(ns,rs),super.onAddInt(e)}}const ls=et.SelectEvent,us=et.FeaturesListedEvent,as=et.FeaturesMarkedEvent,fs=et.OptionsVisibilityChangeEvent,cs=et.PickEvent,hs=et.QueryChangeEvent,ds=et.ResponseEvent,gs=et.ReverseToggleEvent;j.FeaturesListedEvent=us,j.FeaturesMarkedEvent=as,j.GeocodingControl=os,j.OptionsVisibilityChangeEvent=fs,j.PickEvent=cs,j.QueryChangeEvent=hs,j.ResponseEvent=ds,j.ReverseToggleEvent=gs,j.SelectEvent=ls,j.createMapLibreGlMapController=un,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
|
14
14
|
//# sourceMappingURL=maptilersdk.umd.js.map
|