@arenarium/maps 1.0.192 → 1.0.200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(N,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(N=typeof globalThis<"u"?globalThis:N||self,D(N.arenarium={}))})(this,function(N){"use strict";var Xo=Object.defineProperty;var Pa=N=>{throw TypeError(N)};var Ho=(N,D,V)=>D in N?Xo(N,D,{enumerable:!0,configurable:!0,writable:!0,value:V}):N[D]=V;var p=(N,D,V)=>Ho(N,typeof D!="symbol"?D+"":D,V),mr=(N,D,V)=>D.has(N)||Pa("Cannot "+V);var C=(N,D,V)=>(mr(N,D,"read from private field"),V?V.call(N):D.get(N)),Y=(N,D,V)=>D.has(N)?Pa("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(N):D.set(N,V),H=(N,D,V,Gt)=>(mr(N,D,"write to private field"),Gt?Gt.call(N,V):D.set(N,V),V),rt=(N,D,V)=>(mr(N,D,"access private method"),V);var _t,xt,Fe,Ft,Bt,Qe,bt,et,Be,wt,Vt,Ut,fe,Ia,xn,gr,Ta,Se,kt,$t,tt;var V=Array.isArray,Gt=Array.prototype.indexOf,ja=Array.from,bn=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,Da=Object.prototype,Za=Array.prototype,Fa=Object.getPrototypeOf,yr=Object.isExtensible;function Ba(n){for(var e=0;e<n.length;e++)n[e]()}function Va(){var n,e,t=new Promise((r,a)=>{n=r,e=a});return{promise:t,resolve:n,reject:e}}const ae=2,wn=4,vr=8,Yt=16,Me=32,We=64,_r=128,se=256,Xt=512,ee=1024,me=2048,Ae=4096,at=8192,it=16384,kn=32768,Ua=65536,xr=1<<17,$a=1<<18,Sn=1<<19,br=1<<20,zn=1<<21,En=1<<22,qe=1<<23,Ht=Symbol("$state"),Mn=new class extends Error{constructor(){super(...arguments);p(this,"name","StaleReactionError");p(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Wa(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function qa(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ga(n){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ya(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Xa(n){throw new Error("https://svelte.dev/e/effect_orphan")}function Ha(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ja(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ka(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Qa(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const ei=2,X=Symbol();function wr(n){return n===this.v}let Jo=!1,pe=null;function Jt(n){pe=n}function An(n,e=!1,t){pe={p:pe,c:null,e:null,s:n,x:null,l:null}}function Cn(n){var e=pe,t=e.e;if(t!==null){e.e=null;for(var r of t)Zr(r)}return n!==void 0&&(e.x=n),pe=e.p,n??{}}function kr(){return!0}const ti=new WeakMap;function ni(n){var e=j;if(e===null)return O.f|=qe,n;if((e.f&kn)===0){if((e.f&_r)===0)throw!e.parent&&n instanceof Error&&Sr(n),n;e.b.error(n)}else Nn(n,e)}function Nn(n,e){for(;e!==null;){if((e.f&_r)!==0)try{e.b.error(n);return}catch(t){n=t}e=e.parent}throw n instanceof Error&&Sr(n),n}function Sr(n){const e=ti.get(n);e&&(bn(n,"message",{value:e.message}),bn(n,"stack",{value:e.stack}))}let Kt=[];function ri(){var n=Kt;Kt=[],Ba(n)}function ai(n){Kt.length===0&&queueMicrotask(ri),Kt.push(n)}function ii(){for(var n=j.b;n!==null&&!n.has_pending_snippet();)n=n.parent;return n===null&&Wa(),n}function oi(n){var e=ae|me,t=O!==null&&(O.f&ae)!==0?O:null;return j===null||t!==null&&(t.f&se)!==0?e|=se:j.f|=Sn,{ctx:pe,deps:null,effects:null,equals:wr,f:e,fn:n,reactions:null,rv:0,v:X,wv:0,parent:t??j,ac:null}}function si(n,e){let t=j;t===null&&qa();var r=t.b,a=void 0,i=Tr(X),o=null,s=!O;return xi(()=>{try{var c=n()}catch(f){c=Promise.reject(f)}var l=()=>c;a=(o==null?void 0:o.then(l,l))??Promise.resolve(c),o=a;var u=q,d=r.pending;s&&(r.update_pending_count(1),d||u.increment());const m=(f,z=void 0)=>{o=null,d||u.activate(),z?z!==Mn&&(i.f|=qe,Rn(i,z)):((i.f&qe)!==0&&(i.f^=qe),Rn(i,f)),s&&(r.update_pending_count(-1),d||u.decrement()),Mr()};if(a.then(m,f=>m(null,f||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(c=>{function l(u){function d(){u===a?c(i):l(a)}u.then(d,d)}l(a)})}function zr(n){var e=n.effects;if(e!==null){n.effects=null;for(var t=0;t<e.length;t+=1)Xe(e[t])}}function li(n){for(var e=n.parent;e!==null;){if((e.f&ae)===0)return e;e=e.parent}return null}function Tn(n){var e,t=j;ct(li(n));try{zr(n),e=Kr(n)}finally{ct(t)}return e}function Er(n){var e=Tn(n);if(n.equals(e)||(n.v=e,n.wv=Hr()),!lt)if(Ce!==null)Ce.set(n,n.v);else{var t=(Te||(n.f&se)!==0)&&n.deps!==null?Ae:ee;ce(n,t)}}function ci(n,e,t){const r=oi;if(e.length===0){t(n.map(r));return}var a=q,i=j,o=ui(),s=ii();Promise.all(e.map(c=>si(c))).then(c=>{a==null||a.activate(),o();try{t([...n.map(r),...c])}catch(l){(i.f&it)===0&&Nn(l,i)}a==null||a.deactivate(),Mr()}).catch(c=>{s.error(c)})}function ui(){var n=j,e=O,t=pe;return function(){ct(n),Ne(e),Jt(t)}}function Mr(){ct(null),Ne(null),Jt(null)}const At=new Set;let q=null,Ce=null,Ar=new Set,Qt=[];function Cr(){const n=Qt.shift();Qt.length>0&&queueMicrotask(Cr),n()}let Ct=[],Ln=null,On=!1;const pn=class pn{constructor(){Y(this,fe);p(this,"current",new Map);Y(this,_t,new Map);Y(this,xt,new Set);Y(this,Fe,0);Y(this,Ft,null);Y(this,Bt,!1);Y(this,Qe,[]);Y(this,bt,[]);Y(this,et,[]);Y(this,Be,[]);Y(this,wt,[]);Y(this,Vt,[]);Y(this,Ut,[]);p(this,"skipped_effects",new Set)}process(e){var i;Ct=[];var t=null;if(At.size>1){t=new Map,Ce=new Map;for(const[o,s]of this.current)t.set(o,{v:o.v,wv:o.wv}),o.v=s;for(const o of At)if(o!==this)for(const[s,c]of C(o,_t))t.has(s)||(t.set(s,{v:s.v,wv:s.wv}),s.v=c)}for(const o of e)rt(this,fe,Ia).call(this,o);if(C(this,Qe).length===0&&C(this,Fe)===0){rt(this,fe,gr).call(this);var r=C(this,et),a=C(this,Be);H(this,et,[]),H(this,Be,[]),H(this,wt,[]),q=null,Nr(r),Nr(a),q===null?q=this:At.delete(this),(i=C(this,Ft))==null||i.resolve()}else rt(this,fe,xn).call(this,C(this,et)),rt(this,fe,xn).call(this,C(this,Be)),rt(this,fe,xn).call(this,C(this,wt));if(t){for(const[o,{v:s,wv:c}]of t)o.wv<=c&&(o.v=s);Ce=null}for(const o of C(this,Qe))Ot(o);for(const o of C(this,bt))Ot(o);H(this,Qe,[]),H(this,bt,[])}capture(e,t){C(this,_t).has(e)||C(this,_t).set(e,t),this.current.set(e,e.v)}activate(){q=this}deactivate(){q=null;for(const e of Ar)if(Ar.delete(e),e(),q!==null)break}neuter(){H(this,Bt,!0)}flush(){Ct.length>0?di():rt(this,fe,gr).call(this),q===this&&(C(this,Fe)===0&&At.delete(this),this.deactivate())}increment(){H(this,Fe,C(this,Fe)+1)}decrement(){if(H(this,Fe,C(this,Fe)-1),C(this,Fe)===0){for(const e of C(this,Vt))ce(e,me),ot(e);for(const e of C(this,Ut))ce(e,Ae),ot(e);H(this,et,[]),H(this,Be,[]),this.flush()}else this.deactivate()}add_callback(e){C(this,xt).add(e)}settled(){return(C(this,Ft)??H(this,Ft,Va())).promise}static ensure(){if(q===null){const e=q=new pn;At.add(q),pn.enqueue(()=>{q===e&&e.flush()})}return q}static enqueue(e){Qt.length===0&&queueMicrotask(Cr),Qt.unshift(e)}};_t=new WeakMap,xt=new WeakMap,Fe=new WeakMap,Ft=new WeakMap,Bt=new WeakMap,Qe=new WeakMap,bt=new WeakMap,et=new WeakMap,Be=new WeakMap,wt=new WeakMap,Vt=new WeakMap,Ut=new WeakMap,fe=new WeakSet,Ia=function(e){var u;e.f^=ee;for(var t=e.first;t!==null;){var r=t.f,a=(r&(Me|We))!==0,i=a&&(r&ee)!==0,o=i||(r&at)!==0||this.skipped_effects.has(t);if(!o&&t.fn!==null){if(a)t.f^=ee;else if((r&ee)===0)if((r&wn)!==0)C(this,Be).push(t);else if((r&En)!==0){var s=(u=t.b)!=null&&u.pending?C(this,bt):C(this,Qe);s.push(t)}else en(t)&&((t.f&Yt)!==0&&C(this,wt).push(t),Ot(t));var c=t.first;if(c!==null){t=c;continue}}var l=t.parent;for(t=t.next;t===null&&l!==null;)t=l.next,l=l.parent}},xn=function(e){for(const t of e)((t.f&me)!==0?C(this,Vt):C(this,Ut)).push(t),ce(t,ee);e.length=0},gr=function(){if(!C(this,Bt))for(const e of C(this,xt))e();C(this,xt).clear()};let Nt=pn;function di(){var n=st;On=!0;try{var e=0;for(qr(!0);Ct.length>0;){var t=Nt.ensure();if(e++>1e3){var r,a;pi()}t.process(Ct),Ge.clear()}}finally{On=!1,qr(n),Ln=null}}function pi(){try{Ha()}catch(n){Nn(n,Ln)}}function Nr(n){var e=n.length;if(e!==0){for(var t=0;t<e;){var r=n[t++];if((r.f&(it|at))===0&&en(r)){var a=q?q.current.size:0;if(Ot(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?$r(r):r.fn=null),q!==null&&q.current.size>a&&(r.f&br)!==0)break}}for(;t<e;)ot(n[t++])}}function ot(n){for(var e=Ln=n;e.parent!==null;){e=e.parent;var t=e.f;if(On&&e===j&&(t&Yt)!==0)return;if((t&(We|Me))!==0){if((t&ee)===0)return;e.f^=ee}}Ct.push(e)}const Ge=new Map;function Tr(n,e){var t={f:0,v:n,reactions:null,equals:wr,rv:0,wv:0};return t}function te(n,e){const t=Tr(n);return Ei(t),t}function J(n,e,t=!1){O!==null&&(!ge||(O.f&xr)!==0)&&kr()&&(O.f&(ae|Yt|En|xr))!==0&&!(K!=null&&K.includes(n))&&Qa();let r=t?Tt(e):e;return Rn(n,r)}function Rn(n,e){if(!n.equals(e)){var t=n.v;lt?Ge.set(n,e):Ge.set(n,t),n.v=e;var r=Nt.ensure();r.capture(n,t),(n.f&ae)!==0&&((n.f&me)!==0&&Tn(n),ce(n,(n.f&se)===0?ee:Ae)),n.wv=Hr(),Lr(n,me),j!==null&&(j.f&ee)!==0&&(j.f&(Me|We))===0&&(le===null?Mi([n]):le.push(n))}return e}function Pn(n){J(n,n.v+1)}function Lr(n,e){var t=n.reactions;if(t!==null)for(var r=t.length,a=0;a<r;a++){var i=t[a],o=i.f,s=(o&me)===0;s&&ce(i,e),(o&ae)!==0?Lr(i,Ae):s&&ot(i)}}function Tt(n){if(typeof n!="object"||n===null||Ht in n)return n;const e=Fa(n);if(e!==Da&&e!==Za)return n;var t=new Map,r=V(n),a=te(0),i=He,o=s=>{if(He===i)return s();var c=O,l=He;Ne(null),Xr(i);var u=s();return Ne(c),Xr(l),u};return r&&t.set("length",te(n.length)),new Proxy(n,{defineProperty(s,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&Ja();var u=t.get(c);return u===void 0?u=o(()=>{var d=te(l.value);return t.set(c,d),d}):J(u,l.value,!0),!0},deleteProperty(s,c){var l=t.get(c);if(l===void 0){if(c in s){const u=o(()=>te(X));t.set(c,u),Pn(a)}}else J(l,X),Pn(a);return!0},get(s,c,l){var f;if(c===Ht)return n;var u=t.get(c),d=c in s;if(u===void 0&&(!d||(f=Mt(s,c))!=null&&f.writable)&&(u=o(()=>{var z=Tt(d?s[c]:X),v=te(z);return v}),t.set(c,u)),u!==void 0){var m=U(u);return m===X?void 0:m}return Reflect.get(s,c,l)},getOwnPropertyDescriptor(s,c){var l=Reflect.getOwnPropertyDescriptor(s,c);if(l&&"value"in l){var u=t.get(c);u&&(l.value=U(u))}else if(l===void 0){var d=t.get(c),m=d==null?void 0:d.v;if(d!==void 0&&m!==X)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return l},has(s,c){var m;if(c===Ht)return!0;var l=t.get(c),u=l!==void 0&&l.v!==X||Reflect.has(s,c);if(l!==void 0||j!==null&&(!u||(m=Mt(s,c))!=null&&m.writable)){l===void 0&&(l=o(()=>{var f=u?Tt(s[c]):X,z=te(f);return z}),t.set(c,l));var d=U(l);if(d===X)return!1}return u},set(s,c,l,u){var b;var d=t.get(c),m=c in s;if(r&&c==="length")for(var f=l;f<d.v;f+=1){var z=t.get(f+"");z!==void 0?J(z,X):f in s&&(z=o(()=>te(X)),t.set(f+"",z))}if(d===void 0)(!m||(b=Mt(s,c))!=null&&b.writable)&&(d=o(()=>te(void 0)),J(d,Tt(l)),t.set(c,d));else{m=d.v!==X;var v=o(()=>Tt(l));J(d,v)}var h=Reflect.getOwnPropertyDescriptor(s,c);if(h!=null&&h.set&&h.set.call(u,l),!m){if(r&&typeof c=="string"){var _=t.get("length"),g=Number(c);Number.isInteger(g)&&g>=_.v&&J(_,g+1)}Pn(a)}return!0},ownKeys(s){U(a);var c=Reflect.ownKeys(s).filter(d=>{var m=t.get(d);return m===void 0||m.v!==X});for(var[l,u]of t)u.v!==X&&!(l in s)&&c.push(l);return c},setPrototypeOf(){Ka()}})}var Or,Rr,Pr,Ir;function hi(){if(Or===void 0){Or=window,Rr=/Firefox/.test(navigator.userAgent);var n=Element.prototype,e=Node.prototype,t=Text.prototype;Pr=Mt(e,"firstChild").get,Ir=Mt(e,"nextSibling").get,yr(n)&&(n.__click=void 0,n.__className=void 0,n.__attributes=null,n.__style=void 0,n.__e=void 0),yr(t)&&(t.__t=void 0)}}function fi(n=""){return document.createTextNode(n)}function jr(n){return Pr.call(n)}function Dr(n){return Ir.call(n)}function In(n,e){return jr(n)}function mi(n,e=1,t=!1){let r=n;for(;e--;)r=Dr(r);return r}function gi(n){j===null&&O===null&&Xa(),O!==null&&(O.f&se)!==0&&j===null&&Ya(),lt&&Ga()}function yi(n,e){var t=e.last;t===null?e.last=e.first=n:(t.next=n,n.prev=t,e.last=n)}function Ye(n,e,t,r=!0){var a=j;a!==null&&(a.f&at)!==0&&(n|=at);var i={ctx:pe,deps:null,nodes_start:null,nodes_end:null,f:n|me,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{Ot(i),i.f|=kn}catch(c){throw Xe(i),c}else e!==null&&ot(i);var o=t&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&Sn)===0;if(!o&&r&&(a!==null&&yi(i,a),O!==null&&(O.f&ae)!==0&&(n&We)===0)){var s=O;(s.effects??(s.effects=[])).push(i)}return i}function we(n){gi();var e=j.f,t=!O&&(e&Me)!==0&&(e&kn)===0;if(t){var r=pe;(r.e??(r.e=[])).push(n)}else return Zr(n)}function Zr(n){return Ye(wn|br,n,!1)}function vi(n){Nt.ensure();const e=Ye(We,n,!0);return(t={})=>new Promise(r=>{t.outro?Si(e,()=>{Xe(e),r(void 0)}):(Xe(e),r(void 0))})}function _i(n){return Ye(wn,n,!1)}function xi(n){return Ye(En|Sn,n,!0)}function Fr(n,e=0){return Ye(vr|e,n,!0)}function Br(n,e=[],t=[]){ci(e,t,r=>{Ye(vr,()=>n(...r.map(U)),!0)})}function bi(n,e=!0){return Ye(Me,n,!0,e)}function Vr(n){var e=n.teardown;if(e!==null){const t=lt,r=O;Gr(!0),Ne(null);try{e.call(null)}finally{Gr(t),Ne(r)}}}function Ur(n,e=!1){var a;var t=n.first;for(n.first=n.last=null;t!==null;){(a=t.ac)==null||a.abort(Mn);var r=t.next;(t.f&We)!==0?t.parent=null:Xe(t,e),t=r}}function wi(n){for(var e=n.first;e!==null;){var t=e.next;(e.f&Me)===0&&Xe(e),e=t}}function Xe(n,e=!0){var t=!1;(e||(n.f&$a)!==0)&&n.nodes_start!==null&&n.nodes_end!==null&&(ki(n.nodes_start,n.nodes_end),t=!0),Ur(n,e&&!t),tn(n,0),ce(n,it);var r=n.transitions;if(r!==null)for(const i of r)i.stop();Vr(n);var a=n.parent;a!==null&&a.first!==null&&$r(n),n.next=n.prev=n.teardown=n.ctx=n.deps=n.fn=n.nodes_start=n.nodes_end=n.ac=null}function ki(n,e){for(;n!==null;){var t=n===e?null:Dr(n);n.remove(),n=t}}function $r(n){var e=n.parent,t=n.prev,r=n.next;t!==null&&(t.next=r),r!==null&&(r.prev=t),e!==null&&(e.first===n&&(e.first=r),e.last===n&&(e.last=t))}function Si(n,e){var t=[];Wr(n,t,!0),zi(t,()=>{Xe(n),e&&e()})}function zi(n,e){var t=n.length;if(t>0){var r=()=>--t||e();for(var a of n)a.out(r)}else e()}function Wr(n,e,t){if((n.f&at)===0){if(n.f^=at,n.transitions!==null)for(const o of n.transitions)(o.is_global||t)&&e.push(o);for(var r=n.first;r!==null;){var a=r.next,i=(r.f&Ua)!==0||(r.f&Me)!==0;Wr(r,e,i?t:!1),r=a}}}let st=!1;function qr(n){st=n}let lt=!1;function Gr(n){lt=n}let O=null,ge=!1;function Ne(n){O=n}let j=null;function ct(n){j=n}let K=null;function Ei(n){O!==null&&(K===null?K=[n]:K.push(n))}let Q=null,ie=0,le=null;function Mi(n){le=n}let Yr=1,Lt=0,He=Lt;function Xr(n){He=n}let Te=!1;function Hr(){return++Yr}function en(n){var d;var e=n.f;if((e&me)!==0)return!0;if((e&Ae)!==0){var t=n.deps,r=(e&se)!==0;if(t!==null){var a,i,o=(e&Xt)!==0,s=r&&j!==null&&!Te,c=t.length;if((o||s)&&(j===null||(j.f&it)===0)){var l=n,u=l.parent;for(a=0;a<c;a++)i=t[a],(o||!((d=i==null?void 0:i.reactions)!=null&&d.includes(l)))&&(i.reactions??(i.reactions=[])).push(l);o&&(l.f^=Xt),s&&u!==null&&(u.f&se)===0&&(l.f^=se)}for(a=0;a<c;a++)if(i=t[a],en(i)&&Er(i),i.wv>n.wv)return!0}(!r||j!==null&&!Te)&&ce(n,ee)}return!1}function Jr(n,e,t=!0){var r=n.reactions;if(r!==null&&!(K!=null&&K.includes(n)))for(var a=0;a<r.length;a++){var i=r[a];(i.f&ae)!==0?Jr(i,e,!1):e===i&&(t?ce(i,me):(i.f&ee)!==0&&ce(i,Ae),ot(i))}}function Kr(n){var z;var e=Q,t=ie,r=le,a=O,i=Te,o=K,s=pe,c=ge,l=He,u=n.f;Q=null,ie=0,le=null,Te=(u&se)!==0&&(ge||!st||O===null),O=(u&(Me|We))===0?n:null,K=null,Jt(n.ctx),ge=!1,He=++Lt,n.ac!==null&&(n.ac.abort(Mn),n.ac=null);try{n.f|=zn;var d=(0,n.fn)(),m=n.deps;if(Q!==null){var f;if(tn(n,ie),m!==null&&ie>0)for(m.length=ie+Q.length,f=0;f<Q.length;f++)m[ie+f]=Q[f];else n.deps=m=Q;if(!Te||(u&ae)!==0&&n.reactions!==null)for(f=ie;f<m.length;f++)((z=m[f]).reactions??(z.reactions=[])).push(n)}else m!==null&&ie<m.length&&(tn(n,ie),m.length=ie);if(kr()&&le!==null&&!ge&&m!==null&&(n.f&(ae|Ae|me))===0)for(f=0;f<le.length;f++)Jr(le[f],n);return a!==null&&a!==n&&(Lt++,le!==null&&(r===null?r=le:r.push(...le))),(n.f&qe)!==0&&(n.f^=qe),d}catch(v){return ni(v)}finally{n.f^=zn,Q=e,ie=t,le=r,O=a,Te=i,K=o,Jt(s),ge=c,He=l}}function Ai(n,e){let t=e.reactions;if(t!==null){var r=Gt.call(t,n);if(r!==-1){var a=t.length-1;a===0?t=e.reactions=null:(t[r]=t[a],t.pop())}}t===null&&(e.f&ae)!==0&&(Q===null||!Q.includes(e))&&(ce(e,Ae),(e.f&(se|Xt))===0&&(e.f^=Xt),zr(e),tn(e,0))}function tn(n,e){var t=n.deps;if(t!==null)for(var r=e;r<t.length;r++)Ai(n,t[r])}function Ot(n){var e=n.f;if((e&it)===0){ce(n,ee);var t=j,r=st;j=n,st=!0;try{(e&Yt)!==0?wi(n):Ur(n),Vr(n);var a=Kr(n);n.teardown=typeof a=="function"?a:null,n.wv=Yr;var i}finally{st=r,j=t}}}function U(n){var e=n.f,t=(e&ae)!==0;if(O!==null&&!ge){var r=j!==null&&(j.f&it)!==0;if(!r&&!(K!=null&&K.includes(n))){var a=O.deps;if((O.f&zn)!==0)n.rv<Lt&&(n.rv=Lt,Q===null&&a!==null&&a[ie]===n?ie++:Q===null?Q=[n]:(!Te||!Q.includes(n))&&Q.push(n));else{(O.deps??(O.deps=[])).push(n);var i=n.reactions;i===null?n.reactions=[O]:i.includes(O)||i.push(O)}}}else if(t&&n.deps===null&&n.effects===null){var o=n,s=o.parent;s!==null&&(s.f&se)===0&&(o.f^=se)}if(lt){if(Ge.has(n))return Ge.get(n);if(t){o=n;var c=o.v;return((o.f&ee)===0&&o.reactions!==null||Qr(o))&&(c=Tn(o)),Ge.set(o,c),c}}else if(t){if(o=n,Ce!=null&&Ce.has(o))return Ce.get(o);en(o)&&Er(o)}if((n.f&qe)!==0)throw n.v;return n.v}function Qr(n){if(n.v===X)return!0;if(n.deps===null)return!1;for(const e of n.deps)if(Ge.has(e)||(e.f&ae)!==0&&Qr(e))return!0;return!1}function Ci(n){var e=ge;try{return ge=!0,n()}finally{ge=e}}const Ni=-7169;function ce(n,e){n.f=n.f&Ni|e}const Ti=["touchstart","touchmove"];function Li(n){return Ti.includes(n)}const Oi=new Set,ea=new Set;function nn(n){var g;var e=this,t=e.ownerDocument,r=n.type,a=((g=n.composedPath)==null?void 0:g.call(n))||[],i=a[0]||n.target,o=0,s=n.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(e===document||e===window)){n.__root=e;return}var l=a.indexOf(e);if(l===-1)return;c<=l&&(o=c)}if(i=a[o]||n.target,i!==e){bn(n,"currentTarget",{configurable:!0,get(){return i||t}});var u=O,d=j;Ne(null),ct(null);try{for(var m,f=[];i!==null;){var z=i.assignedSlot||i.parentNode||i.host||null;try{var v=i["__"+r];if(v!=null&&(!i.disabled||n.target===i))if(V(v)){var[h,..._]=v;h.apply(i,[n,..._])}else v.call(i,n)}catch(b){m?f.push(b):m=b}if(n.cancelBubble||z===e||z===null)break;i=z}if(m){for(let b of f)queueMicrotask(()=>{throw b});throw m}}finally{n.__root=e,delete n.currentTarget,Ne(u),ct(d)}}}function Ri(n){var e=document.createElement("template");return e.innerHTML=n.replaceAll("<!>","<!---->"),e.content}function Pi(n,e){var t=j;t.nodes_start===null&&(t.nodes_start=n,t.nodes_end=e)}function ta(n,e){var t=(e&ei)!==0,r,a=!n.startsWith("<!>");return()=>{r===void 0&&(r=Ri(a?n:"<!>"+n),r=jr(r));var i=t||Rr?document.importNode(r,!0):r.cloneNode(!0);return Pi(i,i),i}}function na(n,e){n!==null&&n.before(e)}function jn(n,e){return Ii(n,e)}const ut=new Map;function Ii(n,{target:e,anchor:t,props:r={},events:a,context:i,intro:o=!0}){hi();var s=new Set,c=d=>{for(var m=0;m<d.length;m++){var f=d[m];if(!s.has(f)){s.add(f);var z=Li(f);e.addEventListener(f,nn,{passive:z});var v=ut.get(f);v===void 0?(document.addEventListener(f,nn,{passive:z}),ut.set(f,1)):ut.set(f,v+1)}}};c(ja(Oi)),ea.add(c);var l=void 0,u=vi(()=>{var d=t??e.appendChild(fi());return bi(()=>{if(i){An({});var m=pe;m.c=i}a&&(r.$$events=a),l=n(d,r)||{},i&&Cn()}),()=>{var z;for(var m of s){e.removeEventListener(m,nn);var f=ut.get(m);--f===0?(document.removeEventListener(m,nn),ut.delete(m)):ut.set(m,f)}ea.delete(c),d!==t&&((z=d.parentNode)==null||z.removeChild(d))}});return ji.set(l,u),l}let ji=new WeakMap;const ra=[...`
2
- \r\f \v\uFEFF`];function Di(n,e,t){var r=n==null?"":""+n;if(t){for(var a in t)if(t[a])r=r?r+" "+a:a;else if(r.length)for(var i=a.length,o=0;(o=r.indexOf(a,o))>=0;){var s=o+i;(o===0||ra.includes(r[o-1]))&&(s===r.length||ra.includes(r[s]))?r=(o===0?"":r.substring(0,o))+r.substring(s+1):o=s}}return r===""?null:r}function aa(n,e=!1){var t=e?" !important;":";",r="";for(var a in n){var i=n[a];i!=null&&i!==""&&(r+=" "+a+": "+i+t)}return r}function Dn(n){return n[0]!=="-"||n[1]!=="-"?n.toLowerCase():n}function Zi(n,e){if(e){var t="",r,a;if(Array.isArray(e)?(r=e[0],a=e[1]):r=e,n){n=String(n).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Dn)),a&&c.push(...Object.keys(a).map(Dn));var l=0,u=-1;const v=n.length;for(var d=0;d<v;d++){var m=n[d];if(s?m==="/"&&n[d-1]==="*"&&(s=!1):i?i===m&&(i=!1):m==="/"&&n[d+1]==="*"?s=!0:m==='"'||m==="'"?i=m:m==="("?o++:m===")"&&o--,!s&&i===!1&&o===0){if(m===":"&&u===-1)u=d;else if(m===";"||d===v-1){if(u!==-1){var f=Dn(n.substring(l,u).trim());if(!c.includes(f)){m!==";"&&d++;var z=n.substring(l,d).trim();t+=" "+z+";"}}l=d+1,u=-1}}}}return r&&(t+=aa(r)),a&&(t+=aa(a,!0)),t=t.trim(),t===""?null:t}return n==null?null:String(n)}function ia(n,e,t,r,a,i){var o=n.__className;if(o!==t||o===void 0){var s=Di(t,r,i);s==null?n.removeAttribute("class"):n.className=s,n.__className=t}else if(i&&a!==i)for(var c in i){var l=!!i[c];(a==null||l!==!!a[c])&&n.classList.toggle(c,l)}return i}function Zn(n,e={},t,r){for(var a in t){var i=t[a];e[a]!==i&&(t[a]==null?n.style.removeProperty(a):n.style.setProperty(a,i,r))}}function rn(n,e,t,r){var a=n.__style;if(a!==e){var i=Zi(e,r);i==null?n.removeAttribute("style"):n.style.cssText=i,n.__style=e}else r&&(Array.isArray(r)?(Zn(n,t==null?void 0:t[0],r[0]),Zn(n,t==null?void 0:t[1],r[1],"important")):Zn(n,t,r));return r}const Fi=()=>performance.now(),ye={tick:n=>requestAnimationFrame(n),now:()=>Fi(),tasks:new Set};function oa(){const n=ye.now();ye.tasks.forEach(e=>{e.c(n)||(ye.tasks.delete(e),e.f())}),ye.tasks.size!==0&&ye.tick(oa)}function Bi(n){let e;return ye.tasks.size===0&&ye.tick(oa),{promise:new Promise(t=>{ye.tasks.add(e={c:n,f:t})}),abort(){ye.tasks.delete(e)}}}function sa(n,e){return n===e||(n==null?void 0:n[Ht])===e}function dt(n={},e,t,r){return _i(()=>{var a,i;return Fr(()=>{a=i,i=[],Ci(()=>{n!==t(...i)&&(e(n,...i),a&&sa(t(...a),n)&&e(null,...a))})}),()=>{ai(()=>{i&&sa(t(...i),n)&&e(null,...i)})}}),n}const Vi="5";typeof window<"u"&&((Ta=window.__svelte??(window.__svelte={})).v??(Ta.v=new Set)).add(Vi);function Ui(n){return n}function Fn(n){return-.5*(Math.cos(Math.PI*n)-1)}function $i(n){const e=Math.cos(n*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Wi(n){return Math.sin(n*Math.PI/2)}const qi=128,Gi=0,Yi=1,Xi=2;class Hi{constructor(){p(this,"animationsStarted",!1);p(this,"animationsCount",0);p(this,"animationsLimit",qi);p(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const r=t.animations;if(r!=null)for(let a=0;a<r.length;a++){const i=r[a];if(i!=null){for(const o of i.values())if(!o.executed&&(o.executed=!0,o.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,r,a){let i=this.layers[e];i==null&&(i=this.layers[e]={animations:new Array});let o=i.animations[t];o==null&&(o=i.animations[t]=new Map);let s={id:r,priority:t,executed:!1,function:a};o.set(r,s),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let r=0;r<this.layers.length;r++){let a=this.layers[r];if(a==null)continue;let i=a.animations[e];if(i==null)return;let o=i.get(t);if(o==null||o.executed==!1)return;i.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const Le=new Hi;function la(n){return Object.prototype.toString.call(n)==="[object Date]"}function Bn(n,e){if(n===e||n!==n)return()=>n;const t=typeof n;if(t!==typeof e||Array.isArray(n)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(n)){const r=e.map((a,i)=>Bn(n[i],a));return a=>r.map(i=>i(a))}if(t==="object"){if(!n||!e)throw new Error("Object cannot be null");if(la(n)&&la(e)){const i=n.getTime(),s=e.getTime()-i;return c=>new Date(i+c*s)}const r=Object.keys(e),a={};return r.forEach(i=>{a[i]=Bn(n[i],e[i])}),i=>{const o={};return r.forEach(s=>{o[s]=a[s](i)}),o}}if(t==="number"){const r=e-n;return a=>n+a*r}return()=>e}const hr=class hr{constructor(e,t={}){Y(this,Se);Y(this,kt);Y(this,$t);Y(this,tt,null);H(this,Se,te(e)),H(this,kt,te(e)),H(this,$t,t)}static of(e,t){const r=new hr(e(),t);return Fr(()=>{r.set(e())}),r}set(e,t){var d;J(C(this,kt),e);let{delay:r=0,duration:a=400,easing:i=Ui,interpolate:o=Bn}={...C(this,$t),...t};if(a===0)return(d=C(this,tt))==null||d.abort(),J(C(this,Se),e),Promise.resolve();const s=ye.now()+r;let c,l=!1,u=C(this,tt);return H(this,tt,Bi(m=>{if(m<s)return!0;if(!l){l=!0;const z=C(this,Se).v;c=o(z,e),typeof a=="function"&&(a=a(z,e)),u==null||u.abort()}const f=m-s;return f>a?(J(C(this,Se),e),!1):(J(C(this,Se),c(i(f/a))),!0)})),C(this,tt).promise}get current(){return U(C(this,Se))}get target(){return U(C(this,kt))}set target(e){this.set(e)}};Se=new WeakMap,kt=new WeakMap,$t=new WeakMap,tt=new WeakMap;let Vn=hr;class an{constructor(e,t){p(this,"value");p(this,"motion");this.value=e,this.motion=new Vn(e,t)}set(e,t){this.value=e,this.motion.set(e,t)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Ji=ta('<div><div class="body svelte-1nfn9j8"></div></div>');function Ki(n,e){An(e,!0);let t,r;function a(){return r}let i=te(!1);function o(g){J(i,g,!0)}function s(){return U(i)}let c=new an(0,{easing:Fn});we(()=>{l(c.motion.current)}),we(()=>{U(i)==!1&&(c.snap(),Le.clear(e.priority,e.id))});function l(g){t&&Le.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=g.toString(),t.style.filter=`brightness(${.25+.75*g})`,r.style.opacity=g.toString()})}function u(g){g!=c.value&&c.set(g,{duration:75})}function d(){return c.motion.current==0}function m(){return c.value}var f=Ji();let z,v;var h=In(f);let _;return dt(h,g=>r=g,()=>r),dt(f,g=>t=g,()=>t),Br((g,b,x)=>{z=ia(f,1,"pin svelte-1nfn9j8",null,z,g),v=rn(f,"",v,b),_=rn(h,"",_,x)},[()=>({displayed:U(i)}),()=>({width:`${e.width}px`,height:`${e.height}px`,"border-radius":`${e.radius}px`}),()=>({width:`${e.width-4}px`,height:`${e.height-4}px`,"border-radius":`${e.radius-2}px`})]),na(n,f),Cn({getBody:a,setDisplayed:o,getDisplayed:s,setScale:u,getCollapsed:d,getScale:m})}var Je;(n=>{function e(t,r,a){const i=t/2,o=r/2,s=Math.sqrt(i*i+o*o),c=Math.atan(o/i)*(180/Math.PI),l=a*(Math.PI/180);return a<180?a<90?a<c?{x:0,y:s*Math.sin(l)-o}:{x:s*Math.cos(l)-i,y:0}:a<180-c?{x:s*Math.cos(l)-i,y:0}:{x:-t,y:s*Math.sin(l)-o}:a<270?a<180+c?{x:-t,y:s*Math.sin(l)-o}:{x:s*Math.cos(l)-i,y:-r}:a<360-c?{x:s*Math.cos(l)-i,y:-r}:{x:0,y:s*Math.sin(l)-o}}n.getOffsets=e})(Je||(Je={}));var Qi=ta('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function ca(n,e){An(e,!0);let t,r,a,i;const o=e.width+2*e.margin,s=e.height+2*e.margin,c=()=>i;we(()=>{a.style.width=`${e.margin*4}px`,a.style.height=`${e.margin*4}px`});let l=te(!0);function u(P){J(l,P,!0)}function d(){return U(l)}let m=te(!0);function f(P){J(m,P,!0)}function z(){return h.motion.current==0}function v(){return h.motion.current==1}let h=new an(0);we(()=>{_(h.motion.current)}),we(()=>{U(l)==!1&&(h.snap(),Le.clear(e.priority,e.id+"_scale"))}),we(()=>{U(m)==!0&&h.value!=0&&(Le.stacked()?h.set(0,{duration:0}):h.set(0,{duration:150,easing:$i})),U(m)==!1&&h.value!=1&&h.set(1,{duration:150,easing:Wi})});function _(P){!t||!r||!a||Le.equeue(U(m)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${P}`,r.style.scale=`${P}`,a.style.scale=`${P}`})}let g=NaN,b=te(!1),x=new an(-o/2,{easing:Fn}),E=new an(-s/2,{easing:Fn});we(()=>{F(x.motion.current,E.motion.current)}),we(()=>{U(l)==!1&&(x.snap(),x.snap(),Le.clear(e.priority,e.id+"_angle"))}),we(()=>{U(m)==!0&&U(b)&&(x.update({duration:75}),x.update({duration:75}))});function F(P,re){if(!t||!r||!a)return;const $e=P+o/2,ze=re+s/2,be=s<o?$e*s/o:$e,Wt=s>o?ze*o/s:ze,fr=Math.atan2(Wt,be)/Math.PI*180-45,mn=0,gn=30,nt=Math.sqrt(be*be+Wt*Wt),Ee=Math.min(o,s)/2,yn=Ee*Math.SQRT2,vn=(nt-Ee)/(yn-Ee),qt=mn+vn*(gn-mn),_n=nt<Ee?nt/Ee:1;Le.equeue(e.layer,e.priority,e.id+"_angle",()=>{r.style.transform=`translate(${Math.round(P)}px, ${Math.round(re)}px)`,a.style.transform=`scale(${_n}) rotate(${fr}deg) skew(${qt}deg, ${qt}deg)`})}function Z(P){if(U(b)==!1){let re=Je.getOffsets(o,s,P);x.set(Math.round(re.x),{duration:0}),E.set(Math.round(re.y),{duration:0}),F(x.value,E.value),g=P,J(b,!0)}else if(P!=g){let re=Math.abs(P-g),$e=re<180?re:360-re,ze=Math.log($e)*75,be=Je.getOffsets(o,s,P);x.set(Math.round(be.x),{duration:ze}),E.set(Math.round(be.y),{duration:ze}),g=P}}function Et(){return Je.getOffsets(o,s,g)}var Ve=Qi();let Ue;var _e=In(Ve);dt(_e,P=>a=P,()=>a);var de=mi(_e,2),xe=In(de);return dt(xe,P=>i=P,()=>i),dt(de,P=>r=P,()=>r),dt(Ve,P=>t=P,()=>t),Br(P=>{Ue=ia(Ve,1,"anchor svelte-j5igi2",null,Ue,P),rn(de,`margin: ${e.margin}px;`),rn(xe,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)},[()=>({displayed:U(l)})]),na(n,Ve),Cn({getBody:c,setDisplayed:u,getDisplayed:d,setCollapsed:f,getCollapsed:z,getExpanded:v,setAngle:Z,getOffsets:Et})}var Oe;(n=>{function e(s,c,l){return{x:r(c)*l,y:a(s)*l}}n.project=e;function t(s,c,l){return{lat:o(c/l),lng:i(s/l)}}n.unproject=t;function r(s){return(180+s)/360}function a(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function i(s){return s*360-180}function o(s){return 360/Math.PI*Math.atan(Math.exp((180-s*360)*Math.PI/180))-90}})(Oe||(Oe={}));class ua{constructor(e,t,r,a,i){p(this,"swLat");p(this,"swLng");p(this,"neLat");p(this,"neLng");const o=r*Math.pow(2,t),s=Oe.project(e.sw.lat,e.sw.lng,o),c=Oe.project(e.ne.lat,e.ne.lng,o),l=s.x-a,u=s.y+i,d=c.x+a,m=c.y-i,f=Oe.unproject(l,u,o),z=Oe.unproject(d,m,o);this.swLat=f.lat,this.swLng=f.lng,this.neLat=z.lat,this.neLng=z.lng}contains(e,t){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1}}var $;(n=>{n.COUNT=12,n.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],n.DEGREES_DEFAULT=270})($||($={}));var on;(n=>{const e=$.DEGREES.map(l=>l*Math.PI/180),t=e.map(l=>Math.cos(l)),r=e.map(l=>Math.sin(l));function a(l,u){const d=Math.abs(u/l);return d<1?d<.26795?0:1:d<3.73205?2:3}function i(l,u){const d=a(l,u);return l>0?u>0?(12-d)%12:0+d:u>0?6+d:6-d}function o(l,u){return u==0?l:((l+u)%$.COUNT+$.COUNT)%$.COUNT}function s(l){let u=!0;for(let d=0;d<l.length;d++){const m=l[d],f=m.particle,z=m.x,v=m.y,h=f.distX,_=f.distY,g=f.index,b=o(g,-1),x=o(g,1),E=z+h*t[b],F=v+_*r[b],Z=z+h*t[g],Et=v+_*r[g],Ve=z+h*t[x],Ue=v+_*r[x];let _e=0,de=0,xe=0;const P=m.neighbours;for(let $e=0;$e<P.length;$e++){const ze=P[$e],be=ze.particle,Wt=ze.x,La=ze.y,fr=be.distX,mn=be.distY,gn=be.index,nt=Wt+fr*t[gn],Ee=La+mn*r[gn],yn=E-nt,vn=F-Ee;_e+=1/(yn*yn+vn*vn);const qt=Z-nt,_n=Et-Ee;de+=1/(qt*qt+_n*_n);const Oa=Ve-nt,Ra=Ue-Ee;xe+=1/(Oa*Oa+Ra*Ra)}let re=0;_e<de&&_e<xe&&(re=-1),xe<de&&xe<_e&&(re=1),re!=0&&(f.index=o(g,re),u=!1)}return u}n.updateAngleIndexes=s;function c(l){for(let u=0;u<l.length;u++){const d=l[u],m=d.x,f=d.y;let z=0,v=0;for(let h=0;h<l.length;h++){const _=l[h],g=_.x,b=_.y,x=m-g,E=f-b;if(x==0&&E==0)continue;const F=Math.sqrt(x*x+E*E),Z=1/(F*F);z+=Z*x/F,v+=-(Z*E)/F}d.particle.index=i(z,v)}}n.initializeAngleIndexes=c})(on||(on={}));var Re;(n=>{function e(r,a){return!(r.x-r.distances.left>a.x+a.distances.right||r.x+r.distances.right<a.x-a.distances.left||r.y-r.distances.top>a.y+a.distances.bottom||r.y+r.distances.bottom<a.y-a.distances.top)}n.areOverlaping=e;function t(r,a){let i=Math.abs(r.x-a.x),s=(r.x<a.x?r.distances.right+a.distances.left:r.distances.left+a.distances.right)/i,c=Math.abs(r.y-a.y),u=(r.y<a.y?r.distances.bottom+a.distances.top:r.distances.top+a.distances.bottom)/c,d=Math.min(s,u);return Math.log2(d)}n.getZoomWhenTouching=t})(Re||(Re={}));var I;(function(n){n.assertEqual=a=>{};function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},n.getValidEnumValues=a=>{const i=n.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return n.objectValues(o)},n.objectValues=a=>n.objectKeys(a).map(function(i){return a[i]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},n.find=(a,i)=>{for(const o of a)if(i(o))return o},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}n.joinValues=r,n.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(I||(I={}));var da;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(da||(da={}));const k=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pe=n=>{switch(typeof n){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(n)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(n)?k.array:n===null?k.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?k.promise:typeof Map<"u"&&n instanceof Map?k.map:typeof Set<"u"&&n instanceof Set?k.set:typeof Date<"u"&&n instanceof Date?k.date:k.object;default:return k.unknown}},y=I.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ue extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let s=r,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return a(this),r}static assert(e){if(!(e instanceof ue))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ue.create=n=>new ue(n);const Rt=(n,e)=>{let t;switch(n.code){case y.invalid_type:n.received===k.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case y.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,I.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:t=`Unrecognized key(s) in object: ${I.joinValues(n.keys,", ")}`;break;case y.invalid_union:t="Invalid input";break;case y.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${I.joinValues(n.options)}`;break;case y.invalid_enum_value:t=`Invalid enum value. Expected ${I.joinValues(n.options)}, received '${n.received}'`;break;case y.invalid_arguments:t="Invalid function arguments";break;case y.invalid_return_type:t="Invalid function return type";break;case y.invalid_date:t="Invalid date";break;case y.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:I.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case y.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case y.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case y.custom:t="Invalid input";break;case y.invalid_intersection_types:t="Intersection results could not be merged";break;case y.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case y.not_finite:t="Number must be finite";break;default:t=e.defaultError,I.assertNever(n)}return{message:t}};let eo=Rt;function Un(){return eo}const $n=n=>{const{data:e,path:t,errorMaps:r,issueData:a}=n,i=[...t,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)s=l(o,{data:e,defaultError:s}).message;return{...a,path:i,message:s}};function w(n,e){const t=Un(),r=$n({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Rt?void 0:Rt].filter(a=>!!a)});n.common.issues.push(r)}class oe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return M;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return oe.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return M;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const M=Object.freeze({status:"aborted"}),Pt=n=>({status:"dirty",value:n}),ne=n=>({status:"valid",value:n}),pa=n=>n.status==="aborted",ha=n=>n.status==="dirty",pt=n=>n.status==="valid",sn=n=>typeof Promise<"u"&&n instanceof Promise;var S;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(S||(S={}));class Ie{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const fa=(n,e)=>{if(pt(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ue(n.common.issues);return this._error=t,this._error}}};function T(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,s)=>{const{message:c}=n;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??r??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??t??s.defaultError}},description:a}}class R{get description(){return this._def.description}_getType(e){return Pe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new oe,ctx:{common:e.parent.common,data:e.data,parsedType:Pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(sn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pe(e)},a=this._parseSync({data:e,path:r.path,parent:r});return fa(r,a)}"~validate"(e){var r,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pe(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return pt(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>pt(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pe(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(sn(a)?a:Promise.resolve(a));return fa(r,i)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{const o=e(a),s=()=>i.addIssue({code:y.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new yt({schema:this,typeName:A.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Ze.create(this,this._def)}nullable(){return vt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ve.create(this)}promise(){return Zt.create(this,this._def)}or(e){return cn.create([this,e],this._def)}and(e){return un.create(this,e,this._def)}transform(e){return new yt({...T(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Hn({...T(this._def),innerType:this,defaultValue:t,typeName:A.ZodDefault})}brand(){return new So({typeName:A.ZodBranded,type:this,...T(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Jn({...T(this._def),innerType:this,catchValue:t,typeName:A.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Kn.create(this,e)}readonly(){return Qn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const to=/^c[^\s-]{8,}$/i,no=/^[0-9a-z]+$/,ro=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ao=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,io=/^[a-z0-9_-]{21}$/i,oo=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,so=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lo=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,co="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wn;const uo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,po=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ho=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mo=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,go=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ma="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",yo=new RegExp(`^${ma}$`);function ga(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function vo(n){return new RegExp(`^${ga(n)}$`)}function _o(n){let e=`${ma}T${ga(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function xo(n,e){return!!((e==="v4"||!e)&&uo.test(n)||(e==="v6"||!e)&&ho.test(n))}function bo(n,e){if(!oo.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function wo(n,e){return!!((e==="v4"||!e)&&po.test(n)||(e==="v6"||!e)&&fo.test(n))}class je extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const i=this._getOrReturnCtx(e);return w(i,{code:y.invalid_type,expected:k.string,received:i.parsedType}),M}const r=new oe;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(a=this._getOrReturnCtx(e,a),o?w(a,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&w(a,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")lo.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"email",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Wn||(Wn=new RegExp(co,"u")),Wn.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"emoji",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")ao.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"uuid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")io.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"nanoid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")to.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"cuid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")no.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"cuid2",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")ro.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"ulid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),w(a,{validation:"url",code:y.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"regex",code:y.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),w(a,{code:y.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),w(a,{code:y.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),w(a,{code:y.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?_o(i).test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{code:y.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?yo.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{code:y.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?vo(i).test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{code:y.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?so.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"duration",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?xo(e.data,i.version)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"ip",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?bo(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"jwt",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?wo(e.data,i.version)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"cidr",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?mo.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"base64",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?go.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"base64url",code:y.invalid_string,message:i.message}),r.dirty()):I.assertNever(i);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:y.invalid_string,...S.errToObj(r)})}_addCheck(e){return new je({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...S.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...S.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...S.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...S.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...S.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new je({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new je({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new je({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}je.create=n=>new je({checks:[],typeName:A.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...T(n)});function ko(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,i=Number.parseInt(n.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class ht extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){const i=this._getOrReturnCtx(e);return w(i,{code:y.invalid_type,expected:k.number,received:i.parsedType}),M}let r;const a=new oe;for(const i of this._def.checks)i.kind==="int"?I.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:y.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:y.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:y.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?ko(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),w(r,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:y.not_finite,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,r,a){return new ht({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:S.toString(a)}]})}_addCheck(e){return new ht({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&I.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ht.create=n=>new ht({checks:[],typeName:A.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...T(n)});class It extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let r;const a=new oe;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:y.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:y.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),w(r,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return w(t,{code:y.invalid_type,expected:k.bigint,received:t.parsedType}),M}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,r,a){return new It({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:S.toString(a)}]})}_addCheck(e){return new It({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}It.create=n=>new It({checks:[],typeName:A.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...T(n)});class qn extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:k.boolean,received:r.parsedType}),M}return ne(e.data)}}qn.create=n=>new qn({typeName:A.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...T(n)});class ln extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const i=this._getOrReturnCtx(e);return w(i,{code:y.invalid_type,expected:k.date,received:i.parsedType}),M}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return w(i,{code:y.invalid_date}),M}const r=new oe;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:y.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:y.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):I.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ln({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}ln.create=n=>new ln({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:A.ZodDate,...T(n)});class ya extends R{_parse(e){if(this._getType(e)!==k.symbol){const r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:k.symbol,received:r.parsedType}),M}return ne(e.data)}}ya.create=n=>new ya({typeName:A.ZodSymbol,...T(n)});class va extends R{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:k.undefined,received:r.parsedType}),M}return ne(e.data)}}va.create=n=>new va({typeName:A.ZodUndefined,...T(n)});class _a extends R{_parse(e){if(this._getType(e)!==k.null){const r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:k.null,received:r.parsedType}),M}return ne(e.data)}}_a.create=n=>new _a({typeName:A.ZodNull,...T(n)});class Gn extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return ne(e.data)}}Gn.create=n=>new Gn({typeName:A.ZodAny,...T(n)});class ft extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ne(e.data)}}ft.create=n=>new ft({typeName:A.ZodUnknown,...T(n)});class De extends R{_parse(e){const t=this._getOrReturnCtx(e);return w(t,{code:y.invalid_type,expected:k.never,received:t.parsedType}),M}}De.create=n=>new De({typeName:A.ZodNever,...T(n)});class Yn extends R{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:k.void,received:r.parsedType}),M}return ne(e.data)}}Yn.create=n=>new Yn({typeName:A.ZodVoid,...T(n)});class ve extends R{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==k.array)return w(t,{code:y.invalid_type,expected:k.array,received:t.parsedType}),M;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(o||s)&&(w(t,{code:o?y.too_big:y.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(w(t,{code:y.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(w(t,{code:y.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,s)=>a.type._parseAsync(new Ie(t,o,t.path,s)))).then(o=>oe.mergeArray(r,o));const i=[...t.data].map((o,s)=>a.type._parseSync(new Ie(t,o,t.path,s)));return oe.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new ve({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new ve({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new ve({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}ve.create=(n,e)=>new ve({type:n,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,...T(e)});function mt(n){if(n instanceof W){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Ze.create(mt(r))}return new W({...n._def,shape:()=>e})}else return n instanceof ve?new ve({...n._def,type:mt(n.element)}):n instanceof Ze?Ze.create(mt(n.unwrap())):n instanceof vt?vt.create(mt(n.unwrap())):n instanceof ke?ke.create(n.items.map(e=>mt(e))):n}class W extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=I.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==k.object){const l=this._getOrReturnCtx(e);return w(l,{code:y.invalid_type,expected:k.object,received:l.parsedType}),M}const{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof De&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||s.push(l);const c=[];for(const l of o){const u=i[l],d=a.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ie(a,d,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof De){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(l==="strict")s.length>0&&(w(a,{code:y.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of s){const d=a.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ie(a,d,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key,m=await u.value;l.push({key:d,value:m,alwaysSet:u.alwaysSet})}return l}).then(l=>oe.mergeObjectSync(r,l)):oe.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new W({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:S.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new W({...this._def,unknownKeys:"strip"})}passthrough(){return new W({...this._def,unknownKeys:"passthrough"})}extend(e){return new W({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new W({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:A.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new W({...this._def,catchall:e})}pick(e){const t={};for(const r of I.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new W({...this._def,shape:()=>t})}omit(e){const t={};for(const r of I.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new W({...this._def,shape:()=>t})}deepPartial(){return mt(this)}partial(e){const t={};for(const r of I.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new W({...this._def,shape:()=>t})}required(e){const t={};for(const r of I.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ze;)i=i._def.innerType;t[r]=i}return new W({...this._def,shape:()=>t})}keyof(){return ka(I.objectKeys(this.shape))}}W.create=(n,e)=>new W({shape:()=>n,unknownKeys:"strip",catchall:De.create(),typeName:A.ZodObject,...T(e)}),W.strictCreate=(n,e)=>new W({shape:()=>n,unknownKeys:"strict",catchall:De.create(),typeName:A.ZodObject,...T(e)}),W.lazycreate=(n,e)=>new W({shape:n,unknownKeys:"strip",catchall:De.create(),typeName:A.ZodObject,...T(e)});class cn extends R{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new ue(s.ctx.common.issues));return w(t,{code:y.invalid_union,unionErrors:o}),M}if(t.common.async)return Promise.all(r.map(async i=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of r){const l={...t,common:{...t.common,issues:[]},parent:null},u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new ue(c));return w(t,{code:y.invalid_union,unionErrors:s}),M}}get options(){return this._def.options}}cn.create=(n,e)=>new cn({options:n,typeName:A.ZodUnion,...T(e)});function Xn(n,e){const t=Pe(n),r=Pe(e);if(n===e)return{valid:!0,data:n};if(t===k.object&&r===k.object){const a=I.objectKeys(e),i=I.objectKeys(n).filter(s=>a.indexOf(s)!==-1),o={...n,...e};for(const s of i){const c=Xn(n[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(t===k.array&&r===k.array){if(n.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<n.length;i++){const o=n[i],s=e[i],c=Xn(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return t===k.date&&r===k.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class un extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(i,o)=>{if(pa(i)||pa(o))return M;const s=Xn(i.value,o.value);return s.valid?((ha(i)||ha(o))&&t.dirty(),{status:t.value,value:s.data}):(w(r,{code:y.invalid_intersection_types}),M)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}un.create=(n,e,t)=>new un({left:n,right:e,typeName:A.ZodIntersection,...T(t)});class ke extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.array)return w(r,{code:y.invalid_type,expected:k.array,received:r.parsedType}),M;if(r.data.length<this._def.items.length)return w(r,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),M;!this._def.rest&&r.data.length>this._def.items.length&&(w(r,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...r.data].map((o,s)=>{const c=this._def.items[s]||this._def.rest;return c?c._parse(new Ie(r,o,r.path,s)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>oe.mergeArray(t,o)):oe.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new ke({...this._def,rest:e})}}ke.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ke({items:n,typeName:A.ZodTuple,rest:null,...T(e)})};class xa extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.map)return w(r,{code:y.invalid_type,expected:k.map,received:r.parsedType}),M;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([s,c],l)=>({key:a._parse(new Ie(r,s,r.path,[l,"key"])),value:i._parse(new Ie(r,c,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return M;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(l.value,u.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return M;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(l.value,u.value)}return{status:t.value,value:s}}}}xa.create=(n,e,t)=>new xa({valueType:e,keyType:n,typeName:A.ZodMap,...T(t)});class jt extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.set)return w(r,{code:y.invalid_type,expected:k.set,received:r.parsedType}),M;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(w(r,{code:y.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(w(r,{code:y.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const i=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return M;u.status==="dirty"&&t.dirty(),l.add(u.value)}return{status:t.value,value:l}}const s=[...r.data.values()].map((c,l)=>i._parse(new Ie(r,c,r.path,l)));return r.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,t){return new jt({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new jt({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}jt.create=(n,e)=>new jt({valueType:n,minSize:null,maxSize:null,typeName:A.ZodSet,...T(e)});class Dt extends R{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.function)return w(t,{code:y.invalid_type,expected:k.function,received:t.parsedType}),M;function r(s,c){return $n({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Un(),Rt].filter(l=>!!l),issueData:{code:y.invalid_arguments,argumentsError:c}})}function a(s,c){return $n({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Un(),Rt].filter(l=>!!l),issueData:{code:y.invalid_return_type,returnTypeError:c}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Zt){const s=this;return ne(async function(...c){const l=new ue([]),u=await s._def.args.parseAsync(c,i).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,i).catch(f=>{throw l.addIssue(a(d,f)),l})})}else{const s=this;return ne(function(...c){const l=s._def.args.safeParse(c,i);if(!l.success)throw new ue([r(c,l.error)]);const u=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(u,i);if(!d.success)throw new ue([a(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Dt({...this._def,args:ke.create(e).rest(ft.create())})}returns(e){return new Dt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Dt({args:e||ke.create([]).rest(ft.create()),returns:t||ft.create(),typeName:A.ZodFunction,...T(r)})}}class ba extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ba.create=(n,e)=>new ba({getter:n,typeName:A.ZodLazy,...T(e)});class wa extends R{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return w(t,{received:t.data,code:y.invalid_literal,expected:this._def.value}),M}return{status:"valid",value:e.data}}get value(){return this._def.value}}wa.create=(n,e)=>new wa({value:n,typeName:A.ZodLiteral,...T(e)});function ka(n,e){return new gt({values:n,typeName:A.ZodEnum,...T(e)})}class gt extends R{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return w(t,{expected:I.joinValues(r),received:t.parsedType,code:y.invalid_type}),M}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return w(t,{received:t.data,code:y.invalid_enum_value,options:r}),M}return ne(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return gt.create(e,{...this._def,...t})}exclude(e,t=this._def){return gt.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}gt.create=ka;class Sa extends R{_parse(e){const t=I.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==k.string&&r.parsedType!==k.number){const a=I.objectValues(t);return w(r,{expected:I.joinValues(a),received:r.parsedType,code:y.invalid_type}),M}if(this._cache||(this._cache=new Set(I.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=I.objectValues(t);return w(r,{received:r.data,code:y.invalid_enum_value,options:a}),M}return ne(e.data)}get enum(){return this._def.values}}Sa.create=(n,e)=>new Sa({values:n,typeName:A.ZodNativeEnum,...T(e)});class Zt extends R{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.promise&&t.common.async===!1)return w(t,{code:y.invalid_type,expected:k.promise,received:t.parsedType}),M;const r=t.parsedType===k.promise?t.data:Promise.resolve(t.data);return ne(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Zt.create=(n,e)=>new Zt({type:n,typeName:A.ZodPromise,...T(e)});class yt extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{w(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async s=>{if(t.value==="aborted")return M;const c=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return c.status==="aborted"?M:c.status==="dirty"||t.value==="dirty"?Pt(c.value):c});{if(t.value==="aborted")return M;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?M:s.status==="dirty"||t.value==="dirty"?Pt(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?M:(s.status==="dirty"&&t.dirty(),o(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?M:(s.status==="dirty"&&t.dirty(),o(s.value).then(()=>({status:t.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!pt(o))return M;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>pt(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:t.value,value:s})):M);I.assertNever(a)}}yt.create=(n,e,t)=>new yt({schema:n,typeName:A.ZodEffects,effect:e,...T(t)}),yt.createWithPreprocess=(n,e,t)=>new yt({schema:e,effect:{type:"preprocess",transform:n},typeName:A.ZodEffects,...T(t)});class Ze extends R{_parse(e){return this._getType(e)===k.undefined?ne(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(n,e)=>new Ze({innerType:n,typeName:A.ZodOptional,...T(e)});class vt extends R{_parse(e){return this._getType(e)===k.null?ne(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vt.create=(n,e)=>new vt({innerType:n,typeName:A.ZodNullable,...T(e)});class Hn extends R{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===k.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Hn.create=(n,e)=>new Hn({innerType:n,typeName:A.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...T(e)});class Jn extends R{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sn(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ue(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ue(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Jn.create=(n,e)=>new Jn({innerType:n,typeName:A.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...T(e)});class za extends R{_parse(e){if(this._getType(e)!==k.nan){const r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:k.nan,received:r.parsedType}),M}return{status:"valid",value:e.data}}}za.create=n=>new za({typeName:A.ZodNaN,...T(n)});class So extends R{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Kn extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?M:i.status==="dirty"?(t.dirty(),Pt(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?M:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new Kn({in:e,out:t,typeName:A.ZodPipeline})}}class Qn extends R{_parse(e){const t=this._def.innerType._parse(e),r=a=>(pt(a)&&(a.value=Object.freeze(a.value)),a);return sn(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}Qn.create=(n,e)=>new Qn({innerType:n,typeName:A.ZodReadonly,...T(e)});var A;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(A||(A={}));const Ke=je.create,L=ht.create,er=qn.create,tr=Gn.create;ft.create,De.create;const dn=Yn.create,nr=ve.create,B=W.create;cn.create,un.create;const Ea=ke.create,he=Dt.create,zo=gt.create,Eo=Zt.create;Ze.create,vt.create,B({pin:B({fade:er().optional(),maxCount:L().optional(),maxZoom:L().optional()}).optional(),animation:B({queue:B({limit:L().optional()}).optional()}).optional(),api:B({states:B({url:Ke().optional(),key:Ke()}).optional(),log:B({enabled:er()}).optional()}).optional()});const rr=L().min(-90).max(90),ar=L().min(-180).max(180),Mo=B({sw:B({lat:rr,lng:ar}),ne:B({lat:rr,lng:ar})}),ir=tr().refine(n=>n instanceof HTMLElement,"Must be an HTMLElement"),or=B({mapSize:L().min(1),zoomMin:L().min(0),zoomMax:L().min(0),zoomScale:L().min(1).max(10)}),Ao=B({instance:tr(),inserted:he().returns(er()),insert:he().returns(dn()),remove:he().returns(dn()),update:he().args(L()).returns(dn())}),Co=B({getParameters:he().args().returns(or),getContainer:he().args().returns(ir),getZoom:he().args().returns(L()),getBounds:he().args().returns(Mo),panBy:he().args(L(),L()).returns(dn()),createMarker:he().args(ir,rr,ar,L()).returns(Ao)}),sr=he().args(Ke()).returns(Eo(ir)),No=B({id:Ke().min(1),rank:L(),lat:L().min(-90).max(90),lng:L().min(-180).max(180),tooltip:B({style:B({width:L(),height:L(),margin:L(),radius:L()}).refine(n=>Math.min(n.width,n.height)/n.margin>=5,"Tooltip width and height must be at least 5 times the margin"),body:sr}),pin:B({style:B({width:L(),height:L(),radius:L()}),body:sr}).optional(),popup:B({style:B({width:L(),height:L(),radius:L(),margin:L()}),body:sr}).optional()}),To=nr(No);Ea([L(),nr(Ea([L(),L()]))]);const Lo=or,Oo=B({id:Ke(),rank:L(),lat:L(),lng:L(),width:L(),height:L(),margin:L()});B({key:Ke(),parameters:or,input:nr(Oo)});const Ro=zo(["info","warn","error"]);B({title:Ke(),level:Ro,content:tr()});var G;(n=>{class e{constructor(){p(this,"zoomAfterExpanded");p(this,"zoomAfterAngleIndexes");this.zoomAfterExpanded=NaN,this.zoomAfterAngleIndexes=[]}}n.State=e;class t{constructor(h){p(this,"min");p(this,"max");p(this,"scale");p(this,"step");Lo.parse(h),this.min=h.zoomMin,this.max=h.zoomMax,this.scale=Math.round(h.zoomScale),this.step=1/this.scale}addSteps(h,_){return Math.round((h+_*this.step)*this.scale)/this.scale}getLevel(h){if(!(h<this.min))return h>this.max?this.max*this.scale:Math.floor(h*this.scale)}}n.Zoom=t;class r{constructor(h,_,g){p(this,"id","");p(this,"index",NaN);p(this,"rank",NaN);p(this,"x",NaN);p(this,"y",NaN);p(this,"width",NaN);p(this,"height",NaN);p(this,"expanded",!0);p(this,"scale",1);p(this,"angle",$.DEGREES_DEFAULT);p(this,"neighbours",new Array);p(this,"distances",{left:NaN,right:NaN,top:NaN,bottom:NaN});p(this,"particle",{index:$.DEGREES.indexOf($.DEGREES_DEFAULT),distX:NaN,distY:NaN});const b=Oe.project(_.lat,_.lng,h.mapSize);this.index=g,this.id=_.id,this.rank=_.rank,this.x=b.x,this.y=b.y,this.width=_.width+2*_.margin,this.height=_.height+2*_.margin}updateScale(h){h!=this.scale&&(this.scale=h,this.updateBounds(h,this.angle),this.updateParticle(h))}updateAngle(h){h!=this.angle&&(this.angle=h,this.updateBounds(this.scale,h))}updateBounds(h,_){const g=Je.getOffsets(this.width,this.height,_),b=-g.x,x=this.width-b,E=-g.y,F=this.height-E,Z=this.distances;Z.left=b/h,Z.right=x/h,Z.top=E/h,Z.bottom=F/h}updateParticle(h){this.particle.distX=this.width/2/h,this.particle.distY=this.height/2/h}}n.Tooltip=r;function a(v,h){let _=new Array(h.length);for(let g=0;g<h.length;g++)_[g]=new r(v,h[g],g);return _}n.createTooltips=a;function i(v,h){let _=new Array,g=0;for(let x=h.min*h.scale;x<=h.max*h.scale;x++)_[x]=new Array(v.length);const b=new Array(v.length);for(let x=0;x<v.length;x++){const E=v[x];b[x]={x:E.x,y:E.y,distances:{left:E.width,right:E.width,top:E.height,bottom:E.height}}}for(let x=0;x<v.length;x++){const E=v[x],F=b[x];for(let Z=x+1;Z<v.length;Z++){const Et=v[Z],Ve=b[Z],Ue=Re.getZoomWhenTouching(F,Ve);Ue>g&&(g=Ue);const _e=h.getLevel(Ue);if(_e==null)continue;const de=_[_e],xe=de[x];xe?xe.push(Et):de[x]=[Et];const P=de[Z];P?P.push(E):de[Z]=[E]}}return{zoomMax:g,zoomLevelDeltas:_}}n.createNeighbours=i;function o(v,h){for(let _=0;_<v.length;_++){let g=v[_];if(g.expanded==!1){g.neighbours.length=0;continue}const b=h[_];if(b!=null)for(let x=0;x<b.length;x++){const E=b[x];E.expanded!=!1&&g.neighbours.push(E)}}}n.updateNeighbours=o;function s(v){const h=new Set,_=[];for(let g=0;g<v.length;g++){let b=v[g];if(b.expanded==!1||b.neighbours.length==0||h.has(b))continue;h.add(b);const x=[],E=[b];for(;E.length>0;){const F=E.pop();x.push(F);for(const Z of F.neighbours)h.has(Z)||(h.add(Z),E.push(Z))}_.push(x)}return _}n.getNeighbourGraphs=s;function c(v){v.expanded=!1;const h=v.neighbours;for(let _=0;_<h.length;_++){const g=h[_],b=g.neighbours.indexOf(v);g.neighbours.splice(b,1)}}n.updateCollapsed=c;function l(v,h,_){for(let g=0;g<h.length;g++){const b=h[g];if(b.expanded==!1)continue;const x=v.get(b.id);if(!x)throw new Error("Tooltip not found");x.zoomAfterExpanded=_;const E=$.DEGREES.indexOf(b.angle);x.zoomAfterAngleIndexes.length==0?x.zoomAfterAngleIndexes.push([_,E]):x.zoomAfterAngleIndexes[0][1]!=E?x.zoomAfterAngleIndexes.unshift([_,E]):x.zoomAfterAngleIndexes[0][0]=_}}n.updateStates=l;function u(v,h){for(let _=0;_<v.length;_++)v[_].updateScale(h)}n.updateScale=u;function d(v){const h=new Set;for(let _=0;_<v.length;_++){const g=v[_],b=v[_].neighbours;for(let x=0;x<b.length;x++){const E=b[x];Re.areOverlaping(g,E)&&(h.add(g),h.add(E))}}return h}n.getOverlaps=d;function m(v,h){let _=!1;for(let g=0;g<h.length;g++){const b=h[g],x=h[g].neighbours;for(let E=0;E<x.length;E++){const F=x[E];Re.areOverlaping(b,F)&&(v.has(b)||(v.add(b),_=!0),v.has(F)||(v.add(F),_=!0))}}return _}n.updateOverlaps=m;function f(v){let h,_=0;for(let g=0;g<v.length;g++){const b=v[g],x=v[g].neighbours;let E=0;for(let F=0;F<x.length;F++){const Z=x[F];Re.areOverlaping(b,Z)&&(E+=1+(Z.rank-b.rank))}E=E*x.length,E>_&&(_=E,h=b)}return h}n.getOverlapsWorstTooltip=f;function z(v){for(let h=0;h<v.length;h++){const _=v[h];for(let g=h+1;g<v.length;g++){const b=v[g];if(Re.areOverlaping(_,b))return!0}}return!1}n.areOverlaping=z,(v=>{function h(b){on.initializeAngleIndexes(b),g(b)}v.initializeAngles=h;function _(b){const x=on.updateAngleIndexes(b);return g(b),x}v.updateAngles=_;function g(b){for(let x=0;x<b.length;x++){const E=b[x];E.updateAngle($.DEGREES[E.particle.index])}}v.updateTooltips=g})(n.Particles||(n.Particles={}))})(G||(G={}));function Ma(n,e){const t=new G.Zoom(n);if(e.length==0)return[];if(e.length==1)return[[t.min,[[t.min,$.DEGREES.indexOf($.DEGREES_DEFAULT)]]]];const r=new Map(e.map(l=>[l.id,new G.State])),a=G.createTooltips(n,e),i=G.createNeighbours(a,t);G.Particles.initializeAngles(a),G.updateStates(r,a,t.addSteps(t.max,1));const o=t.getLevel(i.zoomMax);if(o==null)return Array.from(r.values()).map(l=>[l.zoomAfterExpanded,l.zoomAfterAngleIndexes]);const s=t.min,c=o/t.scale;for(let l=c;l>=s;l=t.addSteps(l,-1)){const u=Math.pow(2,l),d=l*t.scale;G.updateNeighbours(a,i.zoomLevelDeltas[d]);const m=G.getNeighbourGraphs(a);for(const f of m){G.updateScale(f,u);const z=G.getOverlaps(f);for(;z.size>1;){const v=Array.from(z);for(let g=0;g<$.COUNT&&!(G.Particles.updateAngles(v)==!0||G.areOverlaping(v)==!1);g++);if(G.updateOverlaps(z,v))continue;const _=G.getOverlapsWorstTooltip(v);if(_==null)break;G.updateCollapsed(_),z.delete(_)}}G.updateStates(r,a,Number(l.toFixed(1)))}return Array.from(r.values()).map(l=>[l.zoomAfterExpanded,l.zoomAfterAngleIndexes])}const Aa="https://maps.api.arenarium.dev",Po=`${Aa}/log`,Io=`${Aa}/tooltip/states`,Ca="1.0.191";class jo{constructor(e,t){p(this,"provider");p(this,"apiStatesUrl");p(this,"apiStatesKey");p(this,"apiLogEnabled");p(this,"markerDataArray",new Array);p(this,"markerDataMap",new Map);p(this,"markerDataUpdating",!1);p(this,"markerPinProcessor");p(this,"markerTooltipProcessor");p(this,"markerPopupProcessor");Co.parse(e),this.provider=e,this.markerPinProcessor=new ur(e),this.markerTooltipProcessor=new Do(e),this.markerPopupProcessor=new Zo(e),this.configuration=t,this.log("info","Loaded")}set configuration(e){var t,r,a,i,o,s,c,l;this.apiStatesUrl=(r=(t=e==null?void 0:e.api)==null?void 0:t.states)==null?void 0:r.url,this.apiStatesKey=(i=(a=e==null?void 0:e.api)==null?void 0:a.states)==null?void 0:i.key,this.apiLogEnabled=(s=(o=e==null?void 0:e.api)==null?void 0:o.log)==null?void 0:s.enabled,this.markerPinProcessor.setConfiguration(e),Le.setLimit(((l=(c=e==null?void 0:e.animation)==null?void 0:c.queue)==null?void 0:l.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(e){To.parse(e);try{let t;if(e.length>1){const r=this.provider.getParameters(),a=e.map(i=>({id:i.id,rank:i.rank,lat:i.lat,lng:i.lng,width:i.tooltip.style.width,height:i.tooltip.style.height,margin:i.tooltip.style.margin}));if(this.apiStatesKey!=null){const i={key:this.apiStatesKey,parameters:r,input:a},o=await fetch(this.apiStatesUrl??Io,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok||!o.body)throw new Error("Failed to get marker states: "+o.statusText);t=await o.json()}else t=Ma(r,a)}else t=[[0,[[0,$.DEGREES.indexOf($.DEGREES_DEFAULT)]]]];this.updateMarkerData(e,t),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const r of this.markerDataArray)this.markerPopupProcessor.hide(r);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const r of this.markerDataArray)this.markerPopupProcessor.hide(r);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}updateMarkerData(e,t){try{this.markerDataUpdating=!0;const r=new Map(e.map((i,o)=>[i.id,new Na(this.provider,i,t[o])])),a=Array.from(this.markerDataArray);for(const i of a)r.has(i.marker.id)==!1&&(i.remove(),this.markerDataMap.delete(i.marker.id),this.markerDataArray.splice(this.markerDataArray.indexOf(i),1));for(let i=0;i<e.length;i++){const o=e[i],s=t[i],c=this.markerDataMap.get(o.id);if(c)c.update(s);else{const l=new Na(this.provider,o,s);l.create(),this.markerDataMap.set(o.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((i,o)=>i.zoom-o.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(i=>i.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(i=>i.tooltip))}catch(r){throw console.error(r),this.markerDataArray.forEach(a=>a.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),r instanceof Error&&this.log("error","Failed to update marker data",r),r}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.clear(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.provider.getBounds(),t=this.provider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,r){if(!(this.apiLogEnabled==null&&(window!=null&&window.location.host.startsWith("localhost")))&&this.apiLogEnabled!=!1)try{const a={title:`[CLIENT:${Ca}] ${t}`,level:e,content:{version:Ca,...r}};await fetch(Po,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(a){console.error(a)}}}class Na{constructor(e,t,r){p(this,"marker");p(this,"zoom");p(this,"pin");p(this,"tooltip");this.marker=t,this.zoom=r[0],this.pin=new cr(e,t,r),this.tooltip=new dr(e,t,r)}create(){this.pin.create(),this.tooltip.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove()}}class lr{constructor(e,t){p(this,"provider");p(this,"id");p(this,"lat");p(this,"lng");p(this,"shown");p(this,"element");p(this,"component");p(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,r=this.component;if(t==null||r==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e,t;(e=this.marker)==null||e.remove(),(t=this.element)==null||t.remove()}}const St=class St extends lr{constructor(t,r,a){var i,o,s,c;super(t,r);p(this,"width");p(this,"height");p(this,"radius");p(this,"zoom");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=((i=r.pin)==null?void 0:i.style.width)??St.DEFAULT_SIZE,this.height=((o=r.pin)==null?void 0:o.style.height)??St.DEFAULT_SIZE,this.radius=((s=r.pin)==null?void 0:s.style.radius)??St.DEFAULT_SIZE,this.zoom=a[0],this.bodyCallback=(c=r.pin)==null?void 0:c.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=jn(Ki,{target:this.element,props:{id:this.id+"_pin",layer:Xi,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var r;super.updateMap(t),(r=this.component)==null||r.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update pin state");this.component.setScale(this.getScale(t))}updateBody(){var r;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(r=this.component)==null?void 0:r.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load pin body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setScale(t?0:1)}getScale(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};p(St,"DEFAULT_SIZE",16);let cr=St;const zt=class zt{constructor(e){p(this,"provider");p(this,"pinElements",new Array);p(this,"pinMaxWidth",0);p(this,"pinMaxHeight",0);p(this,"pinFade",!1);p(this,"pinMaxCount",0);p(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,r,a;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((r=e==null?void 0:e.pin)==null?void 0:r.maxCount)??Math.max(zt.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((a=e==null?void 0:e.pin)==null?void 0:a.maxZoom)??zt.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,r)=>Math.max(t,r.width),0),this.pinMaxHeight=e.reduce((t,r)=>Math.max(t,r.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const r=this.provider.getParameters().mapSize,a=new ua(e,t,r,this.pinMaxWidth*2,this.pinMaxHeight*2);let i=0;for(const o of this.pinElements)a.contains(o.lat,o.lng)?o.shown&&t<o.zoom&&o.zoom<t+this.pinMaxZoomDelta?(i<this.pinMaxCount&&(this.pinFade==!0?o.updateState(t):o.setCollapsed(!1),o.updateMap(!0),o.isBodyLoaded()==!1&&o.updateBody()),i++):(o.setCollapsed(!0),o.isCollapsed()&&o.updateMap(!1)):o.updateMap(!1)}};p(zt,"MAP_PINS_MAX_ZOOM",2),p(zt,"MAP_PINS_MAX_COUNT",128);let ur=zt;const hn=class hn extends lr{constructor(t,r,a){super(t,r);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"zoom");p(this,"angle");p(this,"states");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=r.tooltip.style.width,this.height=r.tooltip.style.height,this.margin=r.tooltip.style.margin,this.radius=r.tooltip.style.radius,this.zoom=a[0],this.angle=$.DEGREES_DEFAULT,this.states=a[1].map(i=>[i[0],$.DEGREES[i[1]]]),this.bodyCallback=r.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=jn(ca,{target:this.element,props:{id:this.id+"_tooltip",layer:Yi,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(r=>[r[0],$.DEGREES[r[1]]]),this.updateZIndex()}updateMap(t){var r;super.updateMap(t),(r=this.component)==null||r.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var r;if(this.bodyLoaded||this.bodyLoading)return;const t=(r=this.component)==null?void 0:r.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load tooltip body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const r=this.states.findLast(a=>a[0]<=t);if(!r)throw new Error("Angle not found");return r[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+hn.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};p(hn,"Z_INDEX_OFFSET",1e6);let dr=hn;class Do{constructor(e){p(this,"provider");p(this,"tooltipElements",new Array);p(this,"tooltipMaxWidth",0);p(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,r)=>Math.max(t,r.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,r)=>Math.max(t,r.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const r=this.provider.getParameters().mapSize,a=new ua(e,t,r,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const i of this.tooltipElements)a.contains(i.lat,i.lng)?i.shown&&i.zoom<=t?(i.updateState(t),i.setCollapsed(!1),i.updateMap(!0),i.isCollapsed()==!1&&i.isBodyLoaded()==!1&&i.updateBody()):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}}const fn=class fn extends lr{constructor(t,r){if(r.popup==null)throw new Error("Failed to create popup");super(t,r);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.shown=!1,this.width=r.popup.style.width,this.height=r.popup.style.height,this.margin=r.popup.style.margin,this.radius=r.popup.style.radius,this.bodyCallback=r.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=jn(ca,{target:this.element,props:{id:this.id+"_popup",layer:Gi,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var r;super.updateMap(t),(r=this.component)==null||r.setDisplayed(t)}updateBody(){var r;if(this.bodyLoaded||this.bodyLoading)return;const t=(r=this.component)==null?void 0:r.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load popup body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return fn.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(t)}setAngle(t){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};p(fn,"Z_INDEX_OFFSET",2e6);let pr=fn;class Zo{constructor(e){p(this,"provider");p(this,"popupElements",new Map);p(this,"popupPositioned",new Map);this.provider=e}show(e){e.pin.shown=!1,e.tooltip.shown=!1;const t=new pr(this.provider,e.marker);this.popupElements.set(e.marker.id,t),this.popupPositioned.set(e.marker.id,!1),t.create(),t.setAngle(e.tooltip.angle),t.shown=!0}hide(e){e.pin.shown=!0,e.tooltip.shown=!0;const t=this.popupElements.get(e.marker.id);t!=null&&(t.shown=!1)}clear(){this.popupElements.values().forEach(e=>e.remove()),this.popupElements.clear(),this.popupPositioned.clear()}process(){var e,t;for(const r of this.popupElements.values())if(r.shown){if(r.setCollapsed(!1),r.updateMap(!0),r.isExpanded()&&r.isBodyLoaded()==!1&&r.updateBody(),r.isCollapsed()==!1&&this.popupPositioned.get(r.id)==!1){const a=(e=r.component)==null?void 0:e.getBody();if(a==null)continue;const i=(t=r.component)==null?void 0:t.getOffsets();if(i==null)continue;const o=a.getBoundingClientRect();if(o.x==0&&o.y==0&&o.width==0&&o.height==0)continue;const s=o.x+o.width/2,c=o.y+o.height/2,l=s+i.x,u=c+i.y,d=l+r.width,m=u+r.height,f=this.provider.getContainer().getBoundingClientRect(),z=l-f.left,v=f.right-d,h=u-f.top,_=f.bottom-m,g=Math.min(r.width,r.height)/4,b=z<0?z-g:v<0?-v+g:0,x=h<0?h-g:_<0?-_+g:0;this.provider.panBy(b,x),this.popupPositioned.set(r.id,!0)}}else r.setCollapsed(!0),r.isCollapsed()&&(r.updateMap(!1),r.remove(),this.popupElements.delete(r.id),this.popupPositioned.delete(r.id))}}class Fo{constructor(e,t,r){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...r,minZoom:Math.max(r.minZoom??0,0),maxZoom:Math.min(r.maxZoom??22,24),style:r.style??"https://tiles.openfreemap.org/styles/liberty",pitchWithRotate:!1,attributionControl:r.attributionControl??{compact:!1,customAttribution:"@arenarium/maps"}}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds(),t=e.getSouthWest(),r=e.getNorthEast();return{sw:t,ne:r}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,r){const a=new this.MapMarkerClass({element:e});return a.setLngLat([r,t]),{instance:a,inserted:()=>a._map!=null,insert:()=>a.addTo(this.map),remove:()=>a.remove(),update:i=>a.getElement().style.zIndex=i.toString()}}}const Bo={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(120, 120, 120, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(128, 128, 128, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(56, 56, 56, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(153, 153, 153, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(104, 104, 104, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(56, 56, 56, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(136, 136, 136, 1)","fill-outline-color":"rgba(102, 102, 102, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(50, 50, 50, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(52, 52, 52, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(88, 88, 88, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20],"line-color":"rgba(102, 102, 102, 1)"}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23],"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(51, 51, 51, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(51, 51, 51, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(255, 255, 255, 1)","text-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]},Vo={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(220, 220, 220, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(228, 228, 228, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(156, 156, 156, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(253, 253, 253, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(204, 204, 204, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(156, 156, 156, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(236, 236, 236, 1)","fill-outline-color":"rgba(202, 202, 202, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(185, 185, 185)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(150, 150, 150, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(152, 152, 152, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(188, 188, 188)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(185, 185, 185)","line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23]}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":2}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(151, 151, 151, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(151, 151, 151, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1.5}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(0, 0, 0, 1)","text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]};class Uo{constructor(e,t,r){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...r,minZoom:Math.max(r.minZoom??0,0),maxZoom:Math.min(r.maxZoom??22,24),projection:"mercator",pitchWithRotate:!1,customAttribution:r.customAttribution??"@arenarium/maps"}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds();if(!e)return{sw:{lat:0,lng:0},ne:{lat:0,lng:0}};const t=e.getSouthWest(),r=e.getNorthEast();return{sw:t,ne:r}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,r){const a=new this.MapMarkerClass({element:e});return a.setLngLat([r,t]),{instance:a,inserted:()=>a._map!=null,insert:()=>a.addTo(this.map),remove:()=>a.remove(),update:i=>a.getElement().style.zIndex=i.toString()}}}class $o{constructor(e,t,r,a){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");p(this,"options");this.MapClass=e,this.MapMarkerClass=t,this.options=a,this.map=new this.MapClass(r,{...a})}getParameters(){return{mapSize:256,zoomMin:this.options.minZoom??0,zoomMax:this.options.maxZoom??24,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getDiv()}getZoom(){return this.map.getZoom()??NaN}getBounds(){const e=this.map.getBounds();if(e==null)return{sw:{lat:NaN,lng:NaN},ne:{lat:NaN,lng:NaN}};const t=e.getSouthWest(),r=e.getNorthEast();return{sw:{lat:t.lat(),lng:t.lng()},ne:{lat:r.lat(),lng:r.lng()}}}panBy(e,t){this.map.panBy(e,t)}createMarker(e,t,r,a){const i=new this.MapMarkerClass({position:{lat:t,lng:r},content:e,zIndex:a});return{instance:i,inserted:()=>i.map!=null&&i.map==this.map,insert:()=>i.map=this.map,remove:()=>i.map=void 0,update:o=>i.zIndex=o}}}const Wo=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100},{lightness:-10}]},{featureType:"landscape",stylers:[{lightness:30}]},{featureType:"road",elementType:"geometry",stylers:[{saturation:-100}]}],qo=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100}]},{elementType:"geometry",stylers:[{lightness:-45}]},{elementType:"labels.text.fill",stylers:[{lightness:-100}]},{elementType:"labels.text.stroke",stylers:[{lightness:-15}]},{featureType:"water",elementType:"geometry",stylers:[{lightness:-50}]}];class Go{constructor(e,t,r){p(this,"x");p(this,"y");p(this,"width");p(this,"height");p(this,"zoom");p(this,"angles");p(this,"expanded");p(this,"angle");p(this,"bounds");const a=Oe.project(t.lat,t.lng,e.mapSize);this.x=a.x,this.y=a.y,this.width=t.width+2*t.margin,this.height=t.height+2*t.margin,this.zoom=r[0],this.angles=r[1].map(i=>[i[0],$.DEGREES[i[1]]]),this.expanded=!1,this.angle=0,this.bounds=void 0}getBounds(e,t){let r=Je.getOffsets(this.width,this.height,t),a=-r.x,i=this.width-a,o=-r.y,s=this.height-o;return{x:this.x,y:this.y,distances:{left:a/e,right:i/e,top:o/e,bottom:s/e}}}}function Yo(n,e,t){var s;if(e.length!=t.length)throw new Error("Data and states length must be the same");const r=new Array(e.length);for(let c=0;c<e.length;c++){const l=t[c];if(isNaN(l[0]))throw new Error("State zoom is not a number");if(l[1]==null||l[1].length==0)throw new Error("State angles is empty");if(l[0]!=l[1][0][0])throw new Error("State expand zoom and start angles zoom are not the same");const u=new Go(n,e[c],t[c]);r[c]=u}const a=n.zoomMin,i=n.zoomMax,o=1/n.zoomScale;for(let c=a;c<=i;c+=o){const l=Math.pow(2,c);for(let u=0;u<r.length;u++){const d=r[u];if(d.expanded=d.zoom<c,d.expanded==!1)continue;const m=(s=d.angles.findLast(f=>f[0]<c))==null?void 0:s[1];if(m==null)throw new Error("Angle not found");d.angle=m,d.bounds=d.getBounds(l,m)}for(let u=0;u<r.length;u++){const d=r[u];if(d.bounds!=null)for(let m=u+1;m<r.length;m++){const f=r[m];if(f.bounds!=null&&Re.areOverlaping(d.bounds,f.bounds)){console.log("OVERLAP",c,d,e[u],f,e[m]);const z=d.bounds.x-d.bounds.distances.left,v=d.bounds.x+d.bounds.distances.right,h=d.bounds.y-d.bounds.distances.top,_=d.bounds.y+d.bounds.distances.bottom;console.log(`B1: (${z}, ${h}), (${z}, ${_}), (${v}, ${h}), (${v}, ${_}), (${d.bounds.x}, ${d.bounds.y})`,d.angle);const g=f.bounds.x-f.bounds.distances.left,b=f.bounds.x+f.bounds.distances.right,x=f.bounds.y-f.bounds.distances.top,E=f.bounds.y+f.bounds.distances.bottom;throw console.log(`B2: (${g}, ${x}), (${g}, ${E}), (${b}, ${x}), (${b}, ${E}), (${f.bounds.x}, ${f.bounds.y})`,f.angle),new Error("Bounds overlaping")}}}}}N.GoogleMapDarkStyle=qo,N.GoogleMapLightStyle=Wo,N.GoogleMapsProvider=$o,N.MapManager=jo,N.MapboxProvider=Uo,N.MaplibreDarkStyle=Bo,N.MaplibreLightStyle=Vo,N.MaplibreProvider=Fo,N.getStates=Ma,N.testStates=Yo,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
1
+ (function(S,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(S=typeof globalThis<"u"?globalThis:S||self,N(S.arenarium={}))})(this,function(S){"use strict";var Ps=Object.defineProperty;var gn=S=>{throw TypeError(S)};var Os=(S,N,O)=>N in S?Ps(S,N,{enumerable:!0,configurable:!0,writable:!0,value:O}):S[N]=O;var p=(S,N,O)=>Os(S,typeof N!="symbol"?N+"":N,O),Gr=(S,N,O)=>N.has(S)||gn("Cannot "+O);var w=(S,N,O)=>(Gr(S,N,"read from private field"),O?O.call(S):N.get(S)),F=(S,N,O)=>N.has(S)?gn("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(S):N.set(S,O),V=(S,N,O,Nt)=>(Gr(S,N,"write to private field"),Nt?Nt.call(S,O):N.set(S,O),O),De=(S,N,O)=>(Gr(S,N,"access private method"),O);var rt,at,Ee,St,zt,je,nt,Ie,Ce,it,Mt,Et,oe,vn,er,Xr,cn,he,st,Ct,Ze;var O=Array.isArray,Nt=Array.prototype.indexOf,_n=Array.from,tr=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,xn=Object.prototype,wn=Array.prototype,bn=Object.getPrototypeOf,Jr=Object.isExtensible;function kn(r){for(var e=0;e<r.length;e++)r[e]()}function Sn(){var r,e,t=new Promise((a,n)=>{r=a,e=n});return{promise:t,resolve:r,reject:e}}const X=2,rr=4,Kr=8,Lt=16,ye=32,Te=64,Qr=128,Q=256,Rt=512,H=1024,le=2048,ge=4096,Fe=8192,Be=16384,ar=32768,zn=65536,ea=1<<17,Mn=1<<18,nr=1<<19,ta=1<<20,ir=1<<21,sr=1<<22,Ae=1<<23,Pt=Symbol("$state"),or=new class extends Error{constructor(){super(...arguments);p(this,"name","StaleReactionError");p(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function En(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Cn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Tn(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function An(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Nn(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Ln(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Rn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Pn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function On(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const jn=2,B=Symbol();function ra(r){return r===this.v}let js=!1,ie=null;function Ot(r){ie=r}function lr(r,e=!1,t){ie={p:ie,c:null,e:null,s:r,x:null,l:null}}function ur(r){var e=ie,t=e.e;if(t!==null){e.e=null;for(var a of t)_a(a)}return r!==void 0&&(e.x=r),ie=e.p,r??{}}function aa(){return!0}const In=new WeakMap;function Zn(r){var e=T;if(e===null)return z.f|=Ae,r;if((e.f&ar)===0){if((e.f&Qr)===0)throw!e.parent&&r instanceof Error&&na(r),r;e.b.error(r)}else cr(r,e)}function cr(r,e){for(;e!==null;){if((e.f&Qr)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&na(r),r}function na(r){const e=In.get(r);e&&(tr(r,"message",{value:e.message}),tr(r,"stack",{value:e.stack}))}let jt=[];function Dn(){var r=jt;jt=[],kn(r)}function Fn(r){jt.length===0&&queueMicrotask(Dn),jt.push(r)}function Bn(){for(var r=T.b;r!==null&&!r.has_pending_snippet();)r=r.parent;return r===null&&En(),r}function Vn(r){var e=X|le,t=z!==null&&(z.f&X)!==0?z:null;return T===null||t!==null&&(t.f&Q)!==0?e|=Q:T.f|=nr,{ctx:ie,deps:null,effects:null,equals:ra,f:e,fn:r,reactions:null,rv:0,v:B,wv:0,parent:t??T,ac:null}}function Un(r,e){let t=T;t===null&&Cn();var a=t.b,n=void 0,i=da(B),s=null,o=!z;return ri(()=>{try{var l=r()}catch(y){l=Promise.reject(y)}var u=()=>l;n=(s==null?void 0:s.then(u,u))??Promise.resolve(l),s=n;var c=D,f=a.pending;o&&(a.update_pending_count(1),f||c.increment());const h=(y,b=void 0)=>{s=null,f||c.activate(),b?b!==or&&(i.f|=Ae,hr(i,b)):((i.f&Ae)!==0&&(i.f^=Ae),hr(i,y)),o&&(a.update_pending_count(-1),f||c.decrement()),oa()};if(n.then(h,y=>h(null,y||"unknown")),c)return()=>{queueMicrotask(()=>c.neuter())}}),new Promise(l=>{function u(c){function f(){c===n?l(i):u(n)}c.then(f,f)}u(n)})}function ia(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Re(e[t])}}function qn(r){for(var e=r.parent;e!==null;){if((e.f&X)===0)return e;e=e.parent}return null}function dr(r){var e,t=T;$e(qn(r));try{ia(r),e=La(r)}finally{$e(t)}return e}function sa(r){var e=dr(r);if(r.equals(e)||(r.v=e,r.wv=Aa()),!qe)if(ve!==null)ve.set(r,r.v);else{var t=(xe||(r.f&Q)!==0)&&r.deps!==null?ge:H;te(r,t)}}function $n(r,e,t){const a=Vn;if(e.length===0){t(r.map(a));return}var n=D,i=T,s=Wn(),o=Bn();Promise.all(e.map(l=>Un(l))).then(l=>{n==null||n.activate(),s();try{t([...r.map(a),...l])}catch(u){(i.f&Be)===0&&cr(u,i)}n==null||n.deactivate(),oa()}).catch(l=>{o.error(l)})}function Wn(){var r=T,e=z,t=ie;return function(){$e(r),_e(e),Ot(t)}}function oa(){$e(null),_e(null),Ot(null)}const dt=new Set;let D=null,ve=null,la=new Set,It=[];function ua(){const r=It.shift();It.length>0&&queueMicrotask(ua),r()}let pt=[],pr=null,fr=!1;const Yt=class Yt{constructor(){F(this,oe);p(this,"current",new Map);F(this,rt,new Map);F(this,at,new Set);F(this,Ee,0);F(this,St,null);F(this,zt,!1);F(this,je,[]);F(this,nt,[]);F(this,Ie,[]);F(this,Ce,[]);F(this,it,[]);F(this,Mt,[]);F(this,Et,[]);p(this,"skipped_effects",new Set)}process(e){var i;pt=[];var t=null;if(dt.size>1){t=new Map,ve=new Map;for(const[s,o]of this.current)t.set(s,{v:s.v,wv:s.wv}),s.v=o;for(const s of dt)if(s!==this)for(const[o,l]of w(s,rt))t.has(o)||(t.set(o,{v:o.v,wv:o.wv}),o.v=l)}for(const s of e)De(this,oe,vn).call(this,s);if(w(this,je).length===0&&w(this,Ee)===0){De(this,oe,Xr).call(this);var a=w(this,Ie),n=w(this,Ce);V(this,Ie,[]),V(this,Ce,[]),V(this,it,[]),D=null,ca(a),ca(n),D===null?D=this:dt.delete(this),(i=w(this,St))==null||i.resolve()}else De(this,oe,er).call(this,w(this,Ie)),De(this,oe,er).call(this,w(this,Ce)),De(this,oe,er).call(this,w(this,it));if(t){for(const[s,{v:o,wv:l}]of t)s.wv<=l&&(s.v=o);ve=null}for(const s of w(this,je))yt(s);for(const s of w(this,nt))yt(s);V(this,je,[]),V(this,nt,[])}capture(e,t){w(this,rt).has(e)||w(this,rt).set(e,t),this.current.set(e,e.v)}activate(){D=this}deactivate(){D=null;for(const e of la)if(la.delete(e),e(),D!==null)break}neuter(){V(this,zt,!0)}flush(){pt.length>0?Hn():De(this,oe,Xr).call(this),D===this&&(w(this,Ee)===0&&dt.delete(this),this.deactivate())}increment(){V(this,Ee,w(this,Ee)+1)}decrement(){if(V(this,Ee,w(this,Ee)-1),w(this,Ee)===0){for(const e of w(this,Mt))te(e,le),Ve(e);for(const e of w(this,Et))te(e,ge),Ve(e);V(this,Ie,[]),V(this,Ce,[]),this.flush()}else this.deactivate()}add_callback(e){w(this,at).add(e)}settled(){return(w(this,St)??V(this,St,Sn())).promise}static ensure(){if(D===null){const e=D=new Yt;dt.add(D),Yt.enqueue(()=>{D===e&&e.flush()})}return D}static enqueue(e){It.length===0&&queueMicrotask(ua),It.unshift(e)}};rt=new WeakMap,at=new WeakMap,Ee=new WeakMap,St=new WeakMap,zt=new WeakMap,je=new WeakMap,nt=new WeakMap,Ie=new WeakMap,Ce=new WeakMap,it=new WeakMap,Mt=new WeakMap,Et=new WeakMap,oe=new WeakSet,vn=function(e){var c;e.f^=H;for(var t=e.first;t!==null;){var a=t.f,n=(a&(ye|Te))!==0,i=n&&(a&H)!==0,s=i||(a&Fe)!==0||this.skipped_effects.has(t);if(!s&&t.fn!==null){if(n)t.f^=H;else if((a&H)===0)if((a&rr)!==0)w(this,Ce).push(t);else if((a&sr)!==0){var o=(c=t.b)!=null&&c.pending?w(this,nt):w(this,je);o.push(t)}else Zt(t)&&((t.f&Lt)!==0&&w(this,it).push(t),yt(t));var l=t.first;if(l!==null){t=l;continue}}var u=t.parent;for(t=t.next;t===null&&u!==null;)t=u.next,u=u.parent}},er=function(e){for(const t of e)((t.f&le)!==0?w(this,Mt):w(this,Et)).push(t),te(t,H);e.length=0},Xr=function(){if(!w(this,zt))for(const e of w(this,at))e();w(this,at).clear()};let ft=Yt;function Hn(){var r=Ue;fr=!0;try{var e=0;for(Ma(!0);pt.length>0;){var t=ft.ensure();if(e++>1e3){var a,n;Yn()}t.process(pt),Ne.clear()}}finally{fr=!1,Ma(r),pr=null}}function Yn(){try{Ln()}catch(r){cr(r,pr)}}function ca(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var a=r[t++];if((a.f&(Be|Fe))===0&&Zt(a)){var n=D?D.current.size:0;if(yt(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?Sa(a):a.fn=null),D!==null&&D.current.size>n&&(a.f&ta)!==0)break}}for(;t<e;)Ve(r[t++])}}function Ve(r){for(var e=pr=r;e.parent!==null;){e=e.parent;var t=e.f;if(fr&&e===T&&(t&Lt)!==0)return;if((t&(Te|ye))!==0){if((t&H)===0)return;e.f^=H}}pt.push(e)}const Ne=new Map;function da(r,e){var t={f:0,v:r,reactions:null,equals:ra,rv:0,wv:0};return t}function Y(r,e){const t=da(r);return li(t),t}function U(r,e,t=!1){z!==null&&(!ue||(z.f&ea)!==0)&&aa()&&(z.f&(X|Lt|sr|ea))!==0&&!(q!=null&&q.includes(r))&&On();let a=t?ht(e):e;return hr(r,a)}function hr(r,e){if(!r.equals(e)){var t=r.v;qe?Ne.set(r,e):Ne.set(r,t),r.v=e;var a=ft.ensure();a.capture(r,t),(r.f&X)!==0&&((r.f&le)!==0&&dr(r),te(r,(r.f&Q)===0?H:ge)),r.wv=Aa(),pa(r,le),T!==null&&(T.f&H)!==0&&(T.f&(ye|Te))===0&&(ee===null?ui([r]):ee.push(r))}return e}function mr(r){U(r,r.v+1)}function pa(r,e){var t=r.reactions;if(t!==null)for(var a=t.length,n=0;n<a;n++){var i=t[n],s=i.f,o=(s&le)===0;o&&te(i,e),(s&X)!==0?pa(i,ge):o&&Ve(i)}}function ht(r){if(typeof r!="object"||r===null||Pt in r)return r;const e=bn(r);if(e!==xn&&e!==wn)return r;var t=new Map,a=O(r),n=Y(0),i=Pe,s=o=>{if(Pe===i)return o();var l=z,u=Pe;_e(null),Ta(i);var c=o();return _e(l),Ta(u),c};return a&&t.set("length",Y(r.length)),new Proxy(r,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Rn();var c=t.get(l);return c===void 0?c=s(()=>{var f=Y(u.value);return t.set(l,f),f}):U(c,u.value,!0),!0},deleteProperty(o,l){var u=t.get(l);if(u===void 0){if(l in o){const c=s(()=>Y(B));t.set(l,c),mr(n)}}else U(u,B),mr(n);return!0},get(o,l,u){var y;if(l===Pt)return r;var c=t.get(l),f=l in o;if(c===void 0&&(!f||(y=ct(o,l))!=null&&y.writable)&&(c=s(()=>{var b=ht(f?o[l]:B),R=Y(b);return R}),t.set(l,c)),c!==void 0){var h=j(c);return h===B?void 0:h}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var c=t.get(l);c&&(u.value=j(c))}else if(u===void 0){var f=t.get(l),h=f==null?void 0:f.v;if(f!==void 0&&h!==B)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(o,l){var h;if(l===Pt)return!0;var u=t.get(l),c=u!==void 0&&u.v!==B||Reflect.has(o,l);if(u!==void 0||T!==null&&(!c||(h=ct(o,l))!=null&&h.writable)){u===void 0&&(u=s(()=>{var y=c?ht(o[l]):B,b=Y(y);return b}),t.set(l,u));var f=j(u);if(f===B)return!1}return c},set(o,l,u,c){var W;var f=t.get(l),h=l in o;if(a&&l==="length")for(var y=u;y<f.v;y+=1){var b=t.get(y+"");b!==void 0?U(b,B):y in o&&(b=s(()=>Y(B)),t.set(y+"",b))}if(f===void 0)(!h||(W=ct(o,l))!=null&&W.writable)&&(f=s(()=>Y(void 0)),U(f,ht(u)),t.set(l,f));else{h=f.v!==B;var R=s(()=>ht(u));U(f,R)}var P=Reflect.getOwnPropertyDescriptor(o,l);if(P!=null&&P.set&&P.set.call(c,u),!h){if(a&&typeof l=="string"){var ae=t.get("length"),C=Number(l);Number.isInteger(C)&&C>=ae.v&&U(ae,C+1)}mr(n)}return!0},ownKeys(o){j(n);var l=Reflect.ownKeys(o).filter(f=>{var h=t.get(f);return h===void 0||h.v!==B});for(var[u,c]of t)c.v!==B&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Pn()}})}var fa,ha,ma,ya;function Gn(){if(fa===void 0){fa=window,ha=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;ma=ct(e,"firstChild").get,ya=ct(e,"nextSibling").get,Jr(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),Jr(t)&&(t.__t=void 0)}}function Xn(r=""){return document.createTextNode(r)}function ga(r){return ma.call(r)}function va(r){return ya.call(r)}function yr(r,e){return ga(r)}function Jn(r,e=1,t=!1){let a=r;for(;e--;)a=va(a);return a}function Kn(r){T===null&&z===null&&Nn(),z!==null&&(z.f&Q)!==0&&T===null&&An(),qe&&Tn()}function Qn(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Le(r,e,t,a=!0){var n=T;n!==null&&(n.f&Fe)!==0&&(r|=Fe);var i={ctx:ie,deps:null,nodes_start:null,nodes_end:null,f:r|le,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{yt(i),i.f|=ar}catch(l){throw Re(i),l}else e!==null&&Ve(i);var s=t&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&nr)===0;if(!s&&a&&(n!==null&&Qn(i,n),z!==null&&(z.f&X)!==0&&(r&Te)===0)){var o=z;(o.effects??(o.effects=[])).push(i)}return i}function pe(r){Kn();var e=T.f,t=!z&&(e&ye)!==0&&(e&ar)===0;if(t){var a=ie;(a.e??(a.e=[])).push(r)}else return _a(r)}function _a(r){return Le(rr|ta,r,!1)}function ei(r){ft.ensure();const e=Le(Te,r,!0);return(t={})=>new Promise(a=>{t.outro?si(e,()=>{Re(e),a(void 0)}):(Re(e),a(void 0))})}function ti(r){return Le(rr,r,!1)}function ri(r){return Le(sr|nr,r,!0)}function xa(r,e=0){return Le(Kr|e,r,!0)}function wa(r,e=[],t=[]){$n(e,t,a=>{Le(Kr,()=>r(...a.map(j)),!0)})}function ai(r,e=!0){return Le(ye,r,!0,e)}function ba(r){var e=r.teardown;if(e!==null){const t=qe,a=z;Ea(!0),_e(null);try{e.call(null)}finally{Ea(t),_e(a)}}}function ka(r,e=!1){var n;var t=r.first;for(r.first=r.last=null;t!==null;){(n=t.ac)==null||n.abort(or);var a=t.next;(t.f&Te)!==0?t.parent=null:Re(t,e),t=a}}function ni(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&ye)===0&&Re(e),e=t}}function Re(r,e=!0){var t=!1;(e||(r.f&Mn)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(ii(r.nodes_start,r.nodes_end),t=!0),ka(r,e&&!t),Dt(r,0),te(r,Be);var a=r.transitions;if(a!==null)for(const i of a)i.stop();ba(r);var n=r.parent;n!==null&&n.first!==null&&Sa(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function ii(r,e){for(;r!==null;){var t=r===e?null:va(r);r.remove(),r=t}}function Sa(r){var e=r.parent,t=r.prev,a=r.next;t!==null&&(t.next=a),a!==null&&(a.prev=t),e!==null&&(e.first===r&&(e.first=a),e.last===r&&(e.last=t))}function si(r,e){var t=[];za(r,t,!0),oi(t,()=>{Re(r),e&&e()})}function oi(r,e){var t=r.length;if(t>0){var a=()=>--t||e();for(var n of r)n.out(a)}else e()}function za(r,e,t){if((r.f&Fe)===0){if(r.f^=Fe,r.transitions!==null)for(const s of r.transitions)(s.is_global||t)&&e.push(s);for(var a=r.first;a!==null;){var n=a.next,i=(a.f&zn)!==0||(a.f&ye)!==0;za(a,e,i?t:!1),a=n}}}let Ue=!1;function Ma(r){Ue=r}let qe=!1;function Ea(r){qe=r}let z=null,ue=!1;function _e(r){z=r}let T=null;function $e(r){T=r}let q=null;function li(r){z!==null&&(q===null?q=[r]:q.push(r))}let $=null,J=0,ee=null;function ui(r){ee=r}let Ca=1,mt=0,Pe=mt;function Ta(r){Pe=r}let xe=!1;function Aa(){return++Ca}function Zt(r){var f;var e=r.f;if((e&le)!==0)return!0;if((e&ge)!==0){var t=r.deps,a=(e&Q)!==0;if(t!==null){var n,i,s=(e&Rt)!==0,o=a&&T!==null&&!xe,l=t.length;if((s||o)&&(T===null||(T.f&Be)===0)){var u=r,c=u.parent;for(n=0;n<l;n++)i=t[n],(s||!((f=i==null?void 0:i.reactions)!=null&&f.includes(u)))&&(i.reactions??(i.reactions=[])).push(u);s&&(u.f^=Rt),o&&c!==null&&(c.f&Q)===0&&(u.f^=Q)}for(n=0;n<l;n++)if(i=t[n],Zt(i)&&sa(i),i.wv>r.wv)return!0}(!a||T!==null&&!xe)&&te(r,H)}return!1}function Na(r,e,t=!0){var a=r.reactions;if(a!==null&&!(q!=null&&q.includes(r)))for(var n=0;n<a.length;n++){var i=a[n];(i.f&X)!==0?Na(i,e,!1):e===i&&(t?te(i,le):(i.f&H)!==0&&te(i,ge),Ve(i))}}function La(r){var b;var e=$,t=J,a=ee,n=z,i=xe,s=q,o=ie,l=ue,u=Pe,c=r.f;$=null,J=0,ee=null,xe=(c&Q)!==0&&(ue||!Ue||z===null),z=(c&(ye|Te))===0?r:null,q=null,Ot(r.ctx),ue=!1,Pe=++mt,r.ac!==null&&(r.ac.abort(or),r.ac=null);try{r.f|=ir;var f=(0,r.fn)(),h=r.deps;if($!==null){var y;if(Dt(r,J),h!==null&&J>0)for(h.length=J+$.length,y=0;y<$.length;y++)h[J+y]=$[y];else r.deps=h=$;if(!xe||(c&X)!==0&&r.reactions!==null)for(y=J;y<h.length;y++)((b=h[y]).reactions??(b.reactions=[])).push(r)}else h!==null&&J<h.length&&(Dt(r,J),h.length=J);if(aa()&&ee!==null&&!ue&&h!==null&&(r.f&(X|ge|le))===0)for(y=0;y<ee.length;y++)Na(ee[y],r);return n!==null&&n!==r&&(mt++,ee!==null&&(a===null?a=ee:a.push(...ee))),(r.f&Ae)!==0&&(r.f^=Ae),f}catch(R){return Zn(R)}finally{r.f^=ir,$=e,J=t,ee=a,z=n,xe=i,q=s,Ot(o),ue=l,Pe=u}}function ci(r,e){let t=e.reactions;if(t!==null){var a=Nt.call(t,r);if(a!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[a]=t[n],t.pop())}}t===null&&(e.f&X)!==0&&($===null||!$.includes(e))&&(te(e,ge),(e.f&(Q|Rt))===0&&(e.f^=Rt),ia(e),Dt(e,0))}function Dt(r,e){var t=r.deps;if(t!==null)for(var a=e;a<t.length;a++)ci(r,t[a])}function yt(r){var e=r.f;if((e&Be)===0){te(r,H);var t=T,a=Ue;T=r,Ue=!0;try{(e&Lt)!==0?ni(r):ka(r),ba(r);var n=La(r);r.teardown=typeof n=="function"?n:null,r.wv=Ca;var i}finally{Ue=a,T=t}}}function j(r){var e=r.f,t=(e&X)!==0;if(z!==null&&!ue){var a=T!==null&&(T.f&Be)!==0;if(!a&&!(q!=null&&q.includes(r))){var n=z.deps;if((z.f&ir)!==0)r.rv<mt&&(r.rv=mt,$===null&&n!==null&&n[J]===r?J++:$===null?$=[r]:(!xe||!$.includes(r))&&$.push(r));else{(z.deps??(z.deps=[])).push(r);var i=r.reactions;i===null?r.reactions=[z]:i.includes(z)||i.push(z)}}}else if(t&&r.deps===null&&r.effects===null){var s=r,o=s.parent;o!==null&&(o.f&Q)===0&&(s.f^=Q)}if(qe){if(Ne.has(r))return Ne.get(r);if(t){s=r;var l=s.v;return((s.f&H)===0&&s.reactions!==null||Ra(s))&&(l=dr(s)),Ne.set(s,l),l}}else if(t){if(s=r,ve!=null&&ve.has(s))return ve.get(s);Zt(s)&&sa(s)}if((r.f&Ae)!==0)throw r.v;return r.v}function Ra(r){if(r.v===B)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(Ne.has(e)||(e.f&X)!==0&&Ra(e))return!0;return!1}function di(r){var e=ue;try{return ue=!0,r()}finally{ue=e}}const pi=-7169;function te(r,e){r.f=r.f&pi|e}const fi=["touchstart","touchmove"];function hi(r){return fi.includes(r)}const mi=new Set,Pa=new Set;function Ft(r){var C;var e=this,t=e.ownerDocument,a=r.type,n=((C=r.composedPath)==null?void 0:C.call(r))||[],i=n[0]||r.target,s=0,o=r.__root;if(o){var l=n.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var u=n.indexOf(e);if(u===-1)return;l<=u&&(s=l)}if(i=n[s]||r.target,i!==e){tr(r,"currentTarget",{configurable:!0,get(){return i||t}});var c=z,f=T;_e(null),$e(null);try{for(var h,y=[];i!==null;){var b=i.assignedSlot||i.parentNode||i.host||null;try{var R=i["__"+a];if(R!=null&&(!i.disabled||r.target===i))if(O(R)){var[P,...ae]=R;P.apply(i,[r,...ae])}else R.call(i,r)}catch(W){h?y.push(W):h=W}if(r.cancelBubble||b===e||b===null)break;i=b}if(h){for(let W of y)queueMicrotask(()=>{throw W});throw h}}finally{r.__root=e,delete r.currentTarget,_e(c),$e(f)}}}function yi(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function gi(r,e){var t=T;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function Oa(r,e){var t=(e&jn)!==0,a,n=!r.startsWith("<!>");return()=>{a===void 0&&(a=yi(n?r:"<!>"+r),a=ga(a));var i=t||ha?document.importNode(a,!0):a.cloneNode(!0);return gi(i,i),i}}function ja(r,e){r!==null&&r.before(e)}function gr(r,e){return vi(r,e)}const We=new Map;function vi(r,{target:e,anchor:t,props:a={},events:n,context:i,intro:s=!0}){Gn();var o=new Set,l=f=>{for(var h=0;h<f.length;h++){var y=f[h];if(!o.has(y)){o.add(y);var b=hi(y);e.addEventListener(y,Ft,{passive:b});var R=We.get(y);R===void 0?(document.addEventListener(y,Ft,{passive:b}),We.set(y,1)):We.set(y,R+1)}}};l(_n(mi)),Pa.add(l);var u=void 0,c=ei(()=>{var f=t??e.appendChild(Xn());return ai(()=>{if(i){lr({});var h=ie;h.c=i}n&&(a.$$events=n),u=r(f,a)||{},i&&ur()}),()=>{var b;for(var h of o){e.removeEventListener(h,Ft);var y=We.get(h);--y===0?(document.removeEventListener(h,Ft),We.delete(h)):We.set(h,y)}Pa.delete(l),f!==t&&((b=f.parentNode)==null||b.removeChild(f))}});return _i.set(u,c),u}let _i=new WeakMap;const Ia=[...`
2
+ \r\f \v\uFEFF`];function xi(r,e,t){var a=r==null?"":""+r;if(t){for(var n in t)if(t[n])a=a?a+" "+n:n;else if(a.length)for(var i=n.length,s=0;(s=a.indexOf(n,s))>=0;){var o=s+i;(s===0||Ia.includes(a[s-1]))&&(o===a.length||Ia.includes(a[o]))?a=(s===0?"":a.substring(0,s))+a.substring(o+1):s=o}}return a===""?null:a}function Za(r,e=!1){var t=e?" !important;":";",a="";for(var n in r){var i=r[n];i!=null&&i!==""&&(a+=" "+n+": "+i+t)}return a}function vr(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function wi(r,e){if(e){var t="",a,n;if(Array.isArray(e)?(a=e[0],n=e[1]):a=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,o=!1,l=[];a&&l.push(...Object.keys(a).map(vr)),n&&l.push(...Object.keys(n).map(vr));var u=0,c=-1;const R=r.length;for(var f=0;f<R;f++){var h=r[f];if(o?h==="/"&&r[f-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&r[f+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?s++:h===")"&&s--,!o&&i===!1&&s===0){if(h===":"&&c===-1)c=f;else if(h===";"||f===R-1){if(c!==-1){var y=vr(r.substring(u,c).trim());if(!l.includes(y)){h!==";"&&f++;var b=r.substring(u,f).trim();t+=" "+b+";"}}u=f+1,c=-1}}}}return a&&(t+=Za(a)),n&&(t+=Za(n,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function Da(r,e,t,a,n,i){var s=r.__className;if(s!==t||s===void 0){var o=xi(t,a,i);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}else if(i&&n!==i)for(var l in i){var u=!!i[l];(n==null||u!==!!n[l])&&r.classList.toggle(l,u)}return i}function _r(r,e={},t,a){for(var n in t){var i=t[n];e[n]!==i&&(t[n]==null?r.style.removeProperty(n):r.style.setProperty(n,i,a))}}function Bt(r,e,t,a){var n=r.__style;if(n!==e){var i=wi(e,a);i==null?r.removeAttribute("style"):r.style.cssText=i,r.__style=e}else a&&(Array.isArray(a)?(_r(r,t==null?void 0:t[0],a[0]),_r(r,t==null?void 0:t[1],a[1],"important")):_r(r,t,a));return a}const bi=()=>performance.now(),ce={tick:r=>requestAnimationFrame(r),now:()=>bi(),tasks:new Set};function Fa(){const r=ce.now();ce.tasks.forEach(e=>{e.c(r)||(ce.tasks.delete(e),e.f())}),ce.tasks.size!==0&&ce.tick(Fa)}function ki(r){let e;return ce.tasks.size===0&&ce.tick(Fa),{promise:new Promise(t=>{ce.tasks.add(e={c:r,f:t})}),abort(){ce.tasks.delete(e)}}}function Ba(r,e){return r===e||(r==null?void 0:r[Pt])===e}function He(r={},e,t,a){return ti(()=>{var n,i;return xa(()=>{n=i,i=[],di(()=>{r!==t(...i)&&(e(r,...i),n&&Ba(t(...n),r)&&e(null,...n))})}),()=>{Fn(()=>{i&&Ba(t(...i),r)&&e(null,...i)})}}),r}const Si="5";typeof window<"u"&&((cn=window.__svelte??(window.__svelte={})).v??(cn.v=new Set)).add(Si);function zi(r){return r}function xr(r){return-.5*(Math.cos(Math.PI*r)-1)}function Mi(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Ei(r){return Math.sin(r*Math.PI/2)}const Ci=128,Ti=0,Ai=1,Ni=2;class Li{constructor(){p(this,"animationsStarted",!1);p(this,"animationsCount",0);p(this,"animationsLimit",Ci);p(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const a=t.animations;if(a!=null)for(let n=0;n<a.length;n++){const i=a[n];if(i!=null){for(const s of i.values())if(!s.executed&&(s.executed=!0,s.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,a,n){let i=this.layers[e];i==null&&(i=this.layers[e]={animations:new Array});let s=i.animations[t];s==null&&(s=i.animations[t]=new Map);let o={id:a,priority:t,executed:!1,function:n};s.set(a,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let a=0;a<this.layers.length;a++){let n=this.layers[a];if(n==null)continue;let i=n.animations[e];if(i==null)return;let s=i.get(t);if(s==null||s.executed==!1)return;i.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const we=new Li;function Va(r){return Object.prototype.toString.call(r)==="[object Date]"}function wr(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const a=e.map((n,i)=>wr(r[i],n));return n=>a.map(i=>i(n))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(Va(r)&&Va(e)){const i=r.getTime(),o=e.getTime()-i;return l=>new Date(i+l*o)}const a=Object.keys(e),n={};return a.forEach(i=>{n[i]=wr(r[i],e[i])}),i=>{const s={};return a.forEach(o=>{s[o]=n[o](i)}),s}}if(t==="number"){const a=e-r;return n=>r+n*a}return()=>e}const $r=class $r{constructor(e,t={}){F(this,he);F(this,st);F(this,Ct);F(this,Ze,null);V(this,he,Y(e)),V(this,st,Y(e)),V(this,Ct,t)}static of(e,t){const a=new $r(e(),t);return xa(()=>{a.set(e())}),a}set(e,t){var f;U(w(this,st),e);let{delay:a=0,duration:n=400,easing:i=zi,interpolate:s=wr}={...w(this,Ct),...t};if(n===0)return(f=w(this,Ze))==null||f.abort(),U(w(this,he),e),Promise.resolve();const o=ce.now()+a;let l,u=!1,c=w(this,Ze);return V(this,Ze,ki(h=>{if(h<o)return!0;if(!u){u=!0;const b=w(this,he).v;l=s(b,e),typeof n=="function"&&(n=n(b,e)),c==null||c.abort()}const y=h-o;return y>n?(U(w(this,he),e),!1):(U(w(this,he),l(i(y/n))),!0)})),w(this,Ze).promise}get current(){return j(w(this,he))}get target(){return j(w(this,st))}set target(e){this.set(e)}};he=new WeakMap,st=new WeakMap,Ct=new WeakMap,Ze=new WeakMap;let br=$r;class Vt{constructor(e,t){p(this,"value");p(this,"motion");this.value=e,this.motion=new br(e,t)}set(e,t){this.value=e,this.motion.set(e,t)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Ri=Oa('<div><div class="body svelte-1nfn9j8"></div></div>');function Pi(r,e){lr(e,!0);let t,a;function n(){return a}let i=Y(!1);function s(C){U(i,C,!0)}function o(){return j(i)}let l=new Vt(0,{easing:xr});pe(()=>{u(l.motion.current)}),pe(()=>{j(i)==!1&&(l.snap(),we.clear(e.priority,e.id))});function u(C){t&&we.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=C.toString(),t.style.filter=`brightness(${.25+.75*C})`,a.style.opacity=C.toString()})}function c(C){C!=l.value&&l.set(C,{duration:75})}function f(){return l.motion.current==0}function h(){return l.value}var y=Ri();let b,R;var P=yr(y);let ae;return He(P,C=>a=C,()=>a),He(y,C=>t=C,()=>t),wa((C,W,ne)=>{b=Da(y,1,"pin svelte-1nfn9j8",null,b,C),R=Bt(y,"",R,W),ae=Bt(P,"",ae,ne)},[()=>({displayed:j(i)}),()=>({width:`${e.width}px`,height:`${e.height}px`,"border-radius":`${e.radius}px`}),()=>({width:`${e.width-4}px`,height:`${e.height-4}px`,"border-radius":`${e.radius-2}px`})]),ja(r,y),ur({getBody:n,setDisplayed:s,getDisplayed:o,setScale:c,getCollapsed:f,getScale:h})}var gt;(r=>{function e(t,a,n){const i=t/2,s=a/2,o=Math.sqrt(i*i+s*s),l=Math.atan(s/i)*(180/Math.PI),u=n*(Math.PI/180);return n<180?n<90?n<l?{x:0,y:o*Math.sin(u)-s}:{x:o*Math.cos(u)-i,y:0}:n<180-l?{x:o*Math.cos(u)-i,y:0}:{x:-t,y:o*Math.sin(u)-s}:n<270?n<180+l?{x:-t,y:o*Math.sin(u)-s}:{x:o*Math.cos(u)-i,y:-a}:n<360-l?{x:o*Math.cos(u)-i,y:-a}:{x:0,y:o*Math.sin(u)-s}}r.getOffsets=e})(gt||(gt={}));var Oi=Oa('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function Ua(r,e){lr(e,!0);let t,a,n,i;const s=e.width+2*e.margin,o=e.height+2*e.margin,l=()=>i;pe(()=>{n.style.width=`${e.margin*4}px`,n.style.height=`${e.margin*4}px`});let u=Y(!0);function c(L){U(u,L,!0)}function f(){return j(u)}let h=Y(!0);function y(L){U(h,L,!0)}function b(){return P.motion.current==0}function R(){return P.motion.current==1}let P=new Vt(0);pe(()=>{ae(P.motion.current)}),pe(()=>{j(u)==!1&&(P.snap(),we.clear(e.priority,e.id+"_scale"))}),pe(()=>{j(h)==!0&&P.value!=0&&(we.stacked()?P.set(0,{duration:0}):P.set(0,{duration:150,easing:Mi})),j(h)==!1&&P.value!=1&&P.set(1,{duration:150,easing:Ei})});function ae(L){!t||!a||!n||we.equeue(j(h)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${L}`,a.style.scale=`${L}`,n.style.scale=`${L}`})}let C=NaN,W=Y(!1),ne=new Vt(-s/2,{easing:xr}),Jt=new Vt(-o/2,{easing:xr});pe(()=>{dn(ne.motion.current,Jt.motion.current)}),pe(()=>{j(u)==!1&&(ne.snap(),ne.snap(),we.clear(e.priority,e.id+"_angle"))}),pe(()=>{j(h)==!0&&j(W)&&(ne.update({duration:75}),ne.update({duration:75}))});function dn(L,me){if(!t||!a||!n)return;const Qt=L+s/2,Tt=me+o/2,ut=o<s?Qt*o/s:Qt,Hr=o>s?Tt*s/o:Tt,Ts=Math.atan2(Hr,ut)/Math.PI*180-45,mn=0,As=30,Yr=Math.sqrt(ut*ut+Hr*Hr),At=Math.min(s,o)/2,Ns=At*Math.SQRT2,Ls=(Yr-At)/(Ns-At),yn=mn+Ls*(As-mn),Rs=Yr<At?Yr/At:1;we.equeue(e.layer,e.priority,e.id+"_angle",()=>{a.style.transform=`translate(${Math.round(L)}px, ${Math.round(me)}px)`,n.style.transform=`scale(${Rs}) rotate(${Ts}deg) skew(${yn}deg, ${yn}deg)`})}function Es(L){if(j(W)==!1){let me=gt.getOffsets(s,o,L);ne.set(Math.round(me.x),{duration:0}),Jt.set(Math.round(me.y),{duration:0}),dn(ne.value,Jt.value),C=L,U(W,!0)}else if(L!=C){let me=Math.abs(L-C),Qt=me<180?me:360-me,Tt=Math.log(Qt)*75,ut=gt.getOffsets(s,o,L);ne.set(Math.round(ut.x),{duration:Tt}),Jt.set(Math.round(ut.y),{duration:Tt}),C=L}}function Cs(){return gt.getOffsets(s,o,C)}var Kt=Oi();let pn;var fn=yr(Kt);He(fn,L=>n=L,()=>n);var Wr=Jn(fn,2),hn=yr(Wr);return He(hn,L=>i=L,()=>i),He(Wr,L=>a=L,()=>a),He(Kt,L=>t=L,()=>t),wa(L=>{pn=Da(Kt,1,"anchor svelte-j5igi2",null,pn,L),Bt(Wr,`margin: ${e.margin}px;`),Bt(hn,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)},[()=>({displayed:j(u)})]),ja(r,Kt),ur({getBody:l,setDisplayed:c,getDisplayed:f,setCollapsed:y,getCollapsed:b,getExpanded:R,setAngle:Es,getOffsets:Cs})}var Ye;(r=>{function e(o,l,u){return{x:a(l)*u,y:n(o)*u}}r.project=e;function t(o,l,u){return{lat:s(l/u),lng:i(o/u)}}r.unproject=t;function a(o){return(180+o)/360}function n(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function i(o){return o*360-180}function s(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})(Ye||(Ye={}));class qa{constructor(e,t,a,n,i){p(this,"swLat");p(this,"swLng");p(this,"neLat");p(this,"neLng");const s=a*Math.pow(2,t),o=Ye.project(e.sw.lat,e.sw.lng,s),l=Ye.project(e.ne.lat,e.ne.lng,s),u=o.x-n,c=o.y+i,f=l.x+n,h=l.y-i,y=Ye.unproject(u,c,s),b=Ye.unproject(f,h,s);this.swLat=y.lat,this.swLng=y.lng,this.neLat=b.lat,this.neLng=b.lng}contains(e,t){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1}}var E;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const i={};for(const s of n)i[s]=s;return i},r.getValidEnumValues=n=>{const i=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),s={};for(const o of i)s[o]=n[o];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(i){return n[i]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},r.find=(n,i)=>{for(const s of n)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}r.joinValues=a,r.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(E||(E={}));var $a;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})($a||($a={}));const g=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),be=r=>{switch(typeof r){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(r)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":return Array.isArray(r)?g.array:r===null?g.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?g.promise:typeof Map<"u"&&r instanceof Map?g.map:typeof Set<"u"&&r instanceof Set?g.set:typeof Date<"u"&&r instanceof Date?g.date:g.object;default:return g.unknown}},d=E.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class re extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},a={_errors:[]},n=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)a._errors.push(t(s));else{let o=a,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return n(this),a}static assert(e){if(!(e instanceof re))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}re.create=r=>new re(r);const vt=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===g.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,E.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${E.joinValues(r.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${E.joinValues(r.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${E.joinValues(r.options)}, received '${r.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:E.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case d.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case d.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,E.assertNever(r)}return{message:t}};let ji=vt;function kr(){return ji}const Sr=r=>{const{data:e,path:t,errorMaps:a,issueData:n}=r,i=[...t,...n.path||[]],s={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let o="";const l=a.filter(u=>!!u).slice().reverse();for(const u of l)o=u(s,{data:e,defaultError:o}).message;return{...n,path:i,message:o}};function m(r,e){const t=kr(),a=Sr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===vt?void 0:vt].filter(n=>!!n)});r.common.issues.push(a)}class K{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if(n.status==="aborted")return _;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const n of t){const i=await n.key,s=await n.value;a.push({key:i,value:s})}return K.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:i,value:s}=n;if(i.status==="aborted"||s.status==="aborted")return _;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(a[i.value]=s.value)}return{status:e.value,value:a}}}const _=Object.freeze({status:"aborted"}),_t=r=>({status:"dirty",value:r}),G=r=>({status:"valid",value:r}),Wa=r=>r.status==="aborted",Ha=r=>r.status==="dirty",Ge=r=>r.status==="valid",Ut=r=>typeof Promise<"u"&&r instanceof Promise;var v;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(v||(v={}));class ke{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ya=(r,e)=>{if(Ge(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new re(r.common.issues);return this._error=t,this._error}}};function k(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:n}=r;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,o)=>{const{message:l}=r;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??a??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:n}}class M{get description(){return this._def.description}_getType(e){return be(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new K,ctx:{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ut(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Ya(a,n)}"~validate"(e){var a,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return Ge(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(n=(a=i==null?void 0:i.message)==null?void 0:a.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>Ge(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},n=this._parse({data:e,path:a.path,parent:a}),i=await(Ut(n)?n:Promise.resolve(n));return Ya(a,i)}refine(e,t){const a=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,i)=>{const s=e(n),o=()=>i.addIssue({code:d.custom,...a(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((a,n)=>e(a)?!0:(n.addIssue(typeof t=="function"?t(a,n):t),!1))}_refinement(e){return new et({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Me.create(this,this._def)}nullable(){return tt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return kt.create(this,this._def)}or(e){return $t.create([this,e],this._def)}and(e){return Wt.create(this,e,this._def)}transform(e){return new et({...k(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ar({...k(this._def),innerType:this,defaultValue:t,typeName:x.ZodDefault})}brand(){return new is({typeName:x.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Nr({...k(this._def),innerType:this,catchValue:t,typeName:x.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Lr.create(this,e)}readonly(){return Rr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ii=/^c[^\s-]{8,}$/i,Zi=/^[0-9a-z]+$/,Di=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Fi=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Bi=/^[a-z0-9_-]{21}$/i,Vi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ui=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$i="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let zr;const Wi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Yi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Gi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ji=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ga="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ki=new RegExp(`^${Ga}$`);function Xa(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Qi(r){return new RegExp(`^${Xa(r)}$`)}function es(r){let e=`${Ga}T${Xa(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ts(r,e){return!!((e==="v4"||!e)&&Wi.test(r)||(e==="v6"||!e)&&Yi.test(r))}function rs(r,e){if(!Vi.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(a));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function as(r,e){return!!((e==="v4"||!e)&&Hi.test(r)||(e==="v6"||!e)&&Gi.test(r))}class Se extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){const i=this._getOrReturnCtx(e);return m(i,{code:d.invalid_type,expected:g.string,received:i.parsedType}),_}const a=new K;let n;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(n=this._getOrReturnCtx(e,n),s?m(n,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&m(n,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")qi.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"email",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")zr||(zr=new RegExp($i,"u")),zr.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"emoji",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")Fi.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"uuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")Bi.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"nanoid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Ii.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"cuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")Zi.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"cuid2",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")Di.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"ulid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),m(n,{validation:"url",code:d.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"regex",code:d.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),m(n,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),m(n,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),m(n,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?es(i).test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:d.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?Ki.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:d.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?Qi(i).test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:d.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?Ui.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"duration",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?ts(e.data,i.version)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"ip",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="jwt"?rs(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"jwt",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="cidr"?as(e.data,i.version)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"cidr",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?Xi.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"base64",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64url"?Ji.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"base64url",code:d.invalid_string,message:i.message}),a.dirty()):E.assertNever(i);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(n=>e.test(n),{validation:t,code:d.invalid_string,...v.errToObj(a)})}_addCheck(e){return new Se({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...v.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...v.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...v.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new Se({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Se({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Se({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Se.create=r=>new Se({checks:[],typeName:x.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...k(r)});function ns(r,e){const t=(r.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=t>a?t:a,i=Number.parseInt(r.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return i%s/10**n}class Xe extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){const i=this._getOrReturnCtx(e);return m(i,{code:d.invalid_type,expected:g.number,received:i.parsedType}),_}let a;const n=new K;for(const i of this._def.checks)i.kind==="int"?E.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?ns(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),m(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{code:d.not_finite,message:i.message}),n.dirty()):E.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,a,n){return new Xe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:v.toString(n)}]})}_addCheck(e){return new Xe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&E.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Xe.create=r=>new Xe({checks:[],typeName:x.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class xt extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let a;const n=new K;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),m(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):E.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return m(t,{code:d.invalid_type,expected:g.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,a,n){return new xt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:v.toString(n)}]})}_addCheck(e){return new xt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}xt.create=r=>new xt({checks:[],typeName:x.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...k(r)});class Mr extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){const a=this._getOrReturnCtx(e);return m(a,{code:d.invalid_type,expected:g.boolean,received:a.parsedType}),_}return G(e.data)}}Mr.create=r=>new Mr({typeName:x.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class qt extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){const i=this._getOrReturnCtx(e);return m(i,{code:d.invalid_type,expected:g.date,received:i.parsedType}),_}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return m(i,{code:d.invalid_date}),_}const a=new K;let n;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):E.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}qt.create=r=>new qt({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:x.ZodDate,...k(r)});class Ja extends M{_parse(e){if(this._getType(e)!==g.symbol){const a=this._getOrReturnCtx(e);return m(a,{code:d.invalid_type,expected:g.symbol,received:a.parsedType}),_}return G(e.data)}}Ja.create=r=>new Ja({typeName:x.ZodSymbol,...k(r)});class Ka extends M{_parse(e){if(this._getType(e)!==g.undefined){const a=this._getOrReturnCtx(e);return m(a,{code:d.invalid_type,expected:g.undefined,received:a.parsedType}),_}return G(e.data)}}Ka.create=r=>new Ka({typeName:x.ZodUndefined,...k(r)});class Qa extends M{_parse(e){if(this._getType(e)!==g.null){const a=this._getOrReturnCtx(e);return m(a,{code:d.invalid_type,expected:g.null,received:a.parsedType}),_}return G(e.data)}}Qa.create=r=>new Qa({typeName:x.ZodNull,...k(r)});class Er extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return G(e.data)}}Er.create=r=>new Er({typeName:x.ZodAny,...k(r)});class Je extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return G(e.data)}}Je.create=r=>new Je({typeName:x.ZodUnknown,...k(r)});class ze extends M{_parse(e){const t=this._getOrReturnCtx(e);return m(t,{code:d.invalid_type,expected:g.never,received:t.parsedType}),_}}ze.create=r=>new ze({typeName:x.ZodNever,...k(r)});class Cr extends M{_parse(e){if(this._getType(e)!==g.undefined){const a=this._getOrReturnCtx(e);return m(a,{code:d.invalid_type,expected:g.void,received:a.parsedType}),_}return G(e.data)}}Cr.create=r=>new Cr({typeName:x.ZodVoid,...k(r)});class de extends M{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==g.array)return m(t,{code:d.invalid_type,expected:g.array,received:t.parsedType}),_;if(n.exactLength!==null){const s=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(s||o)&&(m(t,{code:s?d.too_big:d.too_small,minimum:o?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(m(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(m(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>n.type._parseAsync(new ke(t,s,t.path,o)))).then(s=>K.mergeArray(a,s));const i=[...t.data].map((s,o)=>n.type._parseSync(new ke(t,s,t.path,o)));return K.mergeArray(a,i)}get element(){return this._def.type}min(e,t){return new de({...this._def,minLength:{value:e,message:v.toString(t)}})}max(e,t){return new de({...this._def,maxLength:{value:e,message:v.toString(t)}})}length(e,t){return new de({...this._def,exactLength:{value:e,message:v.toString(t)}})}nonempty(e){return this.min(1,e)}}de.create=(r,e)=>new de({type:r,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...k(e)});function Ke(r){if(r instanceof I){const e={};for(const t in r.shape){const a=r.shape[t];e[t]=Me.create(Ke(a))}return new I({...r._def,shape:()=>e})}else return r instanceof de?new de({...r._def,type:Ke(r.element)}):r instanceof Me?Me.create(Ke(r.unwrap())):r instanceof tt?tt.create(Ke(r.unwrap())):r instanceof fe?fe.create(r.items.map(e=>Ke(e))):r}class I extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=E.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==g.object){const u=this._getOrReturnCtx(e);return m(u,{code:d.invalid_type,expected:g.object,received:u.parsedType}),_}const{status:a,ctx:n}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(const u in n.data)s.includes(u)||o.push(u);const l=[];for(const u of s){const c=i[u],f=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ke(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof ze){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(u==="strict")o.length>0&&(m(n,{code:d.unrecognized_keys,keys:o}),a.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of o){const f=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ke(n,f,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const f=await c.key,h=await c.value;u.push({key:f,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>K.mergeObjectSync(a,u)):K.mergeObjectSync(a,l)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new I({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var i,s;const n=((s=(i=this._def).errorMap)==null?void 0:s.call(i,t,a).message)??a.defaultError;return t.code==="unrecognized_keys"?{message:v.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new I({...this._def,unknownKeys:"strip"})}passthrough(){return new I({...this._def,unknownKeys:"passthrough"})}extend(e){return new I({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new I({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new I({...this._def,catchall:e})}pick(e){const t={};for(const a of E.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new I({...this._def,shape:()=>t})}omit(e){const t={};for(const a of E.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new I({...this._def,shape:()=>t})}deepPartial(){return Ke(this)}partial(e){const t={};for(const a of E.objectKeys(this.shape)){const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new I({...this._def,shape:()=>t})}required(e){const t={};for(const a of E.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof Me;)i=i._def.innerType;t[a]=i}return new I({...this._def,shape:()=>t})}keyof(){return an(E.objectKeys(this.shape))}}I.create=(r,e)=>new I({shape:()=>r,unknownKeys:"strip",catchall:ze.create(),typeName:x.ZodObject,...k(e)}),I.strictCreate=(r,e)=>new I({shape:()=>r,unknownKeys:"strict",catchall:ze.create(),typeName:x.ZodObject,...k(e)}),I.lazycreate=(r,e)=>new I({shape:r,unknownKeys:"strip",catchall:ze.create(),typeName:x.ZodObject,...k(e)});class $t extends M{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function n(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(o=>new re(o.ctx.common.issues));return m(t,{code:d.invalid_union,unionErrors:s}),_}if(t.common.async)return Promise.all(a.map(async i=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let i;const s=[];for(const l of a){const u={...t,common:{...t.common,issues:[]},parent:null},c=l._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const o=s.map(l=>new re(l));return m(t,{code:d.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}$t.create=(r,e)=>new $t({options:r,typeName:x.ZodUnion,...k(e)});function Tr(r,e){const t=be(r),a=be(e);if(r===e)return{valid:!0,data:r};if(t===g.object&&a===g.object){const n=E.objectKeys(e),i=E.objectKeys(r).filter(o=>n.indexOf(o)!==-1),s={...r,...e};for(const o of i){const l=Tr(r[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(t===g.array&&a===g.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let i=0;i<r.length;i++){const s=r[i],o=e[i],l=Tr(s,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return t===g.date&&a===g.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Wt extends M{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(i,s)=>{if(Wa(i)||Wa(s))return _;const o=Tr(i.value,s.value);return o.valid?((Ha(i)||Ha(s))&&t.dirty(),{status:t.value,value:o.data}):(m(a,{code:d.invalid_intersection_types}),_)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,s])=>n(i,s)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Wt.create=(r,e,t)=>new Wt({left:r,right:e,typeName:x.ZodIntersection,...k(t)});class fe extends M{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.array)return m(a,{code:d.invalid_type,expected:g.array,received:a.parsedType}),_;if(a.data.length<this._def.items.length)return m(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&a.data.length>this._def.items.length&&(m(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...a.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new ke(a,s,a.path,o)):null}).filter(s=>!!s);return a.common.async?Promise.all(i).then(s=>K.mergeArray(t,s)):K.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new fe({...this._def,rest:e})}}fe.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:r,typeName:x.ZodTuple,rest:null,...k(e)})};class en extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.map)return m(a,{code:d.invalid_type,expected:g.map,received:a.parsedType}),_;const n=this._def.keyType,i=this._def.valueType,s=[...a.data.entries()].map(([o,l],u)=>({key:n._parse(new ke(a,o,a.path,[u,"key"])),value:i._parse(new ke(a,l,a.path,[u,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return _;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(u.value,c.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of s){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return _;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(u.value,c.value)}return{status:t.value,value:o}}}}en.create=(r,e,t)=>new en({valueType:e,keyType:r,typeName:x.ZodMap,...k(t)});class wt extends M{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.set)return m(a,{code:d.invalid_type,expected:g.set,received:a.parsedType}),_;const n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(m(a,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(m(a,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function s(l){const u=new Set;for(const c of l){if(c.status==="aborted")return _;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const o=[...a.data.values()].map((l,u)=>i._parse(new ke(a,l,a.path,u)));return a.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,t){return new wt({...this._def,minSize:{value:e,message:v.toString(t)}})}max(e,t){return new wt({...this._def,maxSize:{value:e,message:v.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}wt.create=(r,e)=>new wt({valueType:r,minSize:null,maxSize:null,typeName:x.ZodSet,...k(e)});class bt extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.function)return m(t,{code:d.invalid_type,expected:g.function,received:t.parsedType}),_;function a(o,l){return Sr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kr(),vt].filter(u=>!!u),issueData:{code:d.invalid_arguments,argumentsError:l}})}function n(o,l){return Sr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kr(),vt].filter(u=>!!u),issueData:{code:d.invalid_return_type,returnTypeError:l}})}const i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof kt){const o=this;return G(async function(...l){const u=new re([]),c=await o._def.args.parseAsync(l,i).catch(y=>{throw u.addIssue(a(l,y)),u}),f=await Reflect.apply(s,this,c);return await o._def.returns._def.type.parseAsync(f,i).catch(y=>{throw u.addIssue(n(f,y)),u})})}else{const o=this;return G(function(...l){const u=o._def.args.safeParse(l,i);if(!u.success)throw new re([a(l,u.error)]);const c=Reflect.apply(s,this,u.data),f=o._def.returns.safeParse(c,i);if(!f.success)throw new re([n(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new bt({...this._def,args:fe.create(e).rest(Je.create())})}returns(e){return new bt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new bt({args:e||fe.create([]).rest(Je.create()),returns:t||Je.create(),typeName:x.ZodFunction,...k(a)})}}class tn extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}tn.create=(r,e)=>new tn({getter:r,typeName:x.ZodLazy,...k(e)});class rn extends M{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return m(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}rn.create=(r,e)=>new rn({value:r,typeName:x.ZodLiteral,...k(e)});function an(r,e){return new Qe({values:r,typeName:x.ZodEnum,...k(e)})}class Qe extends M{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return m(t,{expected:E.joinValues(a),received:t.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return m(t,{received:t.data,code:d.invalid_enum_value,options:a}),_}return G(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Qe.create(e,{...this._def,...t})}exclude(e,t=this._def){return Qe.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}Qe.create=an;class nn extends M{_parse(e){const t=E.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==g.string&&a.parsedType!==g.number){const n=E.objectValues(t);return m(a,{expected:E.joinValues(n),received:a.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(E.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=E.objectValues(t);return m(a,{received:a.data,code:d.invalid_enum_value,options:n}),_}return G(e.data)}get enum(){return this._def.values}}nn.create=(r,e)=>new nn({values:r,typeName:x.ZodNativeEnum,...k(e)});class kt extends M{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.promise&&t.common.async===!1)return m(t,{code:d.invalid_type,expected:g.promise,received:t.parsedType}),_;const a=t.parsedType===g.promise?t.data:Promise.resolve(t.data);return G(a.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}kt.create=(r,e)=>new kt({type:r,typeName:x.ZodPromise,...k(e)});class et extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:s=>{m(a,s),s.fatal?t.abort():t.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const s=n.transform(a.data,i);if(a.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?_t(l.value):l});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:s,path:a.path,parent:a});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?_t(o.value):o}}if(n.type==="refinement"){const s=o=>{const l=n.refinement(o,i);if(a.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(a.common.async===!1){const s=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ge(s))return _;const o=n.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(s=>Ge(s)?Promise.resolve(n.transform(s.value,i)).then(o=>({status:t.value,value:o})):_);E.assertNever(n)}}et.create=(r,e,t)=>new et({schema:r,typeName:x.ZodEffects,effect:e,...k(t)}),et.createWithPreprocess=(r,e,t)=>new et({schema:e,effect:{type:"preprocess",transform:r},typeName:x.ZodEffects,...k(t)});class Me extends M{_parse(e){return this._getType(e)===g.undefined?G(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(r,e)=>new Me({innerType:r,typeName:x.ZodOptional,...k(e)});class tt extends M{_parse(e){return this._getType(e)===g.null?G(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tt.create=(r,e)=>new tt({innerType:r,typeName:x.ZodNullable,...k(e)});class Ar extends M{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===g.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ar.create=(r,e)=>new Ar({innerType:r,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class Nr extends M{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Ut(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new re(a.common.issues)},input:a.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new re(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Nr.create=(r,e)=>new Nr({innerType:r,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class sn extends M{_parse(e){if(this._getType(e)!==g.nan){const a=this._getOrReturnCtx(e);return m(a,{code:d.invalid_type,expected:g.nan,received:a.parsedType}),_}return{status:"valid",value:e.data}}}sn.create=r=>new sn({typeName:x.ZodNaN,...k(r)});class is extends M{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Lr extends M{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?_:i.status==="dirty"?(t.dirty(),_t(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?_:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,t){return new Lr({in:e,out:t,typeName:x.ZodPipeline})}}class Rr extends M{_parse(e){const t=this._def.innerType._parse(e),a=n=>(Ge(n)&&(n.value=Object.freeze(n.value)),n);return Ut(t)?t.then(n=>a(n)):a(t)}unwrap(){return this._def.innerType}}Rr.create=(r,e)=>new Rr({innerType:r,typeName:x.ZodReadonly,...k(e)});var x;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(x||(x={}));const Pr=Se.create,A=Xe.create,Or=Mr.create,on=Er.create;Je.create,ze.create;const Ht=Cr.create,ss=de.create,Z=I.create;$t.create,Wt.create,fe.create;const se=bt.create;Qe.create;const os=kt.create;Me.create,tt.create,Z({pin:Z({fade:Or().optional(),maxCount:A().optional(),maxZoom:A().optional()}).optional(),animation:Z({queue:Z({limit:A().optional()}).optional()}).optional(),api:Z({states:Z({url:Pr(),singleRequest:Or().optional()}).optional()}).optional()});const jr=A().min(-90).max(90),Ir=A().min(-180).max(180),ls=Z({sw:Z({lat:jr,lng:Ir}),ne:Z({lat:jr,lng:Ir})}),Zr=on().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),us=Z({mapSize:A().min(1),zoomMin:A().min(0),zoomMax:A().min(0),zoomScale:A().min(1).max(10)}),cs=Z({instance:on(),inserted:se().returns(Or()),insert:se().returns(Ht()),remove:se().returns(Ht()),update:se().args(A()).returns(Ht())}),ds=Z({getParameters:se().args().returns(us),getContainer:se().args().returns(Zr),getZoom:se().args().returns(A()),getBounds:se().args().returns(ls),panBy:se().args(A(),A()).returns(Ht()),createMarker:se().args(Zr,jr,Ir,A()).returns(cs)}),Dr=se().args(Pr()).returns(os(Zr)),ps=Z({id:Pr().min(1),rank:A(),lat:A().min(-90).max(90),lng:A().min(-180).max(180),tooltip:Z({style:Z({width:A(),height:A(),margin:A(),radius:A()}).refine(r=>Math.min(r.width,r.height)/r.margin>=5,"Tooltip width and height must be at least 5 times the margin"),body:Dr}),pin:Z({style:Z({width:A(),height:A(),radius:A()}),body:Dr}).optional(),popup:Z({style:Z({width:A(),height:A(),radius:A(),margin:A()}),body:Dr}).optional()}),fs=ss(ps);var Oe;(r=>{r.COUNT=12,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],r.DEGREES_DEFAULT=270})(Oe||(Oe={}));const ln="1.0.199",un="https://maps.api.arenarium.dev",hs=`${un}/log`,ms=`${un}/tooltip/states`;class ys{constructor(e,t,a){p(this,"apiKey");p(this,"apiStatesUrl");p(this,"apiStatesSingleRequest",!1);p(this,"mapProvider");p(this,"markerDataArray",new Array);p(this,"markerDataMap",new Map);p(this,"markerDataUpdating",!1);p(this,"markerPinProcessor");p(this,"markerTooltipProcessor");p(this,"markerPopupProcessor");ds.parse(t),this.apiKey=e,this.mapProvider=t,this.markerPinProcessor=new Vr(t),this.markerTooltipProcessor=new vs(t),this.markerPopupProcessor=new _s(t),this.configuration=a,this.log("info","Loaded")}set configuration(e){var t,a,n,i,s,o;this.markerPinProcessor.setConfiguration(e),this.apiStatesUrl=((a=(t=e==null?void 0:e.api)==null?void 0:t.states)==null?void 0:a.url)??void 0,this.apiStatesSingleRequest=((i=(n=e==null?void 0:e.api)==null?void 0:n.states)==null?void 0:i.singleRequest)??!1,we.setLimit(((o=(s=e==null?void 0:e.animation)==null?void 0:s.queue)==null?void 0:o.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(e){fs.parse(e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const a of this.markerDataArray)this.markerPopupProcessor.hide(a);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const a of this.markerDataArray)this.markerPopupProcessor.hide(a);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}async updateMarkerData(e){try{let t=this.markerDataArray.map(n=>n.marker);for(let n=0;n<e.length;n++){const i=e[n];this.markerDataMap.get(i.id)||t.push(i)}let a;if(e.length>1){const n=this.mapProvider.getParameters(),i=t.map(u=>({id:u.id,rank:u.rank,lat:u.lat,lng:u.lng,width:u.tooltip.style.width,height:u.tooltip.style.height,margin:u.tooltip.style.margin})),s={key:this.apiKey,parameters:n,input:i},o=this.apiStatesUrl??ms,l=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!l.ok||!l.body)throw new Error("Failed to get marker states: "+l.statusText);a=await l.json()}else a=[[0,[[0,Oe.DEGREES.indexOf(Oe.DEGREES_DEFAULT)]]]];try{this.markerDataUpdating=!0;for(let n=0;n<t.length;n++){const i=t[n],s=a[n],o=this.markerDataMap.get(i.id);if(o)o.update(s);else{const l=new gs(this.mapProvider,i,s);l.create(),this.markerDataMap.set(i.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((n,i)=>n.zoom-i.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(n=>n.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(n=>n.tooltip))}finally{this.markerDataUpdating=!1}}catch(t){throw console.error(t),this.markerDataArray.forEach(a=>a.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),t instanceof Error&&this.log("error","Failed to update marker data",t),t}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.clear(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),t=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,a){if(!(window!=null&&window.location.host.startsWith("localhost")||window!=null&&window.location.host.startsWith("127.0.0.1")))try{const n={title:`[CLIENT:${ln}] ${t}`,level:e,content:{version:ln,...a}};await fetch(hs,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(n){console.error(n)}}}class gs{constructor(e,t,a){p(this,"marker");p(this,"zoom");p(this,"pin");p(this,"tooltip");this.marker=t,this.zoom=a[0],this.pin=new Br(e,t,a),this.tooltip=new Ur(e,t,a)}create(){this.pin.create(),this.tooltip.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove()}}class Fr{constructor(e,t){p(this,"provider");p(this,"id");p(this,"lat");p(this,"lng");p(this,"shown");p(this,"element");p(this,"component");p(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,a=this.component;if(t==null||a==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e,t;(e=this.marker)==null||e.remove(),(t=this.element)==null||t.remove()}}const ot=class ot extends Fr{constructor(t,a,n){var i,s,o,l;super(t,a);p(this,"width");p(this,"height");p(this,"radius");p(this,"zoom");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=((i=a.pin)==null?void 0:i.style.width)??ot.DEFAULT_SIZE,this.height=((s=a.pin)==null?void 0:s.style.height)??ot.DEFAULT_SIZE,this.radius=((o=a.pin)==null?void 0:o.style.radius)??ot.DEFAULT_SIZE,this.zoom=n[0],this.bodyCallback=(l=a.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=gr(Pi,{target:this.element,props:{id:this.id+"_pin",layer:Ni,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update pin state");this.component.setScale(this.getScale(t))}updateBody(){var a;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load pin body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setScale(t?0:1)}getScale(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};p(ot,"DEFAULT_SIZE",16);let Br=ot;const lt=class lt{constructor(e){p(this,"provider");p(this,"pinElements",new Array);p(this,"pinMaxWidth",0);p(this,"pinMaxHeight",0);p(this,"pinFade",!1);p(this,"pinMaxCount",0);p(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,a,n;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((a=e==null?void 0:e.pin)==null?void 0:a.maxCount)??Math.max(lt.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((n=e==null?void 0:e.pin)==null?void 0:n.maxZoom)??lt.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,a)=>Math.max(t,a.width),0),this.pinMaxHeight=e.reduce((t,a)=>Math.max(t,a.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const a=this.provider.getParameters().mapSize,n=new qa(e,t,a,this.pinMaxWidth*2,this.pinMaxHeight*2);let i=0;for(const s of this.pinElements)n.contains(s.lat,s.lng)?s.shown&&t<s.zoom&&s.zoom<t+this.pinMaxZoomDelta?(i<this.pinMaxCount&&(this.pinFade==!0?s.updateState(t):s.setCollapsed(!1),s.updateMap(!0),s.isBodyLoaded()==!1&&s.updateBody()),i++):(s.setCollapsed(!0),s.isCollapsed()&&s.updateMap(!1)):s.updateMap(!1)}};p(lt,"MAP_PINS_MAX_ZOOM",2),p(lt,"MAP_PINS_MAX_COUNT",128);let Vr=lt;const Gt=class Gt extends Fr{constructor(t,a,n){super(t,a);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"zoom");p(this,"angle");p(this,"states");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=a.tooltip.style.width,this.height=a.tooltip.style.height,this.margin=a.tooltip.style.margin,this.radius=a.tooltip.style.radius,this.zoom=n[0],this.angle=Oe.DEGREES_DEFAULT,this.states=n[1].map(i=>[i[0],Oe.DEGREES[i[1]]]),this.bodyCallback=a.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=gr(Ua,{target:this.element,props:{id:this.id+"_tooltip",layer:Ai,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(a=>[a[0],Oe.DEGREES[a[1]]]),this.updateZIndex()}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var a;if(this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load tooltip body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const a=this.states.findLast(n=>n[0]<=t);if(!a)throw new Error("Angle not found");return a[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+Gt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};p(Gt,"Z_INDEX_OFFSET",1e6);let Ur=Gt;class vs{constructor(e){p(this,"provider");p(this,"tooltipElements",new Array);p(this,"tooltipMaxWidth",0);p(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,a)=>Math.max(t,a.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,a)=>Math.max(t,a.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const a=this.provider.getParameters().mapSize,n=new qa(e,t,a,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const i of this.tooltipElements)n.contains(i.lat,i.lng)?i.shown&&i.zoom<=t?(i.updateState(t),i.setCollapsed(!1),i.updateMap(!0),i.isCollapsed()==!1&&i.isBodyLoaded()==!1&&i.updateBody()):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}}const Xt=class Xt extends Fr{constructor(t,a){if(a.popup==null)throw new Error("Failed to create popup");super(t,a);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.shown=!1,this.width=a.popup.style.width,this.height=a.popup.style.height,this.margin=a.popup.style.margin,this.radius=a.popup.style.radius,this.bodyCallback=a.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=gr(Ua,{target:this.element,props:{id:this.id+"_popup",layer:Ti,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateBody(){var a;if(this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load popup body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Xt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(t)}setAngle(t){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};p(Xt,"Z_INDEX_OFFSET",2e6);let qr=Xt;class _s{constructor(e){p(this,"provider");p(this,"popupElements",new Map);p(this,"popupPositioned",new Map);this.provider=e}show(e){e.pin.shown=!1,e.tooltip.shown=!1;const t=new qr(this.provider,e.marker);this.popupElements.set(e.marker.id,t),this.popupPositioned.set(e.marker.id,!1),t.create(),t.setAngle(e.tooltip.angle),t.shown=!0}hide(e){e.pin.shown=!0,e.tooltip.shown=!0;const t=this.popupElements.get(e.marker.id);t!=null&&(t.shown=!1)}clear(){this.popupElements.values().forEach(e=>e.remove()),this.popupElements.clear(),this.popupPositioned.clear()}process(){var e,t;for(const a of this.popupElements.values())if(a.shown){if(a.setCollapsed(!1),a.updateMap(!0),a.isExpanded()&&a.isBodyLoaded()==!1&&a.updateBody(),a.isCollapsed()==!1&&this.popupPositioned.get(a.id)==!1){const n=(e=a.component)==null?void 0:e.getBody();if(n==null)continue;const i=(t=a.component)==null?void 0:t.getOffsets();if(i==null)continue;const s=n.getBoundingClientRect();if(s.x==0&&s.y==0&&s.width==0&&s.height==0)continue;const o=s.x+s.width/2,l=s.y+s.height/2,u=o+i.x,c=l+i.y,f=u+a.width,h=c+a.height,y=this.provider.getContainer().getBoundingClientRect(),b=u-y.left,R=y.right-f,P=c-y.top,ae=y.bottom-h,C=Math.min(a.width,a.height)/4,W=b<0?b-C:R<0?-R+C:0,ne=P<0?P-C:ae<0?-ae+C:0;this.provider.panBy(W,ne),this.popupPositioned.set(a.id,!0)}}else a.setCollapsed(!0),a.isCollapsed()&&(a.updateMap(!1),a.remove(),this.popupElements.delete(a.id),this.popupPositioned.delete(a.id))}}class xs{constructor(e,t,a){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...a,minZoom:Math.max(a.minZoom??0,0),maxZoom:Math.min(a.maxZoom??22,24),style:a.style??"https://tiles.openfreemap.org/styles/liberty",pitchWithRotate:!1,attributionControl:a.attributionControl??{compact:!1,customAttribution:"@arenarium/maps"}}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds(),t=e.getSouthWest(),a=e.getNorthEast();return{sw:t,ne:a}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,a){const n=new this.MapMarkerClass({element:e});return n.setLngLat([a,t]),{instance:n,inserted:()=>n._map!=null,insert:()=>n.addTo(this.map),remove:()=>n.remove(),update:i=>n.getElement().style.zIndex=i.toString()}}}const ws={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(120, 120, 120, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(128, 128, 128, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(56, 56, 56, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(153, 153, 153, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(104, 104, 104, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(56, 56, 56, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(136, 136, 136, 1)","fill-outline-color":"rgba(102, 102, 102, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(50, 50, 50, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(52, 52, 52, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(88, 88, 88, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20],"line-color":"rgba(102, 102, 102, 1)"}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23],"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(51, 51, 51, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(51, 51, 51, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(255, 255, 255, 1)","text-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]},bs={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(220, 220, 220, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(228, 228, 228, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(156, 156, 156, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(253, 253, 253, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(204, 204, 204, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(156, 156, 156, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(236, 236, 236, 1)","fill-outline-color":"rgba(202, 202, 202, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(185, 185, 185)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(150, 150, 150, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(152, 152, 152, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(188, 188, 188)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(185, 185, 185)","line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23]}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":2}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(151, 151, 151, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(151, 151, 151, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1.5}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(0, 0, 0, 1)","text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]};class ks{constructor(e,t,a){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...a,minZoom:Math.max(a.minZoom??0,0),maxZoom:Math.min(a.maxZoom??22,24),projection:"mercator",pitchWithRotate:!1,customAttribution:a.customAttribution??"@arenarium/maps"}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds();if(!e)return{sw:{lat:0,lng:0},ne:{lat:0,lng:0}};const t=e.getSouthWest(),a=e.getNorthEast();return{sw:t,ne:a}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,a){const n=new this.MapMarkerClass({element:e});return n.setLngLat([a,t]),{instance:n,inserted:()=>n._map!=null,insert:()=>n.addTo(this.map),remove:()=>n.remove(),update:i=>n.getElement().style.zIndex=i.toString()}}}class Ss{constructor(e,t,a,n){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");p(this,"options");this.MapClass=e,this.MapMarkerClass=t,this.options=n,this.map=new this.MapClass(a,{...n})}getParameters(){return{mapSize:256,zoomMin:this.options.minZoom??0,zoomMax:this.options.maxZoom??24,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getDiv()}getZoom(){return this.map.getZoom()??NaN}getBounds(){const e=this.map.getBounds();if(e==null)return{sw:{lat:NaN,lng:NaN},ne:{lat:NaN,lng:NaN}};const t=e.getSouthWest(),a=e.getNorthEast();return{sw:{lat:t.lat(),lng:t.lng()},ne:{lat:a.lat(),lng:a.lng()}}}panBy(e,t){this.map.panBy(e,t)}createMarker(e,t,a,n){const i=new this.MapMarkerClass({position:{lat:t,lng:a},content:e,zIndex:n});return{instance:i,inserted:()=>i.map!=null&&i.map==this.map,insert:()=>i.map=this.map,remove:()=>i.map=void 0,update:s=>i.zIndex=s}}}const zs=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100},{lightness:-10}]},{featureType:"landscape",stylers:[{lightness:30}]},{featureType:"road",elementType:"geometry",stylers:[{saturation:-100}]}],Ms=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100}]},{elementType:"geometry",stylers:[{lightness:-45}]},{elementType:"labels.text.fill",stylers:[{lightness:-100}]},{elementType:"labels.text.stroke",stylers:[{lightness:-15}]},{featureType:"water",elementType:"geometry",stylers:[{lightness:-50}]}];S.GoogleMapDarkStyle=Ms,S.GoogleMapLightStyle=zs,S.GoogleMapsProvider=Ss,S.MapManager=ys,S.MapboxProvider=ks,S.MaplibreDarkStyle=ws,S.MaplibreLightStyle=bs,S.MaplibreProvider=xs,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});