@arenarium/maps 1.0.190 → 1.0.192
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 +1 -1
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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://arenarium.dev/api/public/v1",Po=`${Aa}/log`,Io=`${Aa}/tooltip/states`,Ca="1.0.189";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"})});
|
|
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"})});
|
package/dist/main.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var ri=Object.defineProperty;var We=e=>{throw TypeError(e)};var ii=(e,t,r)=>t in e?ri(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var f=(e,t,r)=>ii(e,typeof t!="symbol"?t+"":t,r),he=(e,t,r)=>t.has(e)||We("Cannot "+r);var v=(e,t,r)=>(he(e,t,"read from private field"),r?r.call(e):t.get(e)),k=(e,t,r)=>t.has(e)?We("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),S=(e,t,r,i)=>(he(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),nt=(e,t,r)=>(he(e,t,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./states-C618H9PS.cjs"),fr=!1;var hr=Array.isArray,ni=Array.prototype.indexOf,si=Array.from,ve=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,ai=Object.prototype,oi=Array.prototype,li=Object.getPrototypeOf,Ve=Object.isExtensible;function ui(e){for(var t=0;t<e.length;t++)e[t]()}function fi(){var e,t,r=new Promise((i,s)=>{e=i,t=s});return{promise:r,resolve:e,reject:t}}const N=2,Ce=4,dr=8,ae=16,rt=32,dt=64,cr=128,U=256,Jt=512,F=1024,Z=2048,it=4096,At=8192,Ct=16384,De=32768,hi=65536,Ge=1<<17,di=1<<18,Le=1<<19,pr=1<<20,me=1<<21,Pe=1<<22,lt=1<<23,Vt=Symbol("$state"),Te=new class extends Error{constructor(){super(...arguments);f(this,"name","StaleReactionError");f(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function ci(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function pi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function vi(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function mi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gi(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wi(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _i(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function yi(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ei(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const bi=2,x=Symbol();function vr(e){return e===this.v}let Mi=!1,Y=null;function Qt(e){Y=e}function Oe(e,t=!1,r){Y={p:Y,c:null,e:null,s:e,x:null,l:null}}function Fe(e){var t=Y,r=t.e;if(r!==null){t.e=null;for(var i of r)Lr(i)}return e!==void 0&&(t.x=e),Y=t.p,e??{}}function mr(){return!0}const ki=new WeakMap;function Ai(e){var t=_;if(t===null)return g.f|=lt,e;if((t.f&De)===0){if((t.f&cr)===0)throw!t.parent&&e instanceof Error&&gr(e),e;t.b.error(e)}else Ie(e,t)}function Ie(e,t){for(;t!==null;){if((t.f&cr)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e instanceof Error&&gr(e),e}function gr(e){const t=ki.get(e);t&&(ve(e,"message",{value:t.message}),ve(e,"stack",{value:t.stack}))}let $t=[];function Si(){var e=$t;$t=[],ui(e)}function xi(e){$t.length===0&&queueMicrotask(Si),$t.push(e)}function Ci(){for(var e=_.b;e!==null&&!e.has_pending_snippet();)e=e.parent;return e===null&&ci(),e}function Di(e){var t=N|Z,r=g!==null&&(g.f&N)!==0?g:null;return _===null||r!==null&&(r.f&U)!==0?t|=U:_.f|=Le,{ctx:Y,deps:null,effects:null,equals:vr,f:t,fn:e,reactions:null,rv:0,v:x,wv:0,parent:r??_,ac:null}}function Li(e,t){let r=_;r===null&&pi();var i=r.b,s=void 0,n=Mr(x),a=null,o=!g;return Zi(()=>{try{var l=e()}catch(p){l=Promise.reject(p)}var u=()=>l;s=(a==null?void 0:a.then(u,u))??Promise.resolve(l),a=s;var d=A,c=i.pending;o&&(i.update_pending_count(1),c||d.increment());const h=(p,m=void 0)=>{a=null,c||d.activate(),m?m!==Te&&(n.f|=lt,_e(n,m)):((n.f<)!==0&&(n.f^=lt),_e(n,p)),o&&(i.update_pending_count(-1),c||d.decrement()),yr()};if(s.then(h,p=>h(null,p||"unknown")),d)return()=>{queueMicrotask(()=>d.neuter())}}),new Promise(l=>{function u(d){function c(){d===s?l(n):u(s)}d.then(c,c)}u(s)})}function wr(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)ht(t[r])}}function Pi(e){for(var t=e.parent;t!==null;){if((t.f&N)===0)return t;t=t.parent}return null}function Ne(e){var t,r=_;xt(Pi(e));try{wr(e),t=Ur(e)}finally{xt(r)}return t}function _r(e){var t=Ne(e);if(e.equals(t)||(e.v=t,e.wv=zr()),!Dt)if($!==null)$.set(e,e.v);else{var r=(tt||(e.f&U)!==0)&&e.deps!==null?it:F;B(e,r)}}function Ti(e,t,r){const i=Di;if(t.length===0){r(e.map(i));return}var s=A,n=_,a=Oi(),o=Ci();Promise.all(t.map(l=>Li(l))).then(l=>{s==null||s.activate(),a();try{r([...e.map(i),...l])}catch(u){(n.f&Ct)===0&&Ie(u,n)}s==null||s.deactivate(),yr()}).catch(l=>{o.error(l)})}function Oi(){var e=_,t=g,r=Y;return function(){xt(e),et(t),Qt(r)}}function yr(){xt(null),et(null),Qt(null)}const Tt=new Set;let A=null,$=null,Ke=new Set,te=[];function Er(){const e=te.shift();te.length>0&&queueMicrotask(Er),e()}let Nt=[],Re=null,ge=!1;var yt,Et,J,jt,Ut,st,bt,at,Q,Mt,Bt,qt,q,br,Gt,we;const ie=class ie{constructor(){k(this,q);f(this,"current",new Map);k(this,yt,new Map);k(this,Et,new Set);k(this,J,0);k(this,jt,null);k(this,Ut,!1);k(this,st,[]);k(this,bt,[]);k(this,at,[]);k(this,Q,[]);k(this,Mt,[]);k(this,Bt,[]);k(this,qt,[]);f(this,"skipped_effects",new Set)}process(t){var n;Nt=[];var r=null;if(Tt.size>1){r=new Map,$=new Map;for(const[a,o]of this.current)r.set(a,{v:a.v,wv:a.wv}),a.v=o;for(const a of Tt)if(a!==this)for(const[o,l]of v(a,yt))r.has(o)||(r.set(o,{v:o.v,wv:o.wv}),o.v=l)}for(const a of t)nt(this,q,br).call(this,a);if(v(this,st).length===0&&v(this,J)===0){nt(this,q,we).call(this);var i=v(this,at),s=v(this,Q);S(this,at,[]),S(this,Q,[]),S(this,Mt,[]),A=null,Je(i),Je(s),A===null?A=this:Tt.delete(this),(n=v(this,jt))==null||n.resolve()}else nt(this,q,Gt).call(this,v(this,at)),nt(this,q,Gt).call(this,v(this,Q)),nt(this,q,Gt).call(this,v(this,Mt));if(r){for(const[a,{v:o,wv:l}]of r)a.wv<=l&&(a.v=o);$=null}for(const a of v(this,st))It(a);for(const a of v(this,bt))It(a);S(this,st,[]),S(this,bt,[])}capture(t,r){v(this,yt).has(t)||v(this,yt).set(t,r),this.current.set(t,t.v)}activate(){A=this}deactivate(){A=null;for(const t of Ke)if(Ke.delete(t),t(),A!==null)break}neuter(){S(this,Ut,!0)}flush(){Nt.length>0?Fi():nt(this,q,we).call(this),A===this&&(v(this,J)===0&&Tt.delete(this),this.deactivate())}increment(){S(this,J,v(this,J)+1)}decrement(){if(S(this,J,v(this,J)-1),v(this,J)===0){for(const t of v(this,Bt))B(t,Z),St(t);for(const t of v(this,qt))B(t,it),St(t);S(this,at,[]),S(this,Q,[]),this.flush()}else this.deactivate()}add_callback(t){v(this,Et).add(t)}settled(){return(v(this,jt)??S(this,jt,fi())).promise}static ensure(){if(A===null){const t=A=new ie;Tt.add(A),ie.enqueue(()=>{A===t&&t.flush()})}return A}static enqueue(t){te.length===0&&queueMicrotask(Er),te.unshift(t)}};yt=new WeakMap,Et=new WeakMap,J=new WeakMap,jt=new WeakMap,Ut=new WeakMap,st=new WeakMap,bt=new WeakMap,at=new WeakMap,Q=new WeakMap,Mt=new WeakMap,Bt=new WeakMap,qt=new WeakMap,q=new WeakSet,br=function(t){var d;t.f^=F;for(var r=t.first;r!==null;){var i=r.f,s=(i&(rt|dt))!==0,n=s&&(i&F)!==0,a=n||(i&At)!==0||this.skipped_effects.has(r);if(!a&&r.fn!==null){if(s)r.f^=F;else if((i&F)===0)if((i&Ce)!==0)v(this,Q).push(r);else if((i&Pe)!==0){var o=(d=r.b)!=null&&d.pending?v(this,bt):v(this,st);o.push(r)}else oe(r)&&((r.f&ae)!==0&&v(this,Mt).push(r),It(r));var l=r.first;if(l!==null){r=l;continue}}var u=r.parent;for(r=r.next;r===null&&u!==null;)r=u.next,u=u.parent}},Gt=function(t){for(const r of t)((r.f&Z)!==0?v(this,Bt):v(this,qt)).push(r),B(r,F);t.length=0},we=function(){if(!v(this,Ut))for(const t of v(this,Et))t();v(this,Et).clear()};let Rt=ie;function Fi(){var e=_t;ge=!0;try{var t=0;for($e(!0);Nt.length>0;){var r=Rt.ensure();if(t++>1e3){var i,s;Ii()}r.process(Nt),ut.clear()}}finally{ge=!1,$e(e),Re=null}}function Ii(){try{wi()}catch(e){Ie(e,Re)}}function Je(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var i=e[r++];if((i.f&(Ct|At))===0&&oe(i)){var s=A?A.current.size:0;if(It(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null&&i.ac===null?Ir(i):i.fn=null),A!==null&&A.current.size>s&&(i.f&pr)!==0)break}}for(;r<t;)St(e[r++])}}function St(e){for(var t=Re=e;t.parent!==null;){t=t.parent;var r=t.f;if(ge&&t===_&&(r&ae)!==0)return;if((r&(dt|rt))!==0){if((r&F)===0)return;t.f^=F}}Nt.push(t)}const ut=new Map;function Mr(e,t){var r={f:0,v:e,reactions:null,equals:vr,rv:0,wv:0};return r}function O(e,t){const r=Mr(e);return Gi(r),r}function L(e,t,r=!1){g!==null&&(!H||(g.f&Ge)!==0)&&mr()&&(g.f&(N|ae|Pe|Ge))!==0&&!(T!=null&&T.includes(e))&&Ei();let i=r?Ot(t):t;return _e(e,i)}function _e(e,t){if(!e.equals(t)){var r=e.v;Dt?ut.set(e,t):ut.set(e,r),e.v=t;var i=Rt.ensure();i.capture(e,r),(e.f&N)!==0&&((e.f&Z)!==0&&Ne(e),B(e,(e.f&U)===0?F:it)),e.wv=zr(),kr(e,Z),_!==null&&(_.f&F)!==0&&(_.f&(rt|dt))===0&&(j===null?Ki([e]):j.push(e))}return t}function de(e){L(e,e.v+1)}function kr(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,s=0;s<i;s++){var n=r[s],a=n.f,o=(a&Z)===0;o&&B(n,t),(a&N)!==0?kr(n,it):o&&St(n)}}function Ot(e){if(typeof e!="object"||e===null||Vt in e)return e;const t=li(e);if(t!==ai&&t!==oi)return e;var r=new Map,i=hr(e),s=O(0),n=ft,a=o=>{if(ft===n)return o();var l=g,u=ft;et(null),er(n);var d=o();return et(l),er(u),d};return i&&r.set("length",O(e.length)),new Proxy(e,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&_i();var d=r.get(l);return d===void 0?d=a(()=>{var c=O(u.value);return r.set(l,c),c}):L(d,u.value,!0),!0},deleteProperty(o,l){var u=r.get(l);if(u===void 0){if(l in o){const d=a(()=>O(x));r.set(l,d),de(s)}}else L(u,x),de(s);return!0},get(o,l,u){var p;if(l===Vt)return e;var d=r.get(l),c=l in o;if(d===void 0&&(!c||(p=Ft(o,l))!=null&&p.writable)&&(d=a(()=>{var m=Ot(c?o[l]:x),E=O(m);return E}),r.set(l,d)),d!==void 0){var h=M(d);return h===x?void 0:h}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var d=r.get(l);d&&(u.value=M(d))}else if(u===void 0){var c=r.get(l),h=c==null?void 0:c.v;if(c!==void 0&&h!==x)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(o,l){var h;if(l===Vt)return!0;var u=r.get(l),d=u!==void 0&&u.v!==x||Reflect.has(o,l);if(u!==void 0||_!==null&&(!d||(h=Ft(o,l))!=null&&h.writable)){u===void 0&&(u=a(()=>{var p=d?Ot(o[l]):x,m=O(p);return m}),r.set(l,u));var c=M(u);if(c===x)return!1}return d},set(o,l,u,d){var C;var c=r.get(l),h=l in o;if(i&&l==="length")for(var p=u;p<c.v;p+=1){var m=r.get(p+"");m!==void 0?L(m,x):p in o&&(m=a(()=>O(x)),r.set(p+"",m))}if(c===void 0)(!h||(C=Ft(o,l))!=null&&C.writable)&&(c=a(()=>O(void 0)),L(c,Ot(u)),r.set(l,c));else{h=c.v!==x;var E=a(()=>Ot(u));L(c,E)}var b=Reflect.getOwnPropertyDescriptor(o,l);if(b!=null&&b.set&&b.set.call(d,u),!h){if(i&&typeof l=="string"){var R=r.get("length"),w=Number(l);Number.isInteger(w)&&w>=R.v&&L(R,w+1)}de(s)}return!0},ownKeys(o){M(s);var l=Reflect.ownKeys(o).filter(c=>{var h=r.get(c);return h===void 0||h.v!==x});for(var[u,d]of r)d.v!==x&&!(u in o)&&l.push(u);return l},setPrototypeOf(){yi()}})}var Qe,Ar,Sr,xr;function Ni(){if(Qe===void 0){Qe=window,Ar=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;Sr=Ft(t,"firstChild").get,xr=Ft(t,"nextSibling").get,Ve(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Ve(r)&&(r.__t=void 0)}}function Ri(e=""){return document.createTextNode(e)}function Cr(e){return Sr.call(e)}function Dr(e){return xr.call(e)}function ye(e,t){return Cr(e)}function zi(e,t=1,r=!1){let i=e;for(;t--;)i=Dr(i);return i}function ji(e){_===null&&g===null&&gi(),g!==null&&(g.f&U)!==0&&_===null&&mi(),Dt&&vi()}function Ui(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function ct(e,t,r,i=!0){var s=_;s!==null&&(s.f&At)!==0&&(e|=At);var n={ctx:Y,deps:null,nodes_start:null,nodes_end:null,f:e|Z,first:null,fn:t,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{It(n),n.f|=De}catch(l){throw ht(n),l}else t!==null&&St(n);var a=r&&n.deps===null&&n.first===null&&n.nodes_start===null&&n.teardown===null&&(n.f&Le)===0;if(!a&&i&&(s!==null&&Ui(n,s),g!==null&&(g.f&N)!==0&&(e&dt)===0)){var o=g;(o.effects??(o.effects=[])).push(n)}return n}function V(e){ji();var t=_.f,r=!g&&(t&rt)!==0&&(t&De)===0;if(r){var i=Y;(i.e??(i.e=[])).push(e)}else return Lr(e)}function Lr(e){return ct(Ce|pr,e,!1)}function Bi(e){Rt.ensure();const t=ct(dt,e,!0);return(r={})=>new Promise(i=>{r.outro?Wi(t,()=>{ht(t),i(void 0)}):(ht(t),i(void 0))})}function qi(e){return ct(Ce,e,!1)}function Zi(e){return ct(Pe|Le,e,!0)}function Pr(e,t=0){return ct(dr|t,e,!0)}function Tr(e,t=[],r=[]){Ti(t,r,i=>{ct(dr,()=>e(...i.map(M)),!0)})}function Yi(e,t=!0){return ct(rt,e,!0,t)}function Or(e){var t=e.teardown;if(t!==null){const r=Dt,i=g;tr(!0),et(null);try{t.call(null)}finally{tr(r),et(i)}}}function Fr(e,t=!1){var s;var r=e.first;for(e.first=e.last=null;r!==null;){(s=r.ac)==null||s.abort(Te);var i=r.next;(r.f&dt)!==0?r.parent=null:ht(r,t),r=i}}function Hi(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&rt)===0&&ht(t),t=r}}function ht(e,t=!0){var r=!1;(t||(e.f&di)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(Xi(e.nodes_start,e.nodes_end),r=!0),Fr(e,t&&!r),ee(e,0),B(e,Ct);var i=e.transitions;if(i!==null)for(const n of i)n.stop();Or(e);var s=e.parent;s!==null&&s.first!==null&&Ir(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function Xi(e,t){for(;e!==null;){var r=e===t?null:Dr(e);e.remove(),e=r}}function Ir(e){var t=e.parent,r=e.prev,i=e.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=r))}function Wi(e,t){var r=[];Nr(e,r,!0),Vi(r,()=>{ht(e),t&&t()})}function Vi(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var s of e)s.out(i)}else t()}function Nr(e,t,r){if((e.f&At)===0){if(e.f^=At,e.transitions!==null)for(const a of e.transitions)(a.is_global||r)&&t.push(a);for(var i=e.first;i!==null;){var s=i.next,n=(i.f&hi)!==0||(i.f&rt)!==0;Nr(i,t,n?r:!1),i=s}}}let _t=!1;function $e(e){_t=e}let Dt=!1;function tr(e){Dt=e}let g=null,H=!1;function et(e){g=e}let _=null;function xt(e){_=e}let T=null;function Gi(e){g!==null&&(T===null?T=[e]:T.push(e))}let D=null,I=0,j=null;function Ki(e){j=e}let Rr=1,zt=0,ft=zt;function er(e){ft=e}let tt=!1;function zr(){return++Rr}function oe(e){var c;var t=e.f;if((t&Z)!==0)return!0;if((t&it)!==0){var r=e.deps,i=(t&U)!==0;if(r!==null){var s,n,a=(t&Jt)!==0,o=i&&_!==null&&!tt,l=r.length;if((a||o)&&(_===null||(_.f&Ct)===0)){var u=e,d=u.parent;for(s=0;s<l;s++)n=r[s],(a||!((c=n==null?void 0:n.reactions)!=null&&c.includes(u)))&&(n.reactions??(n.reactions=[])).push(u);a&&(u.f^=Jt),o&&d!==null&&(d.f&U)===0&&(u.f^=U)}for(s=0;s<l;s++)if(n=r[s],oe(n)&&_r(n),n.wv>e.wv)return!0}(!i||_!==null&&!tt)&&B(e,F)}return!1}function jr(e,t,r=!0){var i=e.reactions;if(i!==null&&!(T!=null&&T.includes(e)))for(var s=0;s<i.length;s++){var n=i[s];(n.f&N)!==0?jr(n,t,!1):t===n&&(r?B(n,Z):(n.f&F)!==0&&B(n,it),St(n))}}function Ur(e){var m;var t=D,r=I,i=j,s=g,n=tt,a=T,o=Y,l=H,u=ft,d=e.f;D=null,I=0,j=null,tt=(d&U)!==0&&(H||!_t||g===null),g=(d&(rt|dt))===0?e:null,T=null,Qt(e.ctx),H=!1,ft=++zt,e.ac!==null&&(e.ac.abort(Te),e.ac=null);try{e.f|=me;var c=(0,e.fn)(),h=e.deps;if(D!==null){var p;if(ee(e,I),h!==null&&I>0)for(h.length=I+D.length,p=0;p<D.length;p++)h[I+p]=D[p];else e.deps=h=D;if(!tt||(d&N)!==0&&e.reactions!==null)for(p=I;p<h.length;p++)((m=h[p]).reactions??(m.reactions=[])).push(e)}else h!==null&&I<h.length&&(ee(e,I),h.length=I);if(mr()&&j!==null&&!H&&h!==null&&(e.f&(N|it|Z))===0)for(p=0;p<j.length;p++)jr(j[p],e);return s!==null&&s!==e&&(zt++,j!==null&&(i===null?i=j:i.push(...j))),(e.f<)!==0&&(e.f^=lt),c}catch(E){return Ai(E)}finally{e.f^=me,D=t,I=r,j=i,g=s,tt=n,T=a,Qt(o),H=l,ft=u}}function Ji(e,t){let r=t.reactions;if(r!==null){var i=ni.call(r,e);if(i!==-1){var s=r.length-1;s===0?r=t.reactions=null:(r[i]=r[s],r.pop())}}r===null&&(t.f&N)!==0&&(D===null||!D.includes(t))&&(B(t,it),(t.f&(U|Jt))===0&&(t.f^=Jt),wr(t),ee(t,0))}function ee(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)Ji(e,r[i])}function It(e){var t=e.f;if((t&Ct)===0){B(e,F);var r=_,i=_t;_=e,_t=!0;try{(t&ae)!==0?Hi(e):Fr(e),Or(e);var s=Ur(e);e.teardown=typeof s=="function"?s:null,e.wv=Rr;var n;fr&&Mi&&(e.f&Z)!==0&&e.deps}finally{_t=i,_=r}}}function M(e){var t=e.f,r=(t&N)!==0;if(g!==null&&!H){var i=_!==null&&(_.f&Ct)!==0;if(!i&&!(T!=null&&T.includes(e))){var s=g.deps;if((g.f&me)!==0)e.rv<zt&&(e.rv=zt,D===null&&s!==null&&s[I]===e?I++:D===null?D=[e]:(!tt||!D.includes(e))&&D.push(e));else{(g.deps??(g.deps=[])).push(e);var n=e.reactions;n===null?e.reactions=[g]:n.includes(g)||n.push(g)}}}else if(r&&e.deps===null&&e.effects===null){var a=e,o=a.parent;o!==null&&(o.f&U)===0&&(a.f^=U)}if(Dt){if(ut.has(e))return ut.get(e);if(r){a=e;var l=a.v;return((a.f&F)===0&&a.reactions!==null||Br(a))&&(l=Ne(a)),ut.set(a,l),l}}else if(r){if(a=e,$!=null&&$.has(a))return $.get(a);oe(a)&&_r(a)}if((e.f<)!==0)throw e.v;return e.v}function Br(e){if(e.v===x)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(ut.has(t)||(t.f&N)!==0&&Br(t))return!0;return!1}function Qi(e){var t=H;try{return H=!0,e()}finally{H=t}}const $i=-7169;function B(e,t){e.f=e.f&$i|t}const tn=["touchstart","touchmove"];function en(e){return tn.includes(e)}const rn=new Set,rr=new Set;function Wt(e){var w;var t=this,r=t.ownerDocument,i=e.type,s=((w=e.composedPath)==null?void 0:w.call(e))||[],n=s[0]||e.target,a=0,o=e.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var u=s.indexOf(t);if(u===-1)return;l<=u&&(a=l)}if(n=s[a]||e.target,n!==t){ve(e,"currentTarget",{configurable:!0,get(){return n||r}});var d=g,c=_;et(null),xt(null);try{for(var h,p=[];n!==null;){var m=n.assignedSlot||n.parentNode||n.host||null;try{var E=n["__"+i];if(E!=null&&(!n.disabled||e.target===n))if(hr(E)){var[b,...R]=E;b.apply(n,[e,...R])}else E.call(n,e)}catch(C){h?p.push(C):h=C}if(e.cancelBubble||m===t||m===null)break;n=m}if(h){for(let C of p)queueMicrotask(()=>{throw C});throw h}}finally{e.__root=t,delete e.currentTarget,et(d),xt(c)}}}function nn(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function sn(e,t){var r=_;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function qr(e,t){var r=(t&bi)!==0,i,s=!e.startsWith("<!>");return()=>{i===void 0&&(i=nn(s?e:"<!>"+e),i=Cr(i));var n=r||Ar?document.importNode(i,!0):i.cloneNode(!0);return sn(n,n),n}}function Zr(e,t){e!==null&&e.before(t)}function ze(e,t){return an(e,t)}const vt=new Map;function an(e,{target:t,anchor:r,props:i={},events:s,context:n,intro:a=!0}){Ni();var o=new Set,l=c=>{for(var h=0;h<c.length;h++){var p=c[h];if(!o.has(p)){o.add(p);var m=en(p);t.addEventListener(p,Wt,{passive:m});var E=vt.get(p);E===void 0?(document.addEventListener(p,Wt,{passive:m}),vt.set(p,1)):vt.set(p,E+1)}}};l(si(rn)),rr.add(l);var u=void 0,d=Bi(()=>{var c=r??t.appendChild(Ri());return Yi(()=>{if(n){Oe({});var h=Y;h.c=n}s&&(i.$$events=s),u=e(c,i)||{},n&&Fe()}),()=>{var m;for(var h of o){t.removeEventListener(h,Wt);var p=vt.get(h);--p===0?(document.removeEventListener(h,Wt),vt.delete(h)):vt.set(h,p)}rr.delete(l),c!==r&&((m=c.parentNode)==null||m.removeChild(c))}});return on.set(u,d),u}let on=new WeakMap;const ir=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function ln(e,t,r){var i=e==null?"":""+e;if(r){for(var s in r)if(r[s])i=i?i+" "+s:s;else if(i.length)for(var n=s.length,a=0;(a=i.indexOf(s,a))>=0;){var o=a+n;(a===0||ir.includes(i[a-1]))&&(o===i.length||ir.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}function nr(e,t=!1){var r=t?" !important;":";",i="";for(var s in e){var n=e[s];n!=null&&n!==""&&(i+=" "+s+": "+n+r)}return i}function ce(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function un(e,t){if(t){var r="",i,s;if(Array.isArray(t)?(i=t[0],s=t[1]):i=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var n=!1,a=0,o=!1,l=[];i&&l.push(...Object.keys(i).map(ce)),s&&l.push(...Object.keys(s).map(ce));var u=0,d=-1;const E=e.length;for(var c=0;c<E;c++){var h=e[c];if(o?h==="/"&&e[c-1]==="*"&&(o=!1):n?n===h&&(n=!1):h==="/"&&e[c+1]==="*"?o=!0:h==='"'||h==="'"?n=h:h==="("?a++:h===")"&&a--,!o&&n===!1&&a===0){if(h===":"&&d===-1)d=c;else if(h===";"||c===E-1){if(d!==-1){var p=ce(e.substring(u,d).trim());if(!l.includes(p)){h!==";"&&c++;var m=e.substring(u,c).trim();r+=" "+m+";"}}u=c+1,d=-1}}}}return i&&(r+=nr(i)),s&&(r+=nr(s,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function Yr(e,t,r,i,s,n){var a=e.__className;if(a!==r||a===void 0){var o=ln(r,i,n);o==null?e.removeAttribute("class"):e.className=o,e.__className=r}else if(n&&s!==n)for(var l in n){var u=!!n[l];(s==null||u!==!!s[l])&&e.classList.toggle(l,u)}return n}function pe(e,t={},r,i){for(var s in r){var n=r[s];t[s]!==n&&(r[s]==null?e.style.removeProperty(s):e.style.setProperty(s,n,i))}}function re(e,t,r,i){var s=e.__style;if(s!==t){var n=un(t,i);n==null?e.removeAttribute("style"):e.style.cssText=n,e.__style=t}else i&&(Array.isArray(i)?(pe(e,r==null?void 0:r[0],i[0]),pe(e,r==null?void 0:r[1],i[1],"important")):pe(e,r,i));return i}const fn=()=>performance.now(),X={tick:e=>requestAnimationFrame(e),now:()=>fn(),tasks:new Set};function Hr(){const e=X.now();X.tasks.forEach(t=>{t.c(e)||(X.tasks.delete(t),t.f())}),X.tasks.size!==0&&X.tick(Hr)}function hn(e){let t;return X.tasks.size===0&&X.tick(Hr),{promise:new Promise(r=>{X.tasks.add(t={c:e,f:r})}),abort(){X.tasks.delete(t)}}}function sr(e,t){return e===t||(e==null?void 0:e[Vt])===t}function mt(e={},t,r,i){return qi(()=>{var s,n;return Pr(()=>{s=n,n=[],Qi(()=>{e!==r(...n)&&(t(e,...n),s&&sr(r(...s),e)&&t(null,...s))})}),()=>{xi(()=>{n&&sr(r(...n),e)&&t(null,...n)})}}),e}const dn="5";var ur;typeof window<"u"&&((ur=window.__svelte??(window.__svelte={})).v??(ur.v=new Set)).add(dn);function cn(e){return e}function Ee(e){return-.5*(Math.cos(Math.PI*e)-1)}function pn(e){const t=Math.cos(e*Math.PI*.5);return Math.abs(t)<1e-14?1:1-t}function vn(e){return Math.sin(e*Math.PI/2)}const mn=128,gn=0,wn=1,_n=2;class yn{constructor(){f(this,"animationsStarted",!1);f(this,"animationsCount",0);f(this,"animationsLimit",mn);f(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let t=0;t<this.layers.length;t++){const r=this.layers[t];if(r==null)continue;const i=r.animations;if(i!=null)for(let s=0;s<i.length;s++){const n=i[s];if(n!=null){for(const a of n.values())if(!a.executed&&(a.executed=!0,a.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(t,r,i,s){let n=this.layers[t];n==null&&(n=this.layers[t]={animations:new Array});let a=n.animations[r];a==null&&(a=n.animations[r]=new Map);let o={id:i,priority:r,executed:!1,function:s};a.set(i,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(t,r){for(let i=0;i<this.layers.length;i++){let s=this.layers[i];if(s==null)continue;let n=s.animations[t];if(n==null)return;let a=n.get(r);if(a==null||a.executed==!1)return;n.delete(r)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(t){this.animationsLimit=t}}const K=new yn;function ar(e){return Object.prototype.toString.call(e)==="[object Date]"}function be(e,t){if(e===t||e!==e)return()=>e;const r=typeof e;if(r!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const i=t.map((s,n)=>be(e[n],s));return s=>i.map(n=>n(s))}if(r==="object"){if(!e||!t)throw new Error("Object cannot be null");if(ar(e)&&ar(t)){const n=e.getTime(),o=t.getTime()-n;return l=>new Date(n+l*o)}const i=Object.keys(t),s={};return i.forEach(n=>{s[n]=be(e[n],t[n])}),n=>{const a={};return i.forEach(o=>{a[o]=s[o](n)}),a}}if(r==="number"){const i=t-e;return s=>e+s*i}return()=>t}var G,kt,Zt,ot;const Ue=class Ue{constructor(t,r={}){k(this,G);k(this,kt);k(this,Zt);k(this,ot,null);S(this,G,O(t)),S(this,kt,O(t)),S(this,Zt,r)}static of(t,r){const i=new Ue(t(),r);return Pr(()=>{i.set(t())}),i}set(t,r){var c;L(v(this,kt),t);let{delay:i=0,duration:s=400,easing:n=cn,interpolate:a=be}={...v(this,Zt),...r};if(s===0)return(c=v(this,ot))==null||c.abort(),L(v(this,G),t),Promise.resolve();const o=X.now()+i;let l,u=!1,d=v(this,ot);return S(this,ot,hn(h=>{if(h<o)return!0;if(!u){u=!0;const m=v(this,G).v;l=a(m,t),typeof s=="function"&&(s=s(m,t)),d==null||d.abort()}const p=h-o;return p>s?(L(v(this,G),t),!1):(L(v(this,G),l(n(p/s))),!0)})),v(this,ot).promise}get current(){return M(v(this,G))}get target(){return M(v(this,kt))}set target(t){this.set(t)}};G=new WeakMap,kt=new WeakMap,Zt=new WeakMap,ot=new WeakMap;let Me=Ue;class Kt{constructor(t,r){f(this,"value");f(this,"motion");this.value=t,this.motion=new Me(t,r)}set(t,r){this.value=t,this.motion.set(t,r)}update(t){this.motion.set(this.value,t)}snap(){this.motion.set(this.value,{duration:0})}}var En=qr('<div><div class="body svelte-1nfn9j8"></div></div>');function bn(e,t){Oe(t,!0);let r,i;function s(){return i}let n=O(!1);function a(w){L(n,w,!0)}function o(){return M(n)}let l=new Kt(0,{easing:Ee});V(()=>{u(l.motion.current)}),V(()=>{M(n)==!1&&(l.snap(),K.clear(t.priority,t.id))});function u(w){r&&K.equeue(t.layer,t.priority,t.id,()=>{r.style.scale=w.toString(),r.style.filter=`brightness(${.25+.75*w})`,i.style.opacity=w.toString()})}function d(w){w!=l.value&&l.set(w,{duration:75})}function c(){return l.motion.current==0}function h(){return l.value}var p=En();let m,E;var b=ye(p);let R;return mt(b,w=>i=w,()=>i),mt(p,w=>r=w,()=>r),Tr((w,C,z)=>{m=Yr(p,1,"pin svelte-1nfn9j8",null,m,w),E=re(p,"",E,C),R=re(b,"",R,z)},[()=>({displayed:M(n)}),()=>({width:`${t.width}px`,height:`${t.height}px`,"border-radius":`${t.radius}px`}),()=>({width:`${t.width-4}px`,height:`${t.height-4}px`,"border-radius":`${t.radius-2}px`})]),Zr(e,p),Fe({getBody:s,setDisplayed:a,getDisplayed:o,setScale:d,getCollapsed:c,getScale:h})}var Mn=qr('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function Xr(e,t){Oe(t,!0);let r,i,s,n;const a=t.width+2*t.margin,o=t.height+2*t.margin,l=()=>n;V(()=>{s.style.width=`${t.margin*4}px`,s.style.height=`${t.margin*4}px`});let u=O(!0);function d(y){L(u,y,!0)}function c(){return M(u)}let h=O(!0);function p(y){L(h,y,!0)}function m(){return b.motion.current==0}function E(){return b.motion.current==1}let b=new Kt(0);V(()=>{R(b.motion.current)}),V(()=>{M(u)==!1&&(b.snap(),K.clear(t.priority,t.id+"_scale"))}),V(()=>{M(h)==!0&&b.value!=0&&(K.stacked()?b.set(0,{duration:0}):b.set(0,{duration:150,easing:pn})),M(h)==!1&&b.value!=1&&b.set(1,{duration:150,easing:vn})});function R(y){!r||!i||!s||K.equeue(M(h)?0:t.layer,t.priority,t.id+"_scale",()=>{r.style.opacity=`${y}`,i.style.scale=`${y}`,s.style.scale=`${y}`})}let w=NaN,C=O(!1),z=new Kt(-a/2,{easing:Ee}),Yt=new Kt(-o/2,{easing:Ee});V(()=>{Be(z.motion.current,Yt.motion.current)}),V(()=>{M(u)==!1&&(z.snap(),z.snap(),K.clear(t.priority,t.id+"_angle"))}),V(()=>{M(h)==!0&&M(C)&&(z.update({duration:75}),z.update({duration:75}))});function Be(y,W){if(!r||!i||!s)return;const Xt=y+a/2,Lt=W+o/2,pt=o<a?Xt*o/a:Xt,ue=o>a?Lt*a/o:Lt,Jr=Math.atan2(ue,pt)/Math.PI*180-45,He=0,Qr=30,fe=Math.sqrt(pt*pt+ue*ue),Pt=Math.min(a,o)/2,$r=Pt*Math.SQRT2,ti=(fe-Pt)/($r-Pt),Xe=He+ti*(Qr-He),ei=fe<Pt?fe/Pt:1;K.equeue(t.layer,t.priority,t.id+"_angle",()=>{i.style.transform=`translate(${Math.round(y)}px, ${Math.round(W)}px)`,s.style.transform=`scale(${ei}) rotate(${Jr}deg) skew(${Xe}deg, ${Xe}deg)`})}function Gr(y){if(M(C)==!1){let W=P.Rectangle.getOffsets(a,o,y);z.set(Math.round(W.x),{duration:0}),Yt.set(Math.round(W.y),{duration:0}),Be(z.value,Yt.value),w=y,L(C,!0)}else if(y!=w){let W=Math.abs(y-w),Xt=W<180?W:360-W,Lt=Math.log(Xt)*75,pt=P.Rectangle.getOffsets(a,o,y);z.set(Math.round(pt.x),{duration:Lt}),Yt.set(Math.round(pt.y),{duration:Lt}),w=y}}function Kr(){return P.Rectangle.getOffsets(a,o,w)}var Ht=Mn();let qe;var Ze=ye(Ht);mt(Ze,y=>s=y,()=>s);var le=zi(Ze,2),Ye=ye(le);return mt(Ye,y=>n=y,()=>n),mt(le,y=>i=y,()=>i),mt(Ht,y=>r=y,()=>r),Tr(y=>{qe=Yr(Ht,1,"anchor svelte-j5igi2",null,qe,y),re(le,`margin: ${t.margin}px;`),re(Ye,`width: ${t.width}px; height: ${t.height}px; border-radius: ${t.radius}px;`)},[()=>({displayed:M(u)})]),Zr(e,Ht),Fe({getBody:l,setDisplayed:d,getDisplayed:c,setCollapsed:p,getCollapsed:m,getExpanded:E,setAngle:Gr,getOffsets:Kr})}class Wr{constructor(t,r,i,s,n){f(this,"swLat");f(this,"swLng");f(this,"neLat");f(this,"neLng");const a=i*Math.pow(2,r),o=P.Mercator.project(t.sw.lat,t.sw.lng,a),l=P.Mercator.project(t.ne.lat,t.ne.lng,a),u=o.x-s,d=o.y+n,c=l.x+s,h=l.y-n,p=P.Mercator.unproject(u,d,a),m=P.Mercator.unproject(c,h,a);this.swLat=p.lat,this.swLng=p.lng,this.neLat=m.lat,this.neLng=m.lng}contains(t,r){return this.swLat<=t&&t<=this.neLat?this.swLng<this.neLng?this.swLng<=r&&r<=this.neLng:r<=this.neLng||this.swLng<=r:!1}}const Vr="https://arenarium.dev/api/public/v1",kn=`${Vr}/log`,An=`${Vr}/tooltip/states`,or="1.0.189";class Sn{constructor(t,r){f(this,"provider");f(this,"apiStatesUrl");f(this,"apiStatesKey");f(this,"apiLogEnabled");f(this,"markerDataArray",new Array);f(this,"markerDataMap",new Map);f(this,"markerDataUpdating",!1);f(this,"markerPinProcessor");f(this,"markerTooltipProcessor");f(this,"markerPopupProcessor");P.mapProviderSchema.parse(t),this.provider=t,this.markerPinProcessor=new Ae(t),this.markerTooltipProcessor=new xn(t),this.markerPopupProcessor=new Cn(t),this.configuration=r,this.log("info","Loaded")}set configuration(t){var r,i,s,n,a,o,l,u;this.apiStatesUrl=(i=(r=t==null?void 0:t.api)==null?void 0:r.states)==null?void 0:i.url,this.apiStatesKey=(n=(s=t==null?void 0:t.api)==null?void 0:s.states)==null?void 0:n.key,this.apiLogEnabled=(o=(a=t==null?void 0:t.api)==null?void 0:a.log)==null?void 0:o.enabled,this.markerPinProcessor.setConfiguration(t),K.setLimit(((u=(l=t==null?void 0:t.animation)==null?void 0:l.queue)==null?void 0:u.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(t){P.mapMarkersSchema.parse(t);try{let r;if(t.length>1){const i=this.provider.getParameters(),s=t.map(n=>({id:n.id,rank:n.rank,lat:n.lat,lng:n.lng,width:n.tooltip.style.width,height:n.tooltip.style.height,margin:n.tooltip.style.margin}));if(this.apiStatesKey!=null){const n={key:this.apiStatesKey,parameters:i,input:s},a=await fetch(this.apiStatesUrl??An,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok||!a.body)throw new Error("Failed to get marker states: "+a.statusText);r=await a.json()}else r=P.getStates(i,s)}else r=[[0,[[0,P.Angles.DEGREES.indexOf(P.Angles.DEGREES_DEFAULT)]]]];this.updateMarkerData(t,r),this.processMarkerDataCallback()}catch(r){throw console.error(r),this.removeMarkerData(),r instanceof Error&&this.log("error","Failed to update markers",r),r}}removeMarkers(){try{this.removeMarkerData()}catch(t){throw console.error(t),t instanceof Error&&this.log("error","Failed to remove markers",t),t}}showPopup(t){try{for(const r of this.markerDataArray)r.marker.id==t?this.markerPopupProcessor.show(r):this.markerPopupProcessor.hide(r)}catch(r){console.error(r);for(const i of this.markerDataArray)this.markerPopupProcessor.hide(i);throw r instanceof Error&&this.log("error","Failed to show popup",r),r}}hidePopup(t){try{if(t){const r=this.markerDataMap.get(t);if(r==null)return;this.markerPopupProcessor.hide(r)}else for(const r of this.markerDataArray)this.markerPopupProcessor.hide(r)}catch(r){console.error(r);for(const i of this.markerDataArray)this.markerPopupProcessor.hide(i);throw r instanceof Error&&this.log("error","Failed to hide popup",r),r}}updateMarkerData(t,r){try{this.markerDataUpdating=!0;const i=new Map(t.map((n,a)=>[n.id,new lr(this.provider,n,r[a])])),s=Array.from(this.markerDataArray);for(const n of s)i.has(n.marker.id)==!1&&(n.remove(),this.markerDataMap.delete(n.marker.id),this.markerDataArray.splice(this.markerDataArray.indexOf(n),1));for(let n=0;n<t.length;n++){const a=t[n],o=r[n],l=this.markerDataMap.get(a.id);if(l)l.update(o);else{const u=new lr(this.provider,a,o);u.create(),this.markerDataMap.set(a.id,u),this.markerDataArray.push(u)}}this.markerDataArray.sort((n,a)=>n.zoom-a.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(n=>n.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(n=>n.tooltip))}catch(i){throw console.error(i),this.markerDataArray.forEach(s=>s.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),i instanceof Error&&this.log("error","Failed to update marker data",i),i}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(t){throw console.error(t),t instanceof Error&&this.log("error","Failed to remove marker data",t),t}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(t){console.error(t),t instanceof Error&&this.log("error","Failed to process marker data",t)}}processMarkerData(){if(this.markerDataUpdating)return;const t=this.provider.getBounds(),r=this.provider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(t,r),this.markerPinProcessor.process(t,r)}async log(t,r,i){if(!(this.apiLogEnabled==null&&(window!=null&&window.location.host.startsWith("localhost")))&&this.apiLogEnabled!=!1)try{const s={title:`[CLIENT:${or}] ${r}`,level:t,content:{version:or,...i}};await fetch(kn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(s){console.error(s)}}}class lr{constructor(t,r,i){f(this,"marker");f(this,"zoom");f(this,"pin");f(this,"tooltip");this.marker=r,this.zoom=i[0],this.pin=new ke(t,r,i),this.tooltip=new Se(t,r,i)}create(){this.pin.create(),this.tooltip.create()}update(t){this.pin.update(t),this.tooltip.update(t)}remove(){this.pin.remove(),this.tooltip.remove()}}class je{constructor(t,r){f(this,"provider");f(this,"id");f(this,"lat");f(this,"lng");f(this,"shown");f(this,"element");f(this,"component");f(this,"marker");this.provider=t,this.id=r.id,this.lat=r.lat,this.lng=r.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const t=this.element;if(!t)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(t,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(t){const r=this.marker,i=this.component;if(r==null||i==null)throw new Error("Failed to update provider marker map");t?r.inserted()==!1&&r.insert():r.inserted()==!0&&r.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var t,r;(t=this.marker)==null||t.remove(),(r=this.element)==null||r.remove()}}const gt=class gt extends je{constructor(r,i,s){var n,a,o,l;super(r,i);f(this,"width");f(this,"height");f(this,"radius");f(this,"zoom");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=((n=i.pin)==null?void 0:n.style.width)??gt.DEFAULT_SIZE,this.height=((a=i.pin)==null?void 0:a.style.height)??gt.DEFAULT_SIZE,this.radius=((o=i.pin)==null?void 0:o.style.radius)??gt.DEFAULT_SIZE,this.zoom=s[0],this.bodyCallback=(l=i.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=ze(bn,{target:this.element,props:{id:this.id+"_pin",layer:_n,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(r){this.zoom=r[0],this.updateZIndex()}updateMap(r){var i;super.updateMap(r),(i=this.component)==null||i.setDisplayed(r)}updateState(r){if(this.component==null)throw new Error("Failed to update pin state");this.component.setScale(this.getScale(r))}updateBody(){var i;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const r=(i=this.component)==null?void 0:i.getBody();r!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?r.appendChild(s):console.error("Failed to load pin body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(r){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setScale(r?0:1)}getScale(r){return this.zoom<r?1:Math.max(0,1-(this.zoom-r)*.125)}getZindex(){const r=this.provider.getParameters();return Math.round((r.zoomMax-this.zoom)*r.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};f(gt,"DEFAULT_SIZE",16);let ke=gt;const wt=class wt{constructor(t){f(this,"provider");f(this,"pinElements",new Array);f(this,"pinMaxWidth",0);f(this,"pinMaxHeight",0);f(this,"pinFade",!1);f(this,"pinMaxCount",0);f(this,"pinMaxZoomDelta",0);this.provider=t}setConfiguration(t){var r,i,s;this.pinFade=((r=t==null?void 0:t.pin)==null?void 0:r.fade)??!0,this.pinMaxCount=((i=t==null?void 0:t.pin)==null?void 0:i.maxCount)??Math.max(wt.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((s=t==null?void 0:t.pin)==null?void 0:s.maxZoom)??wt.MAP_PINS_MAX_ZOOM}updateElements(t){this.pinElements=t,this.pinMaxWidth=t.reduce((r,i)=>Math.max(r,i.width),0),this.pinMaxHeight=t.reduce((r,i)=>Math.max(r,i.height),0)}removeElements(){this.pinElements.forEach(t=>t.remove()),this.pinElements.length=0}process(t,r){const i=this.provider.getParameters().mapSize,s=new Wr(t,r,i,this.pinMaxWidth*2,this.pinMaxHeight*2);let n=0;for(const a of this.pinElements)s.contains(a.lat,a.lng)?a.shown&&r<=a.zoom&&a.zoom<=r+this.pinMaxZoomDelta?(n<this.pinMaxCount&&(this.pinFade==!0?a.updateState(r):a.setCollapsed(!1),a.updateMap(!0),a.isBodyLoaded()==!1&&a.updateBody()),n++):(a.setCollapsed(!0),a.isCollapsed()&&a.updateMap(!1)):a.updateMap(!1)}};f(wt,"MAP_PINS_MAX_ZOOM",2),f(wt,"MAP_PINS_MAX_COUNT",128);let Ae=wt;const ne=class ne extends je{constructor(r,i,s){super(r,i);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"zoom");f(this,"angle");f(this,"states");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=i.tooltip.style.width,this.height=i.tooltip.style.height,this.margin=i.tooltip.style.margin,this.radius=i.tooltip.style.radius,this.zoom=s[0],this.angle=P.Angles.DEGREES_DEFAULT,this.states=s[1].map(n=>[n[0],P.Angles.DEGREES[n[1]]]),this.bodyCallback=i.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=ze(Xr,{target:this.element,props:{id:this.id+"_tooltip",layer:wn,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(r){this.zoom=r[0],this.states=r[1].map(i=>[i[0],P.Angles.DEGREES[i[1]]]),this.updateZIndex()}updateMap(r){var i;super.updateMap(r),(i=this.component)==null||i.setDisplayed(r)}updateState(r){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(r),this.component.setAngle(this.angle)}updateBody(){var i;if(this.bodyLoaded||this.bodyLoading)return;const r=(i=this.component)==null?void 0:i.getBody();r!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?r.appendChild(s):console.error("Failed to load tooltip body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(r){const i=this.states.findLast(s=>s[0]<=r);if(!i)throw new Error("Angle not found");return i[1]}getZindex(){const r=this.provider.getParameters();return Math.round((r.zoomMax-this.zoom)*r.zoomScale)+ne.Z_INDEX_OFFSET}setCollapsed(r){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(r)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(ne,"Z_INDEX_OFFSET",1e6);let Se=ne;class xn{constructor(t){f(this,"provider");f(this,"tooltipElements",new Array);f(this,"tooltipMaxWidth",0);f(this,"tooltipMaxHeight",0);this.provider=t}updateElements(t){this.tooltipElements=t,this.tooltipMaxWidth=this.tooltipElements.reduce((r,i)=>Math.max(r,i.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((r,i)=>Math.max(r,i.height),0)}removeElements(){this.tooltipElements.forEach(t=>t.remove()),this.tooltipElements.length=0}process(t,r){const i=this.provider.getParameters().mapSize,s=new Wr(t,r,i,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const n of this.tooltipElements)s.contains(n.lat,n.lng)?n.shown&&n.zoom<=r?(n.updateState(r),n.setCollapsed(!1),n.updateMap(!0),n.isCollapsed()==!1&&n.isBodyLoaded()==!1&&n.updateBody()):(n.setCollapsed(!0),n.isCollapsed()&&n.updateMap(!1)):n.updateMap(!1)}}const se=class se extends je{constructor(r,i){if(i.popup==null)throw new Error("Failed to create popup");super(r,i);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.shown=!1,this.width=i.popup.style.width,this.height=i.popup.style.height,this.margin=i.popup.style.margin,this.radius=i.popup.style.radius,this.bodyCallback=i.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=ze(Xr,{target:this.element,props:{id:this.id+"_popup",layer:gn,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(r){var i;super.updateMap(r),(i=this.component)==null||i.setDisplayed(r)}updateBody(){var i;if(this.bodyLoaded||this.bodyLoading)return;const r=(i=this.component)==null?void 0:i.getBody();r!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?r.appendChild(s):console.error("Failed to load popup body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return se.Z_INDEX_OFFSET}setCollapsed(r){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(r)}setAngle(r){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(r)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(se,"Z_INDEX_OFFSET",2e6);let xe=se;class Cn{constructor(t){f(this,"provider");f(this,"popupElements",new Map);f(this,"popupPositioned",new Map);this.provider=t}show(t){t.pin.shown=!1,t.tooltip.shown=!1;const r=new xe(this.provider,t.marker);this.popupElements.set(t.marker.id,r),this.popupPositioned.set(t.marker.id,!1),r.create(),r.setAngle(t.tooltip.angle),r.shown=!0}hide(t){t.pin.shown=!0,t.tooltip.shown=!0;const r=this.popupElements.get(t.marker.id);r!=null&&(r.shown=!1)}clear(){this.popupElements.values().forEach(t=>t.remove()),this.popupElements.clear(),this.popupPositioned.clear()}process(){var t,r;for(const i of this.popupElements.values())if(i.shown){if(i.setCollapsed(!1),i.updateMap(!0),i.isExpanded()&&i.isBodyLoaded()==!1&&i.updateBody(),i.isCollapsed()==!1&&this.popupPositioned.get(i.id)==!1){const s=(t=i.component)==null?void 0:t.getBody();if(s==null)continue;const n=(r=i.component)==null?void 0:r.getOffsets();if(n==null)continue;const a=s.getBoundingClientRect();if(a.x==0&&a.y==0&&a.width==0&&a.height==0)continue;const o=a.x+a.width/2,l=a.y+a.height/2,u=o+n.x,d=l+n.y,c=u+i.width,h=d+i.height,p=this.provider.getContainer().getBoundingClientRect(),m=u-p.left,E=p.right-c,b=d-p.top,R=p.bottom-h,w=Math.min(i.width,i.height)/4,C=m<0?m-w:E<0?-E+w:0,z=b<0?b-w:R<0?-R+w:0;this.provider.panBy(C,z),this.popupPositioned.set(i.id,!0)}}else i.setCollapsed(!0),i.isCollapsed()&&(i.updateMap(!1),i.remove(),this.popupElements.delete(i.id),this.popupPositioned.delete(i.id))}}exports.MapManager=Sn;
|
|
2
|
+
\r\f \v\uFEFF`];function ln(e,t,r){var i=e==null?"":""+e;if(r){for(var s in r)if(r[s])i=i?i+" "+s:s;else if(i.length)for(var n=s.length,a=0;(a=i.indexOf(s,a))>=0;){var o=a+n;(a===0||ir.includes(i[a-1]))&&(o===i.length||ir.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}function nr(e,t=!1){var r=t?" !important;":";",i="";for(var s in e){var n=e[s];n!=null&&n!==""&&(i+=" "+s+": "+n+r)}return i}function ce(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function un(e,t){if(t){var r="",i,s;if(Array.isArray(t)?(i=t[0],s=t[1]):i=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var n=!1,a=0,o=!1,l=[];i&&l.push(...Object.keys(i).map(ce)),s&&l.push(...Object.keys(s).map(ce));var u=0,d=-1;const E=e.length;for(var c=0;c<E;c++){var h=e[c];if(o?h==="/"&&e[c-1]==="*"&&(o=!1):n?n===h&&(n=!1):h==="/"&&e[c+1]==="*"?o=!0:h==='"'||h==="'"?n=h:h==="("?a++:h===")"&&a--,!o&&n===!1&&a===0){if(h===":"&&d===-1)d=c;else if(h===";"||c===E-1){if(d!==-1){var p=ce(e.substring(u,d).trim());if(!l.includes(p)){h!==";"&&c++;var m=e.substring(u,c).trim();r+=" "+m+";"}}u=c+1,d=-1}}}}return i&&(r+=nr(i)),s&&(r+=nr(s,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function Yr(e,t,r,i,s,n){var a=e.__className;if(a!==r||a===void 0){var o=ln(r,i,n);o==null?e.removeAttribute("class"):e.className=o,e.__className=r}else if(n&&s!==n)for(var l in n){var u=!!n[l];(s==null||u!==!!s[l])&&e.classList.toggle(l,u)}return n}function pe(e,t={},r,i){for(var s in r){var n=r[s];t[s]!==n&&(r[s]==null?e.style.removeProperty(s):e.style.setProperty(s,n,i))}}function re(e,t,r,i){var s=e.__style;if(s!==t){var n=un(t,i);n==null?e.removeAttribute("style"):e.style.cssText=n,e.__style=t}else i&&(Array.isArray(i)?(pe(e,r==null?void 0:r[0],i[0]),pe(e,r==null?void 0:r[1],i[1],"important")):pe(e,r,i));return i}const fn=()=>performance.now(),X={tick:e=>requestAnimationFrame(e),now:()=>fn(),tasks:new Set};function Hr(){const e=X.now();X.tasks.forEach(t=>{t.c(e)||(X.tasks.delete(t),t.f())}),X.tasks.size!==0&&X.tick(Hr)}function hn(e){let t;return X.tasks.size===0&&X.tick(Hr),{promise:new Promise(r=>{X.tasks.add(t={c:e,f:r})}),abort(){X.tasks.delete(t)}}}function sr(e,t){return e===t||(e==null?void 0:e[Vt])===t}function mt(e={},t,r,i){return qi(()=>{var s,n;return Pr(()=>{s=n,n=[],Qi(()=>{e!==r(...n)&&(t(e,...n),s&&sr(r(...s),e)&&t(null,...s))})}),()=>{xi(()=>{n&&sr(r(...n),e)&&t(null,...n)})}}),e}const dn="5";var ur;typeof window<"u"&&((ur=window.__svelte??(window.__svelte={})).v??(ur.v=new Set)).add(dn);function cn(e){return e}function Ee(e){return-.5*(Math.cos(Math.PI*e)-1)}function pn(e){const t=Math.cos(e*Math.PI*.5);return Math.abs(t)<1e-14?1:1-t}function vn(e){return Math.sin(e*Math.PI/2)}const mn=128,gn=0,wn=1,_n=2;class yn{constructor(){f(this,"animationsStarted",!1);f(this,"animationsCount",0);f(this,"animationsLimit",mn);f(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let t=0;t<this.layers.length;t++){const r=this.layers[t];if(r==null)continue;const i=r.animations;if(i!=null)for(let s=0;s<i.length;s++){const n=i[s];if(n!=null){for(const a of n.values())if(!a.executed&&(a.executed=!0,a.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(t,r,i,s){let n=this.layers[t];n==null&&(n=this.layers[t]={animations:new Array});let a=n.animations[r];a==null&&(a=n.animations[r]=new Map);let o={id:i,priority:r,executed:!1,function:s};a.set(i,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(t,r){for(let i=0;i<this.layers.length;i++){let s=this.layers[i];if(s==null)continue;let n=s.animations[t];if(n==null)return;let a=n.get(r);if(a==null||a.executed==!1)return;n.delete(r)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(t){this.animationsLimit=t}}const K=new yn;function ar(e){return Object.prototype.toString.call(e)==="[object Date]"}function be(e,t){if(e===t||e!==e)return()=>e;const r=typeof e;if(r!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const i=t.map((s,n)=>be(e[n],s));return s=>i.map(n=>n(s))}if(r==="object"){if(!e||!t)throw new Error("Object cannot be null");if(ar(e)&&ar(t)){const n=e.getTime(),o=t.getTime()-n;return l=>new Date(n+l*o)}const i=Object.keys(t),s={};return i.forEach(n=>{s[n]=be(e[n],t[n])}),n=>{const a={};return i.forEach(o=>{a[o]=s[o](n)}),a}}if(r==="number"){const i=t-e;return s=>e+s*i}return()=>t}var G,kt,Zt,ot;const Ue=class Ue{constructor(t,r={}){k(this,G);k(this,kt);k(this,Zt);k(this,ot,null);S(this,G,O(t)),S(this,kt,O(t)),S(this,Zt,r)}static of(t,r){const i=new Ue(t(),r);return Pr(()=>{i.set(t())}),i}set(t,r){var c;L(v(this,kt),t);let{delay:i=0,duration:s=400,easing:n=cn,interpolate:a=be}={...v(this,Zt),...r};if(s===0)return(c=v(this,ot))==null||c.abort(),L(v(this,G),t),Promise.resolve();const o=X.now()+i;let l,u=!1,d=v(this,ot);return S(this,ot,hn(h=>{if(h<o)return!0;if(!u){u=!0;const m=v(this,G).v;l=a(m,t),typeof s=="function"&&(s=s(m,t)),d==null||d.abort()}const p=h-o;return p>s?(L(v(this,G),t),!1):(L(v(this,G),l(n(p/s))),!0)})),v(this,ot).promise}get current(){return M(v(this,G))}get target(){return M(v(this,kt))}set target(t){this.set(t)}};G=new WeakMap,kt=new WeakMap,Zt=new WeakMap,ot=new WeakMap;let Me=Ue;class Kt{constructor(t,r){f(this,"value");f(this,"motion");this.value=t,this.motion=new Me(t,r)}set(t,r){this.value=t,this.motion.set(t,r)}update(t){this.motion.set(this.value,t)}snap(){this.motion.set(this.value,{duration:0})}}var En=qr('<div><div class="body svelte-1nfn9j8"></div></div>');function bn(e,t){Oe(t,!0);let r,i;function s(){return i}let n=O(!1);function a(w){L(n,w,!0)}function o(){return M(n)}let l=new Kt(0,{easing:Ee});V(()=>{u(l.motion.current)}),V(()=>{M(n)==!1&&(l.snap(),K.clear(t.priority,t.id))});function u(w){r&&K.equeue(t.layer,t.priority,t.id,()=>{r.style.scale=w.toString(),r.style.filter=`brightness(${.25+.75*w})`,i.style.opacity=w.toString()})}function d(w){w!=l.value&&l.set(w,{duration:75})}function c(){return l.motion.current==0}function h(){return l.value}var p=En();let m,E;var b=ye(p);let R;return mt(b,w=>i=w,()=>i),mt(p,w=>r=w,()=>r),Tr((w,C,z)=>{m=Yr(p,1,"pin svelte-1nfn9j8",null,m,w),E=re(p,"",E,C),R=re(b,"",R,z)},[()=>({displayed:M(n)}),()=>({width:`${t.width}px`,height:`${t.height}px`,"border-radius":`${t.radius}px`}),()=>({width:`${t.width-4}px`,height:`${t.height-4}px`,"border-radius":`${t.radius-2}px`})]),Zr(e,p),Fe({getBody:s,setDisplayed:a,getDisplayed:o,setScale:d,getCollapsed:c,getScale:h})}var Mn=qr('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function Xr(e,t){Oe(t,!0);let r,i,s,n;const a=t.width+2*t.margin,o=t.height+2*t.margin,l=()=>n;V(()=>{s.style.width=`${t.margin*4}px`,s.style.height=`${t.margin*4}px`});let u=O(!0);function d(y){L(u,y,!0)}function c(){return M(u)}let h=O(!0);function p(y){L(h,y,!0)}function m(){return b.motion.current==0}function E(){return b.motion.current==1}let b=new Kt(0);V(()=>{R(b.motion.current)}),V(()=>{M(u)==!1&&(b.snap(),K.clear(t.priority,t.id+"_scale"))}),V(()=>{M(h)==!0&&b.value!=0&&(K.stacked()?b.set(0,{duration:0}):b.set(0,{duration:150,easing:pn})),M(h)==!1&&b.value!=1&&b.set(1,{duration:150,easing:vn})});function R(y){!r||!i||!s||K.equeue(M(h)?0:t.layer,t.priority,t.id+"_scale",()=>{r.style.opacity=`${y}`,i.style.scale=`${y}`,s.style.scale=`${y}`})}let w=NaN,C=O(!1),z=new Kt(-a/2,{easing:Ee}),Yt=new Kt(-o/2,{easing:Ee});V(()=>{Be(z.motion.current,Yt.motion.current)}),V(()=>{M(u)==!1&&(z.snap(),z.snap(),K.clear(t.priority,t.id+"_angle"))}),V(()=>{M(h)==!0&&M(C)&&(z.update({duration:75}),z.update({duration:75}))});function Be(y,W){if(!r||!i||!s)return;const Xt=y+a/2,Lt=W+o/2,pt=o<a?Xt*o/a:Xt,ue=o>a?Lt*a/o:Lt,Jr=Math.atan2(ue,pt)/Math.PI*180-45,He=0,Qr=30,fe=Math.sqrt(pt*pt+ue*ue),Pt=Math.min(a,o)/2,$r=Pt*Math.SQRT2,ti=(fe-Pt)/($r-Pt),Xe=He+ti*(Qr-He),ei=fe<Pt?fe/Pt:1;K.equeue(t.layer,t.priority,t.id+"_angle",()=>{i.style.transform=`translate(${Math.round(y)}px, ${Math.round(W)}px)`,s.style.transform=`scale(${ei}) rotate(${Jr}deg) skew(${Xe}deg, ${Xe}deg)`})}function Gr(y){if(M(C)==!1){let W=P.Rectangle.getOffsets(a,o,y);z.set(Math.round(W.x),{duration:0}),Yt.set(Math.round(W.y),{duration:0}),Be(z.value,Yt.value),w=y,L(C,!0)}else if(y!=w){let W=Math.abs(y-w),Xt=W<180?W:360-W,Lt=Math.log(Xt)*75,pt=P.Rectangle.getOffsets(a,o,y);z.set(Math.round(pt.x),{duration:Lt}),Yt.set(Math.round(pt.y),{duration:Lt}),w=y}}function Kr(){return P.Rectangle.getOffsets(a,o,w)}var Ht=Mn();let qe;var Ze=ye(Ht);mt(Ze,y=>s=y,()=>s);var le=zi(Ze,2),Ye=ye(le);return mt(Ye,y=>n=y,()=>n),mt(le,y=>i=y,()=>i),mt(Ht,y=>r=y,()=>r),Tr(y=>{qe=Yr(Ht,1,"anchor svelte-j5igi2",null,qe,y),re(le,`margin: ${t.margin}px;`),re(Ye,`width: ${t.width}px; height: ${t.height}px; border-radius: ${t.radius}px;`)},[()=>({displayed:M(u)})]),Zr(e,Ht),Fe({getBody:l,setDisplayed:d,getDisplayed:c,setCollapsed:p,getCollapsed:m,getExpanded:E,setAngle:Gr,getOffsets:Kr})}class Wr{constructor(t,r,i,s,n){f(this,"swLat");f(this,"swLng");f(this,"neLat");f(this,"neLng");const a=i*Math.pow(2,r),o=P.Mercator.project(t.sw.lat,t.sw.lng,a),l=P.Mercator.project(t.ne.lat,t.ne.lng,a),u=o.x-s,d=o.y+n,c=l.x+s,h=l.y-n,p=P.Mercator.unproject(u,d,a),m=P.Mercator.unproject(c,h,a);this.swLat=p.lat,this.swLng=p.lng,this.neLat=m.lat,this.neLng=m.lng}contains(t,r){return this.swLat<=t&&t<=this.neLat?this.swLng<this.neLng?this.swLng<=r&&r<=this.neLng:r<=this.neLng||this.swLng<=r:!1}}const Vr="https://maps.api.arenarium.dev",kn=`${Vr}/log`,An=`${Vr}/tooltip/states`,or="1.0.191";class Sn{constructor(t,r){f(this,"provider");f(this,"apiStatesUrl");f(this,"apiStatesKey");f(this,"apiLogEnabled");f(this,"markerDataArray",new Array);f(this,"markerDataMap",new Map);f(this,"markerDataUpdating",!1);f(this,"markerPinProcessor");f(this,"markerTooltipProcessor");f(this,"markerPopupProcessor");P.mapProviderSchema.parse(t),this.provider=t,this.markerPinProcessor=new Ae(t),this.markerTooltipProcessor=new xn(t),this.markerPopupProcessor=new Cn(t),this.configuration=r,this.log("info","Loaded")}set configuration(t){var r,i,s,n,a,o,l,u;this.apiStatesUrl=(i=(r=t==null?void 0:t.api)==null?void 0:r.states)==null?void 0:i.url,this.apiStatesKey=(n=(s=t==null?void 0:t.api)==null?void 0:s.states)==null?void 0:n.key,this.apiLogEnabled=(o=(a=t==null?void 0:t.api)==null?void 0:a.log)==null?void 0:o.enabled,this.markerPinProcessor.setConfiguration(t),K.setLimit(((u=(l=t==null?void 0:t.animation)==null?void 0:l.queue)==null?void 0:u.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(t){P.mapMarkersSchema.parse(t);try{let r;if(t.length>1){const i=this.provider.getParameters(),s=t.map(n=>({id:n.id,rank:n.rank,lat:n.lat,lng:n.lng,width:n.tooltip.style.width,height:n.tooltip.style.height,margin:n.tooltip.style.margin}));if(this.apiStatesKey!=null){const n={key:this.apiStatesKey,parameters:i,input:s},a=await fetch(this.apiStatesUrl??An,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok||!a.body)throw new Error("Failed to get marker states: "+a.statusText);r=await a.json()}else r=P.getStates(i,s)}else r=[[0,[[0,P.Angles.DEGREES.indexOf(P.Angles.DEGREES_DEFAULT)]]]];this.updateMarkerData(t,r),this.processMarkerDataCallback()}catch(r){throw console.error(r),this.removeMarkerData(),r instanceof Error&&this.log("error","Failed to update markers",r),r}}removeMarkers(){try{this.removeMarkerData()}catch(t){throw console.error(t),t instanceof Error&&this.log("error","Failed to remove markers",t),t}}showPopup(t){try{for(const r of this.markerDataArray)r.marker.id==t?this.markerPopupProcessor.show(r):this.markerPopupProcessor.hide(r)}catch(r){console.error(r);for(const i of this.markerDataArray)this.markerPopupProcessor.hide(i);throw r instanceof Error&&this.log("error","Failed to show popup",r),r}}hidePopup(t){try{if(t){const r=this.markerDataMap.get(t);if(r==null)return;this.markerPopupProcessor.hide(r)}else for(const r of this.markerDataArray)this.markerPopupProcessor.hide(r)}catch(r){console.error(r);for(const i of this.markerDataArray)this.markerPopupProcessor.hide(i);throw r instanceof Error&&this.log("error","Failed to hide popup",r),r}}updateMarkerData(t,r){try{this.markerDataUpdating=!0;const i=new Map(t.map((n,a)=>[n.id,new lr(this.provider,n,r[a])])),s=Array.from(this.markerDataArray);for(const n of s)i.has(n.marker.id)==!1&&(n.remove(),this.markerDataMap.delete(n.marker.id),this.markerDataArray.splice(this.markerDataArray.indexOf(n),1));for(let n=0;n<t.length;n++){const a=t[n],o=r[n],l=this.markerDataMap.get(a.id);if(l)l.update(o);else{const u=new lr(this.provider,a,o);u.create(),this.markerDataMap.set(a.id,u),this.markerDataArray.push(u)}}this.markerDataArray.sort((n,a)=>n.zoom-a.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(n=>n.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(n=>n.tooltip))}catch(i){throw console.error(i),this.markerDataArray.forEach(s=>s.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),i instanceof Error&&this.log("error","Failed to update marker data",i),i}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(t){throw console.error(t),t instanceof Error&&this.log("error","Failed to remove marker data",t),t}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(t){console.error(t),t instanceof Error&&this.log("error","Failed to process marker data",t)}}processMarkerData(){if(this.markerDataUpdating)return;const t=this.provider.getBounds(),r=this.provider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(t,r),this.markerPinProcessor.process(t,r)}async log(t,r,i){if(!(this.apiLogEnabled==null&&(window!=null&&window.location.host.startsWith("localhost")))&&this.apiLogEnabled!=!1)try{const s={title:`[CLIENT:${or}] ${r}`,level:t,content:{version:or,...i}};await fetch(kn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(s){console.error(s)}}}class lr{constructor(t,r,i){f(this,"marker");f(this,"zoom");f(this,"pin");f(this,"tooltip");this.marker=r,this.zoom=i[0],this.pin=new ke(t,r,i),this.tooltip=new Se(t,r,i)}create(){this.pin.create(),this.tooltip.create()}update(t){this.pin.update(t),this.tooltip.update(t)}remove(){this.pin.remove(),this.tooltip.remove()}}class je{constructor(t,r){f(this,"provider");f(this,"id");f(this,"lat");f(this,"lng");f(this,"shown");f(this,"element");f(this,"component");f(this,"marker");this.provider=t,this.id=r.id,this.lat=r.lat,this.lng=r.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const t=this.element;if(!t)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(t,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(t){const r=this.marker,i=this.component;if(r==null||i==null)throw new Error("Failed to update provider marker map");t?r.inserted()==!1&&r.insert():r.inserted()==!0&&r.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var t,r;(t=this.marker)==null||t.remove(),(r=this.element)==null||r.remove()}}const gt=class gt extends je{constructor(r,i,s){var n,a,o,l;super(r,i);f(this,"width");f(this,"height");f(this,"radius");f(this,"zoom");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=((n=i.pin)==null?void 0:n.style.width)??gt.DEFAULT_SIZE,this.height=((a=i.pin)==null?void 0:a.style.height)??gt.DEFAULT_SIZE,this.radius=((o=i.pin)==null?void 0:o.style.radius)??gt.DEFAULT_SIZE,this.zoom=s[0],this.bodyCallback=(l=i.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=ze(bn,{target:this.element,props:{id:this.id+"_pin",layer:_n,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(r){this.zoom=r[0],this.updateZIndex()}updateMap(r){var i;super.updateMap(r),(i=this.component)==null||i.setDisplayed(r)}updateState(r){if(this.component==null)throw new Error("Failed to update pin state");this.component.setScale(this.getScale(r))}updateBody(){var i;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const r=(i=this.component)==null?void 0:i.getBody();r!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?r.appendChild(s):console.error("Failed to load pin body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(r){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setScale(r?0:1)}getScale(r){return this.zoom<r?1:Math.max(0,1-(this.zoom-r)*.125)}getZindex(){const r=this.provider.getParameters();return Math.round((r.zoomMax-this.zoom)*r.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};f(gt,"DEFAULT_SIZE",16);let ke=gt;const wt=class wt{constructor(t){f(this,"provider");f(this,"pinElements",new Array);f(this,"pinMaxWidth",0);f(this,"pinMaxHeight",0);f(this,"pinFade",!1);f(this,"pinMaxCount",0);f(this,"pinMaxZoomDelta",0);this.provider=t}setConfiguration(t){var r,i,s;this.pinFade=((r=t==null?void 0:t.pin)==null?void 0:r.fade)??!0,this.pinMaxCount=((i=t==null?void 0:t.pin)==null?void 0:i.maxCount)??Math.max(wt.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((s=t==null?void 0:t.pin)==null?void 0:s.maxZoom)??wt.MAP_PINS_MAX_ZOOM}updateElements(t){this.pinElements=t,this.pinMaxWidth=t.reduce((r,i)=>Math.max(r,i.width),0),this.pinMaxHeight=t.reduce((r,i)=>Math.max(r,i.height),0)}removeElements(){this.pinElements.forEach(t=>t.remove()),this.pinElements.length=0}process(t,r){const i=this.provider.getParameters().mapSize,s=new Wr(t,r,i,this.pinMaxWidth*2,this.pinMaxHeight*2);let n=0;for(const a of this.pinElements)s.contains(a.lat,a.lng)?a.shown&&r<a.zoom&&a.zoom<r+this.pinMaxZoomDelta?(n<this.pinMaxCount&&(this.pinFade==!0?a.updateState(r):a.setCollapsed(!1),a.updateMap(!0),a.isBodyLoaded()==!1&&a.updateBody()),n++):(a.setCollapsed(!0),a.isCollapsed()&&a.updateMap(!1)):a.updateMap(!1)}};f(wt,"MAP_PINS_MAX_ZOOM",2),f(wt,"MAP_PINS_MAX_COUNT",128);let Ae=wt;const ne=class ne extends je{constructor(r,i,s){super(r,i);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"zoom");f(this,"angle");f(this,"states");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=i.tooltip.style.width,this.height=i.tooltip.style.height,this.margin=i.tooltip.style.margin,this.radius=i.tooltip.style.radius,this.zoom=s[0],this.angle=P.Angles.DEGREES_DEFAULT,this.states=s[1].map(n=>[n[0],P.Angles.DEGREES[n[1]]]),this.bodyCallback=i.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=ze(Xr,{target:this.element,props:{id:this.id+"_tooltip",layer:wn,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(r){this.zoom=r[0],this.states=r[1].map(i=>[i[0],P.Angles.DEGREES[i[1]]]),this.updateZIndex()}updateMap(r){var i;super.updateMap(r),(i=this.component)==null||i.setDisplayed(r)}updateState(r){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(r),this.component.setAngle(this.angle)}updateBody(){var i;if(this.bodyLoaded||this.bodyLoading)return;const r=(i=this.component)==null?void 0:i.getBody();r!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?r.appendChild(s):console.error("Failed to load tooltip body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(r){const i=this.states.findLast(s=>s[0]<=r);if(!i)throw new Error("Angle not found");return i[1]}getZindex(){const r=this.provider.getParameters();return Math.round((r.zoomMax-this.zoom)*r.zoomScale)+ne.Z_INDEX_OFFSET}setCollapsed(r){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(r)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(ne,"Z_INDEX_OFFSET",1e6);let Se=ne;class xn{constructor(t){f(this,"provider");f(this,"tooltipElements",new Array);f(this,"tooltipMaxWidth",0);f(this,"tooltipMaxHeight",0);this.provider=t}updateElements(t){this.tooltipElements=t,this.tooltipMaxWidth=this.tooltipElements.reduce((r,i)=>Math.max(r,i.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((r,i)=>Math.max(r,i.height),0)}removeElements(){this.tooltipElements.forEach(t=>t.remove()),this.tooltipElements.length=0}process(t,r){const i=this.provider.getParameters().mapSize,s=new Wr(t,r,i,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const n of this.tooltipElements)s.contains(n.lat,n.lng)?n.shown&&n.zoom<=r?(n.updateState(r),n.setCollapsed(!1),n.updateMap(!0),n.isCollapsed()==!1&&n.isBodyLoaded()==!1&&n.updateBody()):(n.setCollapsed(!0),n.isCollapsed()&&n.updateMap(!1)):n.updateMap(!1)}}const se=class se extends je{constructor(r,i){if(i.popup==null)throw new Error("Failed to create popup");super(r,i);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.shown=!1,this.width=i.popup.style.width,this.height=i.popup.style.height,this.margin=i.popup.style.margin,this.radius=i.popup.style.radius,this.bodyCallback=i.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=ze(Xr,{target:this.element,props:{id:this.id+"_popup",layer:gn,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(r){var i;super.updateMap(r),(i=this.component)==null||i.setDisplayed(r)}updateBody(){var i;if(this.bodyLoaded||this.bodyLoading)return;const r=(i=this.component)==null?void 0:i.getBody();r!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?r.appendChild(s):console.error("Failed to load popup body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return se.Z_INDEX_OFFSET}setCollapsed(r){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(r)}setAngle(r){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(r)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(se,"Z_INDEX_OFFSET",2e6);let xe=se;class Cn{constructor(t){f(this,"provider");f(this,"popupElements",new Map);f(this,"popupPositioned",new Map);this.provider=t}show(t){t.pin.shown=!1,t.tooltip.shown=!1;const r=new xe(this.provider,t.marker);this.popupElements.set(t.marker.id,r),this.popupPositioned.set(t.marker.id,!1),r.create(),r.setAngle(t.tooltip.angle),r.shown=!0}hide(t){t.pin.shown=!0,t.tooltip.shown=!0;const r=this.popupElements.get(t.marker.id);r!=null&&(r.shown=!1)}clear(){this.popupElements.values().forEach(t=>t.remove()),this.popupElements.clear(),this.popupPositioned.clear()}process(){var t,r;for(const i of this.popupElements.values())if(i.shown){if(i.setCollapsed(!1),i.updateMap(!0),i.isExpanded()&&i.isBodyLoaded()==!1&&i.updateBody(),i.isCollapsed()==!1&&this.popupPositioned.get(i.id)==!1){const s=(t=i.component)==null?void 0:t.getBody();if(s==null)continue;const n=(r=i.component)==null?void 0:r.getOffsets();if(n==null)continue;const a=s.getBoundingClientRect();if(a.x==0&&a.y==0&&a.width==0&&a.height==0)continue;const o=a.x+a.width/2,l=a.y+a.height/2,u=o+n.x,d=l+n.y,c=u+i.width,h=d+i.height,p=this.provider.getContainer().getBoundingClientRect(),m=u-p.left,E=p.right-c,b=d-p.top,R=p.bottom-h,w=Math.min(i.width,i.height)/4,C=m<0?m-w:E<0?-E+w:0,z=b<0?b-w:R<0?-R+w:0;this.provider.panBy(C,z),this.popupPositioned.set(i.id,!0)}}else i.setCollapsed(!0),i.isCollapsed()&&(i.updateMap(!1),i.remove(),this.popupElements.delete(i.id),this.popupPositioned.delete(i.id))}}exports.MapManager=Sn;
|
package/dist/main.es.js
CHANGED
|
@@ -1869,7 +1869,7 @@ class Gr {
|
|
|
1869
1869
|
return this.swLat <= t && t <= this.neLat ? this.swLng < this.neLng ? this.swLng <= r && r <= this.neLng : r <= this.neLng || this.swLng <= r : !1;
|
|
1870
1870
|
}
|
|
1871
1871
|
}
|
|
1872
|
-
const Kr = "https://arenarium.dev
|
|
1872
|
+
const Kr = "https://maps.api.arenarium.dev", Dn = `${Kr}/log`, Ln = `${Kr}/tooltip/states`, ur = "1.0.191";
|
|
1873
1873
|
class Rn {
|
|
1874
1874
|
constructor(t, r) {
|
|
1875
1875
|
f(this, "provider");
|
|
@@ -2175,7 +2175,7 @@ const gt = class gt {
|
|
|
2175
2175
|
const i = this.provider.getParameters().mapSize, s = new Gr(t, r, i, this.pinMaxWidth * 2, this.pinMaxHeight * 2);
|
|
2176
2176
|
let n = 0;
|
|
2177
2177
|
for (const a of this.pinElements)
|
|
2178
|
-
s.contains(a.lat, a.lng) ? a.shown && r
|
|
2178
|
+
s.contains(a.lat, a.lng) ? a.shown && r < a.zoom && a.zoom < r + this.pinMaxZoomDelta ? (n < this.pinMaxCount && (this.pinFade == !0 ? a.updateState(r) : a.setCollapsed(!1), a.updateMap(!0), a.isBodyLoaded() == !1 && a.updateBody()), n++) : (a.setCollapsed(!0), a.isCollapsed() && a.updateMap(!1)) : a.updateMap(!1);
|
|
2179
2179
|
}
|
|
2180
2180
|
};
|
|
2181
2181
|
f(gt, "MAP_PINS_MAX_ZOOM", 2), f(gt, "MAP_PINS_MAX_COUNT", 128);
|