@maptiler/geocoding-control 1.4.2-dev.2 → 1.4.2-dev.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.
@@ -1,4 +1,4 @@
1
- (function(O,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],B):(O=typeof globalThis<"u"?globalThis:O||self,B(O.maptilersdkMaptilerGeocoder={},O.maptilersdk))})(this,function(O,B){"use strict";var Yr=Object.defineProperty;var Di=O=>{throw TypeError(O)};var Kr=(O,B,X)=>B in O?Yr(O,B,{enumerable:!0,configurable:!0,writable:!0,value:X}):O[B]=X;var Ut=(O,B,X)=>Kr(O,typeof B!="symbol"?B+"":B,X),Ui=(O,B,X)=>B.has(O)||Di("Cannot "+X);var ue=(O,B,X)=>(Ui(O,B,"read from private field"),X?X.call(O):B.get(O)),zt=(O,B,X)=>B.has(O)?Di("Cannot add the same private member more than once"):B instanceof WeakSet?B.add(O):B.set(O,X),dt=(O,B,X,Ke)=>(Ui(O,B,"write to private field"),Ke?Ke.call(O,X):B.set(O,X),X);var ne,Te;function X(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Ke=X(B);function D(){}function zi(n,e){for(const t in e)n[t]=e[t];return n}function Ft(n){return n()}function jt(){return Object.create(null)}function me(n){n.forEach(Ft)}function Zt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Xe;function J(n,e){return n===e?!0:(Xe||(Xe=document.createElement("a")),Xe.href=e,n===Xe.href)}function Fi(n){return Object.keys(n).length===0}function ji(n,e,t,i){if(n){const r=qt(n,e,t,i);return n[0](r)}}function qt(n,e,t,i){return n[1]&&i?zi(t.ctx.slice(),n[1](i(e))):t.ctx}function Zi(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function qi(n,e,t,i,r,o){if(r){const l=qt(e,t,i,o);n.p(l,r)}}function Gi(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Gt(n){return n??""}function T(n,e){n.appendChild(e)}function z(n,e,t){n.insertBefore(e,t||null)}function U(n){n.parentNode&&n.parentNode.removeChild(n)}function A(n){return document.createElement(n)}function ae(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function we(n){return document.createTextNode(n)}function ie(){return we(" ")}function Qi(){return we("")}function ee(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Hi(n){return function(e){return e.preventDefault(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Vi(n){return Array.from(n.childNodes)}function Ue(n,e){e=""+e,n.data!==e&&(n.data=e)}function Qt(n,e){n.value=e??""}function se(n,e,t){n.classList.toggle(e,!!t)}function Yi(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let ze;function Fe(n){ze=n}function Ht(){if(!ze)throw new Error("Function called outside component initialization");return ze}function Ki(n){Ht().$$.on_destroy.push(n)}function Xi(){const n=Ht();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const o=Yi(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}function Vt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Re=[],ht=[];let Ie=[];const Yt=[],Ji=Promise.resolve();let gt=!1;function $i(){gt||(gt=!0,Ji.then(Kt))}function mt(n){Ie.push(n)}const pt=new Set;let Oe=0;function Kt(){if(Oe!==0)return;const n=ze;do{try{for(;Oe<Re.length;){const e=Re[Oe];Oe++,Fe(e),en(e.$$)}}catch(e){throw Re.length=0,Oe=0,e}for(Fe(null),Re.length=0,Oe=0;ht.length;)ht.pop()();for(let e=0;e<Ie.length;e+=1){const t=Ie[e];pt.has(t)||(pt.add(t),t())}Ie.length=0}while(Re.length);for(;Yt.length;)Yt.pop()();gt=!1,pt.clear(),Fe(n)}function en(n){if(n.fragment!==null){n.update(),me(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(mt)}}function tn(n){const e=[],t=[];Ie.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Ie=e}const Je=new Set;let Ne;function $e(){Ne={r:0,c:[],p:Ne}}function et(){Ne.r||me(Ne.c),Ne=Ne.p}function Q(n,e){n&&n.i&&(Je.delete(n),n.i(e))}function K(n,e,t,i){if(n&&n.o){if(Je.has(n))return;Je.add(n),Ne.c.push(()=>{Je.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function Xt(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function nn(n,e){K(n,1,1,()=>{e.delete(n.key)})}function rn(n,e,t,i,r,o,l,s,c,u,d,a){let f=n.length,h=o.length,y=f;const b={};for(;y--;)b[n[y].key]=y;const v=[],m=new Map,E=new Map,S=[];for(y=h;y--;){const L=a(r,o,y),w=t(L);let C=l.get(w);C?S.push(()=>C.p(L,e)):(C=u(w,L),C.c()),m.set(w,v[y]=C),w in b&&E.set(w,Math.abs(y-b[w]))}const _=new Set,k=new Set;function x(L){Q(L,1),L.m(s,d),l.set(L.key,L),d=L.first,h--}for(;f&&h;){const L=v[h-1],w=n[f-1],C=L.key,I=w.key;L===w?(d=L.first,f--,h--):m.has(I)?!l.has(C)||_.has(C)?x(L):k.has(I)?f--:E.get(C)>E.get(I)?(k.add(C),x(L)):(_.add(I),f--):(c(w,l),f--)}for(;f--;){const L=n[f];m.has(L.key)||c(L,l)}for(;h;)x(v[h-1]);return me(S),v}function _e(n){n&&n.c()}function pe(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),mt(()=>{const o=n.$$.on_mount.map(Ft).filter(Zt);n.$$.on_destroy?n.$$.on_destroy.push(...o):me(o),n.$$.on_mount=[]}),r.forEach(mt)}function ve(n,e){const t=n.$$;t.fragment!==null&&(tn(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function on(n,e){n.$$.dirty[0]===-1&&(Re.push(n),$i(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ee(n,e,t,i,r,o,l=null,s=[-1]){const c=ze;Fe(n);const u=n.$$={fragment:null,ctx:[],props:o,update:D,not_equal:r,bound:jt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:jt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let d=!1;if(u.ctx=t?t(n,e.props||{},(a,f,...h)=>{const y=h.length?h[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=y)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](y),d&&on(n,a)),f}):[],u.update(),d=!0,me(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const a=Vi(e.target);u.fragment&&u.fragment.l(a),a.forEach(U)}else u.fragment&&u.fragment.c();e.intro&&Q(n.$$.fragment),pe(n,e.target,e.anchor),Kt()}Fe(c)}class Le{constructor(){Ut(this,"$$");Ut(this,"$$set")}$destroy(){ve(this,1),this.$destroy=D}$on(e,t){if(!Zt(t))return D;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!Fi(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const sn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(sn);function ln(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),p(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"),p(e,"viewBox","0 0 14 14"),p(e,"width","13"),p(e,"height","13"),p(e,"class","svelte-en2qvf")},m(i,r){z(i,e,r),T(e,t)},p:D,i:D,o:D,d(i){i&&U(e)}}}class Jt extends Le{constructor(e){super(),Ee(this,e,null,ln,be,{})}}function un(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),p(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"),p(e,"viewBox","0 0 30 30"),p(e,"fill","none"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"class","svelte-d2loi5")},m(i,r){z(i,e,r),T(e,t)},p:D,i:D,o:D,d(i){i&&U(e)}}}class $t extends Le{constructor(e){super(),Ee(this,e,null,un,be,{})}}function an(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"area.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function cn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function fn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"poi.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function dn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"postal_code.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function hn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"street.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function gn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"road.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function mn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function pn(n){let e,t,i,r;return{c(){e=A("img"),J(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[4]),p(e,"class","svelte-ltkwvy")},m(o,l){z(o,e,l),i||(r=ee(e,"error",n[14]),i=!0)},p(o,l){l&32&&!J(e.src,t=o[5])&&p(e,"src",t),l&16&&p(e,"alt",o[4])},d(o){o&&U(e),i=!1,r()}}}function ei(n){let e,t;return{c(){e=A("span"),t=we(n[6]),p(e,"class","secondary svelte-ltkwvy")},m(i,r){z(i,e,r),T(e,t)},p(i,r){r&64&&Ue(t,i[6])},d(i){i&&U(e)}}}function vn(n){let e,t,i,r,o,l,s,c,u,d=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",a,f,h=n[2]==="always"||n[2]&&!n[0].address&&!n[0].id.startsWith("road.")&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],y,b,v=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",m,E,S;function _(w,C){return C&1&&(t=null),C&1&&(i=null),C&1&&(r=null),C&1&&(o=null),w[5]?pn:w[0].address?mn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?gn:(i==null&&(i=!!w[0].id.startsWith("address.")),i?hn:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?dn:(o==null&&(o=!!w[0].id.startsWith("poi.")),o?fn:w[7]?cn:an))))}let k=_(n,-1),x=k(n),L=h&&ei(n);return{c(){e=A("li"),x.c(),l=ie(),s=A("span"),c=A("span"),u=A("span"),a=we(d),f=ie(),L&&L.c(),y=ie(),b=A("span"),m=we(v),p(u,"class","primary svelte-ltkwvy"),p(c,"class","svelte-ltkwvy"),p(b,"class","line2 svelte-ltkwvy"),p(s,"class","texts svelte-ltkwvy"),p(e,"tabindex","0"),p(e,"data-selected",n[1]),p(e,"class","svelte-ltkwvy"),se(e,"selected",n[1])},m(w,C){z(w,e,C),x.m(e,null),T(e,l),T(e,s),T(s,c),T(c,u),T(u,a),T(c,f),L&&L.m(c,null),T(s,y),T(s,b),T(b,m),E||(S=[ee(e,"mouseenter",n[12]),ee(e,"focus",n[13])],E=!0)},p(w,[C]){k===(k=_(w,C))&&x?x.p(w,C):(x.d(1),x=k(w),x&&(x.c(),x.m(e,l))),C&1&&d!==(d=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&Ue(a,d),C&37&&(h=w[2]==="always"||w[2]&&!w[0].address&&!w[0].id.startsWith("road.")&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),h?L?L.p(w,C):(L=ei(w),L.c(),L.m(c,null)):L&&(L.d(1),L=null),C&1&&v!==(v=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ue(m,v),C&2&&p(e,"data-selected",w[1]),C&2&&se(e,"selected",w[1])},i:D,o:D,d(w){w&&U(e),x.d(),L&&L.d(),E=!1,me(S)}}}function yn(n,e,t){var S;let i,r,{feature:o}=e,{selected:l=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const d=(S=o.properties)==null?void 0:S.categories;let a,f,h=0,y=o.place_type[0]==="reverse";function b(){f&&c.add(f),t(10,h++,h)}function v(_){Vt.call(this,n,_)}function m(_){Vt.call(this,n,_)}const E=()=>b();return n.$$set=_=>{"feature"in _&&t(0,o=_.feature),"selected"in _&&t(1,l=_.selected),"showPlaceType"in _&&t(2,s=_.showPlaceType),"missingIconsCache"in _&&t(9,c=_.missingIconsCache),"iconsBaseUrl"in _&&t(3,u=_.iconsBaseUrl)},n.$$.update=()=>{var _,k,x,L;if(n.$$.dirty&3640)do t(11,i--,i),t(4,a=d==null?void 0:d[i]),t(5,f=a?u+a.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!f||c.has(f)));n.$$.dirty&1&&t(6,r=((k=(_=o.properties)==null?void 0:_.categories)==null?void 0:k.join(", "))??((L=(x=o.properties)==null?void 0:x.place_type_name)==null?void 0:L[0])??o.place_type[0])},t(11,i=(d==null?void 0:d.length)??0),[o,l,s,u,a,f,r,y,b,c,h,i,v,m,E]}class bn extends Le{constructor(e){super(),Ee(this,e,yn,vn,be,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function wn(n){let e;return{c(){e=A("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>',p(e,"class","svelte-7cmwmc")},m(t,i){z(t,e,i)},p:D,i:D,o:D,d(t){t&&U(e)}}}class _n extends Le{constructor(e){super(),Ee(this,e,null,wn,be,{})}}function En(n){let e,t,i;return{c(){e=ae("svg"),t=ae("path"),p(t,"stroke-width","4"),p(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"),p(t,"class","svelte-gzo3ar"),p(e,"width",i=n[0]==="list"?20:void 0),p(e,"viewBox","0 0 70 85"),p(e,"fill","none"),p(e,"class","svelte-gzo3ar"),se(e,"in-map",n[0]!=="list"),se(e,"list-icon",n[0]==="list")},m(r,o){z(r,e,o),T(e,t)},p(r,[o]){o&1&&i!==(i=r[0]==="list"?20:void 0)&&p(e,"width",i),o&1&&se(e,"in-map",r[0]!=="list"),o&1&&se(e,"list-icon",r[0]==="list")},i:D,o:D,d(r){r&&U(e)}}}function Ln(n,e,t){let{displayIn:i}=e;return n.$$set=r=>{"displayIn"in r&&t(0,i=r.displayIn)},[i]}class xn extends Le{constructor(e){super(),Ee(this,e,Ln,En,be,{displayIn:0})}}function Sn(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),p(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"),p(e,"viewBox","0 0 60.006 21.412"),p(e,"width","14"),p(e,"height","20"),p(e,"class","svelte-en2qvf")},m(i,r){z(i,e,r),T(e,t)},p:D,i:D,o:D,d(i){i&&U(e)}}}class Mn extends Le{constructor(e){super(),Ee(this,e,null,Sn,be,{})}}function kn(n){let e,t,i;return{c(){e=ae("svg"),t=ae("circle"),i=ae("path"),p(t,"cx","4.789"),p(t,"cy","4.787"),p(t,"r","3.85"),p(t,"class","svelte-1aq105l"),p(i,"d","M12.063 12.063 7.635 7.635"),p(i,"class","svelte-1aq105l"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"width","13"),p(e,"height","13"),p(e,"viewBox","0 0 13 13"),p(e,"class","svelte-1aq105l")},m(r,o){z(r,e,o),T(e,t),T(e,i)},p:D,i:D,o:D,d(r){r&&U(e)}}}class Cn extends Le{constructor(e){super(),Ee(this,e,null,kn,be,{})}}function Nn(n,e,t){const i=e[1],r=e[0],o=i-r;return n===i&&t?n:((n-r)%o+o)%o+r}function tt(n){const e=[...n];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 je;async function Tn(n,e,t){const i=n==null?void 0:n.getCenterAndZoom();for(const r of e??[])if(!(i&&(r.minZoom!=null&&r.minZoom>i[0]||r.maxZoom!=null&&r.maxZoom<i[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(je&&r.cachedLocationExpiry&&je.time+r.cachedLocationExpiry>Date.now()){if(!je.coords)break e;return je.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(u=>u.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(je={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(i&&r.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}const Pn=/^(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,ti=/^([+-]?[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,ni=/^(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,ri=/^(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,oi=/^(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 Rn(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),t=Number(e[0]),i=Number(e[1]),r=Math.abs(t),o=Math.abs(i),l=t>0?"N":"S",s=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),d=Math.floor(o),a=(r-u)*60,f=(o-d)*60;if(n=="DM"){let h=si(a,3).toFixed(3).padStart(6,"0"),y=si(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&y.endsWith(".000")&&(h=h.replace(/\.000$/,""),y=y.replace(/\.000$/,"")),c=`${u}° ${h}' ${l}, ${d}° ${y}' ${s}`}if(n=="DMS"){const h=Math.floor(a),y=Math.floor(f);let b=((a-h)*60).toFixed(1).padStart(4,"0"),v=((f-y)*60).toFixed(1).padStart(4,"0");const m=h.toString().padStart(2,"0"),E=y.toString().padStart(2,"0");b.endsWith(".0")&&v.endsWith(".0")&&(b=b.replace(/\.0$/,""),v=v.replace(/\.0$/,"")),c=`${u}° ${m}' ${b}" ${l}, ${d}° ${E}' ${v}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function si(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function vt(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",o="",l=null,s=[],c=!1;if(Pn.test(n))throw new Error("invalid coordinate value");if(ti.test(n))if(s=ti.exec(n),c=Ze(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),i=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(i*=-1),l="DM";else throw new Error("invalid coordinate format");else if(ii.test(n))if(s=ii.exec(n),c=Ze(s),c){if(t=s[2],i=s[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),l="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(ni.test(n))if(s=ni.exec(n),c=Ze(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[9])),s[11]&&(i+=s[11]/60),s[13]&&(i+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(i=-1*i),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(ri.test(n))if(s=ri.exec(n),c=Ze(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12]/60),s[14]&&(i+=s[14]/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(oi.test(n)){if(s=oi.exec(n),c=Ze(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12].replace(",",".")/60),s[14]&&(i+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&i>0&&(i=-1*i);const d=s[0].trim();let a,f;const h=/[,/;\u0020]/g,y=d.match(h);if(y==null){const m=Math.floor(n.length/2);a=d.substring(0,m).trim(),f=d.substring(m).trim()}else{let m;y.length%2==1?m=Math.floor(y.length/2):m=y.length/2-1;let E=0;if(m==0)E=d.indexOf(y[0]),a=d.substring(0,E).trim(),f=d.substring(E+1).trim();else{let S=0,_=0;for(;S<=m;)E=d.indexOf(y[S],_),_=E+1,S++;a=d.substring(0,E).trim(),f=d.substring(E+1).trim()}}const b=a.split(".");if(b.length==2&&b[1]==0&&b[1].length!=2)throw new Error("invalid coordinates format");const v=f.split(".");if(v.length==2&&v[1]==0&&v[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:l,closeEnough:In,toCoordinateFormat:Rn})}else throw new Error("coordinates pattern match failed")}function Ze(n){if(!isNaN(n[0]))return!1;const e=[...n];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=i.test(l)&&i.test(s),d=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||d)continue;return!1}}return!0}function li(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function In(n){if(!n)throw new Error("coords must be provided");if(n.includes(",")){const e=n.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return li(this.decimalLatitude,Number(e[0]))&&li(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const On=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});vt.to=On;const Wn=[{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"}],An={decimalLatitude:40.123,decimalLongitude:-74.123},Bn=[{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}],Dn=[{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 Un(){const n=[];return Wn.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...An})}),[...n,...Bn,...Dn]}const zn=Un();vt.formats=zn.map(n=>n.verbatimCoordinates);const Fn=vt;function ui(n,e,t){const i=n.slice();return i[83]=e[t],i[85]=t,i}function ai(n){let e,t;return e=new _n({}),{c(){_e(e.$$.fragment)},m(i,r){pe(e,i,r),t=!0},i(i){t||(Q(e.$$.fragment,i),t=!0)},o(i){K(e.$$.fragment,i),t=!1},d(i){ve(e,i)}}}function ci(n){let e,t,i,r,o;return t=new Mn({}),{c(){e=A("button"),_e(t.$$.fragment),p(e,"type","button"),p(e,"title",n[9]),p(e,"class","svelte-1uvos7g"),se(e,"active",n[0])},m(l,s){z(l,e,s),pe(t,e,null),i=!0,r||(o=ee(e,"click",n[68]),r=!0)},p(l,s){(!i||s[0]&512)&&p(e,"title",l[9]),(!i||s[0]&1)&&se(e,"active",l[0])},i(l){i||(Q(t.$$.fragment,l),i=!0)},o(l){K(t.$$.fragment,l),i=!1},d(l){l&&U(e),ve(t),r=!1,o()}}}function jn(n){let e,t=[],i=new Map,r,o,l,s=Xt(n[14]);const c=u=>u[83].id+(u[83].address?","+u[83].address:"");for(let u=0;u<s.length;u+=1){let d=ui(n,s,u),a=c(d);i.set(a,t[u]=fi(a,d))}return{c(){e=A("ul");for(let u=0;u<t.length;u+=1)t[u].c();p(e,"class","svelte-1uvos7g")},m(u,d){z(u,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[ee(e,"mouseleave",n[72]),ee(e,"blur",n[73])],o=!0)},p(u,d){d[0]&17880064&&(s=Xt(u[14]),$e(),t=rn(t,d,c,1,u,s,i,e,nn,fi,null,ui),et())},i(u){if(!r){for(let d=0;d<s.length;d+=1)Q(t[d]);r=!0}},o(u){for(let d=0;d<t.length;d+=1)K(t[d]);r=!1},d(u){u&&U(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,me(l)}}}function Zn(n){let e,t,i,r,o,l;return t=new $t({}),{c(){e=A("div"),_e(t.$$.fragment),i=ie(),r=A("div"),o=we(n[7]),p(r,"class","svelte-1uvos7g"),p(e,"class","no-results svelte-1uvos7g")},m(s,c){z(s,e,c),pe(t,e,null),T(e,i),T(e,r),T(r,o),l=!0},p(s,c){(!l||c[0]&128)&&Ue(o,s[7])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){K(t.$$.fragment,s),l=!1},d(s){s&&U(e),ve(t)}}}function qn(n){let e="",t;return{c(){t=we(e)},m(i,r){z(i,t,r)},p:D,i:D,o:D,d(i){i&&U(t)}}}function Gn(n){let e,t,i,r,o,l,s,c,u,d,a;return t=new $t({}),c=new Jt({}),{c(){e=A("div"),_e(t.$$.fragment),i=ie(),r=A("div"),o=we(n[6]),l=ie(),s=A("button"),_e(c.$$.fragment),p(r,"class","svelte-1uvos7g"),p(s,"class","svelte-1uvos7g"),p(e,"class","error svelte-1uvos7g")},m(f,h){z(f,e,h),pe(t,e,null),T(e,i),T(e,r),T(r,o),T(e,l),T(e,s),pe(c,s,null),u=!0,d||(a=ee(s,"click",n[69]),d=!0)},p(f,h){(!u||h[0]&64)&&Ue(o,f[6])},i(f){u||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),u=!0)},o(f){K(t.$$.fragment,f),K(c.$$.fragment,f),u=!1},d(f){f&&U(e),ve(t),ve(c),d=!1,a()}}}function fi(n,e){let t,i,r;function o(){return e[70](e[85])}function l(){return e[71](e[83])}return i=new bn({props:{feature:e[83],showPlaceType:e[10],selected:e[15]===e[85],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),i.$on("mouseenter",o),i.$on("focus",l),{key:n,first:null,c(){t=Qi(),_e(i.$$.fragment),this.first=t},m(s,c){z(s,t,c),pe(i,s,c),r=!0},p(s,c){e=s;const u={};c[0]&16384&&(u.feature=e[83]),c[0]&1024&&(u.showPlaceType=e[10]),c[0]&49152&&(u.selected=e[15]===e[85]),c[0]&4096&&(u.iconsBaseUrl=e[12]),i.$set(u)},i(s){r||(Q(i.$$.fragment,s),r=!0)},o(s){K(i.$$.fragment,s),r=!1},d(s){s&&U(t),ve(i,s)}}}function Qn(n){let e,t,i,r,o,l,s,c,u,d,a,f,h,y,b,v,m,E,S,_,k,x=!1;o=new Cn({}),a=new Jt({});let L=n[19]&&ai(),w=n[5]===!0&&ci(n);const C=n[60].default,I=ji(C,n,n[59],null),F=[Gn,qn,Zn,jn],Z=[];function W(M,q){var re,fe;return M[18]?0:M[16]?((re=M[14])==null?void 0:re.length)===0?2:M[16]&&((fe=M[14])!=null&&fe.length)?3:-1:1}return~(v=W(n))&&(m=Z[v]=F[v](n)),{c(){e=ie(),t=A("form"),i=A("div"),r=A("button"),_e(o.$$.fragment),l=ie(),s=A("input"),c=ie(),u=A("div"),d=A("button"),_e(a.$$.fragment),f=ie(),L&&L.c(),h=ie(),w&&w.c(),y=ie(),I&&I.c(),b=ie(),m&&m.c(),p(r,"class","search-button svelte-1uvos7g"),p(r,"type","button"),p(s,"placeholder",n[8]),p(s,"aria-label",n[8]),p(s,"class","svelte-1uvos7g"),p(d,"type","button"),p(d,"title",n[3]),p(d,"class","svelte-1uvos7g"),p(u,"class","clear-button-container svelte-1uvos7g"),se(u,"displayable",n[1]!==""),p(i,"class","input-group svelte-1uvos7g"),p(t,"tabindex","0"),p(t,"class",E=Gt(n[2])+" svelte-1uvos7g"),se(t,"can-collapse",n[4]&&n[1]==="")},m(M,q){z(M,e,q),z(M,t,q),T(t,i),T(i,r),pe(o,r,null),T(i,l),T(i,s),n[62](s),Qt(s,n[1]),T(i,c),T(i,u),T(u,d),pe(a,d,null),T(u,f),L&&L.m(u,null),T(i,h),w&&w.m(i,null),T(i,y),I&&I.m(i,null),T(t,b),~v&&Z[v].m(t,null),S=!0,_||(k=[ee(r,"click",n[61]),ee(s,"input",n[63]),ee(s,"focus",n[64]),ee(s,"blur",n[65]),ee(s,"keydown",n[22]),ee(s,"input",n[66]),ee(d,"click",n[67]),ee(t,"submit",Hi(n[21]))],_=!0)},p(M,q){(!S||q[0]&256)&&p(s,"placeholder",M[8]),(!S||q[0]&256)&&p(s,"aria-label",M[8]),q[0]&2&&s.value!==M[1]&&Qt(s,M[1]),(!S||q[0]&8)&&p(d,"title",M[3]),M[19]?L?q[0]&524288&&Q(L,1):(L=ai(),L.c(),Q(L,1),L.m(u,null)):L&&($e(),K(L,1,1,()=>{L=null}),et()),(!S||q[0]&2)&&se(u,"displayable",M[1]!==""),M[5]===!0?w?(w.p(M,q),q[0]&32&&Q(w,1)):(w=ci(M),w.c(),Q(w,1),w.m(i,y)):w&&($e(),K(w,1,1,()=>{w=null}),et()),I&&I.p&&(!S||q[1]&268435456)&&qi(I,C,M,M[59],S?Zi(C,M[59],q,null):Gi(M[59]),null);let re=v;v=W(M),v===re?~v&&Z[v].p(M,q):(m&&($e(),K(Z[re],1,1,()=>{Z[re]=null}),et()),~v?(m=Z[v],m?m.p(M,q):(m=Z[v]=F[v](M),m.c()),Q(m,1),m.m(t,null)):m=null),(!S||q[0]&4&&E!==(E=Gt(M[2])+" svelte-1uvos7g"))&&p(t,"class",E),(!S||q[0]&22)&&se(t,"can-collapse",M[4]&&M[1]==="")},i(M){S||(Q(x),Q(o.$$.fragment,M),Q(a.$$.fragment,M),Q(L),Q(w),Q(I,M),Q(m),S=!0)},o(M){K(x),K(o.$$.fragment,M),K(a.$$.fragment,M),K(L),K(w),K(I,M),K(m),S=!1},d(M){M&&(U(e),U(t)),ve(o),n[62](null),ve(a),L&&L.d(),w&&w.d(),I&&I.d(M),~v&&Z[v].d(),_=!1,me(k)}}}function Hn(n,e,t){let i,{$$slots:r={},$$scope:o}=e;const l={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:s=void 0}=e,{apiKey:c}=e,{bbox:u=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:y=200}=e,{enableReverse:b=!1}=e,{errorMessage:v="Something went wrong…"}=e,{filter:m=()=>!0}=e,{flyTo:E=!0}=e,{fuzzyMatch:S=!0}=e,{language:_=void 0}=e,{limit:k=void 0}=e,{mapController:x=void 0}=e,{minLength:L=2}=e,{noResultsMessage:w="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:C="Search"}=e,{proximity:I=[{type:"server-geolocation"}]}=e,{reverseActive:F=b==="always"}=e,{reverseButtonTitle:Z="toggle reverse geocoding"}=e,{searchValue:W=""}=e,{showFullGeometry:M=!0}=e,{showPlaceType:q="ifNeeded"}=e,{showResultsWhileTyping:re=!0}=e,{selectFirst:fe=!0}=e,{flyToSelected:Ct=!1}=e,{markerOnSelected:ot=!0}=e,{types:st=void 0}=e,{excludeTypes:lt=!1}=e,{zoom:Ae=l}=e,{maxZoom:ut=void 0}=e,{apiUrl:Nt="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Tt={}}=e,{iconsBaseUrl:Oi="https://cdn.maptiler.com/maptiler-geocoding-control/v1.4.2-dev.2/icons/"}=e,{adjustUrlQuery:Pt=()=>{}}=e;function Cr(){de.focus()}function Nr(){de.blur()}function Wi(g,G=!0,Y=!1){t(1,W=g),G?(t(15,j=-1),Bi()):(Wt(!Y,Y),setTimeout(()=>{de.focus(),de.select()}))}function Tr(){t(14,R=void 0),t(56,N=void 0),t(15,j=-1)}function Pr(){t(55,H=[]),t(56,N=void 0)}let Be=!1,R,H,N,Ai="",de,j=-1,he,at=[],Pe,De,ct,Rt;const Rr=new Set,Ce=Xi();Ki(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function Bi(g){if(De&&(clearTimeout(De),De=void 0),j>-1&&R)t(56,N=R[j]),t(1,W=N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,"")),t(18,he=void 0),t(55,H=void 0),t(15,j=-1);else if(W){const G=g||!It(W);Ot(W,{exact:!0}).then(()=>{t(55,H=R),t(56,N=void 0),G&&Ir()}).catch(Y=>t(18,he=Y))}}function It(g){try{return Fn(g,6)}catch{return!1}}async function Ot(g,{byId:G=!1,exact:Y=!1}={}){t(18,he=void 0),Pe==null||Pe.abort();const oe=new AbortController;t(19,Pe=oe);try{const P=It(g),V=new URLSearchParams;if(_!==void 0&&V.set("language",Array.isArray(_)?_.join(","):_??""),st&&V.set("types",st.join(",")),lt&&V.set("excludeTypes",String(lt)),u&&V.set("bbox",u.map(ft=>ft.toFixed(6)).join(",")),h&&V.set("country",Array.isArray(h)?h.join(","):h),!G&&!P){const ft=await Tn(x,I,oe);ft&&V.set("proximity",ft),(Y||!re)&&V.set("autocomplete","false"),V.set("fuzzyMatch",String(S))}k!==void 0&&V.set("limit",String(k)),V.set("key",c),Pt(V);const ge=Nt+"/"+encodeURIComponent(P?P.decimalLongitude+","+P.decimalLatitude:g)+".json?"+V.toString();if(ge===Ai){G?(t(14,R=void 0),t(56,N=at[0])):t(14,R=at);return}Ai=ge;const Bt=await fetch(ge,{signal:oe.signal,...Tt});if(!Bt.ok)throw new Error(await Bt.text());const Dt=await Bt.json();Ce("response",{url:ge,featureCollection:Dt}),G?(t(14,R=void 0),t(56,N=Dt.features[0]),at=[N]):(t(14,R=Dt.features.filter(m)),P&&R.unshift({type:"Feature",properties:{},id:"reverse_"+P.decimalLongitude+"_"+P.decimalLatitude,text:P.decimalLatitude+", "+P.decimalLongitude,place_name:P.decimalLatitude+", "+P.decimalLongitude,place_type:["reverse"],center:[P.decimalLongitude,P.decimalLatitude],bbox:[P.decimalLongitude,P.decimalLatitude,P.decimalLongitude,P.decimalLatitude],geometry:{type:"Point",coordinates:[P.decimalLongitude,P.decimalLatitude]}}),at=R,P&&de.focus())}catch(P){if(P&&typeof P=="object"&&"name"in P&&P.name==="AbortError")return;throw P}finally{oe===Pe&&t(19,Pe=void 0)}}function Ir(){var oe;if(!(H!=null&&H.length)||!E)return;const g=[180,90,-180,-90],G=!H.some(P=>!P.matching_text);let Y;for(const P of H){const V=Ye(P);if(Y=ut??(Y===void 0?V:V===void 0?Y:Math.max(Y,V)),G||!P.matching_text)for(const ge of[0,1,2,3])g[ge]=Math[ge<2?"min":"max"](g[ge],((oe=P.bbox)==null?void 0:oe[ge])??P.center[ge%2])}x&&H.length>0&&(N&&g[0]===g[2]&&g[1]===g[3]?x.flyTo(N.center,Ye(N)):x.fitBounds(tt(g),50,Y))}function Ye(g){var Y;if(!g.bbox||g.bbox[0]!==g.bbox[2]&&g.bbox[1]!==g.bbox[3])return;if(typeof Ae=="number")return g.id.startsWith("poi.")||g.id.startsWith("address.")?ut:Ae;const G=g.id.replace(/\..*/,"");return(Array.isArray((Y=g.properties)==null?void 0:Y.categories)?g.properties.categories.reduce((oe,P)=>{const V=Ae[G+"."+P];return oe===void 0?V:V===void 0?oe:Math.max(oe,V)},void 0):void 0)??Ae[G]}function Or(g){t(0,F=b==="always"),t(14,R=void 0),t(56,N=void 0),t(15,j=-1),Wi(g[1].toFixed(6)+", "+Nn(g[0],[-180,180],!0).toFixed(6),!1,!0)}function Wr(g){if(!R)return;let G=g.key==="ArrowDown"?1:g.key==="ArrowUp"?-1:0;G&&(j===(fe?0:-1)&&G===-1&&t(15,j=R.length),t(15,j+=G),j>=R.length&&t(15,j=-1),j<0&&fe&&t(15,j=0),g.preventDefault())}function Wt(g=!0,G=!1){if(t(18,he=void 0),re||G){if(De&&clearTimeout(De),W.length<L)return;const Y=W;De=window.setTimeout(()=>{Ot(Y).catch(oe=>t(18,he=oe))},g?y:0)}else t(14,R=void 0),t(18,he=void 0)}function At(g){t(56,N=g),t(1,W=g.place_name),t(15,j=-1)}const Ar=()=>de.focus();function Br(g){ht[g?"unshift":"push"](()=>{de=g,t(17,de)})}function Dr(){W=this.value,t(1,W),t(13,Be),t(28,a)}const Ur=()=>t(13,Be=!0),zr=()=>t(13,Be=!1),Fr=()=>Wt(),jr=()=>{t(1,W=""),de.focus()},Zr=()=>t(0,F=!F),qr=()=>t(18,he=void 0),Gr=g=>t(15,j=g),Qr=g=>At(g),Hr=()=>{fe||t(15,j=-1)},Vr=()=>{};return n.$$set=g=>{"class"in g&&t(2,s=g.class),"apiKey"in g&&t(26,c=g.apiKey),"bbox"in g&&t(27,u=g.bbox),"clearButtonTitle"in g&&t(3,d=g.clearButtonTitle),"clearOnBlur"in g&&t(28,a=g.clearOnBlur),"collapsed"in g&&t(4,f=g.collapsed),"country"in g&&t(29,h=g.country),"debounceSearch"in g&&t(30,y=g.debounceSearch),"enableReverse"in g&&t(5,b=g.enableReverse),"errorMessage"in g&&t(6,v=g.errorMessage),"filter"in g&&t(31,m=g.filter),"flyTo"in g&&t(32,E=g.flyTo),"fuzzyMatch"in g&&t(33,S=g.fuzzyMatch),"language"in g&&t(34,_=g.language),"limit"in g&&t(35,k=g.limit),"mapController"in g&&t(36,x=g.mapController),"minLength"in g&&t(37,L=g.minLength),"noResultsMessage"in g&&t(7,w=g.noResultsMessage),"placeholder"in g&&t(8,C=g.placeholder),"proximity"in g&&t(38,I=g.proximity),"reverseActive"in g&&t(0,F=g.reverseActive),"reverseButtonTitle"in g&&t(9,Z=g.reverseButtonTitle),"searchValue"in g&&t(1,W=g.searchValue),"showFullGeometry"in g&&t(39,M=g.showFullGeometry),"showPlaceType"in g&&t(10,q=g.showPlaceType),"showResultsWhileTyping"in g&&t(40,re=g.showResultsWhileTyping),"selectFirst"in g&&t(11,fe=g.selectFirst),"flyToSelected"in g&&t(41,Ct=g.flyToSelected),"markerOnSelected"in g&&t(42,ot=g.markerOnSelected),"types"in g&&t(43,st=g.types),"excludeTypes"in g&&t(44,lt=g.excludeTypes),"zoom"in g&&t(45,Ae=g.zoom),"maxZoom"in g&&t(46,ut=g.maxZoom),"apiUrl"in g&&t(47,Nt=g.apiUrl),"fetchParameters"in g&&t(48,Tt=g.fetchParameters),"iconsBaseUrl"in g&&t(12,Oi=g.iconsBaseUrl),"adjustUrlQuery"in g&&t(49,Pt=g.adjustUrlQuery),"$$scope"in g&&t(59,o=g.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&32&&t(0,F=b==="always"),n.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ct=Be),a&&!Be&&t(1,W="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&64&&W.length<L&&(t(56,N=void 0),t(14,R=void 0),t(18,he=void 0),t(55,H=R)),n.$$.dirty[1]&33554688&&M&&N&&!N.address&&N.geometry.type==="Point"&&N.place_type[0]!=="reverse"&&Ot(N.id,{byId:!0}).catch(g=>t(18,he=g)),n.$$.dirty[1]&100663330&&(x&&N&&N.id!==Rt&&E&&(!N.bbox||N.bbox[0]===N.bbox[2]&&N.bbox[1]===N.bbox[3]?x.flyTo(N.center,Ye(N)):x.fitBounds(tt(N.bbox),50,Ye(N)),t(14,R=void 0),t(55,H=void 0),t(15,j=-1)),t(57,Rt=N==null?void 0:N.id)),n.$$.dirty[0]&18432&&fe&&R!=null&&R.length&&t(15,j=0),n.$$.dirty[0]&2&&t(15,j=-1),n.$$.dirty[0]&16384|n.$$.dirty[1]&16777216&&H!==R&&t(55,H=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&16777248&&x&&x.setEventHandler(g=>{switch(g.type){case"mapClick":F&&Or(g.coordinates);break;case"markerClick":{const G=R==null?void 0:R.find(Y=>Y.id===g.id);G&&At(G)}break;case"markerMouseEnter":H&&t(15,j=ct?(R==null?void 0:R.findIndex(G=>G.id===g.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,j=-1);break}}),n.$$.dirty[0]&49152&&t(58,i=R==null?void 0:R[j]),n.$$.dirty[1]&134218786&&x&&i&&E&&Ct&&x.flyTo(i.center,Ye(i)),n.$$.dirty[1]&2080&&(ot||x==null||x.setMarkers(void 0,void 0)),n.$$.dirty[1]&150997024&&x&&ot&&!H&&(x.setMarkers(i?[i]:void 0,void 0),x.setSelectedMarker(i?0:-1)),n.$$.dirty[1]&50331680&&x&&x.setMarkers(H,N),n.$$.dirty[0]&32768|n.$$.dirty[1]&16777248&&H&&x&&x.setSelectedMarker(j),n.$$.dirty[0]&2|n.$$.dirty[1]&32&&x){const g=It(W);x.setReverseMarker(g?[g.decimalLongitude,g.decimalLatitude]:void 0)}n.$$.dirty[1]&134217728&&Ce("select",i),n.$$.dirty[1]&33554432&&Ce("pick",N),n.$$.dirty[0]&81920&&Ce("optionsVisibilityChange",ct&&!!R),n.$$.dirty[0]&16384&&Ce("featuresListed",R),n.$$.dirty[1]&16777216&&Ce("featuresMarked",H),n.$$.dirty[0]&1&&Ce("reverseToggle",F),n.$$.dirty[0]&2&&Ce("queryChange",W),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&x&&x.indicateReverse(F)},[F,W,s,d,f,b,v,w,C,Z,q,fe,Oi,Be,R,j,ct,de,he,Pe,Rr,Bi,Wr,Wt,At,l,c,u,a,h,y,m,E,S,_,k,x,L,I,M,re,Ct,ot,st,lt,Ae,ut,Nt,Tt,Pt,Cr,Nr,Wi,Tr,Pr,H,N,Rt,i,o,r,Ar,Br,Dr,Ur,zr,Fr,jr,Zr,qr,Gr,Qr,Hr,Vr]}let Vn=class extends Le{constructor(e){super(),Ee(this,e,Hn,Qn,be,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,excludeTypes:44,zoom:45,maxZoom:46,apiUrl:47,fetchParameters:48,iconsBaseUrl:12,adjustUrlQuery:49,focus:50,blur:51,setQuery:52,clearList:53,clearMap:54},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[50]}get blur(){return this.$$.ctx[51]}get setQuery(){return this.$$.ctx[52]}get clearList(){return this.$$.ctx[53]}get clearMap(){return this.$$.ctx[54]}};function qe(n,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=n,i}function yt(n,e,t={}){for(const r of n){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 o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return qe({type:"Polygon",coordinates:n},e,t)}function Ge(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function di(n,e,t={}){return qe({type:"MultiPolygon",coordinates:n},e,t)}/**
1
+ (function(O,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],B):(O=typeof globalThis<"u"?globalThis:O||self,B(O.maptilersdkMaptilerGeocoder={},O.maptilersdk))})(this,function(O,B){"use strict";var Kr=Object.defineProperty;var Ui=O=>{throw TypeError(O)};var Xr=(O,B,X)=>B in O?Kr(O,B,{enumerable:!0,configurable:!0,writable:!0,value:X}):O[B]=X;var zt=(O,B,X)=>Xr(O,typeof B!="symbol"?B+"":B,X),zi=(O,B,X)=>B.has(O)||Ui("Cannot "+X);var ue=(O,B,X)=>(zi(O,B,"read from private field"),X?X.call(O):B.get(O)),Ft=(O,B,X)=>B.has(O)?Ui("Cannot add the same private member more than once"):B instanceof WeakSet?B.add(O):B.set(O,X),dt=(O,B,X,Xe)=>(zi(O,B,"write to private field"),Xe?Xe.call(O,X):B.set(O,X),X);var ne,Te;function X(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Xe=X(B);function D(){}function Fi(n,e){for(const t in e)n[t]=e[t];return n}function jt(n){return n()}function Gt(){return Object.create(null)}function me(n){n.forEach(jt)}function Zt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Je;function J(n,e){return n===e?!0:(Je||(Je=document.createElement("a")),Je.href=e,n===Je.href)}function ji(n){return Object.keys(n).length===0}function Gi(n,e,t,i){if(n){const r=qt(n,e,t,i);return n[0](r)}}function qt(n,e,t,i){return n[1]&&i?Fi(t.ctx.slice(),n[1](i(e))):t.ctx}function Zi(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function qi(n,e,t,i,r,o){if(r){const l=qt(e,t,i,o);n.p(l,r)}}function Qi(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Qt(n){return n??""}function P(n,e){n.appendChild(e)}function z(n,e,t){n.insertBefore(e,t||null)}function U(n){n.parentNode&&n.parentNode.removeChild(n)}function A(n){return document.createElement(n)}function ae(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function we(n){return document.createTextNode(n)}function ie(){return we(" ")}function Hi(){return we("")}function ee(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Vi(n){return function(e){return e.preventDefault(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Yi(n){return Array.from(n.childNodes)}function ze(n,e){e=""+e,n.data!==e&&(n.data=e)}function Ht(n,e){n.value=e??""}function se(n,e,t){n.classList.toggle(e,!!t)}function Ki(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let Fe;function je(n){Fe=n}function Vt(){if(!Fe)throw new Error("Function called outside component initialization");return Fe}function Xi(n){Vt().$$.on_destroy.push(n)}function Ji(){const n=Vt();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const o=Ki(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}function Yt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ie=[],ht=[];let Oe=[];const Kt=[],$i=Promise.resolve();let gt=!1;function en(){gt||(gt=!0,$i.then(Xt))}function mt(n){Oe.push(n)}const pt=new Set;let We=0;function Xt(){if(We!==0)return;const n=Fe;do{try{for(;We<Ie.length;){const e=Ie[We];We++,je(e),tn(e.$$)}}catch(e){throw Ie.length=0,We=0,e}for(je(null),Ie.length=0,We=0;ht.length;)ht.pop()();for(let e=0;e<Oe.length;e+=1){const t=Oe[e];pt.has(t)||(pt.add(t),t())}Oe.length=0}while(Ie.length);for(;Kt.length;)Kt.pop()();gt=!1,pt.clear(),je(n)}function tn(n){if(n.fragment!==null){n.update(),me(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(mt)}}function nn(n){const e=[],t=[];Oe.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Oe=e}const $e=new Set;let Ne;function et(){Ne={r:0,c:[],p:Ne}}function tt(){Ne.r||me(Ne.c),Ne=Ne.p}function Q(n,e){n&&n.i&&($e.delete(n),n.i(e))}function K(n,e,t,i){if(n&&n.o){if($e.has(n))return;$e.add(n),Ne.c.push(()=>{$e.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function Jt(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function rn(n,e){K(n,1,1,()=>{e.delete(n.key)})}function on(n,e,t,i,r,o,l,s,c,u,d,a){let f=n.length,h=o.length,y=f;const b={};for(;y--;)b[n[y].key]=y;const v=[],m=new Map,E=new Map,S=[];for(y=h;y--;){const L=a(r,o,y),w=t(L);let C=l.get(w);C?S.push(()=>C.p(L,e)):(C=u(w,L),C.c()),m.set(w,v[y]=C),w in b&&E.set(w,Math.abs(y-b[w]))}const _=new Set,k=new Set;function x(L){Q(L,1),L.m(s,d),l.set(L.key,L),d=L.first,h--}for(;f&&h;){const L=v[h-1],w=n[f-1],C=L.key,I=w.key;L===w?(d=L.first,f--,h--):m.has(I)?!l.has(C)||_.has(C)?x(L):k.has(I)?f--:E.get(C)>E.get(I)?(k.add(C),x(L)):(_.add(I),f--):(c(w,l),f--)}for(;f--;){const L=n[f];m.has(L.key)||c(L,l)}for(;h;)x(v[h-1]);return me(S),v}function _e(n){n&&n.c()}function pe(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),mt(()=>{const o=n.$$.on_mount.map(jt).filter(Zt);n.$$.on_destroy?n.$$.on_destroy.push(...o):me(o),n.$$.on_mount=[]}),r.forEach(mt)}function ve(n,e){const t=n.$$;t.fragment!==null&&(nn(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function sn(n,e){n.$$.dirty[0]===-1&&(Ie.push(n),en(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ee(n,e,t,i,r,o,l=null,s=[-1]){const c=Fe;je(n);const u=n.$$={fragment:null,ctx:[],props:o,update:D,not_equal:r,bound:Gt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Gt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let d=!1;if(u.ctx=t?t(n,e.props||{},(a,f,...h)=>{const y=h.length?h[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=y)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](y),d&&sn(n,a)),f}):[],u.update(),d=!0,me(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const a=Yi(e.target);u.fragment&&u.fragment.l(a),a.forEach(U)}else u.fragment&&u.fragment.c();e.intro&&Q(n.$$.fragment),pe(n,e.target,e.anchor),Xt()}je(c)}class Le{constructor(){zt(this,"$$");zt(this,"$$set")}$destroy(){ve(this,1),this.$destroy=D}$on(e,t){if(!Zt(t))return D;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!ji(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ln="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ln);function un(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),p(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"),p(e,"viewBox","0 0 14 14"),p(e,"width","13"),p(e,"height","13"),p(e,"class","svelte-en2qvf")},m(i,r){z(i,e,r),P(e,t)},p:D,i:D,o:D,d(i){i&&U(e)}}}class $t extends Le{constructor(e){super(),Ee(this,e,null,un,be,{})}}function an(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),p(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"),p(e,"viewBox","0 0 30 30"),p(e,"fill","none"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"class","svelte-d2loi5")},m(i,r){z(i,e,r),P(e,t)},p:D,i:D,o:D,d(i){i&&U(e)}}}class ei extends Le{constructor(e){super(),Ee(this,e,null,an,be,{})}}function cn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"area.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function fn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function dn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"poi.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function hn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"postal_code.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function gn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"street.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function mn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"road.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function pn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&U(e)}}}function vn(n){let e,t,i,r;return{c(){e=A("img"),J(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[4]),p(e,"class","svelte-ltkwvy")},m(o,l){z(o,e,l),i||(r=ee(e,"error",n[14]),i=!0)},p(o,l){l&32&&!J(e.src,t=o[5])&&p(e,"src",t),l&16&&p(e,"alt",o[4])},d(o){o&&U(e),i=!1,r()}}}function ti(n){let e,t;return{c(){e=A("span"),t=we(n[6]),p(e,"class","secondary svelte-ltkwvy")},m(i,r){z(i,e,r),P(e,t)},p(i,r){r&64&&ze(t,i[6])},d(i){i&&U(e)}}}function yn(n){let e,t,i,r,o,l,s,c,u,d=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",a,f,h=n[2]==="always"||n[2]&&!n[0].address&&!n[0].id.startsWith("road.")&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],y,b,v=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",m,E,S;function _(w,C){return C&1&&(t=null),C&1&&(i=null),C&1&&(r=null),C&1&&(o=null),w[5]?vn:w[0].address?pn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?mn:(i==null&&(i=!!w[0].id.startsWith("address.")),i?gn:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?hn:(o==null&&(o=!!w[0].id.startsWith("poi.")),o?dn:w[7]?fn:cn))))}let k=_(n,-1),x=k(n),L=h&&ti(n);return{c(){e=A("li"),x.c(),l=ie(),s=A("span"),c=A("span"),u=A("span"),a=we(d),f=ie(),L&&L.c(),y=ie(),b=A("span"),m=we(v),p(u,"class","primary svelte-ltkwvy"),p(c,"class","svelte-ltkwvy"),p(b,"class","line2 svelte-ltkwvy"),p(s,"class","texts svelte-ltkwvy"),p(e,"tabindex","0"),p(e,"data-selected",n[1]),p(e,"class","svelte-ltkwvy"),se(e,"selected",n[1])},m(w,C){z(w,e,C),x.m(e,null),P(e,l),P(e,s),P(s,c),P(c,u),P(u,a),P(c,f),L&&L.m(c,null),P(s,y),P(s,b),P(b,m),E||(S=[ee(e,"mouseenter",n[12]),ee(e,"focus",n[13])],E=!0)},p(w,[C]){k===(k=_(w,C))&&x?x.p(w,C):(x.d(1),x=k(w),x&&(x.c(),x.m(e,l))),C&1&&d!==(d=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&ze(a,d),C&37&&(h=w[2]==="always"||w[2]&&!w[0].address&&!w[0].id.startsWith("road.")&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),h?L?L.p(w,C):(L=ti(w),L.c(),L.m(c,null)):L&&(L.d(1),L=null),C&1&&v!==(v=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&ze(m,v),C&2&&p(e,"data-selected",w[1]),C&2&&se(e,"selected",w[1])},i:D,o:D,d(w){w&&U(e),x.d(),L&&L.d(),E=!1,me(S)}}}function bn(n,e,t){var S;let i,r,{feature:o}=e,{selected:l=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const d=(S=o.properties)==null?void 0:S.categories;let a,f,h=0,y=o.place_type[0]==="reverse";function b(){f&&c.add(f),t(10,h++,h)}function v(_){Yt.call(this,n,_)}function m(_){Yt.call(this,n,_)}const E=()=>b();return n.$$set=_=>{"feature"in _&&t(0,o=_.feature),"selected"in _&&t(1,l=_.selected),"showPlaceType"in _&&t(2,s=_.showPlaceType),"missingIconsCache"in _&&t(9,c=_.missingIconsCache),"iconsBaseUrl"in _&&t(3,u=_.iconsBaseUrl)},n.$$.update=()=>{var _,k,x,L;if(n.$$.dirty&3640)do t(11,i--,i),t(4,a=d==null?void 0:d[i]),t(5,f=a?u+a.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!f||c.has(f)));n.$$.dirty&1&&t(6,r=((k=(_=o.properties)==null?void 0:_.categories)==null?void 0:k.join(", "))??((L=(x=o.properties)==null?void 0:x.place_type_name)==null?void 0:L[0])??o.place_type[0])},t(11,i=(d==null?void 0:d.length)??0),[o,l,s,u,a,f,r,y,b,c,h,i,v,m,E]}class wn extends Le{constructor(e){super(),Ee(this,e,bn,yn,be,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function _n(n){let e;return{c(){e=A("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>',p(e,"class","svelte-7cmwmc")},m(t,i){z(t,e,i)},p:D,i:D,o:D,d(t){t&&U(e)}}}class En extends Le{constructor(e){super(),Ee(this,e,null,_n,be,{})}}function Ln(n){let e,t,i;return{c(){e=ae("svg"),t=ae("path"),p(t,"stroke-width","4"),p(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"),p(t,"class","svelte-gzo3ar"),p(e,"width",i=n[0]==="list"?20:void 0),p(e,"viewBox","0 0 70 85"),p(e,"fill","none"),p(e,"class","svelte-gzo3ar"),se(e,"in-map",n[0]!=="list"),se(e,"list-icon",n[0]==="list")},m(r,o){z(r,e,o),P(e,t)},p(r,[o]){o&1&&i!==(i=r[0]==="list"?20:void 0)&&p(e,"width",i),o&1&&se(e,"in-map",r[0]!=="list"),o&1&&se(e,"list-icon",r[0]==="list")},i:D,o:D,d(r){r&&U(e)}}}function xn(n,e,t){let{displayIn:i}=e;return n.$$set=r=>{"displayIn"in r&&t(0,i=r.displayIn)},[i]}class Sn extends Le{constructor(e){super(),Ee(this,e,xn,Ln,be,{displayIn:0})}}function Mn(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),p(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"),p(e,"viewBox","0 0 60.006 21.412"),p(e,"width","14"),p(e,"height","20"),p(e,"class","svelte-en2qvf")},m(i,r){z(i,e,r),P(e,t)},p:D,i:D,o:D,d(i){i&&U(e)}}}class kn extends Le{constructor(e){super(),Ee(this,e,null,Mn,be,{})}}function Cn(n){let e,t,i;return{c(){e=ae("svg"),t=ae("circle"),i=ae("path"),p(t,"cx","4.789"),p(t,"cy","4.787"),p(t,"r","3.85"),p(t,"class","svelte-1aq105l"),p(i,"d","M12.063 12.063 7.635 7.635"),p(i,"class","svelte-1aq105l"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"width","13"),p(e,"height","13"),p(e,"viewBox","0 0 13 13"),p(e,"class","svelte-1aq105l")},m(r,o){z(r,e,o),P(e,t),P(e,i)},p:D,i:D,o:D,d(r){r&&U(e)}}}class Nn extends Le{constructor(e){super(),Ee(this,e,null,Cn,be,{})}}function Tn(n,e,t){const i=e[1],r=e[0],o=i-r;return n===i&&t?n:((n-r)%o+o)%o+r}function it(n){const e=[...n];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 Ge;async function Pn(n,e,t){const i=n==null?void 0:n.getCenterAndZoom();for(const r of e??[])if(!(i&&(r.minZoom!=null&&r.minZoom>i[0]||r.maxZoom!=null&&r.maxZoom<i[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Ge&&r.cachedLocationExpiry&&Ge.time+r.cachedLocationExpiry>Date.now()){if(!Ge.coords)break e;return Ge.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(u=>u.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Ge={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(i&&r.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}const Rn=/^(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,ii=/^([+-]?[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,})$/,ni=/^(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,ri=/^(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,oi=/^(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,si=/^(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 In(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),t=Number(e[0]),i=Number(e[1]),r=Math.abs(t),o=Math.abs(i),l=t>0?"N":"S",s=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),d=Math.floor(o),a=(r-u)*60,f=(o-d)*60;if(n=="DM"){let h=li(a,3).toFixed(3).padStart(6,"0"),y=li(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&y.endsWith(".000")&&(h=h.replace(/\.000$/,""),y=y.replace(/\.000$/,"")),c=`${u}° ${h}' ${l}, ${d}° ${y}' ${s}`}if(n=="DMS"){const h=Math.floor(a),y=Math.floor(f);let b=((a-h)*60).toFixed(1).padStart(4,"0"),v=((f-y)*60).toFixed(1).padStart(4,"0");const m=h.toString().padStart(2,"0"),E=y.toString().padStart(2,"0");b.endsWith(".0")&&v.endsWith(".0")&&(b=b.replace(/\.0$/,""),v=v.replace(/\.0$/,"")),c=`${u}° ${m}' ${b}" ${l}, ${d}° ${E}' ${v}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function li(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function vt(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",o="",l=null,s=[],c=!1;if(Rn.test(n))throw new Error("invalid coordinate value");if(ii.test(n))if(s=ii.exec(n),c=Ze(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),i=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(i*=-1),l="DM";else throw new Error("invalid coordinate format");else if(ni.test(n))if(s=ni.exec(n),c=Ze(s),c){if(t=s[2],i=s[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),l="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(ri.test(n))if(s=ri.exec(n),c=Ze(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[9])),s[11]&&(i+=s[11]/60),s[13]&&(i+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(i=-1*i),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(oi.test(n))if(s=oi.exec(n),c=Ze(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12]/60),s[14]&&(i+=s[14]/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(si.test(n)){if(s=si.exec(n),c=Ze(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12].replace(",",".")/60),s[14]&&(i+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&i>0&&(i=-1*i);const d=s[0].trim();let a,f;const h=/[,/;\u0020]/g,y=d.match(h);if(y==null){const m=Math.floor(n.length/2);a=d.substring(0,m).trim(),f=d.substring(m).trim()}else{let m;y.length%2==1?m=Math.floor(y.length/2):m=y.length/2-1;let E=0;if(m==0)E=d.indexOf(y[0]),a=d.substring(0,E).trim(),f=d.substring(E+1).trim();else{let S=0,_=0;for(;S<=m;)E=d.indexOf(y[S],_),_=E+1,S++;a=d.substring(0,E).trim(),f=d.substring(E+1).trim()}}const b=a.split(".");if(b.length==2&&b[1]==0&&b[1].length!=2)throw new Error("invalid coordinates format");const v=f.split(".");if(v.length==2&&v[1]==0&&v[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:l,closeEnough:On,toCoordinateFormat:In})}else throw new Error("coordinates pattern match failed")}function Ze(n){if(!isNaN(n[0]))return!1;const e=[...n];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=i.test(l)&&i.test(s),d=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||d)continue;return!1}}return!0}function ui(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function On(n){if(!n)throw new Error("coords must be provided");if(n.includes(",")){const e=n.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return ui(this.decimalLatitude,Number(e[0]))&&ui(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Wn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});vt.to=Wn;const An=[{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"}],Bn={decimalLatitude:40.123,decimalLongitude:-74.123},Dn=[{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}],Un=[{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 zn(){const n=[];return An.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...Bn})}),[...n,...Dn,...Un]}const Fn=zn();vt.formats=Fn.map(n=>n.verbatimCoordinates);const jn=vt;function ai(n,e,t){const i=n.slice();return i[84]=e[t],i[86]=t,i}function ci(n){let e,t;return e=new En({}),{c(){_e(e.$$.fragment)},m(i,r){pe(e,i,r),t=!0},i(i){t||(Q(e.$$.fragment,i),t=!0)},o(i){K(e.$$.fragment,i),t=!1},d(i){ve(e,i)}}}function fi(n){let e,t,i,r,o;return t=new kn({}),{c(){e=A("button"),_e(t.$$.fragment),p(e,"type","button"),p(e,"title",n[9]),p(e,"class","svelte-1uvos7g"),se(e,"active",n[0])},m(l,s){z(l,e,s),pe(t,e,null),i=!0,r||(o=ee(e,"click",n[69]),r=!0)},p(l,s){(!i||s[0]&512)&&p(e,"title",l[9]),(!i||s[0]&1)&&se(e,"active",l[0])},i(l){i||(Q(t.$$.fragment,l),i=!0)},o(l){K(t.$$.fragment,l),i=!1},d(l){l&&U(e),ve(t),r=!1,o()}}}function Gn(n){let e,t=[],i=new Map,r,o,l,s=Jt(n[14]);const c=u=>u[84].id+(u[84].address?","+u[84].address:"");for(let u=0;u<s.length;u+=1){let d=ai(n,s,u),a=c(d);i.set(a,t[u]=di(a,d))}return{c(){e=A("ul");for(let u=0;u<t.length;u+=1)t[u].c();p(e,"class","svelte-1uvos7g")},m(u,d){z(u,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[ee(e,"mouseleave",n[73]),ee(e,"blur",n[74])],o=!0)},p(u,d){d[0]&17880064&&(s=Jt(u[14]),et(),t=on(t,d,c,1,u,s,i,e,rn,di,null,ai),tt())},i(u){if(!r){for(let d=0;d<s.length;d+=1)Q(t[d]);r=!0}},o(u){for(let d=0;d<t.length;d+=1)K(t[d]);r=!1},d(u){u&&U(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,me(l)}}}function Zn(n){let e,t,i,r,o,l;return t=new ei({}),{c(){e=A("div"),_e(t.$$.fragment),i=ie(),r=A("div"),o=we(n[7]),p(r,"class","svelte-1uvos7g"),p(e,"class","no-results svelte-1uvos7g")},m(s,c){z(s,e,c),pe(t,e,null),P(e,i),P(e,r),P(r,o),l=!0},p(s,c){(!l||c[0]&128)&&ze(o,s[7])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){K(t.$$.fragment,s),l=!1},d(s){s&&U(e),ve(t)}}}function qn(n){let e="",t;return{c(){t=we(e)},m(i,r){z(i,t,r)},p:D,i:D,o:D,d(i){i&&U(t)}}}function Qn(n){let e,t,i,r,o,l,s,c,u,d,a;return t=new ei({}),c=new $t({}),{c(){e=A("div"),_e(t.$$.fragment),i=ie(),r=A("div"),o=we(n[6]),l=ie(),s=A("button"),_e(c.$$.fragment),p(r,"class","svelte-1uvos7g"),p(s,"class","svelte-1uvos7g"),p(e,"class","error svelte-1uvos7g")},m(f,h){z(f,e,h),pe(t,e,null),P(e,i),P(e,r),P(r,o),P(e,l),P(e,s),pe(c,s,null),u=!0,d||(a=ee(s,"click",n[70]),d=!0)},p(f,h){(!u||h[0]&64)&&ze(o,f[6])},i(f){u||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),u=!0)},o(f){K(t.$$.fragment,f),K(c.$$.fragment,f),u=!1},d(f){f&&U(e),ve(t),ve(c),d=!1,a()}}}function di(n,e){let t,i,r;function o(){return e[71](e[86])}function l(){return e[72](e[84])}return i=new wn({props:{feature:e[84],showPlaceType:e[10],selected:e[15]===e[86],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),i.$on("mouseenter",o),i.$on("focus",l),{key:n,first:null,c(){t=Hi(),_e(i.$$.fragment),this.first=t},m(s,c){z(s,t,c),pe(i,s,c),r=!0},p(s,c){e=s;const u={};c[0]&16384&&(u.feature=e[84]),c[0]&1024&&(u.showPlaceType=e[10]),c[0]&49152&&(u.selected=e[15]===e[86]),c[0]&4096&&(u.iconsBaseUrl=e[12]),i.$set(u)},i(s){r||(Q(i.$$.fragment,s),r=!0)},o(s){K(i.$$.fragment,s),r=!1},d(s){s&&U(t),ve(i,s)}}}function Hn(n){let e,t,i,r,o,l,s,c,u,d,a,f,h,y,b,v,m,E,S,_,k,x=!1;o=new Nn({}),a=new $t({});let L=n[19]&&ci(),w=n[5]===!0&&fi(n);const C=n[61].default,I=Gi(C,n,n[60],null),F=[Qn,qn,Zn,Gn],G=[];function W(M,Z){var re,fe;return M[18]?0:M[16]?((re=M[14])==null?void 0:re.length)===0?2:M[16]&&((fe=M[14])!=null&&fe.length)?3:-1:1}return~(v=W(n))&&(m=G[v]=F[v](n)),{c(){e=ie(),t=A("form"),i=A("div"),r=A("button"),_e(o.$$.fragment),l=ie(),s=A("input"),c=ie(),u=A("div"),d=A("button"),_e(a.$$.fragment),f=ie(),L&&L.c(),h=ie(),w&&w.c(),y=ie(),I&&I.c(),b=ie(),m&&m.c(),p(r,"class","search-button svelte-1uvos7g"),p(r,"type","button"),p(s,"placeholder",n[8]),p(s,"aria-label",n[8]),p(s,"class","svelte-1uvos7g"),p(d,"type","button"),p(d,"title",n[3]),p(d,"class","svelte-1uvos7g"),p(u,"class","clear-button-container svelte-1uvos7g"),se(u,"displayable",n[1]!==""),p(i,"class","input-group svelte-1uvos7g"),p(t,"tabindex","0"),p(t,"class",E=Qt(n[2])+" svelte-1uvos7g"),se(t,"can-collapse",n[4]&&n[1]==="")},m(M,Z){z(M,e,Z),z(M,t,Z),P(t,i),P(i,r),pe(o,r,null),P(i,l),P(i,s),n[63](s),Ht(s,n[1]),P(i,c),P(i,u),P(u,d),pe(a,d,null),P(u,f),L&&L.m(u,null),P(i,h),w&&w.m(i,null),P(i,y),I&&I.m(i,null),P(t,b),~v&&G[v].m(t,null),S=!0,_||(k=[ee(r,"click",n[62]),ee(s,"input",n[64]),ee(s,"focus",n[65]),ee(s,"blur",n[66]),ee(s,"keydown",n[22]),ee(s,"input",n[67]),ee(d,"click",n[68]),ee(t,"submit",Vi(n[21]))],_=!0)},p(M,Z){(!S||Z[0]&256)&&p(s,"placeholder",M[8]),(!S||Z[0]&256)&&p(s,"aria-label",M[8]),Z[0]&2&&s.value!==M[1]&&Ht(s,M[1]),(!S||Z[0]&8)&&p(d,"title",M[3]),M[19]?L?Z[0]&524288&&Q(L,1):(L=ci(),L.c(),Q(L,1),L.m(u,null)):L&&(et(),K(L,1,1,()=>{L=null}),tt()),(!S||Z[0]&2)&&se(u,"displayable",M[1]!==""),M[5]===!0?w?(w.p(M,Z),Z[0]&32&&Q(w,1)):(w=fi(M),w.c(),Q(w,1),w.m(i,y)):w&&(et(),K(w,1,1,()=>{w=null}),tt()),I&&I.p&&(!S||Z[1]&536870912)&&qi(I,C,M,M[60],S?Zi(C,M[60],Z,null):Qi(M[60]),null);let re=v;v=W(M),v===re?~v&&G[v].p(M,Z):(m&&(et(),K(G[re],1,1,()=>{G[re]=null}),tt()),~v?(m=G[v],m?m.p(M,Z):(m=G[v]=F[v](M),m.c()),Q(m,1),m.m(t,null)):m=null),(!S||Z[0]&4&&E!==(E=Qt(M[2])+" svelte-1uvos7g"))&&p(t,"class",E),(!S||Z[0]&22)&&se(t,"can-collapse",M[4]&&M[1]==="")},i(M){S||(Q(x),Q(o.$$.fragment,M),Q(a.$$.fragment,M),Q(L),Q(w),Q(I,M),Q(m),S=!0)},o(M){K(x),K(o.$$.fragment,M),K(a.$$.fragment,M),K(L),K(w),K(I,M),K(m),S=!1},d(M){M&&(U(e),U(t)),ve(o),n[63](null),ve(a),L&&L.d(),w&&w.d(),I&&I.d(M),~v&&G[v].d(),_=!1,me(k)}}}function Vn(n,e,t){let i,{$$slots:r={},$$scope:o}=e;const l={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:s=void 0}=e,{apiKey:c}=e,{bbox:u=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:y=200}=e,{enableReverse:b=!1}=e,{errorMessage:v="Something went wrong…"}=e,{filter:m=()=>!0}=e,{flyTo:E=!0}=e,{fuzzyMatch:S=!0}=e,{language:_=void 0}=e,{limit:k=void 0}=e,{mapController:x=void 0}=e,{minLength:L=2}=e,{noResultsMessage:w="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:C="Search"}=e,{proximity:I=[{type:"server-geolocation"}]}=e,{reverseActive:F=b==="always"}=e,{reverseButtonTitle:G="toggle reverse geocoding"}=e,{searchValue:W=""}=e,{showFullGeometry:M=!0}=e,{showPlaceType:Z="ifNeeded"}=e,{showResultsWhileTyping:re=!0}=e,{selectFirst:fe=!0}=e,{flyToSelected:Ct=!1}=e,{markerOnSelected:st=!0}=e,{types:Pe=void 0}=e,{exhaustiveReverseGeocoding:Nt=!1}=e,{excludeTypes:lt=!1}=e,{zoom:Be=l}=e,{maxZoom:ut=void 0}=e,{apiUrl:Tt="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Pt={}}=e,{iconsBaseUrl:Wi="https://cdn.maptiler.com/maptiler-geocoding-control/v1.4.2-dev.3/icons/"}=e,{adjustUrlQuery:Rt=()=>{}}=e;function Nr(){de.focus()}function Tr(){de.blur()}function Ai(g,q=!0,Y=!1){t(1,W=g),q?(t(15,j=-1),Di()):(At(!Y,Y),setTimeout(()=>{de.focus(),de.select()}))}function Pr(){t(14,R=void 0),t(57,N=void 0),t(15,j=-1)}function Rr(){t(56,H=[]),t(57,N=void 0)}let De=!1,R,H,N,Bi="",de,j=-1,he,at=[],Re,Ue,ct,It;const Ir=new Set,Ce=Ji();Xi(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function Di(g){if(Ue&&(clearTimeout(Ue),Ue=void 0),j>-1&&R)t(57,N=R[j]),t(1,W=N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,"")),t(18,he=void 0),t(56,H=void 0),t(15,j=-1);else if(W){const q=g||!Ot(W);Wt(W,{exact:!0}).then(()=>{t(56,H=R),t(57,N=void 0),q&&Or()}).catch(Y=>t(18,he=Y))}}function Ot(g){try{return jn(g,6)}catch{return!1}}async function Wt(g,{byId:q=!1,exact:Y=!1}={}){t(18,he=void 0),Re==null||Re.abort();const oe=new AbortController;t(19,Re=oe);try{const T=Ot(g),V=new URLSearchParams;if(_!==void 0&&V.set("language",Array.isArray(_)?_.join(","):_??""),Pe&&V.set("types",Pe.join(",")),lt&&V.set("excludeTypes",String(lt)),u&&V.set("bbox",u.map(ft=>ft.toFixed(6)).join(",")),h&&V.set("country",Array.isArray(h)?h.join(","):h),!q&&!T){const ft=await Pn(x,I,oe);ft&&V.set("proximity",ft),(Y||!re)&&V.set("autocomplete","false"),V.set("fuzzyMatch",String(S))}k!==void 0&&(Nt||!T||(Pe==null?void 0:Pe.length)===1)&&V.set("limit",String(k)),V.set("key",c),Rt(V);const ge=Tt+"/"+encodeURIComponent(T?T.decimalLongitude+","+T.decimalLatitude:g)+".json?"+V.toString();if(ge===Bi){q?(t(14,R=void 0),t(57,N=at[0])):t(14,R=at);return}Bi=ge;const Dt=await fetch(ge,{signal:oe.signal,...Pt});if(!Dt.ok)throw new Error(await Dt.text());const Ut=await Dt.json();Ce("response",{url:ge,featureCollection:Ut}),q?(t(14,R=void 0),t(57,N=Ut.features[0]),at=[N]):(t(14,R=Ut.features.filter(m)),T&&R.unshift({type:"Feature",properties:{},id:"reverse_"+T.decimalLongitude+"_"+T.decimalLatitude,text:T.decimalLatitude+", "+T.decimalLongitude,place_name:T.decimalLatitude+", "+T.decimalLongitude,place_type:["reverse"],center:[T.decimalLongitude,T.decimalLatitude],bbox:[T.decimalLongitude,T.decimalLatitude,T.decimalLongitude,T.decimalLatitude],geometry:{type:"Point",coordinates:[T.decimalLongitude,T.decimalLatitude]}}),at=R,T&&de.focus())}catch(T){if(T&&typeof T=="object"&&"name"in T&&T.name==="AbortError")return;throw T}finally{oe===Re&&t(19,Re=void 0)}}function Or(){var oe;if(!(H!=null&&H.length)||!E)return;const g=[180,90,-180,-90],q=!H.some(T=>!T.matching_text);let Y;for(const T of H){const V=Ke(T);if(Y=ut??(Y===void 0?V:V===void 0?Y:Math.max(Y,V)),q||!T.matching_text)for(const ge of[0,1,2,3])g[ge]=Math[ge<2?"min":"max"](g[ge],((oe=T.bbox)==null?void 0:oe[ge])??T.center[ge%2])}x&&H.length>0&&(N&&g[0]===g[2]&&g[1]===g[3]?x.flyTo(N.center,Ke(N)):x.fitBounds(it(g),50,Y))}function Ke(g){var Y;if(!g.bbox||g.bbox[0]!==g.bbox[2]&&g.bbox[1]!==g.bbox[3])return;if(typeof Be=="number")return g.id.startsWith("poi.")||g.id.startsWith("address.")?ut:Be;const q=g.id.replace(/\..*/,"");return(Array.isArray((Y=g.properties)==null?void 0:Y.categories)?g.properties.categories.reduce((oe,T)=>{const V=Be[q+"."+T];return oe===void 0?V:V===void 0?oe:Math.max(oe,V)},void 0):void 0)??Be[q]}function Wr(g){t(0,F=b==="always"),t(14,R=void 0),t(57,N=void 0),t(15,j=-1),Ai(g[1].toFixed(6)+", "+Tn(g[0],[-180,180],!0).toFixed(6),!1,!0)}function Ar(g){if(!R)return;let q=g.key==="ArrowDown"?1:g.key==="ArrowUp"?-1:0;q&&(j===(fe?0:-1)&&q===-1&&t(15,j=R.length),t(15,j+=q),j>=R.length&&t(15,j=-1),j<0&&fe&&t(15,j=0),g.preventDefault())}function At(g=!0,q=!1){if(t(18,he=void 0),re||q){if(Ue&&clearTimeout(Ue),W.length<L)return;const Y=W;Ue=window.setTimeout(()=>{Wt(Y).catch(oe=>t(18,he=oe))},g?y:0)}else t(14,R=void 0),t(18,he=void 0)}function Bt(g){t(57,N=g),t(1,W=g.place_name),t(15,j=-1)}const Br=()=>de.focus();function Dr(g){ht[g?"unshift":"push"](()=>{de=g,t(17,de)})}function Ur(){W=this.value,t(1,W),t(13,De),t(28,a)}const zr=()=>t(13,De=!0),Fr=()=>t(13,De=!1),jr=()=>At(),Gr=()=>{t(1,W=""),de.focus()},Zr=()=>t(0,F=!F),qr=()=>t(18,he=void 0),Qr=g=>t(15,j=g),Hr=g=>Bt(g),Vr=()=>{fe||t(15,j=-1)},Yr=()=>{};return n.$$set=g=>{"class"in g&&t(2,s=g.class),"apiKey"in g&&t(26,c=g.apiKey),"bbox"in g&&t(27,u=g.bbox),"clearButtonTitle"in g&&t(3,d=g.clearButtonTitle),"clearOnBlur"in g&&t(28,a=g.clearOnBlur),"collapsed"in g&&t(4,f=g.collapsed),"country"in g&&t(29,h=g.country),"debounceSearch"in g&&t(30,y=g.debounceSearch),"enableReverse"in g&&t(5,b=g.enableReverse),"errorMessage"in g&&t(6,v=g.errorMessage),"filter"in g&&t(31,m=g.filter),"flyTo"in g&&t(32,E=g.flyTo),"fuzzyMatch"in g&&t(33,S=g.fuzzyMatch),"language"in g&&t(34,_=g.language),"limit"in g&&t(35,k=g.limit),"mapController"in g&&t(36,x=g.mapController),"minLength"in g&&t(37,L=g.minLength),"noResultsMessage"in g&&t(7,w=g.noResultsMessage),"placeholder"in g&&t(8,C=g.placeholder),"proximity"in g&&t(38,I=g.proximity),"reverseActive"in g&&t(0,F=g.reverseActive),"reverseButtonTitle"in g&&t(9,G=g.reverseButtonTitle),"searchValue"in g&&t(1,W=g.searchValue),"showFullGeometry"in g&&t(39,M=g.showFullGeometry),"showPlaceType"in g&&t(10,Z=g.showPlaceType),"showResultsWhileTyping"in g&&t(40,re=g.showResultsWhileTyping),"selectFirst"in g&&t(11,fe=g.selectFirst),"flyToSelected"in g&&t(41,Ct=g.flyToSelected),"markerOnSelected"in g&&t(42,st=g.markerOnSelected),"types"in g&&t(43,Pe=g.types),"exhaustiveReverseGeocoding"in g&&t(44,Nt=g.exhaustiveReverseGeocoding),"excludeTypes"in g&&t(45,lt=g.excludeTypes),"zoom"in g&&t(46,Be=g.zoom),"maxZoom"in g&&t(47,ut=g.maxZoom),"apiUrl"in g&&t(48,Tt=g.apiUrl),"fetchParameters"in g&&t(49,Pt=g.fetchParameters),"iconsBaseUrl"in g&&t(12,Wi=g.iconsBaseUrl),"adjustUrlQuery"in g&&t(50,Rt=g.adjustUrlQuery),"$$scope"in g&&t(60,o=g.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&32&&t(0,F=b==="always"),n.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ct=De),a&&!De&&t(1,W="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&64&&W.length<L&&(t(57,N=void 0),t(14,R=void 0),t(18,he=void 0),t(56,H=R)),n.$$.dirty[1]&67109120&&M&&N&&!N.address&&N.geometry.type==="Point"&&N.place_type[0]!=="reverse"&&Wt(N.id,{byId:!0}).catch(g=>t(18,he=g)),n.$$.dirty[1]&201326626&&(x&&N&&N.id!==It&&E&&(!N.bbox||N.bbox[0]===N.bbox[2]&&N.bbox[1]===N.bbox[3]?x.flyTo(N.center,Ke(N)):x.fitBounds(it(N.bbox),50,Ke(N)),t(14,R=void 0),t(56,H=void 0),t(15,j=-1)),t(58,It=N==null?void 0:N.id)),n.$$.dirty[0]&18432&&fe&&R!=null&&R.length&&t(15,j=0),n.$$.dirty[0]&2&&t(15,j=-1),n.$$.dirty[0]&16384|n.$$.dirty[1]&33554432&&H!==R&&t(56,H=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&33554464&&x&&x.setEventHandler(g=>{switch(g.type){case"mapClick":F&&Wr(g.coordinates);break;case"markerClick":{const q=R==null?void 0:R.find(Y=>Y.id===g.id);q&&Bt(q)}break;case"markerMouseEnter":H&&t(15,j=ct?(R==null?void 0:R.findIndex(q=>q.id===g.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,j=-1);break}}),n.$$.dirty[0]&49152&&t(59,i=R==null?void 0:R[j]),n.$$.dirty[1]&268436514&&x&&i&&E&&Ct&&x.flyTo(i.center,Ke(i)),n.$$.dirty[1]&2080&&(st||x==null||x.setMarkers(void 0,void 0)),n.$$.dirty[1]&301991968&&x&&st&&!H&&(x.setMarkers(i?[i]:void 0,void 0),x.setSelectedMarker(i?0:-1)),n.$$.dirty[1]&100663328&&x&&x.setMarkers(H,N),n.$$.dirty[0]&32768|n.$$.dirty[1]&33554464&&H&&x&&x.setSelectedMarker(j),n.$$.dirty[0]&2|n.$$.dirty[1]&32&&x){const g=Ot(W);x.setReverseMarker(g?[g.decimalLongitude,g.decimalLatitude]:void 0)}n.$$.dirty[1]&268435456&&Ce("select",i),n.$$.dirty[1]&67108864&&Ce("pick",N),n.$$.dirty[0]&81920&&Ce("optionsVisibilityChange",ct&&!!R),n.$$.dirty[0]&16384&&Ce("featuresListed",R),n.$$.dirty[1]&33554432&&Ce("featuresMarked",H),n.$$.dirty[0]&1&&Ce("reverseToggle",F),n.$$.dirty[0]&2&&Ce("queryChange",W),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&x&&x.indicateReverse(F)},[F,W,s,d,f,b,v,w,C,G,Z,fe,Wi,De,R,j,ct,de,he,Re,Ir,Di,Ar,At,Bt,l,c,u,a,h,y,m,E,S,_,k,x,L,I,M,re,Ct,st,Pe,Nt,lt,Be,ut,Tt,Pt,Rt,Nr,Tr,Ai,Pr,Rr,H,N,It,i,o,r,Br,Dr,Ur,zr,Fr,jr,Gr,Zr,qr,Qr,Hr,Vr,Yr]}let Yn=class extends Le{constructor(e){super(),Ee(this,e,Vn,Hn,be,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,exhaustiveReverseGeocoding:44,excludeTypes:45,zoom:46,maxZoom:47,apiUrl:48,fetchParameters:49,iconsBaseUrl:12,adjustUrlQuery:50,focus:51,blur:52,setQuery:53,clearList:54,clearMap:55},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[51]}get blur(){return this.$$.ctx[52]}get setQuery(){return this.$$.ctx[53]}get clearList(){return this.$$.ctx[54]}get clearMap(){return this.$$.ctx[55]}};function qe(n,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=n,i}function yt(n,e,t={}){for(const r of n){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 o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return qe({type:"Polygon",coordinates:n},e,t)}function Qe(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function hi(n,e,t={}){return qe({type:"MultiPolygon",coordinates:n},e,t)}/**
2
2
  * splaytree v3.1.2
3
3
  * Fast Splay tree for Node and browser
4
4
  *
@@ -18,6 +18,6 @@
18
18
 
19
19
  See the Apache Version 2.0 License for specific language governing permissions
20
20
  and limitations under the License.
21
- ***************************************************************************** */function Yn(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(u){return function(d){return c([u,d])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,r=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(d){u=[6,d],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var xe=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function Kn(n,e){return n>e?1:n<e?-1:0}function Se(n,e,t){for(var i=new xe(null,null),r=i,o=i;;){var l=t(n,e.key);if(l<0){if(e.left===null)break;if(t(n,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}o.left=e,o=e,e=e.left}else if(l>0){if(e.right===null)break;if(t(n,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,o.left=e.right,e.left=i.right,e.right=i.left,e}function bt(n,e,t,i){var r=new xe(n,e);if(t===null)return r.left=r.right=null,r;t=Se(n,t,i);var o=i(n,t.key);return o<0?(r.left=t.left,r.right=t,t.left=null):o>=0&&(r.right=t.right,r.left=t,t.right=null),r}function hi(n,e,t){var i=null,r=null;if(e){e=Se(n,e,t);var o=t(e.key,n);o===0?(i=e.left,r=e.right):o<0?(r=e.right,e.right=null,i=e):(i=e.left,e.left=null,r=e)}return{left:i,right:r}}function Xn(n,e,t){return e===null?n:(n===null||(e=Se(n.key,e,t),e.left=n),e)}function wt(n,e,t,i,r){if(n){i(""+e+(t?"└── ":"├── ")+r(n)+`
22
- `);var o=e+(t?" ":"│ ");n.left&&wt(n.left,o,!1,i,r),n.right&&wt(n.right,o,!0,i,r)}}var _t=function(){function n(e){e===void 0&&(e=Kn),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=bt(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var i=new xe(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,o=Se(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(i.left=o.left,i.right=o,o.left=null):l>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,i){var r;if(t===null)return null;t=Se(e,t,i);var o=i(e,t.key);return o===0?(t.left===null?r=t.right:(r=Se(e,t.left,i),r.right=t.right),this._size--,r):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Se(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=Se(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var i=this._root,r=[],o=!1;!o;)i!==null?(r.push(i),i=i.left):r.length!==0?(i=r.pop(),e.call(t,i),i=i.right):o=!0;return this},n.prototype.range=function(e,t,i,r){for(var o=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(s.key,e)>=0&&i.call(r,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var i=t.key;return e.push(i)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var i=t.data;return e.push(i)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,i=!1,r=0,o=[];!i;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},n.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(i=t,t=t.left):t=t.right}return i},n.prototype.prev=function(e){var t=this._root,i=null;if(e.left!==null){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(i=t,t=t.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return $n(this._root)},n.prototype.load=function(e,t,i){t===void 0&&(t=[]),i===void 0&&(i=!1);var r=e.length,o=this._comparator;if(i&&xt(e,t,0,r-1,o),this._root===null)this._root=Et(e,t,0,r),this._size=r;else{var l=er(this.toList(),Jn(e,t),o);r=this._size+r,this._root=Lt({head:l},0,r)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(i){return String(i.key)});var t=[];return wt(this._root,"",!0,function(i){return t.push(i)},e),t.join("")},n.prototype.update=function(e,t,i){var r=this._comparator,o=hi(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=bt(t,i,s,r):l=bt(t,i,l,r),this._root=Xn(l,s,r)},n.prototype.split=function(e){return hi(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return Yn(this,function(r){switch(r.label){case 0:e=this._root,t=[],i=!1,r.label=1;case 1:return i?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:i=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Et(n,e,t,i){var r=i-t;if(r>0){var o=t+Math.floor(r/2),l=n[o],s=e[o],c=new xe(l,s);return c.left=Et(n,e,t,o),c.right=Et(n,e,o+1,i),c}return null}function Jn(n,e){for(var t=new xe(null,null),i=t,r=0;r<n.length;r++)i=i.next=new xe(n[r],e[r]);return i.next=null,t.next}function $n(n){for(var e=n,t=[],i=!1,r=new xe(null,null),o=r;!i;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):i=!0;return o.next=null,r.next}function Lt(n,e,t){var i=t-e;if(i>0){var r=e+Math.floor(i/2),o=Lt(n,e,r),l=n.head;return l.left=o,n.head=n.head.next,l.right=Lt(n,r+1,t),l}return null}function er(n,e,t){for(var i=new xe(null,null),r=i,o=n,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),i.next}function xt(n,e,t,i,r){if(!(t>=i)){for(var o=n[t+i>>1],l=t-1,s=i+1;;){do l++;while(r(n[l],o)<0);do s--;while(r(n[s],o)>0);if(l>=s)break;var c=n[l];n[l]=n[s],n[s]=c,c=e[l],e[l]=e[s],e[s]=c}xt(n,e,t,s,r),xt(n,e,s+1,i,r)}}const ye=11102230246251565e-32,$=134217729,tr=(3+8*ye)*ye;function St(n,e,t,i,r){let o,l,s,c,u=e[0],d=i[0],a=0,f=0;d>u==d>-u?(o=u,u=e[++a]):(o=d,d=i[++f]);let h=0;if(a<n&&f<t)for(d>u==d>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=d+o,s=o-(l-d),d=i[++f]),o=l,s!==0&&(r[h++]=s);a<n&&f<t;)d>u==d>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f]),o=l,s!==0&&(r[h++]=s);for(;a<n;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[h++]=s);for(;f<t;)l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f],o=l,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function ir(n,e){let t=e[0];for(let i=1;i<n;i++)t+=e[i];return t}function Qe(n){return new Float64Array(n)}const nr=(3+16*ye)*ye,rr=(2+12*ye)*ye,or=(9+64*ye)*ye*ye,We=Qe(4),gi=Qe(8),mi=Qe(12),pi=Qe(16),te=Qe(4);function sr(n,e,t,i,r,o,l){let s,c,u,d,a,f,h,y,b,v,m,E,S,_,k,x,L,w;const C=n-r,I=t-r,F=e-o,Z=i-o;_=C*Z,f=$*C,h=f-(f-C),y=C-h,f=$*Z,b=f-(f-Z),v=Z-b,k=y*v-(_-h*b-y*b-h*v),x=F*I,f=$*F,h=f-(f-F),y=F-h,f=$*I,b=f-(f-I),v=I-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,We[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,We[1]=S-(m+a)+(a-x),w=E+m,a=w-E,We[2]=E-(w-a)+(m-a),We[3]=w;let W=ir(4,We),M=rr*l;if(W>=M||-W>=M||(a=n-C,s=n-(C+a)+(a-r),a=t-I,u=t-(I+a)+(a-r),a=e-F,c=e-(F+a)+(a-o),a=i-Z,d=i-(Z+a)+(a-o),s===0&&c===0&&u===0&&d===0)||(M=or*l+tr*Math.abs(W),W+=C*d+Z*s-(F*u+I*c),W>=M||-W>=M))return W;_=s*Z,f=$*s,h=f-(f-s),y=s-h,f=$*Z,b=f-(f-Z),v=Z-b,k=y*v-(_-h*b-y*b-h*v),x=c*I,f=$*c,h=f-(f-c),y=c-h,f=$*I,b=f-(f-I),v=I-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,te[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,te[1]=S-(m+a)+(a-x),w=E+m,a=w-E,te[2]=E-(w-a)+(m-a),te[3]=w;const q=St(4,We,4,te,gi);_=C*d,f=$*C,h=f-(f-C),y=C-h,f=$*d,b=f-(f-d),v=d-b,k=y*v-(_-h*b-y*b-h*v),x=F*u,f=$*F,h=f-(f-F),y=F-h,f=$*u,b=f-(f-u),v=u-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,te[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,te[1]=S-(m+a)+(a-x),w=E+m,a=w-E,te[2]=E-(w-a)+(m-a),te[3]=w;const re=St(q,gi,4,te,mi);_=s*d,f=$*s,h=f-(f-s),y=s-h,f=$*d,b=f-(f-d),v=d-b,k=y*v-(_-h*b-y*b-h*v),x=c*u,f=$*c,h=f-(f-c),y=c-h,f=$*u,b=f-(f-u),v=u-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,te[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,te[1]=S-(m+a)+(a-x),w=E+m,a=w-E,te[2]=E-(w-a)+(m-a),te[3]=w;const fe=St(re,mi,4,te,pi);return pi[fe-1]}function lr(n,e,t,i,r,o){const l=(e-o)*(t-r),s=(n-r)*(i-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=nr*u?c:-sr(n,e,t,i,r,o,u)}const He=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Mt=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,i=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,o=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:i,y:o}}};let Me=Number.EPSILON;Me===void 0&&(Me=Math.pow(2,-52));const ur=Me*Me,vi=(n,e)=>{if(-Me<n&&n<Me&&-Me<e&&e<Me)return 0;const t=n-e;return t*t<ur*n*e?0:n<e?-1:1};class ar{constructor(){this.reset()}reset(){this.xRounder=new yi,this.yRounder=new yi}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class yi{constructor(){this.tree=new _t,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&vi(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&vi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Ve=new ar,it=(n,e)=>n.x*e.y-n.y*e.x,bi=(n,e)=>n.x*e.x+n.y*e.y,wi=(n,e,t)=>{const i=lr(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},nt=n=>Math.sqrt(bi(n,n)),cr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return it(r,i)/nt(r)/nt(i)},fr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return bi(r,i)/nt(r)/nt(i)},_i=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},Ei=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},dr=(n,e,t,i)=>{if(e.x===0)return Ei(t,i,n.x);if(i.x===0)return Ei(n,e,t.x);if(e.y===0)return _i(t,i,n.y);if(i.y===0)return _i(n,e,t.y);const r=it(e,i);if(r==0)return null;const o={x:t.x-n.x,y:t.y-n.y},l=it(o,e)/r,s=it(o,i)/r,c=n.x+s*e.x,u=t.x+l*i.x,d=n.y+s*e.y,a=t.y+l*i.y,f=(c+u)/2,h=(d+a)/2;return{x:f,y:h}};class le{static compare(e,t){const i=le.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,r=t.length;i<r;i++){const o=t[i];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&i.otherSE.point.events===o.otherSE.point.events&&i.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;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,i=r=>{const o=r.otherSE;t.set(r,{sine:cr(this.point,e.point,o.point),cosine:fr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||i(r),t.has(o)||i(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let hr=0;class ke{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<i)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,d=t.rightSE.point.y;if(i<r){if(c<s&&c<u)return 1;if(c>s&&c>u)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(i>r){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-i,h=d-c,y=l-r;if(a>f&&h<y)return 1;if(a<f&&h>y)return-1}return o>l?1:o<l||u<d?-1:u>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++hr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=r}static fromRing(e,t,i){let r,o,l;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),u=new le(o,!1);return new ke(c,u,[i],[l])}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<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,l=t.x+o*r.x;if(e.x===l)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),i=e.bbox(),r=Mt(t,i);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=He(t,s)&&this.comparePoint(s)===0,d=He(i,o)&&e.comparePoint(o)===0,a=He(t,c)&&this.comparePoint(c)===0,f=He(i,l)&&e.comparePoint(l)===0;if(d&&u)return f&&!a?l:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const h=dr(o,this.vector(),s,e.vector());return h===null||!He(r,h)?null:Ve.round(h.x,h.y)}split(e){const t=[],i=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new ke(r,l,this.rings.slice(),this.windings.slice());return le.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),le.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=ke.compare(t,i);if(r!==0){if(r>0){const o=t;t=i,i=o}if(t.prev===i){const o=t;t=i,i=o}for(let o=0,l=i.rings.length;o<l;o++){const s=i.rings[o],c=i.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=c}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const u=this.rings[s],d=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),i.push(d)):i[a]+=d}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(i[s]===0)continue;const u=t[s],d=u.poly;if(l.indexOf(d)===-1)if(u.isExterior)o.push(d);else{l.indexOf(d)===-1&&l.push(d);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}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(ce.type){case"union":{const i=e.length===0,r=t.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;e.length<t.length?(i=e.length,r=t.length):(i=t.length,r=e.length),this._isInResult=r===ce.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(e)!==i(t);break}default:throw new Error(`Unrecognized operation type found ${ce.type}`)}return this._isInResult}}class Li{constructor(e,t,i){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Ve.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Ve.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(ke.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(ke.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,i=this.segments.length;t<i;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class gr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Li(e[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 i=1,r=e.length;i<r;i++){const o=new Li(e[i],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class xi{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,r=e.length;i<r;i++){const o=new gr(e[i],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class rt{static factory(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.isInResult()||o.ringOut)continue;let l=null,s=o.leftSE,c=o.rightSE;const u=[s],d=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const b=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${b.x}, ${b.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let b=0,v=a.length;b<v;b++)if(a[b].point===s.point){h=b;break}if(h!==null){const b=a.splice(h)[0],v=u.splice(b.index);v.unshift(v[0].otherSE),t.push(new rt(v.reverse()));continue}a.push({index:u.length,point:s.point});const y=s.getLeftmostComparator(l);c=f.sort(y)[0].otherSE;break}t.push(new rt(u))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,d=this.events.length-1;u<d;u++){const a=this.events[u].point,f=this.events[u+1].point;wi(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const i=t[0],r=t[1];wi(i,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const l=this.events[r];le.compare(e,l)>0&&(e=l)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}}class Si{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class mr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.poly)if(o.isExteriorRing())t.push(new Si(o));else{const l=o.enclosingRing();l.poly||t.push(new Si(l)),l.poly.addInterior(o)}}return t}}class pr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new _t(t),this.segments=[]}process(e){const t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,l=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let h=0,y=f.length;h<y;h++)i.push(f[h])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let h=0,y=f.length;h<y;h++)i.push(f[h])}}if(u!==null||d!==null){let a=null;u===null?a=d:d===null?a=u:a=le.comparePoints(u,d)<=0?u:d,this.queue.remove(t.rightSE),i.push(t.rightSE);const f=t.split(a);for(let h=0,y=f.length;h<y;h++)i.push(f[h])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const d=this._splitSafely(s,u);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}}}this.tree.remove(t)}return i}_splitSafely(e,t){this.tree.remove(e);const i=e.rightSE;this.queue.remove(i);const r=e.split(t);return r.push(i),e.consumedBy===void 0&&this.tree.add(e),r}}const Mi=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,vr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class yr{run(e,t,i){ce.type=e,Ve.reset();const r=[new xi(t,!0)];for(let a=0,f=i.length;a<f;a++)r.push(new xi(i[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Mt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(ce.type==="intersection")for(let a=0,f=r.length;a<f;a++){const h=r[a];for(let y=a+1,b=r.length;y<b;y++)if(Mt(h.bbox,r[y].bbox)===null)return[]}const o=new _t(le.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let y=0,b=h.length;y<b;y++)if(o.insert(h[y]),o.size>Mi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new pr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const h=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Mi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>vr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let h=0,y=f.length;h<y;h++){const b=f[h];b.consumedBy===void 0&&o.insert(b)}s=o.size,c=o.pop()}Ve.reset();const u=rt.factory(l.segments);return new mr(u).getGeom()}}const ce=new yr;var ki={union:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("union",n,t)},intersection:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("intersection",n,t)},xor:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("xor",n,t)},difference:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("difference",n,t)}};function Ci(n,e,t){if(n!==null)for(var i,r,o,l,s,c,u,d=0,a=0,f,h=n.type,y=h==="FeatureCollection",b=h==="Feature",v=y?n.features.length:1,m=0;m<v;m++){u=y?n.features[m].geometry:b?n.geometry:n,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var E=0;E<s;E++){var S=0,_=0;if(l=f?u.geometries[E]:u,l!==null){c=l.coordinates;var k=l.type;switch(d=0,k){case null:break;case"Point":if(e(c,a,m,S,_)===!1)return!1;a++,S++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],a,m,S,_)===!1)return!1;a++,k==="MultiPoint"&&S++}k==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(r=0;r<c[i].length-d;r++){if(e(c[i][r],a,m,S,_)===!1)return!1;a++}k==="MultiLineString"&&S++,k==="Polygon"&&_++}k==="Polygon"&&S++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(_=0,r=0;r<c[i].length;r++){for(o=0;o<c[i][r].length-d;o++){if(e(c[i][r][o],a,m,S,_)===!1)return!1;a++}_++}S++}break;case"GeometryCollection":for(i=0;i<l.geometries.length;i++)if(Ci(l.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function kt(n,e){var t,i,r,o,l,s,c,u,d,a,f=0,h=n.type==="FeatureCollection",y=n.type==="Feature",b=h?n.features.length:1;for(t=0;t<b;t++){for(s=h?n.features[t].geometry:y?n.geometry:n,u=h?n.features[t].properties:y?n.properties:{},d=h?n.features[t].bbox:y?n.bbox:void 0,a=h?n.features[t].id:y?n.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,d,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,u,d,a)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],f,u,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function br(n,e){kt(n,function(t,i,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(qe(t,r,{bbox:o,id:l}),i,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var d=t.coordinates[u],a={type:c,coordinates:d};if(e(qe(a,r),i,u)===!1)return!1}})}function wr(n,e={}){const t=[];if(kt(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=ki.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?yt(i[0],e.properties):di(i,e.properties)}var Ni=wr;function _r(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ci(n,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var Ti=_r;function Er(n){const e=[];if(kt(n,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=n.features[0].properties||{},i=ki.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?yt(i[0],t):di(i,t)}var Lr=Er;function xr(n){if(!n)throw new Error("geojson is required");var e=[];return br(n,function(t){e.push(t)}),Ge(e)}var Sr=xr;function Pi(n,e){const t=Lr(Ge([yt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=tt(Ti(n)),r=(i[2]-i[0])/360/1e3,o=i[0]<-180,l=i[2]>180,s=Sr(n);if(s.features.length>1&&(o||l))for(const c of s.features){const u=tt(Ti(c));if(l&&u[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&u[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(Ge([s.features.length<2?n:Ni(s)??n,t]))}const Ri=Ge([]);function Ii(n,e,t=!0,i=!0,r={},o={},l={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"]]}}){let s;const c=[];let u,d,a;function f(){!n.getSource("full-geom")&&(l!=null&&l.fill||l!=null&&l.line)&&n.addSource("full-geom",{type:"geojson",data:Ri}),!n.getLayer("full-geom-fill")&&(l!=null&&l.fill)&&n.addLayer({...l==null?void 0:l.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),!n.getLayer("full-geom-line")&&(l!=null&&l.line)&&n.addLayer({...l==null?void 0:l.line,id:"full-geom-line",type:"line",source:"full-geom"}),a&&b(a)}n.loaded()?f():n.once("load",()=>{f()}),n.on("styledata",()=>{f()});const h=v=>{s==null||s({type:"mapClick",coordinates:[v.lngLat.lng,v.lngLat.lat]})};function y(v=!1){if(!e)throw new Error;const m=document.createElement("div");return v&&m.classList.add("marker-interactive"),new xn({props:{displayIn:"maplibre"},target:m}),new e.Marker({element:m,offset:[1,-13]})}function b(v){var m;a=v,v&&((m=n.getSource("full-geom"))==null||m.setData(v))}return{setEventHandler(v){v?(s=v,n.on("click",h)):(s=void 0,n.off("click",h))},flyTo(v,m){n.flyTo({center:v,...m?{zoom:m}:{},...r})},fitBounds(v,m,E){n.fitBounds([[v[0],v[1]],[v[2],v[3]]],{padding:m,...E?{maxZoom:E}:{},...o})},indicateReverse(v){n.getCanvasContainer().style.cursor=v?"crosshair":""},setReverseMarker(v){!e||!t||(d?v?d.setLngLat(v):(d.remove(),d=void 0):v&&(d=(typeof t=="object"?new e.Marker(t):y()).setLngLat(v).addTo(n),d.getElement().classList.add("marker-reverse")))},setMarkers(v,m){if(t){for(const E of c)E.remove();if(c.length=0,b(Ri),!!e){if(m){let E=!1;if(m.geometry.type==="GeometryCollection"){const S=m.geometry.geometries.filter(_=>_.type==="Polygon"||_.type==="MultiPolygon");e:if(S.length>0){const _=Ni(Ge(S.map(k=>qe(k))));if(!_)break e;Pi({...m,geometry:_.geometry},b),E=!0}else{const _=m.geometry.geometries.filter(k=>k.type==="LineString"||k.type==="MultiLineString");_.length>0&&(b({...m,geometry:{type:"GeometryCollection",geometries:_}}),E=!0)}}if(!E){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")Pi(m,b);else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){b(m);return}}t&&c.push((typeof t=="object"?new e.Marker(t):y()).setLngLat(m.center).addTo(n))}if(i)for(const E of v??[]){if(E===m)continue;const S=(typeof i=="object"?new e.Marker(i):y(!0)).setLngLat(E.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(E.place_type[0]==="reverse"?E.place_name:E.place_name.replace(/,.*/,""))).addTo(n),_=S.getElement();_.addEventListener("click",k=>{k.stopPropagation(),s==null||s({type:"markerClick",id:E.id})}),_.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:E.id}),S.togglePopup()}),_.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:E.id}),S.togglePopup()}),c.push(S)}}}},setSelectedMarker(v){u&&u.getElement().classList.toggle("marker-selected",!1),u=v>-1?c[v]:void 0,u==null||u.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const v=n.getCenter();return[n.getZoom(),v.lng,v.lat]}}}class Mr extends EventTarget{constructor(t={}){super();zt(this,ne);zt(this,Te);dt(this,Te,t)}onAddInt(t){const i=document.createElement("div");i.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:r,showResultMarkers:o,flyTo:l,fullGeometryStyle:s,...c}=ue(this,Te),u=typeof l=="boolean"?{}:l,d=this.getExtraProps(t,i),f={mapController:Ii(t,this.getMapLibreGl(),r,o,u,u,s),flyTo:l===void 0?!0:!!l,apiKey:"",...d,...c};if(!f.apiKey)throw new Error("no apiKey provided");dt(this,ne,new Vn({target:i,props:f}));for(const h of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])ue(this,ne).$on(h,y=>this.dispatchEvent(y));return i}setOptions(t){var c;dt(this,Te,t);const{marker:i,showResultMarkers:r,flyTo:o,fullGeometryStyle:l,...s}=ue(this,Te);(c=ue(this,ne))==null||c.$set(s)}setQuery(t,i=!0){var r;(r=ue(this,ne))==null||r.setQuery(t,i)}clearMap(){var t;(t=ue(this,ne))==null||t.clearMap()}clearList(){var t;(t=ue(this,ne))==null||t.clearList()}setReverseMode(t){var i;(i=ue(this,ne))==null||i.$set({reverseActive:t})}focus(){var t;(t=ue(this,ne))==null||t.focus()}blur(){var t;(t=ue(this,ne))==null||t.blur()}onRemove(){var t;(t=ue(this,ne))==null||t.$destroy()}}ne=new WeakMap,Te=new WeakMap;class kr extends Mr{getMapLibreGl(){return Ke}onAdd(e){return super.onAddInt(e)}getExtraProps(e,t){const i={};if(!("getSdkConfig"in e&&typeof e.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:r,apiKey:o}=e.getSdkConfig();i.apiKey=o;const l=/^([a-z]{2})($|_|-)/.exec(r);return l&&(i.language=l[1]),t.className+=" maptiler-ctrl",i}}O.GeocodingControl=kr,O.createMapLibreGlMapController=Ii,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
21
+ ***************************************************************************** */function Kn(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(u){return function(d){return c([u,d])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,r=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(d){u=[6,d],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var xe=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function Xn(n,e){return n>e?1:n<e?-1:0}function Se(n,e,t){for(var i=new xe(null,null),r=i,o=i;;){var l=t(n,e.key);if(l<0){if(e.left===null)break;if(t(n,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}o.left=e,o=e,e=e.left}else if(l>0){if(e.right===null)break;if(t(n,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,o.left=e.right,e.left=i.right,e.right=i.left,e}function bt(n,e,t,i){var r=new xe(n,e);if(t===null)return r.left=r.right=null,r;t=Se(n,t,i);var o=i(n,t.key);return o<0?(r.left=t.left,r.right=t,t.left=null):o>=0&&(r.right=t.right,r.left=t,t.right=null),r}function gi(n,e,t){var i=null,r=null;if(e){e=Se(n,e,t);var o=t(e.key,n);o===0?(i=e.left,r=e.right):o<0?(r=e.right,e.right=null,i=e):(i=e.left,e.left=null,r=e)}return{left:i,right:r}}function Jn(n,e,t){return e===null?n:(n===null||(e=Se(n.key,e,t),e.left=n),e)}function wt(n,e,t,i,r){if(n){i(""+e+(t?"└── ":"├── ")+r(n)+`
22
+ `);var o=e+(t?" ":"│ ");n.left&&wt(n.left,o,!1,i,r),n.right&&wt(n.right,o,!0,i,r)}}var _t=function(){function n(e){e===void 0&&(e=Xn),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=bt(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var i=new xe(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,o=Se(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(i.left=o.left,i.right=o,o.left=null):l>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,i){var r;if(t===null)return null;t=Se(e,t,i);var o=i(e,t.key);return o===0?(t.left===null?r=t.right:(r=Se(e,t.left,i),r.right=t.right),this._size--,r):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Se(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=Se(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var i=this._root,r=[],o=!1;!o;)i!==null?(r.push(i),i=i.left):r.length!==0?(i=r.pop(),e.call(t,i),i=i.right):o=!0;return this},n.prototype.range=function(e,t,i,r){for(var o=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(s.key,e)>=0&&i.call(r,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var i=t.key;return e.push(i)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var i=t.data;return e.push(i)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,i=!1,r=0,o=[];!i;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},n.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(i=t,t=t.left):t=t.right}return i},n.prototype.prev=function(e){var t=this._root,i=null;if(e.left!==null){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(i=t,t=t.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return er(this._root)},n.prototype.load=function(e,t,i){t===void 0&&(t=[]),i===void 0&&(i=!1);var r=e.length,o=this._comparator;if(i&&xt(e,t,0,r-1,o),this._root===null)this._root=Et(e,t,0,r),this._size=r;else{var l=tr(this.toList(),$n(e,t),o);r=this._size+r,this._root=Lt({head:l},0,r)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(i){return String(i.key)});var t=[];return wt(this._root,"",!0,function(i){return t.push(i)},e),t.join("")},n.prototype.update=function(e,t,i){var r=this._comparator,o=gi(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=bt(t,i,s,r):l=bt(t,i,l,r),this._root=Jn(l,s,r)},n.prototype.split=function(e){return gi(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return Kn(this,function(r){switch(r.label){case 0:e=this._root,t=[],i=!1,r.label=1;case 1:return i?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:i=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Et(n,e,t,i){var r=i-t;if(r>0){var o=t+Math.floor(r/2),l=n[o],s=e[o],c=new xe(l,s);return c.left=Et(n,e,t,o),c.right=Et(n,e,o+1,i),c}return null}function $n(n,e){for(var t=new xe(null,null),i=t,r=0;r<n.length;r++)i=i.next=new xe(n[r],e[r]);return i.next=null,t.next}function er(n){for(var e=n,t=[],i=!1,r=new xe(null,null),o=r;!i;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):i=!0;return o.next=null,r.next}function Lt(n,e,t){var i=t-e;if(i>0){var r=e+Math.floor(i/2),o=Lt(n,e,r),l=n.head;return l.left=o,n.head=n.head.next,l.right=Lt(n,r+1,t),l}return null}function tr(n,e,t){for(var i=new xe(null,null),r=i,o=n,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),i.next}function xt(n,e,t,i,r){if(!(t>=i)){for(var o=n[t+i>>1],l=t-1,s=i+1;;){do l++;while(r(n[l],o)<0);do s--;while(r(n[s],o)>0);if(l>=s)break;var c=n[l];n[l]=n[s],n[s]=c,c=e[l],e[l]=e[s],e[s]=c}xt(n,e,t,s,r),xt(n,e,s+1,i,r)}}const ye=11102230246251565e-32,$=134217729,ir=(3+8*ye)*ye;function St(n,e,t,i,r){let o,l,s,c,u=e[0],d=i[0],a=0,f=0;d>u==d>-u?(o=u,u=e[++a]):(o=d,d=i[++f]);let h=0;if(a<n&&f<t)for(d>u==d>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=d+o,s=o-(l-d),d=i[++f]),o=l,s!==0&&(r[h++]=s);a<n&&f<t;)d>u==d>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f]),o=l,s!==0&&(r[h++]=s);for(;a<n;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[h++]=s);for(;f<t;)l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f],o=l,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function nr(n,e){let t=e[0];for(let i=1;i<n;i++)t+=e[i];return t}function He(n){return new Float64Array(n)}const rr=(3+16*ye)*ye,or=(2+12*ye)*ye,sr=(9+64*ye)*ye*ye,Ae=He(4),mi=He(8),pi=He(12),vi=He(16),te=He(4);function lr(n,e,t,i,r,o,l){let s,c,u,d,a,f,h,y,b,v,m,E,S,_,k,x,L,w;const C=n-r,I=t-r,F=e-o,G=i-o;_=C*G,f=$*C,h=f-(f-C),y=C-h,f=$*G,b=f-(f-G),v=G-b,k=y*v-(_-h*b-y*b-h*v),x=F*I,f=$*F,h=f-(f-F),y=F-h,f=$*I,b=f-(f-I),v=I-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,Ae[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,Ae[1]=S-(m+a)+(a-x),w=E+m,a=w-E,Ae[2]=E-(w-a)+(m-a),Ae[3]=w;let W=nr(4,Ae),M=or*l;if(W>=M||-W>=M||(a=n-C,s=n-(C+a)+(a-r),a=t-I,u=t-(I+a)+(a-r),a=e-F,c=e-(F+a)+(a-o),a=i-G,d=i-(G+a)+(a-o),s===0&&c===0&&u===0&&d===0)||(M=sr*l+ir*Math.abs(W),W+=C*d+G*s-(F*u+I*c),W>=M||-W>=M))return W;_=s*G,f=$*s,h=f-(f-s),y=s-h,f=$*G,b=f-(f-G),v=G-b,k=y*v-(_-h*b-y*b-h*v),x=c*I,f=$*c,h=f-(f-c),y=c-h,f=$*I,b=f-(f-I),v=I-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,te[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,te[1]=S-(m+a)+(a-x),w=E+m,a=w-E,te[2]=E-(w-a)+(m-a),te[3]=w;const Z=St(4,Ae,4,te,mi);_=C*d,f=$*C,h=f-(f-C),y=C-h,f=$*d,b=f-(f-d),v=d-b,k=y*v-(_-h*b-y*b-h*v),x=F*u,f=$*F,h=f-(f-F),y=F-h,f=$*u,b=f-(f-u),v=u-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,te[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,te[1]=S-(m+a)+(a-x),w=E+m,a=w-E,te[2]=E-(w-a)+(m-a),te[3]=w;const re=St(Z,mi,4,te,pi);_=s*d,f=$*s,h=f-(f-s),y=s-h,f=$*d,b=f-(f-d),v=d-b,k=y*v-(_-h*b-y*b-h*v),x=c*u,f=$*c,h=f-(f-c),y=c-h,f=$*u,b=f-(f-u),v=u-b,L=y*v-(x-h*b-y*b-h*v),m=k-L,a=k-m,te[0]=k-(m+a)+(a-L),E=_+m,a=E-_,S=_-(E-a)+(m-a),m=S-x,a=S-m,te[1]=S-(m+a)+(a-x),w=E+m,a=w-E,te[2]=E-(w-a)+(m-a),te[3]=w;const fe=St(re,pi,4,te,vi);return vi[fe-1]}function ur(n,e,t,i,r,o){const l=(e-o)*(t-r),s=(n-r)*(i-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=rr*u?c:-lr(n,e,t,i,r,o,u)}const Ve=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Mt=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,i=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,o=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:i,y:o}}};let Me=Number.EPSILON;Me===void 0&&(Me=Math.pow(2,-52));const ar=Me*Me,yi=(n,e)=>{if(-Me<n&&n<Me&&-Me<e&&e<Me)return 0;const t=n-e;return t*t<ar*n*e?0:n<e?-1:1};class cr{constructor(){this.reset()}reset(){this.xRounder=new bi,this.yRounder=new bi}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class bi{constructor(){this.tree=new _t,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&yi(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&yi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Ye=new cr,nt=(n,e)=>n.x*e.y-n.y*e.x,wi=(n,e)=>n.x*e.x+n.y*e.y,_i=(n,e,t)=>{const i=ur(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},rt=n=>Math.sqrt(wi(n,n)),fr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return nt(r,i)/rt(r)/rt(i)},dr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return wi(r,i)/rt(r)/rt(i)},Ei=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},Li=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},hr=(n,e,t,i)=>{if(e.x===0)return Li(t,i,n.x);if(i.x===0)return Li(n,e,t.x);if(e.y===0)return Ei(t,i,n.y);if(i.y===0)return Ei(n,e,t.y);const r=nt(e,i);if(r==0)return null;const o={x:t.x-n.x,y:t.y-n.y},l=nt(o,e)/r,s=nt(o,i)/r,c=n.x+s*e.x,u=t.x+l*i.x,d=n.y+s*e.y,a=t.y+l*i.y,f=(c+u)/2,h=(d+a)/2;return{x:f,y:h}};class le{static compare(e,t){const i=le.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,r=t.length;i<r;i++){const o=t[i];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&i.otherSE.point.events===o.otherSE.point.events&&i.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;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,i=r=>{const o=r.otherSE;t.set(r,{sine:fr(this.point,e.point,o.point),cosine:dr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||i(r),t.has(o)||i(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let gr=0;class ke{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<i)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,d=t.rightSE.point.y;if(i<r){if(c<s&&c<u)return 1;if(c>s&&c>u)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(i>r){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-i,h=d-c,y=l-r;if(a>f&&h<y)return 1;if(a<f&&h>y)return-1}return o>l?1:o<l||u<d?-1:u>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++gr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=r}static fromRing(e,t,i){let r,o,l;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),u=new le(o,!1);return new ke(c,u,[i],[l])}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<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,l=t.x+o*r.x;if(e.x===l)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),i=e.bbox(),r=Mt(t,i);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=Ve(t,s)&&this.comparePoint(s)===0,d=Ve(i,o)&&e.comparePoint(o)===0,a=Ve(t,c)&&this.comparePoint(c)===0,f=Ve(i,l)&&e.comparePoint(l)===0;if(d&&u)return f&&!a?l:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const h=hr(o,this.vector(),s,e.vector());return h===null||!Ve(r,h)?null:Ye.round(h.x,h.y)}split(e){const t=[],i=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new ke(r,l,this.rings.slice(),this.windings.slice());return le.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),le.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=ke.compare(t,i);if(r!==0){if(r>0){const o=t;t=i,i=o}if(t.prev===i){const o=t;t=i,i=o}for(let o=0,l=i.rings.length;o<l;o++){const s=i.rings[o],c=i.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=c}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const u=this.rings[s],d=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),i.push(d)):i[a]+=d}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(i[s]===0)continue;const u=t[s],d=u.poly;if(l.indexOf(d)===-1)if(u.isExterior)o.push(d);else{l.indexOf(d)===-1&&l.push(d);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}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(ce.type){case"union":{const i=e.length===0,r=t.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;e.length<t.length?(i=e.length,r=t.length):(i=t.length,r=e.length),this._isInResult=r===ce.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(e)!==i(t);break}default:throw new Error(`Unrecognized operation type found ${ce.type}`)}return this._isInResult}}class xi{constructor(e,t,i){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Ye.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Ye.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(ke.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(ke.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,i=this.segments.length;t<i;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class mr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new xi(e[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 i=1,r=e.length;i<r;i++){const o=new xi(e[i],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class Si{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,r=e.length;i<r;i++){const o=new mr(e[i],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class ot{static factory(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.isInResult()||o.ringOut)continue;let l=null,s=o.leftSE,c=o.rightSE;const u=[s],d=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const b=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${b.x}, ${b.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let b=0,v=a.length;b<v;b++)if(a[b].point===s.point){h=b;break}if(h!==null){const b=a.splice(h)[0],v=u.splice(b.index);v.unshift(v[0].otherSE),t.push(new ot(v.reverse()));continue}a.push({index:u.length,point:s.point});const y=s.getLeftmostComparator(l);c=f.sort(y)[0].otherSE;break}t.push(new ot(u))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,d=this.events.length-1;u<d;u++){const a=this.events[u].point,f=this.events[u+1].point;_i(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const i=t[0],r=t[1];_i(i,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const l=this.events[r];le.compare(e,l)>0&&(e=l)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}}class Mi{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class pr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.poly)if(o.isExteriorRing())t.push(new Mi(o));else{const l=o.enclosingRing();l.poly||t.push(new Mi(l)),l.poly.addInterior(o)}}return t}}class vr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new _t(t),this.segments=[]}process(e){const t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,l=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let h=0,y=f.length;h<y;h++)i.push(f[h])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let h=0,y=f.length;h<y;h++)i.push(f[h])}}if(u!==null||d!==null){let a=null;u===null?a=d:d===null?a=u:a=le.comparePoints(u,d)<=0?u:d,this.queue.remove(t.rightSE),i.push(t.rightSE);const f=t.split(a);for(let h=0,y=f.length;h<y;h++)i.push(f[h])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const d=this._splitSafely(s,u);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}}}this.tree.remove(t)}return i}_splitSafely(e,t){this.tree.remove(e);const i=e.rightSE;this.queue.remove(i);const r=e.split(t);return r.push(i),e.consumedBy===void 0&&this.tree.add(e),r}}const ki=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,yr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class br{run(e,t,i){ce.type=e,Ye.reset();const r=[new Si(t,!0)];for(let a=0,f=i.length;a<f;a++)r.push(new Si(i[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Mt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(ce.type==="intersection")for(let a=0,f=r.length;a<f;a++){const h=r[a];for(let y=a+1,b=r.length;y<b;y++)if(Mt(h.bbox,r[y].bbox)===null)return[]}const o=new _t(le.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let y=0,b=h.length;y<b;y++)if(o.insert(h[y]),o.size>ki)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new vr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const h=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>ki)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>yr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let h=0,y=f.length;h<y;h++){const b=f[h];b.consumedBy===void 0&&o.insert(b)}s=o.size,c=o.pop()}Ye.reset();const u=ot.factory(l.segments);return new pr(u).getGeom()}}const ce=new br;var Ci={union:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("union",n,t)},intersection:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("intersection",n,t)},xor:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("xor",n,t)},difference:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("difference",n,t)}};function Ni(n,e,t){if(n!==null)for(var i,r,o,l,s,c,u,d=0,a=0,f,h=n.type,y=h==="FeatureCollection",b=h==="Feature",v=y?n.features.length:1,m=0;m<v;m++){u=y?n.features[m].geometry:b?n.geometry:n,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var E=0;E<s;E++){var S=0,_=0;if(l=f?u.geometries[E]:u,l!==null){c=l.coordinates;var k=l.type;switch(d=0,k){case null:break;case"Point":if(e(c,a,m,S,_)===!1)return!1;a++,S++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],a,m,S,_)===!1)return!1;a++,k==="MultiPoint"&&S++}k==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(r=0;r<c[i].length-d;r++){if(e(c[i][r],a,m,S,_)===!1)return!1;a++}k==="MultiLineString"&&S++,k==="Polygon"&&_++}k==="Polygon"&&S++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(_=0,r=0;r<c[i].length;r++){for(o=0;o<c[i][r].length-d;o++){if(e(c[i][r][o],a,m,S,_)===!1)return!1;a++}_++}S++}break;case"GeometryCollection":for(i=0;i<l.geometries.length;i++)if(Ni(l.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function kt(n,e){var t,i,r,o,l,s,c,u,d,a,f=0,h=n.type==="FeatureCollection",y=n.type==="Feature",b=h?n.features.length:1;for(t=0;t<b;t++){for(s=h?n.features[t].geometry:y?n.geometry:n,u=h?n.features[t].properties:y?n.properties:{},d=h?n.features[t].bbox:y?n.bbox:void 0,a=h?n.features[t].id:y?n.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,d,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,u,d,a)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],f,u,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function wr(n,e){kt(n,function(t,i,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(qe(t,r,{bbox:o,id:l}),i,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var d=t.coordinates[u],a={type:c,coordinates:d};if(e(qe(a,r),i,u)===!1)return!1}})}function _r(n,e={}){const t=[];if(kt(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=Ci.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?yt(i[0],e.properties):hi(i,e.properties)}var Ti=_r;function Er(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ni(n,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var Pi=Er;function Lr(n){const e=[];if(kt(n,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=n.features[0].properties||{},i=Ci.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?yt(i[0],t):hi(i,t)}var xr=Lr;function Sr(n){if(!n)throw new Error("geojson is required");var e=[];return wr(n,function(t){e.push(t)}),Qe(e)}var Mr=Sr;function Ri(n,e){const t=xr(Qe([yt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=it(Pi(n)),r=(i[2]-i[0])/360/1e3,o=i[0]<-180,l=i[2]>180,s=Mr(n);if(s.features.length>1&&(o||l))for(const c of s.features){const u=it(Pi(c));if(l&&u[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&u[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(Qe([s.features.length<2?n:Ti(s)??n,t]))}const Ii=Qe([]);function Oi(n,e,t=!0,i=!0,r={},o={},l={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"]]}}){let s;const c=[];let u,d,a;function f(){!n.getSource("full-geom")&&(l!=null&&l.fill||l!=null&&l.line)&&n.addSource("full-geom",{type:"geojson",data:Ii}),!n.getLayer("full-geom-fill")&&(l!=null&&l.fill)&&n.addLayer({...l==null?void 0:l.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),!n.getLayer("full-geom-line")&&(l!=null&&l.line)&&n.addLayer({...l==null?void 0:l.line,id:"full-geom-line",type:"line",source:"full-geom"}),a&&b(a)}n.loaded()?f():n.once("load",()=>{f()}),n.on("styledata",()=>{f()});const h=v=>{s==null||s({type:"mapClick",coordinates:[v.lngLat.lng,v.lngLat.lat]})};function y(v=!1){if(!e)throw new Error;const m=document.createElement("div");return v&&m.classList.add("marker-interactive"),new Sn({props:{displayIn:"maplibre"},target:m}),new e.Marker({element:m,offset:[1,-13]})}function b(v){var m;a=v,v&&((m=n.getSource("full-geom"))==null||m.setData(v))}return{setEventHandler(v){v?(s=v,n.on("click",h)):(s=void 0,n.off("click",h))},flyTo(v,m){n.flyTo({center:v,...m?{zoom:m}:{},...r})},fitBounds(v,m,E){n.fitBounds([[v[0],v[1]],[v[2],v[3]]],{padding:m,...E?{maxZoom:E}:{},...o})},indicateReverse(v){n.getCanvasContainer().style.cursor=v?"crosshair":""},setReverseMarker(v){!e||!t||(d?v?d.setLngLat(v):(d.remove(),d=void 0):v&&(d=(typeof t=="object"?new e.Marker(t):y()).setLngLat(v).addTo(n),d.getElement().classList.add("marker-reverse")))},setMarkers(v,m){if(t){for(const E of c)E.remove();if(c.length=0,b(Ii),!!e){if(m){let E=!1;if(m.geometry.type==="GeometryCollection"){const S=m.geometry.geometries.filter(_=>_.type==="Polygon"||_.type==="MultiPolygon");e:if(S.length>0){const _=Ti(Qe(S.map(k=>qe(k))));if(!_)break e;Ri({...m,geometry:_.geometry},b),E=!0}else{const _=m.geometry.geometries.filter(k=>k.type==="LineString"||k.type==="MultiLineString");_.length>0&&(b({...m,geometry:{type:"GeometryCollection",geometries:_}}),E=!0)}}if(!E){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")Ri(m,b);else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){b(m);return}}t&&c.push((typeof t=="object"?new e.Marker(t):y()).setLngLat(m.center).addTo(n))}if(i)for(const E of v??[]){if(E===m)continue;const S=(typeof i=="object"?new e.Marker(i):y(!0)).setLngLat(E.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(E.place_type[0]==="reverse"?E.place_name:E.place_name.replace(/,.*/,""))).addTo(n),_=S.getElement();_.addEventListener("click",k=>{k.stopPropagation(),s==null||s({type:"markerClick",id:E.id})}),_.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:E.id}),S.togglePopup()}),_.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:E.id}),S.togglePopup()}),c.push(S)}}}},setSelectedMarker(v){u&&u.getElement().classList.toggle("marker-selected",!1),u=v>-1?c[v]:void 0,u==null||u.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const v=n.getCenter();return[n.getZoom(),v.lng,v.lat]}}}class kr extends EventTarget{constructor(t={}){super();Ft(this,ne);Ft(this,Te);dt(this,Te,t)}onAddInt(t){const i=document.createElement("div");i.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:r,showResultMarkers:o,flyTo:l,fullGeometryStyle:s,...c}=ue(this,Te),u=typeof l=="boolean"?{}:l,d=this.getExtraProps(t,i),f={mapController:Oi(t,this.getMapLibreGl(),r,o,u,u,s),flyTo:l===void 0?!0:!!l,apiKey:"",...d,...c};if(!f.apiKey)throw new Error("no apiKey provided");dt(this,ne,new Yn({target:i,props:f}));for(const h of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])ue(this,ne).$on(h,y=>this.dispatchEvent(y));return i}setOptions(t){var c;dt(this,Te,t);const{marker:i,showResultMarkers:r,flyTo:o,fullGeometryStyle:l,...s}=ue(this,Te);(c=ue(this,ne))==null||c.$set(s)}setQuery(t,i=!0){var r;(r=ue(this,ne))==null||r.setQuery(t,i)}clearMap(){var t;(t=ue(this,ne))==null||t.clearMap()}clearList(){var t;(t=ue(this,ne))==null||t.clearList()}setReverseMode(t){var i;(i=ue(this,ne))==null||i.$set({reverseActive:t})}focus(){var t;(t=ue(this,ne))==null||t.focus()}blur(){var t;(t=ue(this,ne))==null||t.blur()}onRemove(){var t;(t=ue(this,ne))==null||t.$destroy()}}ne=new WeakMap,Te=new WeakMap;class Cr extends kr{getMapLibreGl(){return Xe}onAdd(e){return super.onAddInt(e)}getExtraProps(e,t){const i={};if(!("getSdkConfig"in e&&typeof e.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:r,apiKey:o}=e.getSdkConfig();i.apiKey=o;const l=/^([a-z]{2})($|_|-)/.exec(r);return l&&(i.language=l[1]),t.className+=" maptiler-ctrl",i}}O.GeocodingControl=Cr,O.createMapLibreGlMapController=Oi,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
23
23
  //# sourceMappingURL=maptilersdk.umd.js.map