diff --git a/src/createTemplate.html b/PRE-OVERHAUL/src/createTemplate.html similarity index 100% rename from src/createTemplate.html rename to PRE-OVERHAUL/src/createTemplate.html diff --git a/src/mainOverlay.html b/PRE-OVERHAUL/src/mainOverlay.html similarity index 100% rename from src/mainOverlay.html rename to PRE-OVERHAUL/src/mainOverlay.html diff --git a/src/manageLinks.html b/PRE-OVERHAUL/src/manageLinks.html similarity index 100% rename from src/manageLinks.html rename to PRE-OVERHAUL/src/manageLinks.html diff --git a/src/manageTemplates.html b/PRE-OVERHAUL/src/manageTemplates.html similarity index 100% rename from src/manageTemplates.html rename to PRE-OVERHAUL/src/manageTemplates.html diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 0f016ac..9352048 100644 --- a/dist/BlueMarble.user.js +++ b/dist/BlueMarble.user.js @@ -1 +1 @@ -(()=>{var e=Object.defineProperty,t=(t,n,s)=>((t,n,s)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s)(t,"symbol"!=typeof n?n+"":n,s);function n(e,t){const n=document.createElement(e);return t&&Object.entries(t).forEach(([e,t])=>{"className"===e?n.setAttribute("class",t):n.setAttribute(e,t)}),n}new Blob;var s,i,r,a={};((t,n)=>{for(var s in n)e(t,s,{get:n[s],enumerable:!0})})(a,{t:()=>Ue,i:()=>N,o:()=>y,u:()=>k,NEVER:()=>Dt,OK:()=>A,h:()=>w,l:()=>F,ZodAny:()=>he,ZodArray:()=>fe,ZodBigInt:()=>re,ZodBoolean:()=>ae,ZodBranded:()=>Le,ZodCatch:()=>je,ZodDate:()=>oe,ZodDefault:()=>Pe,ZodDiscriminatedUnion:()=>xe,ZodEffects:()=>De,ZodEnum:()=>Me,m:()=>h,p:()=>qe,ZodFunction:()=>$e,ZodIntersection:()=>ke,v:()=>c,ZodLazy:()=>Ee,ZodLiteral:()=>Ie,ZodMap:()=>_e,ZodNaN:()=>Ce,ZodNativeEnum:()=>Se,ZodNever:()=>me,ZodNull:()=>de,ZodNullable:()=>Oe,ZodNumber:()=>ie,ZodObject:()=>ye,ZodOptional:()=>Be,k:()=>o,ZodPipeline:()=>ze,ZodPromise:()=>Fe,ZodReadonly:()=>Ve,ZodRecord:()=>Ae,N:()=>F,ZodSet:()=>Ze,ZodString:()=>ne,ZodSymbol:()=>ue,A:()=>De,ZodTuple:()=>Ne,_:()=>F,ZodUndefined:()=>ce,ZodUnion:()=>ge,ZodUnknown:()=>le,ZodVoid:()=>pe,Z:()=>g,any:()=>rt,$:()=>ct,I:()=>Xe,T:()=>et,M:()=>Ft,S:()=>We,F:()=>tt,D:()=>Q,B:()=>l,O:()=>mt,effect:()=>_t,P:()=>kt,j:()=>bt,C:()=>f,U:()=>u,L:()=>Je,intersection:()=>pt,V:()=>_,R:()=>E,W:()=>Z,q:()=>$,K:()=>He,H:()=>xt,J:()=>wt,Y:()=>v,map:()=>yt,G:()=>Qe,X:()=>Nt,ee:()=>ot,null:()=>it,te:()=>$t,number:()=>Ge,object:()=>dt,ne:()=>r,se:()=>St,ie:()=>Mt,re:()=>Zt,ae:()=>Tt,oe:()=>It,ue:()=>Et,promise:()=>At,ce:()=>d,de:()=>vt,set:()=>gt,he:()=>p,le:()=>ht,string:()=>Ye,me:()=>nt,pe:()=>_t,fe:()=>ft,undefined:()=>st,union:()=>lt,ve:()=>at,ye:()=>s,ge:()=>ut}),(i=s||(s={})).be=e=>{},i.xe=function(e){},i.we=function(e){throw new Error},i.ke=e=>{const t={};for(const n of e)t[n]=n;return t},i.Ne=e=>{const t=i.Ae(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(const s of t)n[s]=e[s];return i._e(n)},i._e=e=>i.Ae(e).map(function(t){return e[t]}),i.Ae="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},i.find=(e,t)=>{for(const n of e)if(t(n))return n},i.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,i.Ze=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},i.$e=(e,t)=>"bigint"==typeof t?t.toString():t,(r||(r={})).Ee=(e,t)=>({...e,...t});var o=s.ke(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),u=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(e)?o.G:o.number;case"boolean":return o.T;case"function":return o.j;case"bigint":return o.I;case"symbol":return o.me;case"object":return Array.isArray(e)?o.$:null===e?o.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?o.promise:"undefined"!=typeof Map&&e instanceof Map?o.map:"undefined"!=typeof Set&&e instanceof Set?o.set:"undefined"!=typeof Date&&e instanceof Date?o.F:o.object;default:return o.ve}},c=s.ke(["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"]),d=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),h=class e extends Error{get Ie(){return this.Te}constructor(e){super(),this.Te=[],this.Me=e=>{this.Te=[...this.Te,e]},this.Se=(e=[])=>{this.Te=[...this.Te,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.Te=e}format(e){const t=e||function(e){return e.message},n={Fe:[]},s=e=>{for(const i of e.Te)if("invalid_union"===i.code)i.De.map(s);else if("invalid_return_type"===i.code)s(i.Be);else if("invalid_arguments"===i.code)s(i.Oe);else if(0===i.path.length)n.Fe.push(t(i));else{let e=n,s=0;for(;se.message){const t={},n=[];for(const s of this.Te)if(s.path.length>0){const n=s.path[0];t[n]=t[n]||[],t[n].push(e(s))}else n.push(e(s));return{Ce:n,Ue:t}}get Ce(){return this.je()}};h.create=e=>new h(e);var l=(e,t)=>{let n;switch(e.code){case c.Le:n=e.ze===o.undefined?"Required":`Expected ${e.Ve}, received ${e.ze}`;break;case c.Re:n=`Invalid literal value, expected ${JSON.stringify(e.Ve,s.$e)}`;break;case c.We:n=`Unrecognized key(s) in object: ${s.Ze(e.keys,", ")}`;break;case c.qe:n="Invalid input";break;case c.Ke:n=`Invalid discriminator value. Expected ${s.Ze(e.options)}`;break;case c.He:n=`Invalid enum value. Expected ${s.Ze(e.options)}, received '${e.ze}'`;break;case c.Je:n="Invalid function arguments";break;case c.Ye:n="Invalid function return type";break;case c.Ge:n="Invalid date";break;case c.Qe:"object"==typeof e.Xe?"includes"in e.Xe?(n=`Invalid input: must include "${e.Xe.includes}"`,"number"==typeof e.Xe.position&&(n=`${n} at one or more positions greater than or equal to ${e.Xe.position}`)):"startsWith"in e.Xe?n=`Invalid input: must start with "${e.Xe.startsWith}"`:"endsWith"in e.Xe?n=`Invalid input: must end with "${e.Xe.endsWith}"`:s.we(e.Xe):n="regex"!==e.Xe?`Invalid ${e.Xe}`:"Invalid";break;case c.et:n="array"===e.type?`Array must contain ${e.tt?"exactly":e.nt?"at least":"more than"} ${e.st} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.nt?"at least":"over"} ${e.st} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.tt?"exactly equal to ":e.nt?"greater than or equal to ":"greater than "}${e.st}`:"date"===e.type?`Date must be ${e.tt?"exactly equal to ":e.nt?"greater than or equal to ":"greater than "}${new Date(Number(e.st))}`:"Invalid input";break;case c.it:n="array"===e.type?`Array must contain ${e.tt?"exactly":e.nt?"at most":"less than"} ${e.rt} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.nt?"at most":"under"} ${e.rt} character(s)`:"number"===e.type?`Number must be ${e.tt?"exactly":e.nt?"less than or equal to":"less than"} ${e.rt}`:"bigint"===e.type?`BigInt must be ${e.tt?"exactly":e.nt?"less than or equal to":"less than"} ${e.rt}`:"date"===e.type?`Date must be ${e.tt?"exactly":e.nt?"smaller than or equal to":"smaller than"} ${new Date(Number(e.rt))}`:"Invalid input";break;case c.S:n="Invalid input";break;case c.ot:n="Intersection results could not be merged";break;case c.ut:n=`Number must be a multiple of ${e.ct}`;break;case c.dt:n="Number must be finite";break;default:n=t.ht,s.we(e)}return{message:n}},m=l;function p(e){m=e}function f(){return m}var v=e=>{const{data:t,path:n,lt:s,ft:i}=e,r=[...n,...i.path||[]],a={...i,path:r};if(void 0!==i.message)return{...i,path:r,message:i.message};let o="";const u=s.filter(e=>!!e).slice().reverse();for(const e of u)o=e(a,{data:t,ht:o}).message;return{...i,path:r,message:o}},y=[];function g(e,t){const n=f(),s=v({ft:t,data:e.data,path:e.path,lt:[e.yt.vt,e.gt,n,n===l?void 0:l].filter(e=>!!e)});e.yt.Te.push(s)}var b,x,w=class e{constructor(){this.value="valid"}bt(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static xt(e,t){const n=[];for(const s of t){if("aborted"===s.status)return k;"dirty"===s.status&&e.bt(),n.push(s.value)}return{status:e.value,value:n}}static async wt(t,n){const s=[];for(const e of n){const t=await e.key,n=await e.value;s.push({key:t,value:n})}return e.kt(t,s)}static kt(e,t){const n={};for(const s of t){const{key:t,value:i}=s;if("aborted"===t.status)return k;if("aborted"===i.status)return k;"dirty"===t.status&&e.bt(),"dirty"===i.status&&e.bt(),"__proto__"===t.value||void 0===i.value&&!s.Nt||(n[t.value]=i.value)}return{status:e.value,value:n}}},k=Object.freeze({status:"aborted"}),N=e=>({status:"dirty",value:e}),A=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,Z=e=>"dirty"===e.status,$=e=>"valid"===e.status,E=e=>"undefined"!=typeof Promise&&e instanceof Promise;(x=b||(b={})).At=e=>"string"==typeof e?{message:e}:e||{},x.toString=e=>"string"==typeof e?e:e?.message;var I=class{constructor(e,t,n,s){this._t=[],this.parent=e,this.data=t,this.Zt=n,this.$t=s}get path(){return this._t.length||(Array.isArray(this.$t)?this._t.push(...this.Zt,...this.$t):this._t.push(...this.Zt,this.$t)),this._t}},T=(e,t)=>{if($(t))return{Et:!0,data:t.value};if(!e.yt.Te.length)throw new Error("Validation failed but no issues detected.");return{Et:!1,get error(){if(this.It)return this.It;const t=new h(e.yt.Te);return this.It=t,this.It}}};function M(e){if(!e)return{};const{Tt:t,Mt:n,St:s,description:i}=e;if(t&&(n||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{Tt:t,description:i}:{Tt:(t,i)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??i.ht}:void 0===i.data?{message:r??s??i.ht}:"invalid_type"!==t.code?{message:i.ht}:{message:r??n??i.ht}},description:i}}var S,F=class{get description(){return this.Ft.description}Dt(e){return u(e.data)}Bt(e,t){return t||{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Ft.Tt,path:e.path,parent:e.parent}}Pt(e){return{status:new w,jt:{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Ft.Tt,path:e.path,parent:e.parent}}}Ct(e){const t=this.Ut(e);if(E(t))throw new Error("Synchronous parse encountered promise.");return t}Lt(e){const t=this.Ut(e);return Promise.resolve(t)}parse(e,t){const n=this.zt(e,t);if(n.Et)return n.data;throw n.error}zt(e,t){const n={yt:{Te:[],async:t?.async??!1,vt:t?.Tt},path:t?.path||[],gt:this.Ft.Tt,parent:null,data:e,Ot:u(e)},s=this.Ct({data:e,path:n.path,parent:n});return T(n,s)}"~validate"(e){const t={yt:{Te:[],async:!!this["~standard"].async},path:[],gt:this.Ft.Tt,parent:null,data:e,Ot:u(e)};if(!this["~standard"].async)try{const n=this.Ct({data:e,path:[],parent:t});return $(n)?{value:n.value}:{Te:t.yt.Te}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.yt={Te:[],async:!0}}return this.Lt({data:e,path:[],parent:t}).then(e=>$(e)?{value:e.value}:{Te:t.yt.Te})}async Vt(e,t){const n=await this.Rt(e,t);if(n.Et)return n.data;throw n.error}async Rt(e,t){const n={yt:{Te:[],vt:t?.Tt,async:!0},path:t?.path||[],gt:this.Ft.Tt,parent:null,data:e,Ot:u(e)},s=this.Ut({data:e,path:n.path,parent:n}),i=await(E(s)?s:Promise.resolve(s));return T(n,i)}Wt(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this.qt((t,s)=>{const i=e(t),r=()=>s.Me({code:c.S,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(r(),!1)):!!i||(r(),!1)})}Kt(e,t){return this.qt((n,s)=>!!e(n)||(s.Me("function"==typeof t?t(n,s):t),!1))}qt(e){return new De({Ht:this,Jt:qe.ZodEffects,effect:{type:"refinement",Kt:e}})}Yt(e){return this.qt(e)}constructor(e){this.Gt=this.Rt,this.Ft=e,this.parse=this.parse.bind(this),this.zt=this.zt.bind(this),this.Vt=this.Vt.bind(this),this.Rt=this.Rt.bind(this),this.Gt=this.Gt.bind(this),this.Wt=this.Wt.bind(this),this.Kt=this.Kt.bind(this),this.Yt=this.Yt.bind(this),this.re=this.re.bind(this),this.te=this.te.bind(this),this.Qt=this.Qt.bind(this),this.$=this.$.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.Xt=this.Xt.bind(this),this.en=this.en.bind(this),this.tn=this.tn.bind(this),this.nn=this.nn.bind(this),this.sn=this.sn.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}re(){return Be.create(this,this.Ft)}te(){return Oe.create(this,this.Ft)}Qt(){return this.te().re()}$(){return fe.create(this)}promise(){return Fe.create(this,this.Ft)}or(e){return ge.create([this,e],this.Ft)}and(e){return ke.create(this,e,this.Ft)}transform(e){return new De({...M(this.Ft),Ht:this,Jt:qe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Pe({...M(this.Ft),rn:this,defaultValue:t,Jt:qe.ZodDefault})}brand(){return new Le({Jt:qe.ZodBranded,type:this,...M(this.Ft)})}catch(e){const t="function"==typeof e?e:()=>e;return new je({...M(this.Ft),rn:this,an:t,Jt:qe.ZodCatch})}Xt(e){return new(0,this.constructor)({...this.Ft,description:e})}en(e){return ze.create(this,e)}tn(){return Ve.create(this)}sn(){return this.zt(void 0).Et}nn(){return this.zt(null).Et}},D=/^c[^\s-]{8,}$/i,B=/^[0-9a-z]+$/,O=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[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,j=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,U=/^[-+]?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)?)??$/,L=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,z=/^(?:(?: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])$/,V=/^(?:(?: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])$/,R=/^(([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]))$/,W=/^(([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])$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,H="((\\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])))",J=new RegExp(`^${H}$`);function Y(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function G(e){return new RegExp(`^${Y(e)}$`)}function Q(e){let t=`${H}T${Y(e)}`;const n=[];return n.push(e.un?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function X(e,t){return!("v4"!==t&&t||!z.test(e))||!("v6"!==t&&t||!R.test(e))}function ee(e,t){if(!C.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(s));return!("object"!=typeof i||null===i||"cn"in i&&"JWT"!==i?.cn||!i.dn||t&&i.dn!==t)}catch{return!1}}function te(e,t){return!("v4"!==t&&t||!V.test(e))||!("v6"!==t&&t||!W.test(e))}var ne=class e extends F{Ut(e){if(this.Ft.M&&(e.data=String(e.data)),this.Dt(e)!==o.string){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.string,ze:t.Ot}),k}const t=new w;let n;for(const i of this.Ft.hn)if("min"===i.kind)e.data.lengthi.value&&(n=this.Bt(e,n),g(n,{code:c.it,rt:i.value,type:"string",nt:!0,tt:!1,message:i.message}),t.bt());else if("length"===i.kind){const s=e.data.length>i.value,r=e.data.lengthe.test(t),{Xe:t,code:c.Qe,...b.At(n)})}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}email(e){return this.pn({kind:"email",...b.At(e)})}url(e){return this.pn({kind:"url",...b.At(e)})}fn(e){return this.pn({kind:"emoji",...b.At(e)})}uuid(e){return this.pn({kind:"uuid",...b.At(e)})}vn(e){return this.pn({kind:"nanoid",...b.At(e)})}yn(e){return this.pn({kind:"cuid",...b.At(e)})}gn(e){return this.pn({kind:"cuid2",...b.At(e)})}bn(e){return this.pn({kind:"ulid",...b.At(e)})}xn(e){return this.pn({kind:"base64",...b.At(e)})}wn(e){return this.pn({kind:"base64url",...b.At(e)})}kn(e){return this.pn({kind:"jwt",...b.At(e)})}Nn(e){return this.pn({kind:"ip",...b.At(e)})}An(e){return this.pn({kind:"cidr",...b.At(e)})}_n(e){return"string"==typeof e?this.pn({kind:"datetime",precision:null,offset:!1,un:!1,message:e}):this.pn({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,un:e?.un??!1,...b.At(e?.message)})}F(e){return this.pn({kind:"date",message:e})}time(e){return"string"==typeof e?this.pn({kind:"time",precision:null,message:e}):this.pn({kind:"time",precision:void 0===e?.precision?null:e?.precision,...b.At(e?.message)})}duration(e){return this.pn({kind:"duration",...b.At(e)})}ln(e,t){return this.pn({kind:"regex",ln:e,...b.At(t)})}includes(e,t){return this.pn({kind:"includes",value:e,position:t?.position,...b.At(t?.message)})}startsWith(e,t){return this.pn({kind:"startsWith",value:e,...b.At(t)})}endsWith(e,t){return this.pn({kind:"endsWith",value:e,...b.At(t)})}min(e,t){return this.pn({kind:"min",value:e,...b.At(t)})}max(e,t){return this.pn({kind:"max",value:e,...b.At(t)})}length(e,t){return this.pn({kind:"length",value:e,...b.At(t)})}Zn(e){return this.min(1,b.At(e))}trim(){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:"trim"}]})}toLowerCase(){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:"toUpperCase"}]})}get $n(){return!!this.Ft.hn.find(e=>"datetime"===e.kind)}get En(){return!!this.Ft.hn.find(e=>"date"===e.kind)}get In(){return!!this.Ft.hn.find(e=>"time"===e.kind)}get Tn(){return!!this.Ft.hn.find(e=>"duration"===e.kind)}get Mn(){return!!this.Ft.hn.find(e=>"email"===e.kind)}get Sn(){return!!this.Ft.hn.find(e=>"url"===e.kind)}get Fn(){return!!this.Ft.hn.find(e=>"emoji"===e.kind)}get Dn(){return!!this.Ft.hn.find(e=>"uuid"===e.kind)}get Bn(){return!!this.Ft.hn.find(e=>"nanoid"===e.kind)}get On(){return!!this.Ft.hn.find(e=>"cuid"===e.kind)}get Pn(){return!!this.Ft.hn.find(e=>"cuid2"===e.kind)}get jn(){return!!this.Ft.hn.find(e=>"ulid"===e.kind)}get Cn(){return!!this.Ft.hn.find(e=>"ip"===e.kind)}get Un(){return!!this.Ft.hn.find(e=>"cidr"===e.kind)}get Ln(){return!!this.Ft.hn.find(e=>"base64"===e.kind)}get zn(){return!!this.Ft.hn.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.values?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}ne.create=e=>new ne({hn:[],Jt:qe.ZodString,M:e?.M??!1,...M(e)});var ie=class e extends F{constructor(){super(...arguments),this.min=this.Vn,this.max=this.Rn,this.step=this.ct}Ut(e){if(this.Ft.M&&(e.data=Number(e.data)),this.Dt(e)!==o.number){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.number,ze:t.Ot}),k}let t;const n=new w;for(const i of this.Ft.hn)"int"===i.kind?s.isInteger(e.data)||(t=this.Bt(e,t),g(t,{code:c.Le,Ve:"integer",ze:"float",message:i.message}),n.bt()):"min"===i.kind?(i.nt?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,rt:i.value,type:"number",nt:i.nt,tt:!1,message:i.message}),n.bt()):"multipleOf"===i.kind?0!==se(e.data,i.value)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),n.bt()):"finite"===i.kind?Number.isFinite(e.data)||(t=this.Bt(e,t),g(t,{code:c.dt,message:i.message}),n.bt()):s.we(i);return{status:n.value,value:e.data}}Vn(e,t){return this.Wn("min",e,!0,b.toString(t))}qn(e,t){return this.Wn("min",e,!1,b.toString(t))}Rn(e,t){return this.Wn("max",e,!0,b.toString(t))}Kn(e,t){return this.Wn("max",e,!1,b.toString(t))}Wn(t,n,s,i){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:t,value:n,nt:s,message:b.toString(i)}]})}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}Hn(e){return this.pn({kind:"int",message:b.toString(e)})}Jn(e){return this.pn({kind:"min",value:0,nt:!1,message:b.toString(e)})}negative(e){return this.pn({kind:"max",value:0,nt:!1,message:b.toString(e)})}Yn(e){return this.pn({kind:"max",value:0,nt:!0,message:b.toString(e)})}Gn(e){return this.pn({kind:"min",value:0,nt:!0,message:b.toString(e)})}ct(e,t){return this.pn({kind:"multipleOf",value:e,message:b.toString(t)})}Qn(e){return this.pn({kind:"finite",message:b.toString(e)})}Xn(e){return this.pn({kind:"min",nt:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)}).pn({kind:"max",nt:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&s.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this.Ft.hn){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.valuenew ie({hn:[],Jt:qe.ZodNumber,M:e?.M||!1,...M(e)});var re=class e extends F{constructor(){super(...arguments),this.min=this.Vn,this.max=this.Rn}Ut(e){if(this.Ft.M)try{e.data=BigInt(e.data)}catch{return this.ts(e)}if(this.Dt(e)!==o.I)return this.ts(e);let t;const n=new w;for(const i of this.Ft.hn)"min"===i.kind?(i.nt?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,type:"bigint",rt:i.value,nt:i.nt,message:i.message}),n.bt()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),n.bt()):s.we(i);return{status:n.value,value:e.data}}ts(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.I,ze:t.Ot}),k}Vn(e,t){return this.Wn("min",e,!0,b.toString(t))}qn(e,t){return this.Wn("min",e,!1,b.toString(t))}Rn(e,t){return this.Wn("max",e,!0,b.toString(t))}Kn(e,t){return this.Wn("max",e,!1,b.toString(t))}Wn(t,n,s,i){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:t,value:n,nt:s,message:b.toString(i)}]})}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}Jn(e){return this.pn({kind:"min",value:BigInt(0),nt:!1,message:b.toString(e)})}negative(e){return this.pn({kind:"max",value:BigInt(0),nt:!1,message:b.toString(e)})}Yn(e){return this.pn({kind:"max",value:BigInt(0),nt:!0,message:b.toString(e)})}Gn(e){return this.pn({kind:"min",value:BigInt(0),nt:!0,message:b.toString(e)})}ct(e,t){return this.pn({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.valuenew re({hn:[],Jt:qe.ZodBigInt,M:e?.M??!1,...M(e)});var ae=class extends F{Ut(e){if(this.Ft.M&&(e.data=Boolean(e.data)),this.Dt(e)!==o.T){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.T,ze:t.Ot}),k}return A(e.data)}};ae.create=e=>new ae({Jt:qe.ZodBoolean,M:e?.M||!1,...M(e)});var oe=class e extends F{Ut(e){if(this.Ft.M&&(e.data=new Date(e.data)),this.Dt(e)!==o.F){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.F,ze:t.Ot}),k}if(Number.isNaN(e.data.getTime()))return g(this.Bt(e),{code:c.Ge}),k;const t=new w;let n;for(const i of this.Ft.hn)"min"===i.kind?e.data.getTime()i.value&&(n=this.Bt(e,n),g(n,{code:c.it,message:i.message,nt:!0,tt:!1,rt:i.value,type:"date"}),t.bt()):s.we(i);return{status:t.value,value:new Date(e.data.getTime())}}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}min(e,t){return this.pn({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this.pn({kind:"max",value:e.getTime(),message:b.toString(t)})}get ns(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get ss(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.valuenew oe({hn:[],M:e?.M||!1,Jt:qe.ZodDate,...M(e)});var ue=class extends F{Ut(e){if(this.Dt(e)!==o.me){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.me,ze:t.Ot}),k}return A(e.data)}};ue.create=e=>new ue({Jt:qe.ZodSymbol,...M(e)});var ce=class extends F{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.undefined,ze:t.Ot}),k}return A(e.data)}};ce.create=e=>new ce({Jt:qe.ZodUndefined,...M(e)});var de=class extends F{Ut(e){if(this.Dt(e)!==o.null){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.null,ze:t.Ot}),k}return A(e.data)}};de.create=e=>new de({Jt:qe.ZodNull,...M(e)});var he=class extends F{constructor(){super(...arguments),this.rs=!0}Ut(e){return A(e.data)}};he.create=e=>new he({Jt:qe.ZodAny,...M(e)});var le=class extends F{constructor(){super(...arguments),this.us=!0}Ut(e){return A(e.data)}};le.create=e=>new le({Jt:qe.ZodUnknown,...M(e)});var me=class extends F{Ut(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ee,ze:t.Ot}),k}};me.create=e=>new me({Jt:qe.ZodNever,...M(e)});var pe=class extends F{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ge,ze:t.Ot}),k}return A(e.data)}};pe.create=e=>new pe({Jt:qe.ZodVoid,...M(e)});var fe=class e extends F{Ut(e){const{jt:t,status:n}=this.Pt(e),s=this.Ft;if(t.Ot!==o.$)return g(t,{code:c.Le,Ve:o.$,ze:t.Ot}),k;if(null!==s.cs){const e=t.data.length>s.cs.value,i=t.data.lengths.maxLength.value&&(g(t,{code:c.it,rt:s.maxLength.value,type:"array",nt:!0,tt:!1,message:s.maxLength.message}),n.bt()),t.yt.async)return Promise.all([...t.data].map((e,n)=>s.type.Lt(new I(t,e,t.path,n)))).then(e=>w.xt(n,e));const i=[...t.data].map((e,n)=>s.type.Ct(new I(t,e,t.path,n)));return w.xt(n,i)}get element(){return this.Ft.type}min(t,n){return new e({...this.Ft,minLength:{value:t,message:b.toString(n)}})}max(t,n){return new e({...this.Ft,maxLength:{value:t,message:b.toString(n)}})}length(t,n){return new e({...this.Ft,cs:{value:t,message:b.toString(n)}})}Zn(e){return this.min(1,e)}};function ve(e){if(e instanceof ye){const t={};for(const n in e.shape){const s=e.shape[n];t[n]=Be.create(ve(s))}return new ye({...e.Ft,shape:()=>t})}return e instanceof fe?new fe({...e.Ft,type:ve(e.element)}):e instanceof Be?Be.create(ve(e.ds())):e instanceof Oe?Oe.create(ve(e.ds())):e instanceof Ne?Ne.create(e.items.map(e=>ve(e))):e}fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,cs:null,Jt:qe.ZodArray,...M(t)});var ye=class e extends F{constructor(){super(...arguments),this.hs=null,this.ls=this.ps,this.fs=this.extend}vs(){if(null!==this.hs)return this.hs;const e=this.Ft.shape(),t=s.Ae(e);return this.hs={shape:e,keys:t},this.hs}Ut(e){if(this.Dt(e)!==o.object){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k}const{status:t,jt:n}=this.Pt(e),{shape:s,keys:i}=this.vs(),r=[];if(!(this.Ft.ys instanceof me&&"strip"===this.Ft.gs))for(const e in n.data)i.includes(e)||r.push(e);const a=[];for(const e of i){const t=s[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t.Ut(new I(n,i,n.path,e)),Nt:e in n.data})}if(this.Ft.ys instanceof me){const e=this.Ft.gs;if("passthrough"===e)for(const e of r)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)r.length>0&&(g(n,{code:c.We,keys:r}),t.bt());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this.Ft.ys;for(const t of r){const s=n.data[t];a.push({key:{status:"valid",value:t},value:e.Ut(new I(n,s,n.path,t)),Nt:t in n.data})}}return n.yt.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const n=await t.key,s=await t.value;e.push({key:n,value:s,Nt:t.Nt})}return e}).then(e=>w.kt(t,e)):w.kt(t,a)}get shape(){return this.Ft.shape()}bs(t){return b.At,new e({...this.Ft,gs:"strict",...void 0!==t?{Tt:(e,n)=>{const s=this.Ft.Tt?.(e,n).message??n.ht;return"unrecognized_keys"===e.code?{message:b.At(t).message??s}:{message:s}}}:{}})}xs(){return new e({...this.Ft,gs:"strip"})}ps(){return new e({...this.Ft,gs:"passthrough"})}extend(t){return new e({...this.Ft,shape:()=>({...this.Ft.shape(),...t})})}ws(t){return new e({gs:t.Ft.gs,ys:t.Ft.ys,shape:()=>({...this.Ft.shape(),...t.Ft.shape()}),Jt:qe.ZodObject})}ks(e,t){return this.fs({[e]:t})}ys(t){return new e({...this.Ft,ys:t})}Ns(t){const n={};for(const e of s.Ae(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this.Ft,shape:()=>n})}As(t){const n={};for(const e of s.Ae(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this.Ft,shape:()=>n})}_s(){return ve(this)}Zs(t){const n={};for(const e of s.Ae(this.shape)){const s=this.shape[e];t&&!t[e]?n[e]=s:n[e]=s.re()}return new e({...this.Ft,shape:()=>n})}required(t){const n={};for(const e of s.Ae(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Be;)t=t.Ft.rn;n[e]=t}return new e({...this.Ft,shape:()=>n})}$s(){return Te(s.Ae(this.shape))}};ye.create=(e,t)=>new ye({shape:()=>e,gs:"strip",ys:me.create(),Jt:qe.ZodObject,...M(t)}),ye.Es=(e,t)=>new ye({shape:()=>e,gs:"strict",ys:me.create(),Jt:qe.ZodObject,...M(t)}),ye.Is=(e,t)=>new ye({shape:e,gs:"strip",ys:me.create(),Jt:qe.ZodObject,...M(t)});var ge=class extends F{Ut(e){const{jt:t}=this.Pt(e),n=this.Ft.options;if(t.yt.async)return Promise.all(n.map(async e=>{const n={...t,yt:{...t.yt,Te:[]},parent:null};return{result:await e.Lt({data:t.data,path:t.path,parent:n}),jt:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.yt.Te.push(...n.jt.yt.Te),n.result;const n=e.map(e=>new h(e.jt.yt.Te));return g(t,{code:c.qe,De:n}),k});{let e;const s=[];for(const i of n){const n={...t,yt:{...t.yt,Te:[]},parent:null},r=i.Ct({data:t.data,path:t.path,parent:n});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,jt:n}),n.yt.Te.length&&s.push(n.yt.Te)}if(e)return t.yt.Te.push(...e.jt.yt.Te),e.result;const i=s.map(e=>new h(e));return g(t,{code:c.qe,De:i}),k}}get options(){return this.Ft.options}};ge.create=(e,t)=>new ge({options:e,Jt:qe.ZodUnion,...M(t)});var be=e=>e instanceof Ee?be(e.Ht):e instanceof De?be(e.rn()):e instanceof Ie?[e.value]:e instanceof Me?e.options:e instanceof Se?s._e(e.P):e instanceof Pe?be(e.Ft.rn):e instanceof ce?[void 0]:e instanceof de?[null]:e instanceof Be?[void 0,...be(e.ds())]:e instanceof Oe?[null,...be(e.ds())]:e instanceof Le||e instanceof Ve?be(e.ds()):e instanceof je?be(e.Ft.rn):[],xe=class e extends F{Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.object)return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k;const n=this.Ts,s=t.data[n],i=this.Ms.get(s);return i?t.yt.async?i.Lt({data:t.data,path:t.path,parent:t}):i.Ct({data:t.data,path:t.path,parent:t}):(g(t,{code:c.Ke,options:Array.from(this.Ms.keys()),path:[n]}),k)}get Ts(){return this.Ft.Ts}get options(){return this.Ft.options}get Ms(){return this.Ft.Ms}static create(t,n,s){const i=new Map;for(const e of n){const n=be(e.shape[t]);if(!n.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of n){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,e)}}return new e({Jt:qe.ZodDiscriminatedUnion,Ts:t,options:n,Ms:i,...M(s)})}};function we(e,t){const n=u(e),i=u(t);if(e===t)return{valid:!0,data:e};if(n===o.object&&i===o.object){const n=s.Ae(t),i=s.Ae(e).filter(e=>-1!==n.indexOf(e)),r={...e,...t};for(const n of i){const s=we(e[n],t[n]);if(!s.valid)return{valid:!1};r[n]=s.data}return{valid:!0,data:r}}if(n===o.$&&i===o.$){if(e.length!==t.length)return{valid:!1};const n=[];for(let s=0;s{if(_(e)||_(s))return k;const i=we(e.value,s.value);return i.valid?((Z(e)||Z(s))&&t.bt(),{status:t.value,value:i.data}):(g(n,{code:c.ot}),k)};return n.yt.async?Promise.all([this.Ft.left.Lt({data:n.data,path:n.path,parent:n}),this.Ft.right.Lt({data:n.data,path:n.path,parent:n})]).then(([e,t])=>s(e,t)):s(this.Ft.left.Ct({data:n.data,path:n.path,parent:n}),this.Ft.right.Ct({data:n.data,path:n.path,parent:n}))}};ke.create=(e,t,n)=>new ke({left:e,right:t,Jt:qe.ZodIntersection,...M(n)});var Ne=class e extends F{Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.$)return g(n,{code:c.Le,Ve:o.$,ze:n.Ot}),k;if(n.data.lengththis.Ft.items.length&&(g(n,{code:c.it,rt:this.Ft.items.length,nt:!0,tt:!1,type:"array"}),t.bt());const s=[...n.data].map((e,t)=>{const s=this.Ft.items[t]||this.Ft.Ss;return s?s.Ut(new I(n,e,n.path,t)):null}).filter(e=>!!e);return n.yt.async?Promise.all(s).then(e=>w.xt(t,e)):w.xt(t,s)}get items(){return this.Ft.items}Ss(t){return new e({...this.Ft,Ss:t})}};Ne.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ne({items:e,Jt:qe.ZodTuple,Ss:null,...M(t)})};var Ae=class e extends F{get Fs(){return this.Ft.Ds}get Bs(){return this.Ft.valueType}Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.object)return g(n,{code:c.Le,Ve:o.object,ze:n.Ot}),k;const s=[],i=this.Ft.Ds,r=this.Ft.valueType;for(const e in n.data)s.push({key:i.Ut(new I(n,e,n.path,e)),value:r.Ut(new I(n,n.data[e],n.path,e)),Nt:e in n.data});return n.yt.async?w.wt(t,s):w.kt(t,s)}get element(){return this.Ft.valueType}static create(t,n,s){return new e(n instanceof F?{Ds:t,valueType:n,Jt:qe.ZodRecord,...M(s)}:{Ds:ne.create(),valueType:t,Jt:qe.ZodRecord,...M(n)})}},_e=class extends F{get Fs(){return this.Ft.Ds}get Bs(){return this.Ft.valueType}Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.map)return g(n,{code:c.Le,Ve:o.map,ze:n.Ot}),k;const s=this.Ft.Ds,i=this.Ft.valueType,r=[...n.data.entries()].map(([e,t],r)=>({key:s.Ut(new I(n,e,n.path,[r,"key"])),value:i.Ut(new I(n,t,n.path,[r,"value"]))}));if(n.yt.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of r){const s=await n.key,i=await n.value;if("aborted"===s.status||"aborted"===i.status)return k;"dirty"!==s.status&&"dirty"!==i.status||t.bt(),e.set(s.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of r){const s=n.key,i=n.value;if("aborted"===s.status||"aborted"===i.status)return k;"dirty"!==s.status&&"dirty"!==i.status||t.bt(),e.set(s.value,i.value)}return{status:t.value,value:e}}}};_e.create=(e,t,n)=>new _e({valueType:t,Ds:e,Jt:qe.ZodMap,...M(n)});var Ze=class e extends F{Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.set)return g(n,{code:c.Le,Ve:o.set,ze:n.Ot}),k;const s=this.Ft;null!==s.Os&&n.data.sizes.Ps.value&&(g(n,{code:c.it,rt:s.Ps.value,type:"set",nt:!0,tt:!1,message:s.Ps.message}),t.bt());const i=this.Ft.valueType;function r(e){const n=new Set;for(const s of e){if("aborted"===s.status)return k;"dirty"===s.status&&t.bt(),n.add(s.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map((e,t)=>i.Ut(new I(n,e,n.path,t)));return n.yt.async?Promise.all(a).then(e=>r(e)):r(a)}min(t,n){return new e({...this.Ft,Os:{value:t,message:b.toString(n)}})}max(t,n){return new e({...this.Ft,Ps:{value:t,message:b.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}Zn(e){return this.min(1,e)}};Ze.create=(e,t)=>new Ze({valueType:e,Os:null,Ps:null,Jt:qe.ZodSet,...M(t)});var $e=class e extends F{constructor(){super(...arguments),this.validate=this.js}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.j)return g(t,{code:c.Le,Ve:o.j,ze:t.Ot}),k;function n(e,n){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Je,Oe:n}})}function s(e,n){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Ye,Be:n}})}const i={Tt:t.yt.vt},r=t.data;if(this.Ft.Cs instanceof Fe){const e=this;return A(async function(...t){const a=new h([]),o=await e.Ft.Us.Vt(t,i).catch(e=>{throw a.Me(n(t,e)),a}),u=await Reflect.apply(r,this,o);return await e.Ft.Cs.Ft.type.Vt(u,i).catch(e=>{throw a.Me(s(u,e)),a})})}{const e=this;return A(function(...t){const a=e.Ft.Us.zt(t,i);if(!a.Et)throw new h([n(t,a.error)]);const o=Reflect.apply(r,this,a.data),u=e.Ft.Cs.zt(o,i);if(!u.Et)throw new h([s(o,u.error)]);return u.data})}}parameters(){return this.Ft.Us}Ls(){return this.Ft.Cs}Us(...t){return new e({...this.Ft,Us:Ne.create(t).Ss(le.create())})}Cs(t){return new e({...this.Ft,Cs:t})}js(e){return this.parse(e)}zs(e){return this.parse(e)}static create(t,n,s){return new e({Us:t||Ne.create([]).Ss(le.create()),Cs:n||le.create(),Jt:qe.ZodFunction,...M(s)})}},Ee=class extends F{get Ht(){return this.Ft.Vs()}Ut(e){const{jt:t}=this.Pt(e);return this.Ft.Vs().Ut({data:t.data,path:t.path,parent:t})}};Ee.create=(e,t)=>new Ee({Vs:e,Jt:qe.ZodLazy,...M(t)});var Ie=class extends F{Ut(e){if(e.data!==this.Ft.value){const t=this.Bt(e);return g(t,{ze:t.data,code:c.Re,Ve:this.Ft.value}),k}return{status:"valid",value:e.data}}get value(){return this.Ft.value}};function Te(e,t){return new Me({values:e,Jt:qe.ZodEnum,...M(t)})}Ie.create=(e,t)=>new Ie({value:e,Jt:qe.ZodLiteral,...M(t)});var Me=class e extends F{Ut(e){if("string"!=typeof e.data){const t=this.Bt(e),n=this.Ft.values;return g(t,{Ve:s.Ze(n),ze:t.Ot,code:c.Le}),k}if(this.Rs||(this.Rs=new Set(this.Ft.values)),!this.Rs.has(e.data)){const t=this.Bt(e),n=this.Ft.values;return g(t,{ze:t.data,code:c.He,options:n}),k}return A(e.data)}get options(){return this.Ft.values}get P(){const e={};for(const t of this.Ft.values)e[t]=t;return e}get Ws(){const e={};for(const t of this.Ft.values)e[t]=t;return e}get qs(){const e={};for(const t of this.Ft.values)e[t]=t;return e}Ks(t,n=this.Ft){return e.create(t,{...this.Ft,...n})}Hs(t,n=this.Ft){return e.create(this.options.filter(e=>!t.includes(e)),{...this.Ft,...n})}};Me.create=Te;var Se=class extends F{Ut(e){const t=s.Ne(this.Ft.values),n=this.Bt(e);if(n.Ot!==o.string&&n.Ot!==o.number){const e=s._e(t);return g(n,{Ve:s.Ze(e),ze:n.Ot,code:c.Le}),k}if(this.Rs||(this.Rs=new Set(s.Ne(this.Ft.values))),!this.Rs.has(e.data)){const e=s._e(t);return g(n,{ze:n.data,code:c.He,options:e}),k}return A(e.data)}get P(){return this.Ft.values}};Se.create=(e,t)=>new Se({values:e,Jt:qe.ZodNativeEnum,...M(t)});var Fe=class extends F{ds(){return this.Ft.type}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.promise&&!1===t.yt.async)return g(t,{code:c.Le,Ve:o.promise,ze:t.Ot}),k;const n=t.Ot===o.promise?t.data:Promise.resolve(t.data);return A(n.then(e=>this.Ft.type.Vt(e,{path:t.path,Tt:t.yt.vt})))}};Fe.create=(e,t)=>new Fe({type:e,Jt:qe.ZodPromise,...M(t)});var De=class extends F{rn(){return this.Ft.Ht}Js(){return this.Ft.Ht.Ft.Jt===qe.ZodEffects?this.Ft.Ht.Js():this.Ft.Ht}Ut(e){const{status:t,jt:n}=this.Pt(e),i=this.Ft.effect||null,r={Me:e=>{g(n,e),e.fatal?t.abort():t.bt()},get path(){return n.path}};if(r.Me=r.Me.bind(r),"preprocess"===i.type){const e=i.transform(n.data,r);if(n.yt.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return k;const s=await this.Ft.Ht.Lt({data:e,path:n.path,parent:n});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?N(s.value):s});{if("aborted"===t.value)return k;const s=this.Ft.Ht.Ct({data:e,path:n.path,parent:n});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?N(s.value):s}}if("refinement"===i.type){const e=e=>{const t=i.Kt(e,r);if(n.yt.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.yt.async){const s=this.Ft.Ht.Ct({data:n.data,path:n.path,parent:n});return"aborted"===s.status?k:("dirty"===s.status&&t.bt(),e(s.value),{status:t.value,value:s.value})}return this.Ft.Ht.Lt({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?k:("dirty"===n.status&&t.bt(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===i.type){if(!1===n.yt.async){const e=this.Ft.Ht.Ct({data:n.data,path:n.path,parent:n});if(!$(e))return k;const s=i.transform(e.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this.Ft.Ht.Lt({data:n.data,path:n.path,parent:n}).then(e=>$(e)?Promise.resolve(i.transform(e.value,r)).then(e=>({status:t.value,value:e})):k)}s.we(i)}};De.create=(e,t,n)=>new De({Ht:e,Jt:qe.ZodEffects,effect:t,...M(n)}),De.Ys=(e,t,n)=>new De({Ht:t,effect:{type:"preprocess",transform:e},Jt:qe.ZodEffects,...M(n)});var Be=class extends F{Ut(e){return this.Dt(e)===o.undefined?A(void 0):this.Ft.rn.Ut(e)}ds(){return this.Ft.rn}};Be.create=(e,t)=>new Be({rn:e,Jt:qe.ZodOptional,...M(t)});var Oe=class extends F{Ut(e){return this.Dt(e)===o.null?A(null):this.Ft.rn.Ut(e)}ds(){return this.Ft.rn}};Oe.create=(e,t)=>new Oe({rn:e,Jt:qe.ZodNullable,...M(t)});var Pe=class extends F{Ut(e){const{jt:t}=this.Pt(e);let n=t.data;return t.Ot===o.undefined&&(n=this.Ft.defaultValue()),this.Ft.rn.Ut({data:n,path:t.path,parent:t})}Gs(){return this.Ft.rn}};Pe.create=(e,t)=>new Pe({rn:e,Jt:qe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...M(t)});var je=class extends F{Ut(e){const{jt:t}=this.Pt(e),n={...t,yt:{...t.yt,Te:[]}},s=this.Ft.rn.Ut({data:n.data,path:n.path,parent:{...n}});return E(s)?s.then(e=>({status:"valid",value:"valid"===e.status?e.value:this.Ft.an({get error(){return new h(n.yt.Te)},input:n.data})})):{status:"valid",value:"valid"===s.status?s.value:this.Ft.an({get error(){return new h(n.yt.Te)},input:n.data})}}Qs(){return this.Ft.rn}};je.create=(e,t)=>new je({rn:e,Jt:qe.ZodCatch,an:"function"==typeof t.catch?t.catch:()=>t.catch,...M(t)});var Ce=class extends F{Ut(e){if(this.Dt(e)!==o.G){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.G,ze:t.Ot}),k}return{status:"valid",value:e.data}}};Ce.create=e=>new Ce({Jt:qe.ZodNaN,...M(e)});var Ue=Symbol("zod_brand"),Le=class extends F{Ut(e){const{jt:t}=this.Pt(e),n=t.data;return this.Ft.type.Ut({data:n,path:t.path,parent:t})}ds(){return this.Ft.type}},ze=class e extends F{Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.yt.async)return(async()=>{const e=await this.Ft.in.Lt({data:n.data,path:n.path,parent:n});return"aborted"===e.status?k:"dirty"===e.status?(t.bt(),N(e.value)):this.Ft.Xs.Lt({data:e.value,path:n.path,parent:n})})();{const e=this.Ft.in.Ct({data:n.data,path:n.path,parent:n});return"aborted"===e.status?k:"dirty"===e.status?(t.bt(),{status:"dirty",value:e.value}):this.Ft.Xs.Ct({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,Xs:n,Jt:qe.ZodPipeline})}},Ve=class extends F{Ut(e){const t=this.Ft.rn.Ut(e),n=e=>($(e)&&(e.value=Object.freeze(e.value)),e);return E(t)?t.then(e=>n(e)):n(t)}ds(){return this.Ft.rn}};function Re(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function We(e,t={},n){return e?he.create().Yt((s,i)=>{const r=e(s);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Re(t,s),r=e.fatal??n??!0;i.Me({code:"custom",...e,fatal:r})}});if(!r){const e=Re(t,s),r=e.fatal??n??!0;i.Me({code:"custom",...e,fatal:r})}}):he.create()}Ve.create=(e,t)=>new Ve({rn:e,Jt:qe.ZodReadonly,...M(t)});var qe,Ke,He={object:ye.Is};(Ke=qe||(qe={})).ZodString="ZodString",Ke.ZodNumber="ZodNumber",Ke.ZodNaN="ZodNaN",Ke.ZodBigInt="ZodBigInt",Ke.ZodBoolean="ZodBoolean",Ke.ZodDate="ZodDate",Ke.ZodSymbol="ZodSymbol",Ke.ZodUndefined="ZodUndefined",Ke.ZodNull="ZodNull",Ke.ZodAny="ZodAny",Ke.ZodUnknown="ZodUnknown",Ke.ZodNever="ZodNever",Ke.ZodVoid="ZodVoid",Ke.ZodArray="ZodArray",Ke.ZodObject="ZodObject",Ke.ZodUnion="ZodUnion",Ke.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ke.ZodIntersection="ZodIntersection",Ke.ZodTuple="ZodTuple",Ke.ZodRecord="ZodRecord",Ke.ZodMap="ZodMap",Ke.ZodSet="ZodSet",Ke.ZodFunction="ZodFunction",Ke.ZodLazy="ZodLazy",Ke.ZodLiteral="ZodLiteral",Ke.ZodEnum="ZodEnum",Ke.ZodEffects="ZodEffects",Ke.ZodNativeEnum="ZodNativeEnum",Ke.ZodOptional="ZodOptional",Ke.ZodNullable="ZodNullable",Ke.ZodDefault="ZodDefault",Ke.ZodCatch="ZodCatch",Ke.ZodPromise="ZodPromise",Ke.ZodBranded="ZodBranded",Ke.ZodPipeline="ZodPipeline",Ke.ZodReadonly="ZodReadonly";var Je=(e,t={message:`Input not instance of ${e.name}`})=>We(t=>t instanceof e,t),Ye=ne.create,Ge=ie.create,Qe=Ce.create,Xe=re.create,et=ae.create,tt=oe.create,nt=ue.create,st=ce.create,it=de.create,rt=he.create,at=le.create,ot=me.create,ut=pe.create,ct=fe.create,dt=ye.create,ht=ye.Es,lt=ge.create,mt=xe.create,pt=ke.create,ft=Ne.create,vt=Ae.create,yt=_e.create,gt=Ze.create,bt=$e.create,xt=Ee.create,wt=Ie.create,kt=Me.create,Nt=Se.create,At=Fe.create,_t=De.create,Zt=Be.create,$t=Oe.create,Et=De.Ys,It=ze.create,Tt=()=>Ye().re(),Mt=()=>Ge().re(),St=()=>et().re(),Ft={string:e=>ne.create({...e,M:!0}),number:e=>ie.create({...e,M:!0}),T:e=>ae.create({...e,M:!0}),I:e=>re.create({...e,M:!0}),F:e=>oe.create({...e,M:!0})},Dt=k,Bt=a,Ot=Bt.object({ei:Bt.object({ti:Bt.string(),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re()}),ii:Bt.object({name:Bt.string(),ri:Bt.string()}).re(),ai:Bt.$(Bt.object({name:Bt.string().re(),enabled:Bt.T(),coords:Bt.object({oi:Bt.number(),ui:Bt.number(),px:Bt.number(),ci:Bt.number()}),sources:Bt.$(Bt.string()),di:Bt.number().re(),animation:Bt.object({hi:Bt.number().re(),li:Bt.number().re(),frameCount:Bt.number().re(),mi:Bt.number().re(),pi:Bt.number().re(),fi:Bt.number().re(),yi:Bt.number().re(),startTime:Bt.number().re(),looping:Bt.T().re()}).re(),uuid:Bt.string()})),gi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()})),bi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()}))}),Pt=Bt.object({name:Bt.string().re(),coords:Bt.$(Bt.number()),xi:Bt.number().re(),enabled:Bt.T(),wi:Bt.string().re(),uuid:Bt.string()}),jt=Bt.object({name:Bt.string().re(),url:Bt.string(),ki:Bt.$(Bt.object({xi:Bt.number().re(),uuid:Bt.string()})).re()}),Ct=Bt.object({ti:Bt.string(),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re(),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),ai:Bt.$(Pt),links:Bt.$(jt).re()}),Ut=document.querySelector("#bm-manage-templates table");Ut&&"TABLE"===Ut.nodeName.toLocaleUpperCase()&&(Ut=Ut.children[0])&&"BM"===Vt.getType()&&Vt.get().ai.forEach((e,t)=>{const s=n("tr",{id:"main-row"}),i=n("td",{textContent:t.toString()}),r=n("td",{textContent:e.name||"unnamed-0"}),a=document.createElement("td"),o=n("button",{id:"enable"});a.appendChild(o);const u=document.createElement("td"),c=n("button",{id:"exportAdd"});u.appendChild(c);const d=document.createElement("td"),h=n("div",{className:"shifts-container"}),l=n("button",{id:"up"}),m=n("button",{id:"down"});h.append(l,m),d.appendChild(h),s.append(i,r,a,u,d)});var Lt={"bm-create-template":"flex","bm-main-overlay":"flex","bm-manage-links":"flex","bm-manage-templates":"flex"},zt=document.createElement("style");zt.textContent="",document.body.appendChild(zt),document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n
\n
\n
\n

Create new template

\n \n
\n
\n
\n \n
\n \n \n \n \n \n
\n
\n

Drag and drop an image here

\n

-- or --

\n \n
\n
\n \n
\n
',document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n
\n
\n
\n

Blue Marble

\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
Name:
Droplets:
Next level in...
\n
\n \n \n
\n
\n

Made by SwingTheVine

\n
\n\n',document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n ',document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n
\n
\n
\n

Template manager

\n \n
\n
\n \n \n \n
\n \n \n \n \n \n \n \x3c!--list of templates goes here--\x3e\n
\n #\n \n \n Name\n \n Enabled\n \n Export\n
\n
\n \n
';var Vt=new class{constructor(e){t(this,"object"),t(this,"type"),this.object=e,e&&(Ot.zt(e).Et?this.type="CHA":Ct.zt(e).Et?this.type="BM":this.type="N/A")}update(e){if(Ct.zt(e).Et)this.type="BM";else{if(!Ot.zt(e).Et)return;this.type="CHA"}this.object=e}get(){return this.object}getType(){return this.type}Ni(){"N/A"!==this.type&&"CHA"!==this.type&&("BM"===this.type&&(this.object=this.object,this.object={ei:{ti:"Charity",ni:"0.1.0",si:this.object.si},ai:this.object.ai.map(e=>({name:e.name,enabled:e.enabled||!1,coords:{oi:e.coords[0],ui:e.coords[1],px:e.coords[2],ci:e.coords[3]},sources:[e.wi||""],di:e.xi,uuid:e.uuid})),gi:[],bi:[]}),this.type="CHA")}Ai(){"N/A"!==this.type&&"BM"!==this.type&&("CHA"===this.type&&(this.object=this.object,this.object={ti:"BlueMarble",ni:"0.1.0",si:this.object.ei.si,ai:this.object.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,wi:e.sources[0],uuid:e.uuid}))}),this.type="BM")}appendData(e){"BM"===this.type&&(this.object=this.object,Ot.parse(e)?this.object.ai.push(...e.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,wi:e.sources[0],uuid:e.uuid}))):Ct.parse(e)&&(this.object.ai.push(...e.ai),this.object.links?e.links&&this.object.links.push(...e.links):this.object.links=e.links))}Zi(e){"BM"===this.type&&this.object.ai.push(e)}$i(e){"BM"===this.type&&(this.object=this.object,this.object.links?this.object.links.push(e):this.object.links=[e])}Ei(e,t){if("N/A"===this.type)return null;if(this.object.hasOwnProperty("links")){const n=this.object;return{...n,ai:e?e.map(e=>!!(Number.isInteger(e)&&e>=0&&n.ai.length!!(Number.isInteger(e)&&e>=0&&n.links.length!!(Number.isInteger(e)&&e>=0&&n.ai.length{console.log("test"),console.log("test")})}()})(); \ No newline at end of file +(()=>{var e=Object.defineProperty,t=(t,s,n)=>((t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n)(t,"symbol"!=typeof s?s+"":s,n);function s(e,t){const s=document.createElement(e);return t&&Object.entries(t).forEach(([e,t])=>{"className"===e?s.setAttribute("class",t):s.setAttribute(e,t)}),s}new Blob;var n,i,r,a={};((t,s)=>{for(var n in s)e(t,n,{get:s[n],enumerable:!0})})(a,{t:()=>Ue,i:()=>N,o:()=>y,u:()=>k,NEVER:()=>Dt,OK:()=>A,h:()=>x,l:()=>M,ZodAny:()=>he,ZodArray:()=>fe,ZodBigInt:()=>re,ZodBoolean:()=>ae,ZodBranded:()=>Le,ZodCatch:()=>je,ZodDate:()=>oe,ZodDefault:()=>Pe,ZodDiscriminatedUnion:()=>be,ZodEffects:()=>De,ZodEnum:()=>Te,m:()=>h,p:()=>qe,ZodFunction:()=>$e,ZodIntersection:()=>ke,v:()=>c,ZodLazy:()=>Ie,ZodLiteral:()=>Ee,ZodMap:()=>_e,ZodNaN:()=>Ce,ZodNativeEnum:()=>Se,ZodNever:()=>me,ZodNull:()=>de,ZodNullable:()=>Oe,ZodNumber:()=>ie,ZodObject:()=>ye,ZodOptional:()=>Be,k:()=>o,ZodPipeline:()=>ze,ZodPromise:()=>Me,ZodReadonly:()=>Ve,ZodRecord:()=>Ae,N:()=>M,ZodSet:()=>Ze,ZodString:()=>se,ZodSymbol:()=>ue,A:()=>De,ZodTuple:()=>Ne,_:()=>M,ZodUndefined:()=>ce,ZodUnion:()=>ge,ZodUnknown:()=>le,ZodVoid:()=>pe,Z:()=>g,any:()=>rt,$:()=>ct,I:()=>Xe,F:()=>et,T:()=>Mt,S:()=>We,M:()=>tt,D:()=>Q,B:()=>l,O:()=>mt,effect:()=>_t,P:()=>kt,j:()=>wt,C:()=>f,U:()=>u,L:()=>Je,intersection:()=>pt,V:()=>_,R:()=>I,W:()=>Z,q:()=>$,K:()=>He,H:()=>bt,J:()=>xt,Y:()=>v,map:()=>yt,G:()=>Qe,X:()=>Nt,ee:()=>ot,null:()=>it,te:()=>$t,number:()=>Ge,object:()=>dt,se:()=>r,ne:()=>St,ie:()=>Tt,re:()=>Zt,ae:()=>Ft,oe:()=>Et,ue:()=>It,promise:()=>At,ce:()=>d,de:()=>vt,set:()=>gt,he:()=>p,le:()=>ht,string:()=>Ye,me:()=>st,pe:()=>_t,fe:()=>ft,undefined:()=>nt,union:()=>lt,ve:()=>at,ye:()=>n,ge:()=>ut}),(i=n||(n={})).we=e=>{},i.be=function(e){},i.xe=function(e){throw new Error},i.ke=e=>{const t={};for(const s of e)t[s]=s;return t},i.Ne=e=>{const t=i.Ae(e).filter(t=>"number"!=typeof e[e[t]]),s={};for(const n of t)s[n]=e[n];return i._e(s)},i._e=e=>i.Ae(e).map(function(t){return e[t]}),i.Ae="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},i.find=(e,t)=>{for(const s of e)if(t(s))return s},i.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,i.Ze=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},i.$e=(e,t)=>"bigint"==typeof t?t.toString():t,(r||(r={})).Ie=(e,t)=>({...e,...t});var o=n.ke(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),u=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(e)?o.G:o.number;case"boolean":return o.F;case"function":return o.j;case"bigint":return o.I;case"symbol":return o.me;case"object":return Array.isArray(e)?o.$:null===e?o.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?o.promise:"undefined"!=typeof Map&&e instanceof Map?o.map:"undefined"!=typeof Set&&e instanceof Set?o.set:"undefined"!=typeof Date&&e instanceof Date?o.M:o.object;default:return o.ve}},c=n.ke(["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"]),d=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),h=class e extends Error{get Ee(){return this.Fe}constructor(e){super(),this.Fe=[],this.Te=e=>{this.Fe=[...this.Fe,e]},this.Se=(e=[])=>{this.Fe=[...this.Fe,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.Fe=e}format(e){const t=e||function(e){return e.message},s={Me:[]},n=e=>{for(const i of e.Fe)if("invalid_union"===i.code)i.De.map(n);else if("invalid_return_type"===i.code)n(i.Be);else if("invalid_arguments"===i.code)n(i.Oe);else if(0===i.path.length)s.Me.push(t(i));else{let e=s,n=0;for(;ne.message){const t={},s=[];for(const n of this.Fe)if(n.path.length>0){const s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else s.push(e(n));return{Ce:s,Ue:t}}get Ce(){return this.je()}};h.create=e=>new h(e);var l=(e,t)=>{let s;switch(e.code){case c.Le:s=e.ze===o.undefined?"Required":`Expected ${e.Ve}, received ${e.ze}`;break;case c.Re:s=`Invalid literal value, expected ${JSON.stringify(e.Ve,n.$e)}`;break;case c.We:s=`Unrecognized key(s) in object: ${n.Ze(e.keys,", ")}`;break;case c.qe:s="Invalid input";break;case c.Ke:s=`Invalid discriminator value. Expected ${n.Ze(e.options)}`;break;case c.He:s=`Invalid enum value. Expected ${n.Ze(e.options)}, received '${e.ze}'`;break;case c.Je:s="Invalid function arguments";break;case c.Ye:s="Invalid function return type";break;case c.Ge:s="Invalid date";break;case c.Qe:"object"==typeof e.Xe?"includes"in e.Xe?(s=`Invalid input: must include "${e.Xe.includes}"`,"number"==typeof e.Xe.position&&(s=`${s} at one or more positions greater than or equal to ${e.Xe.position}`)):"startsWith"in e.Xe?s=`Invalid input: must start with "${e.Xe.startsWith}"`:"endsWith"in e.Xe?s=`Invalid input: must end with "${e.Xe.endsWith}"`:n.xe(e.Xe):s="regex"!==e.Xe?`Invalid ${e.Xe}`:"Invalid";break;case c.et:s="array"===e.type?`Array must contain ${e.tt?"exactly":e.st?"at least":"more than"} ${e.nt} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.st?"at least":"over"} ${e.nt} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.tt?"exactly equal to ":e.st?"greater than or equal to ":"greater than "}${e.nt}`:"date"===e.type?`Date must be ${e.tt?"exactly equal to ":e.st?"greater than or equal to ":"greater than "}${new Date(Number(e.nt))}`:"Invalid input";break;case c.it:s="array"===e.type?`Array must contain ${e.tt?"exactly":e.st?"at most":"less than"} ${e.rt} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.st?"at most":"under"} ${e.rt} character(s)`:"number"===e.type?`Number must be ${e.tt?"exactly":e.st?"less than or equal to":"less than"} ${e.rt}`:"bigint"===e.type?`BigInt must be ${e.tt?"exactly":e.st?"less than or equal to":"less than"} ${e.rt}`:"date"===e.type?`Date must be ${e.tt?"exactly":e.st?"smaller than or equal to":"smaller than"} ${new Date(Number(e.rt))}`:"Invalid input";break;case c.S:s="Invalid input";break;case c.ot:s="Intersection results could not be merged";break;case c.ut:s=`Number must be a multiple of ${e.ct}`;break;case c.dt:s="Number must be finite";break;default:s=t.ht,n.xe(e)}return{message:s}},m=l;function p(e){m=e}function f(){return m}var v=e=>{const{data:t,path:s,lt:n,ft:i}=e,r=[...s,...i.path||[]],a={...i,path:r};if(void 0!==i.message)return{...i,path:r,message:i.message};let o="";const u=n.filter(e=>!!e).slice().reverse();for(const e of u)o=e(a,{data:t,ht:o}).message;return{...i,path:r,message:o}},y=[];function g(e,t){const s=f(),n=v({ft:t,data:e.data,path:e.path,lt:[e.yt.vt,e.gt,s,s===l?void 0:l].filter(e=>!!e)});e.yt.Fe.push(n)}var w,b,x=class e{constructor(){this.value="valid"}wt(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static bt(e,t){const s=[];for(const n of t){if("aborted"===n.status)return k;"dirty"===n.status&&e.wt(),s.push(n.value)}return{status:e.value,value:s}}static async xt(t,s){const n=[];for(const e of s){const t=await e.key,s=await e.value;n.push({key:t,value:s})}return e.kt(t,n)}static kt(e,t){const s={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return k;if("aborted"===i.status)return k;"dirty"===t.status&&e.wt(),"dirty"===i.status&&e.wt(),"__proto__"===t.value||void 0===i.value&&!n.Nt||(s[t.value]=i.value)}return{status:e.value,value:s}}},k=Object.freeze({status:"aborted"}),N=e=>({status:"dirty",value:e}),A=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,Z=e=>"dirty"===e.status,$=e=>"valid"===e.status,I=e=>"undefined"!=typeof Promise&&e instanceof Promise;(b=w||(w={})).At=e=>"string"==typeof e?{message:e}:e||{},b.toString=e=>"string"==typeof e?e:e?.message;var E=class{constructor(e,t,s,n){this._t=[],this.parent=e,this.data=t,this.Zt=s,this.$t=n}get path(){return this._t.length||(Array.isArray(this.$t)?this._t.push(...this.Zt,...this.$t):this._t.push(...this.Zt,this.$t)),this._t}},F=(e,t)=>{if($(t))return{It:!0,data:t.value};if(!e.yt.Fe.length)throw new Error("Validation failed but no issues detected.");return{It:!1,get error(){if(this.Et)return this.Et;const t=new h(e.yt.Fe);return this.Et=t,this.Et}}};function T(e){if(!e)return{};const{Ft:t,Tt:s,St:n,description:i}=e;if(t&&(s||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{Ft:t,description:i}:{Ft:(t,i)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??i.ht}:void 0===i.data?{message:r??n??i.ht}:"invalid_type"!==t.code?{message:i.ht}:{message:r??s??i.ht}},description:i}}var S,M=class{get description(){return this.Mt.description}Dt(e){return u(e.data)}Bt(e,t){return t||{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Mt.Ft,path:e.path,parent:e.parent}}Pt(e){return{status:new x,jt:{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Mt.Ft,path:e.path,parent:e.parent}}}Ct(e){const t=this.Ut(e);if(I(t))throw new Error("Synchronous parse encountered promise.");return t}Lt(e){const t=this.Ut(e);return Promise.resolve(t)}parse(e,t){const s=this.zt(e,t);if(s.It)return s.data;throw s.error}zt(e,t){const s={yt:{Fe:[],async:t?.async??!1,vt:t?.Ft},path:t?.path||[],gt:this.Mt.Ft,parent:null,data:e,Ot:u(e)},n=this.Ct({data:e,path:s.path,parent:s});return F(s,n)}"~validate"(e){const t={yt:{Fe:[],async:!!this["~standard"].async},path:[],gt:this.Mt.Ft,parent:null,data:e,Ot:u(e)};if(!this["~standard"].async)try{const s=this.Ct({data:e,path:[],parent:t});return $(s)?{value:s.value}:{Fe:t.yt.Fe}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.yt={Fe:[],async:!0}}return this.Lt({data:e,path:[],parent:t}).then(e=>$(e)?{value:e.value}:{Fe:t.yt.Fe})}async Vt(e,t){const s=await this.Rt(e,t);if(s.It)return s.data;throw s.error}async Rt(e,t){const s={yt:{Fe:[],vt:t?.Ft,async:!0},path:t?.path||[],gt:this.Mt.Ft,parent:null,data:e,Ot:u(e)},n=this.Ut({data:e,path:s.path,parent:s}),i=await(I(n)?n:Promise.resolve(n));return F(s,i)}Wt(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this.qt((t,n)=>{const i=e(t),r=()=>n.Te({code:c.S,...s(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(r(),!1)):!!i||(r(),!1)})}Kt(e,t){return this.qt((s,n)=>!!e(s)||(n.Te("function"==typeof t?t(s,n):t),!1))}qt(e){return new De({Ht:this,Jt:qe.ZodEffects,effect:{type:"refinement",Kt:e}})}Yt(e){return this.qt(e)}constructor(e){this.Gt=this.Rt,this.Mt=e,this.parse=this.parse.bind(this),this.zt=this.zt.bind(this),this.Vt=this.Vt.bind(this),this.Rt=this.Rt.bind(this),this.Gt=this.Gt.bind(this),this.Wt=this.Wt.bind(this),this.Kt=this.Kt.bind(this),this.Yt=this.Yt.bind(this),this.re=this.re.bind(this),this.te=this.te.bind(this),this.Qt=this.Qt.bind(this),this.$=this.$.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.Xt=this.Xt.bind(this),this.es=this.es.bind(this),this.ts=this.ts.bind(this),this.ss=this.ss.bind(this),this.ns=this.ns.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}re(){return Be.create(this,this.Mt)}te(){return Oe.create(this,this.Mt)}Qt(){return this.te().re()}$(){return fe.create(this)}promise(){return Me.create(this,this.Mt)}or(e){return ge.create([this,e],this.Mt)}and(e){return ke.create(this,e,this.Mt)}transform(e){return new De({...T(this.Mt),Ht:this,Jt:qe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Pe({...T(this.Mt),rs:this,defaultValue:t,Jt:qe.ZodDefault})}brand(){return new Le({Jt:qe.ZodBranded,type:this,...T(this.Mt)})}catch(e){const t="function"==typeof e?e:()=>e;return new je({...T(this.Mt),rs:this,us:t,Jt:qe.ZodCatch})}Xt(e){return new(0,this.constructor)({...this.Mt,description:e})}es(e){return ze.create(this,e)}ts(){return Ve.create(this)}ns(){return this.zt(void 0).It}ss(){return this.zt(null).It}},D=/^c[^\s-]{8,}$/i,B=/^[0-9a-z]+$/,O=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[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,j=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,U=/^[-+]?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)?)??$/,L=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,z=/^(?:(?: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])$/,V=/^(?:(?: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])$/,R=/^(([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]))$/,W=/^(([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])$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,H="((\\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])))",J=new RegExp(`^${H}$`);function Y(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function G(e){return new RegExp(`^${Y(e)}$`)}function Q(e){let t=`${H}T${Y(e)}`;const s=[];return s.push(e.cs?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function X(e,t){return!("v4"!==t&&t||!z.test(e))||!("v6"!==t&&t||!R.test(e))}function ee(e,t){if(!C.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(n));return!("object"!=typeof i||null===i||"ds"in i&&"JWT"!==i?.ds||!i.hs||t&&i.hs!==t)}catch{return!1}}function te(e,t){return!("v4"!==t&&t||!V.test(e))||!("v6"!==t&&t||!W.test(e))}var se=class e extends M{Ut(e){if(this.Mt.T&&(e.data=String(e.data)),this.Dt(e)!==o.string){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.string,ze:t.Ot}),k}const t=new x;let s;for(const i of this.Mt.ls)if("min"===i.kind)e.data.lengthi.value&&(s=this.Bt(e,s),g(s,{code:c.it,rt:i.value,type:"string",st:!0,tt:!1,message:i.message}),t.wt());else if("length"===i.kind){const n=e.data.length>i.value,r=e.data.lengthe.test(t),{Xe:t,code:c.Qe,...w.At(s)})}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}email(e){return this.vs({kind:"email",...w.At(e)})}url(e){return this.vs({kind:"url",...w.At(e)})}ys(e){return this.vs({kind:"emoji",...w.At(e)})}uuid(e){return this.vs({kind:"uuid",...w.At(e)})}gs(e){return this.vs({kind:"nanoid",...w.At(e)})}ws(e){return this.vs({kind:"cuid",...w.At(e)})}bs(e){return this.vs({kind:"cuid2",...w.At(e)})}xs(e){return this.vs({kind:"ulid",...w.At(e)})}ks(e){return this.vs({kind:"base64",...w.At(e)})}Ns(e){return this.vs({kind:"base64url",...w.At(e)})}As(e){return this.vs({kind:"jwt",...w.At(e)})}_s(e){return this.vs({kind:"ip",...w.At(e)})}Zs(e){return this.vs({kind:"cidr",...w.At(e)})}$s(e){return"string"==typeof e?this.vs({kind:"datetime",precision:null,offset:!1,cs:!1,message:e}):this.vs({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,cs:e?.cs??!1,...w.At(e?.message)})}M(e){return this.vs({kind:"date",message:e})}time(e){return"string"==typeof e?this.vs({kind:"time",precision:null,message:e}):this.vs({kind:"time",precision:void 0===e?.precision?null:e?.precision,...w.At(e?.message)})}duration(e){return this.vs({kind:"duration",...w.At(e)})}ps(e,t){return this.vs({kind:"regex",ps:e,...w.At(t)})}includes(e,t){return this.vs({kind:"includes",value:e,position:t?.position,...w.At(t?.message)})}startsWith(e,t){return this.vs({kind:"startsWith",value:e,...w.At(t)})}endsWith(e,t){return this.vs({kind:"endsWith",value:e,...w.At(t)})}min(e,t){return this.vs({kind:"min",value:e,...w.At(t)})}max(e,t){return this.vs({kind:"max",value:e,...w.At(t)})}length(e,t){return this.vs({kind:"length",value:e,...w.At(t)})}Is(e){return this.min(1,w.At(e))}trim(){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:"trim"}]})}toLowerCase(){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:"toUpperCase"}]})}get Es(){return!!this.Mt.ls.find(e=>"datetime"===e.kind)}get Fs(){return!!this.Mt.ls.find(e=>"date"===e.kind)}get Ts(){return!!this.Mt.ls.find(e=>"time"===e.kind)}get Ss(){return!!this.Mt.ls.find(e=>"duration"===e.kind)}get Ms(){return!!this.Mt.ls.find(e=>"email"===e.kind)}get Ds(){return!!this.Mt.ls.find(e=>"url"===e.kind)}get Bs(){return!!this.Mt.ls.find(e=>"emoji"===e.kind)}get Os(){return!!this.Mt.ls.find(e=>"uuid"===e.kind)}get Ps(){return!!this.Mt.ls.find(e=>"nanoid"===e.kind)}get js(){return!!this.Mt.ls.find(e=>"cuid"===e.kind)}get Cs(){return!!this.Mt.ls.find(e=>"cuid2"===e.kind)}get Us(){return!!this.Mt.ls.find(e=>"ulid"===e.kind)}get Ls(){return!!this.Mt.ls.find(e=>"ip"===e.kind)}get zs(){return!!this.Mt.ls.find(e=>"cidr"===e.kind)}get Vs(){return!!this.Mt.ls.find(e=>"base64"===e.kind)}get Rs(){return!!this.Mt.ls.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.valuen?s:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}se.create=e=>new se({ls:[],Jt:qe.ZodString,T:e?.T??!1,...T(e)});var ie=class e extends M{constructor(){super(...arguments),this.min=this.Ws,this.max=this.qs,this.step=this.ct}Ut(e){if(this.Mt.T&&(e.data=Number(e.data)),this.Dt(e)!==o.number){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.number,ze:t.Ot}),k}let t;const s=new x;for(const i of this.Mt.ls)"int"===i.kind?n.isInteger(e.data)||(t=this.Bt(e,t),g(t,{code:c.Le,Ve:"integer",ze:"float",message:i.message}),s.wt()):"min"===i.kind?(i.st?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,rt:i.value,type:"number",st:i.st,tt:!1,message:i.message}),s.wt()):"multipleOf"===i.kind?0!==ne(e.data,i.value)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),s.wt()):"finite"===i.kind?Number.isFinite(e.data)||(t=this.Bt(e,t),g(t,{code:c.dt,message:i.message}),s.wt()):n.xe(i);return{status:s.value,value:e.data}}Ws(e,t){return this.Ks("min",e,!0,w.toString(t))}Hs(e,t){return this.Ks("min",e,!1,w.toString(t))}qs(e,t){return this.Ks("max",e,!0,w.toString(t))}Js(e,t){return this.Ks("max",e,!1,w.toString(t))}Ks(t,s,n,i){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:t,value:s,st:n,message:w.toString(i)}]})}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}Ys(e){return this.vs({kind:"int",message:w.toString(e)})}Gs(e){return this.vs({kind:"min",value:0,st:!1,message:w.toString(e)})}negative(e){return this.vs({kind:"max",value:0,st:!1,message:w.toString(e)})}Qs(e){return this.vs({kind:"max",value:0,st:!0,message:w.toString(e)})}Xs(e){return this.vs({kind:"min",value:0,st:!0,message:w.toString(e)})}ct(e,t){return this.vs({kind:"multipleOf",value:e,message:w.toString(t)})}en(e){return this.vs({kind:"finite",message:w.toString(e)})}tn(e){return this.vs({kind:"min",st:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)}).vs({kind:"max",st:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&n.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this.Mt.ls){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.valuenew ie({ls:[],Jt:qe.ZodNumber,T:e?.T||!1,...T(e)});var re=class e extends M{constructor(){super(...arguments),this.min=this.Ws,this.max=this.qs}Ut(e){if(this.Mt.T)try{e.data=BigInt(e.data)}catch{return this.nn(e)}if(this.Dt(e)!==o.I)return this.nn(e);let t;const s=new x;for(const i of this.Mt.ls)"min"===i.kind?(i.st?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,type:"bigint",rt:i.value,st:i.st,message:i.message}),s.wt()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),s.wt()):n.xe(i);return{status:s.value,value:e.data}}nn(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.I,ze:t.Ot}),k}Ws(e,t){return this.Ks("min",e,!0,w.toString(t))}Hs(e,t){return this.Ks("min",e,!1,w.toString(t))}qs(e,t){return this.Ks("max",e,!0,w.toString(t))}Js(e,t){return this.Ks("max",e,!1,w.toString(t))}Ks(t,s,n,i){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:t,value:s,st:n,message:w.toString(i)}]})}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}Gs(e){return this.vs({kind:"min",value:BigInt(0),st:!1,message:w.toString(e)})}negative(e){return this.vs({kind:"max",value:BigInt(0),st:!1,message:w.toString(e)})}Qs(e){return this.vs({kind:"max",value:BigInt(0),st:!0,message:w.toString(e)})}Xs(e){return this.vs({kind:"min",value:BigInt(0),st:!0,message:w.toString(e)})}ct(e,t){return this.vs({kind:"multipleOf",value:e,message:w.toString(t)})}get minValue(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.valuenew re({ls:[],Jt:qe.ZodBigInt,T:e?.T??!1,...T(e)});var ae=class extends M{Ut(e){if(this.Mt.T&&(e.data=Boolean(e.data)),this.Dt(e)!==o.F){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.F,ze:t.Ot}),k}return A(e.data)}};ae.create=e=>new ae({Jt:qe.ZodBoolean,T:e?.T||!1,...T(e)});var oe=class e extends M{Ut(e){if(this.Mt.T&&(e.data=new Date(e.data)),this.Dt(e)!==o.M){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.M,ze:t.Ot}),k}if(Number.isNaN(e.data.getTime()))return g(this.Bt(e),{code:c.Ge}),k;const t=new x;let s;for(const i of this.Mt.ls)"min"===i.kind?e.data.getTime()i.value&&(s=this.Bt(e,s),g(s,{code:c.it,message:i.message,st:!0,tt:!1,rt:i.value,type:"date"}),t.wt()):n.xe(i);return{status:t.value,value:new Date(e.data.getTime())}}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}min(e,t){return this.vs({kind:"min",value:e.getTime(),message:w.toString(t)})}max(e,t){return this.vs({kind:"max",value:e.getTime(),message:w.toString(t)})}get rn(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get an(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.valuenew oe({ls:[],T:e?.T||!1,Jt:qe.ZodDate,...T(e)});var ue=class extends M{Ut(e){if(this.Dt(e)!==o.me){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.me,ze:t.Ot}),k}return A(e.data)}};ue.create=e=>new ue({Jt:qe.ZodSymbol,...T(e)});var ce=class extends M{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.undefined,ze:t.Ot}),k}return A(e.data)}};ce.create=e=>new ce({Jt:qe.ZodUndefined,...T(e)});var de=class extends M{Ut(e){if(this.Dt(e)!==o.null){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.null,ze:t.Ot}),k}return A(e.data)}};de.create=e=>new de({Jt:qe.ZodNull,...T(e)});var he=class extends M{constructor(){super(...arguments),this.un=!0}Ut(e){return A(e.data)}};he.create=e=>new he({Jt:qe.ZodAny,...T(e)});var le=class extends M{constructor(){super(...arguments),this.cn=!0}Ut(e){return A(e.data)}};le.create=e=>new le({Jt:qe.ZodUnknown,...T(e)});var me=class extends M{Ut(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ee,ze:t.Ot}),k}};me.create=e=>new me({Jt:qe.ZodNever,...T(e)});var pe=class extends M{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ge,ze:t.Ot}),k}return A(e.data)}};pe.create=e=>new pe({Jt:qe.ZodVoid,...T(e)});var fe=class e extends M{Ut(e){const{jt:t,status:s}=this.Pt(e),n=this.Mt;if(t.Ot!==o.$)return g(t,{code:c.Le,Ve:o.$,ze:t.Ot}),k;if(null!==n.dn){const e=t.data.length>n.dn.value,i=t.data.lengthn.maxLength.value&&(g(t,{code:c.it,rt:n.maxLength.value,type:"array",st:!0,tt:!1,message:n.maxLength.message}),s.wt()),t.yt.async)return Promise.all([...t.data].map((e,s)=>n.type.Lt(new E(t,e,t.path,s)))).then(e=>x.bt(s,e));const i=[...t.data].map((e,s)=>n.type.Ct(new E(t,e,t.path,s)));return x.bt(s,i)}get element(){return this.Mt.type}min(t,s){return new e({...this.Mt,minLength:{value:t,message:w.toString(s)}})}max(t,s){return new e({...this.Mt,maxLength:{value:t,message:w.toString(s)}})}length(t,s){return new e({...this.Mt,dn:{value:t,message:w.toString(s)}})}Is(e){return this.min(1,e)}};function ve(e){if(e instanceof ye){const t={};for(const s in e.shape){const n=e.shape[s];t[s]=Be.create(ve(n))}return new ye({...e.Mt,shape:()=>t})}return e instanceof fe?new fe({...e.Mt,type:ve(e.element)}):e instanceof Be?Be.create(ve(e.hn())):e instanceof Oe?Oe.create(ve(e.hn())):e instanceof Ne?Ne.create(e.items.map(e=>ve(e))):e}fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,dn:null,Jt:qe.ZodArray,...T(t)});var ye=class e extends M{constructor(){super(...arguments),this.ln=null,this.mn=this.pn,this.fn=this.extend}vn(){if(null!==this.ln)return this.ln;const e=this.Mt.shape(),t=n.Ae(e);return this.ln={shape:e,keys:t},this.ln}Ut(e){if(this.Dt(e)!==o.object){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k}const{status:t,jt:s}=this.Pt(e),{shape:n,keys:i}=this.vn(),r=[];if(!(this.Mt.yn instanceof me&&"strip"===this.Mt.gn))for(const e in s.data)i.includes(e)||r.push(e);const a=[];for(const e of i){const t=n[e],i=s.data[e];a.push({key:{status:"valid",value:e},value:t.Ut(new E(s,i,s.path,e)),Nt:e in s.data})}if(this.Mt.yn instanceof me){const e=this.Mt.gn;if("passthrough"===e)for(const e of r)a.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)r.length>0&&(g(s,{code:c.We,keys:r}),t.wt());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this.Mt.yn;for(const t of r){const n=s.data[t];a.push({key:{status:"valid",value:t},value:e.Ut(new E(s,n,s.path,t)),Nt:t in s.data})}}return s.yt.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const s=await t.key,n=await t.value;e.push({key:s,value:n,Nt:t.Nt})}return e}).then(e=>x.kt(t,e)):x.kt(t,a)}get shape(){return this.Mt.shape()}wn(t){return w.At,new e({...this.Mt,gn:"strict",...void 0!==t?{Ft:(e,s)=>{const n=this.Mt.Ft?.(e,s).message??s.ht;return"unrecognized_keys"===e.code?{message:w.At(t).message??n}:{message:n}}}:{}})}bn(){return new e({...this.Mt,gn:"strip"})}pn(){return new e({...this.Mt,gn:"passthrough"})}extend(t){return new e({...this.Mt,shape:()=>({...this.Mt.shape(),...t})})}xn(t){return new e({gn:t.Mt.gn,yn:t.Mt.yn,shape:()=>({...this.Mt.shape(),...t.Mt.shape()}),Jt:qe.ZodObject})}kn(e,t){return this.fn({[e]:t})}yn(t){return new e({...this.Mt,yn:t})}Nn(t){const s={};for(const e of n.Ae(t))t[e]&&this.shape[e]&&(s[e]=this.shape[e]);return new e({...this.Mt,shape:()=>s})}An(t){const s={};for(const e of n.Ae(this.shape))t[e]||(s[e]=this.shape[e]);return new e({...this.Mt,shape:()=>s})}_n(){return ve(this)}Zn(t){const s={};for(const e of n.Ae(this.shape)){const n=this.shape[e];t&&!t[e]?s[e]=n:s[e]=n.re()}return new e({...this.Mt,shape:()=>s})}required(t){const s={};for(const e of n.Ae(this.shape))if(t&&!t[e])s[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Be;)t=t.Mt.rs;s[e]=t}return new e({...this.Mt,shape:()=>s})}$n(){return Fe(n.Ae(this.shape))}};ye.create=(e,t)=>new ye({shape:()=>e,gn:"strip",yn:me.create(),Jt:qe.ZodObject,...T(t)}),ye.In=(e,t)=>new ye({shape:()=>e,gn:"strict",yn:me.create(),Jt:qe.ZodObject,...T(t)}),ye.En=(e,t)=>new ye({shape:e,gn:"strip",yn:me.create(),Jt:qe.ZodObject,...T(t)});var ge=class extends M{Ut(e){const{jt:t}=this.Pt(e),s=this.Mt.options;if(t.yt.async)return Promise.all(s.map(async e=>{const s={...t,yt:{...t.yt,Fe:[]},parent:null};return{result:await e.Lt({data:t.data,path:t.path,parent:s}),jt:s}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.yt.Fe.push(...s.jt.yt.Fe),s.result;const s=e.map(e=>new h(e.jt.yt.Fe));return g(t,{code:c.qe,De:s}),k});{let e;const n=[];for(const i of s){const s={...t,yt:{...t.yt,Fe:[]},parent:null},r=i.Ct({data:t.data,path:t.path,parent:s});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,jt:s}),s.yt.Fe.length&&n.push(s.yt.Fe)}if(e)return t.yt.Fe.push(...e.jt.yt.Fe),e.result;const i=n.map(e=>new h(e));return g(t,{code:c.qe,De:i}),k}}get options(){return this.Mt.options}};ge.create=(e,t)=>new ge({options:e,Jt:qe.ZodUnion,...T(t)});var we=e=>e instanceof Ie?we(e.Ht):e instanceof De?we(e.rs()):e instanceof Ee?[e.value]:e instanceof Te?e.options:e instanceof Se?n._e(e.P):e instanceof Pe?we(e.Mt.rs):e instanceof ce?[void 0]:e instanceof de?[null]:e instanceof Be?[void 0,...we(e.hn())]:e instanceof Oe?[null,...we(e.hn())]:e instanceof Le||e instanceof Ve?we(e.hn()):e instanceof je?we(e.Mt.rs):[],be=class e extends M{Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.object)return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k;const s=this.Fn,n=t.data[s],i=this.Tn.get(n);return i?t.yt.async?i.Lt({data:t.data,path:t.path,parent:t}):i.Ct({data:t.data,path:t.path,parent:t}):(g(t,{code:c.Ke,options:Array.from(this.Tn.keys()),path:[s]}),k)}get Fn(){return this.Mt.Fn}get options(){return this.Mt.options}get Tn(){return this.Mt.Tn}static create(t,s,n){const i=new Map;for(const e of s){const s=we(e.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const n of s){if(i.has(n))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(n)}`);i.set(n,e)}}return new e({Jt:qe.ZodDiscriminatedUnion,Fn:t,options:s,Tn:i,...T(n)})}};function xe(e,t){const s=u(e),i=u(t);if(e===t)return{valid:!0,data:e};if(s===o.object&&i===o.object){const s=n.Ae(t),i=n.Ae(e).filter(e=>-1!==s.indexOf(e)),r={...e,...t};for(const s of i){const n=xe(e[s],t[s]);if(!n.valid)return{valid:!1};r[s]=n.data}return{valid:!0,data:r}}if(s===o.$&&i===o.$){if(e.length!==t.length)return{valid:!1};const s=[];for(let n=0;n{if(_(e)||_(n))return k;const i=xe(e.value,n.value);return i.valid?((Z(e)||Z(n))&&t.wt(),{status:t.value,value:i.data}):(g(s,{code:c.ot}),k)};return s.yt.async?Promise.all([this.Mt.left.Lt({data:s.data,path:s.path,parent:s}),this.Mt.right.Lt({data:s.data,path:s.path,parent:s})]).then(([e,t])=>n(e,t)):n(this.Mt.left.Ct({data:s.data,path:s.path,parent:s}),this.Mt.right.Ct({data:s.data,path:s.path,parent:s}))}};ke.create=(e,t,s)=>new ke({left:e,right:t,Jt:qe.ZodIntersection,...T(s)});var Ne=class e extends M{Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.$)return g(s,{code:c.Le,Ve:o.$,ze:s.Ot}),k;if(s.data.lengththis.Mt.items.length&&(g(s,{code:c.it,rt:this.Mt.items.length,st:!0,tt:!1,type:"array"}),t.wt());const n=[...s.data].map((e,t)=>{const n=this.Mt.items[t]||this.Mt.Sn;return n?n.Ut(new E(s,e,s.path,t)):null}).filter(e=>!!e);return s.yt.async?Promise.all(n).then(e=>x.bt(t,e)):x.bt(t,n)}get items(){return this.Mt.items}Sn(t){return new e({...this.Mt,Sn:t})}};Ne.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ne({items:e,Jt:qe.ZodTuple,Sn:null,...T(t)})};var Ae=class e extends M{get Mn(){return this.Mt.Dn}get Bn(){return this.Mt.valueType}Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.object)return g(s,{code:c.Le,Ve:o.object,ze:s.Ot}),k;const n=[],i=this.Mt.Dn,r=this.Mt.valueType;for(const e in s.data)n.push({key:i.Ut(new E(s,e,s.path,e)),value:r.Ut(new E(s,s.data[e],s.path,e)),Nt:e in s.data});return s.yt.async?x.xt(t,n):x.kt(t,n)}get element(){return this.Mt.valueType}static create(t,s,n){return new e(s instanceof M?{Dn:t,valueType:s,Jt:qe.ZodRecord,...T(n)}:{Dn:se.create(),valueType:t,Jt:qe.ZodRecord,...T(s)})}},_e=class extends M{get Mn(){return this.Mt.Dn}get Bn(){return this.Mt.valueType}Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.map)return g(s,{code:c.Le,Ve:o.map,ze:s.Ot}),k;const n=this.Mt.Dn,i=this.Mt.valueType,r=[...s.data.entries()].map(([e,t],r)=>({key:n.Ut(new E(s,e,s.path,[r,"key"])),value:i.Ut(new E(s,t,s.path,[r,"value"]))}));if(s.yt.async){const e=new Map;return Promise.resolve().then(async()=>{for(const s of r){const n=await s.key,i=await s.value;if("aborted"===n.status||"aborted"===i.status)return k;"dirty"!==n.status&&"dirty"!==i.status||t.wt(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const s of r){const n=s.key,i=s.value;if("aborted"===n.status||"aborted"===i.status)return k;"dirty"!==n.status&&"dirty"!==i.status||t.wt(),e.set(n.value,i.value)}return{status:t.value,value:e}}}};_e.create=(e,t,s)=>new _e({valueType:t,Dn:e,Jt:qe.ZodMap,...T(s)});var Ze=class e extends M{Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.set)return g(s,{code:c.Le,Ve:o.set,ze:s.Ot}),k;const n=this.Mt;null!==n.On&&s.data.sizen.Pn.value&&(g(s,{code:c.it,rt:n.Pn.value,type:"set",st:!0,tt:!1,message:n.Pn.message}),t.wt());const i=this.Mt.valueType;function r(e){const s=new Set;for(const n of e){if("aborted"===n.status)return k;"dirty"===n.status&&t.wt(),s.add(n.value)}return{status:t.value,value:s}}const a=[...s.data.values()].map((e,t)=>i.Ut(new E(s,e,s.path,t)));return s.yt.async?Promise.all(a).then(e=>r(e)):r(a)}min(t,s){return new e({...this.Mt,On:{value:t,message:w.toString(s)}})}max(t,s){return new e({...this.Mt,Pn:{value:t,message:w.toString(s)}})}size(e,t){return this.min(e,t).max(e,t)}Is(e){return this.min(1,e)}};Ze.create=(e,t)=>new Ze({valueType:e,On:null,Pn:null,Jt:qe.ZodSet,...T(t)});var $e=class e extends M{constructor(){super(...arguments),this.validate=this.jn}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.j)return g(t,{code:c.Le,Ve:o.j,ze:t.Ot}),k;function s(e,s){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Je,Oe:s}})}function n(e,s){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Ye,Be:s}})}const i={Ft:t.yt.vt},r=t.data;if(this.Mt.Cn instanceof Me){const e=this;return A(async function(...t){const a=new h([]),o=await e.Mt.Un.Vt(t,i).catch(e=>{throw a.Te(s(t,e)),a}),u=await Reflect.apply(r,this,o);return await e.Mt.Cn.Mt.type.Vt(u,i).catch(e=>{throw a.Te(n(u,e)),a})})}{const e=this;return A(function(...t){const a=e.Mt.Un.zt(t,i);if(!a.It)throw new h([s(t,a.error)]);const o=Reflect.apply(r,this,a.data),u=e.Mt.Cn.zt(o,i);if(!u.It)throw new h([n(o,u.error)]);return u.data})}}parameters(){return this.Mt.Un}Ln(){return this.Mt.Cn}Un(...t){return new e({...this.Mt,Un:Ne.create(t).Sn(le.create())})}Cn(t){return new e({...this.Mt,Cn:t})}jn(e){return this.parse(e)}zn(e){return this.parse(e)}static create(t,s,n){return new e({Un:t||Ne.create([]).Sn(le.create()),Cn:s||le.create(),Jt:qe.ZodFunction,...T(n)})}},Ie=class extends M{get Ht(){return this.Mt.Vn()}Ut(e){const{jt:t}=this.Pt(e);return this.Mt.Vn().Ut({data:t.data,path:t.path,parent:t})}};Ie.create=(e,t)=>new Ie({Vn:e,Jt:qe.ZodLazy,...T(t)});var Ee=class extends M{Ut(e){if(e.data!==this.Mt.value){const t=this.Bt(e);return g(t,{ze:t.data,code:c.Re,Ve:this.Mt.value}),k}return{status:"valid",value:e.data}}get value(){return this.Mt.value}};function Fe(e,t){return new Te({values:e,Jt:qe.ZodEnum,...T(t)})}Ee.create=(e,t)=>new Ee({value:e,Jt:qe.ZodLiteral,...T(t)});var Te=class e extends M{Ut(e){if("string"!=typeof e.data){const t=this.Bt(e),s=this.Mt.values;return g(t,{Ve:n.Ze(s),ze:t.Ot,code:c.Le}),k}if(this.Rn||(this.Rn=new Set(this.Mt.values)),!this.Rn.has(e.data)){const t=this.Bt(e),s=this.Mt.values;return g(t,{ze:t.data,code:c.He,options:s}),k}return A(e.data)}get options(){return this.Mt.values}get P(){const e={};for(const t of this.Mt.values)e[t]=t;return e}get Wn(){const e={};for(const t of this.Mt.values)e[t]=t;return e}get qn(){const e={};for(const t of this.Mt.values)e[t]=t;return e}Kn(t,s=this.Mt){return e.create(t,{...this.Mt,...s})}Hn(t,s=this.Mt){return e.create(this.options.filter(e=>!t.includes(e)),{...this.Mt,...s})}};Te.create=Fe;var Se=class extends M{Ut(e){const t=n.Ne(this.Mt.values),s=this.Bt(e);if(s.Ot!==o.string&&s.Ot!==o.number){const e=n._e(t);return g(s,{Ve:n.Ze(e),ze:s.Ot,code:c.Le}),k}if(this.Rn||(this.Rn=new Set(n.Ne(this.Mt.values))),!this.Rn.has(e.data)){const e=n._e(t);return g(s,{ze:s.data,code:c.He,options:e}),k}return A(e.data)}get P(){return this.Mt.values}};Se.create=(e,t)=>new Se({values:e,Jt:qe.ZodNativeEnum,...T(t)});var Me=class extends M{hn(){return this.Mt.type}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.promise&&!1===t.yt.async)return g(t,{code:c.Le,Ve:o.promise,ze:t.Ot}),k;const s=t.Ot===o.promise?t.data:Promise.resolve(t.data);return A(s.then(e=>this.Mt.type.Vt(e,{path:t.path,Ft:t.yt.vt})))}};Me.create=(e,t)=>new Me({type:e,Jt:qe.ZodPromise,...T(t)});var De=class extends M{rs(){return this.Mt.Ht}Jn(){return this.Mt.Ht.Mt.Jt===qe.ZodEffects?this.Mt.Ht.Jn():this.Mt.Ht}Ut(e){const{status:t,jt:s}=this.Pt(e),i=this.Mt.effect||null,r={Te:e=>{g(s,e),e.fatal?t.abort():t.wt()},get path(){return s.path}};if(r.Te=r.Te.bind(r),"preprocess"===i.type){const e=i.transform(s.data,r);if(s.yt.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return k;const n=await this.Mt.Ht.Lt({data:e,path:s.path,parent:s});return"aborted"===n.status?k:"dirty"===n.status||"dirty"===t.value?N(n.value):n});{if("aborted"===t.value)return k;const n=this.Mt.Ht.Ct({data:e,path:s.path,parent:s});return"aborted"===n.status?k:"dirty"===n.status||"dirty"===t.value?N(n.value):n}}if("refinement"===i.type){const e=e=>{const t=i.Kt(e,r);if(s.yt.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.yt.async){const n=this.Mt.Ht.Ct({data:s.data,path:s.path,parent:s});return"aborted"===n.status?k:("dirty"===n.status&&t.wt(),e(n.value),{status:t.value,value:n.value})}return this.Mt.Ht.Lt({data:s.data,path:s.path,parent:s}).then(s=>"aborted"===s.status?k:("dirty"===s.status&&t.wt(),e(s.value).then(()=>({status:t.value,value:s.value}))))}if("transform"===i.type){if(!1===s.yt.async){const e=this.Mt.Ht.Ct({data:s.data,path:s.path,parent:s});if(!$(e))return k;const n=i.transform(e.value,r);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this.Mt.Ht.Lt({data:s.data,path:s.path,parent:s}).then(e=>$(e)?Promise.resolve(i.transform(e.value,r)).then(e=>({status:t.value,value:e})):k)}n.xe(i)}};De.create=(e,t,s)=>new De({Ht:e,Jt:qe.ZodEffects,effect:t,...T(s)}),De.Yn=(e,t,s)=>new De({Ht:t,effect:{type:"preprocess",transform:e},Jt:qe.ZodEffects,...T(s)});var Be=class extends M{Ut(e){return this.Dt(e)===o.undefined?A(void 0):this.Mt.rs.Ut(e)}hn(){return this.Mt.rs}};Be.create=(e,t)=>new Be({rs:e,Jt:qe.ZodOptional,...T(t)});var Oe=class extends M{Ut(e){return this.Dt(e)===o.null?A(null):this.Mt.rs.Ut(e)}hn(){return this.Mt.rs}};Oe.create=(e,t)=>new Oe({rs:e,Jt:qe.ZodNullable,...T(t)});var Pe=class extends M{Ut(e){const{jt:t}=this.Pt(e);let s=t.data;return t.Ot===o.undefined&&(s=this.Mt.defaultValue()),this.Mt.rs.Ut({data:s,path:t.path,parent:t})}Gn(){return this.Mt.rs}};Pe.create=(e,t)=>new Pe({rs:e,Jt:qe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});var je=class extends M{Ut(e){const{jt:t}=this.Pt(e),s={...t,yt:{...t.yt,Fe:[]}},n=this.Mt.rs.Ut({data:s.data,path:s.path,parent:{...s}});return I(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this.Mt.us({get error(){return new h(s.yt.Fe)},input:s.data})})):{status:"valid",value:"valid"===n.status?n.value:this.Mt.us({get error(){return new h(s.yt.Fe)},input:s.data})}}Qn(){return this.Mt.rs}};je.create=(e,t)=>new je({rs:e,Jt:qe.ZodCatch,us:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});var Ce=class extends M{Ut(e){if(this.Dt(e)!==o.G){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.G,ze:t.Ot}),k}return{status:"valid",value:e.data}}};Ce.create=e=>new Ce({Jt:qe.ZodNaN,...T(e)});var Ue=Symbol("zod_brand"),Le=class extends M{Ut(e){const{jt:t}=this.Pt(e),s=t.data;return this.Mt.type.Ut({data:s,path:t.path,parent:t})}hn(){return this.Mt.type}},ze=class e extends M{Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.yt.async)return(async()=>{const e=await this.Mt.in.Lt({data:s.data,path:s.path,parent:s});return"aborted"===e.status?k:"dirty"===e.status?(t.wt(),N(e.value)):this.Mt.Xn.Lt({data:e.value,path:s.path,parent:s})})();{const e=this.Mt.in.Ct({data:s.data,path:s.path,parent:s});return"aborted"===e.status?k:"dirty"===e.status?(t.wt(),{status:"dirty",value:e.value}):this.Mt.Xn.Ct({data:e.value,path:s.path,parent:s})}}static create(t,s){return new e({in:t,Xn:s,Jt:qe.ZodPipeline})}},Ve=class extends M{Ut(e){const t=this.Mt.rs.Ut(e),s=e=>($(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then(e=>s(e)):s(t)}hn(){return this.Mt.rs}};function Re(e,t){const s="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof s?{message:s}:s}function We(e,t={},s){return e?he.create().Yt((n,i)=>{const r=e(n);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Re(t,n),r=e.fatal??s??!0;i.Te({code:"custom",...e,fatal:r})}});if(!r){const e=Re(t,n),r=e.fatal??s??!0;i.Te({code:"custom",...e,fatal:r})}}):he.create()}Ve.create=(e,t)=>new Ve({rs:e,Jt:qe.ZodReadonly,...T(t)});var qe,Ke,He={object:ye.En};(Ke=qe||(qe={})).ZodString="ZodString",Ke.ZodNumber="ZodNumber",Ke.ZodNaN="ZodNaN",Ke.ZodBigInt="ZodBigInt",Ke.ZodBoolean="ZodBoolean",Ke.ZodDate="ZodDate",Ke.ZodSymbol="ZodSymbol",Ke.ZodUndefined="ZodUndefined",Ke.ZodNull="ZodNull",Ke.ZodAny="ZodAny",Ke.ZodUnknown="ZodUnknown",Ke.ZodNever="ZodNever",Ke.ZodVoid="ZodVoid",Ke.ZodArray="ZodArray",Ke.ZodObject="ZodObject",Ke.ZodUnion="ZodUnion",Ke.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ke.ZodIntersection="ZodIntersection",Ke.ZodTuple="ZodTuple",Ke.ZodRecord="ZodRecord",Ke.ZodMap="ZodMap",Ke.ZodSet="ZodSet",Ke.ZodFunction="ZodFunction",Ke.ZodLazy="ZodLazy",Ke.ZodLiteral="ZodLiteral",Ke.ZodEnum="ZodEnum",Ke.ZodEffects="ZodEffects",Ke.ZodNativeEnum="ZodNativeEnum",Ke.ZodOptional="ZodOptional",Ke.ZodNullable="ZodNullable",Ke.ZodDefault="ZodDefault",Ke.ZodCatch="ZodCatch",Ke.ZodPromise="ZodPromise",Ke.ZodBranded="ZodBranded",Ke.ZodPipeline="ZodPipeline",Ke.ZodReadonly="ZodReadonly";var Je=(e,t={message:`Input not instance of ${e.name}`})=>We(t=>t instanceof e,t),Ye=se.create,Ge=ie.create,Qe=Ce.create,Xe=re.create,et=ae.create,tt=oe.create,st=ue.create,nt=ce.create,it=de.create,rt=he.create,at=le.create,ot=me.create,ut=pe.create,ct=fe.create,dt=ye.create,ht=ye.In,lt=ge.create,mt=be.create,pt=ke.create,ft=Ne.create,vt=Ae.create,yt=_e.create,gt=Ze.create,wt=$e.create,bt=Ie.create,xt=Ee.create,kt=Te.create,Nt=Se.create,At=Me.create,_t=De.create,Zt=Be.create,$t=Oe.create,It=De.Yn,Et=ze.create,Ft=()=>Ye().re(),Tt=()=>Ge().re(),St=()=>et().re(),Mt={string:e=>se.create({...e,T:!0}),number:e=>ie.create({...e,T:!0}),F:e=>ae.create({...e,T:!0}),I:e=>re.create({...e,T:!0}),M:e=>oe.create({...e,T:!0})},Dt=k,Bt=a,Ot=Bt.object({ei:Bt.object({ti:Bt.string(),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re()}),ii:Bt.object({name:Bt.string(),ri:Bt.string()}).re(),ai:Bt.$(Bt.object({name:Bt.string().re(),enabled:Bt.F(),coords:Bt.object({oi:Bt.number(),ui:Bt.number(),px:Bt.number(),ci:Bt.number()}),sources:Bt.$(Bt.string()),di:Bt.number().re(),animation:Bt.object({hi:Bt.number().re(),li:Bt.number().re(),frameCount:Bt.number().re(),mi:Bt.number().re(),pi:Bt.number().re(),fi:Bt.number().re(),yi:Bt.number().re(),startTime:Bt.number().re(),looping:Bt.F().re()}).re(),uuid:Bt.string()})),gi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()})),wi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()}))}),Pt=Bt.object({name:Bt.string().re(),coords:Bt.$(Bt.number()),bi:Bt.number().re(),enabled:Bt.F(),xi:Bt.string().re(),uuid:Bt.string()}),jt=Bt.object({name:Bt.string().re(),url:Bt.string(),ki:Bt.$(Bt.object({bi:Bt.number().re(),uuid:Bt.string()})).re()}),Ct=Bt.object({ti:Bt.string(),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re(),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),ai:Bt.$(Pt),links:Bt.$(jt).re()}),Ut=document.querySelector("#bm-manage-templates table");Ut&&"TABLE"===Ut.nodeName.toLocaleUpperCase()&&(Ut=Ut.children[0])&&"BM"===Vt.getType()&&Vt.get().ai.forEach((e,t)=>{const n=s("tr",{id:"main-row"}),i=s("td",{textContent:t.toString()}),r=s("td",{textContent:e.name||"unnamed-0"}),a=document.createElement("td"),o=s("button",{id:"enable"});a.appendChild(o);const u=document.createElement("td"),c=s("button",{id:"exportAdd"});u.appendChild(c);const d=document.createElement("td"),h=s("div",{className:"shifts-container"}),l=s("button",{id:"up"}),m=s("button",{id:"down"});h.append(l,m),d.appendChild(h),n.append(i,r,a,u,d)});var Lt={"bm-create-template":"flex","bm-main-overlay":"flex","bm-manage-links":"flex","bm-manage-templates":"flex"},zt=document.createElement("style");zt.textContent="",document.body.appendChild(zt);var Vt=new class{constructor(e){t(this,"object"),t(this,"type"),this.object=e,e&&(Ot.zt(e).It?this.type="CHA":Ct.zt(e).It?this.type="BM":this.type="N/A")}update(e){if(Ct.zt(e).It)this.type="BM";else{if(!Ot.zt(e).It)return;this.type="CHA"}this.object=e}get(){return this.object}getType(){return this.type}Ni(){"N/A"!==this.type&&"CHA"!==this.type&&("BM"===this.type&&(this.object=this.object,this.object={ei:{ti:"Charity",si:"0.1.0",ni:this.object.ni},ai:this.object.ai.map(e=>({name:e.name,enabled:e.enabled||!1,coords:{oi:e.coords[0],ui:e.coords[1],px:e.coords[2],ci:e.coords[3]},sources:[e.xi||""],di:e.bi,uuid:e.uuid})),gi:[],wi:[]}),this.type="CHA")}Ai(){"N/A"!==this.type&&"BM"!==this.type&&("CHA"===this.type&&(this.object=this.object,this.object={ti:"BlueMarble",si:"0.1.0",ni:this.object.ei.ni,ai:this.object.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,xi:e.sources[0],uuid:e.uuid}))}),this.type="BM")}appendData(e){"BM"===this.type&&(this.object=this.object,Ot.parse(e)?this.object.ai.push(...e.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,xi:e.sources[0],uuid:e.uuid}))):Ct.parse(e)&&(this.object.ai.push(...e.ai),this.object.links?e.links&&this.object.links.push(...e.links):this.object.links=e.links))}Zi(e){"BM"===this.type&&this.object.ai.push(e)}$i(e){"BM"===this.type&&(this.object=this.object,this.object.links?this.object.links.push(e):this.object.links=[e])}Ii(e,t){if("N/A"===this.type)return null;if(this.object.hasOwnProperty("links")){const s=this.object;return{...s,ai:e?e.map(e=>!!(Number.isInteger(e)&&e>=0&&s.ai.length!!(Number.isInteger(e)&&e>=0&&s.links.length!!(Number.isInteger(e)&&e>=0&&s.ai.length{console.log("test"),console.log("test")})}()})(); \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 52a984c..268a04a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1 +1 @@ -(function (){ return ({ patches: [], load: () => {(()=>{var e=Object.defineProperty,t=(t,n,s)=>((t,n,s)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s)(t,"symbol"!=typeof n?n+"":n,s);function n(e,t){const n=document.createElement(e);return t&&Object.entries(t).forEach(([e,t])=>{"className"===e?n.setAttribute("class",t):n.setAttribute(e,t)}),n}new Blob;var s,i,r,a={};((t,n)=>{for(var s in n)e(t,s,{get:n[s],enumerable:!0})})(a,{t:()=>Ue,i:()=>N,o:()=>y,u:()=>k,NEVER:()=>Dt,OK:()=>A,h:()=>w,l:()=>F,ZodAny:()=>he,ZodArray:()=>fe,ZodBigInt:()=>re,ZodBoolean:()=>ae,ZodBranded:()=>Le,ZodCatch:()=>je,ZodDate:()=>oe,ZodDefault:()=>Pe,ZodDiscriminatedUnion:()=>xe,ZodEffects:()=>De,ZodEnum:()=>Me,m:()=>h,p:()=>qe,ZodFunction:()=>$e,ZodIntersection:()=>ke,v:()=>c,ZodLazy:()=>Ee,ZodLiteral:()=>Ie,ZodMap:()=>_e,ZodNaN:()=>Ce,ZodNativeEnum:()=>Se,ZodNever:()=>me,ZodNull:()=>de,ZodNullable:()=>Oe,ZodNumber:()=>ie,ZodObject:()=>ye,ZodOptional:()=>Be,k:()=>o,ZodPipeline:()=>ze,ZodPromise:()=>Fe,ZodReadonly:()=>Ve,ZodRecord:()=>Ae,N:()=>F,ZodSet:()=>Ze,ZodString:()=>ne,ZodSymbol:()=>ue,A:()=>De,ZodTuple:()=>Ne,_:()=>F,ZodUndefined:()=>ce,ZodUnion:()=>ge,ZodUnknown:()=>le,ZodVoid:()=>pe,Z:()=>g,any:()=>rt,$:()=>ct,I:()=>Xe,T:()=>et,M:()=>Ft,S:()=>We,F:()=>tt,D:()=>Q,B:()=>l,O:()=>mt,effect:()=>_t,P:()=>kt,j:()=>bt,C:()=>f,U:()=>u,L:()=>Je,intersection:()=>pt,V:()=>_,R:()=>E,W:()=>Z,q:()=>$,K:()=>He,H:()=>xt,J:()=>wt,Y:()=>v,map:()=>yt,G:()=>Qe,X:()=>Nt,ee:()=>ot,null:()=>it,te:()=>$t,number:()=>Ge,object:()=>dt,ne:()=>r,se:()=>St,ie:()=>Mt,re:()=>Zt,ae:()=>Tt,oe:()=>It,ue:()=>Et,promise:()=>At,ce:()=>d,de:()=>vt,set:()=>gt,he:()=>p,le:()=>ht,string:()=>Ye,me:()=>nt,pe:()=>_t,fe:()=>ft,undefined:()=>st,union:()=>lt,ve:()=>at,ye:()=>s,ge:()=>ut}),(i=s||(s={})).be=e=>{},i.xe=function(e){},i.we=function(e){throw new Error},i.ke=e=>{const t={};for(const n of e)t[n]=n;return t},i.Ne=e=>{const t=i.Ae(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(const s of t)n[s]=e[s];return i._e(n)},i._e=e=>i.Ae(e).map(function(t){return e[t]}),i.Ae="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},i.find=(e,t)=>{for(const n of e)if(t(n))return n},i.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,i.Ze=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},i.$e=(e,t)=>"bigint"==typeof t?t.toString():t,(r||(r={})).Ee=(e,t)=>({...e,...t});var o=s.ke(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),u=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(e)?o.G:o.number;case"boolean":return o.T;case"function":return o.j;case"bigint":return o.I;case"symbol":return o.me;case"object":return Array.isArray(e)?o.$:null===e?o.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?o.promise:"undefined"!=typeof Map&&e instanceof Map?o.map:"undefined"!=typeof Set&&e instanceof Set?o.set:"undefined"!=typeof Date&&e instanceof Date?o.F:o.object;default:return o.ve}},c=s.ke(["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"]),d=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),h=class e extends Error{get Ie(){return this.Te}constructor(e){super(),this.Te=[],this.Me=e=>{this.Te=[...this.Te,e]},this.Se=(e=[])=>{this.Te=[...this.Te,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.Te=e}format(e){const t=e||function(e){return e.message},n={Fe:[]},s=e=>{for(const i of e.Te)if("invalid_union"===i.code)i.De.map(s);else if("invalid_return_type"===i.code)s(i.Be);else if("invalid_arguments"===i.code)s(i.Oe);else if(0===i.path.length)n.Fe.push(t(i));else{let e=n,s=0;for(;se.message){const t={},n=[];for(const s of this.Te)if(s.path.length>0){const n=s.path[0];t[n]=t[n]||[],t[n].push(e(s))}else n.push(e(s));return{Ce:n,Ue:t}}get Ce(){return this.je()}};h.create=e=>new h(e);var l=(e,t)=>{let n;switch(e.code){case c.Le:n=e.ze===o.undefined?"Required":`Expected ${e.Ve}, received ${e.ze}`;break;case c.Re:n=`Invalid literal value, expected ${JSON.stringify(e.Ve,s.$e)}`;break;case c.We:n=`Unrecognized key(s) in object: ${s.Ze(e.keys,", ")}`;break;case c.qe:n="Invalid input";break;case c.Ke:n=`Invalid discriminator value. Expected ${s.Ze(e.options)}`;break;case c.He:n=`Invalid enum value. Expected ${s.Ze(e.options)}, received '${e.ze}'`;break;case c.Je:n="Invalid function arguments";break;case c.Ye:n="Invalid function return type";break;case c.Ge:n="Invalid date";break;case c.Qe:"object"==typeof e.Xe?"includes"in e.Xe?(n=`Invalid input: must include "${e.Xe.includes}"`,"number"==typeof e.Xe.position&&(n=`${n} at one or more positions greater than or equal to ${e.Xe.position}`)):"startsWith"in e.Xe?n=`Invalid input: must start with "${e.Xe.startsWith}"`:"endsWith"in e.Xe?n=`Invalid input: must end with "${e.Xe.endsWith}"`:s.we(e.Xe):n="regex"!==e.Xe?`Invalid ${e.Xe}`:"Invalid";break;case c.et:n="array"===e.type?`Array must contain ${e.tt?"exactly":e.nt?"at least":"more than"} ${e.st} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.nt?"at least":"over"} ${e.st} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.tt?"exactly equal to ":e.nt?"greater than or equal to ":"greater than "}${e.st}`:"date"===e.type?`Date must be ${e.tt?"exactly equal to ":e.nt?"greater than or equal to ":"greater than "}${new Date(Number(e.st))}`:"Invalid input";break;case c.it:n="array"===e.type?`Array must contain ${e.tt?"exactly":e.nt?"at most":"less than"} ${e.rt} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.nt?"at most":"under"} ${e.rt} character(s)`:"number"===e.type?`Number must be ${e.tt?"exactly":e.nt?"less than or equal to":"less than"} ${e.rt}`:"bigint"===e.type?`BigInt must be ${e.tt?"exactly":e.nt?"less than or equal to":"less than"} ${e.rt}`:"date"===e.type?`Date must be ${e.tt?"exactly":e.nt?"smaller than or equal to":"smaller than"} ${new Date(Number(e.rt))}`:"Invalid input";break;case c.S:n="Invalid input";break;case c.ot:n="Intersection results could not be merged";break;case c.ut:n=`Number must be a multiple of ${e.ct}`;break;case c.dt:n="Number must be finite";break;default:n=t.ht,s.we(e)}return{message:n}},m=l;function p(e){m=e}function f(){return m}var v=e=>{const{data:t,path:n,lt:s,ft:i}=e,r=[...n,...i.path||[]],a={...i,path:r};if(void 0!==i.message)return{...i,path:r,message:i.message};let o="";const u=s.filter(e=>!!e).slice().reverse();for(const e of u)o=e(a,{data:t,ht:o}).message;return{...i,path:r,message:o}},y=[];function g(e,t){const n=f(),s=v({ft:t,data:e.data,path:e.path,lt:[e.yt.vt,e.gt,n,n===l?void 0:l].filter(e=>!!e)});e.yt.Te.push(s)}var b,x,w=class e{constructor(){this.value="valid"}bt(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static xt(e,t){const n=[];for(const s of t){if("aborted"===s.status)return k;"dirty"===s.status&&e.bt(),n.push(s.value)}return{status:e.value,value:n}}static async wt(t,n){const s=[];for(const e of n){const t=await e.key,n=await e.value;s.push({key:t,value:n})}return e.kt(t,s)}static kt(e,t){const n={};for(const s of t){const{key:t,value:i}=s;if("aborted"===t.status)return k;if("aborted"===i.status)return k;"dirty"===t.status&&e.bt(),"dirty"===i.status&&e.bt(),"__proto__"===t.value||void 0===i.value&&!s.Nt||(n[t.value]=i.value)}return{status:e.value,value:n}}},k=Object.freeze({status:"aborted"}),N=e=>({status:"dirty",value:e}),A=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,Z=e=>"dirty"===e.status,$=e=>"valid"===e.status,E=e=>"undefined"!=typeof Promise&&e instanceof Promise;(x=b||(b={})).At=e=>"string"==typeof e?{message:e}:e||{},x.toString=e=>"string"==typeof e?e:e?.message;var I=class{constructor(e,t,n,s){this._t=[],this.parent=e,this.data=t,this.Zt=n,this.$t=s}get path(){return this._t.length||(Array.isArray(this.$t)?this._t.push(...this.Zt,...this.$t):this._t.push(...this.Zt,this.$t)),this._t}},T=(e,t)=>{if($(t))return{Et:!0,data:t.value};if(!e.yt.Te.length)throw new Error("Validation failed but no issues detected.");return{Et:!1,get error(){if(this.It)return this.It;const t=new h(e.yt.Te);return this.It=t,this.It}}};function M(e){if(!e)return{};const{Tt:t,Mt:n,St:s,description:i}=e;if(t&&(n||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{Tt:t,description:i}:{Tt:(t,i)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??i.ht}:void 0===i.data?{message:r??s??i.ht}:"invalid_type"!==t.code?{message:i.ht}:{message:r??n??i.ht}},description:i}}var S,F=class{get description(){return this.Ft.description}Dt(e){return u(e.data)}Bt(e,t){return t||{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Ft.Tt,path:e.path,parent:e.parent}}Pt(e){return{status:new w,jt:{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Ft.Tt,path:e.path,parent:e.parent}}}Ct(e){const t=this.Ut(e);if(E(t))throw new Error("Synchronous parse encountered promise.");return t}Lt(e){const t=this.Ut(e);return Promise.resolve(t)}parse(e,t){const n=this.zt(e,t);if(n.Et)return n.data;throw n.error}zt(e,t){const n={yt:{Te:[],async:t?.async??!1,vt:t?.Tt},path:t?.path||[],gt:this.Ft.Tt,parent:null,data:e,Ot:u(e)},s=this.Ct({data:e,path:n.path,parent:n});return T(n,s)}"~validate"(e){const t={yt:{Te:[],async:!!this["~standard"].async},path:[],gt:this.Ft.Tt,parent:null,data:e,Ot:u(e)};if(!this["~standard"].async)try{const n=this.Ct({data:e,path:[],parent:t});return $(n)?{value:n.value}:{Te:t.yt.Te}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.yt={Te:[],async:!0}}return this.Lt({data:e,path:[],parent:t}).then(e=>$(e)?{value:e.value}:{Te:t.yt.Te})}async Vt(e,t){const n=await this.Rt(e,t);if(n.Et)return n.data;throw n.error}async Rt(e,t){const n={yt:{Te:[],vt:t?.Tt,async:!0},path:t?.path||[],gt:this.Ft.Tt,parent:null,data:e,Ot:u(e)},s=this.Ut({data:e,path:n.path,parent:n}),i=await(E(s)?s:Promise.resolve(s));return T(n,i)}Wt(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this.qt((t,s)=>{const i=e(t),r=()=>s.Me({code:c.S,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(r(),!1)):!!i||(r(),!1)})}Kt(e,t){return this.qt((n,s)=>!!e(n)||(s.Me("function"==typeof t?t(n,s):t),!1))}qt(e){return new De({Ht:this,Jt:qe.ZodEffects,effect:{type:"refinement",Kt:e}})}Yt(e){return this.qt(e)}constructor(e){this.Gt=this.Rt,this.Ft=e,this.parse=this.parse.bind(this),this.zt=this.zt.bind(this),this.Vt=this.Vt.bind(this),this.Rt=this.Rt.bind(this),this.Gt=this.Gt.bind(this),this.Wt=this.Wt.bind(this),this.Kt=this.Kt.bind(this),this.Yt=this.Yt.bind(this),this.re=this.re.bind(this),this.te=this.te.bind(this),this.Qt=this.Qt.bind(this),this.$=this.$.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.Xt=this.Xt.bind(this),this.en=this.en.bind(this),this.tn=this.tn.bind(this),this.nn=this.nn.bind(this),this.sn=this.sn.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}re(){return Be.create(this,this.Ft)}te(){return Oe.create(this,this.Ft)}Qt(){return this.te().re()}$(){return fe.create(this)}promise(){return Fe.create(this,this.Ft)}or(e){return ge.create([this,e],this.Ft)}and(e){return ke.create(this,e,this.Ft)}transform(e){return new De({...M(this.Ft),Ht:this,Jt:qe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Pe({...M(this.Ft),rn:this,defaultValue:t,Jt:qe.ZodDefault})}brand(){return new Le({Jt:qe.ZodBranded,type:this,...M(this.Ft)})}catch(e){const t="function"==typeof e?e:()=>e;return new je({...M(this.Ft),rn:this,an:t,Jt:qe.ZodCatch})}Xt(e){return new(0,this.constructor)({...this.Ft,description:e})}en(e){return ze.create(this,e)}tn(){return Ve.create(this)}sn(){return this.zt(void 0).Et}nn(){return this.zt(null).Et}},D=/^c[^\s-]{8,}$/i,B=/^[0-9a-z]+$/,O=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[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,j=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,U=/^[-+]?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)?)??$/,L=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,z=/^(?:(?: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])$/,V=/^(?:(?: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])$/,R=/^(([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]))$/,W=/^(([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])$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,H="((\\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])))",J=new RegExp(`^${H}$`);function Y(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function G(e){return new RegExp(`^${Y(e)}$`)}function Q(e){let t=`${H}T${Y(e)}`;const n=[];return n.push(e.un?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function X(e,t){return!("v4"!==t&&t||!z.test(e))||!("v6"!==t&&t||!R.test(e))}function ee(e,t){if(!C.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(s));return!("object"!=typeof i||null===i||"cn"in i&&"JWT"!==i?.cn||!i.dn||t&&i.dn!==t)}catch{return!1}}function te(e,t){return!("v4"!==t&&t||!V.test(e))||!("v6"!==t&&t||!W.test(e))}var ne=class e extends F{Ut(e){if(this.Ft.M&&(e.data=String(e.data)),this.Dt(e)!==o.string){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.string,ze:t.Ot}),k}const t=new w;let n;for(const i of this.Ft.hn)if("min"===i.kind)e.data.lengthi.value&&(n=this.Bt(e,n),g(n,{code:c.it,rt:i.value,type:"string",nt:!0,tt:!1,message:i.message}),t.bt());else if("length"===i.kind){const s=e.data.length>i.value,r=e.data.lengthe.test(t),{Xe:t,code:c.Qe,...b.At(n)})}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}email(e){return this.pn({kind:"email",...b.At(e)})}url(e){return this.pn({kind:"url",...b.At(e)})}fn(e){return this.pn({kind:"emoji",...b.At(e)})}uuid(e){return this.pn({kind:"uuid",...b.At(e)})}vn(e){return this.pn({kind:"nanoid",...b.At(e)})}yn(e){return this.pn({kind:"cuid",...b.At(e)})}gn(e){return this.pn({kind:"cuid2",...b.At(e)})}bn(e){return this.pn({kind:"ulid",...b.At(e)})}xn(e){return this.pn({kind:"base64",...b.At(e)})}wn(e){return this.pn({kind:"base64url",...b.At(e)})}kn(e){return this.pn({kind:"jwt",...b.At(e)})}Nn(e){return this.pn({kind:"ip",...b.At(e)})}An(e){return this.pn({kind:"cidr",...b.At(e)})}_n(e){return"string"==typeof e?this.pn({kind:"datetime",precision:null,offset:!1,un:!1,message:e}):this.pn({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,un:e?.un??!1,...b.At(e?.message)})}F(e){return this.pn({kind:"date",message:e})}time(e){return"string"==typeof e?this.pn({kind:"time",precision:null,message:e}):this.pn({kind:"time",precision:void 0===e?.precision?null:e?.precision,...b.At(e?.message)})}duration(e){return this.pn({kind:"duration",...b.At(e)})}ln(e,t){return this.pn({kind:"regex",ln:e,...b.At(t)})}includes(e,t){return this.pn({kind:"includes",value:e,position:t?.position,...b.At(t?.message)})}startsWith(e,t){return this.pn({kind:"startsWith",value:e,...b.At(t)})}endsWith(e,t){return this.pn({kind:"endsWith",value:e,...b.At(t)})}min(e,t){return this.pn({kind:"min",value:e,...b.At(t)})}max(e,t){return this.pn({kind:"max",value:e,...b.At(t)})}length(e,t){return this.pn({kind:"length",value:e,...b.At(t)})}Zn(e){return this.min(1,b.At(e))}trim(){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:"trim"}]})}toLowerCase(){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:"toUpperCase"}]})}get $n(){return!!this.Ft.hn.find(e=>"datetime"===e.kind)}get En(){return!!this.Ft.hn.find(e=>"date"===e.kind)}get In(){return!!this.Ft.hn.find(e=>"time"===e.kind)}get Tn(){return!!this.Ft.hn.find(e=>"duration"===e.kind)}get Mn(){return!!this.Ft.hn.find(e=>"email"===e.kind)}get Sn(){return!!this.Ft.hn.find(e=>"url"===e.kind)}get Fn(){return!!this.Ft.hn.find(e=>"emoji"===e.kind)}get Dn(){return!!this.Ft.hn.find(e=>"uuid"===e.kind)}get Bn(){return!!this.Ft.hn.find(e=>"nanoid"===e.kind)}get On(){return!!this.Ft.hn.find(e=>"cuid"===e.kind)}get Pn(){return!!this.Ft.hn.find(e=>"cuid2"===e.kind)}get jn(){return!!this.Ft.hn.find(e=>"ulid"===e.kind)}get Cn(){return!!this.Ft.hn.find(e=>"ip"===e.kind)}get Un(){return!!this.Ft.hn.find(e=>"cidr"===e.kind)}get Ln(){return!!this.Ft.hn.find(e=>"base64"===e.kind)}get zn(){return!!this.Ft.hn.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.values?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}ne.create=e=>new ne({hn:[],Jt:qe.ZodString,M:e?.M??!1,...M(e)});var ie=class e extends F{constructor(){super(...arguments),this.min=this.Vn,this.max=this.Rn,this.step=this.ct}Ut(e){if(this.Ft.M&&(e.data=Number(e.data)),this.Dt(e)!==o.number){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.number,ze:t.Ot}),k}let t;const n=new w;for(const i of this.Ft.hn)"int"===i.kind?s.isInteger(e.data)||(t=this.Bt(e,t),g(t,{code:c.Le,Ve:"integer",ze:"float",message:i.message}),n.bt()):"min"===i.kind?(i.nt?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,rt:i.value,type:"number",nt:i.nt,tt:!1,message:i.message}),n.bt()):"multipleOf"===i.kind?0!==se(e.data,i.value)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),n.bt()):"finite"===i.kind?Number.isFinite(e.data)||(t=this.Bt(e,t),g(t,{code:c.dt,message:i.message}),n.bt()):s.we(i);return{status:n.value,value:e.data}}Vn(e,t){return this.Wn("min",e,!0,b.toString(t))}qn(e,t){return this.Wn("min",e,!1,b.toString(t))}Rn(e,t){return this.Wn("max",e,!0,b.toString(t))}Kn(e,t){return this.Wn("max",e,!1,b.toString(t))}Wn(t,n,s,i){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:t,value:n,nt:s,message:b.toString(i)}]})}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}Hn(e){return this.pn({kind:"int",message:b.toString(e)})}Jn(e){return this.pn({kind:"min",value:0,nt:!1,message:b.toString(e)})}negative(e){return this.pn({kind:"max",value:0,nt:!1,message:b.toString(e)})}Yn(e){return this.pn({kind:"max",value:0,nt:!0,message:b.toString(e)})}Gn(e){return this.pn({kind:"min",value:0,nt:!0,message:b.toString(e)})}ct(e,t){return this.pn({kind:"multipleOf",value:e,message:b.toString(t)})}Qn(e){return this.pn({kind:"finite",message:b.toString(e)})}Xn(e){return this.pn({kind:"min",nt:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)}).pn({kind:"max",nt:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&s.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this.Ft.hn){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.valuenew ie({hn:[],Jt:qe.ZodNumber,M:e?.M||!1,...M(e)});var re=class e extends F{constructor(){super(...arguments),this.min=this.Vn,this.max=this.Rn}Ut(e){if(this.Ft.M)try{e.data=BigInt(e.data)}catch{return this.ts(e)}if(this.Dt(e)!==o.I)return this.ts(e);let t;const n=new w;for(const i of this.Ft.hn)"min"===i.kind?(i.nt?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,type:"bigint",rt:i.value,nt:i.nt,message:i.message}),n.bt()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),n.bt()):s.we(i);return{status:n.value,value:e.data}}ts(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.I,ze:t.Ot}),k}Vn(e,t){return this.Wn("min",e,!0,b.toString(t))}qn(e,t){return this.Wn("min",e,!1,b.toString(t))}Rn(e,t){return this.Wn("max",e,!0,b.toString(t))}Kn(e,t){return this.Wn("max",e,!1,b.toString(t))}Wn(t,n,s,i){return new e({...this.Ft,hn:[...this.Ft.hn,{kind:t,value:n,nt:s,message:b.toString(i)}]})}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}Jn(e){return this.pn({kind:"min",value:BigInt(0),nt:!1,message:b.toString(e)})}negative(e){return this.pn({kind:"max",value:BigInt(0),nt:!1,message:b.toString(e)})}Yn(e){return this.pn({kind:"max",value:BigInt(0),nt:!0,message:b.toString(e)})}Gn(e){return this.pn({kind:"min",value:BigInt(0),nt:!0,message:b.toString(e)})}ct(e,t){return this.pn({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.valuenew re({hn:[],Jt:qe.ZodBigInt,M:e?.M??!1,...M(e)});var ae=class extends F{Ut(e){if(this.Ft.M&&(e.data=Boolean(e.data)),this.Dt(e)!==o.T){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.T,ze:t.Ot}),k}return A(e.data)}};ae.create=e=>new ae({Jt:qe.ZodBoolean,M:e?.M||!1,...M(e)});var oe=class e extends F{Ut(e){if(this.Ft.M&&(e.data=new Date(e.data)),this.Dt(e)!==o.F){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.F,ze:t.Ot}),k}if(Number.isNaN(e.data.getTime()))return g(this.Bt(e),{code:c.Ge}),k;const t=new w;let n;for(const i of this.Ft.hn)"min"===i.kind?e.data.getTime()i.value&&(n=this.Bt(e,n),g(n,{code:c.it,message:i.message,nt:!0,tt:!1,rt:i.value,type:"date"}),t.bt()):s.we(i);return{status:t.value,value:new Date(e.data.getTime())}}pn(t){return new e({...this.Ft,hn:[...this.Ft.hn,t]})}min(e,t){return this.pn({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this.pn({kind:"max",value:e.getTime(),message:b.toString(t)})}get ns(){let e=null;for(const t of this.Ft.hn)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get ss(){let e=null;for(const t of this.Ft.hn)"max"===t.kind&&(null===e||t.valuenew oe({hn:[],M:e?.M||!1,Jt:qe.ZodDate,...M(e)});var ue=class extends F{Ut(e){if(this.Dt(e)!==o.me){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.me,ze:t.Ot}),k}return A(e.data)}};ue.create=e=>new ue({Jt:qe.ZodSymbol,...M(e)});var ce=class extends F{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.undefined,ze:t.Ot}),k}return A(e.data)}};ce.create=e=>new ce({Jt:qe.ZodUndefined,...M(e)});var de=class extends F{Ut(e){if(this.Dt(e)!==o.null){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.null,ze:t.Ot}),k}return A(e.data)}};de.create=e=>new de({Jt:qe.ZodNull,...M(e)});var he=class extends F{constructor(){super(...arguments),this.rs=!0}Ut(e){return A(e.data)}};he.create=e=>new he({Jt:qe.ZodAny,...M(e)});var le=class extends F{constructor(){super(...arguments),this.us=!0}Ut(e){return A(e.data)}};le.create=e=>new le({Jt:qe.ZodUnknown,...M(e)});var me=class extends F{Ut(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ee,ze:t.Ot}),k}};me.create=e=>new me({Jt:qe.ZodNever,...M(e)});var pe=class extends F{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ge,ze:t.Ot}),k}return A(e.data)}};pe.create=e=>new pe({Jt:qe.ZodVoid,...M(e)});var fe=class e extends F{Ut(e){const{jt:t,status:n}=this.Pt(e),s=this.Ft;if(t.Ot!==o.$)return g(t,{code:c.Le,Ve:o.$,ze:t.Ot}),k;if(null!==s.cs){const e=t.data.length>s.cs.value,i=t.data.lengths.maxLength.value&&(g(t,{code:c.it,rt:s.maxLength.value,type:"array",nt:!0,tt:!1,message:s.maxLength.message}),n.bt()),t.yt.async)return Promise.all([...t.data].map((e,n)=>s.type.Lt(new I(t,e,t.path,n)))).then(e=>w.xt(n,e));const i=[...t.data].map((e,n)=>s.type.Ct(new I(t,e,t.path,n)));return w.xt(n,i)}get element(){return this.Ft.type}min(t,n){return new e({...this.Ft,minLength:{value:t,message:b.toString(n)}})}max(t,n){return new e({...this.Ft,maxLength:{value:t,message:b.toString(n)}})}length(t,n){return new e({...this.Ft,cs:{value:t,message:b.toString(n)}})}Zn(e){return this.min(1,e)}};function ve(e){if(e instanceof ye){const t={};for(const n in e.shape){const s=e.shape[n];t[n]=Be.create(ve(s))}return new ye({...e.Ft,shape:()=>t})}return e instanceof fe?new fe({...e.Ft,type:ve(e.element)}):e instanceof Be?Be.create(ve(e.ds())):e instanceof Oe?Oe.create(ve(e.ds())):e instanceof Ne?Ne.create(e.items.map(e=>ve(e))):e}fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,cs:null,Jt:qe.ZodArray,...M(t)});var ye=class e extends F{constructor(){super(...arguments),this.hs=null,this.ls=this.ps,this.fs=this.extend}vs(){if(null!==this.hs)return this.hs;const e=this.Ft.shape(),t=s.Ae(e);return this.hs={shape:e,keys:t},this.hs}Ut(e){if(this.Dt(e)!==o.object){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k}const{status:t,jt:n}=this.Pt(e),{shape:s,keys:i}=this.vs(),r=[];if(!(this.Ft.ys instanceof me&&"strip"===this.Ft.gs))for(const e in n.data)i.includes(e)||r.push(e);const a=[];for(const e of i){const t=s[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t.Ut(new I(n,i,n.path,e)),Nt:e in n.data})}if(this.Ft.ys instanceof me){const e=this.Ft.gs;if("passthrough"===e)for(const e of r)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)r.length>0&&(g(n,{code:c.We,keys:r}),t.bt());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this.Ft.ys;for(const t of r){const s=n.data[t];a.push({key:{status:"valid",value:t},value:e.Ut(new I(n,s,n.path,t)),Nt:t in n.data})}}return n.yt.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const n=await t.key,s=await t.value;e.push({key:n,value:s,Nt:t.Nt})}return e}).then(e=>w.kt(t,e)):w.kt(t,a)}get shape(){return this.Ft.shape()}bs(t){return b.At,new e({...this.Ft,gs:"strict",...void 0!==t?{Tt:(e,n)=>{const s=this.Ft.Tt?.(e,n).message??n.ht;return"unrecognized_keys"===e.code?{message:b.At(t).message??s}:{message:s}}}:{}})}xs(){return new e({...this.Ft,gs:"strip"})}ps(){return new e({...this.Ft,gs:"passthrough"})}extend(t){return new e({...this.Ft,shape:()=>({...this.Ft.shape(),...t})})}ws(t){return new e({gs:t.Ft.gs,ys:t.Ft.ys,shape:()=>({...this.Ft.shape(),...t.Ft.shape()}),Jt:qe.ZodObject})}ks(e,t){return this.fs({[e]:t})}ys(t){return new e({...this.Ft,ys:t})}Ns(t){const n={};for(const e of s.Ae(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this.Ft,shape:()=>n})}As(t){const n={};for(const e of s.Ae(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this.Ft,shape:()=>n})}_s(){return ve(this)}Zs(t){const n={};for(const e of s.Ae(this.shape)){const s=this.shape[e];t&&!t[e]?n[e]=s:n[e]=s.re()}return new e({...this.Ft,shape:()=>n})}required(t){const n={};for(const e of s.Ae(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Be;)t=t.Ft.rn;n[e]=t}return new e({...this.Ft,shape:()=>n})}$s(){return Te(s.Ae(this.shape))}};ye.create=(e,t)=>new ye({shape:()=>e,gs:"strip",ys:me.create(),Jt:qe.ZodObject,...M(t)}),ye.Es=(e,t)=>new ye({shape:()=>e,gs:"strict",ys:me.create(),Jt:qe.ZodObject,...M(t)}),ye.Is=(e,t)=>new ye({shape:e,gs:"strip",ys:me.create(),Jt:qe.ZodObject,...M(t)});var ge=class extends F{Ut(e){const{jt:t}=this.Pt(e),n=this.Ft.options;if(t.yt.async)return Promise.all(n.map(async e=>{const n={...t,yt:{...t.yt,Te:[]},parent:null};return{result:await e.Lt({data:t.data,path:t.path,parent:n}),jt:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.yt.Te.push(...n.jt.yt.Te),n.result;const n=e.map(e=>new h(e.jt.yt.Te));return g(t,{code:c.qe,De:n}),k});{let e;const s=[];for(const i of n){const n={...t,yt:{...t.yt,Te:[]},parent:null},r=i.Ct({data:t.data,path:t.path,parent:n});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,jt:n}),n.yt.Te.length&&s.push(n.yt.Te)}if(e)return t.yt.Te.push(...e.jt.yt.Te),e.result;const i=s.map(e=>new h(e));return g(t,{code:c.qe,De:i}),k}}get options(){return this.Ft.options}};ge.create=(e,t)=>new ge({options:e,Jt:qe.ZodUnion,...M(t)});var be=e=>e instanceof Ee?be(e.Ht):e instanceof De?be(e.rn()):e instanceof Ie?[e.value]:e instanceof Me?e.options:e instanceof Se?s._e(e.P):e instanceof Pe?be(e.Ft.rn):e instanceof ce?[void 0]:e instanceof de?[null]:e instanceof Be?[void 0,...be(e.ds())]:e instanceof Oe?[null,...be(e.ds())]:e instanceof Le||e instanceof Ve?be(e.ds()):e instanceof je?be(e.Ft.rn):[],xe=class e extends F{Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.object)return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k;const n=this.Ts,s=t.data[n],i=this.Ms.get(s);return i?t.yt.async?i.Lt({data:t.data,path:t.path,parent:t}):i.Ct({data:t.data,path:t.path,parent:t}):(g(t,{code:c.Ke,options:Array.from(this.Ms.keys()),path:[n]}),k)}get Ts(){return this.Ft.Ts}get options(){return this.Ft.options}get Ms(){return this.Ft.Ms}static create(t,n,s){const i=new Map;for(const e of n){const n=be(e.shape[t]);if(!n.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of n){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,e)}}return new e({Jt:qe.ZodDiscriminatedUnion,Ts:t,options:n,Ms:i,...M(s)})}};function we(e,t){const n=u(e),i=u(t);if(e===t)return{valid:!0,data:e};if(n===o.object&&i===o.object){const n=s.Ae(t),i=s.Ae(e).filter(e=>-1!==n.indexOf(e)),r={...e,...t};for(const n of i){const s=we(e[n],t[n]);if(!s.valid)return{valid:!1};r[n]=s.data}return{valid:!0,data:r}}if(n===o.$&&i===o.$){if(e.length!==t.length)return{valid:!1};const n=[];for(let s=0;s{if(_(e)||_(s))return k;const i=we(e.value,s.value);return i.valid?((Z(e)||Z(s))&&t.bt(),{status:t.value,value:i.data}):(g(n,{code:c.ot}),k)};return n.yt.async?Promise.all([this.Ft.left.Lt({data:n.data,path:n.path,parent:n}),this.Ft.right.Lt({data:n.data,path:n.path,parent:n})]).then(([e,t])=>s(e,t)):s(this.Ft.left.Ct({data:n.data,path:n.path,parent:n}),this.Ft.right.Ct({data:n.data,path:n.path,parent:n}))}};ke.create=(e,t,n)=>new ke({left:e,right:t,Jt:qe.ZodIntersection,...M(n)});var Ne=class e extends F{Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.$)return g(n,{code:c.Le,Ve:o.$,ze:n.Ot}),k;if(n.data.lengththis.Ft.items.length&&(g(n,{code:c.it,rt:this.Ft.items.length,nt:!0,tt:!1,type:"array"}),t.bt());const s=[...n.data].map((e,t)=>{const s=this.Ft.items[t]||this.Ft.Ss;return s?s.Ut(new I(n,e,n.path,t)):null}).filter(e=>!!e);return n.yt.async?Promise.all(s).then(e=>w.xt(t,e)):w.xt(t,s)}get items(){return this.Ft.items}Ss(t){return new e({...this.Ft,Ss:t})}};Ne.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ne({items:e,Jt:qe.ZodTuple,Ss:null,...M(t)})};var Ae=class e extends F{get Fs(){return this.Ft.Ds}get Bs(){return this.Ft.valueType}Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.object)return g(n,{code:c.Le,Ve:o.object,ze:n.Ot}),k;const s=[],i=this.Ft.Ds,r=this.Ft.valueType;for(const e in n.data)s.push({key:i.Ut(new I(n,e,n.path,e)),value:r.Ut(new I(n,n.data[e],n.path,e)),Nt:e in n.data});return n.yt.async?w.wt(t,s):w.kt(t,s)}get element(){return this.Ft.valueType}static create(t,n,s){return new e(n instanceof F?{Ds:t,valueType:n,Jt:qe.ZodRecord,...M(s)}:{Ds:ne.create(),valueType:t,Jt:qe.ZodRecord,...M(n)})}},_e=class extends F{get Fs(){return this.Ft.Ds}get Bs(){return this.Ft.valueType}Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.map)return g(n,{code:c.Le,Ve:o.map,ze:n.Ot}),k;const s=this.Ft.Ds,i=this.Ft.valueType,r=[...n.data.entries()].map(([e,t],r)=>({key:s.Ut(new I(n,e,n.path,[r,"key"])),value:i.Ut(new I(n,t,n.path,[r,"value"]))}));if(n.yt.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of r){const s=await n.key,i=await n.value;if("aborted"===s.status||"aborted"===i.status)return k;"dirty"!==s.status&&"dirty"!==i.status||t.bt(),e.set(s.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of r){const s=n.key,i=n.value;if("aborted"===s.status||"aborted"===i.status)return k;"dirty"!==s.status&&"dirty"!==i.status||t.bt(),e.set(s.value,i.value)}return{status:t.value,value:e}}}};_e.create=(e,t,n)=>new _e({valueType:t,Ds:e,Jt:qe.ZodMap,...M(n)});var Ze=class e extends F{Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.Ot!==o.set)return g(n,{code:c.Le,Ve:o.set,ze:n.Ot}),k;const s=this.Ft;null!==s.Os&&n.data.sizes.Ps.value&&(g(n,{code:c.it,rt:s.Ps.value,type:"set",nt:!0,tt:!1,message:s.Ps.message}),t.bt());const i=this.Ft.valueType;function r(e){const n=new Set;for(const s of e){if("aborted"===s.status)return k;"dirty"===s.status&&t.bt(),n.add(s.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map((e,t)=>i.Ut(new I(n,e,n.path,t)));return n.yt.async?Promise.all(a).then(e=>r(e)):r(a)}min(t,n){return new e({...this.Ft,Os:{value:t,message:b.toString(n)}})}max(t,n){return new e({...this.Ft,Ps:{value:t,message:b.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}Zn(e){return this.min(1,e)}};Ze.create=(e,t)=>new Ze({valueType:e,Os:null,Ps:null,Jt:qe.ZodSet,...M(t)});var $e=class e extends F{constructor(){super(...arguments),this.validate=this.js}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.j)return g(t,{code:c.Le,Ve:o.j,ze:t.Ot}),k;function n(e,n){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Je,Oe:n}})}function s(e,n){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Ye,Be:n}})}const i={Tt:t.yt.vt},r=t.data;if(this.Ft.Cs instanceof Fe){const e=this;return A(async function(...t){const a=new h([]),o=await e.Ft.Us.Vt(t,i).catch(e=>{throw a.Me(n(t,e)),a}),u=await Reflect.apply(r,this,o);return await e.Ft.Cs.Ft.type.Vt(u,i).catch(e=>{throw a.Me(s(u,e)),a})})}{const e=this;return A(function(...t){const a=e.Ft.Us.zt(t,i);if(!a.Et)throw new h([n(t,a.error)]);const o=Reflect.apply(r,this,a.data),u=e.Ft.Cs.zt(o,i);if(!u.Et)throw new h([s(o,u.error)]);return u.data})}}parameters(){return this.Ft.Us}Ls(){return this.Ft.Cs}Us(...t){return new e({...this.Ft,Us:Ne.create(t).Ss(le.create())})}Cs(t){return new e({...this.Ft,Cs:t})}js(e){return this.parse(e)}zs(e){return this.parse(e)}static create(t,n,s){return new e({Us:t||Ne.create([]).Ss(le.create()),Cs:n||le.create(),Jt:qe.ZodFunction,...M(s)})}},Ee=class extends F{get Ht(){return this.Ft.Vs()}Ut(e){const{jt:t}=this.Pt(e);return this.Ft.Vs().Ut({data:t.data,path:t.path,parent:t})}};Ee.create=(e,t)=>new Ee({Vs:e,Jt:qe.ZodLazy,...M(t)});var Ie=class extends F{Ut(e){if(e.data!==this.Ft.value){const t=this.Bt(e);return g(t,{ze:t.data,code:c.Re,Ve:this.Ft.value}),k}return{status:"valid",value:e.data}}get value(){return this.Ft.value}};function Te(e,t){return new Me({values:e,Jt:qe.ZodEnum,...M(t)})}Ie.create=(e,t)=>new Ie({value:e,Jt:qe.ZodLiteral,...M(t)});var Me=class e extends F{Ut(e){if("string"!=typeof e.data){const t=this.Bt(e),n=this.Ft.values;return g(t,{Ve:s.Ze(n),ze:t.Ot,code:c.Le}),k}if(this.Rs||(this.Rs=new Set(this.Ft.values)),!this.Rs.has(e.data)){const t=this.Bt(e),n=this.Ft.values;return g(t,{ze:t.data,code:c.He,options:n}),k}return A(e.data)}get options(){return this.Ft.values}get P(){const e={};for(const t of this.Ft.values)e[t]=t;return e}get Ws(){const e={};for(const t of this.Ft.values)e[t]=t;return e}get qs(){const e={};for(const t of this.Ft.values)e[t]=t;return e}Ks(t,n=this.Ft){return e.create(t,{...this.Ft,...n})}Hs(t,n=this.Ft){return e.create(this.options.filter(e=>!t.includes(e)),{...this.Ft,...n})}};Me.create=Te;var Se=class extends F{Ut(e){const t=s.Ne(this.Ft.values),n=this.Bt(e);if(n.Ot!==o.string&&n.Ot!==o.number){const e=s._e(t);return g(n,{Ve:s.Ze(e),ze:n.Ot,code:c.Le}),k}if(this.Rs||(this.Rs=new Set(s.Ne(this.Ft.values))),!this.Rs.has(e.data)){const e=s._e(t);return g(n,{ze:n.data,code:c.He,options:e}),k}return A(e.data)}get P(){return this.Ft.values}};Se.create=(e,t)=>new Se({values:e,Jt:qe.ZodNativeEnum,...M(t)});var Fe=class extends F{ds(){return this.Ft.type}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.promise&&!1===t.yt.async)return g(t,{code:c.Le,Ve:o.promise,ze:t.Ot}),k;const n=t.Ot===o.promise?t.data:Promise.resolve(t.data);return A(n.then(e=>this.Ft.type.Vt(e,{path:t.path,Tt:t.yt.vt})))}};Fe.create=(e,t)=>new Fe({type:e,Jt:qe.ZodPromise,...M(t)});var De=class extends F{rn(){return this.Ft.Ht}Js(){return this.Ft.Ht.Ft.Jt===qe.ZodEffects?this.Ft.Ht.Js():this.Ft.Ht}Ut(e){const{status:t,jt:n}=this.Pt(e),i=this.Ft.effect||null,r={Me:e=>{g(n,e),e.fatal?t.abort():t.bt()},get path(){return n.path}};if(r.Me=r.Me.bind(r),"preprocess"===i.type){const e=i.transform(n.data,r);if(n.yt.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return k;const s=await this.Ft.Ht.Lt({data:e,path:n.path,parent:n});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?N(s.value):s});{if("aborted"===t.value)return k;const s=this.Ft.Ht.Ct({data:e,path:n.path,parent:n});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?N(s.value):s}}if("refinement"===i.type){const e=e=>{const t=i.Kt(e,r);if(n.yt.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.yt.async){const s=this.Ft.Ht.Ct({data:n.data,path:n.path,parent:n});return"aborted"===s.status?k:("dirty"===s.status&&t.bt(),e(s.value),{status:t.value,value:s.value})}return this.Ft.Ht.Lt({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?k:("dirty"===n.status&&t.bt(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===i.type){if(!1===n.yt.async){const e=this.Ft.Ht.Ct({data:n.data,path:n.path,parent:n});if(!$(e))return k;const s=i.transform(e.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this.Ft.Ht.Lt({data:n.data,path:n.path,parent:n}).then(e=>$(e)?Promise.resolve(i.transform(e.value,r)).then(e=>({status:t.value,value:e})):k)}s.we(i)}};De.create=(e,t,n)=>new De({Ht:e,Jt:qe.ZodEffects,effect:t,...M(n)}),De.Ys=(e,t,n)=>new De({Ht:t,effect:{type:"preprocess",transform:e},Jt:qe.ZodEffects,...M(n)});var Be=class extends F{Ut(e){return this.Dt(e)===o.undefined?A(void 0):this.Ft.rn.Ut(e)}ds(){return this.Ft.rn}};Be.create=(e,t)=>new Be({rn:e,Jt:qe.ZodOptional,...M(t)});var Oe=class extends F{Ut(e){return this.Dt(e)===o.null?A(null):this.Ft.rn.Ut(e)}ds(){return this.Ft.rn}};Oe.create=(e,t)=>new Oe({rn:e,Jt:qe.ZodNullable,...M(t)});var Pe=class extends F{Ut(e){const{jt:t}=this.Pt(e);let n=t.data;return t.Ot===o.undefined&&(n=this.Ft.defaultValue()),this.Ft.rn.Ut({data:n,path:t.path,parent:t})}Gs(){return this.Ft.rn}};Pe.create=(e,t)=>new Pe({rn:e,Jt:qe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...M(t)});var je=class extends F{Ut(e){const{jt:t}=this.Pt(e),n={...t,yt:{...t.yt,Te:[]}},s=this.Ft.rn.Ut({data:n.data,path:n.path,parent:{...n}});return E(s)?s.then(e=>({status:"valid",value:"valid"===e.status?e.value:this.Ft.an({get error(){return new h(n.yt.Te)},input:n.data})})):{status:"valid",value:"valid"===s.status?s.value:this.Ft.an({get error(){return new h(n.yt.Te)},input:n.data})}}Qs(){return this.Ft.rn}};je.create=(e,t)=>new je({rn:e,Jt:qe.ZodCatch,an:"function"==typeof t.catch?t.catch:()=>t.catch,...M(t)});var Ce=class extends F{Ut(e){if(this.Dt(e)!==o.G){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.G,ze:t.Ot}),k}return{status:"valid",value:e.data}}};Ce.create=e=>new Ce({Jt:qe.ZodNaN,...M(e)});var Ue=Symbol("zod_brand"),Le=class extends F{Ut(e){const{jt:t}=this.Pt(e),n=t.data;return this.Ft.type.Ut({data:n,path:t.path,parent:t})}ds(){return this.Ft.type}},ze=class e extends F{Ut(e){const{status:t,jt:n}=this.Pt(e);if(n.yt.async)return(async()=>{const e=await this.Ft.in.Lt({data:n.data,path:n.path,parent:n});return"aborted"===e.status?k:"dirty"===e.status?(t.bt(),N(e.value)):this.Ft.Xs.Lt({data:e.value,path:n.path,parent:n})})();{const e=this.Ft.in.Ct({data:n.data,path:n.path,parent:n});return"aborted"===e.status?k:"dirty"===e.status?(t.bt(),{status:"dirty",value:e.value}):this.Ft.Xs.Ct({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,Xs:n,Jt:qe.ZodPipeline})}},Ve=class extends F{Ut(e){const t=this.Ft.rn.Ut(e),n=e=>($(e)&&(e.value=Object.freeze(e.value)),e);return E(t)?t.then(e=>n(e)):n(t)}ds(){return this.Ft.rn}};function Re(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function We(e,t={},n){return e?he.create().Yt((s,i)=>{const r=e(s);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Re(t,s),r=e.fatal??n??!0;i.Me({code:"custom",...e,fatal:r})}});if(!r){const e=Re(t,s),r=e.fatal??n??!0;i.Me({code:"custom",...e,fatal:r})}}):he.create()}Ve.create=(e,t)=>new Ve({rn:e,Jt:qe.ZodReadonly,...M(t)});var qe,Ke,He={object:ye.Is};(Ke=qe||(qe={})).ZodString="ZodString",Ke.ZodNumber="ZodNumber",Ke.ZodNaN="ZodNaN",Ke.ZodBigInt="ZodBigInt",Ke.ZodBoolean="ZodBoolean",Ke.ZodDate="ZodDate",Ke.ZodSymbol="ZodSymbol",Ke.ZodUndefined="ZodUndefined",Ke.ZodNull="ZodNull",Ke.ZodAny="ZodAny",Ke.ZodUnknown="ZodUnknown",Ke.ZodNever="ZodNever",Ke.ZodVoid="ZodVoid",Ke.ZodArray="ZodArray",Ke.ZodObject="ZodObject",Ke.ZodUnion="ZodUnion",Ke.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ke.ZodIntersection="ZodIntersection",Ke.ZodTuple="ZodTuple",Ke.ZodRecord="ZodRecord",Ke.ZodMap="ZodMap",Ke.ZodSet="ZodSet",Ke.ZodFunction="ZodFunction",Ke.ZodLazy="ZodLazy",Ke.ZodLiteral="ZodLiteral",Ke.ZodEnum="ZodEnum",Ke.ZodEffects="ZodEffects",Ke.ZodNativeEnum="ZodNativeEnum",Ke.ZodOptional="ZodOptional",Ke.ZodNullable="ZodNullable",Ke.ZodDefault="ZodDefault",Ke.ZodCatch="ZodCatch",Ke.ZodPromise="ZodPromise",Ke.ZodBranded="ZodBranded",Ke.ZodPipeline="ZodPipeline",Ke.ZodReadonly="ZodReadonly";var Je=(e,t={message:`Input not instance of ${e.name}`})=>We(t=>t instanceof e,t),Ye=ne.create,Ge=ie.create,Qe=Ce.create,Xe=re.create,et=ae.create,tt=oe.create,nt=ue.create,st=ce.create,it=de.create,rt=he.create,at=le.create,ot=me.create,ut=pe.create,ct=fe.create,dt=ye.create,ht=ye.Es,lt=ge.create,mt=xe.create,pt=ke.create,ft=Ne.create,vt=Ae.create,yt=_e.create,gt=Ze.create,bt=$e.create,xt=Ee.create,wt=Ie.create,kt=Me.create,Nt=Se.create,At=Fe.create,_t=De.create,Zt=Be.create,$t=Oe.create,Et=De.Ys,It=ze.create,Tt=()=>Ye().re(),Mt=()=>Ge().re(),St=()=>et().re(),Ft={string:e=>ne.create({...e,M:!0}),number:e=>ie.create({...e,M:!0}),T:e=>ae.create({...e,M:!0}),I:e=>re.create({...e,M:!0}),F:e=>oe.create({...e,M:!0})},Dt=k,Bt=a,Ot=Bt.object({ei:Bt.object({ti:Bt.string(),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re()}),ii:Bt.object({name:Bt.string(),ri:Bt.string()}).re(),ai:Bt.$(Bt.object({name:Bt.string().re(),enabled:Bt.T(),coords:Bt.object({oi:Bt.number(),ui:Bt.number(),px:Bt.number(),ci:Bt.number()}),sources:Bt.$(Bt.string()),di:Bt.number().re(),animation:Bt.object({hi:Bt.number().re(),li:Bt.number().re(),frameCount:Bt.number().re(),mi:Bt.number().re(),pi:Bt.number().re(),fi:Bt.number().re(),yi:Bt.number().re(),startTime:Bt.number().re(),looping:Bt.T().re()}).re(),uuid:Bt.string()})),gi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()})),bi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()}))}),Pt=Bt.object({name:Bt.string().re(),coords:Bt.$(Bt.number()),xi:Bt.number().re(),enabled:Bt.T(),wi:Bt.string().re(),uuid:Bt.string()}),jt=Bt.object({name:Bt.string().re(),url:Bt.string(),ki:Bt.$(Bt.object({xi:Bt.number().re(),uuid:Bt.string()})).re()}),Ct=Bt.object({ti:Bt.string(),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re(),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),ai:Bt.$(Pt),links:Bt.$(jt).re()}),Ut=document.querySelector("#bm-manage-templates table");Ut&&"TABLE"===Ut.nodeName.toLocaleUpperCase()&&(Ut=Ut.children[0])&&"BM"===Vt.getType()&&Vt.get().ai.forEach((e,t)=>{const s=n("tr",{id:"main-row"}),i=n("td",{textContent:t.toString()}),r=n("td",{textContent:e.name||"unnamed-0"}),a=document.createElement("td"),o=n("button",{id:"enable"});a.appendChild(o);const u=document.createElement("td"),c=n("button",{id:"exportAdd"});u.appendChild(c);const d=document.createElement("td"),h=n("div",{className:"shifts-container"}),l=n("button",{id:"up"}),m=n("button",{id:"down"});h.append(l,m),d.appendChild(h),s.append(i,r,a,u,d)});var Lt={"bm-create-template":"flex","bm-main-overlay":"flex","bm-manage-links":"flex","bm-manage-templates":"flex"},zt=document.createElement("style");zt.textContent="",document.body.appendChild(zt),document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n
\n
\n
\n

Create new template

\n \n
\n
\n
\n \n
\n \n \n \n \n \n
\n
\n

Drag and drop an image here

\n

-- or --

\n \n
\n
\n \n
\n
',document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n
\n
\n
\n

Blue Marble

\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
Name:
Droplets:
Next level in...
\n
\n \n \n
\n
\n

Made by SwingTheVine

\n
\n\n',document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n ',document.querySelector("body").innerHTML+='\x3c!-- body --\x3e\n
\n
\n
\n

Template manager

\n \n
\n
\n \n \n \n
\n \n \n \n \n \n \n \x3c!--list of templates goes here--\x3e\n
\n #\n \n \n Name\n \n Enabled\n \n Export\n
\n
\n \n
';var Vt=new class{constructor(e){t(this,"object"),t(this,"type"),this.object=e,e&&(Ot.zt(e).Et?this.type="CHA":Ct.zt(e).Et?this.type="BM":this.type="N/A")}update(e){if(Ct.zt(e).Et)this.type="BM";else{if(!Ot.zt(e).Et)return;this.type="CHA"}this.object=e}get(){return this.object}getType(){return this.type}Ni(){"N/A"!==this.type&&"CHA"!==this.type&&("BM"===this.type&&(this.object=this.object,this.object={ei:{ti:"Charity",ni:"0.1.0",si:this.object.si},ai:this.object.ai.map(e=>({name:e.name,enabled:e.enabled||!1,coords:{oi:e.coords[0],ui:e.coords[1],px:e.coords[2],ci:e.coords[3]},sources:[e.wi||""],di:e.xi,uuid:e.uuid})),gi:[],bi:[]}),this.type="CHA")}Ai(){"N/A"!==this.type&&"BM"!==this.type&&("CHA"===this.type&&(this.object=this.object,this.object={ti:"BlueMarble",ni:"0.1.0",si:this.object.ei.si,ai:this.object.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,wi:e.sources[0],uuid:e.uuid}))}),this.type="BM")}appendData(e){"BM"===this.type&&(this.object=this.object,Ot.parse(e)?this.object.ai.push(...e.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,wi:e.sources[0],uuid:e.uuid}))):Ct.parse(e)&&(this.object.ai.push(...e.ai),this.object.links?e.links&&this.object.links.push(...e.links):this.object.links=e.links))}Zi(e){"BM"===this.type&&this.object.ai.push(e)}$i(e){"BM"===this.type&&(this.object=this.object,this.object.links?this.object.links.push(e):this.object.links=[e])}Ei(e,t){if("N/A"===this.type)return null;if(this.object.hasOwnProperty("links")){const n=this.object;return{...n,ai:e?e.map(e=>!!(Number.isInteger(e)&&e>=0&&n.ai.length!!(Number.isInteger(e)&&e>=0&&n.links.length!!(Number.isInteger(e)&&e>=0&&n.ai.length{console.log("test"),console.log("test")})}()})();},});})(); \ No newline at end of file +(function (){ return ({ patches: [], load: () => {(()=>{var e=Object.defineProperty,t=(t,s,n)=>((t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n)(t,"symbol"!=typeof s?s+"":s,n);function s(e,t){const s=document.createElement(e);return t&&Object.entries(t).forEach(([e,t])=>{"className"===e?s.setAttribute("class",t):s.setAttribute(e,t)}),s}new Blob;var n,i,r,a={};((t,s)=>{for(var n in s)e(t,n,{get:s[n],enumerable:!0})})(a,{t:()=>Ue,i:()=>N,o:()=>y,u:()=>k,NEVER:()=>Dt,OK:()=>A,h:()=>x,l:()=>M,ZodAny:()=>he,ZodArray:()=>fe,ZodBigInt:()=>re,ZodBoolean:()=>ae,ZodBranded:()=>Le,ZodCatch:()=>je,ZodDate:()=>oe,ZodDefault:()=>Pe,ZodDiscriminatedUnion:()=>be,ZodEffects:()=>De,ZodEnum:()=>Te,m:()=>h,p:()=>qe,ZodFunction:()=>$e,ZodIntersection:()=>ke,v:()=>c,ZodLazy:()=>Ie,ZodLiteral:()=>Ee,ZodMap:()=>_e,ZodNaN:()=>Ce,ZodNativeEnum:()=>Se,ZodNever:()=>me,ZodNull:()=>de,ZodNullable:()=>Oe,ZodNumber:()=>ie,ZodObject:()=>ye,ZodOptional:()=>Be,k:()=>o,ZodPipeline:()=>ze,ZodPromise:()=>Me,ZodReadonly:()=>Ve,ZodRecord:()=>Ae,N:()=>M,ZodSet:()=>Ze,ZodString:()=>se,ZodSymbol:()=>ue,A:()=>De,ZodTuple:()=>Ne,_:()=>M,ZodUndefined:()=>ce,ZodUnion:()=>ge,ZodUnknown:()=>le,ZodVoid:()=>pe,Z:()=>g,any:()=>rt,$:()=>ct,I:()=>Xe,F:()=>et,T:()=>Mt,S:()=>We,M:()=>tt,D:()=>Q,B:()=>l,O:()=>mt,effect:()=>_t,P:()=>kt,j:()=>wt,C:()=>f,U:()=>u,L:()=>Je,intersection:()=>pt,V:()=>_,R:()=>I,W:()=>Z,q:()=>$,K:()=>He,H:()=>bt,J:()=>xt,Y:()=>v,map:()=>yt,G:()=>Qe,X:()=>Nt,ee:()=>ot,null:()=>it,te:()=>$t,number:()=>Ge,object:()=>dt,se:()=>r,ne:()=>St,ie:()=>Tt,re:()=>Zt,ae:()=>Ft,oe:()=>Et,ue:()=>It,promise:()=>At,ce:()=>d,de:()=>vt,set:()=>gt,he:()=>p,le:()=>ht,string:()=>Ye,me:()=>st,pe:()=>_t,fe:()=>ft,undefined:()=>nt,union:()=>lt,ve:()=>at,ye:()=>n,ge:()=>ut}),(i=n||(n={})).we=e=>{},i.be=function(e){},i.xe=function(e){throw new Error},i.ke=e=>{const t={};for(const s of e)t[s]=s;return t},i.Ne=e=>{const t=i.Ae(e).filter(t=>"number"!=typeof e[e[t]]),s={};for(const n of t)s[n]=e[n];return i._e(s)},i._e=e=>i.Ae(e).map(function(t){return e[t]}),i.Ae="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},i.find=(e,t)=>{for(const s of e)if(t(s))return s},i.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,i.Ze=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},i.$e=(e,t)=>"bigint"==typeof t?t.toString():t,(r||(r={})).Ie=(e,t)=>({...e,...t});var o=n.ke(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),u=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(e)?o.G:o.number;case"boolean":return o.F;case"function":return o.j;case"bigint":return o.I;case"symbol":return o.me;case"object":return Array.isArray(e)?o.$:null===e?o.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?o.promise:"undefined"!=typeof Map&&e instanceof Map?o.map:"undefined"!=typeof Set&&e instanceof Set?o.set:"undefined"!=typeof Date&&e instanceof Date?o.M:o.object;default:return o.ve}},c=n.ke(["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"]),d=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),h=class e extends Error{get Ee(){return this.Fe}constructor(e){super(),this.Fe=[],this.Te=e=>{this.Fe=[...this.Fe,e]},this.Se=(e=[])=>{this.Fe=[...this.Fe,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.Fe=e}format(e){const t=e||function(e){return e.message},s={Me:[]},n=e=>{for(const i of e.Fe)if("invalid_union"===i.code)i.De.map(n);else if("invalid_return_type"===i.code)n(i.Be);else if("invalid_arguments"===i.code)n(i.Oe);else if(0===i.path.length)s.Me.push(t(i));else{let e=s,n=0;for(;ne.message){const t={},s=[];for(const n of this.Fe)if(n.path.length>0){const s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else s.push(e(n));return{Ce:s,Ue:t}}get Ce(){return this.je()}};h.create=e=>new h(e);var l=(e,t)=>{let s;switch(e.code){case c.Le:s=e.ze===o.undefined?"Required":`Expected ${e.Ve}, received ${e.ze}`;break;case c.Re:s=`Invalid literal value, expected ${JSON.stringify(e.Ve,n.$e)}`;break;case c.We:s=`Unrecognized key(s) in object: ${n.Ze(e.keys,", ")}`;break;case c.qe:s="Invalid input";break;case c.Ke:s=`Invalid discriminator value. Expected ${n.Ze(e.options)}`;break;case c.He:s=`Invalid enum value. Expected ${n.Ze(e.options)}, received '${e.ze}'`;break;case c.Je:s="Invalid function arguments";break;case c.Ye:s="Invalid function return type";break;case c.Ge:s="Invalid date";break;case c.Qe:"object"==typeof e.Xe?"includes"in e.Xe?(s=`Invalid input: must include "${e.Xe.includes}"`,"number"==typeof e.Xe.position&&(s=`${s} at one or more positions greater than or equal to ${e.Xe.position}`)):"startsWith"in e.Xe?s=`Invalid input: must start with "${e.Xe.startsWith}"`:"endsWith"in e.Xe?s=`Invalid input: must end with "${e.Xe.endsWith}"`:n.xe(e.Xe):s="regex"!==e.Xe?`Invalid ${e.Xe}`:"Invalid";break;case c.et:s="array"===e.type?`Array must contain ${e.tt?"exactly":e.st?"at least":"more than"} ${e.nt} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.st?"at least":"over"} ${e.nt} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.tt?"exactly equal to ":e.st?"greater than or equal to ":"greater than "}${e.nt}`:"date"===e.type?`Date must be ${e.tt?"exactly equal to ":e.st?"greater than or equal to ":"greater than "}${new Date(Number(e.nt))}`:"Invalid input";break;case c.it:s="array"===e.type?`Array must contain ${e.tt?"exactly":e.st?"at most":"less than"} ${e.rt} element(s)`:"string"===e.type?`String must contain ${e.tt?"exactly":e.st?"at most":"under"} ${e.rt} character(s)`:"number"===e.type?`Number must be ${e.tt?"exactly":e.st?"less than or equal to":"less than"} ${e.rt}`:"bigint"===e.type?`BigInt must be ${e.tt?"exactly":e.st?"less than or equal to":"less than"} ${e.rt}`:"date"===e.type?`Date must be ${e.tt?"exactly":e.st?"smaller than or equal to":"smaller than"} ${new Date(Number(e.rt))}`:"Invalid input";break;case c.S:s="Invalid input";break;case c.ot:s="Intersection results could not be merged";break;case c.ut:s=`Number must be a multiple of ${e.ct}`;break;case c.dt:s="Number must be finite";break;default:s=t.ht,n.xe(e)}return{message:s}},m=l;function p(e){m=e}function f(){return m}var v=e=>{const{data:t,path:s,lt:n,ft:i}=e,r=[...s,...i.path||[]],a={...i,path:r};if(void 0!==i.message)return{...i,path:r,message:i.message};let o="";const u=n.filter(e=>!!e).slice().reverse();for(const e of u)o=e(a,{data:t,ht:o}).message;return{...i,path:r,message:o}},y=[];function g(e,t){const s=f(),n=v({ft:t,data:e.data,path:e.path,lt:[e.yt.vt,e.gt,s,s===l?void 0:l].filter(e=>!!e)});e.yt.Fe.push(n)}var w,b,x=class e{constructor(){this.value="valid"}wt(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static bt(e,t){const s=[];for(const n of t){if("aborted"===n.status)return k;"dirty"===n.status&&e.wt(),s.push(n.value)}return{status:e.value,value:s}}static async xt(t,s){const n=[];for(const e of s){const t=await e.key,s=await e.value;n.push({key:t,value:s})}return e.kt(t,n)}static kt(e,t){const s={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return k;if("aborted"===i.status)return k;"dirty"===t.status&&e.wt(),"dirty"===i.status&&e.wt(),"__proto__"===t.value||void 0===i.value&&!n.Nt||(s[t.value]=i.value)}return{status:e.value,value:s}}},k=Object.freeze({status:"aborted"}),N=e=>({status:"dirty",value:e}),A=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,Z=e=>"dirty"===e.status,$=e=>"valid"===e.status,I=e=>"undefined"!=typeof Promise&&e instanceof Promise;(b=w||(w={})).At=e=>"string"==typeof e?{message:e}:e||{},b.toString=e=>"string"==typeof e?e:e?.message;var E=class{constructor(e,t,s,n){this._t=[],this.parent=e,this.data=t,this.Zt=s,this.$t=n}get path(){return this._t.length||(Array.isArray(this.$t)?this._t.push(...this.Zt,...this.$t):this._t.push(...this.Zt,this.$t)),this._t}},F=(e,t)=>{if($(t))return{It:!0,data:t.value};if(!e.yt.Fe.length)throw new Error("Validation failed but no issues detected.");return{It:!1,get error(){if(this.Et)return this.Et;const t=new h(e.yt.Fe);return this.Et=t,this.Et}}};function T(e){if(!e)return{};const{Ft:t,Tt:s,St:n,description:i}=e;if(t&&(s||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{Ft:t,description:i}:{Ft:(t,i)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??i.ht}:void 0===i.data?{message:r??n??i.ht}:"invalid_type"!==t.code?{message:i.ht}:{message:r??s??i.ht}},description:i}}var S,M=class{get description(){return this.Mt.description}Dt(e){return u(e.data)}Bt(e,t){return t||{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Mt.Ft,path:e.path,parent:e.parent}}Pt(e){return{status:new x,jt:{yt:e.parent.yt,data:e.data,Ot:u(e.data),gt:this.Mt.Ft,path:e.path,parent:e.parent}}}Ct(e){const t=this.Ut(e);if(I(t))throw new Error("Synchronous parse encountered promise.");return t}Lt(e){const t=this.Ut(e);return Promise.resolve(t)}parse(e,t){const s=this.zt(e,t);if(s.It)return s.data;throw s.error}zt(e,t){const s={yt:{Fe:[],async:t?.async??!1,vt:t?.Ft},path:t?.path||[],gt:this.Mt.Ft,parent:null,data:e,Ot:u(e)},n=this.Ct({data:e,path:s.path,parent:s});return F(s,n)}"~validate"(e){const t={yt:{Fe:[],async:!!this["~standard"].async},path:[],gt:this.Mt.Ft,parent:null,data:e,Ot:u(e)};if(!this["~standard"].async)try{const s=this.Ct({data:e,path:[],parent:t});return $(s)?{value:s.value}:{Fe:t.yt.Fe}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.yt={Fe:[],async:!0}}return this.Lt({data:e,path:[],parent:t}).then(e=>$(e)?{value:e.value}:{Fe:t.yt.Fe})}async Vt(e,t){const s=await this.Rt(e,t);if(s.It)return s.data;throw s.error}async Rt(e,t){const s={yt:{Fe:[],vt:t?.Ft,async:!0},path:t?.path||[],gt:this.Mt.Ft,parent:null,data:e,Ot:u(e)},n=this.Ut({data:e,path:s.path,parent:s}),i=await(I(n)?n:Promise.resolve(n));return F(s,i)}Wt(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this.qt((t,n)=>{const i=e(t),r=()=>n.Te({code:c.S,...s(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(r(),!1)):!!i||(r(),!1)})}Kt(e,t){return this.qt((s,n)=>!!e(s)||(n.Te("function"==typeof t?t(s,n):t),!1))}qt(e){return new De({Ht:this,Jt:qe.ZodEffects,effect:{type:"refinement",Kt:e}})}Yt(e){return this.qt(e)}constructor(e){this.Gt=this.Rt,this.Mt=e,this.parse=this.parse.bind(this),this.zt=this.zt.bind(this),this.Vt=this.Vt.bind(this),this.Rt=this.Rt.bind(this),this.Gt=this.Gt.bind(this),this.Wt=this.Wt.bind(this),this.Kt=this.Kt.bind(this),this.Yt=this.Yt.bind(this),this.re=this.re.bind(this),this.te=this.te.bind(this),this.Qt=this.Qt.bind(this),this.$=this.$.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.Xt=this.Xt.bind(this),this.es=this.es.bind(this),this.ts=this.ts.bind(this),this.ss=this.ss.bind(this),this.ns=this.ns.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}re(){return Be.create(this,this.Mt)}te(){return Oe.create(this,this.Mt)}Qt(){return this.te().re()}$(){return fe.create(this)}promise(){return Me.create(this,this.Mt)}or(e){return ge.create([this,e],this.Mt)}and(e){return ke.create(this,e,this.Mt)}transform(e){return new De({...T(this.Mt),Ht:this,Jt:qe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Pe({...T(this.Mt),rs:this,defaultValue:t,Jt:qe.ZodDefault})}brand(){return new Le({Jt:qe.ZodBranded,type:this,...T(this.Mt)})}catch(e){const t="function"==typeof e?e:()=>e;return new je({...T(this.Mt),rs:this,us:t,Jt:qe.ZodCatch})}Xt(e){return new(0,this.constructor)({...this.Mt,description:e})}es(e){return ze.create(this,e)}ts(){return Ve.create(this)}ns(){return this.zt(void 0).It}ss(){return this.zt(null).It}},D=/^c[^\s-]{8,}$/i,B=/^[0-9a-z]+$/,O=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[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,j=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,U=/^[-+]?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)?)??$/,L=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,z=/^(?:(?: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])$/,V=/^(?:(?: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])$/,R=/^(([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]))$/,W=/^(([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])$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,H="((\\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])))",J=new RegExp(`^${H}$`);function Y(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function G(e){return new RegExp(`^${Y(e)}$`)}function Q(e){let t=`${H}T${Y(e)}`;const s=[];return s.push(e.cs?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function X(e,t){return!("v4"!==t&&t||!z.test(e))||!("v6"!==t&&t||!R.test(e))}function ee(e,t){if(!C.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(n));return!("object"!=typeof i||null===i||"ds"in i&&"JWT"!==i?.ds||!i.hs||t&&i.hs!==t)}catch{return!1}}function te(e,t){return!("v4"!==t&&t||!V.test(e))||!("v6"!==t&&t||!W.test(e))}var se=class e extends M{Ut(e){if(this.Mt.T&&(e.data=String(e.data)),this.Dt(e)!==o.string){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.string,ze:t.Ot}),k}const t=new x;let s;for(const i of this.Mt.ls)if("min"===i.kind)e.data.lengthi.value&&(s=this.Bt(e,s),g(s,{code:c.it,rt:i.value,type:"string",st:!0,tt:!1,message:i.message}),t.wt());else if("length"===i.kind){const n=e.data.length>i.value,r=e.data.lengthe.test(t),{Xe:t,code:c.Qe,...w.At(s)})}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}email(e){return this.vs({kind:"email",...w.At(e)})}url(e){return this.vs({kind:"url",...w.At(e)})}ys(e){return this.vs({kind:"emoji",...w.At(e)})}uuid(e){return this.vs({kind:"uuid",...w.At(e)})}gs(e){return this.vs({kind:"nanoid",...w.At(e)})}ws(e){return this.vs({kind:"cuid",...w.At(e)})}bs(e){return this.vs({kind:"cuid2",...w.At(e)})}xs(e){return this.vs({kind:"ulid",...w.At(e)})}ks(e){return this.vs({kind:"base64",...w.At(e)})}Ns(e){return this.vs({kind:"base64url",...w.At(e)})}As(e){return this.vs({kind:"jwt",...w.At(e)})}_s(e){return this.vs({kind:"ip",...w.At(e)})}Zs(e){return this.vs({kind:"cidr",...w.At(e)})}$s(e){return"string"==typeof e?this.vs({kind:"datetime",precision:null,offset:!1,cs:!1,message:e}):this.vs({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,cs:e?.cs??!1,...w.At(e?.message)})}M(e){return this.vs({kind:"date",message:e})}time(e){return"string"==typeof e?this.vs({kind:"time",precision:null,message:e}):this.vs({kind:"time",precision:void 0===e?.precision?null:e?.precision,...w.At(e?.message)})}duration(e){return this.vs({kind:"duration",...w.At(e)})}ps(e,t){return this.vs({kind:"regex",ps:e,...w.At(t)})}includes(e,t){return this.vs({kind:"includes",value:e,position:t?.position,...w.At(t?.message)})}startsWith(e,t){return this.vs({kind:"startsWith",value:e,...w.At(t)})}endsWith(e,t){return this.vs({kind:"endsWith",value:e,...w.At(t)})}min(e,t){return this.vs({kind:"min",value:e,...w.At(t)})}max(e,t){return this.vs({kind:"max",value:e,...w.At(t)})}length(e,t){return this.vs({kind:"length",value:e,...w.At(t)})}Is(e){return this.min(1,w.At(e))}trim(){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:"trim"}]})}toLowerCase(){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:"toUpperCase"}]})}get Es(){return!!this.Mt.ls.find(e=>"datetime"===e.kind)}get Fs(){return!!this.Mt.ls.find(e=>"date"===e.kind)}get Ts(){return!!this.Mt.ls.find(e=>"time"===e.kind)}get Ss(){return!!this.Mt.ls.find(e=>"duration"===e.kind)}get Ms(){return!!this.Mt.ls.find(e=>"email"===e.kind)}get Ds(){return!!this.Mt.ls.find(e=>"url"===e.kind)}get Bs(){return!!this.Mt.ls.find(e=>"emoji"===e.kind)}get Os(){return!!this.Mt.ls.find(e=>"uuid"===e.kind)}get Ps(){return!!this.Mt.ls.find(e=>"nanoid"===e.kind)}get js(){return!!this.Mt.ls.find(e=>"cuid"===e.kind)}get Cs(){return!!this.Mt.ls.find(e=>"cuid2"===e.kind)}get Us(){return!!this.Mt.ls.find(e=>"ulid"===e.kind)}get Ls(){return!!this.Mt.ls.find(e=>"ip"===e.kind)}get zs(){return!!this.Mt.ls.find(e=>"cidr"===e.kind)}get Vs(){return!!this.Mt.ls.find(e=>"base64"===e.kind)}get Rs(){return!!this.Mt.ls.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.valuen?s:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}se.create=e=>new se({ls:[],Jt:qe.ZodString,T:e?.T??!1,...T(e)});var ie=class e extends M{constructor(){super(...arguments),this.min=this.Ws,this.max=this.qs,this.step=this.ct}Ut(e){if(this.Mt.T&&(e.data=Number(e.data)),this.Dt(e)!==o.number){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.number,ze:t.Ot}),k}let t;const s=new x;for(const i of this.Mt.ls)"int"===i.kind?n.isInteger(e.data)||(t=this.Bt(e,t),g(t,{code:c.Le,Ve:"integer",ze:"float",message:i.message}),s.wt()):"min"===i.kind?(i.st?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,rt:i.value,type:"number",st:i.st,tt:!1,message:i.message}),s.wt()):"multipleOf"===i.kind?0!==ne(e.data,i.value)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),s.wt()):"finite"===i.kind?Number.isFinite(e.data)||(t=this.Bt(e,t),g(t,{code:c.dt,message:i.message}),s.wt()):n.xe(i);return{status:s.value,value:e.data}}Ws(e,t){return this.Ks("min",e,!0,w.toString(t))}Hs(e,t){return this.Ks("min",e,!1,w.toString(t))}qs(e,t){return this.Ks("max",e,!0,w.toString(t))}Js(e,t){return this.Ks("max",e,!1,w.toString(t))}Ks(t,s,n,i){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:t,value:s,st:n,message:w.toString(i)}]})}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}Ys(e){return this.vs({kind:"int",message:w.toString(e)})}Gs(e){return this.vs({kind:"min",value:0,st:!1,message:w.toString(e)})}negative(e){return this.vs({kind:"max",value:0,st:!1,message:w.toString(e)})}Qs(e){return this.vs({kind:"max",value:0,st:!0,message:w.toString(e)})}Xs(e){return this.vs({kind:"min",value:0,st:!0,message:w.toString(e)})}ct(e,t){return this.vs({kind:"multipleOf",value:e,message:w.toString(t)})}en(e){return this.vs({kind:"finite",message:w.toString(e)})}tn(e){return this.vs({kind:"min",st:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)}).vs({kind:"max",st:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&n.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this.Mt.ls){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.valuenew ie({ls:[],Jt:qe.ZodNumber,T:e?.T||!1,...T(e)});var re=class e extends M{constructor(){super(...arguments),this.min=this.Ws,this.max=this.qs}Ut(e){if(this.Mt.T)try{e.data=BigInt(e.data)}catch{return this.nn(e)}if(this.Dt(e)!==o.I)return this.nn(e);let t;const s=new x;for(const i of this.Mt.ls)"min"===i.kind?(i.st?e.datai.value:e.data>=i.value)&&(t=this.Bt(e,t),g(t,{code:c.it,type:"bigint",rt:i.value,st:i.st,message:i.message}),s.wt()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this.Bt(e,t),g(t,{code:c.ut,ct:i.value,message:i.message}),s.wt()):n.xe(i);return{status:s.value,value:e.data}}nn(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.I,ze:t.Ot}),k}Ws(e,t){return this.Ks("min",e,!0,w.toString(t))}Hs(e,t){return this.Ks("min",e,!1,w.toString(t))}qs(e,t){return this.Ks("max",e,!0,w.toString(t))}Js(e,t){return this.Ks("max",e,!1,w.toString(t))}Ks(t,s,n,i){return new e({...this.Mt,ls:[...this.Mt.ls,{kind:t,value:s,st:n,message:w.toString(i)}]})}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}Gs(e){return this.vs({kind:"min",value:BigInt(0),st:!1,message:w.toString(e)})}negative(e){return this.vs({kind:"max",value:BigInt(0),st:!1,message:w.toString(e)})}Qs(e){return this.vs({kind:"max",value:BigInt(0),st:!0,message:w.toString(e)})}Xs(e){return this.vs({kind:"min",value:BigInt(0),st:!0,message:w.toString(e)})}ct(e,t){return this.vs({kind:"multipleOf",value:e,message:w.toString(t)})}get minValue(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.valuenew re({ls:[],Jt:qe.ZodBigInt,T:e?.T??!1,...T(e)});var ae=class extends M{Ut(e){if(this.Mt.T&&(e.data=Boolean(e.data)),this.Dt(e)!==o.F){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.F,ze:t.Ot}),k}return A(e.data)}};ae.create=e=>new ae({Jt:qe.ZodBoolean,T:e?.T||!1,...T(e)});var oe=class e extends M{Ut(e){if(this.Mt.T&&(e.data=new Date(e.data)),this.Dt(e)!==o.M){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.M,ze:t.Ot}),k}if(Number.isNaN(e.data.getTime()))return g(this.Bt(e),{code:c.Ge}),k;const t=new x;let s;for(const i of this.Mt.ls)"min"===i.kind?e.data.getTime()i.value&&(s=this.Bt(e,s),g(s,{code:c.it,message:i.message,st:!0,tt:!1,rt:i.value,type:"date"}),t.wt()):n.xe(i);return{status:t.value,value:new Date(e.data.getTime())}}vs(t){return new e({...this.Mt,ls:[...this.Mt.ls,t]})}min(e,t){return this.vs({kind:"min",value:e.getTime(),message:w.toString(t)})}max(e,t){return this.vs({kind:"max",value:e.getTime(),message:w.toString(t)})}get rn(){let e=null;for(const t of this.Mt.ls)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get an(){let e=null;for(const t of this.Mt.ls)"max"===t.kind&&(null===e||t.valuenew oe({ls:[],T:e?.T||!1,Jt:qe.ZodDate,...T(e)});var ue=class extends M{Ut(e){if(this.Dt(e)!==o.me){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.me,ze:t.Ot}),k}return A(e.data)}};ue.create=e=>new ue({Jt:qe.ZodSymbol,...T(e)});var ce=class extends M{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.undefined,ze:t.Ot}),k}return A(e.data)}};ce.create=e=>new ce({Jt:qe.ZodUndefined,...T(e)});var de=class extends M{Ut(e){if(this.Dt(e)!==o.null){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.null,ze:t.Ot}),k}return A(e.data)}};de.create=e=>new de({Jt:qe.ZodNull,...T(e)});var he=class extends M{constructor(){super(...arguments),this.un=!0}Ut(e){return A(e.data)}};he.create=e=>new he({Jt:qe.ZodAny,...T(e)});var le=class extends M{constructor(){super(...arguments),this.cn=!0}Ut(e){return A(e.data)}};le.create=e=>new le({Jt:qe.ZodUnknown,...T(e)});var me=class extends M{Ut(e){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ee,ze:t.Ot}),k}};me.create=e=>new me({Jt:qe.ZodNever,...T(e)});var pe=class extends M{Ut(e){if(this.Dt(e)!==o.undefined){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.ge,ze:t.Ot}),k}return A(e.data)}};pe.create=e=>new pe({Jt:qe.ZodVoid,...T(e)});var fe=class e extends M{Ut(e){const{jt:t,status:s}=this.Pt(e),n=this.Mt;if(t.Ot!==o.$)return g(t,{code:c.Le,Ve:o.$,ze:t.Ot}),k;if(null!==n.dn){const e=t.data.length>n.dn.value,i=t.data.lengthn.maxLength.value&&(g(t,{code:c.it,rt:n.maxLength.value,type:"array",st:!0,tt:!1,message:n.maxLength.message}),s.wt()),t.yt.async)return Promise.all([...t.data].map((e,s)=>n.type.Lt(new E(t,e,t.path,s)))).then(e=>x.bt(s,e));const i=[...t.data].map((e,s)=>n.type.Ct(new E(t,e,t.path,s)));return x.bt(s,i)}get element(){return this.Mt.type}min(t,s){return new e({...this.Mt,minLength:{value:t,message:w.toString(s)}})}max(t,s){return new e({...this.Mt,maxLength:{value:t,message:w.toString(s)}})}length(t,s){return new e({...this.Mt,dn:{value:t,message:w.toString(s)}})}Is(e){return this.min(1,e)}};function ve(e){if(e instanceof ye){const t={};for(const s in e.shape){const n=e.shape[s];t[s]=Be.create(ve(n))}return new ye({...e.Mt,shape:()=>t})}return e instanceof fe?new fe({...e.Mt,type:ve(e.element)}):e instanceof Be?Be.create(ve(e.hn())):e instanceof Oe?Oe.create(ve(e.hn())):e instanceof Ne?Ne.create(e.items.map(e=>ve(e))):e}fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,dn:null,Jt:qe.ZodArray,...T(t)});var ye=class e extends M{constructor(){super(...arguments),this.ln=null,this.mn=this.pn,this.fn=this.extend}vn(){if(null!==this.ln)return this.ln;const e=this.Mt.shape(),t=n.Ae(e);return this.ln={shape:e,keys:t},this.ln}Ut(e){if(this.Dt(e)!==o.object){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k}const{status:t,jt:s}=this.Pt(e),{shape:n,keys:i}=this.vn(),r=[];if(!(this.Mt.yn instanceof me&&"strip"===this.Mt.gn))for(const e in s.data)i.includes(e)||r.push(e);const a=[];for(const e of i){const t=n[e],i=s.data[e];a.push({key:{status:"valid",value:e},value:t.Ut(new E(s,i,s.path,e)),Nt:e in s.data})}if(this.Mt.yn instanceof me){const e=this.Mt.gn;if("passthrough"===e)for(const e of r)a.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)r.length>0&&(g(s,{code:c.We,keys:r}),t.wt());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this.Mt.yn;for(const t of r){const n=s.data[t];a.push({key:{status:"valid",value:t},value:e.Ut(new E(s,n,s.path,t)),Nt:t in s.data})}}return s.yt.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const s=await t.key,n=await t.value;e.push({key:s,value:n,Nt:t.Nt})}return e}).then(e=>x.kt(t,e)):x.kt(t,a)}get shape(){return this.Mt.shape()}wn(t){return w.At,new e({...this.Mt,gn:"strict",...void 0!==t?{Ft:(e,s)=>{const n=this.Mt.Ft?.(e,s).message??s.ht;return"unrecognized_keys"===e.code?{message:w.At(t).message??n}:{message:n}}}:{}})}bn(){return new e({...this.Mt,gn:"strip"})}pn(){return new e({...this.Mt,gn:"passthrough"})}extend(t){return new e({...this.Mt,shape:()=>({...this.Mt.shape(),...t})})}xn(t){return new e({gn:t.Mt.gn,yn:t.Mt.yn,shape:()=>({...this.Mt.shape(),...t.Mt.shape()}),Jt:qe.ZodObject})}kn(e,t){return this.fn({[e]:t})}yn(t){return new e({...this.Mt,yn:t})}Nn(t){const s={};for(const e of n.Ae(t))t[e]&&this.shape[e]&&(s[e]=this.shape[e]);return new e({...this.Mt,shape:()=>s})}An(t){const s={};for(const e of n.Ae(this.shape))t[e]||(s[e]=this.shape[e]);return new e({...this.Mt,shape:()=>s})}_n(){return ve(this)}Zn(t){const s={};for(const e of n.Ae(this.shape)){const n=this.shape[e];t&&!t[e]?s[e]=n:s[e]=n.re()}return new e({...this.Mt,shape:()=>s})}required(t){const s={};for(const e of n.Ae(this.shape))if(t&&!t[e])s[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Be;)t=t.Mt.rs;s[e]=t}return new e({...this.Mt,shape:()=>s})}$n(){return Fe(n.Ae(this.shape))}};ye.create=(e,t)=>new ye({shape:()=>e,gn:"strip",yn:me.create(),Jt:qe.ZodObject,...T(t)}),ye.In=(e,t)=>new ye({shape:()=>e,gn:"strict",yn:me.create(),Jt:qe.ZodObject,...T(t)}),ye.En=(e,t)=>new ye({shape:e,gn:"strip",yn:me.create(),Jt:qe.ZodObject,...T(t)});var ge=class extends M{Ut(e){const{jt:t}=this.Pt(e),s=this.Mt.options;if(t.yt.async)return Promise.all(s.map(async e=>{const s={...t,yt:{...t.yt,Fe:[]},parent:null};return{result:await e.Lt({data:t.data,path:t.path,parent:s}),jt:s}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.yt.Fe.push(...s.jt.yt.Fe),s.result;const s=e.map(e=>new h(e.jt.yt.Fe));return g(t,{code:c.qe,De:s}),k});{let e;const n=[];for(const i of s){const s={...t,yt:{...t.yt,Fe:[]},parent:null},r=i.Ct({data:t.data,path:t.path,parent:s});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,jt:s}),s.yt.Fe.length&&n.push(s.yt.Fe)}if(e)return t.yt.Fe.push(...e.jt.yt.Fe),e.result;const i=n.map(e=>new h(e));return g(t,{code:c.qe,De:i}),k}}get options(){return this.Mt.options}};ge.create=(e,t)=>new ge({options:e,Jt:qe.ZodUnion,...T(t)});var we=e=>e instanceof Ie?we(e.Ht):e instanceof De?we(e.rs()):e instanceof Ee?[e.value]:e instanceof Te?e.options:e instanceof Se?n._e(e.P):e instanceof Pe?we(e.Mt.rs):e instanceof ce?[void 0]:e instanceof de?[null]:e instanceof Be?[void 0,...we(e.hn())]:e instanceof Oe?[null,...we(e.hn())]:e instanceof Le||e instanceof Ve?we(e.hn()):e instanceof je?we(e.Mt.rs):[],be=class e extends M{Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.object)return g(t,{code:c.Le,Ve:o.object,ze:t.Ot}),k;const s=this.Fn,n=t.data[s],i=this.Tn.get(n);return i?t.yt.async?i.Lt({data:t.data,path:t.path,parent:t}):i.Ct({data:t.data,path:t.path,parent:t}):(g(t,{code:c.Ke,options:Array.from(this.Tn.keys()),path:[s]}),k)}get Fn(){return this.Mt.Fn}get options(){return this.Mt.options}get Tn(){return this.Mt.Tn}static create(t,s,n){const i=new Map;for(const e of s){const s=we(e.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const n of s){if(i.has(n))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(n)}`);i.set(n,e)}}return new e({Jt:qe.ZodDiscriminatedUnion,Fn:t,options:s,Tn:i,...T(n)})}};function xe(e,t){const s=u(e),i=u(t);if(e===t)return{valid:!0,data:e};if(s===o.object&&i===o.object){const s=n.Ae(t),i=n.Ae(e).filter(e=>-1!==s.indexOf(e)),r={...e,...t};for(const s of i){const n=xe(e[s],t[s]);if(!n.valid)return{valid:!1};r[s]=n.data}return{valid:!0,data:r}}if(s===o.$&&i===o.$){if(e.length!==t.length)return{valid:!1};const s=[];for(let n=0;n{if(_(e)||_(n))return k;const i=xe(e.value,n.value);return i.valid?((Z(e)||Z(n))&&t.wt(),{status:t.value,value:i.data}):(g(s,{code:c.ot}),k)};return s.yt.async?Promise.all([this.Mt.left.Lt({data:s.data,path:s.path,parent:s}),this.Mt.right.Lt({data:s.data,path:s.path,parent:s})]).then(([e,t])=>n(e,t)):n(this.Mt.left.Ct({data:s.data,path:s.path,parent:s}),this.Mt.right.Ct({data:s.data,path:s.path,parent:s}))}};ke.create=(e,t,s)=>new ke({left:e,right:t,Jt:qe.ZodIntersection,...T(s)});var Ne=class e extends M{Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.$)return g(s,{code:c.Le,Ve:o.$,ze:s.Ot}),k;if(s.data.lengththis.Mt.items.length&&(g(s,{code:c.it,rt:this.Mt.items.length,st:!0,tt:!1,type:"array"}),t.wt());const n=[...s.data].map((e,t)=>{const n=this.Mt.items[t]||this.Mt.Sn;return n?n.Ut(new E(s,e,s.path,t)):null}).filter(e=>!!e);return s.yt.async?Promise.all(n).then(e=>x.bt(t,e)):x.bt(t,n)}get items(){return this.Mt.items}Sn(t){return new e({...this.Mt,Sn:t})}};Ne.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ne({items:e,Jt:qe.ZodTuple,Sn:null,...T(t)})};var Ae=class e extends M{get Mn(){return this.Mt.Dn}get Bn(){return this.Mt.valueType}Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.object)return g(s,{code:c.Le,Ve:o.object,ze:s.Ot}),k;const n=[],i=this.Mt.Dn,r=this.Mt.valueType;for(const e in s.data)n.push({key:i.Ut(new E(s,e,s.path,e)),value:r.Ut(new E(s,s.data[e],s.path,e)),Nt:e in s.data});return s.yt.async?x.xt(t,n):x.kt(t,n)}get element(){return this.Mt.valueType}static create(t,s,n){return new e(s instanceof M?{Dn:t,valueType:s,Jt:qe.ZodRecord,...T(n)}:{Dn:se.create(),valueType:t,Jt:qe.ZodRecord,...T(s)})}},_e=class extends M{get Mn(){return this.Mt.Dn}get Bn(){return this.Mt.valueType}Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.map)return g(s,{code:c.Le,Ve:o.map,ze:s.Ot}),k;const n=this.Mt.Dn,i=this.Mt.valueType,r=[...s.data.entries()].map(([e,t],r)=>({key:n.Ut(new E(s,e,s.path,[r,"key"])),value:i.Ut(new E(s,t,s.path,[r,"value"]))}));if(s.yt.async){const e=new Map;return Promise.resolve().then(async()=>{for(const s of r){const n=await s.key,i=await s.value;if("aborted"===n.status||"aborted"===i.status)return k;"dirty"!==n.status&&"dirty"!==i.status||t.wt(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const s of r){const n=s.key,i=s.value;if("aborted"===n.status||"aborted"===i.status)return k;"dirty"!==n.status&&"dirty"!==i.status||t.wt(),e.set(n.value,i.value)}return{status:t.value,value:e}}}};_e.create=(e,t,s)=>new _e({valueType:t,Dn:e,Jt:qe.ZodMap,...T(s)});var Ze=class e extends M{Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.Ot!==o.set)return g(s,{code:c.Le,Ve:o.set,ze:s.Ot}),k;const n=this.Mt;null!==n.On&&s.data.sizen.Pn.value&&(g(s,{code:c.it,rt:n.Pn.value,type:"set",st:!0,tt:!1,message:n.Pn.message}),t.wt());const i=this.Mt.valueType;function r(e){const s=new Set;for(const n of e){if("aborted"===n.status)return k;"dirty"===n.status&&t.wt(),s.add(n.value)}return{status:t.value,value:s}}const a=[...s.data.values()].map((e,t)=>i.Ut(new E(s,e,s.path,t)));return s.yt.async?Promise.all(a).then(e=>r(e)):r(a)}min(t,s){return new e({...this.Mt,On:{value:t,message:w.toString(s)}})}max(t,s){return new e({...this.Mt,Pn:{value:t,message:w.toString(s)}})}size(e,t){return this.min(e,t).max(e,t)}Is(e){return this.min(1,e)}};Ze.create=(e,t)=>new Ze({valueType:e,On:null,Pn:null,Jt:qe.ZodSet,...T(t)});var $e=class e extends M{constructor(){super(...arguments),this.validate=this.jn}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.j)return g(t,{code:c.Le,Ve:o.j,ze:t.Ot}),k;function s(e,s){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Je,Oe:s}})}function n(e,s){return v({data:e,path:t.path,lt:[t.yt.vt,t.gt,f(),l].filter(e=>!!e),ft:{code:c.Ye,Be:s}})}const i={Ft:t.yt.vt},r=t.data;if(this.Mt.Cn instanceof Me){const e=this;return A(async function(...t){const a=new h([]),o=await e.Mt.Un.Vt(t,i).catch(e=>{throw a.Te(s(t,e)),a}),u=await Reflect.apply(r,this,o);return await e.Mt.Cn.Mt.type.Vt(u,i).catch(e=>{throw a.Te(n(u,e)),a})})}{const e=this;return A(function(...t){const a=e.Mt.Un.zt(t,i);if(!a.It)throw new h([s(t,a.error)]);const o=Reflect.apply(r,this,a.data),u=e.Mt.Cn.zt(o,i);if(!u.It)throw new h([n(o,u.error)]);return u.data})}}parameters(){return this.Mt.Un}Ln(){return this.Mt.Cn}Un(...t){return new e({...this.Mt,Un:Ne.create(t).Sn(le.create())})}Cn(t){return new e({...this.Mt,Cn:t})}jn(e){return this.parse(e)}zn(e){return this.parse(e)}static create(t,s,n){return new e({Un:t||Ne.create([]).Sn(le.create()),Cn:s||le.create(),Jt:qe.ZodFunction,...T(n)})}},Ie=class extends M{get Ht(){return this.Mt.Vn()}Ut(e){const{jt:t}=this.Pt(e);return this.Mt.Vn().Ut({data:t.data,path:t.path,parent:t})}};Ie.create=(e,t)=>new Ie({Vn:e,Jt:qe.ZodLazy,...T(t)});var Ee=class extends M{Ut(e){if(e.data!==this.Mt.value){const t=this.Bt(e);return g(t,{ze:t.data,code:c.Re,Ve:this.Mt.value}),k}return{status:"valid",value:e.data}}get value(){return this.Mt.value}};function Fe(e,t){return new Te({values:e,Jt:qe.ZodEnum,...T(t)})}Ee.create=(e,t)=>new Ee({value:e,Jt:qe.ZodLiteral,...T(t)});var Te=class e extends M{Ut(e){if("string"!=typeof e.data){const t=this.Bt(e),s=this.Mt.values;return g(t,{Ve:n.Ze(s),ze:t.Ot,code:c.Le}),k}if(this.Rn||(this.Rn=new Set(this.Mt.values)),!this.Rn.has(e.data)){const t=this.Bt(e),s=this.Mt.values;return g(t,{ze:t.data,code:c.He,options:s}),k}return A(e.data)}get options(){return this.Mt.values}get P(){const e={};for(const t of this.Mt.values)e[t]=t;return e}get Wn(){const e={};for(const t of this.Mt.values)e[t]=t;return e}get qn(){const e={};for(const t of this.Mt.values)e[t]=t;return e}Kn(t,s=this.Mt){return e.create(t,{...this.Mt,...s})}Hn(t,s=this.Mt){return e.create(this.options.filter(e=>!t.includes(e)),{...this.Mt,...s})}};Te.create=Fe;var Se=class extends M{Ut(e){const t=n.Ne(this.Mt.values),s=this.Bt(e);if(s.Ot!==o.string&&s.Ot!==o.number){const e=n._e(t);return g(s,{Ve:n.Ze(e),ze:s.Ot,code:c.Le}),k}if(this.Rn||(this.Rn=new Set(n.Ne(this.Mt.values))),!this.Rn.has(e.data)){const e=n._e(t);return g(s,{ze:s.data,code:c.He,options:e}),k}return A(e.data)}get P(){return this.Mt.values}};Se.create=(e,t)=>new Se({values:e,Jt:qe.ZodNativeEnum,...T(t)});var Me=class extends M{hn(){return this.Mt.type}Ut(e){const{jt:t}=this.Pt(e);if(t.Ot!==o.promise&&!1===t.yt.async)return g(t,{code:c.Le,Ve:o.promise,ze:t.Ot}),k;const s=t.Ot===o.promise?t.data:Promise.resolve(t.data);return A(s.then(e=>this.Mt.type.Vt(e,{path:t.path,Ft:t.yt.vt})))}};Me.create=(e,t)=>new Me({type:e,Jt:qe.ZodPromise,...T(t)});var De=class extends M{rs(){return this.Mt.Ht}Jn(){return this.Mt.Ht.Mt.Jt===qe.ZodEffects?this.Mt.Ht.Jn():this.Mt.Ht}Ut(e){const{status:t,jt:s}=this.Pt(e),i=this.Mt.effect||null,r={Te:e=>{g(s,e),e.fatal?t.abort():t.wt()},get path(){return s.path}};if(r.Te=r.Te.bind(r),"preprocess"===i.type){const e=i.transform(s.data,r);if(s.yt.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return k;const n=await this.Mt.Ht.Lt({data:e,path:s.path,parent:s});return"aborted"===n.status?k:"dirty"===n.status||"dirty"===t.value?N(n.value):n});{if("aborted"===t.value)return k;const n=this.Mt.Ht.Ct({data:e,path:s.path,parent:s});return"aborted"===n.status?k:"dirty"===n.status||"dirty"===t.value?N(n.value):n}}if("refinement"===i.type){const e=e=>{const t=i.Kt(e,r);if(s.yt.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.yt.async){const n=this.Mt.Ht.Ct({data:s.data,path:s.path,parent:s});return"aborted"===n.status?k:("dirty"===n.status&&t.wt(),e(n.value),{status:t.value,value:n.value})}return this.Mt.Ht.Lt({data:s.data,path:s.path,parent:s}).then(s=>"aborted"===s.status?k:("dirty"===s.status&&t.wt(),e(s.value).then(()=>({status:t.value,value:s.value}))))}if("transform"===i.type){if(!1===s.yt.async){const e=this.Mt.Ht.Ct({data:s.data,path:s.path,parent:s});if(!$(e))return k;const n=i.transform(e.value,r);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this.Mt.Ht.Lt({data:s.data,path:s.path,parent:s}).then(e=>$(e)?Promise.resolve(i.transform(e.value,r)).then(e=>({status:t.value,value:e})):k)}n.xe(i)}};De.create=(e,t,s)=>new De({Ht:e,Jt:qe.ZodEffects,effect:t,...T(s)}),De.Yn=(e,t,s)=>new De({Ht:t,effect:{type:"preprocess",transform:e},Jt:qe.ZodEffects,...T(s)});var Be=class extends M{Ut(e){return this.Dt(e)===o.undefined?A(void 0):this.Mt.rs.Ut(e)}hn(){return this.Mt.rs}};Be.create=(e,t)=>new Be({rs:e,Jt:qe.ZodOptional,...T(t)});var Oe=class extends M{Ut(e){return this.Dt(e)===o.null?A(null):this.Mt.rs.Ut(e)}hn(){return this.Mt.rs}};Oe.create=(e,t)=>new Oe({rs:e,Jt:qe.ZodNullable,...T(t)});var Pe=class extends M{Ut(e){const{jt:t}=this.Pt(e);let s=t.data;return t.Ot===o.undefined&&(s=this.Mt.defaultValue()),this.Mt.rs.Ut({data:s,path:t.path,parent:t})}Gn(){return this.Mt.rs}};Pe.create=(e,t)=>new Pe({rs:e,Jt:qe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});var je=class extends M{Ut(e){const{jt:t}=this.Pt(e),s={...t,yt:{...t.yt,Fe:[]}},n=this.Mt.rs.Ut({data:s.data,path:s.path,parent:{...s}});return I(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this.Mt.us({get error(){return new h(s.yt.Fe)},input:s.data})})):{status:"valid",value:"valid"===n.status?n.value:this.Mt.us({get error(){return new h(s.yt.Fe)},input:s.data})}}Qn(){return this.Mt.rs}};je.create=(e,t)=>new je({rs:e,Jt:qe.ZodCatch,us:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});var Ce=class extends M{Ut(e){if(this.Dt(e)!==o.G){const t=this.Bt(e);return g(t,{code:c.Le,Ve:o.G,ze:t.Ot}),k}return{status:"valid",value:e.data}}};Ce.create=e=>new Ce({Jt:qe.ZodNaN,...T(e)});var Ue=Symbol("zod_brand"),Le=class extends M{Ut(e){const{jt:t}=this.Pt(e),s=t.data;return this.Mt.type.Ut({data:s,path:t.path,parent:t})}hn(){return this.Mt.type}},ze=class e extends M{Ut(e){const{status:t,jt:s}=this.Pt(e);if(s.yt.async)return(async()=>{const e=await this.Mt.in.Lt({data:s.data,path:s.path,parent:s});return"aborted"===e.status?k:"dirty"===e.status?(t.wt(),N(e.value)):this.Mt.Xn.Lt({data:e.value,path:s.path,parent:s})})();{const e=this.Mt.in.Ct({data:s.data,path:s.path,parent:s});return"aborted"===e.status?k:"dirty"===e.status?(t.wt(),{status:"dirty",value:e.value}):this.Mt.Xn.Ct({data:e.value,path:s.path,parent:s})}}static create(t,s){return new e({in:t,Xn:s,Jt:qe.ZodPipeline})}},Ve=class extends M{Ut(e){const t=this.Mt.rs.Ut(e),s=e=>($(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then(e=>s(e)):s(t)}hn(){return this.Mt.rs}};function Re(e,t){const s="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof s?{message:s}:s}function We(e,t={},s){return e?he.create().Yt((n,i)=>{const r=e(n);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Re(t,n),r=e.fatal??s??!0;i.Te({code:"custom",...e,fatal:r})}});if(!r){const e=Re(t,n),r=e.fatal??s??!0;i.Te({code:"custom",...e,fatal:r})}}):he.create()}Ve.create=(e,t)=>new Ve({rs:e,Jt:qe.ZodReadonly,...T(t)});var qe,Ke,He={object:ye.En};(Ke=qe||(qe={})).ZodString="ZodString",Ke.ZodNumber="ZodNumber",Ke.ZodNaN="ZodNaN",Ke.ZodBigInt="ZodBigInt",Ke.ZodBoolean="ZodBoolean",Ke.ZodDate="ZodDate",Ke.ZodSymbol="ZodSymbol",Ke.ZodUndefined="ZodUndefined",Ke.ZodNull="ZodNull",Ke.ZodAny="ZodAny",Ke.ZodUnknown="ZodUnknown",Ke.ZodNever="ZodNever",Ke.ZodVoid="ZodVoid",Ke.ZodArray="ZodArray",Ke.ZodObject="ZodObject",Ke.ZodUnion="ZodUnion",Ke.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ke.ZodIntersection="ZodIntersection",Ke.ZodTuple="ZodTuple",Ke.ZodRecord="ZodRecord",Ke.ZodMap="ZodMap",Ke.ZodSet="ZodSet",Ke.ZodFunction="ZodFunction",Ke.ZodLazy="ZodLazy",Ke.ZodLiteral="ZodLiteral",Ke.ZodEnum="ZodEnum",Ke.ZodEffects="ZodEffects",Ke.ZodNativeEnum="ZodNativeEnum",Ke.ZodOptional="ZodOptional",Ke.ZodNullable="ZodNullable",Ke.ZodDefault="ZodDefault",Ke.ZodCatch="ZodCatch",Ke.ZodPromise="ZodPromise",Ke.ZodBranded="ZodBranded",Ke.ZodPipeline="ZodPipeline",Ke.ZodReadonly="ZodReadonly";var Je=(e,t={message:`Input not instance of ${e.name}`})=>We(t=>t instanceof e,t),Ye=se.create,Ge=ie.create,Qe=Ce.create,Xe=re.create,et=ae.create,tt=oe.create,st=ue.create,nt=ce.create,it=de.create,rt=he.create,at=le.create,ot=me.create,ut=pe.create,ct=fe.create,dt=ye.create,ht=ye.In,lt=ge.create,mt=be.create,pt=ke.create,ft=Ne.create,vt=Ae.create,yt=_e.create,gt=Ze.create,wt=$e.create,bt=Ie.create,xt=Ee.create,kt=Te.create,Nt=Se.create,At=Me.create,_t=De.create,Zt=Be.create,$t=Oe.create,It=De.Yn,Et=ze.create,Ft=()=>Ye().re(),Tt=()=>Ge().re(),St=()=>et().re(),Mt={string:e=>se.create({...e,T:!0}),number:e=>ie.create({...e,T:!0}),F:e=>ae.create({...e,T:!0}),I:e=>re.create({...e,T:!0}),M:e=>oe.create({...e,T:!0})},Dt=k,Bt=a,Ot=Bt.object({ei:Bt.object({ti:Bt.string(),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re()}),ii:Bt.object({name:Bt.string(),ri:Bt.string()}).re(),ai:Bt.$(Bt.object({name:Bt.string().re(),enabled:Bt.F(),coords:Bt.object({oi:Bt.number(),ui:Bt.number(),px:Bt.number(),ci:Bt.number()}),sources:Bt.$(Bt.string()),di:Bt.number().re(),animation:Bt.object({hi:Bt.number().re(),li:Bt.number().re(),frameCount:Bt.number().re(),mi:Bt.number().re(),pi:Bt.number().re(),fi:Bt.number().re(),yi:Bt.number().re(),startTime:Bt.number().re(),looping:Bt.F().re()}).re(),uuid:Bt.string()})),gi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()})),wi:Bt.$(Bt.object({name:Bt.string().re(),url:Bt.string()}))}),Pt=Bt.object({name:Bt.string().re(),coords:Bt.$(Bt.number()),bi:Bt.number().re(),enabled:Bt.F(),xi:Bt.string().re(),uuid:Bt.string()}),jt=Bt.object({name:Bt.string().re(),url:Bt.string(),ki:Bt.$(Bt.object({bi:Bt.number().re(),uuid:Bt.string()})).re()}),Ct=Bt.object({ti:Bt.string(),ni:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).re(),si:Bt.string().Wt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),ai:Bt.$(Pt),links:Bt.$(jt).re()}),Ut=document.querySelector("#bm-manage-templates table");Ut&&"TABLE"===Ut.nodeName.toLocaleUpperCase()&&(Ut=Ut.children[0])&&"BM"===Vt.getType()&&Vt.get().ai.forEach((e,t)=>{const n=s("tr",{id:"main-row"}),i=s("td",{textContent:t.toString()}),r=s("td",{textContent:e.name||"unnamed-0"}),a=document.createElement("td"),o=s("button",{id:"enable"});a.appendChild(o);const u=document.createElement("td"),c=s("button",{id:"exportAdd"});u.appendChild(c);const d=document.createElement("td"),h=s("div",{className:"shifts-container"}),l=s("button",{id:"up"}),m=s("button",{id:"down"});h.append(l,m),d.appendChild(h),n.append(i,r,a,u,d)});var Lt={"bm-create-template":"flex","bm-main-overlay":"flex","bm-manage-links":"flex","bm-manage-templates":"flex"},zt=document.createElement("style");zt.textContent="",document.body.appendChild(zt);var Vt=new class{constructor(e){t(this,"object"),t(this,"type"),this.object=e,e&&(Ot.zt(e).It?this.type="CHA":Ct.zt(e).It?this.type="BM":this.type="N/A")}update(e){if(Ct.zt(e).It)this.type="BM";else{if(!Ot.zt(e).It)return;this.type="CHA"}this.object=e}get(){return this.object}getType(){return this.type}Ni(){"N/A"!==this.type&&"CHA"!==this.type&&("BM"===this.type&&(this.object=this.object,this.object={ei:{ti:"Charity",si:"0.1.0",ni:this.object.ni},ai:this.object.ai.map(e=>({name:e.name,enabled:e.enabled||!1,coords:{oi:e.coords[0],ui:e.coords[1],px:e.coords[2],ci:e.coords[3]},sources:[e.xi||""],di:e.bi,uuid:e.uuid})),gi:[],wi:[]}),this.type="CHA")}Ai(){"N/A"!==this.type&&"BM"!==this.type&&("CHA"===this.type&&(this.object=this.object,this.object={ti:"BlueMarble",si:"0.1.0",ni:this.object.ei.ni,ai:this.object.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,xi:e.sources[0],uuid:e.uuid}))}),this.type="BM")}appendData(e){"BM"===this.type&&(this.object=this.object,Ot.parse(e)?this.object.ai.push(...e.ai.map(e=>({name:e.name,coords:Object.values(e.coords),_i:e.di,enabled:e.enabled,xi:e.sources[0],uuid:e.uuid}))):Ct.parse(e)&&(this.object.ai.push(...e.ai),this.object.links?e.links&&this.object.links.push(...e.links):this.object.links=e.links))}Zi(e){"BM"===this.type&&this.object.ai.push(e)}$i(e){"BM"===this.type&&(this.object=this.object,this.object.links?this.object.links.push(e):this.object.links=[e])}Ii(e,t){if("N/A"===this.type)return null;if(this.object.hasOwnProperty("links")){const s=this.object;return{...s,ai:e?e.map(e=>!!(Number.isInteger(e)&&e>=0&&s.ai.length!!(Number.isInteger(e)&&e>=0&&s.links.length!!(Number.isInteger(e)&&e>=0&&s.ai.length{console.log("test"),console.log("test")})}()})();},});})(); \ No newline at end of file diff --git a/dist/manifest.json b/dist/manifest.json index 19e0d98..ff9fc5d 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1 +1 @@ -{"id":"blue-marble","name":"Blue Marble","version":"0.0.18","authors":["SwingTheVine"],"versions":{"framework":">=0.1.0-beta"}} \ No newline at end of file +{"id":"blue-marble","name":"Blue Marble","version":"0.0.19","authors":["SwingTheVine"],"versions":{"framework":">=0.1.0-beta"}} \ No newline at end of file