@arenarium/maps 1.0.130 → 1.0.132

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/main.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Rn=Object.defineProperty;var cr=r=>{throw TypeError(r)};var Pn=(r,e,t)=>e in r?Rn(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var g=(r,e,t)=>Pn(r,typeof e!="symbol"?e+"":e,t),dr=(r,e,t)=>e.has(r)||cr("Cannot "+t);var $=(r,e,t)=>(dr(r,e,"read from private field"),t?t.call(r):e.get(r)),ze=(r,e,t)=>e.has(r)?cr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Fe=(r,e,t,n)=>(dr(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fr=!1;var $r=Array.isArray,Dn=Array.prototype.indexOf,Zn=Array.from,Ln=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,jn=Object.prototype,zn=Array.prototype,Fn=Object.getPrototypeOf,hr=Object.isExtensible;function Vn(r){for(var e=0;e<r.length;e++)r[e]()}const X=2,Ur=4,yt=8,Ut=16,ge=32,Ze=64,Bt=128,z=256,it=512,Y=1024,ae=2048,we=4096,ot=8192,qt=16384,Br=32768,$n=65536,Un=1<<19,qr=1<<20,St=1<<21,nt=Symbol("$state");function Wr(r){return r===this.v}function Bn(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function qn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Wn(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Yn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Hn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Xn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Jn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Gn=!1;const L=Symbol();let q=null;function pr(r){q=r}function Wt(r,e=!1,t){var n=q={p:q,c:null,d:!1,e:null,m:!1,s:r,x:null,l:null};ia(()=>{n.d=!0})}function Yt(r){const e=q;if(e!==null){r!==void 0&&(e.x=r);const i=e.e;if(i!==null){var t=M,n=S;e.e=null;try{for(var a=0;a<i.length;a++){var s=i[a];Oe(s.effect),pe(s.reaction),Ht(s.fn)}}finally{Oe(t),pe(n)}}q=e.p,e.m=!0}return r||{}}function Yr(){return!0}function Ve(r){if(typeof r!="object"||r===null||nt in r)return r;const e=Fn(r);if(e!==jn&&e!==zn)return r;var t=new Map,n=$r(r),a=B(0),s=S,i=o=>{var l=S;pe(s);var u=o();return pe(l),u};return n&&t.set("length",B(r.length)),new Proxy(r,{defineProperty(o,l,u){return(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Hn(),i(()=>{var d=t.get(l);d===void 0?(d=B(u.value),t.set(l,d)):I(d,u.value,!0)}),!0},deleteProperty(o,l){var u=t.get(l);if(u===void 0){if(l in o){const h=i(()=>B(L));t.set(l,h),bt(a)}}else{if(n&&typeof l=="string"){var d=t.get("length"),f=Number(l);Number.isInteger(f)&&f<d.v&&I(d,f)}I(u,L),bt(a)}return!0},get(o,l,u){var x;if(l===nt)return r;var d=t.get(l),f=l in o;if(d===void 0&&(!f||(x=Ue(o,l))!=null&&x.writable)&&(d=i(()=>{var E=Ve(f?o[l]:L),R=B(E);return R}),t.set(l,d)),d!==void 0){var h=O(d);return h===L?void 0:h}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var d=t.get(l);d&&(u.value=O(d))}else if(u===void 0){var f=t.get(l),h=f==null?void 0:f.v;if(f!==void 0&&h!==L)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(o,l){var h;if(l===nt)return!0;var u=t.get(l),d=u!==void 0&&u.v!==L||Reflect.has(o,l);if(u!==void 0||M!==null&&(!d||(h=Ue(o,l))!=null&&h.writable)){u===void 0&&(u=i(()=>{var x=d?Ve(o[l]):L,E=B(x);return E}),t.set(l,u));var f=O(u);if(f===L)return!1}return d},set(o,l,u,d){var V;var f=t.get(l),h=l in o;if(n&&l==="length")for(var x=u;x<f.v;x+=1){var E=t.get(x+"");E!==void 0?I(E,L):x in o&&(E=i(()=>B(L)),t.set(x+"",E))}if(f===void 0)(!h||(V=Ue(o,l))!=null&&V.writable)&&(f=i(()=>{var be=B(void 0);return I(be,Ve(u)),be}),t.set(l,f));else{h=f.v!==L;var R=i(()=>Ve(u));I(f,R)}var C=Reflect.getOwnPropertyDescriptor(o,l);if(C!=null&&C.set&&C.set.call(d,u),!h){if(n&&typeof l=="string"){var ie=t.get("length"),oe=Number(l);Number.isInteger(oe)&&oe>=ie.v&&I(ie,oe+1)}bt(a)}return!0},ownKeys(o){O(a);var l=Reflect.ownKeys(o).filter(f=>{var h=t.get(f);return h===void 0||h.v!==L});for(var[u,d]of t)d.v!==L&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Xn()}})}function bt(r,e=1){I(r,r.v+e)}function Kn(r){var e=X|ae,t=S!==null&&(S.f&X)!==0?S:null;return M===null||t!==null&&(t.f&z)!==0?e|=z:M.f|=qr,{ctx:q,deps:null,effects:null,equals:Wr,f:e,fn:r,reactions:null,rv:0,v:null,wv:0,parent:t??M}}function Hr(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)ke(e[t])}}function Qn(r){for(var e=r.parent;e!==null;){if((e.f&X)===0)return e;e=e.parent}return null}function Xr(r){var e,t=M;Oe(Qn(r));try{Hr(r),e=pn(r)}finally{Oe(t)}return e}function Jr(r){var e=Xr(r);if(r.equals(e)||(r.v=e,r.wv=fn()),!je){var t=(de||(r.f&z)!==0)&&r.deps!==null?we:Y;Q(r,t)}}const qe=new Map;function Mt(r,e){var t={f:0,v:r,reactions:null,equals:Wr,rv:0,wv:0};return t}function B(r,e){const t=Mt(r);return ga(t),t}function I(r,e,t=!1){S!==null&&!J&&Yr()&&(S.f&(X|Ut))!==0&&!(D!=null&&D.includes(r))&&Jn();let n=t?Ve(e):e;return ea(r,n)}function ea(r,e){if(!r.equals(e)){var t=r.v;je?qe.set(r,e):qe.set(r,t),r.v=e,(r.f&X)!==0&&((r.f&ae)!==0&&Xr(r),Q(r,(r.f&z)===0?Y:we)),r.wv=fn(),Gr(r,ae),M!==null&&(M.f&Y)!==0&&(M.f&(ge|Ze))===0&&(U===null?_a([r]):U.push(r))}return e}function Gr(r,e){var t=r.reactions;if(t!==null)for(var n=t.length,a=0;a<n;a++){var s=t[a],i=s.f;(i&ae)===0&&(Q(s,e),(i&(Y|z))!==0&&((i&X)!==0?Gr(s,we):Jt(s)))}}var mr,Kr,Qr,en;function ta(){if(mr===void 0){mr=window,Kr=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;Qr=Ue(e,"firstChild").get,en=Ue(e,"nextSibling").get,hr(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),hr(t)&&(t.__t=void 0)}}function ra(r=""){return document.createTextNode(r)}function tn(r){return Qr.call(r)}function rn(r){return en.call(r)}function Tt(r,e){return tn(r)}function na(r,e=1,t=!1){let n=r;for(;e--;)n=rn(n);return n}function aa(r){M===null&&S===null&&Wn(),S!==null&&(S.f&z)!==0&&M===null&&qn(),je&&Bn()}function sa(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Le(r,e,t,n=!0){var a=M,s={ctx:q,deps:null,nodes_start:null,nodes_end:null,f:r|ae,first:null,fn:e,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(t)try{Xt(s),s.f|=Br}catch(l){throw ke(s),l}else e!==null&&Jt(s);var i=t&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&(qr|Bt))===0;if(!i&&n&&(a!==null&&sa(s,a),S!==null&&(S.f&X)!==0)){var o=S;(o.effects??(o.effects=[])).push(s)}return s}function ia(r){const e=Le(yt,null,!1);return Q(e,Y),e.teardown=r,e}function te(r){aa();var e=M!==null&&(M.f&ge)!==0&&q!==null&&!q.m;if(e){var t=q;(t.e??(t.e=[])).push({fn:r,effect:M,reaction:S})}else{var n=Ht(r);return n}}function oa(r){const e=Le(Ze,r,!0);return(t={})=>new Promise(n=>{t.outro?fa(e,()=>{ke(e),n(void 0)}):(ke(e),n(void 0))})}function Ht(r){return Le(Ur,r,!1)}function nn(r){return Le(yt,r,!0)}function an(r,e=[],t=Kn){const n=e.map(t);return ua(()=>r(...n.map(O)))}function ua(r,e=0){return Le(yt|Ut|e,r,!0)}function la(r,e=!0){return Le(yt|ge,r,!0,e)}function sn(r){var e=r.teardown;if(e!==null){const t=je,n=S;vr(!0),pe(null);try{e.call(null)}finally{vr(t),pe(n)}}}function on(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){var n=t.next;(t.f&Ze)!==0?t.parent=null:ke(t,e),t=n}}function ca(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&ge)===0&&ke(e),e=t}}function ke(r,e=!0){var t=!1;(e||(r.f&Un)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(da(r.nodes_start,r.nodes_end),t=!0),on(r,e&&!t),dt(r,0),Q(r,qt);var n=r.transitions;if(n!==null)for(const s of n)s.stop();sn(r);var a=r.parent;a!==null&&a.first!==null&&un(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=null}function da(r,e){for(;r!==null;){var t=r===e?null:rn(r);r.remove(),r=t}}function un(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function fa(r,e){var t=[];ln(r,t,!0),ha(t,()=>{ke(r),e&&e()})}function ha(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var a of r)a.out(n)}else e()}function ln(r,e,t){if((r.f&ot)===0){if(r.f^=ot,r.transitions!==null)for(const i of r.transitions)(i.is_global||t)&&e.push(i);for(var n=r.first;n!==null;){var a=n.next,s=(n.f&$n)!==0||(n.f&ge)!==0;ln(n,e,s?t:!1),n=a}}}let ut=[];function pa(){var r=ut;ut=[],Vn(r)}function ma(r){ut.length===0&&queueMicrotask(pa),ut.push(r)}function va(r){var e=M;if((e.f&Br)===0){if((e.f&Bt)===0)throw r;e.fn(r)}else cn(r,e)}function cn(r,e){for(;e!==null;){if((e.f&Bt)!==0)try{e.fn(r);return}catch{}e=e.parent}throw r}let Ot=!1,lt=null,xe=!1,je=!1;function vr(r){je=r}let at=[];let S=null,J=!1;function pe(r){S=r}let M=null;function Oe(r){M=r}let D=null;function ga(r){S!==null&&S.f&St&&(D===null?D=[r]:D.push(r))}let P=null,j=0,U=null;function _a(r){U=r}let dn=1,ct=0,de=!1;function fn(){return++dn}function xt(r){var f;var e=r.f;if((e&ae)!==0)return!0;if((e&we)!==0){var t=r.deps,n=(e&z)!==0;if(t!==null){var a,s,i=(e&it)!==0,o=n&&M!==null&&!de,l=t.length;if(i||o){var u=r,d=u.parent;for(a=0;a<l;a++)s=t[a],(i||!((f=s==null?void 0:s.reactions)!=null&&f.includes(u)))&&(s.reactions??(s.reactions=[])).push(u);i&&(u.f^=it),o&&d!==null&&(d.f&z)===0&&(u.f^=z)}for(a=0;a<l;a++)if(s=t[a],xt(s)&&Jr(s),s.wv>r.wv)return!0}(!n||M!==null&&!de)&&Q(r,Y)}return!1}function hn(r,e,t=!0){var n=r.reactions;if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];D!=null&&D.includes(r)||((s.f&X)!==0?hn(s,e,!1):e===s&&(t?Q(s,ae):(s.f&Y)!==0&&Q(s,we),Jt(s)))}}function pn(r){var x;var e=P,t=j,n=U,a=S,s=de,i=D,o=q,l=J,u=r.f;P=null,j=0,U=null,de=(u&z)!==0&&(J||!xe||S===null),S=(u&(ge|Ze))===0?r:null,D=null,pr(r.ctx),J=!1,ct++,r.f|=St;try{var d=(0,r.fn)(),f=r.deps;if(P!==null){var h;if(dt(r,j),f!==null&&j>0)for(f.length=j+P.length,h=0;h<P.length;h++)f[j+h]=P[h];else r.deps=f=P;if(!de)for(h=j;h<f.length;h++)((x=f[h]).reactions??(x.reactions=[])).push(r)}else f!==null&&j<f.length&&(dt(r,j),f.length=j);if(Yr()&&U!==null&&!J&&f!==null&&(r.f&(X|we|ae))===0)for(h=0;h<U.length;h++)hn(U[h],r);return a!==null&&a!==r&&(ct++,U!==null&&(n===null?n=U:n.push(...U))),d}catch(E){va(E)}finally{P=e,j=t,U=n,S=a,de=s,D=i,pr(o),J=l,r.f^=St}}function ya(r,e){let t=e.reactions;if(t!==null){var n=Dn.call(t,r);if(n!==-1){var a=t.length-1;a===0?t=e.reactions=null:(t[n]=t[a],t.pop())}}t===null&&(e.f&X)!==0&&(P===null||!P.includes(e))&&(Q(e,we),(e.f&(z|it))===0&&(e.f^=it),Hr(e),dt(e,0))}function dt(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)ya(r,t[n])}function Xt(r){var e=r.f;if((e&qt)===0){Q(r,Y);var t=M,n=xe;M=r,xe=!0;try{(e&Ut)!==0?ca(r):on(r),sn(r);var a=pn(r);r.teardown=typeof a=="function"?a:null,r.wv=dn;var s;fr&&Gn&&(r.f&ae)!==0&&r.deps}finally{xe=n,M=t}}}function xa(){try{Yn()}catch(r){if(lt!==null)cn(r,lt);else throw r}}function ka(){var r=xe;try{var e=0;for(xe=!0;at.length>0;){e++>1e3&&xa();var t=at,n=t.length;at=[];for(var a=0;a<n;a++){var s=ba(t[a]);wa(s)}qe.clear()}}finally{Ot=!1,xe=r,lt=null}}function wa(r){var e=r.length;if(e!==0)for(var t=0;t<e;t++){var n=r[t];(n.f&(qt|ot))===0&&xt(n)&&(Xt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?un(n):n.fn=null))}}function Jt(r){Ot||(Ot=!0,queueMicrotask(ka));for(var e=lt=r;e.parent!==null;){e=e.parent;var t=e.f;if((t&(Ze|ge))!==0){if((t&Y)===0)return;e.f^=Y}}at.push(e)}function ba(r){for(var e=[],t=r;t!==null;){var n=t.f,a=(n&(ge|Ze))!==0,s=a&&(n&Y)!==0;if(!s&&(n&ot)===0){(n&Ur)!==0?e.push(t):a?t.f^=Y:xt(t)&&Xt(t);var i=t.first;if(i!==null){t=i;continue}}var o=t.parent;for(t=t.next;t===null&&o!==null;)t=o.next,o=o.parent}return e}function O(r){var e=r.f,t=(e&X)!==0;if(S!==null&&!J){if(!(D!=null&&D.includes(r))){var n=S.deps;r.rv<ct&&(r.rv=ct,P===null&&n!==null&&n[j]===r?j++:P===null?P=[r]:(!de||!P.includes(r))&&P.push(r))}}else if(t&&r.deps===null&&r.effects===null){var a=r,s=a.parent;s!==null&&(s.f&z)===0&&(a.f^=z)}return t&&(a=r,xt(a)&&Jr(a)),je&&qe.has(r)?qe.get(r):r.v}function Ca(r){var e=J;try{return J=!0,r()}finally{J=e}}const Ea=-7169;function Q(r,e){r.f=r.f&Ea|e}const Aa=["touchstart","touchmove"];function Sa(r){return Aa.includes(r)}const Ma=new Set,gr=new Set;function tt(r){var oe;var e=this,t=e.ownerDocument,n=r.type,a=((oe=r.composedPath)==null?void 0:oe.call(r))||[],s=a[0]||r.target,i=0,o=r.__root;if(o){var l=a.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var u=a.indexOf(e);if(u===-1)return;l<=u&&(i=l)}if(s=a[i]||r.target,s!==e){Ln(r,"currentTarget",{configurable:!0,get(){return s||t}});var d=S,f=M;pe(null),Oe(null);try{for(var h,x=[];s!==null;){var E=s.assignedSlot||s.parentNode||s.host||null;try{var R=s["__"+n];if(R!=null&&(!s.disabled||r.target===s))if($r(R)){var[C,...ie]=R;C.apply(s,[r,...ie])}else R.call(s,r)}catch(V){h?x.push(V):h=V}if(r.cancelBubble||E===e||E===null)break;s=E}if(h){for(let V of x)queueMicrotask(()=>{throw V});throw h}}finally{r.__root=e,delete r.currentTarget,pe(d),Oe(f)}}}function Ta(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function Oa(r,e){var t=M;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function mn(r,e){var t,n=!r.startsWith("<!>");return()=>{t===void 0&&(t=Ta(n?r:"<!>"+r),t=tn(t));var a=Kr?document.importNode(t,!0):t.cloneNode(!0);return Oa(a,a),a}}function vn(r,e){r!==null&&r.before(e)}function gn(r,e){return Na(r,e)}const Ee=new Map;function Na(r,{target:e,anchor:t,props:n={},events:a,context:s,intro:i=!0}){ta();var o=new Set,l=f=>{for(var h=0;h<f.length;h++){var x=f[h];if(!o.has(x)){o.add(x);var E=Sa(x);e.addEventListener(x,tt,{passive:E});var R=Ee.get(x);R===void 0?(document.addEventListener(x,tt,{passive:E}),Ee.set(x,1)):Ee.set(x,R+1)}}};l(Zn(Ma)),gr.add(l);var u=void 0,d=oa(()=>{var f=t??e.appendChild(ra());return la(()=>{if(s){Wt({});var h=q;h.c=s}a&&(n.$$events=a),u=r(f,n)||{},s&&Yt()}),()=>{var E;for(var h of o){e.removeEventListener(h,tt);var x=Ee.get(h);--x===0?(document.removeEventListener(h,tt),Ee.delete(h)):Ee.set(h,x)}gr.delete(l),f!==t&&((E=f.parentNode)==null||E.removeChild(f))}});return Ia.set(u,d),u}let Ia=new WeakMap;const _r=[...`
2
- \r\f \v\uFEFF`];function Ra(r,e,t){var n=r==null?"":""+r;if(t){for(var a in t)if(t[a])n=n?n+" "+a:a;else if(n.length)for(var s=a.length,i=0;(i=n.indexOf(a,i))>=0;){var o=i+s;(i===0||_r.includes(n[i-1]))&&(o===n.length||_r.includes(n[o]))?n=(i===0?"":n.substring(0,i))+n.substring(o+1):i=o}}return n===""?null:n}function yr(r,e=!1){var t=e?" !important;":";",n="";for(var a in r){var s=r[a];s!=null&&s!==""&&(n+=" "+a+": "+s+t)}return n}function Pa(r,e){if(e){var t="",n,a;return Array.isArray(e)?(n=e[0],a=e[1]):n=e,n&&(t+=yr(n)),a&&(t+=yr(a,!0)),t=t.trim(),t===""?null:t}return String(r)}function _n(r,e,t,n,a,s){var i=r.__className;if(i!==t||i===void 0){var o=Ra(t,n,s);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}else if(s&&a!==s)for(var l in s){var u=!!s[l];(a==null||u!==!!a[l])&&r.classList.toggle(l,u)}return s}function Ct(r,e={},t,n){for(var a in t){var s=t[a];e[a]!==s&&(t[a]==null?r.style.removeProperty(a):r.style.setProperty(a,s,n))}}function xr(r,e,t,n){var a=r.__style;if(a!==e){var s=Pa(e,n);s==null?r.removeAttribute("style"):r.style.cssText=s,r.__style=e}else n&&(Array.isArray(n)?(Ct(r,t==null?void 0:t[0],n[0]),Ct(r,t==null?void 0:t[1],n[1],"important")):Ct(r,t,n));return n}const Da=()=>performance.now(),G={tick:r=>requestAnimationFrame(r),now:()=>Da(),tasks:new Set};function yn(){const r=G.now();G.tasks.forEach(e=>{e.c(r)||(G.tasks.delete(e),e.f())}),G.tasks.size!==0&&G.tick(yn)}function Za(r){let e;return G.tasks.size===0&&G.tick(yn),{promise:new Promise(t=>{G.tasks.add(e={c:r,f:t})}),abort(){G.tasks.delete(e)}}}function kr(r,e){return r===e||(r==null?void 0:r[nt])===e}function Se(r={},e,t,n){return Ht(()=>{var a,s;return nn(()=>{a=s,s=[],Ca(()=>{r!==t(...s)&&(e(r,...s),a&&kr(t(...a),r)&&e(null,...a))})}),()=>{ma(()=>{s&&kr(t(...s),r)&&e(null,...s)})}}),r}const La="5";var Vr;typeof window<"u"&&((Vr=window.__svelte??(window.__svelte={})).v??(Vr.v=new Set)).add(La);function ja(r){return r}function Nt(r){return-.5*(Math.cos(Math.PI*r)-1)}function za(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Fa(r){return Math.sin(r*Math.PI/2)}const Va=128,$a=0,Et=1,Ua=2;class Ba{constructor(){g(this,"animationsStarted",!1);g(this,"animationsCount",0);g(this,"animationsLimit",Va);g(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 n=t.animations;if(n!=null)for(let a=0;a<n.length;a++){const s=n[a];if(s!=null){for(const i of s.values())if(!i.executed&&(i.executed=!0,i.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,n,a){let s=this.layers[e];s==null&&(s=this.layers[e]={animations:new Array});let i=s.animations[t];i==null&&(i=s.animations[t]=new Map);let o={id:n,priority:t,executed:!1,function:a};i.set(n,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let n=0;n<this.layers.length;n++){let a=this.layers[n];if(a==null)continue;let s=a.animations[e];if(s==null)return;let i=s.get(t);if(i==null||i.executed==!1)return;s.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ce=new Ba;function wr(r){return Object.prototype.toString.call(r)==="[object Date]"}function It(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 n=e.map((a,s)=>It(r[s],a));return a=>n.map(s=>s(a))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(wr(r)&&wr(e)){const s=r.getTime(),o=e.getTime()-s;return l=>new Date(s+l*o)}const n=Object.keys(e),a={};return n.forEach(s=>{a[s]=It(r[s],e[s])}),s=>{const i={};return n.forEach(o=>{i[o]=a[o](s)}),i}}if(t==="number"){const n=e-r;return a=>r+a*n}return()=>e}var re,Te,Je,ye;const tr=class tr{constructor(e,t={}){ze(this,re);ze(this,Te);ze(this,Je);ze(this,ye,null);Fe(this,re,Mt(e)),Fe(this,Te,Mt(e)),Fe(this,Je,t)}static of(e,t){const n=new tr(e(),t);return nn(()=>{n.set(e())}),n}set(e,t){var f;I($(this,Te),e);let{delay:n=0,duration:a=400,easing:s=ja,interpolate:i=It}={...$(this,Je),...t};if(a===0)return(f=$(this,ye))==null||f.abort(),I($(this,re),e),Promise.resolve();const o=G.now()+n;let l,u=!1,d=$(this,ye);return Fe(this,ye,Za(h=>{if(h<o)return!0;if(!u){u=!0;const E=$(this,re).v;l=i(E,e),typeof a=="function"&&(a=a(E,e)),d==null||d.abort()}const x=h-o;return x>a?(I($(this,re),e),!1):(I($(this,re),l(s(x/a))),!0)})),$(this,ye).promise}get current(){return O($(this,re))}get target(){return O($(this,Te))}set target(e){this.set(e)}};re=new WeakMap,Te=new WeakMap,Je=new WeakMap,ye=new WeakMap;let Rt=tr;class st{constructor(e,t){g(this,"value");g(this,"motion");this.value=e,this.motion=new Rt(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 ft;(r=>{function e(t,n,a){const s=t/2,i=n/2,o=Math.sqrt(s*s+i*i),l=Math.atan(i/s)*(180/Math.PI),u=a*(Math.PI/180);return a<180?a<90?a<l?{offsetX:0,offsetY:o*Math.sin(u)-i}:{offsetX:o*Math.cos(u)-s,offsetY:0}:a<180-l?{offsetX:o*Math.cos(u)-s,offsetY:0}:{offsetX:-t,offsetY:o*Math.sin(u)-i}:a<270?a<180+l?{offsetX:-t,offsetY:o*Math.sin(u)-i}:{offsetX:o*Math.cos(u)-s,offsetY:-n}:a<360-l?{offsetX:o*Math.cos(u)-s,offsetY:-n}:{offsetX:0,offsetY:o*Math.sin(u)-i}}r.getOffsets=e})(ft||(ft={}));var qa=mn('<div><div class="pin svelte-11owlij"></div> <div class="marker svelte-11owlij"><div class="body svelte-11owlij"></div></div></div>');function Wa(r,e){Wt(e,!0);let t,n,a,s;const i=e.width+2*e.padding,o=e.height+2*e.padding,l=()=>s;te(()=>{a.style.width=`${Math.min(i,o)/4}px`,a.style.height=`${Math.min(i,o)/4}px`});let u=B(!0);function d(A){I(u,A,!0)}function f(){return O(u)}let h=B(!0);function x(A){I(h,A,!0)}function E(){return C.motion.current==0}function R(){return O(h)==!1}let C=new st(0),ie=Et;te(()=>{oe(C.motion.current)}),te(()=>{O(u)==!1&&(C.snap(),ce.clear(e.priority,e.id+"_scale"))}),te(()=>{O(h)==!0&&C.value!=0&&(ie=$a,ce.stacked()?C.set(0,{duration:0}):C.set(0,{duration:150,easing:za})),O(h)==!1&&C.value!=1&&(ie=Et,C.set(1,{duration:150,easing:Fa}))});function oe(A){!t||!n||!a||ce.equeue(ie,e.priority,e.id+"_scale",()=>{t.style.opacity=`${A}`,n.style.scale=`${A}`,a.style.scale=`${A}`})}let V=NaN,be=B(!1),ue=new st(-i/2,{easing:Nt}),Ge=new st(-o/2,{easing:Nt});te(()=>{rr(ue.motion.current,Ge.motion.current)}),te(()=>{O(u)==!1&&(ue.snap(),ue.snap(),ce.clear(e.priority,e.id+"_angle"))}),te(()=>{O(h)==!0&&O(be)&&(ue.update({duration:75}),ue.update({duration:75}))});function rr(A,ee){if(!t||!n||!a)return;const Ce=A+i/2,_e=ee+o/2,Qe=o<i?Ce*o/i:Ce,Sn=o>i?_e*i/o:_e,Mn=Math.atan2(Sn,Qe)/Math.PI*180-45,ur=0,Tn=30,wt=Math.sqrt(Ce*Ce+_e*_e),et=Math.min(i,o)/2,On=Math.sqrt(i*i+o*o)/2,Nn=(wt-et)/(On-et),lr=ur+Nn*(Tn-ur),In=wt<et?wt/et:1;ce.equeue(Et,e.priority,e.id+"_angle",()=>{n.style.transform=`translate(${Math.round(A)}px, ${Math.round(ee)}px)`,a.style.transform=`scale(${In}) rotate(${Mn}deg) skew(${lr}deg, ${lr}deg)`})}function An(A){if(O(be)==!1){let ee=ft.getOffsets(i,o,A);ue.set(Math.round(ee.offsetX),{duration:0}),Ge.set(Math.round(ee.offsetY),{duration:0}),rr(ue.value,Ge.value),V=A,I(be,!0)}else if(A!=V){let ee=Math.abs(A-V),Ce=ee<180?ee:360-ee,_e=Math.log(Ce)*75,Qe=ft.getOffsets(i,o,A);ue.set(Math.round(Qe.offsetX),{duration:_e}),Ge.set(Math.round(Qe.offsetY),{duration:_e}),V=A}}var Ke=qa();let nr;var ar=Tt(Ke);Se(ar,A=>a=A,()=>a);var kt=na(ar,2);let sr;var ir=Tt(kt);let or;return Se(ir,A=>s=A,()=>s),Se(kt,A=>n=A,()=>n),Se(Ke,A=>t=A,()=>t),an(A=>{nr=_n(Ke,1,"anchor svelte-11owlij",null,nr,A),sr=xr(kt,"",sr,{padding:e.padding+"px"}),or=xr(ir,"",or,{width:`${e.width}px`,height:`${e.height}px`})},[()=>({displayed:O(u)})]),vn(r,Ke),Yt({getBody:l,setDisplayed:d,getDisplayed:f,setCollapsed:x,getCollapsed:E,getExpanded:R,setAngle:An})}var Ya=mn('<div><div class="body svelte-piqgmq"></div></div>');function Ha(r,e){Wt(e,!0);let t,n;function a(){return n}let s=B(!1);function i(C){I(s,C,!0)}function o(){return O(s)}let l=new st(0,{easing:Nt});te(()=>{u(l.motion.current)}),te(()=>{O(s)==!1&&(l.snap(),ce.clear(e.priority,e.id))});function u(C){t&&ce.equeue(Ua,e.priority,e.id,()=>{t.style.scale=C.toString(),t.style.filter=`brightness(${.25+.75*C})`,n.style.opacity=C.toString()})}function d(C){C!=l.value&&l.set(C,{duration:75})}function f(){return l.motion.current==0}function h(){return l.value}var x=Ya();let E;var R=Tt(x);return Se(R,C=>n=C,()=>n),Se(x,C=>t=C,()=>t),an(C=>E=_n(x,1,"circle svelte-piqgmq",null,E,C),[()=>({displayed:O(s)})]),vn(r,x),Yt({getBody:a,setDisplayed:i,getDisplayed:o,setScale:d,getCollapsed:f,getScale:h})}async function rt(r,e){try{await fetch("https://arenarium.dev/api/public/v1/log?log="+encodeURIComponent(JSON.stringify({title:r,content:e})))}catch(t){console.error(t)}}var b;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const s={};for(const i of a)s[i]=i;return s},r.getValidEnumValues=a=>{const s=r.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of s)i[o]=a[o];return r.objectValues(i)},r.objectValues=a=>r.objectKeys(a).map(function(s){return a[s]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},r.find=(a,s)=>{for(const i of a)if(s(i))return i},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}r.joinValues=n,r.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(b||(b={}));var br;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(br||(br={}));const m=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),le=r=>{switch(typeof r){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(r)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(r)?m.array:r===null?m.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?m.promise:typeof Map<"u"&&r instanceof Map?m.map:typeof Set<"u"&&r instanceof Set?m.set:typeof Date<"u"&&r instanceof Date?m.date:m.object;default:return m.unknown}},c=b.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 W extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};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(s){return s.message},n={_errors:[]},a=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return a(this),n}static assert(e){if(!(e instanceof W))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}W.create=r=>new W(r);const We=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===m.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,b.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${b.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.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}"`:b.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.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==="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 c.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 c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,b.assertNever(r)}return{message:t}};let Xa=We;function Pt(){return Xa}const Dt=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,s=[...t,...a.path||[]],i={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)o=u(i,{data:e,defaultError:o}).message;return{...a,path:s,message:o}};function p(r,e){const t=Pt(),n=Dt({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===We?void 0:We].filter(a=>!!a)});r.common.issues.push(n)}class F{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return _;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const s=await a.key,i=await a.value;n.push({key:s,value:i})}return F.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return _;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}}const _=Object.freeze({status:"aborted"}),$e=r=>({status:"dirty",value:r}),Z=r=>({status:"valid",value:r}),Cr=r=>r.status==="aborted",Er=r=>r.status==="dirty",Ne=r=>r.status==="valid",ht=r=>typeof Promise<"u"&&r instanceof Promise;var v;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(v||(v={}));class me{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ar=(r,e)=>{if(Ne(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 W(r.common.issues);return this._error=t,this._error}}};function k(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:l}=r;return i.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:a}}class w{get description(){return this._def.description}_getType(e){return le(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new F,ctx:{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ht(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={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:le(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Ar(n,a)}"~validate"(e){var n,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return Ne(s)?{value:s.value}:{issues:t.common.issues}}catch(s){(a=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>Ne(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={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:le(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(ht(a)?a:Promise.resolve(a));return Ar(n,s)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const i=e(a),o=()=>s.addIssue({code:c.custom,...n(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new Pe({schema:this,typeName:y.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 he.create(this,this._def)}nullable(){return De.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this)}promise(){return Xe.create(this,this._def)}or(e){return mt.create([this,e],this._def)}and(e){return vt.create(this,e,this._def)}transform(e){return new Pe({...k(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ft({...k(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new _s({typeName:y.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Vt({...k(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Gt.create(this,e)}readonly(){return $t.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ja=/^c[^\s-]{8,}$/i,Ga=/^[0-9a-z]+$/,Ka=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qa=/^[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,es=/^[a-z0-9_-]{21}$/i,ts=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rs=/^[-+]?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)?)??$/,ns=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,as="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let At;const ss=/^(?:(?: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])$/,is=/^(?:(?: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])$/,os=/^(([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]))$/,us=/^(([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])$/,ls=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xn="((\\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])))",ds=new RegExp(`^${xn}$`);function kn(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 fs(r){return new RegExp(`^${kn(r)}$`)}function hs(r){let e=`${xn}T${kn(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 ps(r,e){return!!((e==="v4"||!e)&&ss.test(r)||(e==="v6"||!e)&&os.test(r))}function ms(r,e){if(!ts.test(r))return!1;try{const[t]=r.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function vs(r,e){return!!((e==="v4"||!e)&&is.test(r)||(e==="v6"||!e)&&us.test(r))}class fe extends w{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:m.string,received:s.parsedType}),_}const n=new F;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:c.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:c.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?p(a,{code:c.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&p(a,{code:c.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")ns.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"email",code:c.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")At||(At=new RegExp(as,"u")),At.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"emoji",code:c.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Qa.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"uuid",code:c.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")es.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"nanoid",code:c.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Ja.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid",code:c.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Ga.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid2",code:c.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Ka.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ulid",code:c.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),p(a,{validation:"url",code:c.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"regex",code:c.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),p(a,{code:c.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:c.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:c.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?hs(s).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:c.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ds.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:c.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?fs(s).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:c.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?rs.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"duration",code:c.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?ps(e.data,s.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ip",code:c.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?ms(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"jwt",code:c.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?vs(e.data,s.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cidr",code:c.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?ls.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64",code:c.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?cs.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64url",code:c.invalid_string,message:s.message}),n.dirty()):b.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:c.invalid_string,...v.errToObj(n)})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...v.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...v.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...v.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new fe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fe({...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}}fe.create=r=>new fe({checks:[],typeName:y.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...k(r)});function gs(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,s=Number.parseInt(r.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return s%i/10**a}class Ie extends w{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)!==m.number){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:m.number,received:s.parsedType}),_}let n;const a=new F;for(const s of this._def.checks)s.kind==="int"?b.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{code:c.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:c.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:c.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?gs(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),p(n,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{code:c.not_finite,message:s.message}),a.dirty()):b.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,n,a){return new Ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:v.toString(a)}]})}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Ie.create=r=>new Ie({checks:[],typeName:y.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class Ye extends w{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)!==m.bigint)return this._getInvalidInput(e);let n;const a=new F;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:c.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:c.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),p(n,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):b.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return p(t,{code:c.invalid_type,expected:m.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,n,a){return new Ye({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:v.toString(a)}]})}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ye.create=r=>new Ye({checks:[],typeName:y.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...k(r)});class Zt extends w{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:m.boolean,received:n.parsedType}),_}return Z(e.data)}}Zt.create=r=>new Zt({typeName:y.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class pt extends w{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:m.date,received:s.parsedType}),_}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_date}),_}const n=new F;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:c.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:c.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):b.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}pt.create=r=>new pt({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:y.ZodDate,...k(r)});class Sr extends w{_parse(e){if(this._getType(e)!==m.symbol){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:m.symbol,received:n.parsedType}),_}return Z(e.data)}}Sr.create=r=>new Sr({typeName:y.ZodSymbol,...k(r)});class Mr extends w{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:m.undefined,received:n.parsedType}),_}return Z(e.data)}}Mr.create=r=>new Mr({typeName:y.ZodUndefined,...k(r)});class Tr extends w{_parse(e){if(this._getType(e)!==m.null){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:m.null,received:n.parsedType}),_}return Z(e.data)}}Tr.create=r=>new Tr({typeName:y.ZodNull,...k(r)});class Lt extends w{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}Lt.create=r=>new Lt({typeName:y.ZodAny,...k(r)});class Me extends w{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}Me.create=r=>new Me({typeName:y.ZodUnknown,...k(r)});class ve extends w{_parse(e){const t=this._getOrReturnCtx(e);return p(t,{code:c.invalid_type,expected:m.never,received:t.parsedType}),_}}ve.create=r=>new ve({typeName:y.ZodNever,...k(r)});class jt extends w{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:m.void,received:n.parsedType}),_}return Z(e.data)}}jt.create=r=>new jt({typeName:y.ZodVoid,...k(r)});class K extends w{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==m.array)return p(t,{code:c.invalid_type,expected:m.array,received:t.parsedType}),_;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(i||o)&&(p(t,{code:i?c.too_big:c.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(p(t,{code:c.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(p(t,{code:c.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new me(t,i,t.path,o)))).then(i=>F.mergeArray(n,i));const s=[...t.data].map((i,o)=>a.type._parseSync(new me(t,i,t.path,o)));return F.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new K({...this._def,minLength:{value:e,message:v.toString(t)}})}max(e,t){return new K({...this._def,maxLength:{value:e,message:v.toString(t)}})}length(e,t){return new K({...this._def,exactLength:{value:e,message:v.toString(t)}})}nonempty(e){return this.min(1,e)}}K.create=(r,e)=>new K({type:r,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...k(e)});function Ae(r){if(r instanceof N){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=he.create(Ae(n))}return new N({...r._def,shape:()=>e})}else return r instanceof K?new K({...r._def,type:Ae(r.element)}):r instanceof he?he.create(Ae(r.unwrap())):r instanceof De?De.create(Ae(r.unwrap())):r instanceof se?se.create(r.items.map(e=>Ae(e))):r}class N extends w{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=b.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==m.object){const u=this._getOrReturnCtx(e);return p(u,{code:c.invalid_type,expected:m.object,received:u.parsedType}),_}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ve&&this._def.unknownKeys==="strip"))for(const u in a.data)i.includes(u)||o.push(u);const l=[];for(const u of i){const d=s[u],f=a.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new me(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof ve){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(u==="strict")o.length>0&&(p(a,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const f=a.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new me(a,f,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>F.mergeObjectSync(n,u)):F.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new N({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,i;const a=((i=(s=this._def).errorMap)==null?void 0:i.call(s,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:v.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new N({...this._def,unknownKeys:"strip"})}passthrough(){return new N({...this._def,unknownKeys:"passthrough"})}extend(e){return new N({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new N({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new N({...this._def,catchall:e})}pick(e){const t={};for(const n of b.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new N({...this._def,shape:()=>t})}omit(e){const t={};for(const n of b.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new N({...this._def,shape:()=>t})}deepPartial(){return Ae(this)}partial(e){const t={};for(const n of b.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new N({...this._def,shape:()=>t})}required(e){const t={};for(const n of b.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof he;)s=s._def.innerType;t[n]=s}return new N({...this._def,shape:()=>t})}keyof(){return wn(b.objectKeys(this.shape))}}N.create=(r,e)=>new N({shape:()=>r,unknownKeys:"strip",catchall:ve.create(),typeName:y.ZodObject,...k(e)});N.strictCreate=(r,e)=>new N({shape:()=>r,unknownKeys:"strict",catchall:ve.create(),typeName:y.ZodObject,...k(e)});N.lazycreate=(r,e)=>new N({shape:r,unknownKeys:"strip",catchall:ve.create(),typeName:y.ZodObject,...k(e)});class mt extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new W(o.ctx.common.issues));return p(t,{code:c.invalid_union,unionErrors:i}),_}if(t.common.async)return Promise.all(n.map(async s=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let s;const i=[];for(const l of n){const u={...t,common:{...t.common,issues:[]},parent:null},d=l._parseSync({data:t.data,path:t.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(l=>new W(l));return p(t,{code:c.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}mt.create=(r,e)=>new mt({options:r,typeName:y.ZodUnion,...k(e)});function zt(r,e){const t=le(r),n=le(e);if(r===e)return{valid:!0,data:r};if(t===m.object&&n===m.object){const a=b.objectKeys(e),s=b.objectKeys(r).filter(o=>a.indexOf(o)!==-1),i={...r,...e};for(const o of s){const l=zt(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===m.array&&n===m.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<r.length;s++){const i=r[s],o=e[s],l=zt(i,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return t===m.date&&n===m.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class vt extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(s,i)=>{if(Cr(s)||Cr(i))return _;const o=zt(s.value,i.value);return o.valid?((Er(s)||Er(i))&&t.dirty(),{status:t.value,value:o.data}):(p(n,{code:c.invalid_intersection_types}),_)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}vt.create=(r,e,t)=>new vt({left:r,right:e,typeName:y.ZodIntersection,...k(t)});class se extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.array)return p(n,{code:c.invalid_type,expected:m.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return p(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(p(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new me(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>F.mergeArray(t,i)):F.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new se({...this._def,rest:e})}}se.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new se({items:r,typeName:y.ZodTuple,rest:null,...k(e)})};class Or extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.map)return p(n,{code:c.invalid_type,expected:m.map,received:n.parsedType}),_;const a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,l],u)=>({key:a._parse(new me(n,o,n.path,[u,"key"])),value:s._parse(new me(n,l,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return _;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return _;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}}}}Or.create=(r,e,t)=>new Or({valueType:e,keyType:r,typeName:y.ZodMap,...k(t)});class He extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.set)return p(n,{code:c.invalid_type,expected:m.set,received:n.parsedType}),_;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(p(n,{code:c.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(p(n,{code:c.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function i(l){const u=new Set;for(const d of l){if(d.status==="aborted")return _;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((l,u)=>s._parse(new me(n,l,n.path,u)));return n.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new He({...this._def,minSize:{value:e,message:v.toString(t)}})}max(e,t){return new He({...this._def,maxSize:{value:e,message:v.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}He.create=(r,e)=>new He({valueType:r,minSize:null,maxSize:null,typeName:y.ZodSet,...k(e)});class Be extends w{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.function)return p(t,{code:c.invalid_type,expected:m.function,received:t.parsedType}),_;function n(o,l){return Dt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Pt(),We].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:l}})}function a(o,l){return Dt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Pt(),We].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:l}})}const s={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Xe){const o=this;return Z(async function(...l){const u=new W([]),d=await o._def.args.parseAsync(l,s).catch(x=>{throw u.addIssue(n(l,x)),u}),f=await Reflect.apply(i,this,d);return await o._def.returns._def.type.parseAsync(f,s).catch(x=>{throw u.addIssue(a(f,x)),u})})}else{const o=this;return Z(function(...l){const u=o._def.args.safeParse(l,s);if(!u.success)throw new W([n(l,u.error)]);const d=Reflect.apply(i,this,u.data),f=o._def.returns.safeParse(d,s);if(!f.success)throw new W([a(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Be({...this._def,args:se.create(e).rest(Me.create())})}returns(e){return new Be({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Be({args:e||se.create([]).rest(Me.create()),returns:t||Me.create(),typeName:y.ZodFunction,...k(n)})}}class Nr extends w{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})}}Nr.create=(r,e)=>new Nr({getter:r,typeName:y.ZodLazy,...k(e)});class Ir extends w{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return p(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ir.create=(r,e)=>new Ir({value:r,typeName:y.ZodLiteral,...k(e)});function wn(r,e){return new Re({values:r,typeName:y.ZodEnum,...k(e)})}class Re extends w{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return p(t,{expected:b.joinValues(n),received:t.parsedType,code:c.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return p(t,{received:t.data,code:c.invalid_enum_value,options:n}),_}return Z(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 Re.create(e,{...this._def,...t})}exclude(e,t=this._def){return Re.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Re.create=wn;class Rr extends w{_parse(e){const t=b.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==m.string&&n.parsedType!==m.number){const a=b.objectValues(t);return p(n,{expected:b.joinValues(a),received:n.parsedType,code:c.invalid_type}),_}if(this._cache||(this._cache=new Set(b.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=b.objectValues(t);return p(n,{received:n.data,code:c.invalid_enum_value,options:a}),_}return Z(e.data)}get enum(){return this._def.values}}Rr.create=(r,e)=>new Rr({values:r,typeName:y.ZodNativeEnum,...k(e)});class Xe extends w{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.promise&&t.common.async===!1)return p(t,{code:c.invalid_type,expected:m.promise,received:t.parsedType}),_;const n=t.parsedType===m.promise?t.data:Promise.resolve(t.data);return Z(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Xe.create=(r,e)=>new Xe({type:r,typeName:y.ZodPromise,...k(e)});class Pe extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:i=>{p(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?$e(l.value):l});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?$e(o.value):o}}if(a.type==="refinement"){const i=o=>{const l=a.refinement(o,s);if(n.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(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ne(i))return _;const o=a.transform(i.value,s);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:n.data,path:n.path,parent:n}).then(i=>Ne(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:t.value,value:o})):_);b.assertNever(a)}}Pe.create=(r,e,t)=>new Pe({schema:r,typeName:y.ZodEffects,effect:e,...k(t)});Pe.createWithPreprocess=(r,e,t)=>new Pe({schema:e,effect:{type:"preprocess",transform:r},typeName:y.ZodEffects,...k(t)});class he extends w{_parse(e){return this._getType(e)===m.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}he.create=(r,e)=>new he({innerType:r,typeName:y.ZodOptional,...k(e)});class De extends w{_parse(e){return this._getType(e)===m.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}De.create=(r,e)=>new De({innerType:r,typeName:y.ZodNullable,...k(e)});class Ft extends w{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ft.create=(r,e)=>new Ft({innerType:r,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class Vt extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ht(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new W(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new W(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Vt.create=(r,e)=>new Vt({innerType:r,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class Pr extends w{_parse(e){if(this._getType(e)!==m.nan){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:m.nan,received:n.parsedType}),_}return{status:"valid",value:e.data}}}Pr.create=r=>new Pr({typeName:y.ZodNaN,...k(r)});class _s extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Gt extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?_:s.status==="dirty"?(t.dirty(),$e(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?_:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new Gt({in:e,out:t,typeName:y.ZodPipeline})}}class $t extends w{_parse(e){const t=this._def.innerType._parse(e),n=a=>(Ne(a)&&(a.value=Object.freeze(a.value)),a);return ht(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}$t.create=(r,e)=>new $t({innerType:r,typeName:y.ZodReadonly,...k(e)});var y;(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"})(y||(y={}));const Kt=fe.create,T=Ie.create,bn=Zt.create,Qt=Lt.create;Me.create;ve.create;const Dr=jt.create,er=K.create,H=N.create;mt.create;vt.create;const Zr=se.create,ne=Be.create;Re.create;const ys=Xe.create;he.create;De.create;H({pin:H({fade:bn().optional(),maxCount:T().optional(),maxZoom:T().optional()}).optional(),animation:H({queue:H({limit:T().optional()}).optional()}).optional()});const xs=T().min(-90).max(90),ks=T().min(-180).max(180),Lr=Qt().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),ws=H({mapSize:T(),zoomMin:T(),zoomMax:T(),zoomScale:T()}),bs=H({instance:Qt(),inserted:ne().args().returns(bn()),insert:ne().args().returns(Dr()),remove:ne().args().returns(Dr())}),Cs=H({parameters:ws,getContainer:ne().args().returns(Lr),getZoom:ne().args().returns(T()),getWidth:ne().args().returns(T()),getHeight:ne().args().returns(T()),createMarker:ne().args(xs,ks,Lr).returns(bs)}),Cn=H({id:Kt().min(1),rank:T(),lat:T().min(-90).max(90),lng:T().min(-180).max(180),width:T(),height:T(),padding:T()}).refine(r=>Math.min(r.width,r.height)/r.padding>=4,"Popup width and height must be at least 4 times the padding"),Es=Zr([T(),er(Zr([T(),T()]))]),jr=ne().args(Kt()).returns(ys(Qt())),As=H({data:Cn,state:Es,callbacks:H({body:jr,pin:jr.optional()})}),Ss=er(As);H({key:Kt(),data:er(Cn)});var gt;(r=>{function e(o,l,u){return{x:n(l)*u,y:a(o)*u}}r.project=e;function t(o,l,u){return{lat:i(l/u),lng:s(o/u)}}r.unproject=t;function n(o){return(180+o)/360}function a(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function s(o){return o*360-180}function i(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})(gt||(gt={}));var _t;(r=>{r.COUNT=12,r.DEFAULT=270,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330]})(_t||(_t={}));const Ms=1e6,Ts=2,Os=128;class Ns{constructor(e,t){g(this,"provider");g(this,"popupDataArray",new Array);g(this,"popupDataMap",new Map);g(this,"popupDataUpdating",!1);g(this,"popupMaxWidth",0);g(this,"popupMaxHeight",0);g(this,"configurationPinFade",!1);g(this,"configurationPinMaxCount",0);g(this,"configurationPinMaxZoomDelta",0);Cs.parse(e),this.provider=e,this.configuration=t}set configuration(e){var t,n,a,s,i;this.configurationPinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.configurationPinMaxCount=((n=e==null?void 0:e.pin)==null?void 0:n.maxCount)??Math.max(Os,8*navigator.hardwareConcurrency),this.configurationPinMaxZoomDelta=((a=e==null?void 0:e.pin)==null?void 0:a.maxZoom)??Ts,ce.setLimit(((i=(s=e==null?void 0:e.animation)==null?void 0:s.queue)==null?void 0:i.limit)??8*navigator.hardwareConcurrency)}setColors(e,t,n){const a=this.provider.getContainer();a.style.setProperty("--map-style-primary",e),a.style.setProperty("--map-style-background",t),a.style.setProperty("--map-style-text",n)}async updatePopups(e){try{await Ss.parseAsync(e),await this.updatePopupData(e),this.popupMaxWidth=this.popupDataArray.reduce((t,n)=>Math.max(t,n.marker.width),0),this.popupMaxHeight=this.popupDataArray.reduce((t,n)=>Math.max(t,n.marker.height),0),this.processPopupDataCallback()}catch(t){throw console.error(t),rt("[Error] Failed to update popups",{message:t.message,stack:t.stack}),t}}removePopups(){try{this.removePopupData()}catch(e){throw console.error(e),rt("[Error] Failed to remove popups",{message:e.message,stack:e.stack}),e}}togglePopups(e){try{this.togglePopupData(e)}catch(t){throw console.error(t),rt("[Error] Failed to toggle popups",{message:t.message,stack:t.stack}),t}}processPopupDataCallback(){if(this.popupDataArray.length!=0)try{this.processPopupData(),window.setTimeout(this.processPopupDataCallback.bind(this),25)}catch(e){console.error(e),rt("[Error] Failed to process popups",{message:e.message,stack:e.stack})}}processPopupData(){if(this.popupDataUpdating)return;const e=this.provider.getZoom();if(!e)return;const t=this.provider.getWidth(),n=this.provider.getHeight(),a=this.popupMaxWidth*2,s=this.popupMaxHeight*2,i=new Fr(-a,n+s,t+a,-s,this.provider.parameters),o=new Fr(0,n,t,0,this.provider.parameters);let l=0;for(const u of this.popupDataArray){const d=u.supressed?-1:e,f=u.circle;o.contains(f.lat,f.lng)?d<=f.zoom&&f.zoom<=e+this.configurationPinMaxZoomDelta?(l<this.configurationPinMaxCount&&(this.configurationPinFade==!0?f.updateState(e):f.setExpanded(),f.updateMap(!0),f.isPinLoaded()==!1&&f.updatePin()),l++):(f.setCollapsed(),f.isCollapsed()&&f.updateMap(!1)):f.updateMap(!1);const h=u.marker;i.contains(h.lat,h.lng)?h.zoom<=d?(h.updateState(e),h.setCollapsed(!1),h.updateMap(!0),h.isExpanded()&&h.isBodyLoaded()==!1&&h.updateBody()):(h.setCollapsed(!0),h.isCollapsed()&&h.updateMap(!1)):h.updateMap(!1)}}async updatePopupData(e){try{this.popupDataUpdating=!0;const t=new Map(e.map(a=>[a.data.id,new zr(this.provider,a)])),n=Array.from(this.popupDataArray);for(const a of n)t.has(a.id)==!1&&(a.remove(),this.popupDataMap.delete(a.id),this.popupDataArray.splice(this.popupDataArray.indexOf(a),1));for(const a of e){const s=this.popupDataMap.get(a.data.id);if(s)s.update(a);else{const i=new zr(this.provider,a);i.create(),this.popupDataMap.set(a.data.id,i),this.popupDataArray.push(i)}}this.popupDataArray.sort((a,s)=>a.zoom-s.zoom)}catch(t){throw console.error(t),this.popupDataArray.length=0,this.popupDataMap.clear(),t}finally{this.popupDataUpdating=!1}}removePopupData(){try{this.popupDataUpdating=!0,this.popupDataArray.forEach(e=>e.remove()),this.popupDataArray.length=0,this.popupDataMap.clear()}catch(e){throw console.error(e),this.popupDataArray.forEach(t=>t.remove()),this.popupDataArray.length=0,this.popupDataMap.clear(),e}finally{this.popupDataUpdating=!1}}togglePopupData(e){e.forEach(t=>{const n=this.popupDataMap.get(t.id);n&&(n.supressed=!t.toggled)})}}class En{constructor(e,t){g(this,"provider");g(this,"id");g(this,"lat");g(this,"lng");g(this,"zoom");g(this,"element");g(this,"component");g(this,"marker");this.provider=e,this.id=t.data.id,this.lat=t.data.lat,this.lng=t.data.lng,this.zoom=t.state[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 marker");this.marker=this.provider.createMarker(this.lat,this.lng,e)}update(e){this.zoom=e.state[0],this.updateZIndex()}updateZIndex(){throw new Error("Update z-index not implemented")}updateMap(e){const t=this.marker,n=this.component;if(t==null||n==null)throw new Error("Failed to update popup map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){return Math.round((this.provider.parameters.zoomMax-this.zoom)*this.provider.parameters.zoomScale)}isInBlock(e,t){return this.zoom<=e&&t.contains(this.lat,this.lng)}remove(){var e,t;(e=this.marker)==null||e.remove(),(t=this.element)==null||t.remove()}}class Is extends En{constructor(t,n){super(t,n);g(this,"pinLoading",!1);g(this,"pinLoaded",!1);g(this,"pinCallback");this.pinCallback=n.callbacks.pin}createElement(){this.element=document.createElement("div"),this.element.classList.add("circle"),this.component=gn(Ha,{target:this.element,props:{id:this.id+"_circle",priority:this.zoom*this.provider.parameters.zoomScale}})}updateZIndex(){const t=this.element;t&&(t.style.zIndex=this.getZindex().toString())}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){const n=this.component;if(!n)throw new Error("Failed to update circle state");n.setScale(this.getScale(t))}updatePin(){var n;if(this.pinCallback==null||this.pinLoaded||this.pinLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.pinLoading=!0,this.pinCallback(this.id).then(a=>{t.appendChild(a),this.pinLoaded=!0,this.pinLoading=!1}))}setExpanded(){if(this.component==null)throw new Error("Failed to set circle expanded");this.component.setScale(1)}setCollapsed(){if(this.component==null)throw new Error("Failed to set circle collapsed");this.component.setScale(0)}getScale(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isPinLoaded(){return this.pinCallback==null||this.pinLoaded}}class Rs extends En{constructor(t,n){super(t,n);g(this,"width");g(this,"height");g(this,"padding");g(this,"states");g(this,"bodyLoading",!1);g(this,"bodyLoaded",!1);g(this,"bodyCallback");this.id=n.data.id,this.width=n.data.width,this.height=n.data.height,this.padding=n.data.padding,this.states=n.state[1].map(a=>[a[0],_t.DEGREES[a[1]]]),this.bodyCallback=n.callbacks.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("marker"),this.component=gn(Wa,{target:this.element,props:{id:this.id+"_marker",priority:this.zoom*this.provider.parameters.zoomScale,width:this.width,height:this.height,padding:this.padding}})}update(t){super.update(t),this.states=t.state[1].map(n=>[n[0],_t.DEGREES[n[1]]])}updateZIndex(){const t=this.element;if(!t)return;const n=this.getZindex()+Ms;t.style.zIndex=n.toString()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){const n=this.component;if(!n)throw new Error("Failed to update marker state");n.setAngle(this.getAngle(t))}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{t.appendChild(a),this.bodyLoading=!1,this.bodyLoaded=!0}))}getAngle(t){const n=this.states.findLast(a=>a[0]<=t);if(!n)throw new Error("Angle not found");return n[1]}setCollapsed(t){if(this.component==null)throw new Error("Failed to set marker collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component?this.component.getExpanded():!1}isCollapsed(){return this.component?this.component.getCollapsed():!1}isBodyLoaded(){return this.bodyLoaded}}class zr{constructor(e,t){g(this,"id");g(this,"rank");g(this,"lat");g(this,"lng");g(this,"zoom");g(this,"supressed");g(this,"circle");g(this,"marker");this.id=t.data.id,this.rank=t.data.rank,this.lat=t.data.lat,this.lng=t.data.lng,this.zoom=t.state[0],this.supressed=!1,this.circle=new Is(e,t),this.marker=new Rs(e,t)}create(){this.circle.create(),this.marker.create()}update(e){this.circle.update(e),this.marker.update(e)}remove(){this.circle.remove(),this.marker.remove()}}class Fr{constructor(e,t,n,a,s){g(this,"swLat");g(this,"swLng");g(this,"neLat");g(this,"neLng");g(this,"contains",(e,t)=>this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1);const i=gt.unproject(e,t,s.mapSize),o=gt.unproject(n,a,s.mapSize);this.swLat=i.lat,this.swLng=i.lng,this.neLat=o.lat,this.neLng=o.lng}}exports.MapManager=Ns;
1
+ "use strict";var Zn=Object.defineProperty;var dr=r=>{throw TypeError(r)};var Dn=(r,e,t)=>e in r?Zn(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var g=(r,e,t)=>Dn(r,typeof e!="symbol"?e+"":e,t),cr=(r,e,t)=>e.has(r)||dr("Cannot "+t);var $=(r,e,t)=>(cr(r,e,"read from private field"),t?t.call(r):e.get(r)),ze=(r,e,t)=>e.has(r)?dr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Fe=(r,e,t,n)=>(cr(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fr=!1;var Ur=Array.isArray,Ln=Array.prototype.indexOf,jn=Array.from,zn=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,Fn=Object.prototype,Vn=Array.prototype,$n=Object.getPrototypeOf,hr=Object.isExtensible;function Un(r){for(var e=0;e<r.length;e++)r[e]()}const X=2,Br=4,yt=8,Bt=16,ge=32,De=64,qt=128,z=256,it=512,Y=1024,ae=2048,we=4096,ot=8192,Wt=16384,qr=32768,Bn=65536,qn=1<<19,Wr=1<<20,Mt=1<<21,nt=Symbol("$state");function Yr(r){return r===this.v}function Wn(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Yn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Hn(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Xn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Jn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Gn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Kn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Qn=!1;const L=Symbol();let q=null;function pr(r){q=r}function Yt(r,e=!1,t){var n=q={p:q,c:null,d:!1,e:null,m:!1,s:r,x:null,l:null};ua(()=>{n.d=!0})}function Ht(r){const e=q;if(e!==null){r!==void 0&&(e.x=r);const i=e.e;if(i!==null){var t=M,n=S;e.e=null;try{for(var a=0;a<i.length;a++){var s=i[a];Oe(s.effect),pe(s.reaction),Xt(s.fn)}}finally{Oe(t),pe(n)}}q=e.p,e.m=!0}return r||{}}function Hr(){return!0}function Ve(r){if(typeof r!="object"||r===null||nt in r)return r;const e=$n(r);if(e!==Fn&&e!==Vn)return r;var t=new Map,n=Ur(r),a=B(0),s=S,i=o=>{var l=S;pe(s);var u=o();return pe(l),u};return n&&t.set("length",B(r.length)),new Proxy(r,{defineProperty(o,l,u){return(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Jn(),i(()=>{var c=t.get(l);c===void 0?(c=B(u.value),t.set(l,c)):I(c,u.value,!0)}),!0},deleteProperty(o,l){var u=t.get(l);if(u===void 0){if(l in o){const h=i(()=>B(L));t.set(l,h),Ct(a)}}else{if(n&&typeof l=="string"){var c=t.get("length"),f=Number(l);Number.isInteger(f)&&f<c.v&&I(c,f)}I(u,L),Ct(a)}return!0},get(o,l,u){var x;if(l===nt)return r;var c=t.get(l),f=l in o;if(c===void 0&&(!f||(x=Ue(o,l))!=null&&x.writable)&&(c=i(()=>{var E=Ve(f?o[l]:L),R=B(E);return R}),t.set(l,c)),c!==void 0){var h=O(c);return h===L?void 0:h}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var c=t.get(l);c&&(u.value=O(c))}else if(u===void 0){var f=t.get(l),h=f==null?void 0:f.v;if(f!==void 0&&h!==L)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(o,l){var h;if(l===nt)return!0;var u=t.get(l),c=u!==void 0&&u.v!==L||Reflect.has(o,l);if(u!==void 0||M!==null&&(!c||(h=Ue(o,l))!=null&&h.writable)){u===void 0&&(u=i(()=>{var x=c?Ve(o[l]):L,E=B(x);return E}),t.set(l,u));var f=O(u);if(f===L)return!1}return c},set(o,l,u,c){var V;var f=t.get(l),h=l in o;if(n&&l==="length")for(var x=u;x<f.v;x+=1){var E=t.get(x+"");E!==void 0?I(E,L):x in o&&(E=i(()=>B(L)),t.set(x+"",E))}if(f===void 0)(!h||(V=Ue(o,l))!=null&&V.writable)&&(f=i(()=>{var be=B(void 0);return I(be,Ve(u)),be}),t.set(l,f));else{h=f.v!==L;var R=i(()=>Ve(u));I(f,R)}var C=Reflect.getOwnPropertyDescriptor(o,l);if(C!=null&&C.set&&C.set.call(c,u),!h){if(n&&typeof l=="string"){var ie=t.get("length"),oe=Number(l);Number.isInteger(oe)&&oe>=ie.v&&I(ie,oe+1)}Ct(a)}return!0},ownKeys(o){O(a);var l=Reflect.ownKeys(o).filter(f=>{var h=t.get(f);return h===void 0||h.v!==L});for(var[u,c]of t)c.v!==L&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Gn()}})}function Ct(r,e=1){I(r,r.v+e)}function ea(r){var e=X|ae,t=S!==null&&(S.f&X)!==0?S:null;return M===null||t!==null&&(t.f&z)!==0?e|=z:M.f|=Wr,{ctx:q,deps:null,effects:null,equals:Yr,f:e,fn:r,reactions:null,rv:0,v:null,wv:0,parent:t??M}}function Xr(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)ke(e[t])}}function ta(r){for(var e=r.parent;e!==null;){if((e.f&X)===0)return e;e=e.parent}return null}function Jr(r){var e,t=M;Oe(ta(r));try{Xr(r),e=mn(r)}finally{Oe(t)}return e}function Gr(r){var e=Jr(r);if(r.equals(e)||(r.v=e,r.wv=hn()),!je){var t=(ce||(r.f&z)!==0)&&r.deps!==null?we:Y;Q(r,t)}}const qe=new Map;function Tt(r,e){var t={f:0,v:r,reactions:null,equals:Yr,rv:0,wv:0};return t}function B(r,e){const t=Tt(r);return ya(t),t}function I(r,e,t=!1){S!==null&&!J&&Hr()&&(S.f&(X|Bt))!==0&&!(Z!=null&&Z.includes(r))&&Kn();let n=t?Ve(e):e;return ra(r,n)}function ra(r,e){if(!r.equals(e)){var t=r.v;je?qe.set(r,e):qe.set(r,t),r.v=e,(r.f&X)!==0&&((r.f&ae)!==0&&Jr(r),Q(r,(r.f&z)===0?Y:we)),r.wv=hn(),Kr(r,ae),M!==null&&(M.f&Y)!==0&&(M.f&(ge|De))===0&&(U===null?xa([r]):U.push(r))}return e}function Kr(r,e){var t=r.reactions;if(t!==null)for(var n=t.length,a=0;a<n;a++){var s=t[a],i=s.f;(i&ae)===0&&(Q(s,e),(i&(Y|z))!==0&&((i&X)!==0?Kr(s,we):Gt(s)))}}var mr,Qr,en,tn;function na(){if(mr===void 0){mr=window,Qr=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;en=Ue(e,"firstChild").get,tn=Ue(e,"nextSibling").get,hr(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),hr(t)&&(t.__t=void 0)}}function aa(r=""){return document.createTextNode(r)}function rn(r){return en.call(r)}function nn(r){return tn.call(r)}function Ot(r,e){return rn(r)}function sa(r,e=1,t=!1){let n=r;for(;e--;)n=nn(n);return n}function ia(r){M===null&&S===null&&Hn(),S!==null&&(S.f&z)!==0&&M===null&&Yn(),je&&Wn()}function oa(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Le(r,e,t,n=!0){var a=M,s={ctx:q,deps:null,nodes_start:null,nodes_end:null,f:r|ae,first:null,fn:e,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(t)try{Jt(s),s.f|=qr}catch(l){throw ke(s),l}else e!==null&&Gt(s);var i=t&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&(Wr|qt))===0;if(!i&&n&&(a!==null&&oa(s,a),S!==null&&(S.f&X)!==0)){var o=S;(o.effects??(o.effects=[])).push(s)}return s}function ua(r){const e=Le(yt,null,!1);return Q(e,Y),e.teardown=r,e}function te(r){ia();var e=M!==null&&(M.f&ge)!==0&&q!==null&&!q.m;if(e){var t=q;(t.e??(t.e=[])).push({fn:r,effect:M,reaction:S})}else{var n=Xt(r);return n}}function la(r){const e=Le(De,r,!0);return(t={})=>new Promise(n=>{t.outro?pa(e,()=>{ke(e),n(void 0)}):(ke(e),n(void 0))})}function Xt(r){return Le(Br,r,!1)}function an(r){return Le(yt,r,!0)}function sn(r,e=[],t=ea){const n=e.map(t);return da(()=>r(...n.map(O)))}function da(r,e=0){return Le(yt|Bt|e,r,!0)}function ca(r,e=!0){return Le(yt|ge,r,!0,e)}function on(r){var e=r.teardown;if(e!==null){const t=je,n=S;vr(!0),pe(null);try{e.call(null)}finally{vr(t),pe(n)}}}function un(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){var n=t.next;(t.f&De)!==0?t.parent=null:ke(t,e),t=n}}function fa(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&ge)===0&&ke(e),e=t}}function ke(r,e=!0){var t=!1;(e||(r.f&qn)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(ha(r.nodes_start,r.nodes_end),t=!0),un(r,e&&!t),ct(r,0),Q(r,Wt);var n=r.transitions;if(n!==null)for(const s of n)s.stop();on(r);var a=r.parent;a!==null&&a.first!==null&&ln(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=null}function ha(r,e){for(;r!==null;){var t=r===e?null:nn(r);r.remove(),r=t}}function ln(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function pa(r,e){var t=[];dn(r,t,!0),ma(t,()=>{ke(r),e&&e()})}function ma(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var a of r)a.out(n)}else e()}function dn(r,e,t){if((r.f&ot)===0){if(r.f^=ot,r.transitions!==null)for(const i of r.transitions)(i.is_global||t)&&e.push(i);for(var n=r.first;n!==null;){var a=n.next,s=(n.f&Bn)!==0||(n.f&ge)!==0;dn(n,e,s?t:!1),n=a}}}let ut=[];function va(){var r=ut;ut=[],Un(r)}function ga(r){ut.length===0&&queueMicrotask(va),ut.push(r)}function _a(r){var e=M;if((e.f&qr)===0){if((e.f&qt)===0)throw r;e.fn(r)}else cn(r,e)}function cn(r,e){for(;e!==null;){if((e.f&qt)!==0)try{e.fn(r);return}catch{}e=e.parent}throw r}let Nt=!1,lt=null,xe=!1,je=!1;function vr(r){je=r}let at=[];let S=null,J=!1;function pe(r){S=r}let M=null;function Oe(r){M=r}let Z=null;function ya(r){S!==null&&S.f&Mt&&(Z===null?Z=[r]:Z.push(r))}let P=null,j=0,U=null;function xa(r){U=r}let fn=1,dt=0,ce=!1;function hn(){return++fn}function xt(r){var f;var e=r.f;if((e&ae)!==0)return!0;if((e&we)!==0){var t=r.deps,n=(e&z)!==0;if(t!==null){var a,s,i=(e&it)!==0,o=n&&M!==null&&!ce,l=t.length;if(i||o){var u=r,c=u.parent;for(a=0;a<l;a++)s=t[a],(i||!((f=s==null?void 0:s.reactions)!=null&&f.includes(u)))&&(s.reactions??(s.reactions=[])).push(u);i&&(u.f^=it),o&&c!==null&&(c.f&z)===0&&(u.f^=z)}for(a=0;a<l;a++)if(s=t[a],xt(s)&&Gr(s),s.wv>r.wv)return!0}(!n||M!==null&&!ce)&&Q(r,Y)}return!1}function pn(r,e,t=!0){var n=r.reactions;if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];Z!=null&&Z.includes(r)||((s.f&X)!==0?pn(s,e,!1):e===s&&(t?Q(s,ae):(s.f&Y)!==0&&Q(s,we),Gt(s)))}}function mn(r){var x;var e=P,t=j,n=U,a=S,s=ce,i=Z,o=q,l=J,u=r.f;P=null,j=0,U=null,ce=(u&z)!==0&&(J||!xe||S===null),S=(u&(ge|De))===0?r:null,Z=null,pr(r.ctx),J=!1,dt++,r.f|=Mt;try{var c=(0,r.fn)(),f=r.deps;if(P!==null){var h;if(ct(r,j),f!==null&&j>0)for(f.length=j+P.length,h=0;h<P.length;h++)f[j+h]=P[h];else r.deps=f=P;if(!ce)for(h=j;h<f.length;h++)((x=f[h]).reactions??(x.reactions=[])).push(r)}else f!==null&&j<f.length&&(ct(r,j),f.length=j);if(Hr()&&U!==null&&!J&&f!==null&&(r.f&(X|we|ae))===0)for(h=0;h<U.length;h++)pn(U[h],r);return a!==null&&a!==r&&(dt++,U!==null&&(n===null?n=U:n.push(...U))),c}catch(E){_a(E)}finally{P=e,j=t,U=n,S=a,ce=s,Z=i,pr(o),J=l,r.f^=Mt}}function ka(r,e){let t=e.reactions;if(t!==null){var n=Ln.call(t,r);if(n!==-1){var a=t.length-1;a===0?t=e.reactions=null:(t[n]=t[a],t.pop())}}t===null&&(e.f&X)!==0&&(P===null||!P.includes(e))&&(Q(e,we),(e.f&(z|it))===0&&(e.f^=it),Xr(e),ct(e,0))}function ct(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)ka(r,t[n])}function Jt(r){var e=r.f;if((e&Wt)===0){Q(r,Y);var t=M,n=xe;M=r,xe=!0;try{(e&Bt)!==0?fa(r):un(r),on(r);var a=mn(r);r.teardown=typeof a=="function"?a:null,r.wv=fn;var s;fr&&Qn&&(r.f&ae)!==0&&r.deps}finally{xe=n,M=t}}}function wa(){try{Xn()}catch(r){if(lt!==null)cn(r,lt);else throw r}}function ba(){var r=xe;try{var e=0;for(xe=!0;at.length>0;){e++>1e3&&wa();var t=at,n=t.length;at=[];for(var a=0;a<n;a++){var s=Ea(t[a]);Ca(s)}qe.clear()}}finally{Nt=!1,xe=r,lt=null}}function Ca(r){var e=r.length;if(e!==0)for(var t=0;t<e;t++){var n=r[t];(n.f&(Wt|ot))===0&&xt(n)&&(Jt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?ln(n):n.fn=null))}}function Gt(r){Nt||(Nt=!0,queueMicrotask(ba));for(var e=lt=r;e.parent!==null;){e=e.parent;var t=e.f;if((t&(De|ge))!==0){if((t&Y)===0)return;e.f^=Y}}at.push(e)}function Ea(r){for(var e=[],t=r;t!==null;){var n=t.f,a=(n&(ge|De))!==0,s=a&&(n&Y)!==0;if(!s&&(n&ot)===0){(n&Br)!==0?e.push(t):a?t.f^=Y:xt(t)&&Jt(t);var i=t.first;if(i!==null){t=i;continue}}var o=t.parent;for(t=t.next;t===null&&o!==null;)t=o.next,o=o.parent}return e}function O(r){var e=r.f,t=(e&X)!==0;if(S!==null&&!J){if(!(Z!=null&&Z.includes(r))){var n=S.deps;r.rv<dt&&(r.rv=dt,P===null&&n!==null&&n[j]===r?j++:P===null?P=[r]:(!ce||!P.includes(r))&&P.push(r))}}else if(t&&r.deps===null&&r.effects===null){var a=r,s=a.parent;s!==null&&(s.f&z)===0&&(a.f^=z)}return t&&(a=r,xt(a)&&Gr(a)),je&&qe.has(r)?qe.get(r):r.v}function Aa(r){var e=J;try{return J=!0,r()}finally{J=e}}const Sa=-7169;function Q(r,e){r.f=r.f&Sa|e}const Ma=["touchstart","touchmove"];function Ta(r){return Ma.includes(r)}const Oa=new Set,gr=new Set;function tt(r){var oe;var e=this,t=e.ownerDocument,n=r.type,a=((oe=r.composedPath)==null?void 0:oe.call(r))||[],s=a[0]||r.target,i=0,o=r.__root;if(o){var l=a.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var u=a.indexOf(e);if(u===-1)return;l<=u&&(i=l)}if(s=a[i]||r.target,s!==e){zn(r,"currentTarget",{configurable:!0,get(){return s||t}});var c=S,f=M;pe(null),Oe(null);try{for(var h,x=[];s!==null;){var E=s.assignedSlot||s.parentNode||s.host||null;try{var R=s["__"+n];if(R!=null&&(!s.disabled||r.target===s))if(Ur(R)){var[C,...ie]=R;C.apply(s,[r,...ie])}else R.call(s,r)}catch(V){h?x.push(V):h=V}if(r.cancelBubble||E===e||E===null)break;s=E}if(h){for(let V of x)queueMicrotask(()=>{throw V});throw h}}finally{r.__root=e,delete r.currentTarget,pe(c),Oe(f)}}}function Na(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function Ia(r,e){var t=M;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function vn(r,e){var t,n=!r.startsWith("<!>");return()=>{t===void 0&&(t=Na(n?r:"<!>"+r),t=rn(t));var a=Qr?document.importNode(t,!0):t.cloneNode(!0);return Ia(a,a),a}}function gn(r,e){r!==null&&r.before(e)}function _n(r,e){return Ra(r,e)}const Ee=new Map;function Ra(r,{target:e,anchor:t,props:n={},events:a,context:s,intro:i=!0}){na();var o=new Set,l=f=>{for(var h=0;h<f.length;h++){var x=f[h];if(!o.has(x)){o.add(x);var E=Ta(x);e.addEventListener(x,tt,{passive:E});var R=Ee.get(x);R===void 0?(document.addEventListener(x,tt,{passive:E}),Ee.set(x,1)):Ee.set(x,R+1)}}};l(jn(Oa)),gr.add(l);var u=void 0,c=la(()=>{var f=t??e.appendChild(aa());return ca(()=>{if(s){Yt({});var h=q;h.c=s}a&&(n.$$events=a),u=r(f,n)||{},s&&Ht()}),()=>{var E;for(var h of o){e.removeEventListener(h,tt);var x=Ee.get(h);--x===0?(document.removeEventListener(h,tt),Ee.delete(h)):Ee.set(h,x)}gr.delete(l),f!==t&&((E=f.parentNode)==null||E.removeChild(f))}});return Pa.set(u,c),u}let Pa=new WeakMap;const _r=[...`
2
+ \r\f \v\uFEFF`];function Za(r,e,t){var n=r==null?"":""+r;if(t){for(var a in t)if(t[a])n=n?n+" "+a:a;else if(n.length)for(var s=a.length,i=0;(i=n.indexOf(a,i))>=0;){var o=i+s;(i===0||_r.includes(n[i-1]))&&(o===n.length||_r.includes(n[o]))?n=(i===0?"":n.substring(0,i))+n.substring(o+1):i=o}}return n===""?null:n}function yr(r,e=!1){var t=e?" !important;":";",n="";for(var a in r){var s=r[a];s!=null&&s!==""&&(n+=" "+a+": "+s+t)}return n}function Da(r,e){if(e){var t="",n,a;return Array.isArray(e)?(n=e[0],a=e[1]):n=e,n&&(t+=yr(n)),a&&(t+=yr(a,!0)),t=t.trim(),t===""?null:t}return String(r)}function yn(r,e,t,n,a,s){var i=r.__className;if(i!==t||i===void 0){var o=Za(t,n,s);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}else if(s&&a!==s)for(var l in s){var u=!!s[l];(a==null||u!==!!a[l])&&r.classList.toggle(l,u)}return s}function Et(r,e={},t,n){for(var a in t){var s=t[a];e[a]!==s&&(t[a]==null?r.style.removeProperty(a):r.style.setProperty(a,s,n))}}function xr(r,e,t,n){var a=r.__style;if(a!==e){var s=Da(e,n);s==null?r.removeAttribute("style"):r.style.cssText=s,r.__style=e}else n&&(Array.isArray(n)?(Et(r,t==null?void 0:t[0],n[0]),Et(r,t==null?void 0:t[1],n[1],"important")):Et(r,t,n));return n}const La=()=>performance.now(),G={tick:r=>requestAnimationFrame(r),now:()=>La(),tasks:new Set};function xn(){const r=G.now();G.tasks.forEach(e=>{e.c(r)||(G.tasks.delete(e),e.f())}),G.tasks.size!==0&&G.tick(xn)}function ja(r){let e;return G.tasks.size===0&&G.tick(xn),{promise:new Promise(t=>{G.tasks.add(e={c:r,f:t})}),abort(){G.tasks.delete(e)}}}function kr(r,e){return r===e||(r==null?void 0:r[nt])===e}function Se(r={},e,t,n){return Xt(()=>{var a,s;return an(()=>{a=s,s=[],Aa(()=>{r!==t(...s)&&(e(r,...s),a&&kr(t(...a),r)&&e(null,...a))})}),()=>{ga(()=>{s&&kr(t(...s),r)&&e(null,...s)})}}),r}const za="5";var $r;typeof window<"u"&&(($r=window.__svelte??(window.__svelte={})).v??($r.v=new Set)).add(za);function Fa(r){return r}function It(r){return-.5*(Math.cos(Math.PI*r)-1)}function Va(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function $a(r){return Math.sin(r*Math.PI/2)}const Ua=128,Ba=0,At=1,qa=2;class Wa{constructor(){g(this,"animationsStarted",!1);g(this,"animationsCount",0);g(this,"animationsLimit",Ua);g(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 n=t.animations;if(n!=null)for(let a=0;a<n.length;a++){const s=n[a];if(s!=null){for(const i of s.values())if(!i.executed&&(i.executed=!0,i.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,n,a){let s=this.layers[e];s==null&&(s=this.layers[e]={animations:new Array});let i=s.animations[t];i==null&&(i=s.animations[t]=new Map);let o={id:n,priority:t,executed:!1,function:a};i.set(n,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let n=0;n<this.layers.length;n++){let a=this.layers[n];if(a==null)continue;let s=a.animations[e];if(s==null)return;let i=s.get(t);if(i==null||i.executed==!1)return;s.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const de=new Wa;function wr(r){return Object.prototype.toString.call(r)==="[object Date]"}function Rt(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 n=e.map((a,s)=>Rt(r[s],a));return a=>n.map(s=>s(a))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(wr(r)&&wr(e)){const s=r.getTime(),o=e.getTime()-s;return l=>new Date(s+l*o)}const n=Object.keys(e),a={};return n.forEach(s=>{a[s]=Rt(r[s],e[s])}),s=>{const i={};return n.forEach(o=>{i[o]=a[o](s)}),i}}if(t==="number"){const n=e-r;return a=>r+a*n}return()=>e}var re,Te,Je,ye;const tr=class tr{constructor(e,t={}){ze(this,re);ze(this,Te);ze(this,Je);ze(this,ye,null);Fe(this,re,Tt(e)),Fe(this,Te,Tt(e)),Fe(this,Je,t)}static of(e,t){const n=new tr(e(),t);return an(()=>{n.set(e())}),n}set(e,t){var f;I($(this,Te),e);let{delay:n=0,duration:a=400,easing:s=Fa,interpolate:i=Rt}={...$(this,Je),...t};if(a===0)return(f=$(this,ye))==null||f.abort(),I($(this,re),e),Promise.resolve();const o=G.now()+n;let l,u=!1,c=$(this,ye);return Fe(this,ye,ja(h=>{if(h<o)return!0;if(!u){u=!0;const E=$(this,re).v;l=i(E,e),typeof a=="function"&&(a=a(E,e)),c==null||c.abort()}const x=h-o;return x>a?(I($(this,re),e),!1):(I($(this,re),l(s(x/a))),!0)})),$(this,ye).promise}get current(){return O($(this,re))}get target(){return O($(this,Te))}set target(e){this.set(e)}};re=new WeakMap,Te=new WeakMap,Je=new WeakMap,ye=new WeakMap;let Pt=tr;class st{constructor(e,t){g(this,"value");g(this,"motion");this.value=e,this.motion=new Pt(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 ft;(r=>{function e(t,n,a){const s=t/2,i=n/2,o=Math.sqrt(s*s+i*i),l=Math.atan(i/s)*(180/Math.PI),u=a*(Math.PI/180);return a<180?a<90?a<l?{offsetX:0,offsetY:o*Math.sin(u)-i}:{offsetX:o*Math.cos(u)-s,offsetY:0}:a<180-l?{offsetX:o*Math.cos(u)-s,offsetY:0}:{offsetX:-t,offsetY:o*Math.sin(u)-i}:a<270?a<180+l?{offsetX:-t,offsetY:o*Math.sin(u)-i}:{offsetX:o*Math.cos(u)-s,offsetY:-n}:a<360-l?{offsetX:o*Math.cos(u)-s,offsetY:-n}:{offsetX:0,offsetY:o*Math.sin(u)-i}}r.getOffsets=e})(ft||(ft={}));var Ya=vn('<div><div class="pin svelte-1d2w496"></div> <div class="marker svelte-1d2w496"><div class="body svelte-1d2w496"></div></div></div>');function Ha(r,e){Yt(e,!0);let t,n,a,s;const i=e.width+2*e.padding,o=e.height+2*e.padding,l=()=>s;te(()=>{a.style.width=`${Math.min(i,o)/4}px`,a.style.height=`${Math.min(i,o)/4}px`});let u=B(!0);function c(A){I(u,A,!0)}function f(){return O(u)}let h=B(!0);function x(A){I(h,A,!0)}function E(){return C.motion.current==0}function R(){return O(h)==!1}let C=new st(0),ie=At;te(()=>{oe(C.motion.current)}),te(()=>{O(u)==!1&&(C.snap(),de.clear(e.priority,e.id+"_scale"))}),te(()=>{O(h)==!0&&C.value!=0&&(ie=Ba,de.stacked()?C.set(0,{duration:0}):C.set(0,{duration:150,easing:Va})),O(h)==!1&&C.value!=1&&(ie=At,C.set(1,{duration:150,easing:$a}))});function oe(A){!t||!n||!a||de.equeue(ie,e.priority,e.id+"_scale",()=>{t.style.opacity=`${A}`,n.style.scale=`${A}`,a.style.scale=`${A}`})}let V=NaN,be=B(!1),ue=new st(-i/2,{easing:It}),Ge=new st(-o/2,{easing:It});te(()=>{rr(ue.motion.current,Ge.motion.current)}),te(()=>{O(u)==!1&&(ue.snap(),ue.snap(),de.clear(e.priority,e.id+"_angle"))}),te(()=>{O(h)==!0&&O(be)&&(ue.update({duration:75}),ue.update({duration:75}))});function rr(A,ee){if(!t||!n||!a)return;const Ce=A+i/2,_e=ee+o/2,Qe=o<i?Ce*o/i:Ce,Tn=o>i?_e*i/o:_e,On=Math.atan2(Tn,Qe)/Math.PI*180-45,ur=0,Nn=30,bt=Math.sqrt(Ce*Ce+_e*_e),et=Math.min(i,o)/2,In=Math.sqrt(i*i+o*o)/2,Rn=(bt-et)/(In-et),lr=ur+Rn*(Nn-ur),Pn=bt<et?bt/et:1;de.equeue(At,e.priority,e.id+"_angle",()=>{n.style.transform=`translate(${Math.round(A)}px, ${Math.round(ee)}px)`,a.style.transform=`scale(${Pn}) rotate(${On}deg) skew(${lr}deg, ${lr}deg)`})}function Mn(A){if(O(be)==!1){let ee=ft.getOffsets(i,o,A);ue.set(Math.round(ee.offsetX),{duration:0}),Ge.set(Math.round(ee.offsetY),{duration:0}),rr(ue.value,Ge.value),V=A,I(be,!0)}else if(A!=V){let ee=Math.abs(A-V),Ce=ee<180?ee:360-ee,_e=Math.log(Ce)*75,Qe=ft.getOffsets(i,o,A);ue.set(Math.round(Qe.offsetX),{duration:_e}),Ge.set(Math.round(Qe.offsetY),{duration:_e}),V=A}}var Ke=Ya();let nr;var ar=Ot(Ke);Se(ar,A=>a=A,()=>a);var wt=sa(ar,2);let sr;var ir=Ot(wt);let or;return Se(ir,A=>s=A,()=>s),Se(wt,A=>n=A,()=>n),Se(Ke,A=>t=A,()=>t),sn(A=>{nr=yn(Ke,1,"anchor svelte-1d2w496",null,nr,A),sr=xr(wt,"",sr,{padding:e.padding+"px"}),or=xr(ir,"",or,{width:`${e.width}px`,height:`${e.height}px`})},[()=>({displayed:O(u)})]),gn(r,Ke),Ht({getBody:l,setDisplayed:c,getDisplayed:f,setCollapsed:x,getCollapsed:E,getExpanded:R,setAngle:Mn})}var Xa=vn('<div><div class="body svelte-piqgmq"></div></div>');function Ja(r,e){Yt(e,!0);let t,n;function a(){return n}let s=B(!1);function i(C){I(s,C,!0)}function o(){return O(s)}let l=new st(0,{easing:It});te(()=>{u(l.motion.current)}),te(()=>{O(s)==!1&&(l.snap(),de.clear(e.priority,e.id))});function u(C){t&&de.equeue(qa,e.priority,e.id,()=>{t.style.scale=C.toString(),t.style.filter=`brightness(${.25+.75*C})`,n.style.opacity=C.toString()})}function c(C){C!=l.value&&l.set(C,{duration:75})}function f(){return l.motion.current==0}function h(){return l.value}var x=Xa();let E;var R=Ot(x);return Se(R,C=>n=C,()=>n),Se(x,C=>t=C,()=>t),sn(C=>E=yn(x,1,"circle svelte-piqgmq",null,E,C),[()=>({displayed:O(s)})]),gn(r,x),Ht({getBody:a,setDisplayed:i,getDisplayed:o,setScale:c,getCollapsed:f,getScale:h})}async function rt(r,e){try{await fetch("https://arenarium.dev/api/public/v1/log?log="+encodeURIComponent(JSON.stringify({title:r,content:e})))}catch(t){console.error(t)}}var b;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const s={};for(const i of a)s[i]=i;return s},r.getValidEnumValues=a=>{const s=r.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of s)i[o]=a[o];return r.objectValues(i)},r.objectValues=a=>r.objectKeys(a).map(function(s){return a[s]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},r.find=(a,s)=>{for(const i of a)if(s(i))return i},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}r.joinValues=n,r.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(b||(b={}));var br;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(br||(br={}));const m=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),le=r=>{switch(typeof r){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(r)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(r)?m.array:r===null?m.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?m.promise:typeof Map<"u"&&r instanceof Map?m.map:typeof Set<"u"&&r instanceof Set?m.set:typeof Date<"u"&&r instanceof Date?m.date:m.object;default:return m.unknown}},d=b.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 W extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};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(s){return s.message},n={_errors:[]},a=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return a(this),n}static assert(e){if(!(e instanceof W))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}W.create=r=>new W(r);const We=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===m.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,b.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(r.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(r.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${b.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}"`:b.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==="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,b.assertNever(r)}return{message:t}};let Ga=We;function Zt(){return Ga}const Dt=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,s=[...t,...a.path||[]],i={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)o=u(i,{data:e,defaultError:o}).message;return{...a,path:s,message:o}};function p(r,e){const t=Zt(),n=Dt({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===We?void 0:We].filter(a=>!!a)});r.common.issues.push(n)}class F{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return _;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const s=await a.key,i=await a.value;n.push({key:s,value:i})}return F.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return _;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}}const _=Object.freeze({status:"aborted"}),$e=r=>({status:"dirty",value:r}),D=r=>({status:"valid",value:r}),Cr=r=>r.status==="aborted",Er=r=>r.status==="dirty",Ne=r=>r.status==="valid",ht=r=>typeof Promise<"u"&&r instanceof Promise;var v;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(v||(v={}));class me{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ar=(r,e)=>{if(Ne(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 W(r.common.issues);return this._error=t,this._error}}};function k(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:l}=r;return i.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:a}}class w{get description(){return this._def.description}_getType(e){return le(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new F,ctx:{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ht(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={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:le(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Ar(n,a)}"~validate"(e){var n,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return Ne(s)?{value:s.value}:{issues:t.common.issues}}catch(s){(a=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>Ne(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={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:le(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(ht(a)?a:Promise.resolve(a));return Ar(n,s)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const i=e(a),o=()=>s.addIssue({code:d.custom,...n(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new Pe({schema:this,typeName:y.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 he.create(this,this._def)}nullable(){return Ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this)}promise(){return Xe.create(this,this._def)}or(e){return mt.create([this,e],this._def)}and(e){return vt.create(this,e,this._def)}transform(e){return new Pe({...k(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Vt({...k(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new xs({typeName:y.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new $t({...k(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Kt.create(this,e)}readonly(){return Ut.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ka=/^c[^\s-]{8,}$/i,Qa=/^[0-9a-z]+$/,es=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ts=/^[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,rs=/^[a-z0-9_-]{21}$/i,ns=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,as=/^[-+]?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)?)??$/,ss=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,is="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let St;const os=/^(?:(?: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])$/,us=/^(?:(?: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])$/,ls=/^(([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]))$/,ds=/^(([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])$/,cs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kn="((\\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])))",hs=new RegExp(`^${kn}$`);function wn(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 ps(r){return new RegExp(`^${wn(r)}$`)}function ms(r){let e=`${kn}T${wn(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 vs(r,e){return!!((e==="v4"||!e)&&os.test(r)||(e==="v6"||!e)&&ls.test(r))}function gs(r,e){if(!ns.test(r))return!1;try{const[t]=r.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function _s(r,e){return!!((e==="v4"||!e)&&us.test(r)||(e==="v6"||!e)&&ds.test(r))}class fe extends w{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:m.string,received:s.parsedType}),_}const n=new F;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?p(a,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&p(a,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")ss.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"email",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")St||(St=new RegExp(is,"u")),St.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"emoji",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")ts.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"uuid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")rs.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"nanoid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Ka.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Qa.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cuid2",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")es.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ulid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),p(a,{validation:"url",code:d.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"regex",code:d.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?ms(s).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?hs.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?ps(s).test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:d.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?as.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"duration",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?vs(e.data,s.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"ip",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?gs(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"jwt",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?_s(e.data,s.version)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"cidr",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?cs.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?fs.test(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{validation:"base64url",code:d.invalid_string,message:s.message}),n.dirty()):b.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:d.invalid_string,...v.errToObj(n)})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...v.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...v.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...v.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new fe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fe({...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}}fe.create=r=>new fe({checks:[],typeName:y.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...k(r)});function ys(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,s=Number.parseInt(r.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return s%i/10**a}class Ie extends w{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)!==m.number){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:m.number,received:s.parsedType}),_}let n;const a=new F;for(const s of this._def.checks)s.kind==="int"?b.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{code:d.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:d.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:d.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?ys(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),p(n,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{code:d.not_finite,message:s.message}),a.dirty()):b.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,n,a){return new Ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:v.toString(a)}]})}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Ie.create=r=>new Ie({checks:[],typeName:y.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class Ye extends w{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)!==m.bigint)return this._getInvalidInput(e);let n;const a=new F;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:d.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:d.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),p(n,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):b.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return p(t,{code:d.invalid_type,expected:m.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,n,a){return new Ye({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:v.toString(a)}]})}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ye.create=r=>new Ye({checks:[],typeName:y.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...k(r)});class Lt extends w{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),_}return D(e.data)}}Lt.create=r=>new Lt({typeName:y.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class pt extends w{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_type,expected:m.date,received:s.parsedType}),_}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return p(s,{code:d.invalid_date}),_}const n=new F;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),p(a,{code:d.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):b.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}pt.create=r=>new pt({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:y.ZodDate,...k(r)});class Sr extends w{_parse(e){if(this._getType(e)!==m.symbol){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),_}return D(e.data)}}Sr.create=r=>new Sr({typeName:y.ZodSymbol,...k(r)});class Mr extends w{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),_}return D(e.data)}}Mr.create=r=>new Mr({typeName:y.ZodUndefined,...k(r)});class Tr extends w{_parse(e){if(this._getType(e)!==m.null){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),_}return D(e.data)}}Tr.create=r=>new Tr({typeName:y.ZodNull,...k(r)});class jt extends w{constructor(){super(...arguments),this._any=!0}_parse(e){return D(e.data)}}jt.create=r=>new jt({typeName:y.ZodAny,...k(r)});class Me extends w{constructor(){super(...arguments),this._unknown=!0}_parse(e){return D(e.data)}}Me.create=r=>new Me({typeName:y.ZodUnknown,...k(r)});class ve extends w{_parse(e){const t=this._getOrReturnCtx(e);return p(t,{code:d.invalid_type,expected:m.never,received:t.parsedType}),_}}ve.create=r=>new ve({typeName:y.ZodNever,...k(r)});class zt extends w{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),_}return D(e.data)}}zt.create=r=>new zt({typeName:y.ZodVoid,...k(r)});class K extends w{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==m.array)return p(t,{code:d.invalid_type,expected:m.array,received:t.parsedType}),_;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(i||o)&&(p(t,{code:i?d.too_big:d.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(p(t,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(p(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new me(t,i,t.path,o)))).then(i=>F.mergeArray(n,i));const s=[...t.data].map((i,o)=>a.type._parseSync(new me(t,i,t.path,o)));return F.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new K({...this._def,minLength:{value:e,message:v.toString(t)}})}max(e,t){return new K({...this._def,maxLength:{value:e,message:v.toString(t)}})}length(e,t){return new K({...this._def,exactLength:{value:e,message:v.toString(t)}})}nonempty(e){return this.min(1,e)}}K.create=(r,e)=>new K({type:r,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...k(e)});function Ae(r){if(r instanceof N){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=he.create(Ae(n))}return new N({...r._def,shape:()=>e})}else return r instanceof K?new K({...r._def,type:Ae(r.element)}):r instanceof he?he.create(Ae(r.unwrap())):r instanceof Ze?Ze.create(Ae(r.unwrap())):r instanceof se?se.create(r.items.map(e=>Ae(e))):r}class N extends w{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=b.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==m.object){const u=this._getOrReturnCtx(e);return p(u,{code:d.invalid_type,expected:m.object,received:u.parsedType}),_}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ve&&this._def.unknownKeys==="strip"))for(const u in a.data)i.includes(u)||o.push(u);const l=[];for(const u of i){const c=s[u],f=a.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new me(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof ve){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:a.data[c]}});else if(u==="strict")o.length>0&&(p(a,{code:d.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of o){const f=a.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new me(a,f,a.path,c)),alwaysSet:c in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const f=await c.key,h=await c.value;u.push({key:f,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>F.mergeObjectSync(n,u)):F.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new N({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,i;const a=((i=(s=this._def).errorMap)==null?void 0:i.call(s,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:v.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new N({...this._def,unknownKeys:"strip"})}passthrough(){return new N({...this._def,unknownKeys:"passthrough"})}extend(e){return new N({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new N({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new N({...this._def,catchall:e})}pick(e){const t={};for(const n of b.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new N({...this._def,shape:()=>t})}omit(e){const t={};for(const n of b.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new N({...this._def,shape:()=>t})}deepPartial(){return Ae(this)}partial(e){const t={};for(const n of b.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new N({...this._def,shape:()=>t})}required(e){const t={};for(const n of b.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof he;)s=s._def.innerType;t[n]=s}return new N({...this._def,shape:()=>t})}keyof(){return bn(b.objectKeys(this.shape))}}N.create=(r,e)=>new N({shape:()=>r,unknownKeys:"strip",catchall:ve.create(),typeName:y.ZodObject,...k(e)});N.strictCreate=(r,e)=>new N({shape:()=>r,unknownKeys:"strict",catchall:ve.create(),typeName:y.ZodObject,...k(e)});N.lazycreate=(r,e)=>new N({shape:r,unknownKeys:"strip",catchall:ve.create(),typeName:y.ZodObject,...k(e)});class mt extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new W(o.ctx.common.issues));return p(t,{code:d.invalid_union,unionErrors:i}),_}if(t.common.async)return Promise.all(n.map(async s=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let s;const i=[];for(const l of n){const u={...t,common:{...t.common,issues:[]},parent:null},c=l._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(l=>new W(l));return p(t,{code:d.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}mt.create=(r,e)=>new mt({options:r,typeName:y.ZodUnion,...k(e)});function Ft(r,e){const t=le(r),n=le(e);if(r===e)return{valid:!0,data:r};if(t===m.object&&n===m.object){const a=b.objectKeys(e),s=b.objectKeys(r).filter(o=>a.indexOf(o)!==-1),i={...r,...e};for(const o of s){const l=Ft(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===m.array&&n===m.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<r.length;s++){const i=r[s],o=e[s],l=Ft(i,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return t===m.date&&n===m.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class vt extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(s,i)=>{if(Cr(s)||Cr(i))return _;const o=Ft(s.value,i.value);return o.valid?((Er(s)||Er(i))&&t.dirty(),{status:t.value,value:o.data}):(p(n,{code:d.invalid_intersection_types}),_)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}vt.create=(r,e,t)=>new vt({left:r,right:e,typeName:y.ZodIntersection,...k(t)});class se extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.array)return p(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return p(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(p(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new me(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>F.mergeArray(t,i)):F.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new se({...this._def,rest:e})}}se.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new se({items:r,typeName:y.ZodTuple,rest:null,...k(e)})};class Or extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.map)return p(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),_;const a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,l],u)=>({key:a._parse(new me(n,o,n.path,[u,"key"])),value:s._parse(new me(n,l,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return _;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(u.value,c.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return _;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(u.value,c.value)}return{status:t.value,value:o}}}}Or.create=(r,e,t)=>new Or({valueType:e,keyType:r,typeName:y.ZodMap,...k(t)});class He extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.set)return p(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),_;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(p(n,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(p(n,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function i(l){const u=new Set;for(const c of l){if(c.status==="aborted")return _;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((l,u)=>s._parse(new me(n,l,n.path,u)));return n.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new He({...this._def,minSize:{value:e,message:v.toString(t)}})}max(e,t){return new He({...this._def,maxSize:{value:e,message:v.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}He.create=(r,e)=>new He({valueType:r,minSize:null,maxSize:null,typeName:y.ZodSet,...k(e)});class Be extends w{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.function)return p(t,{code:d.invalid_type,expected:m.function,received:t.parsedType}),_;function n(o,l){return Dt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zt(),We].filter(u=>!!u),issueData:{code:d.invalid_arguments,argumentsError:l}})}function a(o,l){return Dt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zt(),We].filter(u=>!!u),issueData:{code:d.invalid_return_type,returnTypeError:l}})}const s={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Xe){const o=this;return D(async function(...l){const u=new W([]),c=await o._def.args.parseAsync(l,s).catch(x=>{throw u.addIssue(n(l,x)),u}),f=await Reflect.apply(i,this,c);return await o._def.returns._def.type.parseAsync(f,s).catch(x=>{throw u.addIssue(a(f,x)),u})})}else{const o=this;return D(function(...l){const u=o._def.args.safeParse(l,s);if(!u.success)throw new W([n(l,u.error)]);const c=Reflect.apply(i,this,u.data),f=o._def.returns.safeParse(c,s);if(!f.success)throw new W([a(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Be({...this._def,args:se.create(e).rest(Me.create())})}returns(e){return new Be({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Be({args:e||se.create([]).rest(Me.create()),returns:t||Me.create(),typeName:y.ZodFunction,...k(n)})}}class Nr extends w{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})}}Nr.create=(r,e)=>new Nr({getter:r,typeName:y.ZodLazy,...k(e)});class Ir extends w{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return p(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ir.create=(r,e)=>new Ir({value:r,typeName:y.ZodLiteral,...k(e)});function bn(r,e){return new Re({values:r,typeName:y.ZodEnum,...k(e)})}class Re extends w{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return p(t,{expected:b.joinValues(n),received:t.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return p(t,{received:t.data,code:d.invalid_enum_value,options:n}),_}return D(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 Re.create(e,{...this._def,...t})}exclude(e,t=this._def){return Re.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Re.create=bn;class Rr extends w{_parse(e){const t=b.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==m.string&&n.parsedType!==m.number){const a=b.objectValues(t);return p(n,{expected:b.joinValues(a),received:n.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(b.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=b.objectValues(t);return p(n,{received:n.data,code:d.invalid_enum_value,options:a}),_}return D(e.data)}get enum(){return this._def.values}}Rr.create=(r,e)=>new Rr({values:r,typeName:y.ZodNativeEnum,...k(e)});class Xe extends w{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.promise&&t.common.async===!1)return p(t,{code:d.invalid_type,expected:m.promise,received:t.parsedType}),_;const n=t.parsedType===m.promise?t.data:Promise.resolve(t.data);return D(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Xe.create=(r,e)=>new Xe({type:r,typeName:y.ZodPromise,...k(e)});class Pe extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:i=>{p(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?$e(l.value):l});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?$e(o.value):o}}if(a.type==="refinement"){const i=o=>{const l=a.refinement(o,s);if(n.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(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ne(i))return _;const o=a.transform(i.value,s);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:n.data,path:n.path,parent:n}).then(i=>Ne(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:t.value,value:o})):_);b.assertNever(a)}}Pe.create=(r,e,t)=>new Pe({schema:r,typeName:y.ZodEffects,effect:e,...k(t)});Pe.createWithPreprocess=(r,e,t)=>new Pe({schema:e,effect:{type:"preprocess",transform:r},typeName:y.ZodEffects,...k(t)});class he extends w{_parse(e){return this._getType(e)===m.undefined?D(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}he.create=(r,e)=>new he({innerType:r,typeName:y.ZodOptional,...k(e)});class Ze extends w{_parse(e){return this._getType(e)===m.null?D(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(r,e)=>new Ze({innerType:r,typeName:y.ZodNullable,...k(e)});class Vt extends w{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Vt.create=(r,e)=>new Vt({innerType:r,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class $t extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ht(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new W(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new W(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}$t.create=(r,e)=>new $t({innerType:r,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class Pr extends w{_parse(e){if(this._getType(e)!==m.nan){const n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),_}return{status:"valid",value:e.data}}}Pr.create=r=>new Pr({typeName:y.ZodNaN,...k(r)});class xs extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Kt extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?_:s.status==="dirty"?(t.dirty(),$e(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?_:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new Kt({in:e,out:t,typeName:y.ZodPipeline})}}class Ut extends w{_parse(e){const t=this._def.innerType._parse(e),n=a=>(Ne(a)&&(a.value=Object.freeze(a.value)),a);return ht(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}Ut.create=(r,e)=>new Ut({innerType:r,typeName:y.ZodReadonly,...k(e)});var y;(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"})(y||(y={}));const kt=fe.create,T=Ie.create,Cn=Lt.create,Qt=jt.create;Me.create;ve.create;const Zr=zt.create,er=K.create,H=N.create;mt.create;vt.create;const Dr=se.create,ne=Be.create;Re.create;const ks=Xe.create;he.create;Ze.create;H({pin:H({fade:Cn().optional(),maxCount:T().optional(),maxZoom:T().optional()}).optional(),animation:H({queue:H({limit:T().optional()}).optional()}).optional(),api:kt().optional()});const ws=T().min(-90).max(90),bs=T().min(-180).max(180),Lr=Qt().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),En=H({mapSize:T(),zoomMin:T(),zoomMax:T(),zoomScale:T()}),Cs=H({instance:Qt(),inserted:ne().args().returns(Cn()),insert:ne().args().returns(Zr()),remove:ne().args().returns(Zr())}),Es=H({parameters:En,getContainer:ne().args().returns(Lr),getZoom:ne().args().returns(T()),getWidth:ne().args().returns(T()),getHeight:ne().args().returns(T()),createMarker:ne().args(Lr,ws,bs,T()).returns(Cs)}),An=H({id:kt().min(1),rank:T(),lat:T().min(-90).max(90),lng:T().min(-180).max(180),width:T(),height:T(),padding:T()}).refine(r=>Math.min(r.width,r.height)/r.padding>=4,"Popup width and height must be at least 4 times the padding");Dr([T(),er(Dr([T(),T()]))]);const jr=ne().args(kt()).returns(ks(Qt())),As=H({data:An,callbacks:H({body:jr,pin:jr.optional()})}),Ss=er(As);H({key:kt(),parameters:En,data:er(An)});var gt;(r=>{function e(o,l,u){return{x:n(l)*u,y:a(o)*u}}r.project=e;function t(o,l,u){return{lat:i(l/u),lng:s(o/u)}}r.unproject=t;function n(o){return(180+o)/360}function a(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function s(o){return o*360-180}function i(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})(gt||(gt={}));var _t;(r=>{r.COUNT=12,r.DEFAULT=270,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330]})(_t||(_t={}));const Ms=1e6,Ts=2,Os=128,zr="https://arenarium.dev/api/public/v1/popup/states";class Ns{constructor(e,t,n){g(this,"key");g(this,"provider");g(this,"popupDataArray",new Array);g(this,"popupDataMap",new Map);g(this,"popupDataUpdating",!1);g(this,"popupMaxWidth",0);g(this,"popupMaxHeight",0);g(this,"configurationPinFade",!1);g(this,"configurationPinMaxCount",0);g(this,"configurationPinMaxZoomDelta",0);g(this,"configurationApiUrl",zr);Es.parse(t),this.key=e,this.provider=t,this.configuration=n}set configuration(e){var t,n,a,s,i;this.configurationPinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.configurationPinMaxCount=((n=e==null?void 0:e.pin)==null?void 0:n.maxCount)??Math.max(Os,8*navigator.hardwareConcurrency),this.configurationPinMaxZoomDelta=((a=e==null?void 0:e.pin)==null?void 0:a.maxZoom)??Ts,this.configurationApiUrl=(e==null?void 0:e.api)??zr,de.setLimit(((i=(s=e==null?void 0:e.animation)==null?void 0:s.queue)==null?void 0:i.limit)??8*navigator.hardwareConcurrency)}setColors(e,t,n){const a=this.provider.getContainer();a.style.setProperty("--map-style-primary",e),a.style.setProperty("--map-style-background",t),a.style.setProperty("--map-style-text",n)}async updatePopups(e){try{await Ss.parseAsync(e);const t={key:this.key,parameters:this.provider.parameters,data:e.map(s=>s.data)},n=await fetch(this.configurationApiUrl,{method:"POST",body:JSON.stringify(t)});if(!n.ok||!n.body)throw new Error("Failed to get popup states");const a=await n.json();await this.updatePopupData(e,a),this.popupMaxWidth=this.popupDataArray.reduce((s,i)=>Math.max(s,i.marker.width),0),this.popupMaxHeight=this.popupDataArray.reduce((s,i)=>Math.max(s,i.marker.height),0),this.processPopupDataCallback()}catch(t){throw console.error(t),rt("[Error] Failed to update popups",{message:t.message,stack:t.stack}),t}}removePopups(){try{this.removePopupData()}catch(e){throw console.error(e),rt("[Error] Failed to remove popups",{message:e.message,stack:e.stack}),e}}togglePopups(e){try{this.togglePopupData(e)}catch(t){throw console.error(t),rt("[Error] Failed to toggle popups",{message:t.message,stack:t.stack}),t}}processPopupDataCallback(){if(this.popupDataArray.length!=0)try{this.processPopupData(),window.setTimeout(this.processPopupDataCallback.bind(this),25)}catch(e){console.error(e),rt("[Error] Failed to process popups",{message:e.message,stack:e.stack})}}processPopupData(){if(this.popupDataUpdating)return;const e=this.provider.getZoom();if(!e)return;const t=this.provider.getWidth(),n=this.provider.getHeight(),a=this.popupMaxWidth*2,s=this.popupMaxHeight*2,i=new Vr(-a,n+s,t+a,-s,this.provider.parameters),o=new Vr(0,n,t,0,this.provider.parameters);let l=0;for(const u of this.popupDataArray){const c=u.supressed?-1:e,f=u.circle;o.contains(f.lat,f.lng)?c<=f.zoom&&f.zoom<=e+this.configurationPinMaxZoomDelta?(l<this.configurationPinMaxCount&&(this.configurationPinFade==!0?f.updateState(e):f.setExpanded(),f.updateMap(!0),f.isPinLoaded()==!1&&f.updatePin()),l++):(f.setCollapsed(),f.isCollapsed()&&f.updateMap(!1)):f.updateMap(!1);const h=u.marker;i.contains(h.lat,h.lng)?h.zoom<=c?(h.updateState(e),h.setCollapsed(!1),h.updateMap(!0),h.isExpanded()&&h.isBodyLoaded()==!1&&h.updateBody()):(h.setCollapsed(!0),h.isCollapsed()&&h.updateMap(!1)):h.updateMap(!1)}}async updatePopupData(e,t){try{this.popupDataUpdating=!0;const n=new Map(e.map((s,i)=>[s.data.id,new Fr(this.provider,s,t[i])])),a=Array.from(this.popupDataArray);for(const s of a)n.has(s.id)==!1&&(s.remove(),this.popupDataMap.delete(s.id),this.popupDataArray.splice(this.popupDataArray.indexOf(s),1));for(let s=0;s<e.length;s++){const i=e[s],o=t[s],l=this.popupDataMap.get(i.data.id);if(l)l.update(o);else{const u=new Fr(this.provider,i,o);u.create(),this.popupDataMap.set(i.data.id,u),this.popupDataArray.push(u)}}this.popupDataArray.sort((s,i)=>s.zoom-i.zoom)}catch(n){throw console.error(n),this.popupDataArray.length=0,this.popupDataMap.clear(),n}finally{this.popupDataUpdating=!1}}removePopupData(){try{this.popupDataUpdating=!0,this.popupDataArray.forEach(e=>e.remove()),this.popupDataArray.length=0,this.popupDataMap.clear()}catch(e){throw console.error(e),this.popupDataArray.forEach(t=>t.remove()),this.popupDataArray.length=0,this.popupDataMap.clear(),e}finally{this.popupDataUpdating=!1}}togglePopupData(e){e.forEach(t=>{const n=this.popupDataMap.get(t.id);n&&(n.supressed=!t.toggled)})}}class Sn{constructor(e,t,n){g(this,"provider");g(this,"id");g(this,"lat");g(this,"lng");g(this,"zoom");g(this,"element");g(this,"component");g(this,"marker");this.provider=e,this.id=t.data.id,this.lat=t.data.lat,this.lng=t.data.lng,this.zoom=n[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 marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}update(e){this.zoom=e[0],this.updateZIndex()}updateZIndex(){throw new Error("Update z-index not implemented")}updateMap(e){const t=this.marker,n=this.component;if(t==null||n==null)throw new Error("Failed to update popup map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){return Math.round((this.provider.parameters.zoomMax-this.zoom)*this.provider.parameters.zoomScale)}isInBlock(e,t){return this.zoom<=e&&t.contains(this.lat,this.lng)}remove(){var e,t;(e=this.marker)==null||e.remove(),(t=this.element)==null||t.remove()}}class Is extends Sn{constructor(t,n,a){super(t,n,a);g(this,"pinLoading",!1);g(this,"pinLoaded",!1);g(this,"pinCallback");this.pinCallback=n.callbacks.pin}createElement(){this.element=document.createElement("div"),this.element.classList.add("circle"),this.component=_n(Ja,{target:this.element,props:{id:this.id+"_circle",priority:this.zoom*this.provider.parameters.zoomScale}})}updateZIndex(){const t=this.element;t&&(t.style.zIndex=this.getZindex().toString())}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){const n=this.component;if(!n)throw new Error("Failed to update circle state");n.setScale(this.getScale(t))}updatePin(){var n;if(this.pinCallback==null||this.pinLoaded||this.pinLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.pinLoading=!0,this.pinCallback(this.id).then(a=>{t.appendChild(a),this.pinLoaded=!0,this.pinLoading=!1}))}setExpanded(){if(this.component==null)throw new Error("Failed to set circle expanded");this.component.setScale(1)}setCollapsed(){if(this.component==null)throw new Error("Failed to set circle collapsed");this.component.setScale(0)}getScale(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isPinLoaded(){return this.pinCallback==null||this.pinLoaded}}class Rs extends Sn{constructor(t,n,a){super(t,n,a);g(this,"width");g(this,"height");g(this,"padding");g(this,"states");g(this,"bodyLoading",!1);g(this,"bodyLoaded",!1);g(this,"bodyCallback");this.id=n.data.id,this.width=n.data.width,this.height=n.data.height,this.padding=n.data.padding,this.states=a[1].map(s=>[s[0],_t.DEGREES[s[1]]]),this.bodyCallback=n.callbacks.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("marker"),this.component=_n(Ha,{target:this.element,props:{id:this.id+"_marker",priority:this.zoom*this.provider.parameters.zoomScale,width:this.width,height:this.height,padding:this.padding}})}update(t){super.update(t),this.states=t[1].map(n=>[n[0],_t.DEGREES[n[1]]])}updateZIndex(){const t=this.element;if(!t)return;const n=this.getZindex()+Ms;t.style.zIndex=n.toString()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){const n=this.component;if(!n)throw new Error("Failed to update marker state");n.setAngle(this.getAngle(t))}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{t.appendChild(a),this.bodyLoading=!1,this.bodyLoaded=!0}))}getAngle(t){const n=this.states.findLast(a=>a[0]<=t);if(!n)throw new Error("Angle not found");return n[1]}setCollapsed(t){if(this.component==null)throw new Error("Failed to set marker collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component?this.component.getExpanded():!1}isCollapsed(){return this.component?this.component.getCollapsed():!1}isBodyLoaded(){return this.bodyLoaded}}class Fr{constructor(e,t,n){g(this,"id");g(this,"rank");g(this,"lat");g(this,"lng");g(this,"zoom");g(this,"supressed");g(this,"circle");g(this,"marker");this.id=t.data.id,this.rank=t.data.rank,this.lat=t.data.lat,this.lng=t.data.lng,this.zoom=n[0],this.supressed=!1,this.circle=new Is(e,t,n),this.marker=new Rs(e,t,n)}create(){this.circle.create(),this.marker.create()}update(e){this.circle.update(e),this.marker.update(e)}remove(){this.circle.remove(),this.marker.remove()}}class Vr{constructor(e,t,n,a,s){g(this,"swLat");g(this,"swLng");g(this,"neLat");g(this,"neLng");g(this,"contains",(e,t)=>this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1);const i=gt.unproject(e,t,s.mapSize),o=gt.unproject(n,a,s.mapSize);this.swLat=i.lat,this.swLng=i.lng,this.neLat=o.lat,this.neLng=o.lng}}exports.MapManager=Ns;