@arenarium/maps 1.0.206 → 1.0.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(z,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(z=typeof globalThis<"u"?globalThis:z||self,N(z.arenarium={}))})(this,(function(z){"use strict";var Fs=Object.defineProperty;var vn=z=>{throw TypeError(z)};var Bs=(z,N,O)=>N in z?Fs(z,N,{enumerable:!0,configurable:!0,writable:!0,value:O}):z[N]=O;var p=(z,N,O)=>Bs(z,typeof N!="symbol"?N+"":N,O),Gr=(z,N,O)=>N.has(z)||vn("Cannot "+O);var b=(z,N,O)=>(Gr(z,N,"read from private field"),O?O.call(z):N.get(z)),Z=(z,N,O)=>N.has(z)?vn("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(z):N.set(z,O),B=(z,N,O,Pt)=>(Gr(z,N,"write to private field"),Pt?Pt.call(z,O):N.set(z,O),O),Be=(z,N,O)=>(Gr(z,N,"access private method"),O);var nt,it,Te,Et,Ct,Ze,st,De,Ae,ot,Tt,At,ie,xn,rr,Xr,fn,he,lt,Nt,Fe;var O=Array.isArray,Pt=Array.prototype.indexOf,wn=Array.from,ar=Object.defineProperty,pt=Object.getOwnPropertyDescriptor,bn=Object.prototype,kn=Array.prototype,Sn=Object.getPrototypeOf,Jr=Object.isExtensible;function zn(r){for(var e=0;e<r.length;e++)r[e]()}function Mn(){var r,e,t=new Promise((a,n)=>{r=a,e=n});return{promise:t,resolve:r,reject:e}}const G=2,nr=4,Kr=8,ft=16,ge=32,Ne=64,Qr=128,Q=256,Ot=512,q=1024,se=2048,_e=4096,Ve=8192,Ue=16384,ir=32768,En=65536,ea=1<<17,Cn=1<<18,sr=1<<19,Tn=1<<20,or=1<<21,lr=1<<22,Le=1<<23,jt=Symbol("$state"),cr=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 An(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Nn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ln(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Rn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Pn(r){throw new Error("https://svelte.dev/e/effect_orphan")}function On(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function jn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function In(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Zn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const Dn=2,F=Symbol();function ta(r){return r===this.v}let Vs=!1,ae=null;function It(r){ae=r}function ur(r,e=!1,t){ae={p:ae,c:null,e:null,s:r,x:null,l:null}}function dr(r){var e=ae,t=e.e;if(t!==null){e.e=null;for(var a of t)va(a)}return r!==void 0&&(e.x=r),ae=e.p,r??{}}function ra(){return!0}const Fn=new WeakMap;function Bn(r){var e=A;if(e===null)return M.f|=Le,r;if((e.f&ir)===0){if((e.f&Qr)===0)throw!e.parent&&r instanceof Error&&aa(r),r;e.b.error(r)}else pr(r,e)}function pr(r,e){for(;e!==null;){if((e.f&Qr)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&aa(r),r}function aa(r){const e=Fn.get(r);e&&(ar(r,"message",{value:e.message}),ar(r,"stack",{value:e.stack}))}let Zt=[];function Vn(){var r=Zt;Zt=[],zn(r)}function Un(r){Zt.length===0&&queueMicrotask(Vn),Zt.push(r)}function $n(){for(var r=A.b;r!==null&&!r.has_pending_snippet();)r=r.parent;return r===null&&An(),r}function qn(r){var e=G|se,t=M!==null&&(M.f&G)!==0?M:null;return A===null||t!==null&&(t.f&Q)!==0?e|=Q:A.f|=sr,{ctx:ae,deps:null,effects:null,equals:ta,f:e,fn:r,reactions:null,rv:0,v:F,wv:0,parent:t??A,ac:null}}function Wn(r,e){let t=A;t===null&&Nn();var a=t.b,n=void 0,i=ua(F),s=null,o=!M;return ii(()=>{try{var l=r()}catch(m){l=Promise.reject(m)}var c=()=>l;n=(s==null?void 0:s.then(c,c))??Promise.resolve(l),s=n;var u=W,h=a.pending;o&&(a.update_pending_count(1),h||u.increment());const _=(m,v=void 0)=>{s=null,h||u.activate(),v?v!==cr&&(i.f|=Le,yr(i,v)):((i.f&Le)!==0&&(i.f^=Le),yr(i,m)),o&&(a.update_pending_count(-1),h||u.decrement()),sa()};if(n.then(_,m=>_(null,m||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(l=>{function c(u){function h(){u===n?l(i):c(n)}u.then(h,h)}c(n)})}function na(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Oe(e[t])}}function Hn(r){for(var e=r.parent;e!==null;){if((e.f&G)===0)return e;e=e.parent}return null}function fr(r){var e,t=A;we(Hn(r));try{na(r),e=La(r)}finally{we(t)}return e}function ia(r){var e=fr(r);if(r.equals(e)||(r.v=e,r.wv=Aa()),!qe)if(ve!==null)ve.set(r,r.v);else{var t=(be||(r.f&Q)!==0)&&r.deps!==null?_e:q;te(r,t)}}function Yn(r,e,t){const a=qn;if(e.length===0){t(r.map(a));return}var n=W,i=A,s=Gn(),o=$n();Promise.all(e.map(l=>Wn(l))).then(l=>{n==null||n.activate(),s();try{t([...r.map(a),...l])}catch(c){(i.f&Ue)===0&&pr(c,i)}n==null||n.deactivate(),sa()}).catch(l=>{o.error(l)})}function Gn(){var r=A,e=M,t=ae;return function(){we(r),le(e),It(t)}}function sa(){we(null),le(null),It(null)}const ht=new Set;let W=null,ve=null,oa=new Set,Dt=[];function la(){const r=Dt.shift();Dt.length>0&&queueMicrotask(la),r()}let mt=[],hr=null,mr=!1;const Xt=class Xt{constructor(){Z(this,ie);p(this,"current",new Map);Z(this,nt,new Map);Z(this,it,new Set);Z(this,Te,0);Z(this,Et,null);Z(this,Ct,!1);Z(this,Ze,[]);Z(this,st,[]);Z(this,De,[]);Z(this,Ae,[]);Z(this,ot,[]);Z(this,Tt,[]);Z(this,At,[]);p(this,"skipped_effects",new Set)}process(e){var i;mt=[];var t=null;if(ht.size>1){t=new Map,ve=new Map;for(const[s,o]of this.current)t.set(s,{v:s.v,wv:s.wv}),s.v=o;for(const s of ht)if(s!==this)for(const[o,l]of b(s,nt))t.has(o)||(t.set(o,{v:o.v,wv:o.wv}),o.v=l)}for(const s of e)Be(this,ie,xn).call(this,s);if(b(this,Ze).length===0&&b(this,Te)===0){Be(this,ie,Xr).call(this);var a=b(this,De),n=b(this,Ae);B(this,De,[]),B(this,Ae,[]),B(this,ot,[]),W=null,ca(a),ca(n),W===null?W=this:ht.delete(this),(i=b(this,Et))==null||i.resolve()}else Be(this,ie,rr).call(this,b(this,De)),Be(this,ie,rr).call(this,b(this,Ae)),Be(this,ie,rr).call(this,b(this,ot));if(t){for(const[s,{v:o,wv:l}]of t)s.wv<=l&&(s.v=o);ve=null}for(const s of b(this,Ze))We(s);for(const s of b(this,st))We(s);B(this,Ze,[]),B(this,st,[])}capture(e,t){b(this,nt).has(e)||b(this,nt).set(e,t),this.current.set(e,e.v)}activate(){W=this}deactivate(){W=null;for(const e of oa)if(oa.delete(e),e(),W!==null)break}neuter(){B(this,Ct,!0)}flush(){mt.length>0?Xn():Be(this,ie,Xr).call(this),W===this&&(b(this,Te)===0&&ht.delete(this),this.deactivate())}increment(){B(this,Te,b(this,Te)+1)}decrement(){if(B(this,Te,b(this,Te)-1),b(this,Te)===0){for(const e of b(this,Tt))te(e,se),gt(e);for(const e of b(this,At))te(e,_e),gt(e);B(this,De,[]),B(this,Ae,[]),this.flush()}else this.deactivate()}add_callback(e){b(this,it).add(e)}settled(){return(b(this,Et)??B(this,Et,Mn())).promise}static ensure(){if(W===null){const e=W=new Xt;ht.add(W),Xt.enqueue(()=>{W===e&&e.flush()})}return W}static enqueue(e){Dt.length===0&&queueMicrotask(la),Dt.unshift(e)}};nt=new WeakMap,it=new WeakMap,Te=new WeakMap,Et=new WeakMap,Ct=new WeakMap,Ze=new WeakMap,st=new WeakMap,De=new WeakMap,Ae=new WeakMap,ot=new WeakMap,Tt=new WeakMap,At=new WeakMap,ie=new WeakSet,xn=function(e){var u;e.f^=q;for(var t=e.first;t!==null;){var a=t.f,n=(a&(ge|Ne))!==0,i=n&&(a&q)!==0,s=i||(a&Ve)!==0||this.skipped_effects.has(t);if(!s&&t.fn!==null){if(n)t.f^=q;else if((a&nr)!==0)b(this,Ae).push(t);else if((a&q)===0)if((a&lr)!==0){var o=(u=t.b)!=null&&u.pending?b(this,st):b(this,Ze);o.push(t)}else Ft(t)&&((t.f&ft)!==0&&b(this,ot).push(t),We(t));var l=t.first;if(l!==null){t=l;continue}}var c=t.parent;for(t=t.next;t===null&&c!==null;)t=c.next,c=c.parent}},rr=function(e){for(const t of e)((t.f&se)!==0?b(this,Tt):b(this,At)).push(t),te(t,q);e.length=0},Xr=function(){if(!b(this,Ct))for(const e of b(this,it))e();b(this,it).clear()};let yt=Xt;function Xn(){var r=$e;mr=!0;try{var e=0;for(Ma(!0);mt.length>0;){var t=yt.ensure();if(e++>1e3){var a,n;Jn()}t.process(mt),xe.clear()}}finally{mr=!1,Ma(r),hr=null}}function Jn(){try{On()}catch(r){pr(r,hr)}}let Re=null;function ca(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var a=r[t++];if((a.f&(Ue|Ve))===0&&Ft(a)&&(Re=[],We(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?Sa(a):a.fn=null),Re.length>0)){xe.clear();for(const n of Re)We(n);Re=[]}}Re=null}}function gt(r){for(var e=hr=r;e.parent!==null;){e=e.parent;var t=e.f;if(mr&&e===A&&(t&ft)!==0)return;if((t&(Ne|ge))!==0){if((t&q)===0)return;e.f^=q}}mt.push(e)}const xe=new Map;function ua(r,e){var t={f:0,v:r,reactions:null,equals:ta,rv:0,wv:0};return t}function H(r,e){const t=ua(r);return di(t),t}function V(r,e,t=!1){M!==null&&(!oe||(M.f&ea)!==0)&&ra()&&(M.f&(G|ft|lr|ea))!==0&&!(U!=null&&U.includes(r))&&Zn();let a=t?_t(e):e;return yr(r,a)}function yr(r,e){if(!r.equals(e)){var t=r.v;qe?xe.set(r,e):xe.set(r,t),r.v=e;var a=yt.ensure();a.capture(r,t),(r.f&G)!==0&&((r.f&se)!==0&&fr(r),te(r,(r.f&Q)===0?q:_e)),r.wv=Aa(),da(r,se),A!==null&&(A.f&q)!==0&&(A.f&(ge|Ne))===0&&(ee===null?pi([r]):ee.push(r))}return e}function gr(r){V(r,r.v+1)}function da(r,e){var t=r.reactions;if(t!==null)for(var a=t.length,n=0;n<a;n++){var i=t[n],s=i.f,o=(s&se)===0;o&&te(i,e),(s&G)!==0?da(i,_e):o&&((s&ft)!==0&&Re!==null&&Re.push(i),gt(i))}}function _t(r){if(typeof r!="object"||r===null||jt in r)return r;const e=Sn(r);if(e!==bn&&e!==kn)return r;var t=new Map,a=O(r),n=H(0),i=je,s=o=>{if(je===i)return o();var l=M,c=je;le(null),Ta(i);var u=o();return le(l),Ta(c),u};return a&&t.set("length",H(r.length)),new Proxy(r,{defineProperty(o,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&jn();var u=t.get(l);return u===void 0?u=s(()=>{var h=H(c.value);return t.set(l,h),h}):V(u,c.value,!0),!0},deleteProperty(o,l){var c=t.get(l);if(c===void 0){if(l in o){const u=s(()=>H(F));t.set(l,u),gr(n)}}else V(c,F),gr(n);return!0},get(o,l,c){var m;if(l===jt)return r;var u=t.get(l),h=l in o;if(u===void 0&&(!h||(m=pt(o,l))!=null&&m.writable)&&(u=s(()=>{var v=_t(h?o[l]:F),T=H(v);return T}),t.set(l,u)),u!==void 0){var _=j(u);return _===F?void 0:_}return Reflect.get(o,l,c)},getOwnPropertyDescriptor(o,l){var c=Reflect.getOwnPropertyDescriptor(o,l);if(c&&"value"in c){var u=t.get(l);u&&(c.value=j(u))}else if(c===void 0){var h=t.get(l),_=h==null?void 0:h.v;if(h!==void 0&&_!==F)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return c},has(o,l){var _;if(l===jt)return!0;var c=t.get(l),u=c!==void 0&&c.v!==F||Reflect.has(o,l);if(c!==void 0||A!==null&&(!u||(_=pt(o,l))!=null&&_.writable)){c===void 0&&(c=s(()=>{var m=u?_t(o[l]):F,v=H(m);return v}),t.set(l,c));var h=j(c);if(h===F)return!1}return u},set(o,l,c,u){var K;var h=t.get(l),_=l in o;if(a&&l==="length")for(var m=c;m<h.v;m+=1){var v=t.get(m+"");v!==void 0?V(v,F):m in o&&(v=s(()=>H(F)),t.set(m+"",v))}if(h===void 0)(!_||(K=pt(o,l))!=null&&K.writable)&&(h=s(()=>H(void 0)),V(h,_t(c)),t.set(l,h));else{_=h.v!==F;var T=s(()=>_t(c));V(h,T)}var P=Reflect.getOwnPropertyDescriptor(o,l);if(P!=null&&P.set&&P.set.call(u,c),!_){if(a&&typeof l=="string"){var me=t.get("length"),D=Number(l);Number.isInteger(D)&&D>=me.v&&V(me,D+1)}gr(n)}return!0},ownKeys(o){j(n);var l=Reflect.ownKeys(o).filter(h=>{var _=t.get(h);return _===void 0||_.v!==F});for(var[c,u]of t)u.v!==F&&!(c in o)&&l.push(c);return l},setPrototypeOf(){In()}})}var pa,fa,ha,ma;function Kn(){if(pa===void 0){pa=window,fa=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;ha=pt(e,"firstChild").get,ma=pt(e,"nextSibling").get,Jr(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),Jr(t)&&(t.__t=void 0)}}function Qn(r=""){return document.createTextNode(r)}function ya(r){return ha.call(r)}function ga(r){return ma.call(r)}function _r(r,e){return ya(r)}function ei(r,e=1,t=!1){let a=r;for(;e--;)a=ga(a);return a}function _a(r){var e=M,t=A;le(null),we(null);try{return r()}finally{le(e),we(t)}}function ti(r){A===null&&M===null&&Pn(),M!==null&&(M.f&Q)!==0&&A===null&&Rn(),qe&&Ln()}function ri(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Pe(r,e,t,a=!0){var n=A;n!==null&&(n.f&Ve)!==0&&(r|=Ve);var i={ctx:ae,deps:null,nodes_start:null,nodes_end:null,f:r|se,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{We(i),i.f|=ir}catch(l){throw Oe(i),l}else e!==null&&gt(i);var s=t&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&sr)===0;if(!s&&a&&(n!==null&&ri(i,n),M!==null&&(M.f&G)!==0&&(r&Ne)===0)){var o=M;(o.effects??(o.effects=[])).push(i)}return i}function pe(r){ti();var e=A.f,t=!M&&(e&ge)!==0&&(e&ir)===0;if(t){var a=ae;(a.e??(a.e=[])).push(r)}else return va(r)}function va(r){return Pe(nr|Tn,r,!1)}function ai(r){yt.ensure();const e=Pe(Ne,r,!0);return(t={})=>new Promise(a=>{t.outro?ci(e,()=>{Oe(e),a(void 0)}):(Oe(e),a(void 0))})}function ni(r){return Pe(nr,r,!1)}function ii(r){return Pe(lr|sr,r,!0)}function xa(r,e=0){return Pe(Kr|e,r,!0)}function wa(r,e=[],t=[]){Yn(e,t,a=>{Pe(Kr,()=>r(...a.map(j)),!0)})}function si(r,e=!0){return Pe(ge,r,!0,e)}function ba(r){var e=r.teardown;if(e!==null){const t=qe,a=M;Ea(!0),le(null);try{e.call(null)}finally{Ea(t),le(a)}}}function ka(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const n=t.ac;n!==null&&_a(()=>{n.abort(cr)});var a=t.next;(t.f&Ne)!==0?t.parent=null:Oe(t,e),t=a}}function oi(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&ge)===0&&Oe(e),e=t}}function Oe(r,e=!0){var t=!1;(e||(r.f&Cn)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(li(r.nodes_start,r.nodes_end),t=!0),ka(r,e&&!t),Bt(r,0),te(r,Ue);var a=r.transitions;if(a!==null)for(const i of a)i.stop();ba(r);var n=r.parent;n!==null&&n.first!==null&&Sa(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function li(r,e){for(;r!==null;){var t=r===e?null:ga(r);r.remove(),r=t}}function Sa(r){var e=r.parent,t=r.prev,a=r.next;t!==null&&(t.next=a),a!==null&&(a.prev=t),e!==null&&(e.first===r&&(e.first=a),e.last===r&&(e.last=t))}function ci(r,e){var t=[];za(r,t,!0),ui(t,()=>{Oe(r),e&&e()})}function ui(r,e){var t=r.length;if(t>0){var a=()=>--t||e();for(var n of r)n.out(a)}else e()}function za(r,e,t){if((r.f&Ve)===0){if(r.f^=Ve,r.transitions!==null)for(const s of r.transitions)(s.is_global||t)&&e.push(s);for(var a=r.first;a!==null;){var n=a.next,i=(a.f&En)!==0||(a.f&ge)!==0;za(a,e,i?t:!1),a=n}}}let $e=!1;function Ma(r){$e=r}let qe=!1;function Ea(r){qe=r}let M=null,oe=!1;function le(r){M=r}let A=null;function we(r){A=r}let U=null;function di(r){M!==null&&(U===null?U=[r]:U.push(r))}let $=null,X=0,ee=null;function pi(r){ee=r}let Ca=1,vt=0,je=vt;function Ta(r){je=r}let be=!1;function Aa(){return++Ca}function Ft(r){var h;var e=r.f;if((e&se)!==0)return!0;if((e&_e)!==0){var t=r.deps,a=(e&Q)!==0;if(t!==null){var n,i,s=(e&Ot)!==0,o=a&&A!==null&&!be,l=t.length;if((s||o)&&(A===null||(A.f&Ue)===0)){var c=r,u=c.parent;for(n=0;n<l;n++)i=t[n],(s||!((h=i==null?void 0:i.reactions)!=null&&h.includes(c)))&&(i.reactions??(i.reactions=[])).push(c);s&&(c.f^=Ot),o&&u!==null&&(u.f&Q)===0&&(c.f^=Q)}for(n=0;n<l;n++)if(i=t[n],Ft(i)&&ia(i),i.wv>r.wv)return!0}(!a||A!==null&&!be)&&te(r,q)}return!1}function Na(r,e,t=!0){var a=r.reactions;if(a!==null&&!(U!=null&&U.includes(r)))for(var n=0;n<a.length;n++){var i=a[n];(i.f&G)!==0?Na(i,e,!1):e===i&&(t?te(i,se):(i.f&q)!==0&&te(i,_e),gt(i))}}function La(r){var T;var e=$,t=X,a=ee,n=M,i=be,s=U,o=ae,l=oe,c=je,u=r.f;$=null,X=0,ee=null,be=(u&Q)!==0&&(oe||!$e||M===null),M=(u&(ge|Ne))===0?r:null,U=null,It(r.ctx),oe=!1,je=++vt,r.ac!==null&&(_a(()=>{r.ac.abort(cr)}),r.ac=null);try{r.f|=or;var h=r.fn,_=h(),m=r.deps;if($!==null){var v;if(Bt(r,X),m!==null&&X>0)for(m.length=X+$.length,v=0;v<$.length;v++)m[X+v]=$[v];else r.deps=m=$;if(!be||(u&G)!==0&&r.reactions!==null)for(v=X;v<m.length;v++)((T=m[v]).reactions??(T.reactions=[])).push(r)}else m!==null&&X<m.length&&(Bt(r,X),m.length=X);if(ra()&&ee!==null&&!oe&&m!==null&&(r.f&(G|_e|se))===0)for(v=0;v<ee.length;v++)Na(ee[v],r);return n!==null&&n!==r&&(vt++,ee!==null&&(a===null?a=ee:a.push(...ee))),(r.f&Le)!==0&&(r.f^=Le),_}catch(P){return Bn(P)}finally{r.f^=or,$=e,X=t,ee=a,M=n,be=i,U=s,It(o),oe=l,je=c}}function fi(r,e){let t=e.reactions;if(t!==null){var a=Pt.call(t,r);if(a!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[a]=t[n],t.pop())}}t===null&&(e.f&G)!==0&&($===null||!$.includes(e))&&(te(e,_e),(e.f&(Q|Ot))===0&&(e.f^=Ot),na(e),Bt(e,0))}function Bt(r,e){var t=r.deps;if(t!==null)for(var a=e;a<t.length;a++)fi(r,t[a])}function We(r){var e=r.f;if((e&Ue)===0){te(r,q);var t=A,a=$e;A=r,$e=!0;try{(e&ft)!==0?oi(r):ka(r),ba(r);var n=La(r);r.teardown=typeof n=="function"?n:null,r.wv=Ca;var i}finally{$e=a,A=t}}}function j(r){var e=r.f,t=(e&G)!==0;if(M!==null&&!oe){var a=A!==null&&(A.f&Ue)!==0;if(!a&&!(U!=null&&U.includes(r))){var n=M.deps;if((M.f&or)!==0)r.rv<vt&&(r.rv=vt,$===null&&n!==null&&n[X]===r?X++:$===null?$=[r]:(!be||!$.includes(r))&&$.push(r));else{(M.deps??(M.deps=[])).push(r);var i=r.reactions;i===null?r.reactions=[M]:i.includes(M)||i.push(M)}}}else if(t&&r.deps===null&&r.effects===null){var s=r,o=s.parent;o!==null&&(o.f&Q)===0&&(s.f^=Q)}if(qe){if(xe.has(r))return xe.get(r);if(t){s=r;var l=s.v;return((s.f&q)===0&&s.reactions!==null||Ra(s))&&(l=fr(s)),xe.set(s,l),l}}else if(t){if(s=r,ve!=null&&ve.has(s))return ve.get(s);Ft(s)&&ia(s)}if((r.f&Le)!==0)throw r.v;return r.v}function Ra(r){if(r.v===F)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(xe.has(e)||(e.f&G)!==0&&Ra(e))return!0;return!1}function hi(r){var e=oe;try{return oe=!0,r()}finally{oe=e}}const mi=-7169;function te(r,e){r.f=r.f&mi|e}const yi=["touchstart","touchmove"];function gi(r){return yi.includes(r)}const _i=new Set,Pa=new Set;let Oa=null;function Vt(r){var D;var e=this,t=e.ownerDocument,a=r.type,n=((D=r.composedPath)==null?void 0:D.call(r))||[],i=n[0]||r.target;Oa=r;var s=0,o=Oa===r&&r.__root;if(o){var l=n.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var c=n.indexOf(e);if(c===-1)return;l<=c&&(s=l)}if(i=n[s]||r.target,i!==e){ar(r,"currentTarget",{configurable:!0,get(){return i||t}});var u=M,h=A;le(null),we(null);try{for(var _,m=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var T=i["__"+a];if(T!=null&&(!i.disabled||r.target===i))if(O(T)){var[P,...me]=T;P.apply(i,[r,...me])}else T.call(i,r)}catch(K){_?m.push(K):_=K}if(r.cancelBubble||v===e||v===null)break;i=v}if(_){for(let K of m)queueMicrotask(()=>{throw K});throw _}}finally{r.__root=e,delete r.currentTarget,le(u),we(h)}}}function vi(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function xi(r,e){var t=A;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function ja(r,e){var t=(e&Dn)!==0,a,n=!r.startsWith("<!>");return()=>{a===void 0&&(a=vi(n?r:"<!>"+r),a=ya(a));var i=t||fa?document.importNode(a,!0):a.cloneNode(!0);return xi(i,i),i}}function Ia(r,e){r!==null&&r.before(e)}function vr(r,e){return wi(r,e)}const He=new Map;function wi(r,{target:e,anchor:t,props:a={},events:n,context:i,intro:s=!0}){Kn();var o=new Set,l=h=>{for(var _=0;_<h.length;_++){var m=h[_];if(!o.has(m)){o.add(m);var v=gi(m);e.addEventListener(m,Vt,{passive:v});var T=He.get(m);T===void 0?(document.addEventListener(m,Vt,{passive:v}),He.set(m,1)):He.set(m,T+1)}}};l(wn(_i)),Pa.add(l);var c=void 0,u=ai(()=>{var h=t??e.appendChild(Qn());return si(()=>{if(i){ur({});var _=ae;_.c=i}n&&(a.$$events=n),c=r(h,a)||{},i&&dr()}),()=>{var v;for(var _ of o){e.removeEventListener(_,Vt);var m=He.get(_);--m===0?(document.removeEventListener(_,Vt),He.delete(_)):He.set(_,m)}Pa.delete(l),h!==t&&((v=h.parentNode)==null||v.removeChild(h))}});return bi.set(c,u),c}let bi=new WeakMap;function Za(r){var e,t,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=Za(r[e]))&&(a&&(a+=" "),a+=t)}else for(t in r)r[t]&&(a&&(a+=" "),a+=t);return a}function ki(){for(var r,e,t=0,a="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=Za(r))&&(a&&(a+=" "),a+=e);return a}function Da(r){return typeof r=="object"?ki(r):r??""}function Si(r,e,t){var a=r==null?"":""+r;return e&&(a=a?a+" "+e:e),a===""?null:a}function zi(r,e){return r==null?null:String(r)}function Fa(r,e,t,a,n,i){var s=r.__className;if(s!==t||s===void 0){var o=Si(t,a);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}return i}function Ut(r,e,t,a){var n=r.__style;if(n!==e){var i=zi(e);i==null?r.removeAttribute("style"):r.style.cssText=i,r.__style=e}return a}const Mi=()=>performance.now(),ce={tick:r=>requestAnimationFrame(r),now:()=>Mi(),tasks:new Set};function Ba(){const r=ce.now();ce.tasks.forEach(e=>{e.c(r)||(ce.tasks.delete(e),e.f())}),ce.tasks.size!==0&&ce.tick(Ba)}function Ei(r){let e;return ce.tasks.size===0&&ce.tick(Ba),{promise:new Promise(t=>{ce.tasks.add(e={c:r,f:t})}),abort(){ce.tasks.delete(e)}}}function Va(r,e){return r===e||(r==null?void 0:r[jt])===e}function Ye(r={},e,t,a){return ni(()=>{var n,i;return xa(()=>{n=i,i=[],hi(()=>{r!==t(...i)&&(e(r,...i),n&&Va(t(...n),r)&&e(null,...n))})}),()=>{Un(()=>{i&&Va(t(...i),r)&&e(null,...i)})}}),r}const Ci="5";typeof window<"u"&&((fn=window.__svelte??(window.__svelte={})).v??(fn.v=new Set)).add(Ci);function Ti(r){return r}function xr(r){return-.5*(Math.cos(Math.PI*r)-1)}function Ai(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Ni(r){return Math.sin(r*Math.PI/2)}const Li=128,Ri=0,Pi=1,Oi=2;class ji{constructor(){p(this,"animationsStarted",!1);p(this,"animationsCount",0);p(this,"animationsLimit",Li);p(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const a=t.animations;if(a!=null)for(let n=0;n<a.length;n++){const i=a[n];if(i!=null){for(const s of i.values())if(!s.executed&&(s.executed=!0,s.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,a,n){let i=this.layers[e];i==null&&(i=this.layers[e]={animations:new Array});let s=i.animations[t];s==null&&(s=i.animations[t]=new Map);let o={id:a,priority:t,executed:!1,function:n};s.set(a,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let a=0;a<this.layers.length;a++){let n=this.layers[a];if(n==null)continue;let i=n.animations[e];if(i==null)return;let s=i.get(t);if(s==null||s.executed==!1)return;i.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ke=new ji;function Ua(r){return Object.prototype.toString.call(r)==="[object Date]"}function wr(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const a=e.map((n,i)=>wr(r[i],n));return n=>a.map(i=>i(n))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(Ua(r)&&Ua(e)){const i=r.getTime(),o=e.getTime()-i;return l=>new Date(i+l*o)}const a=Object.keys(e),n={};return a.forEach(i=>{n[i]=wr(r[i],e[i])}),i=>{const s={};return a.forEach(o=>{s[o]=n[o](i)}),s}}if(t==="number"){const a=e-r;return n=>r+n*a}return()=>e}const qr=class qr{constructor(e,t={}){Z(this,he);Z(this,lt);Z(this,Nt);Z(this,Fe,null);B(this,he,H(e)),B(this,lt,H(e)),B(this,Nt,t)}static of(e,t){const a=new qr(e(),t);return xa(()=>{a.set(e())}),a}set(e,t){var h;V(b(this,lt),e);let{delay:a=0,duration:n=400,easing:i=Ti,interpolate:s=wr}={...b(this,Nt),...t};if(n===0)return(h=b(this,Fe))==null||h.abort(),V(b(this,he),e),Promise.resolve();const o=ce.now()+a;let l,c=!1,u=b(this,Fe);return B(this,Fe,Ei(_=>{if(_<o)return!0;if(!c){c=!0;const v=b(this,he).v;l=s(v,e),typeof n=="function"&&(n=n(v,e)),u==null||u.abort()}const m=_-o;return m>n?(V(b(this,he),e),!1):(V(b(this,he),l(i(m/n))),!0)})),b(this,Fe).promise}get current(){return j(b(this,he))}get target(){return j(b(this,lt))}set target(e){this.set(e)}};he=new WeakMap,lt=new WeakMap,Nt=new WeakMap,Fe=new WeakMap;let br=qr;class $t{constructor(e,t){p(this,"value");p(this,"motion");this.value=e,this.motion=new br(e,t)}set(e,t){this.value=e,this.motion.set(e,t)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Ii=ja('<div><div class="body svelte-1nfn9j8"></div></div>');function Zi(r,e){ur(e,!0);let t,a;function n(){return a}let i=H(!1);function s(T){V(i,T,!0)}function o(){return j(i)}let l=new $t(0,{easing:xr});pe(()=>{c(l.motion.current)}),pe(()=>{j(i)==!1&&(l.snap(),ke.clear(e.priority,e.id))});function c(T){t&&ke.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=T.toString(),t.style.filter=`brightness(${.25+.75*T})`,a.style.opacity=T.toString()})}function u(T){T!=l.value&&l.set(T,{duration:75})}function h(){return l.motion.current==0}function _(){return l.value}var m=Ii(),v=_r(m);return Ye(v,T=>a=T,()=>a),Ye(m,T=>t=T,()=>t),wa(()=>{Fa(m,1,Da(["pin",j(i)&&"displayed"]),"svelte-1nfn9j8"),Ut(m,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`),Ut(v,`width: ${e.width-4}px; height: ${e.height-4}px; border-radius: ${e.radius-2}px`)}),Ia(r,m),dr({getBody:n,setDisplayed:s,getDisplayed:o,setScale:u,getCollapsed:h,getScale:_})}var xt;(r=>{function e(t,a,n){const i=t/2,s=a/2,o=Math.sqrt(i*i+s*s),l=Math.atan(s/i)*(180/Math.PI),c=n*(Math.PI/180);return n<180?n<90?n<l?{x:0,y:o*Math.sin(c)-s}:{x:o*Math.cos(c)-i,y:0}:n<180-l?{x:o*Math.cos(c)-i,y:0}:{x:-t,y:o*Math.sin(c)-s}:n<270?n<180+l?{x:-t,y:o*Math.sin(c)-s}:{x:o*Math.cos(c)-i,y:-a}:n<360-l?{x:o*Math.cos(c)-i,y:-a}:{x:0,y:o*Math.sin(c)-s}}r.getOffsets=e})(xt||(xt={}));var Di=ja('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function $a(r,e){ur(e,!0);let t,a,n,i;const s=e.width+2*e.margin,o=e.height+2*e.margin,l=()=>i;pe(()=>{n.style.width=`${e.margin*4}px`,n.style.height=`${e.margin*4}px`});let c=H(!0);function u(L){V(c,L,!0)}function h(){return j(c)}let _=H(!0);function m(L){V(_,L,!0)}function v(){return P.motion.current==0}function T(){return P.motion.current==1}let P=new $t(0);pe(()=>{me(P.motion.current)}),pe(()=>{j(c)==!1&&(P.snap(),ke.clear(e.priority,e.id+"_scale"))}),pe(()=>{j(_)==!0&&P.value!=0&&(ke.stacked()?P.set(0,{duration:0}):P.set(0,{duration:150,easing:Ai})),j(_)==!1&&P.value!=1&&P.set(1,{duration:150,easing:Ni})});function me(L){!t||!a||!n||ke.equeue(j(_)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${L}`,a.style.scale=`${L}`,n.style.scale=`${L}`})}let D=NaN,K=H(!1),de=new $t(-s/2,{easing:xr}),Qt=new $t(-o/2,{easing:xr});pe(()=>{hn(de.motion.current,Qt.motion.current)}),pe(()=>{j(c)==!1&&(de.snap(),de.snap(),ke.clear(e.priority,e.id+"_angle"))}),pe(()=>{j(_)==!0&&j(K)&&(de.update({duration:75}),de.update({duration:75}))});function hn(L,ye){if(!t||!a||!n)return;const tr=L+s/2,Lt=ye+o/2,dt=o<s?tr*o/s:tr,Hr=o>s?Lt*s/o:Lt,Os=Math.atan2(Hr,dt)/Math.PI*180-45,gn=0,js=30,Yr=Math.sqrt(dt*dt+Hr*Hr),Rt=Math.min(s,o)/2,Is=Rt*Math.SQRT2,Zs=(Yr-Rt)/(Is-Rt),_n=gn+Zs*(js-gn),Ds=Yr<Rt?Yr/Rt:1;ke.equeue(e.layer,e.priority,e.id+"_angle",()=>{a.style.transform=`translate(${Math.round(L)}px, ${Math.round(ye)}px)`,n.style.transform=`scale(${Ds}) rotate(${Os}deg) skew(${_n}deg, ${_n}deg)`})}function Rs(L){if(j(K)==!1){let ye=xt.getOffsets(s,o,L);de.set(Math.round(ye.x),{duration:0}),Qt.set(Math.round(ye.y),{duration:0}),hn(de.value,Qt.value),D=L,V(K,!0)}else if(L!=D){let ye=Math.abs(L-D),tr=ye<180?ye:360-ye,Lt=Math.log(tr)*75,dt=xt.getOffsets(s,o,L);de.set(Math.round(dt.x),{duration:Lt}),Qt.set(Math.round(dt.y),{duration:Lt}),D=L}}function Ps(){return xt.getOffsets(s,o,D)}var er=Di(),mn=_r(er);Ye(mn,L=>n=L,()=>n);var Wr=ei(mn,2),yn=_r(Wr);return Ye(yn,L=>i=L,()=>i),Ye(Wr,L=>a=L,()=>a),Ye(er,L=>t=L,()=>t),wa(()=>{Fa(er,1,Da(["anchor",j(c)&&"displayed"]),"svelte-j5igi2"),Ut(Wr,`margin: ${e.margin}px;`),Ut(yn,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)}),Ia(r,er),dr({getBody:l,setDisplayed:u,getDisplayed:h,setCollapsed:m,getCollapsed:v,getExpanded:T,setAngle:Rs,getOffsets:Ps})}var Ge;(r=>{function e(o,l,c){return{x:a(l)*c,y:n(o)*c}}r.project=e;function t(o,l,c){return{lat:s(l/c),lng:i(o/c)}}r.unproject=t;function a(o){return(180+o)/360}function n(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function i(o){return o*360-180}function s(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})(Ge||(Ge={}));class qa{constructor(e,t,a,n,i){p(this,"swLat");p(this,"swLng");p(this,"neLat");p(this,"neLng");const s=a*Math.pow(2,t),o=Ge.project(e.sw.lat,e.sw.lng,s),l=Ge.project(e.ne.lat,e.ne.lng,s),c=o.x-n,u=o.y+i,h=l.x+n,_=l.y-i,m=Ge.unproject(c,u,s),v=Ge.unproject(h,_,s);this.swLat=m.lat,this.swLng=m.lng,this.neLat=v.lat,this.neLng=v.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 C;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const i={};for(const s of n)i[s]=s;return i},r.getValidEnumValues=n=>{const i=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),s={};for(const o of i)s[o]=n[o];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(i){return n[i]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},r.find=(n,i)=>{for(const s of n)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}r.joinValues=a,r.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(C||(C={}));var Wa;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Wa||(Wa={}));const y=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Se=r=>{switch(typeof r){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(r)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(r)?y.array:r===null?y.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?y.promise:typeof Map<"u"&&r instanceof Map?y.map:typeof Set<"u"&&r instanceof Set?y.set:typeof Date<"u"&&r instanceof Date?y.date:y.object;default:return y.unknown}},d=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class re extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},a={_errors:[]},n=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)a._errors.push(t(s));else{let o=a,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return n(this),a}static assert(e){if(!(e instanceof re))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}re.create=r=>new re(r);const wt=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===y.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,C.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${C.joinValues(r.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${C.joinValues(r.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${C.joinValues(r.options)}, received '${r.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:C.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case d.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case d.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,C.assertNever(r)}return{message:t}};let Fi=wt;function kr(){return Fi}const Sr=r=>{const{data:e,path:t,errorMaps:a,issueData:n}=r,i=[...t,...n.path||[]],s={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let o="";const l=a.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...n,path:i,message:o}};function f(r,e){const t=kr(),a=Sr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===wt?void 0:wt].filter(n=>!!n)});r.common.issues.push(a)}class J{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if(n.status==="aborted")return x;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const n of t){const i=await n.key,s=await n.value;a.push({key:i,value:s})}return J.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:i,value:s}=n;if(i.status==="aborted"||s.status==="aborted")return x;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(a[i.value]=s.value)}return{status:e.value,value:a}}}const x=Object.freeze({status:"aborted"}),bt=r=>({status:"dirty",value:r}),Y=r=>({status:"valid",value:r}),Ha=r=>r.status==="aborted",Ya=r=>r.status==="dirty",Xe=r=>r.status==="valid",qt=r=>typeof Promise<"u"&&r instanceof Promise;var g;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(g||(g={}));class ze{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ga=(r,e)=>{if(Xe(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new re(r.common.issues);return this._error=t,this._error}}};function S(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:n}=r;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,o)=>{const{message:l}=r;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??a??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:n}}class E{get description(){return this._def.description}_getType(e){return Se(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Se(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new J,ctx:{common:e.parent.common,data:e.data,parsedType:Se(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(qt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Se(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Ga(a,n)}"~validate"(e){var a,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Se(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return Xe(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(n=(a=i==null?void 0:i.message)==null?void 0:a.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>Xe(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Se(e)},n=this._parse({data:e,path:a.path,parent:a}),i=await(qt(n)?n:Promise.resolve(n));return Ga(a,i)}refine(e,t){const a=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,i)=>{const s=e(n),o=()=>i.addIssue({code:d.custom,...a(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((a,n)=>e(a)?!0:(n.addIssue(typeof t=="function"?t(a,n):t),!1))}_refinement(e){return new tt({schema:this,typeName:w.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 Ce.create(this,this._def)}nullable(){return rt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ue.create(this)}promise(){return Mt.create(this,this._def)}or(e){return Ht.create([this,e],this._def)}and(e){return Yt.create(this,e,this._def)}transform(e){return new tt({...S(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ar({...S(this._def),innerType:this,defaultValue:t,typeName:w.ZodDefault})}brand(){return new cs({typeName:w.ZodBranded,type:this,...S(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Nr({...S(this._def),innerType:this,catchValue:t,typeName:w.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Lr.create(this,e)}readonly(){return Rr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bi=/^c[^\s-]{8,}$/i,Vi=/^[0-9a-z]+$/,Ui=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$i=/^[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,qi=/^[a-z0-9_-]{21}$/i,Wi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hi=/^[-+]?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)?)??$/,Yi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Gi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let zr;const Xi=/^(?:(?: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])$/,Ji=/^(?:(?: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])$/,Ki=/^(([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]))$/,Qi=/^(([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])$/,es=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ts=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Xa="((\\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])))",rs=new RegExp(`^${Xa}$`);function Ja(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function as(r){return new RegExp(`^${Ja(r)}$`)}function ns(r){let e=`${Xa}T${Ja(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function is(r,e){return!!((e==="v4"||!e)&&Xi.test(r)||(e==="v6"||!e)&&Ki.test(r))}function ss(r,e){if(!Wi.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(a));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function os(r,e){return!!((e==="v4"||!e)&&Ji.test(r)||(e==="v6"||!e)&&Qi.test(r))}class Me extends E{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_type,expected:y.string,received:i.parsedType}),x}const a=new J;let n;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(n=this._getOrReturnCtx(e,n),s?f(n,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&f(n,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")Yi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"email",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")zr||(zr=new RegExp(Gi,"u")),zr.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"emoji",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")$i.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"uuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")qi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"nanoid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Bi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")Vi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid2",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")Ui.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ulid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),f(n,{validation:"url",code:d.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"regex",code:d.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?ns(i).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?rs.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?as(i).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?Hi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"duration",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?is(e.data,i.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ip",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="jwt"?ss(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"jwt",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="cidr"?os(e.data,i.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cidr",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?es.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"base64",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64url"?ts.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"base64url",code:d.invalid_string,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(n=>e.test(n),{validation:t,code:d.invalid_string,...g.errToObj(a)})}_addCheck(e){return new Me({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...g.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...g.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,...g.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,...g.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...g.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...g.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...g.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...g.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...g.errToObj(t)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new Me({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Me({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Me({...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}}Me.create=r=>new Me({checks:[],typeName:w.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});function ls(r,e){const t=(r.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=t>a?t:a,i=Number.parseInt(r.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return i%s/10**n}class Je extends E{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)!==y.number){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_type,expected:y.number,received:i.parsedType}),x}let a;const n=new J;for(const i of this._def.checks)i.kind==="int"?C.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?ls(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_finite,message:i.message}),n.dirty()):C.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,a,n){return new Je({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:g.toString(n)}]})}_addCheck(e){return new Je({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.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"&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Je.create=r=>new Je({checks:[],typeName:w.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class kt extends E{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)!==y.bigint)return this._getInvalidInput(e);let a;const n=new J;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):C.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return f(t,{code:d.invalid_type,expected:y.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,a,n){return new kt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:g.toString(n)}]})}_addCheck(e){return new kt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.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}}kt.create=r=>new kt({checks:[],typeName:w.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});class Mr extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.boolean,received:a.parsedType}),x}return Y(e.data)}}Mr.create=r=>new Mr({typeName:w.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class Wt extends E{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_type,expected:y.date,received:i.parsedType}),x}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_date}),x}const a=new J;let n;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):C.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:g.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}}Wt.create=r=>new Wt({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:w.ZodDate,...S(r)});class Ka extends E{_parse(e){if(this._getType(e)!==y.symbol){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.symbol,received:a.parsedType}),x}return Y(e.data)}}Ka.create=r=>new Ka({typeName:w.ZodSymbol,...S(r)});class Qa extends E{_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.undefined,received:a.parsedType}),x}return Y(e.data)}}Qa.create=r=>new Qa({typeName:w.ZodUndefined,...S(r)});class en extends E{_parse(e){if(this._getType(e)!==y.null){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.null,received:a.parsedType}),x}return Y(e.data)}}en.create=r=>new en({typeName:w.ZodNull,...S(r)});class Er extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return Y(e.data)}}Er.create=r=>new Er({typeName:w.ZodAny,...S(r)});class Ke extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Y(e.data)}}Ke.create=r=>new Ke({typeName:w.ZodUnknown,...S(r)});class Ee extends E{_parse(e){const t=this._getOrReturnCtx(e);return f(t,{code:d.invalid_type,expected:y.never,received:t.parsedType}),x}}Ee.create=r=>new Ee({typeName:w.ZodNever,...S(r)});class Cr extends E{_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.void,received:a.parsedType}),x}return Y(e.data)}}Cr.create=r=>new Cr({typeName:w.ZodVoid,...S(r)});class ue extends E{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==y.array)return f(t,{code:d.invalid_type,expected:y.array,received:t.parsedType}),x;if(n.exactLength!==null){const s=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(s||o)&&(f(t,{code:s?d.too_big:d.too_small,minimum:o?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(f(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(f(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>n.type._parseAsync(new ze(t,s,t.path,o)))).then(s=>J.mergeArray(a,s));const i=[...t.data].map((s,o)=>n.type._parseSync(new ze(t,s,t.path,o)));return J.mergeArray(a,i)}get element(){return this._def.type}min(e,t){return new ue({...this._def,minLength:{value:e,message:g.toString(t)}})}max(e,t){return new ue({...this._def,maxLength:{value:e,message:g.toString(t)}})}length(e,t){return new ue({...this._def,exactLength:{value:e,message:g.toString(t)}})}nonempty(e){return this.min(1,e)}}ue.create=(r,e)=>new ue({type:r,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...S(e)});function Qe(r){if(r instanceof I){const e={};for(const t in r.shape){const a=r.shape[t];e[t]=Ce.create(Qe(a))}return new I({...r._def,shape:()=>e})}else return r instanceof ue?new ue({...r._def,type:Qe(r.element)}):r instanceof Ce?Ce.create(Qe(r.unwrap())):r instanceof rt?rt.create(Qe(r.unwrap())):r instanceof fe?fe.create(r.items.map(e=>Qe(e))):r}class I extends E{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=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==y.object){const c=this._getOrReturnCtx(e);return f(c,{code:d.invalid_type,expected:y.object,received:c.parsedType}),x}const{status:a,ctx:n}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ee&&this._def.unknownKeys==="strip"))for(const c in n.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=i[c],h=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ze(n,h,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Ee){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict")o.length>0&&(f(n,{code:d.unrecognized_keys,keys:o}),a.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const h=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ze(n,h,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const h=await u.key,_=await u.value;c.push({key:h,value:_,alwaysSet:u.alwaysSet})}return c}).then(c=>J.mergeObjectSync(a,c)):J.mergeObjectSync(a,l)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new I({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var i,s;const n=((s=(i=this._def).errorMap)==null?void 0:s.call(i,t,a).message)??a.defaultError;return t.code==="unrecognized_keys"?{message:g.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new I({...this._def,unknownKeys:"strip"})}passthrough(){return new I({...this._def,unknownKeys:"passthrough"})}extend(e){return new I({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new I({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new I({...this._def,catchall:e})}pick(e){const t={};for(const a of C.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new I({...this._def,shape:()=>t})}omit(e){const t={};for(const a of C.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new I({...this._def,shape:()=>t})}deepPartial(){return Qe(this)}partial(e){const t={};for(const a of C.objectKeys(this.shape)){const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new I({...this._def,shape:()=>t})}required(e){const t={};for(const a of C.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof Ce;)i=i._def.innerType;t[a]=i}return new I({...this._def,shape:()=>t})}keyof(){return nn(C.objectKeys(this.shape))}}I.create=(r,e)=>new I({shape:()=>r,unknownKeys:"strip",catchall:Ee.create(),typeName:w.ZodObject,...S(e)}),I.strictCreate=(r,e)=>new I({shape:()=>r,unknownKeys:"strict",catchall:Ee.create(),typeName:w.ZodObject,...S(e)}),I.lazycreate=(r,e)=>new I({shape:r,unknownKeys:"strip",catchall:Ee.create(),typeName:w.ZodObject,...S(e)});class Ht extends E{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function n(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(o=>new re(o.ctx.common.issues));return f(t,{code:d.invalid_union,unionErrors:s}),x}if(t.common.async)return Promise.all(a.map(async i=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let i;const s=[];for(const l of a){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const o=s.map(l=>new re(l));return f(t,{code:d.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}}Ht.create=(r,e)=>new Ht({options:r,typeName:w.ZodUnion,...S(e)});function Tr(r,e){const t=Se(r),a=Se(e);if(r===e)return{valid:!0,data:r};if(t===y.object&&a===y.object){const n=C.objectKeys(e),i=C.objectKeys(r).filter(o=>n.indexOf(o)!==-1),s={...r,...e};for(const o of i){const l=Tr(r[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(t===y.array&&a===y.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let i=0;i<r.length;i++){const s=r[i],o=e[i],l=Tr(s,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return t===y.date&&a===y.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Yt extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(i,s)=>{if(Ha(i)||Ha(s))return x;const o=Tr(i.value,s.value);return o.valid?((Ya(i)||Ya(s))&&t.dirty(),{status:t.value,value:o.data}):(f(a,{code:d.invalid_intersection_types}),x)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,s])=>n(i,s)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Yt.create=(r,e,t)=>new Yt({left:r,right:e,typeName:w.ZodIntersection,...S(t)});class fe extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.array)return f(a,{code:d.invalid_type,expected:y.array,received:a.parsedType}),x;if(a.data.length<this._def.items.length)return f(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&a.data.length>this._def.items.length&&(f(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...a.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new ze(a,s,a.path,o)):null}).filter(s=>!!s);return a.common.async?Promise.all(i).then(s=>J.mergeArray(t,s)):J.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new fe({...this._def,rest:e})}}fe.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:r,typeName:w.ZodTuple,rest:null,...S(e)})};class tn extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.map)return f(a,{code:d.invalid_type,expected:y.map,received:a.parsedType}),x;const n=this._def.keyType,i=this._def.valueType,s=[...a.data.entries()].map(([o,l],c)=>({key:n._parse(new ze(a,o,a.path,[c,"key"])),value:i._parse(new ze(a,l,a.path,[c,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}}}}tn.create=(r,e,t)=>new tn({valueType:e,keyType:r,typeName:w.ZodMap,...S(t)});class St extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.set)return f(a,{code:d.invalid_type,expected:y.set,received:a.parsedType}),x;const n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(f(a,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(f(a,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return x;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const o=[...a.data.values()].map((l,c)=>i._parse(new ze(a,l,a.path,c)));return a.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,t){return new St({...this._def,minSize:{value:e,message:g.toString(t)}})}max(e,t){return new St({...this._def,maxSize:{value:e,message:g.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}St.create=(r,e)=>new St({valueType:r,minSize:null,maxSize:null,typeName:w.ZodSet,...S(e)});class zt extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.function)return f(t,{code:d.invalid_type,expected:y.function,received:t.parsedType}),x;function a(o,l){return Sr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kr(),wt].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:l}})}function n(o,l){return Sr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kr(),wt].filter(c=>!!c),issueData:{code:d.invalid_return_type,returnTypeError:l}})}const i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Mt){const o=this;return Y(async function(...l){const c=new re([]),u=await o._def.args.parseAsync(l,i).catch(m=>{throw c.addIssue(a(l,m)),c}),h=await Reflect.apply(s,this,u);return await o._def.returns._def.type.parseAsync(h,i).catch(m=>{throw c.addIssue(n(h,m)),c})})}else{const o=this;return Y(function(...l){const c=o._def.args.safeParse(l,i);if(!c.success)throw new re([a(l,c.error)]);const u=Reflect.apply(s,this,c.data),h=o._def.returns.safeParse(u,i);if(!h.success)throw new re([n(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new zt({...this._def,args:fe.create(e).rest(Ke.create())})}returns(e){return new zt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new zt({args:e||fe.create([]).rest(Ke.create()),returns:t||Ke.create(),typeName:w.ZodFunction,...S(a)})}}class rn extends E{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})}}rn.create=(r,e)=>new rn({getter:r,typeName:w.ZodLazy,...S(e)});class an extends E{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}an.create=(r,e)=>new an({value:r,typeName:w.ZodLiteral,...S(e)});function nn(r,e){return new et({values:r,typeName:w.ZodEnum,...S(e)})}class et extends E{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return f(t,{expected:C.joinValues(a),received:t.parsedType,code:d.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return f(t,{received:t.data,code:d.invalid_enum_value,options:a}),x}return Y(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 et.create(e,{...this._def,...t})}exclude(e,t=this._def){return et.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}et.create=nn;class sn extends E{_parse(e){const t=C.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==y.string&&a.parsedType!==y.number){const n=C.objectValues(t);return f(a,{expected:C.joinValues(n),received:a.parsedType,code:d.invalid_type}),x}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=C.objectValues(t);return f(a,{received:a.data,code:d.invalid_enum_value,options:n}),x}return Y(e.data)}get enum(){return this._def.values}}sn.create=(r,e)=>new sn({values:r,typeName:w.ZodNativeEnum,...S(e)});class Mt extends E{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.promise&&t.common.async===!1)return f(t,{code:d.invalid_type,expected:y.promise,received:t.parsedType}),x;const a=t.parsedType===y.promise?t.data:Promise.resolve(t.data);return Y(a.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Mt.create=(r,e)=>new Mt({type:r,typeName:w.ZodPromise,...S(e)});class tt extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:s=>{f(a,s),s.fatal?t.abort():t.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const s=n.transform(a.data,i);if(a.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return x;const l=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return l.status==="aborted"?x:l.status==="dirty"||t.value==="dirty"?bt(l.value):l});{if(t.value==="aborted")return x;const o=this._def.schema._parseSync({data:s,path:a.path,parent:a});return o.status==="aborted"?x:o.status==="dirty"||t.value==="dirty"?bt(o.value):o}}if(n.type==="refinement"){const s=o=>{const l=n.refinement(o,i);if(a.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(a.common.async===!1){const s=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Xe(s))return x;const o=n.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(s=>Xe(s)?Promise.resolve(n.transform(s.value,i)).then(o=>({status:t.value,value:o})):x);C.assertNever(n)}}tt.create=(r,e,t)=>new tt({schema:r,typeName:w.ZodEffects,effect:e,...S(t)}),tt.createWithPreprocess=(r,e,t)=>new tt({schema:e,effect:{type:"preprocess",transform:r},typeName:w.ZodEffects,...S(t)});class Ce extends E{_parse(e){return this._getType(e)===y.undefined?Y(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ce.create=(r,e)=>new Ce({innerType:r,typeName:w.ZodOptional,...S(e)});class rt extends E{_parse(e){return this._getType(e)===y.null?Y(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rt.create=(r,e)=>new rt({innerType:r,typeName:w.ZodNullable,...S(e)});class Ar extends E{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===y.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ar.create=(r,e)=>new Ar({innerType:r,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class Nr extends E{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return qt(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new re(a.common.issues)},input:a.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new re(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Nr.create=(r,e)=>new Nr({innerType:r,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class on extends E{_parse(e){if(this._getType(e)!==y.nan){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.nan,received:a.parsedType}),x}return{status:"valid",value:e.data}}}on.create=r=>new on({typeName:w.ZodNaN,...S(r)});class cs extends E{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Lr extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?x:i.status==="dirty"?(t.dirty(),bt(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?x:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,t){return new Lr({in:e,out:t,typeName:w.ZodPipeline})}}class Rr extends E{_parse(e){const t=this._def.innerType._parse(e),a=n=>(Xe(n)&&(n.value=Object.freeze(n.value)),n);return qt(t)?t.then(n=>a(n)):a(t)}unwrap(){return this._def.innerType}}Rr.create=(r,e)=>new Rr({innerType:r,typeName:w.ZodReadonly,...S(e)});var w;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(w||(w={}));const at=Me.create,k=Je.create,ln=Mr.create,Pr=Er.create;Ke.create,Ee.create;const Gt=Cr.create,Or=ue.create,R=I.create;Ht.create,Yt.create;const cn=fe.create,ne=zt.create,us=et.create,ds=Mt.create;Ce.create,rt.create,R({pin:R({fade:ln().optional(),maxCount:k().optional(),maxZoom:k().optional()}).optional(),animation:R({queue:R({limit:k().optional()}).optional()}).optional(),api:R({states:R({url:at()}).optional()}).optional()});const jr=k().min(-90).max(90),Ir=k().min(-180).max(180),ps=R({sw:R({lat:jr,lng:Ir}),ne:R({lat:jr,lng:Ir})}),Zr=Pr().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),fs=R({mapSize:k().min(1),zoomMin:k().min(0),zoomMax:k().min(0),zoomScale:k().min(1).max(10)}),hs=R({instance:Pr(),inserted:ne().returns(ln()),insert:ne().returns(Gt()),remove:ne().returns(Gt()),update:ne().args(k()).returns(Gt())}),ms=R({getParameters:ne().args().returns(fs),getContainer:ne().args().returns(Zr),getZoom:ne().args().returns(k()),getBounds:ne().args().returns(ps),panBy:ne().args(k(),k()).returns(Gt()),createMarker:ne().args(Zr,jr,Ir,k()).returns(hs)}),Dr=ne().args(at()).returns(ds(Zr)),ys=R({id:at().min(1),rank:k(),lat:k().min(-90).max(90),lng:k().min(-180).max(180),tooltip:R({style:R({width:k(),height:k(),margin:k(),radius:k()}).refine(r=>Math.min(r.width,r.height)/r.margin>=5,"Tooltip width and height must be at least 5 times the margin"),body:Dr}),pin:R({style:R({width:k(),height:k(),radius:k()}),body:Dr}).optional(),popup:R({style:R({width:k(),height:k(),radius:k(),margin:k()}),body:Dr}).optional()}),gs=Or(ys);var Ie;(r=>{r.COUNT=12,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],r.DEGREES_DEFAULT=270})(Ie||(Ie={})),cn([k(),Or(cn([k(),k()]))]);const un=R({mapSize:k().min(1),zoomMin:k().min(0).max(24),zoomMax:k().min(0).max(24),zoomScale:k().min(1).max(10)}),_s=R({id:at(),rank:k(),lat:k(),lng:k(),width:k(),height:k(),margin:k()});R({key:at(),parameters:un,input:Or(_s)});const vs=us(["info","warn","error"]);R({title:at(),level:vs,content:Pr()});const dn="1.0.205",pn="https://maps.api.arenarium.dev",xs=`${pn}/log`,ws=`${pn}/tooltip/states`;class bs{constructor(e,t,a){p(this,"apiKey");p(this,"apiStatesUrl");p(this,"apiDevEnvironment");p(this,"mapProvider");p(this,"markerDataArray",new Array);p(this,"markerDataMap",new Map);p(this,"markerDataUpdating",!1);p(this,"markerPinProcessor");p(this,"markerTooltipProcessor");p(this,"markerPopupProcessor");ms.parse(t),this.apiKey=e,this.apiDevEnvironment=(window==null?void 0:window.location.host.startsWith("localhost"))||(window==null?void 0:window.location.host.startsWith("127.0.0.1")),this.mapProvider=t,this.markerPinProcessor=new Vr(t),this.markerTooltipProcessor=new Ss(t),this.markerPopupProcessor=new zs(t),this.configuration=a,this.log("info","Loaded")}set configuration(e){var t,a,n,i;this.markerPinProcessor.setConfiguration(e),this.apiStatesUrl=((a=(t=e==null?void 0:e.api)==null?void 0:t.states)==null?void 0:a.url)??void 0,ke.setLimit(((i=(n=e==null?void 0:e.animation)==null?void 0:n.queue)==null?void 0:i.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(e){gs.parse(e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const a of this.markerDataArray)this.markerPopupProcessor.hide(a);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const a of this.markerDataArray)this.markerPopupProcessor.hide(a);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}async updateMarkerData(e){try{let t=this.markerDataArray.map(n=>n.marker);for(let n=0;n<e.length;n++){const i=e[n];this.markerDataMap.get(i.id)||t.push(i)}let a;if(e.length>1){const n=this.mapProvider.getParameters();un.parse(n);const i=t.map(c=>({id:c.id,rank:c.rank,lat:c.lat,lng:c.lng,width:c.tooltip.style.width,height:c.tooltip.style.height,margin:c.tooltip.style.margin})),s={key:this.apiKey,parameters:n,input:i},o=this.apiStatesUrl??ws,l=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json","Cache-Control":this.apiDevEnvironment?"no-cache":""},body:JSON.stringify(s)});if(!l.ok||!l.body)throw new Error("Failed to get marker states: "+l.statusText);a=await l.json()}else a=[[0,[[0,Ie.DEGREES.indexOf(Ie.DEGREES_DEFAULT)]]]];try{this.markerDataUpdating=!0;for(let n=0;n<t.length;n++){const i=t[n],s=a[n],o=this.markerDataMap.get(i.id);if(o)o.update(s);else{const l=new ks(this.mapProvider,i,s);l.create(),this.markerDataMap.set(i.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((n,i)=>n.zoom-i.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(n=>n.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(n=>n.tooltip))}finally{this.markerDataUpdating=!1}}catch(t){throw console.error(t),this.markerDataArray.forEach(a=>a.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),t instanceof Error&&this.log("error","Failed to update marker data",t),t}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.clear(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),t=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,a){if(!this.apiDevEnvironment)try{const n={title:`[CLIENT:${dn}] ${t}`,level:e,content:{version:dn,...a}};await fetch(xs,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(n){console.error(n)}}}class ks{constructor(e,t,a){p(this,"marker");p(this,"zoom");p(this,"pin");p(this,"tooltip");this.marker=t,this.zoom=a[0],this.pin=new Br(e,t,a),this.tooltip=new Ur(e,t,a)}create(){this.pin.create(),this.tooltip.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove()}}class Fr{constructor(e,t){p(this,"provider");p(this,"id");p(this,"lat");p(this,"lng");p(this,"shown");p(this,"element");p(this,"component");p(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,a=this.component;if(t==null||a==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e,t;(e=this.marker)==null||e.remove(),(t=this.element)==null||t.remove()}}const ct=class ct extends Fr{constructor(t,a,n){var i,s,o,l;super(t,a);p(this,"width");p(this,"height");p(this,"radius");p(this,"zoom");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=((i=a.pin)==null?void 0:i.style.width)??ct.DEFAULT_SIZE,this.height=((s=a.pin)==null?void 0:s.style.height)??ct.DEFAULT_SIZE,this.radius=((o=a.pin)==null?void 0:o.style.radius)??ct.DEFAULT_SIZE,this.zoom=n[0],this.bodyCallback=(l=a.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=vr(Zi,{target:this.element,props:{id:this.id+"_pin",layer:Oi,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update pin state");this.component.setScale(this.getScale(t))}updateBody(){var a;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load pin body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setScale(t?0:1)}getScale(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};p(ct,"DEFAULT_SIZE",16);let Br=ct;const ut=class ut{constructor(e){p(this,"provider");p(this,"pinElements",new Array);p(this,"pinMaxWidth",0);p(this,"pinMaxHeight",0);p(this,"pinFade",!1);p(this,"pinMaxCount",0);p(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,a,n;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((a=e==null?void 0:e.pin)==null?void 0:a.maxCount)??Math.max(ut.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((n=e==null?void 0:e.pin)==null?void 0:n.maxZoom)??ut.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,a)=>Math.max(t,a.width),0),this.pinMaxHeight=e.reduce((t,a)=>Math.max(t,a.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const a=this.provider.getParameters().mapSize,n=new qa(e,t,a,this.pinMaxWidth*2,this.pinMaxHeight*2);let i=0;for(const s of this.pinElements)n.contains(s.lat,s.lng)?s.shown&&t<s.zoom&&s.zoom<t+this.pinMaxZoomDelta?(i<this.pinMaxCount&&(this.pinFade==!0?s.updateState(t):s.setCollapsed(!1),s.updateMap(!0),s.isBodyLoaded()==!1&&s.updateBody()),i++):(s.setCollapsed(!0),s.isCollapsed()&&s.updateMap(!1)):s.updateMap(!1)}};p(ut,"MAP_PINS_MAX_ZOOM",2),p(ut,"MAP_PINS_MAX_COUNT",128);let Vr=ut;const Jt=class Jt extends Fr{constructor(t,a,n){super(t,a);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"zoom");p(this,"angle");p(this,"states");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=a.tooltip.style.width,this.height=a.tooltip.style.height,this.margin=a.tooltip.style.margin,this.radius=a.tooltip.style.radius,this.zoom=n[0],this.angle=Ie.DEGREES_DEFAULT,this.states=n[1].map(i=>[i[0],Ie.DEGREES[i[1]]]),this.bodyCallback=a.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=vr($a,{target:this.element,props:{id:this.id+"_tooltip",layer:Pi,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(a=>[a[0],Ie.DEGREES[a[1]]]),this.updateZIndex()}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var a;if(this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load tooltip body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const a=this.states.findLast(n=>n[0]<=t);if(!a)throw new Error("Angle not found");return a[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+Jt.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(Jt,"Z_INDEX_OFFSET",1e6);let Ur=Jt;class Ss{constructor(e){p(this,"provider");p(this,"tooltipElements",new Array);p(this,"tooltipMaxWidth",0);p(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,a)=>Math.max(t,a.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,a)=>Math.max(t,a.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const a=this.provider.getParameters().mapSize,n=new qa(e,t,a,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const i of this.tooltipElements)n.contains(i.lat,i.lng)?i.shown&&i.zoom<=t?(i.updateState(t),i.setCollapsed(!1),i.updateMap(!0),i.isCollapsed()==!1&&i.isBodyLoaded()==!1&&i.updateBody()):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}}const Kt=class Kt extends Fr{constructor(t,a){if(a.popup==null)throw new Error("Failed to create popup");super(t,a);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.shown=!1,this.width=a.popup.style.width,this.height=a.popup.style.height,this.margin=a.popup.style.margin,this.radius=a.popup.style.radius,this.bodyCallback=a.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=vr($a,{target:this.element,props:{id:this.id+"_popup",layer:Ri,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateBody(){var a;if(this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load popup body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Kt.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(Kt,"Z_INDEX_OFFSET",2e6);let $r=Kt;class zs{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 $r(this.provider,e.marker);this.popupElements.set(e.marker.id,t),this.popupPositioned.set(e.marker.id,!1),t.create(),t.setAngle(e.tooltip.angle),t.shown=!0}hide(e){e.pin.shown=!0,e.tooltip.shown=!0;const t=this.popupElements.get(e.marker.id);t!=null&&(t.shown=!1)}clear(){this.popupElements.values().forEach(e=>e.remove()),this.popupElements.clear(),this.popupPositioned.clear()}process(){var e,t;for(const a of this.popupElements.values())if(a.shown){if(a.setCollapsed(!1),a.updateMap(!0),a.isExpanded()&&a.isBodyLoaded()==!1&&a.updateBody(),a.isCollapsed()==!1&&this.popupPositioned.get(a.id)==!1){const n=(e=a.component)==null?void 0:e.getBody();if(n==null)continue;const i=(t=a.component)==null?void 0:t.getOffsets();if(i==null)continue;const s=n.getBoundingClientRect();if(s.x==0&&s.y==0&&s.width==0&&s.height==0)continue;const o=s.x+s.width/2,l=s.y+s.height/2,c=o+i.x,u=l+i.y,h=c+a.width,_=u+a.height,m=this.provider.getContainer().getBoundingClientRect(),v=c-m.left,T=m.right-h,P=u-m.top,me=m.bottom-_,D=Math.min(a.width,a.height)/4,K=v<0?v-D:T<0?-T+D:0,de=P<0?P-D:me<0?-me+D:0;this.provider.panBy(K,de),this.popupPositioned.set(a.id,!0)}}else a.setCollapsed(!0),a.isCollapsed()&&(a.updateMap(!1),a.remove(),this.popupElements.delete(a.id),this.popupPositioned.delete(a.id))}}class Ms{constructor(e,t,a){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...a,minZoom:Math.max(a.minZoom??0,0),maxZoom:Math.min(a.maxZoom??22,24),style:a.style??"https://tiles.openfreemap.org/styles/liberty",pitchWithRotate:!1,attributionControl:a.attributionControl??{compact:!1,customAttribution:"@arenarium/maps"}}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds(),t=e.getSouthWest(),a=e.getNorthEast();return{sw:t,ne:a}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,a){const n=new this.MapMarkerClass({element:e});return n.setLngLat([a,t]),{instance:n,inserted:()=>n._map!=null,insert:()=>n.addTo(this.map),remove:()=>n.remove(),update:i=>n.getElement().style.zIndex=i.toString()}}}const Es={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}}]},Cs={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 Ts{constructor(e,t,a){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...a,minZoom:Math.max(a.minZoom??0,0),maxZoom:Math.min(a.maxZoom??22,24),projection:"mercator",pitchWithRotate:!1,customAttribution:a.customAttribution??"@arenarium/maps"}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds();if(!e)return{sw:{lat:0,lng:0},ne:{lat:0,lng:0}};const t=e.getSouthWest(),a=e.getNorthEast();return{sw:t,ne:a}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,a){const n=new this.MapMarkerClass({element:e});return n.setLngLat([a,t]),{instance:n,inserted:()=>n._map!=null,insert:()=>n.addTo(this.map),remove:()=>n.remove(),update:i=>n.getElement().style.zIndex=i.toString()}}}class As{constructor(e,t,a,n){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");p(this,"options");this.MapClass=e,this.MapMarkerClass=t,this.options=n,this.map=new this.MapClass(a,{...n})}getParameters(){return{mapSize:256,zoomMin:this.options.minZoom??0,zoomMax:this.options.maxZoom??24,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getDiv()}getZoom(){return this.map.getZoom()??NaN}getBounds(){const e=this.map.getBounds();if(e==null)return{sw:{lat:NaN,lng:NaN},ne:{lat:NaN,lng:NaN}};const t=e.getSouthWest(),a=e.getNorthEast();return{sw:{lat:t.lat(),lng:t.lng()},ne:{lat:a.lat(),lng:a.lng()}}}panBy(e,t){this.map.panBy(e,t)}createMarker(e,t,a,n){const i=new this.MapMarkerClass({position:{lat:t,lng:a},content:e,zIndex:n});return{instance:i,inserted:()=>i.map!=null&&i.map==this.map,insert:()=>i.map=this.map,remove:()=>i.map=void 0,update:s=>i.zIndex=s}}}const Ns=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100},{lightness:-10}]},{featureType:"landscape",stylers:[{lightness:30}]},{featureType:"road",elementType:"geometry",stylers:[{saturation:-100}]}],Ls=[{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}]}];z.GoogleMapDarkStyle=Ls,z.GoogleMapLightStyle=Ns,z.GoogleMapsProvider=As,z.MapManager=bs,z.MapboxProvider=Ts,z.MaplibreDarkStyle=Es,z.MaplibreLightStyle=Cs,z.MaplibreProvider=Ms,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(z,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(z=typeof globalThis<"u"?globalThis:z||self,L(z.arenarium={}))})(this,(function(z){"use strict";var Bs=Object.defineProperty;var xn=z=>{throw TypeError(z)};var Vs=(z,L,I)=>L in z?Bs(z,L,{enumerable:!0,configurable:!0,writable:!0,value:I}):z[L]=I;var p=(z,L,I)=>Vs(z,typeof L!="symbol"?L+"":L,I),Xr=(z,L,I)=>L.has(z)||xn("Cannot "+I);var k=(z,L,I)=>(Xr(z,L,"read from private field"),I?I.call(z):L.get(z)),D=(z,L,I)=>L.has(z)?xn("Cannot add the same private member more than once"):L instanceof WeakSet?L.add(z):L.set(z,I),V=(z,L,I,Rt)=>(Xr(z,L,"write to private field"),Rt?Rt.call(z,I):L.set(z,I),I),Be=(z,L,I)=>(Xr(z,L,"access private method"),I);var Et,nt,Te,Ct,Tt,Ze,it,De,Ae,st,At,Nt,se,wn,ar,Jr,hn,ye,ot,Lt,Fe;var I=Array.isArray,Rt=Array.prototype.indexOf,bn=Array.from,nr=Object.defineProperty,pt=Object.getOwnPropertyDescriptor,kn=Object.prototype,Sn=Array.prototype,zn=Object.getPrototypeOf,Kr=Object.isExtensible;function Mn(r){for(var e=0;e<r.length;e++)r[e]()}function En(){var r,e,t=new Promise((a,n)=>{r=a,e=n});return{promise:t,resolve:r,reject:e}}const J=2,ir=4,Qr=8,ft=16,_e=32,Le=64,ea=128,ee=256,Ot=512,Y=1024,le=2048,ve=4096,Ve=8192,Ue=16384,sr=32768,Cn=65536,ta=1<<17,Tn=1<<18,ht=1<<19,An=1<<20,or=1<<21,lr=1<<22,Pe=1<<23,jt=Symbol("$state"),cr=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 Nn(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Ln(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Pn(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Rn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function On(r){throw new Error("https://svelte.dev/e/effect_orphan")}function jn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function In(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Zn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Dn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const Fn=2,F=Symbol();function ra(r){return r===this.v}let Us=!1,ne=null;function It(r){ne=r}function ur(r,e=!1,t){ne={p:ne,c:null,e:null,s:r,x:null,l:null}}function dr(r){var e=ne,t=e.e;if(t!==null){e.e=null;for(var a of t)xa(a)}return r!==void 0&&(e.x=r),ne=e.p,r??{}}function aa(){return!0}const Bn=new WeakMap;function Vn(r){var e=T;if(e===null)return M.f|=Pe,r;if((e.f&sr)===0){if((e.f&ea)===0)throw!e.parent&&r instanceof Error&&na(r),r;e.b.error(r)}else pr(r,e)}function pr(r,e){for(;e!==null;){if((e.f&ea)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&na(r),r}function na(r){const e=Bn.get(r);e&&(nr(r,"message",{value:e.message}),nr(r,"stack",{value:e.stack}))}let Zt=[];function Un(){var r=Zt;Zt=[],Mn(r)}function $n(r){Zt.length===0&&queueMicrotask(Un),Zt.push(r)}function qn(){for(var r=T.b;r!==null&&!r.has_pending_snippet();)r=r.parent;return r===null&&Nn(),r}function Wn(r){var e=J|le,t=M!==null&&(M.f&J)!==0?M:null;return T===null||t!==null&&(t.f&ee)!==0?e|=ee:T.f|=ht,{ctx:ne,deps:null,effects:null,equals:ra,f:e,fn:r,reactions:null,rv:0,v:F,wv:0,parent:t??T,ac:null}}function Hn(r,e){let t=T;t===null&&Ln();var a=t.b,n=void 0,i=da(F),s=null,o=!M;return si(()=>{try{var l=r();s&&Promise.resolve(l).catch(()=>{})}catch(m){l=Promise.reject(m)}var c=()=>l;n=(s==null?void 0:s.then(c,c))??Promise.resolve(l),s=n;var u=U,h=a.pending;o&&(a.update_pending_count(1),h||u.increment());const _=(m,v=void 0)=>{s=null,h||u.activate(),v?v!==cr&&(i.f|=Pe,gr(i,v)):((i.f&Pe)!==0&&(i.f^=Pe),gr(i,m)),o&&(a.update_pending_count(-1),h||u.decrement()),oa()};if(n.then(_,m=>_(null,m||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(l=>{function c(u){function h(){u===n?l(i):c(n)}u.then(h,h)}c(n)})}function ia(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Oe(e[t])}}function Yn(r){for(var e=r.parent;e!==null;){if((e.f&J)===0)return e;e=e.parent}return null}function fr(r){var e,t=T;we(Yn(r));try{ia(r),e=Pa(r)}finally{we(t)}return e}function sa(r){var e=fr(r);if(r.equals(e)||(r.v=e,r.wv=Na()),!qe){var t=(be||(r.f&ee)!==0)&&r.deps!==null?ve:Y;re(r,t)}}function Gn(r,e,t){const a=Wn;if(e.length===0){t(r.map(a));return}var n=U,i=T,s=Xn(),o=qn();Promise.all(e.map(l=>Hn(l))).then(l=>{n==null||n.activate(),s();try{t([...r.map(a),...l])}catch(c){(i.f&Ue)===0&&pr(c,i)}n==null||n.deactivate(),oa()}).catch(l=>{o.error(l)})}function Xn(){var r=T,e=M,t=ne,a=U;return function(){we(r),de(e),It(t),a==null||a.activate()}}function oa(){we(null),de(null),It(null)}const hr=new Set;let U=null,la=new Set,Dt=[];function ca(){const r=Dt.shift();Dt.length>0&&queueMicrotask(ca),r()}let mt=[],mr=null,yr=!1;const Xt=class Xt{constructor(){D(this,se);p(this,"current",new Map);D(this,Et,new Map);D(this,nt,new Set);D(this,Te,0);D(this,Ct,null);D(this,Tt,!1);D(this,Ze,[]);D(this,it,[]);D(this,De,[]);D(this,Ae,[]);D(this,st,[]);D(this,At,[]);D(this,Nt,[]);p(this,"skipped_effects",new Set)}process(e){var n;mt=[];for(const i of e)Be(this,se,wn).call(this,i);if(k(this,Ze).length===0&&k(this,Te)===0){Be(this,se,Jr).call(this);var t=k(this,De),a=k(this,Ae);V(this,De,[]),V(this,Ae,[]),V(this,st,[]),U=null,ua(t),ua(a),U===null?U=this:hr.delete(this),(n=k(this,Ct))==null||n.resolve()}else Be(this,se,ar).call(this,k(this,De)),Be(this,se,ar).call(this,k(this,Ae)),Be(this,se,ar).call(this,k(this,st));for(const i of k(this,Ze))We(i);for(const i of k(this,it))We(i);V(this,Ze,[]),V(this,it,[])}capture(e,t){k(this,Et).has(e)||k(this,Et).set(e,t),this.current.set(e,e.v)}activate(){U=this}deactivate(){U=null;for(const e of la)if(la.delete(e),e(),U!==null)break}neuter(){V(this,Tt,!0)}flush(){mt.length>0?Jn():Be(this,se,Jr).call(this),U===this&&(k(this,Te)===0&&hr.delete(this),this.deactivate())}increment(){V(this,Te,k(this,Te)+1)}decrement(){if(V(this,Te,k(this,Te)-1),k(this,Te)===0){for(const e of k(this,At))re(e,le),gt(e);for(const e of k(this,Nt))re(e,ve),gt(e);V(this,De,[]),V(this,Ae,[]),this.flush()}else this.deactivate()}add_callback(e){k(this,nt).add(e)}settled(){return(k(this,Ct)??V(this,Ct,En())).promise}static ensure(){if(U===null){const e=U=new Xt;hr.add(U),Xt.enqueue(()=>{U===e&&e.flush()})}return U}static enqueue(e){Dt.length===0&&queueMicrotask(ca),Dt.unshift(e)}};Et=new WeakMap,nt=new WeakMap,Te=new WeakMap,Ct=new WeakMap,Tt=new WeakMap,Ze=new WeakMap,it=new WeakMap,De=new WeakMap,Ae=new WeakMap,st=new WeakMap,At=new WeakMap,Nt=new WeakMap,se=new WeakSet,wn=function(e){var u;e.f^=Y;for(var t=e.first;t!==null;){var a=t.f,n=(a&(_e|Le))!==0,i=n&&(a&Y)!==0,s=i||(a&Ve)!==0||this.skipped_effects.has(t);if(!s&&t.fn!==null){if(n)t.f^=Y;else if((a&ir)!==0)k(this,Ae).push(t);else if((a&Y)===0)if((a&lr)!==0){var o=(u=t.b)!=null&&u.pending?k(this,it):k(this,Ze);o.push(t)}else Ft(t)&&((t.f&ft)!==0&&k(this,st).push(t),We(t));var l=t.first;if(l!==null){t=l;continue}}var c=t.parent;for(t=t.next;t===null&&c!==null;)t=c.next,c=c.parent}},ar=function(e){for(const t of e)((t.f&le)!==0?k(this,At):k(this,Nt)).push(t),re(t,Y);e.length=0},Jr=function(){if(!k(this,Tt))for(const e of k(this,nt))e();k(this,nt).clear()};let yt=Xt;function Jn(){var r=$e;yr=!0;try{var e=0;for(Ea(!0);mt.length>0;){var t=yt.ensure();if(e++>1e3){var a,n;Kn()}t.process(mt),xe.clear()}}finally{yr=!1,Ea(r),mr=null}}function Kn(){try{jn()}catch(r){pr(r,mr)}}let he=null;function ua(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var a=r[t++];if((a.f&(Ue|Ve))===0&&Ft(a)&&(he=[],We(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?za(a):a.fn=null),(he==null?void 0:he.length)>0)){xe.clear();for(const n of he)We(n);he=[]}}he=null}}function gt(r){for(var e=mr=r;e.parent!==null;){e=e.parent;var t=e.f;if(yr&&e===T&&(t&ft)!==0)return;if((t&(Le|_e))!==0){if((t&Y)===0)return;e.f^=Y}}mt.push(e)}const xe=new Map;function da(r,e){var t={f:0,v:r,reactions:null,equals:ra,rv:0,wv:0};return t}function $(r,e){const t=da(r);return pi(t),t}function B(r,e,t=!1){M!==null&&(!ue||(M.f&ta)!==0)&&aa()&&(M.f&(J|ft|lr|ta))!==0&&!(q!=null&&q.includes(r))&&Dn();let a=t?_t(e):e;return gr(r,a)}function gr(r,e){if(!r.equals(e)){var t=r.v;qe?xe.set(r,e):xe.set(r,t),r.v=e;var a=yt.ensure();a.capture(r,t),(r.f&J)!==0&&((r.f&le)!==0&&fr(r),re(r,(r.f&ee)===0?Y:ve)),r.wv=Na(),pa(r,le),T!==null&&(T.f&Y)!==0&&(T.f&(_e|Le))===0&&(te===null?fi([r]):te.push(r))}return e}function _r(r){B(r,r.v+1)}function pa(r,e){var t=r.reactions;if(t!==null)for(var a=t.length,n=0;n<a;n++){var i=t[n],s=i.f,o=(s&le)===0;o&&re(i,e),(s&J)!==0?pa(i,ve):o&&((s&ft)!==0&&he!==null&&he.push(i),gt(i))}}function _t(r){if(typeof r!="object"||r===null||jt in r)return r;const e=zn(r);if(e!==kn&&e!==Sn)return r;var t=new Map,a=I(r),n=$(0),i=je,s=o=>{if(je===i)return o();var l=M,c=je;de(null),Aa(i);var u=o();return de(l),Aa(c),u};return a&&t.set("length",$(r.length)),new Proxy(r,{defineProperty(o,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&In();var u=t.get(l);return u===void 0?u=s(()=>{var h=$(c.value);return t.set(l,h),h}):B(u,c.value,!0),!0},deleteProperty(o,l){var c=t.get(l);if(c===void 0){if(l in o){const u=s(()=>$(F));t.set(l,u),_r(n)}}else B(c,F),_r(n);return!0},get(o,l,c){var m;if(l===jt)return r;var u=t.get(l),h=l in o;if(u===void 0&&(!h||(m=pt(o,l))!=null&&m.writable)&&(u=s(()=>{var v=_t(h?o[l]:F),j=$(v);return j}),t.set(l,u)),u!==void 0){var _=R(u);return _===F?void 0:_}return Reflect.get(o,l,c)},getOwnPropertyDescriptor(o,l){var c=Reflect.getOwnPropertyDescriptor(o,l);if(c&&"value"in c){var u=t.get(l);u&&(c.value=R(u))}else if(c===void 0){var h=t.get(l),_=h==null?void 0:h.v;if(h!==void 0&&_!==F)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return c},has(o,l){var _;if(l===jt)return!0;var c=t.get(l),u=c!==void 0&&c.v!==F||Reflect.has(o,l);if(c!==void 0||T!==null&&(!u||(_=pt(o,l))!=null&&_.writable)){c===void 0&&(c=s(()=>{var m=u?_t(o[l]):F,v=$(m);return v}),t.set(l,c));var h=R(c);if(h===F)return!1}return u},set(o,l,c,u){var X;var h=t.get(l),_=l in o;if(a&&l==="length")for(var m=c;m<h.v;m+=1){var v=t.get(m+"");v!==void 0?B(v,F):m in o&&(v=s(()=>$(F)),t.set(m+"",v))}if(h===void 0)(!_||(X=pt(o,l))!=null&&X.writable)&&(h=s(()=>$(void 0)),B(h,_t(c)),t.set(l,h));else{_=h.v!==F;var j=s(()=>_t(c));B(h,j)}var H=Reflect.getOwnPropertyDescriptor(o,l);if(H!=null&&H.set&&H.set.call(u,c),!_){if(a&&typeof l=="string"){var oe=t.get("length"),A=Number(l);Number.isInteger(A)&&A>=oe.v&&B(oe,A+1)}_r(n)}return!0},ownKeys(o){R(n);var l=Reflect.ownKeys(o).filter(h=>{var _=t.get(h);return _===void 0||_.v!==F});for(var[c,u]of t)u.v!==F&&!(c in o)&&l.push(c);return l},setPrototypeOf(){Zn()}})}var fa,ha,ma,ya;function Qn(){if(fa===void 0){fa=window,ha=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;ma=pt(e,"firstChild").get,ya=pt(e,"nextSibling").get,Kr(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),Kr(t)&&(t.__t=void 0)}}function ei(r=""){return document.createTextNode(r)}function ga(r){return ma.call(r)}function _a(r){return ya.call(r)}function vr(r,e){return ga(r)}function ti(r,e=1,t=!1){let a=r;for(;e--;)a=_a(a);return a}function va(r){var e=M,t=T;de(null),we(null);try{return r()}finally{de(e),we(t)}}function ri(r){T===null&&M===null&&On(),M!==null&&(M.f&ee)!==0&&T===null&&Rn(),qe&&Pn()}function ai(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Re(r,e,t,a=!0){var n=T;n!==null&&(n.f&Ve)!==0&&(r|=Ve);var i={ctx:ne,deps:null,nodes_start:null,nodes_end:null,f:r|le,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{We(i),i.f|=sr}catch(l){throw Oe(i),l}else e!==null&&gt(i);if(a){var s=i;if(t&&s.deps===null&&s.teardown===null&&s.nodes_start===null&&s.first===s.last&&(s.f&ht)===0&&(s=s.first),s!==null&&(s.parent=n,n!==null&&ai(s,n),M!==null&&(M.f&J)!==0&&(r&Le)===0)){var o=M;(o.effects??(o.effects=[])).push(s)}}return i}function ce(r){ri();var e=T.f,t=!M&&(e&_e)!==0&&(e&sr)===0;if(t){var a=ne;(a.e??(a.e=[])).push(r)}else return xa(r)}function xa(r){return Re(ir|An,r,!1)}function ni(r){yt.ensure();const e=Re(Le|ht,r,!0);return(t={})=>new Promise(a=>{t.outro?ui(e,()=>{Oe(e),a(void 0)}):(Oe(e),a(void 0))})}function ii(r){return Re(ir,r,!1)}function si(r){return Re(lr|ht,r,!0)}function wa(r,e=0){return Re(Qr|e,r,!0)}function ba(r,e=[],t=[]){Gn(e,t,a=>{Re(Qr,()=>r(...a.map(R)),!0)})}function oi(r,e=!0){return Re(_e|ht,r,!0,e)}function ka(r){var e=r.teardown;if(e!==null){const t=qe,a=M;Ca(!0),de(null);try{e.call(null)}finally{Ca(t),de(a)}}}function Sa(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const n=t.ac;n!==null&&va(()=>{n.abort(cr)});var a=t.next;(t.f&Le)!==0?t.parent=null:Oe(t,e),t=a}}function li(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&_e)===0&&Oe(e),e=t}}function Oe(r,e=!0){var t=!1;(e||(r.f&Tn)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(ci(r.nodes_start,r.nodes_end),t=!0),Sa(r,e&&!t),Bt(r,0),re(r,Ue);var a=r.transitions;if(a!==null)for(const i of a)i.stop();ka(r);var n=r.parent;n!==null&&n.first!==null&&za(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function ci(r,e){for(;r!==null;){var t=r===e?null:_a(r);r.remove(),r=t}}function za(r){var e=r.parent,t=r.prev,a=r.next;t!==null&&(t.next=a),a!==null&&(a.prev=t),e!==null&&(e.first===r&&(e.first=a),e.last===r&&(e.last=t))}function ui(r,e){var t=[];Ma(r,t,!0),di(t,()=>{Oe(r),e&&e()})}function di(r,e){var t=r.length;if(t>0){var a=()=>--t||e();for(var n of r)n.out(a)}else e()}function Ma(r,e,t){if((r.f&Ve)===0){if(r.f^=Ve,r.transitions!==null)for(const s of r.transitions)(s.is_global||t)&&e.push(s);for(var a=r.first;a!==null;){var n=a.next,i=(a.f&Cn)!==0||(a.f&_e)!==0;Ma(a,e,i?t:!1),a=n}}}let $e=!1;function Ea(r){$e=r}let qe=!1;function Ca(r){qe=r}let M=null,ue=!1;function de(r){M=r}let T=null;function we(r){T=r}let q=null;function pi(r){M!==null&&(q===null?q=[r]:q.push(r))}let W=null,K=0,te=null;function fi(r){te=r}let Ta=1,vt=0,je=vt;function Aa(r){je=r}let be=!1;function Na(){return++Ta}function Ft(r){var h;var e=r.f;if((e&le)!==0)return!0;if((e&ve)!==0){var t=r.deps,a=(e&ee)!==0;if(t!==null){var n,i,s=(e&Ot)!==0,o=a&&T!==null&&!be,l=t.length;if((s||o)&&(T===null||(T.f&Ue)===0)){var c=r,u=c.parent;for(n=0;n<l;n++)i=t[n],(s||!((h=i==null?void 0:i.reactions)!=null&&h.includes(c)))&&(i.reactions??(i.reactions=[])).push(c);s&&(c.f^=Ot),o&&u!==null&&(u.f&ee)===0&&(c.f^=ee)}for(n=0;n<l;n++)if(i=t[n],Ft(i)&&sa(i),i.wv>r.wv)return!0}(!a||T!==null&&!be)&&re(r,Y)}return!1}function La(r,e,t=!0){var a=r.reactions;if(a!==null&&!(q!=null&&q.includes(r)))for(var n=0;n<a.length;n++){var i=a[n];(i.f&J)!==0?La(i,e,!1):e===i&&(t?re(i,le):(i.f&Y)!==0&&re(i,ve),gt(i))}}function Pa(r){var j;var e=W,t=K,a=te,n=M,i=be,s=q,o=ne,l=ue,c=je,u=r.f;W=null,K=0,te=null,be=(u&ee)!==0&&(ue||!$e||M===null),M=(u&(_e|Le))===0?r:null,q=null,It(r.ctx),ue=!1,je=++vt,r.ac!==null&&(va(()=>{r.ac.abort(cr)}),r.ac=null);try{r.f|=or;var h=r.fn,_=h(),m=r.deps;if(W!==null){var v;if(Bt(r,K),m!==null&&K>0)for(m.length=K+W.length,v=0;v<W.length;v++)m[K+v]=W[v];else r.deps=m=W;if(!be||(u&J)!==0&&r.reactions!==null)for(v=K;v<m.length;v++)((j=m[v]).reactions??(j.reactions=[])).push(r)}else m!==null&&K<m.length&&(Bt(r,K),m.length=K);if(aa()&&te!==null&&!ue&&m!==null&&(r.f&(J|ve|le))===0)for(v=0;v<te.length;v++)La(te[v],r);return n!==null&&n!==r&&(vt++,te!==null&&(a===null?a=te:a.push(...te))),(r.f&Pe)!==0&&(r.f^=Pe),_}catch(H){return Vn(H)}finally{r.f^=or,W=e,K=t,te=a,M=n,be=i,q=s,It(o),ue=l,je=c}}function hi(r,e){let t=e.reactions;if(t!==null){var a=Rt.call(t,r);if(a!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[a]=t[n],t.pop())}}t===null&&(e.f&J)!==0&&(W===null||!W.includes(e))&&(re(e,ve),(e.f&(ee|Ot))===0&&(e.f^=Ot),ia(e),Bt(e,0))}function Bt(r,e){var t=r.deps;if(t!==null)for(var a=e;a<t.length;a++)hi(r,t[a])}function We(r){var e=r.f;if((e&Ue)===0){re(r,Y);var t=T,a=$e;T=r,$e=!0;try{(e&ft)!==0?li(r):Sa(r),ka(r);var n=Pa(r);r.teardown=typeof n=="function"?n:null,r.wv=Ta;var i}finally{$e=a,T=t}}}function R(r){var e=r.f,t=(e&J)!==0;if(M!==null&&!ue){var a=T!==null&&(T.f&Ue)!==0;if(!a&&!(q!=null&&q.includes(r))){var n=M.deps;if((M.f&or)!==0)r.rv<vt&&(r.rv=vt,W===null&&n!==null&&n[K]===r?K++:W===null?W=[r]:(!be||!W.includes(r))&&W.push(r));else{(M.deps??(M.deps=[])).push(r);var i=r.reactions;i===null?r.reactions=[M]:i.includes(M)||i.push(M)}}}else if(t&&r.deps===null&&r.effects===null){var s=r,o=s.parent;o!==null&&(o.f&ee)===0&&(s.f^=ee)}if(qe){if(xe.has(r))return xe.get(r);if(t){s=r;var l=s.v;return((s.f&Y)===0&&s.reactions!==null||Ra(s))&&(l=fr(s)),xe.set(s,l),l}}else t&&(s=r,Ft(s)&&sa(s));if((r.f&Pe)!==0)throw r.v;return r.v}function Ra(r){if(r.v===F)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(xe.has(e)||(e.f&J)!==0&&Ra(e))return!0;return!1}function mi(r){var e=ue;try{return ue=!0,r()}finally{ue=e}}const yi=-7169;function re(r,e){r.f=r.f&yi|e}const gi=["touchstart","touchmove"];function _i(r){return gi.includes(r)}const vi=new Set,Oa=new Set;let ja=null;function Vt(r){var A;var e=this,t=e.ownerDocument,a=r.type,n=((A=r.composedPath)==null?void 0:A.call(r))||[],i=n[0]||r.target;ja=r;var s=0,o=ja===r&&r.__root;if(o){var l=n.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var c=n.indexOf(e);if(c===-1)return;l<=c&&(s=l)}if(i=n[s]||r.target,i!==e){nr(r,"currentTarget",{configurable:!0,get(){return i||t}});var u=M,h=T;de(null),we(null);try{for(var _,m=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var j=i["__"+a];if(j!=null&&(!i.disabled||r.target===i))if(I(j)){var[H,...oe]=j;H.apply(i,[r,...oe])}else j.call(i,r)}catch(X){_?m.push(X):_=X}if(r.cancelBubble||v===e||v===null)break;i=v}if(_){for(let X of m)queueMicrotask(()=>{throw X});throw _}}finally{r.__root=e,delete r.currentTarget,de(u),we(h)}}}function xi(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function wi(r,e){var t=T;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function Ia(r,e){var t=(e&Fn)!==0,a,n=!r.startsWith("<!>");return()=>{a===void 0&&(a=xi(n?r:"<!>"+r),a=ga(a));var i=t||ha?document.importNode(a,!0):a.cloneNode(!0);return wi(i,i),i}}function Za(r,e){r!==null&&r.before(e)}function xr(r,e){return bi(r,e)}const He=new Map;function bi(r,{target:e,anchor:t,props:a={},events:n,context:i,intro:s=!0}){Qn();var o=new Set,l=h=>{for(var _=0;_<h.length;_++){var m=h[_];if(!o.has(m)){o.add(m);var v=_i(m);e.addEventListener(m,Vt,{passive:v});var j=He.get(m);j===void 0?(document.addEventListener(m,Vt,{passive:v}),He.set(m,1)):He.set(m,j+1)}}};l(bn(vi)),Oa.add(l);var c=void 0,u=ni(()=>{var h=t??e.appendChild(ei());return oi(()=>{if(i){ur({});var _=ne;_.c=i}n&&(a.$$events=n),c=r(h,a)||{},i&&dr()}),()=>{var v;for(var _ of o){e.removeEventListener(_,Vt);var m=He.get(_);--m===0?(document.removeEventListener(_,Vt),He.delete(_)):He.set(_,m)}Oa.delete(l),h!==t&&((v=h.parentNode)==null||v.removeChild(h))}});return ki.set(c,u),c}let ki=new WeakMap;function Da(r){var e,t,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=Da(r[e]))&&(a&&(a+=" "),a+=t)}else for(t in r)r[t]&&(a&&(a+=" "),a+=t);return a}function Si(){for(var r,e,t=0,a="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=Da(r))&&(a&&(a+=" "),a+=e);return a}function Fa(r){return typeof r=="object"?Si(r):r??""}function zi(r,e,t){var a=r==null?"":""+r;return e&&(a=a?a+" "+e:e),a===""?null:a}function Mi(r,e){return r==null?null:String(r)}function Ba(r,e,t,a,n,i){var s=r.__className;if(s!==t||s===void 0){var o=zi(t,a);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}return i}function Ut(r,e,t,a){var n=r.__style;if(n!==e){var i=Mi(e);i==null?r.removeAttribute("style"):r.style.cssText=i,r.__style=e}return a}const Ei=()=>performance.now(),pe={tick:r=>requestAnimationFrame(r),now:()=>Ei(),tasks:new Set};function Va(){const r=pe.now();pe.tasks.forEach(e=>{e.c(r)||(pe.tasks.delete(e),e.f())}),pe.tasks.size!==0&&pe.tick(Va)}function Ci(r){let e;return pe.tasks.size===0&&pe.tick(Va),{promise:new Promise(t=>{pe.tasks.add(e={c:r,f:t})}),abort(){pe.tasks.delete(e)}}}function Ua(r,e){return r===e||(r==null?void 0:r[jt])===e}function Ye(r={},e,t,a){return ii(()=>{var n,i;return wa(()=>{n=i,i=[],mi(()=>{r!==t(...i)&&(e(r,...i),n&&Ua(t(...n),r)&&e(null,...n))})}),()=>{$n(()=>{i&&Ua(t(...i),r)&&e(null,...i)})}}),r}const Ti="5";typeof window<"u"&&((hn=window.__svelte??(window.__svelte={})).v??(hn.v=new Set)).add(Ti);function Ai(r){return r}function wr(r){return-.5*(Math.cos(Math.PI*r)-1)}function Ni(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Li(r){return Math.sin(r*Math.PI/2)}const Pi=128,Ri=0,Oi=1,ji=2;class Ii{constructor(){p(this,"animationsStarted",!1);p(this,"animationsCount",0);p(this,"animationsLimit",Pi);p(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const a=t.animations;if(a!=null)for(let n=0;n<a.length;n++){const i=a[n];if(i!=null){for(const s of i.values())if(!s.executed&&(s.executed=!0,s.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,a,n){let i=this.layers[e];i==null&&(i=this.layers[e]={animations:new Array});let s=i.animations[t];s==null&&(s=i.animations[t]=new Map);let o={id:a,priority:t,executed:!1,function:n};s.set(a,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let a=0;a<this.layers.length;a++){let n=this.layers[a];if(n==null)continue;let i=n.animations[e];if(i==null)return;let s=i.get(t);if(s==null||s.executed==!1)return;i.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ke=new Ii;function $a(r){return Object.prototype.toString.call(r)==="[object Date]"}function br(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const a=e.map((n,i)=>br(r[i],n));return n=>a.map(i=>i(n))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if($a(r)&&$a(e)){const i=r.getTime(),o=e.getTime()-i;return l=>new Date(i+l*o)}const a=Object.keys(e),n={};return a.forEach(i=>{n[i]=br(r[i],e[i])}),i=>{const s={};return a.forEach(o=>{s[o]=n[o](i)}),s}}if(t==="number"){const a=e-r;return n=>r+n*a}return()=>e}const Wr=class Wr{constructor(e,t={}){D(this,ye);D(this,ot);D(this,Lt);D(this,Fe,null);V(this,ye,$(e)),V(this,ot,$(e)),V(this,Lt,t)}static of(e,t){const a=new Wr(e(),t);return wa(()=>{a.set(e())}),a}set(e,t){var h;B(k(this,ot),e);let{delay:a=0,duration:n=400,easing:i=Ai,interpolate:s=br}={...k(this,Lt),...t};if(n===0)return(h=k(this,Fe))==null||h.abort(),B(k(this,ye),e),Promise.resolve();const o=pe.now()+a;let l,c=!1,u=k(this,Fe);return V(this,Fe,Ci(_=>{if(_<o)return!0;if(!c){c=!0;const v=k(this,ye).v;l=s(v,e),typeof n=="function"&&(n=n(v,e)),u==null||u.abort()}const m=_-o;return m>n?(B(k(this,ye),e),!1):(B(k(this,ye),l(i(m/n))),!0)})),k(this,Fe).promise}get current(){return R(k(this,ye))}get target(){return R(k(this,ot))}set target(e){this.set(e)}};ye=new WeakMap,ot=new WeakMap,Lt=new WeakMap,Fe=new WeakMap;let kr=Wr;class $t{constructor(e,t){p(this,"value");p(this,"motion");this.value=e,this.motion=new kr(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 Zi=Ia('<div><div class="body svelte-1nfn9j8"></div></div>');function Di(r,e){ur(e,!0);let t,a;function n(){return a}let i=$(!1);function s(P){B(i,P,!0)}function o(){return R(i)}let l=$(!0),c=0,u=150;function h(P){P!=R(l)&&(B(l,P,!0),c=performance.now())}function _(P){return P-c<u?v.motion.current==0:v.value==0}let m=0,v=new $t(0,{easing:wr});ce(()=>{R(i)==!1&&(v.snap(),ke.clear(e.priority,e.id))}),ce(()=>{v.set(R(l)?0:m,{duration:75})}),ce(()=>{j(v.motion.current)});function j(P){t&&ke.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=P.toString(),t.style.filter=`brightness(${.25+.75*P})`,a.style.opacity=P.toString()})}function H(P){P!=m&&(m=P,v.set(P,{duration:75}))}function oe(){return v.value}var A=Zi(),X=vr(A);return Ye(X,P=>a=P,()=>a),Ye(A,P=>t=P,()=>t),ba(()=>{Ba(A,1,Fa(["pin",R(i)&&"displayed"]),"svelte-1nfn9j8"),Ut(A,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`),Ut(X,`width: ${e.width-4}px; height: ${e.height-4}px; border-radius: ${e.radius-2}px`)}),Za(r,A),dr({getBody:n,setDisplayed:s,getDisplayed:o,setCollapsed:h,getCollapsed:_,setScale:H,getScale:oe})}var xt;(r=>{function e(t,a,n){const i=t/2,s=a/2,o=Math.sqrt(i*i+s*s),l=Math.atan(s/i)*(180/Math.PI),c=n*(Math.PI/180);return n<180?n<90?n<l?{x:0,y:o*Math.sin(c)-s}:{x:o*Math.cos(c)-i,y:0}:n<180-l?{x:o*Math.cos(c)-i,y:0}:{x:-t,y:o*Math.sin(c)-s}:n<270?n<180+l?{x:-t,y:o*Math.sin(c)-s}:{x:o*Math.cos(c)-i,y:-a}:n<360-l?{x:o*Math.cos(c)-i,y:-a}:{x:0,y:o*Math.sin(c)-s}}r.getOffsets=e})(xt||(xt={}));var Fi=Ia('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function qa(r,e){ur(e,!0);let t,a,n,i;const s=e.width+2*e.margin,o=e.height+2*e.margin,l=()=>i;ce(()=>{n.style.width=`${e.margin*4}px`,n.style.height=`${e.margin*4}px`});let c=$(!0);function u(N){B(c,N,!0)}function h(){return R(c)}let _=$(!0),m=0,v=300;function j(N){N!=R(_)&&(B(_,N,!0),m=performance.now())}function H(){return performance.now()-m<v?A.motion.current==0:A.value==0}function oe(){return performance.now()-m<v?A.motion.current==1:A.value==1}let A=new $t(0);ce(()=>{R(c)==!1&&(A.snap(),ke.clear(e.priority,e.id+"_scale"))}),ce(()=>{R(_)==!0&&A.value!=0&&(ke.stacked()?A.set(0,{duration:0}):A.set(0,{duration:150,easing:Ni})),R(_)==!1&&A.value!=1&&A.set(1,{duration:150,easing:Li})}),ce(()=>{X(A.motion.current)});function X(N){!t||!a||!n||ke.equeue(R(_)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${N}`,a.style.scale=`${N}`,n.style.scale=`${N}`})}let P=NaN,Hr=$(!1),Ne=new $t(-s/2,{easing:wr}),Qt=new $t(-o/2,{easing:wr});ce(()=>{R(c)==!1&&(Ne.snap(),Ne.snap(),ke.clear(e.priority,e.id+"_angle"))}),ce(()=>{R(_)==!0&&R(Hr)&&(Ne.update({duration:75}),Ne.update({duration:75}))}),ce(()=>{mn(Ne.motion.current,Qt.motion.current)});function mn(N,tr){if(!t||!a||!n)return;const ge=N+s/2,rr=tr+o/2,ut=o<s?ge*o/s:ge,dt=o>s?rr*s/o:rr,js=Math.atan2(dt,ut)/Math.PI*180-45,_n=0,Is=30,Gr=Math.sqrt(ut*ut+dt*dt),Pt=Math.min(s,o)/2,Zs=Pt*Math.SQRT2,Ds=(Gr-Pt)/(Zs-Pt),vn=_n+Ds*(Is-_n),Fs=Gr<Pt?Gr/Pt:1;ke.equeue(e.layer,e.priority,e.id+"_angle",()=>{a.style.transform=`translate(${Math.round(N)}px, ${Math.round(tr)}px)`,n.style.transform=`scale(${Fs}) rotate(${js}deg) skew(${vn}deg, ${vn}deg)`})}function Rs(N,tr){if(R(Hr)==!1||tr==!0){let ge=xt.getOffsets(s,o,N);Ne.set(Math.round(ge.x),{duration:0}),Qt.set(Math.round(ge.y),{duration:0}),mn(Ne.value,Qt.value),P=N,B(Hr,!0)}else if(N!=P){let ge=Math.abs(N-P),rr=ge<180?ge:360-ge,ut=Math.log(rr)*75,dt=xt.getOffsets(s,o,N);Ne.set(Math.round(dt.x),{duration:ut}),Qt.set(Math.round(dt.y),{duration:ut}),P=N}}function Os(){return xt.getOffsets(s,o,P)}var er=Fi(),yn=vr(er);Ye(yn,N=>n=N,()=>n);var Yr=ti(yn,2),gn=vr(Yr);return Ye(gn,N=>i=N,()=>i),Ye(Yr,N=>a=N,()=>a),Ye(er,N=>t=N,()=>t),ba(()=>{Ba(er,1,Fa(["anchor",R(c)&&"displayed"]),"svelte-j5igi2"),Ut(Yr,`margin: ${e.margin}px;`),Ut(gn,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)}),Za(r,er),dr({getBody:l,setDisplayed:u,getDisplayed:h,setCollapsed:j,getCollapsed:H,getExpanded:oe,setAngle:Rs,getOffsets:Os})}var Ge;(r=>{function e(o,l,c){return{x:a(l)*c,y:n(o)*c}}r.project=e;function t(o,l,c){return{lat:s(l/c),lng:i(o/c)}}r.unproject=t;function a(o){return(180+o)/360}function n(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function i(o){return o*360-180}function s(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})(Ge||(Ge={}));class Wa{constructor(e,t,a,n,i){p(this,"swLat");p(this,"swLng");p(this,"neLat");p(this,"neLng");const s=a*Math.pow(2,t),o=Ge.project(e.sw.lat,e.sw.lng,s),l=Ge.project(e.ne.lat,e.ne.lng,s),c=o.x-n,u=o.y+i,h=l.x+n,_=l.y-i,m=Ge.unproject(c,u,s),v=Ge.unproject(h,_,s);this.swLat=m.lat,this.swLng=m.lng,this.neLat=v.lat,this.neLng=v.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 C;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const i={};for(const s of n)i[s]=s;return i},r.getValidEnumValues=n=>{const i=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),s={};for(const o of i)s[o]=n[o];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(i){return n[i]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},r.find=(n,i)=>{for(const s of n)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}r.joinValues=a,r.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(C||(C={}));var Ha;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Ha||(Ha={}));const y=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Se=r=>{switch(typeof r){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(r)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(r)?y.array:r===null?y.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?y.promise:typeof Map<"u"&&r instanceof Map?y.map:typeof Set<"u"&&r instanceof Set?y.set:typeof Date<"u"&&r instanceof Date?y.date:y.object;default:return y.unknown}},d=C.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 ae extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},a={_errors:[]},n=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)a._errors.push(t(s));else{let o=a,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return n(this),a}static assert(e){if(!(e instanceof ae))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}ae.create=r=>new ae(r);const wt=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===y.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,C.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${C.joinValues(r.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${C.joinValues(r.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${C.joinValues(r.options)}, received '${r.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:C.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case d.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case d.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,C.assertNever(r)}return{message:t}};let Bi=wt;function Sr(){return Bi}const zr=r=>{const{data:e,path:t,errorMaps:a,issueData:n}=r,i=[...t,...n.path||[]],s={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let o="";const l=a.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...n,path:i,message:o}};function f(r,e){const t=Sr(),a=zr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===wt?void 0:wt].filter(n=>!!n)});r.common.issues.push(a)}class Q{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if(n.status==="aborted")return x;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const n of t){const i=await n.key,s=await n.value;a.push({key:i,value:s})}return Q.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:i,value:s}=n;if(i.status==="aborted"||s.status==="aborted")return x;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(a[i.value]=s.value)}return{status:e.value,value:a}}}const x=Object.freeze({status:"aborted"}),bt=r=>({status:"dirty",value:r}),G=r=>({status:"valid",value:r}),Ya=r=>r.status==="aborted",Ga=r=>r.status==="dirty",Xe=r=>r.status==="valid",qt=r=>typeof Promise<"u"&&r instanceof Promise;var g;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(g||(g={}));class ze{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xa=(r,e)=>{if(Xe(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ae(r.common.issues);return this._error=t,this._error}}};function S(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:n}=r;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,o)=>{const{message:l}=r;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??a??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:n}}class E{get description(){return this._def.description}_getType(e){return Se(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Se(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Q,ctx:{common:e.parent.common,data:e.data,parsedType:Se(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(qt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Se(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Xa(a,n)}"~validate"(e){var a,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Se(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return Xe(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(n=(a=i==null?void 0:i.message)==null?void 0:a.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>Xe(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Se(e)},n=this._parse({data:e,path:a.path,parent:a}),i=await(qt(n)?n:Promise.resolve(n));return Xa(a,i)}refine(e,t){const a=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,i)=>{const s=e(n),o=()=>i.addIssue({code:d.custom,...a(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((a,n)=>e(a)?!0:(n.addIssue(typeof t=="function"?t(a,n):t),!1))}_refinement(e){return new tt({schema:this,typeName:w.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 Ce.create(this,this._def)}nullable(){return rt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return Mt.create(this,this._def)}or(e){return Ht.create([this,e],this._def)}and(e){return Yt.create(this,e,this._def)}transform(e){return new tt({...S(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Nr({...S(this._def),innerType:this,defaultValue:t,typeName:w.ZodDefault})}brand(){return new us({typeName:w.ZodBranded,type:this,...S(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Lr({...S(this._def),innerType:this,catchValue:t,typeName:w.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Pr.create(this,e)}readonly(){return Rr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vi=/^c[^\s-]{8,}$/i,Ui=/^[0-9a-z]+$/,$i=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qi=/^[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,Wi=/^[a-z0-9_-]{21}$/i,Hi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Yi=/^[-+]?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)?)??$/,Gi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mr;const Ji=/^(?:(?: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])$/,Ki=/^(?:(?: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])$/,Qi=/^(([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]))$/,es=/^(([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])$/,ts=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ja="((\\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])))",as=new RegExp(`^${Ja}$`);function Ka(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ns(r){return new RegExp(`^${Ka(r)}$`)}function is(r){let e=`${Ja}T${Ka(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ss(r,e){return!!((e==="v4"||!e)&&Ji.test(r)||(e==="v6"||!e)&&Qi.test(r))}function os(r,e){if(!Hi.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(a));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function ls(r,e){return!!((e==="v4"||!e)&&Ki.test(r)||(e==="v6"||!e)&&es.test(r))}class Me extends E{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_type,expected:y.string,received:i.parsedType}),x}const a=new Q;let n;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(n=this._getOrReturnCtx(e,n),s?f(n,{code:d.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&f(n,{code:d.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")Gi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"email",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")Mr||(Mr=new RegExp(Xi,"u")),Mr.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"emoji",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")qi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"uuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")Wi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"nanoid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")Vi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")Ui.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid2",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")$i.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ulid",code:d.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),f(n,{validation:"url",code:d.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"regex",code:d.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?is(i).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?as.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?ns(i).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?Yi.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"duration",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?ss(e.data,i.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ip",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="jwt"?os(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"jwt",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="cidr"?ls(e.data,i.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cidr",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?ts.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"base64",code:d.invalid_string,message:i.message}),a.dirty()):i.kind==="base64url"?rs.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"base64url",code:d.invalid_string,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(n=>e.test(n),{validation:t,code:d.invalid_string,...g.errToObj(a)})}_addCheck(e){return new Me({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...g.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...g.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,...g.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,...g.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...g.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...g.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...g.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...g.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...g.errToObj(t)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new Me({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Me({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Me({...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}}Me.create=r=>new Me({checks:[],typeName:w.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});function cs(r,e){const t=(r.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=t>a?t:a,i=Number.parseInt(r.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return i%s/10**n}class Je extends E{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)!==y.number){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_type,expected:y.number,received:i.parsedType}),x}let a;const n=new Q;for(const i of this._def.checks)i.kind==="int"?C.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:d.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?cs(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_finite,message:i.message}),n.dirty()):C.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,a,n){return new Je({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:g.toString(n)}]})}_addCheck(e){return new Je({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.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"&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Je.create=r=>new Je({checks:[],typeName:w.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class kt extends E{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)!==y.bigint)return this._getInvalidInput(e);let a;const n=new Q;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),f(a,{code:d.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):C.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return f(t,{code:d.invalid_type,expected:y.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,a,n){return new kt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:g.toString(n)}]})}_addCheck(e){return new kt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.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}}kt.create=r=>new kt({checks:[],typeName:w.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});class Er extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.boolean,received:a.parsedType}),x}return G(e.data)}}Er.create=r=>new Er({typeName:w.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class Wt extends E{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_type,expected:y.date,received:i.parsedType}),x}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return f(i,{code:d.invalid_date}),x}const a=new Q;let n;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):C.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:g.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}}Wt.create=r=>new Wt({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:w.ZodDate,...S(r)});class Qa extends E{_parse(e){if(this._getType(e)!==y.symbol){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.symbol,received:a.parsedType}),x}return G(e.data)}}Qa.create=r=>new Qa({typeName:w.ZodSymbol,...S(r)});class en extends E{_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.undefined,received:a.parsedType}),x}return G(e.data)}}en.create=r=>new en({typeName:w.ZodUndefined,...S(r)});class tn extends E{_parse(e){if(this._getType(e)!==y.null){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.null,received:a.parsedType}),x}return G(e.data)}}tn.create=r=>new tn({typeName:w.ZodNull,...S(r)});class Cr extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return G(e.data)}}Cr.create=r=>new Cr({typeName:w.ZodAny,...S(r)});class Ke extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return G(e.data)}}Ke.create=r=>new Ke({typeName:w.ZodUnknown,...S(r)});class Ee extends E{_parse(e){const t=this._getOrReturnCtx(e);return f(t,{code:d.invalid_type,expected:y.never,received:t.parsedType}),x}}Ee.create=r=>new Ee({typeName:w.ZodNever,...S(r)});class Tr extends E{_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.void,received:a.parsedType}),x}return G(e.data)}}Tr.create=r=>new Tr({typeName:w.ZodVoid,...S(r)});class fe extends E{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==y.array)return f(t,{code:d.invalid_type,expected:y.array,received:t.parsedType}),x;if(n.exactLength!==null){const s=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(s||o)&&(f(t,{code:s?d.too_big:d.too_small,minimum:o?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(f(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(f(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>n.type._parseAsync(new ze(t,s,t.path,o)))).then(s=>Q.mergeArray(a,s));const i=[...t.data].map((s,o)=>n.type._parseSync(new ze(t,s,t.path,o)));return Q.mergeArray(a,i)}get element(){return this._def.type}min(e,t){return new fe({...this._def,minLength:{value:e,message:g.toString(t)}})}max(e,t){return new fe({...this._def,maxLength:{value:e,message:g.toString(t)}})}length(e,t){return new fe({...this._def,exactLength:{value:e,message:g.toString(t)}})}nonempty(e){return this.min(1,e)}}fe.create=(r,e)=>new fe({type:r,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...S(e)});function Qe(r){if(r instanceof Z){const e={};for(const t in r.shape){const a=r.shape[t];e[t]=Ce.create(Qe(a))}return new Z({...r._def,shape:()=>e})}else return r instanceof fe?new fe({...r._def,type:Qe(r.element)}):r instanceof Ce?Ce.create(Qe(r.unwrap())):r instanceof rt?rt.create(Qe(r.unwrap())):r instanceof me?me.create(r.items.map(e=>Qe(e))):r}class Z extends E{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=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==y.object){const c=this._getOrReturnCtx(e);return f(c,{code:d.invalid_type,expected:y.object,received:c.parsedType}),x}const{status:a,ctx:n}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ee&&this._def.unknownKeys==="strip"))for(const c in n.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=i[c],h=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ze(n,h,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Ee){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict")o.length>0&&(f(n,{code:d.unrecognized_keys,keys:o}),a.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const h=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ze(n,h,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const h=await u.key,_=await u.value;c.push({key:h,value:_,alwaysSet:u.alwaysSet})}return c}).then(c=>Q.mergeObjectSync(a,c)):Q.mergeObjectSync(a,l)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new Z({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var i,s;const n=((s=(i=this._def).errorMap)==null?void 0:s.call(i,t,a).message)??a.defaultError;return t.code==="unrecognized_keys"?{message:g.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new Z({...this._def,unknownKeys:"strip"})}passthrough(){return new Z({...this._def,unknownKeys:"passthrough"})}extend(e){return new Z({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Z({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Z({...this._def,catchall:e})}pick(e){const t={};for(const a of C.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new Z({...this._def,shape:()=>t})}omit(e){const t={};for(const a of C.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new Z({...this._def,shape:()=>t})}deepPartial(){return Qe(this)}partial(e){const t={};for(const a of C.objectKeys(this.shape)){const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new Z({...this._def,shape:()=>t})}required(e){const t={};for(const a of C.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof Ce;)i=i._def.innerType;t[a]=i}return new Z({...this._def,shape:()=>t})}keyof(){return sn(C.objectKeys(this.shape))}}Z.create=(r,e)=>new Z({shape:()=>r,unknownKeys:"strip",catchall:Ee.create(),typeName:w.ZodObject,...S(e)}),Z.strictCreate=(r,e)=>new Z({shape:()=>r,unknownKeys:"strict",catchall:Ee.create(),typeName:w.ZodObject,...S(e)}),Z.lazycreate=(r,e)=>new Z({shape:r,unknownKeys:"strip",catchall:Ee.create(),typeName:w.ZodObject,...S(e)});class Ht extends E{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function n(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(o=>new ae(o.ctx.common.issues));return f(t,{code:d.invalid_union,unionErrors:s}),x}if(t.common.async)return Promise.all(a.map(async i=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let i;const s=[];for(const l of a){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const o=s.map(l=>new ae(l));return f(t,{code:d.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}}Ht.create=(r,e)=>new Ht({options:r,typeName:w.ZodUnion,...S(e)});function Ar(r,e){const t=Se(r),a=Se(e);if(r===e)return{valid:!0,data:r};if(t===y.object&&a===y.object){const n=C.objectKeys(e),i=C.objectKeys(r).filter(o=>n.indexOf(o)!==-1),s={...r,...e};for(const o of i){const l=Ar(r[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(t===y.array&&a===y.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let i=0;i<r.length;i++){const s=r[i],o=e[i],l=Ar(s,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return t===y.date&&a===y.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Yt extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(i,s)=>{if(Ya(i)||Ya(s))return x;const o=Ar(i.value,s.value);return o.valid?((Ga(i)||Ga(s))&&t.dirty(),{status:t.value,value:o.data}):(f(a,{code:d.invalid_intersection_types}),x)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,s])=>n(i,s)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Yt.create=(r,e,t)=>new Yt({left:r,right:e,typeName:w.ZodIntersection,...S(t)});class me extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.array)return f(a,{code:d.invalid_type,expected:y.array,received:a.parsedType}),x;if(a.data.length<this._def.items.length)return f(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&a.data.length>this._def.items.length&&(f(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...a.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new ze(a,s,a.path,o)):null}).filter(s=>!!s);return a.common.async?Promise.all(i).then(s=>Q.mergeArray(t,s)):Q.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new me({...this._def,rest:e})}}me.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new me({items:r,typeName:w.ZodTuple,rest:null,...S(e)})};class rn extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.map)return f(a,{code:d.invalid_type,expected:y.map,received:a.parsedType}),x;const n=this._def.keyType,i=this._def.valueType,s=[...a.data.entries()].map(([o,l],c)=>({key:n._parse(new ze(a,o,a.path,[c,"key"])),value:i._parse(new ze(a,l,a.path,[c,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}}}}rn.create=(r,e,t)=>new rn({valueType:e,keyType:r,typeName:w.ZodMap,...S(t)});class St extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.set)return f(a,{code:d.invalid_type,expected:y.set,received:a.parsedType}),x;const n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(f(a,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(f(a,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return x;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const o=[...a.data.values()].map((l,c)=>i._parse(new ze(a,l,a.path,c)));return a.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,t){return new St({...this._def,minSize:{value:e,message:g.toString(t)}})}max(e,t){return new St({...this._def,maxSize:{value:e,message:g.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}St.create=(r,e)=>new St({valueType:r,minSize:null,maxSize:null,typeName:w.ZodSet,...S(e)});class zt extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.function)return f(t,{code:d.invalid_type,expected:y.function,received:t.parsedType}),x;function a(o,l){return zr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sr(),wt].filter(c=>!!c),issueData:{code:d.invalid_arguments,argumentsError:l}})}function n(o,l){return zr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sr(),wt].filter(c=>!!c),issueData:{code:d.invalid_return_type,returnTypeError:l}})}const i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Mt){const o=this;return G(async function(...l){const c=new ae([]),u=await o._def.args.parseAsync(l,i).catch(m=>{throw c.addIssue(a(l,m)),c}),h=await Reflect.apply(s,this,u);return await o._def.returns._def.type.parseAsync(h,i).catch(m=>{throw c.addIssue(n(h,m)),c})})}else{const o=this;return G(function(...l){const c=o._def.args.safeParse(l,i);if(!c.success)throw new ae([a(l,c.error)]);const u=Reflect.apply(s,this,c.data),h=o._def.returns.safeParse(u,i);if(!h.success)throw new ae([n(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new zt({...this._def,args:me.create(e).rest(Ke.create())})}returns(e){return new zt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new zt({args:e||me.create([]).rest(Ke.create()),returns:t||Ke.create(),typeName:w.ZodFunction,...S(a)})}}class an extends E{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})}}an.create=(r,e)=>new an({getter:r,typeName:w.ZodLazy,...S(e)});class nn extends E{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}nn.create=(r,e)=>new nn({value:r,typeName:w.ZodLiteral,...S(e)});function sn(r,e){return new et({values:r,typeName:w.ZodEnum,...S(e)})}class et extends E{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return f(t,{expected:C.joinValues(a),received:t.parsedType,code:d.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return f(t,{received:t.data,code:d.invalid_enum_value,options:a}),x}return G(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return et.create(e,{...this._def,...t})}exclude(e,t=this._def){return et.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}et.create=sn;class on extends E{_parse(e){const t=C.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==y.string&&a.parsedType!==y.number){const n=C.objectValues(t);return f(a,{expected:C.joinValues(n),received:a.parsedType,code:d.invalid_type}),x}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=C.objectValues(t);return f(a,{received:a.data,code:d.invalid_enum_value,options:n}),x}return G(e.data)}get enum(){return this._def.values}}on.create=(r,e)=>new on({values:r,typeName:w.ZodNativeEnum,...S(e)});class Mt extends E{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.promise&&t.common.async===!1)return f(t,{code:d.invalid_type,expected:y.promise,received:t.parsedType}),x;const a=t.parsedType===y.promise?t.data:Promise.resolve(t.data);return G(a.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Mt.create=(r,e)=>new Mt({type:r,typeName:w.ZodPromise,...S(e)});class tt extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:s=>{f(a,s),s.fatal?t.abort():t.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const s=n.transform(a.data,i);if(a.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return x;const l=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return l.status==="aborted"?x:l.status==="dirty"||t.value==="dirty"?bt(l.value):l});{if(t.value==="aborted")return x;const o=this._def.schema._parseSync({data:s,path:a.path,parent:a});return o.status==="aborted"?x:o.status==="dirty"||t.value==="dirty"?bt(o.value):o}}if(n.type==="refinement"){const s=o=>{const l=n.refinement(o,i);if(a.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(a.common.async===!1){const s=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Xe(s))return x;const o=n.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(s=>Xe(s)?Promise.resolve(n.transform(s.value,i)).then(o=>({status:t.value,value:o})):x);C.assertNever(n)}}tt.create=(r,e,t)=>new tt({schema:r,typeName:w.ZodEffects,effect:e,...S(t)}),tt.createWithPreprocess=(r,e,t)=>new tt({schema:e,effect:{type:"preprocess",transform:r},typeName:w.ZodEffects,...S(t)});class Ce extends E{_parse(e){return this._getType(e)===y.undefined?G(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ce.create=(r,e)=>new Ce({innerType:r,typeName:w.ZodOptional,...S(e)});class rt extends E{_parse(e){return this._getType(e)===y.null?G(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rt.create=(r,e)=>new rt({innerType:r,typeName:w.ZodNullable,...S(e)});class Nr extends E{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===y.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Nr.create=(r,e)=>new Nr({innerType:r,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class Lr extends E{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return qt(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ae(a.common.issues)},input:a.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ae(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Lr.create=(r,e)=>new Lr({innerType:r,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class ln extends E{_parse(e){if(this._getType(e)!==y.nan){const a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:y.nan,received:a.parsedType}),x}return{status:"valid",value:e.data}}}ln.create=r=>new ln({typeName:w.ZodNaN,...S(r)});class us extends E{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Pr extends E{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?x:i.status==="dirty"?(t.dirty(),bt(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?x:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,t){return new Pr({in:e,out:t,typeName:w.ZodPipeline})}}class Rr extends E{_parse(e){const t=this._def.innerType._parse(e),a=n=>(Xe(n)&&(n.value=Object.freeze(n.value)),n);return qt(t)?t.then(n=>a(n)):a(t)}unwrap(){return this._def.innerType}}Rr.create=(r,e)=>new Rr({innerType:r,typeName:w.ZodReadonly,...S(e)});var w;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(w||(w={}));const at=Me.create,b=Je.create,cn=Er.create,Or=Cr.create;Ke.create,Ee.create;const Gt=Tr.create,jr=fe.create,O=Z.create;Ht.create,Yt.create;const un=me.create,ie=zt.create,ds=et.create,ps=Mt.create;Ce.create,rt.create,O({pin:O({fade:cn().optional(),maxCount:b().optional(),maxZoom:b().optional()}).optional(),animation:O({queue:O({limit:b().optional()}).optional()}).optional(),api:O({states:O({url:at()}).optional()}).optional()});const Ir=b().min(-90).max(90),Zr=b().min(-180).max(180),fs=O({sw:O({lat:Ir,lng:Zr}),ne:O({lat:Ir,lng:Zr})}),Dr=Or().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),hs=O({mapSize:b().min(1),zoomMin:b().min(0),zoomMax:b().min(0),zoomScale:b().min(1).max(10)}),ms=O({instance:Or(),inserted:ie().returns(cn()),insert:ie().returns(Gt()),remove:ie().returns(Gt()),update:ie().args(b()).returns(Gt())}),ys=O({getParameters:ie().args().returns(hs),getContainer:ie().args().returns(Dr),getZoom:ie().args().returns(b()),getBounds:ie().args().returns(fs),panBy:ie().args(b(),b()).returns(Gt()),createMarker:ie().args(Dr,Ir,Zr,b()).returns(ms)}),Fr=ie().args(at()).returns(ps(Dr)),gs=O({id:at().min(1),rank:b(),lat:b().min(-90).max(90),lng:b().min(-180).max(180),tooltip:O({style:O({width:b(),height:b(),margin:b(),radius:b()}).refine(r=>Math.min(r.width,r.height)/r.margin>=5,"Tooltip width and height must be at least 5 times the margin"),body:Fr}),pin:O({style:O({width:b(),height:b(),radius:b()}),body:Fr}).optional(),popup:O({style:O({width:b(),height:b(),radius:b(),margin:b()}),body:Fr}).optional()}),_s=jr(gs);var Ie;(r=>{r.COUNT=12,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],r.DEGREES_DEFAULT=270})(Ie||(Ie={})),un([b(),jr(un([b(),b()]))]);const dn=O({mapSize:b().min(1),zoomMin:b().min(0).max(24),zoomMax:b().min(0).max(24),zoomScale:b().min(1).max(10)}),vs=O({id:at(),rank:b(),lat:b(),lng:b(),width:b(),height:b(),margin:b()});O({key:at(),parameters:dn,input:jr(vs)});const xs=ds(["info","warn","error"]);O({title:at(),level:xs,content:Or()});const pn="1.0.207",fn="https://maps.api.arenarium.dev",ws=`${fn}/log`,bs=`${fn}/tooltip/states`;class ks{constructor(e,t,a){p(this,"apiKey");p(this,"apiStatesUrl");p(this,"apiDevEnvironment");p(this,"mapProvider");p(this,"markerDataArray",new Array);p(this,"markerDataMap",new Map);p(this,"markerDataUpdating",!1);p(this,"markerPinProcessor");p(this,"markerTooltipProcessor");p(this,"markerPopupProcessor");ys.parse(t),this.apiKey=e,this.apiDevEnvironment=(window==null?void 0:window.location.host.startsWith("localhost"))||(window==null?void 0:window.location.host.startsWith("127.0.0.1")),this.mapProvider=t,this.markerPinProcessor=new Ur(t),this.markerTooltipProcessor=new zs(t),this.markerPopupProcessor=new Ms(t),this.configuration=a,this.log("info","Loaded")}set configuration(e){var t,a,n,i;this.markerPinProcessor.setConfiguration(e),this.apiStatesUrl=((a=(t=e==null?void 0:e.api)==null?void 0:t.states)==null?void 0:a.url)??void 0,ke.setLimit(((i=(n=e==null?void 0:e.animation)==null?void 0:n.queue)==null?void 0:i.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(e){_s.parse(e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const a of this.markerDataArray)this.markerPopupProcessor.hide(a);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const a of this.markerDataArray)this.markerPopupProcessor.hide(a);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}async updateMarkerData(e){try{let t=this.markerDataArray.map(n=>n.marker);for(let n=0;n<e.length;n++){const i=e[n];this.markerDataMap.get(i.id)||t.push(i)}let a;if(e.length>1){const n=this.mapProvider.getParameters();dn.parse(n);const i=t.map(c=>({id:c.id,rank:c.rank,lat:c.lat,lng:c.lng,width:c.tooltip.style.width,height:c.tooltip.style.height,margin:c.tooltip.style.margin})),s={key:this.apiKey,parameters:n,input:i},o=this.apiStatesUrl??bs,l=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json","Cache-Control":this.apiDevEnvironment?"no-cache":""},body:JSON.stringify(s)});if(!l.ok||!l.body)throw new Error("Failed to get marker states: "+l.statusText);a=await l.json()}else a=[[0,[[0,Ie.DEGREES.indexOf(Ie.DEGREES_DEFAULT)]]]];try{this.markerDataUpdating=!0;for(let n=0;n<t.length;n++){const i=t[n],s=a[n],o=this.markerDataMap.get(i.id);if(o)o.update(s);else{const l=new Ss(this.mapProvider,i,s);l.create(),this.markerDataMap.set(i.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((n,i)=>n.zoom-i.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(n=>n.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(n=>n.tooltip)),this.markerPopupProcessor.updateElements(this.markerDataArray.map(n=>n.popup))}finally{this.markerDataUpdating=!1}}catch(t){throw console.error(t),this.markerDataArray.forEach(a=>a.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),t instanceof Error&&this.log("error","Failed to update marker data",t),t}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),t=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,a){if(!this.apiDevEnvironment)try{const n={title:`[CLIENT:${pn}] ${t}`,level:e,content:{version:pn,...a}};await fetch(ws,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(n){console.error(n)}}}class Ss{constructor(e,t,a){p(this,"marker");p(this,"zoom");p(this,"pin");p(this,"tooltip");p(this,"popup");this.marker=t,this.zoom=a[0],this.pin=new Vr(e,t,a),this.tooltip=new $r(e,t,a),this.popup=new qr(e,t)}create(){this.pin.create(),this.tooltip.create(),this.popup.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove(),this.popup.remove()}}class Br{constructor(e,t){p(this,"provider");p(this,"id");p(this,"lat");p(this,"lng");p(this,"shown");p(this,"element");p(this,"component");p(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,a=this.component;if(t==null||a==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e;(e=this.marker)==null||e.remove()}}const lt=class lt extends Br{constructor(t,a,n){var i,s,o,l;super(t,a);p(this,"width");p(this,"height");p(this,"radius");p(this,"zoom");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=((i=a.pin)==null?void 0:i.style.width)??lt.DEFAULT_SIZE,this.height=((s=a.pin)==null?void 0:s.style.height)??lt.DEFAULT_SIZE,this.radius=((o=a.pin)==null?void 0:o.style.radius)??lt.DEFAULT_SIZE,this.zoom=n[0],this.bodyCallback=(l=a.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=xr(Di,{target:this.element,props:{id:this.id+"_pin",layer:ji,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateBody(){var a;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load pin body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(t)}setScale(t){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(t)}getScaleFromZoomDistance(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(lt,"DEFAULT_SIZE",16);let Vr=lt;const ct=class ct{constructor(e){p(this,"provider");p(this,"pinElements",new Array);p(this,"pinMaxWidth",0);p(this,"pinMaxHeight",0);p(this,"pinFade",!1);p(this,"pinMaxCount",0);p(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,a,n;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((a=e==null?void 0:e.pin)==null?void 0:a.maxCount)??Math.max(ct.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((n=e==null?void 0:e.pin)==null?void 0:n.maxZoom)??ct.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,a)=>Math.max(t,a.width),0),this.pinMaxHeight=e.reduce((t,a)=>Math.max(t,a.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const a=this.provider.getParameters().mapSize,n=new Wa(e,t,a,this.pinMaxWidth*2,this.pinMaxHeight*2);let i=0;for(const s of this.pinElements)n.contains(s.lat,s.lng)?s.shown&&t<s.zoom&&s.zoom<t+this.pinMaxZoomDelta?(i<this.pinMaxCount&&(s.setCollapsed(!1),s.setScale(this.pinFade?s.getScaleFromZoomDistance(t):1),s.updateMap(!0),s.isBodyLoaded()==!1&&s.updateBody()),i++):(s.setCollapsed(!0),s.isCollapsed()&&s.updateMap(!1)):s.updateMap(!1)}};p(ct,"MAP_PINS_MAX_ZOOM",2),p(ct,"MAP_PINS_MAX_COUNT",128);let Ur=ct;const Jt=class Jt extends Br{constructor(t,a,n){super(t,a);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"zoom");p(this,"angle");p(this,"states");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.width=a.tooltip.style.width,this.height=a.tooltip.style.height,this.margin=a.tooltip.style.margin,this.radius=a.tooltip.style.radius,this.zoom=n[0],this.angle=Ie.DEGREES_DEFAULT,this.states=n[1].map(i=>[i[0],Ie.DEGREES[i[1]]]),this.bodyCallback=a.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=xr(qa,{target:this.element,props:{id:this.id+"_tooltip",layer:Oi,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(a=>[a[0],Ie.DEGREES[a[1]]]),this.updateZIndex()}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var a;if(this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load tooltip body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const a=this.states.findLast(n=>n[0]<=t);if(!a)throw new Error("Angle not found");return a[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+Jt.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(Jt,"Z_INDEX_OFFSET",1e6);let $r=Jt;class zs{constructor(e){p(this,"provider");p(this,"tooltipElements",new Array);p(this,"tooltipMaxWidth",0);p(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,a)=>Math.max(t,a.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,a)=>Math.max(t,a.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const a=this.provider.getParameters().mapSize,n=new Wa(e,t,a,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const i of this.tooltipElements)n.contains(i.lat,i.lng)?i.shown&&i.zoom<=t?(i.updateState(t),i.setCollapsed(!1),i.updateMap(!0),i.isCollapsed()==!1&&i.isBodyLoaded()==!1&&i.updateBody()):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}}const Kt=class Kt extends Br{constructor(t,a){if(a.popup==null)throw new Error("Failed to create popup");super(t,a);p(this,"width");p(this,"height");p(this,"margin");p(this,"radius");p(this,"bodyLoading",!1);p(this,"bodyLoaded",!1);p(this,"bodyCallback");this.shown=!1,this.width=a.popup.style.width,this.height=a.popup.style.height,this.margin=a.popup.style.margin,this.radius=a.popup.style.radius,this.bodyCallback=a.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=xr(qa,{target:this.element,props:{id:this.id+"_popup",layer:Ri,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var a;super.updateMap(t),(a=this.component)==null||a.setDisplayed(t)}updateBody(){var a;if(this.bodyLoaded||this.bodyLoading)return;const t=(a=this.component)==null?void 0:a.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?t.appendChild(n):console.error("Failed to load popup body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Kt.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,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};p(Kt,"Z_INDEX_OFFSET",2e6);let qr=Kt;class Ms{constructor(e){p(this,"provider");p(this,"popupElements",new Array);p(this,"popupPositioned",new Map);this.provider=e}show(e){e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0}hide(e){e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(t=>[t.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.remove()),this.popupElements.length=0,this.popupPositioned.clear()}process(){var e,t;for(const a of this.popupElements)if(a.shown){if(a.setCollapsed(!1),a.updateMap(!0),a.isExpanded()&&a.isBodyLoaded()==!1&&a.updateBody(),a.isCollapsed()==!1&&this.popupPositioned.get(a.id)==!1){const n=(e=a.component)==null?void 0:e.getBody();if(n==null)continue;const i=(t=a.component)==null?void 0:t.getOffsets();if(i==null)continue;const s=n.getBoundingClientRect();if(s.x==0&&s.y==0&&s.width==0&&s.height==0)continue;const o=s.x+s.width/2,l=s.y+s.height/2,c=o+i.x,u=l+i.y,h=c+a.width,_=u+a.height,m=this.provider.getContainer().getBoundingClientRect(),v=c-m.left,j=m.right-h,H=u-m.top,oe=m.bottom-_,A=Math.min(a.width,a.height)/4,X=v<0?v-A:j<0?-j+A:0,P=H<0?H-A:oe<0?-oe+A:0;this.provider.panBy(X,P),this.popupPositioned.set(a.id,!0)}}else a.setCollapsed(!0),a.isCollapsed()&&a.updateMap(!1)}}class Es{constructor(e,t,a){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...a,minZoom:Math.max(a.minZoom??0,0),maxZoom:Math.min(a.maxZoom??22,24),style:a.style??"https://tiles.openfreemap.org/styles/liberty",pitchWithRotate:!1,attributionControl:a.attributionControl??{compact:!1,customAttribution:"@arenarium/maps"}}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds(),t=e.getSouthWest(),a=e.getNorthEast();return{sw:t,ne:a}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,a){const n=new this.MapMarkerClass({element:e});return n.setLngLat([a,t]),{instance:n,inserted:()=>n._map!=null,insert:()=>n.addTo(this.map),remove:()=>n.remove(),update:i=>n.getElement().style.zIndex=i.toString()}}}const Cs={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}}]},Ts={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 As{constructor(e,t,a){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...a,minZoom:Math.max(a.minZoom??0,0),maxZoom:Math.min(a.maxZoom??22,24),projection:"mercator",pitchWithRotate:!1,customAttribution:a.customAttribution??"@arenarium/maps"}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable()}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds();if(!e)return{sw:{lat:0,lng:0},ne:{lat:0,lng:0}};const t=e.getSouthWest(),a=e.getNorthEast();return{sw:t,ne:a}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,a){const n=new this.MapMarkerClass({element:e});return n.setLngLat([a,t]),{instance:n,inserted:()=>n._map!=null,insert:()=>n.addTo(this.map),remove:()=>n.remove(),update:i=>n.getElement().style.zIndex=i.toString()}}}class Ns{constructor(e,t,a,n){p(this,"MapClass");p(this,"MapMarkerClass");p(this,"map");p(this,"options");this.MapClass=e,this.MapMarkerClass=t,this.options=n,this.map=new this.MapClass(a,{...n})}getParameters(){return{mapSize:256,zoomMin:this.options.minZoom??0,zoomMax:this.options.maxZoom??24,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getDiv()}getZoom(){return this.map.getZoom()??NaN}getBounds(){const e=this.map.getBounds();if(e==null)return{sw:{lat:NaN,lng:NaN},ne:{lat:NaN,lng:NaN}};const t=e.getSouthWest(),a=e.getNorthEast();return{sw:{lat:t.lat(),lng:t.lng()},ne:{lat:a.lat(),lng:a.lng()}}}panBy(e,t){this.map.panBy(e,t)}createMarker(e,t,a,n){const i=new this.MapMarkerClass({position:{lat:t,lng:a},content:e,zIndex:n});return{instance:i,inserted:()=>i.map!=null&&i.map==this.map,insert:()=>i.map=this.map,remove:()=>i.map=void 0,update:s=>i.zIndex=s}}}const Ls=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100},{lightness:-10}]},{featureType:"landscape",stylers:[{lightness:30}]},{featureType:"road",elementType:"geometry",stylers:[{saturation:-100}]}],Ps=[{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}]}];z.GoogleMapDarkStyle=Ps,z.GoogleMapLightStyle=Ls,z.GoogleMapsProvider=Ns,z.MapManager=ks,z.MapboxProvider=As,z.MaplibreDarkStyle=Cs,z.MaplibreLightStyle=Ts,z.MaplibreProvider=Es,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));