MCPcopy
hub / github.com/mksglu/context-mode / deepPartial

Method deepPartial

cli.bundle.mjs:459–459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

457`,"utf-8")}catch(i){return{healed:[],error:`write-failed: ${i&&i.message||i}`}}return{healed:o}}function Xc({pluginRoot:t,pluginCacheRoot:e,pluginKey:n}){if(!t||!e||!n)return{healed:[],skipped:"missing-args"};let r=vt(t),o=vt(e)+mo;if(!r.startsWith(o))return{healed:[],skipped:"outside-cache-root"};let s=vt(t,".claude-plugin","plugin.json");if(!Xn(s))return{healed:[],skipped:"no-plugin-json"};let i;try{i=vs(s,"utf-8")}catch(h){return{healed:[],error:`read-failed: ${h&&h.message||h}`}}let a;try{a=JSON.parse(i)}catch(h){return{healed:[],error:`parse-failed: ${h&&h.message||h}`}}let c=a&&a.mcpServers;if(!c||typeof c!="object")return{healed:[],skipped:"no-mcp-servers"};let u=n.split("@")[0],l=c[u];if(!l||typeof l!="object"||!Array.isArray(l.args))return{healed:[],skipped:"no-our-server"};let d=[],p=l.args,f=p.map(h=>typeof h!="string"||h===Zi?h:/[/\\]start\.mjs$/.test(h)?Zi:h);if(f.some((h,g)=>h!==p[g])){l.args=f,d.push("plugin-json-args");try{Bi(s,JSON.stringify(a,null,2)+`
458`,"utf-8")}catch(h){return{healed:[],error:`write-failed: ${h&&h.message||h}`}}}return{healed:d}}function $M({pluginRoot:t,pluginCacheRoot:e,pluginKey:n}){if(!t||!e||!n)return{healed:[],skipped:"missing-args"};let r=vt(t),o=vt(e)+mo;if(!r.startsWith(o))return{healed:[],skipped:"outside-cache-root"};let s=vt(t,".mcp.json");if(!Xn(s))return{healed:[],skipped:"no-mcp-json"};let i;try{i=vs(s,"utf-8")}catch(h){return{healed:[],error:`read-failed: ${h&&h.message||h}`}}let a;try{a=JSON.parse(i)}catch(h){return{healed:[],error:`parse-failed: ${h&&h.message||h}`}}let c=a&&a.mcpServers;if(!c||typeof c!="object")return{healed:[],skipped:"no-mcp-servers"};let u=n.split("@")[0],l=c[u];if(!l||typeof l!="object"||!Array.isArray(l.args))return{healed:[],skipped:"no-our-server"};let d=[],p=l.args,f=p.map(h=>typeof h!="string"||h===Zi?h:h==="./start.mjs"||h==="start.mjs"||/[/\\]start\.mjs$/.test(h)?Zi:h);if(f.some((h,g)=>h!==p[g])){l.args=f,d.push("mcp-json-args");try{Bi(s,JSON.stringify(a,null,2)+`
459`,"utf-8")}catch(h){return{healed:[],error:`write-failed: ${h&&h.message||h}`}}}return{healed:d}}function PM({dotClaudeJsonPath:t,pluginCacheParent:e,newPluginRoot:n}){if(!t||!Xn(t))return{healed:[],skipped:"no-claude-json"};let r;try{r=vs(t,"utf-8")}catch(l){return{healed:[],error:`read-failed: ${l&&l.message||l}`}}let o;try{o=JSON.parse(r)}catch(l){return{healed:[],error:`parse-failed: ${l&&l.message||l}`}}let s=o&&o.mcpServers;if(!s||typeof s!="object")return{healed:[],skipped:"no-mcp-servers"};let i=e.replace(/\\/g,"/"),a=vt(n),c=a+mo,u=!1;for(let l of Object.values(s))if(!(!l||typeof l!="object"||!Array.isArray(l.args)))for(let d=0;d<l.args.length;d++){let p=l.args[d];if(typeof p!="string")continue;let f=p.replace(/\\/g,"/");if(!f.startsWith(i+"/"))continue;let m=f.slice(i.length+1),h=m.indexOf("/");if(h<0)continue;let g=m.slice(h+1),y=vt(n,g);y!==a&&!(y+mo).startsWith(c)||y!==p&&(l.args[d]=y,u=!0)}if(!u)return{healed:[]};try{Bi(t,JSON.stringify(o,null,2),"utf-8")}catch(l){return{healed:[],error:`write-failed: ${l&&l.message||l}`}}return{healed:["claude-json-mcp-args"]}}function Yc({pluginCacheRoot:t,pluginKey:e}){let n=[];if(!t||!e)return{removed:n,skipped:"missing-args"};let r=vt(t);if(!Xn(r))return{removed:n,skipped:"no-cache-root"};let[o,s]=e.split("@");if(!o||!s)return{removed:n,skipped:"bad-plugin-key"};let i=vt(r,o,s),a=r+mo;if(!i.startsWith(a))return{removed:n,skipped:"outside-cache-root"};if(!Xn(i))return{removed:n,skipped:"no-plugin-dir"};let c=[];try{c=vM(i)}catch{return{removed:n,skipped:"readdir-failed"}}for(let u of c){let l=vt(i,u);if(!l.startsWith(i+mo))continue;try{if(!wM(l).isDirectory())continue}catch{continue}let d=vt(l,".mcp.json");if(Xn(d))try{kM(d),n.push(d)}catch{}}return{removed:n}}var Zi,Tm=x(()=>{"use strict";Zi="${CLAUDE_PLUGIN_ROOT}/start.mjs"});var ce,$m,z,An,qi=x(()=>{(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ce||(ce={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($m||($m={}));z=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),An=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}}});var I,OM,Ct,Qc=x(()=>{qi();I=ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),OM=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ct=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Ct.create=t=>new Ct(t)});var IM,Yn,Pm=x(()=>{Qc();qi();IM=(t,e)=>{let n;switch(t.code){case I.invalid_type:t.received===z.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case I.invalid_union:n="Invalid input";break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case I.invalid_arguments:n="Invalid function arguments";break;case I.invalid_return_type:n="Invalid function return type";break;case I.invalid_date:n="Invalid date";break;case I.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ce.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case I.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case I.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case I.custom:n="Invalid input";break;case I.invalid_intersection_types:n="Intersection results could not be merged";break;case I.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case I.not_finite:n="Number must be finite";break;default:n=e.defaultError,ce.assertNever(t)}return{message:n}},Yn=IM});function AM(t){Wv=t}function ks(){return Wv}var Wv,eu=x(()=>{Pm();Wv=Yn});function D(t,e){let n=ks(),r=Vi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Yn?void 0:Yn].filter(o=>!!o)});t.common.issues.push(r)}var Vi,NM,at,G,fo,gt,tu,nu,$r,ws,Rm=x(()=>{eu();Pm();Vi=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},NM=[];at=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return G;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return G;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},G=Object.freeze({status:"aborted"}),fo=t=>({status:"dirty",value:t}),gt=t=>({status:"valid",value:t}),tu=t=>t.status==="aborted",nu=t=>t.status==="dirty",$r=t=>t.status==="valid",ws=t=>typeof Promise<"u"&&t instanceof Promise});var Kv=x(()=>{});var Z,Gv=x(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Z||(Z={}))});function te(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}function Qv(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function XM(t){return new RegExp(`^${Qv(t)}$`)}function ek(t){let e=`${Yv}T${Qv(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function YM(t,e){return!!((e==="v4"||!e)&&BM.test(t)||(e==="v6"||!e)&&VM.test(t))}function QM(t,e){if(!HM.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function eD(t,e){return!!((e==="v4"||!e)&&qM.test(t)||(e==="v6"||!e)&&WM.test(t))}function tD(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}function Es(t){if(t instanceof It){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ot.create(Es(r))}return new It({...t._def,shape:()=>e})}else return t instanceof tr?new tr({...t._def,type:Es(t.element)}):t instanceof Ot?Ot.create(Es(t.unwrap())):t instanceof Mn?Mn.create(Es(t.unwrap())):t instanceof Nn?Nn.create(t.items.map(e=>Es(e))):t}function Om(t,e){let n=An(t),r=An(e);if(t===e)return{valid:!0,data:t};if(n===z.object&&r===z.object){let o=ce.objectKeys(e),s=ce.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=Om(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===z.array&&r===z.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=Om(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===z.date&&r===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function tk(t,e){return new Eo({values:t,typeName:N.ZodEnum,...te(e)})}function Xv(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function nk(t,e={},n){return t?Rr.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=Xv(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=Xv(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Rr.create()}var tn,Jv,re,MM,DM,jM,LM,zM,HM,UM,FM,ZM,Cm,BM,qM,VM,WM,KM,GM,Yv,JM,Pr,ho,go,yo,_o,Ts,bo,xo,Rr,er,fn,$s,tr,It,So,Qn,ru,vo,Nn,ou,Ps,Rs,su,ko,wo,Eo,To,Cr,nn,Ot,Mn,$o,Po,Cs,nD,Wi,Ki,Ro,rD,N,oD,rk,ok,sD,iD,sk,aD,cD,uD,lD,dD,pD,mD,fD,hD,Im,gD,yD,_D,bD,xD,SD,vD,kD,wD,ED,TD,$D,PD,RD,CD,OD,ID,AD,ND,MD,DD,jD,LD,zD,ik=x(()=>{Qc();eu();Gv();Rm();qi();tn=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Jv=(t,e)=>{if($r(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Ct(t.common.issues);return this._error=n,this._error}}};re=class{get description(){return this._def.description}_getType(e){return An(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:An(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new at,ctx:{common:e.parent.common,data:e.data,parsedType:An(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ws(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:An(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Jv(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:An(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return $r(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>$r(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:An(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(ws(o)?o:Promise.resolve(o));return Jv(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:I.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new nn({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ot.create(this,this._def)}nullable(){return Mn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tr.create(this)}promise(){return Cr.create(this,this._def)}or(e){return So.create([this,e],this._def)}and(e){return vo.create(this,e,this._def)}transform(e){return new nn({...te(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new $o({...te(this._def),innerType:this,defaultValue:n,typeName:N.ZodDefault})}brand(){return new Wi({typeName:N.ZodBranded,type:this,...te(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Po({...te(this._def),innerType:this,catchValue:n,typeName:N.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ki.create(this,e)}readonly(){return Ro.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},MM=/^c[^\s-]{8,}$/i,DM=/^[0-9a-z]+$/,jM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LM=/^[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,zM=/^[a-z0-9_-]{21}$/i,HM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,UM=/^[-+]?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)?)??$/,FM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",BM=/^(?:(?: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])$/,qM=/^(?:(?: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])$/,VM=/^(([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]))$/,WM=/^(([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])$/,KM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,GM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yv="((\\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])))",JM=new RegExp(`^${Yv}$`);Pr=class t extends re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){let s=this._getOrReturnCtx(e);return D(s,{code:I.invalid_type,expected:z.string,received:s.parsedType}),G}let r=new at,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:I.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:I.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?D(o,{code:I.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&D(o,{code:I.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")FM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"email",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Cm||(Cm=new RegExp(ZM,"u")),Cm.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"emoji",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")LM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"uuid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")zM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"nanoid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")MM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cuid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")DM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cuid2",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")jM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"ulid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),D(o,{validation:"url",code:I.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"regex",code:I.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),D(o,{code:I.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),D(o,{code:I.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),D(o,{code:I.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?ek(s).test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:I.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?JM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:I.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?XM(s).test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:I.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?UM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"duration",code:I.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?YM(e.data,s.version)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"ip",code:I.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?QM(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"jwt",code:I.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?eD(e.data,s.version)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cidr",code:I.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?KM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"base64",code:I.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?GM.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"base64url",code:I.invalid_string,message:s.message}),r.dirty()):ce.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:I.invalid_string,...Z.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Z.errToObj(n)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Pr.create=t=>new Pr({checks:[],typeName:N.ZodString,coerce:t?.coerce??!1,...te(t)});ho=class t extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==z.number){let s=this._getOrReturnCtx(e);return D(s,{code:I.invalid_type,expected:z.number,received:s.parsedType}),G}let r,o=new at;for(let s of this._def.checks)s.kind==="int"?ce.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:I.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),D(r,{code:I.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),D(r,{code:I.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?tD(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),D(r,{code:I.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:I.not_finite,message:s.message}),o.dirty()):ce.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Z.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ce.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};ho.create=t=>new ho({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...te(t)});go=class t extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==z.bigint)return this._getInvalidInput(e);let r,o=new at;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),D(r,{code:I.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),D(r,{code:I.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),D(r,{code:I.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ce.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return D(n,{code:I.invalid_type,expected:z.bigint,received:n.parsedType}),G}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Z.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};go.create=t=>new go({checks:[],typeName:N.ZodBigInt,coerce:t?.coerce??!1,...te(t)});yo=class extends re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){let r=this._getOrReturnCtx(e);return D(r,{code:I.invalid_type,expected:z.boolean,received:r.parsedType}),G}return gt(e.data)}};yo.create=t=>new yo({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...te(t)});_o=class t extends re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){let s=this._getOrReturnCtx(e);return D(s,{code:I.invalid_type,expected:z.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return D(s,{code:I.invalid_date}),G}let r=new at,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:I.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:I.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ce.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};_o.create=t=>new _o({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...te(t)});Ts=class extends re{_parse(e){if(this._getType(e)!==z.symbol){let r=this._getOrReturnCtx(e);return D(r,{code:I.invalid_type,expected:z.symbol,received:r.parsedType}),G}return gt(e.data)}};Ts.create=t=>new Ts({typeName:N.ZodSymbol,...te(t)});bo=class extends re{_parse(e){if(this._getType(e)!==z.undefined){let r=this._getOrReturnCtx(e);return D(r,{code:I.invalid_type,expected:z.undefined,received:r.parsedType}),G}return gt(e.data)}};bo.create=t=>new bo({typeName:N.ZodUndefined,...te(t)});xo=class extends re{_parse(e){if(this._getType(e)!==z.null){let r=this._getOrReturnCtx(e);return D(r,{code:I.invalid_type,expected:z.null,received:r.parsedType}),G}return gt(e.data)}};xo.create=t=>new xo({typeName:N.ZodNull,...te(t)});Rr=class extends re{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}};Rr.create=t=>new Rr({typeName:N.ZodAny,...te(t)});er=class extends re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}};er.create=t=>new er({typeName:N.ZodUnknown,...te(t)});fn=class extends re{_parse(e){let n=this._getOrReturnCtx(e);return D(n,{code:I.invalid_type,expected:z.never,received:n.parsedType}),G}};fn.create=t=>new fn({typeName:N.ZodNever,...te(t)});$s=class extends re{_parse(e){if(this._getType(e)!==z.undefined){let r=this._getOrReturnCtx(e);return D(r,{code:I.invalid_type,expected:z.void,received:r.parsedType}),G}return gt(e.data)}};$s.create=t=>new $s({typeName:N.ZodVoid,...te(t)});tr=class t extends re{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==z.array)return D(n,{code:I.invalid_type,expected:z.array,received:n.parsedType}),G;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(D(n,{code:i?I.too_big:I.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(D(n,{code:I.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(D(n,{code:I.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new tn(n,i,n.path,a)))).then(i=>at.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new tn(n,i,n.path,a)));return at.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Z.toString(n)}})}nonempty(e){return this.min(1,e)}};tr.create=(t,e)=>new tr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...te(e)});It=class t extends re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ce.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==z.object){let u=this._getOrReturnCtx(e);return D(u,{code:I.invalid_type,expected:z.object,received:u.parsedType}),G}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof fn&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new tn(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof fn){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(D(o,{code:I.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new tn(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,p=await l.value;u.push({key:d,value:p,alwaysSet:l.alwaysSet})}return u}).then(u=>at.mergeObjectSync(r,u)):at.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Z.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of ce.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of ce.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Es(this)}partial(e){let n={};for(let r of ce.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of ce.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Ot;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return tk(ce.objectKeys(this.shape))}};It.create=(t,e)=>new It({shape:()=>t,unknownKeys:"strip",catchall:fn.create(),typeName:N.ZodObject,...te(e)});It.strictCreate=(t,e)=>new It({shape:()=>t,unknownKeys:"strict",catchall:fn.create(),typeName:N.ZodObject,...te(e)});It.lazycreate=(t,e)=>new It({shape:t,unknownKeys:"strip",catchall:fn.create(),typeName:N.ZodObject,...te(e)});So=class extends re{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Ct(a.ctx.common.issues));return D(n,{code:I.invalid_union,unionErrors:i}),G}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Ct(c));return D(n,{code:I.invalid_union,unionErrors:a}),G}}get options(){return this._def.options}};So.create=(t,e)=>new So({options:t,typeName:N.ZodUnion,...te(e)});Qn=t=>t instanceof ko?Qn(t.schema):t instanceof nn?Qn(t.innerType()):t instanceof wo?[t.value]:t instanceof Eo?t.options:t instanceof To?ce.objectValues(t.enum):t instanceof $o?Qn(t._def.innerType):t instanceof bo?[void 0]:t instanceof xo?[null]:t instanceof Ot?[void 0,...Qn(t.unwrap())]:t instanceof Mn?[null,...Qn(t.unwrap())]:t instanceof Wi||t instanceof Ro?Qn(t.unwrap()):t instanceof Po?Qn(t._def.innerType):[],ru=class t extends re{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==z.object)return D(n,{code:I.invalid_type,expected:z.object,received:n.parsedType}),G;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(D(n,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=Qn(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...te(r)})}};vo=class extends re{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(tu(s)||tu(i))return G;let a=Om(s.value,i.value);return a.valid?((nu(s)||nu(i))&&n.dirty(),{status:n.value,value:a.data}):(D(r,{code:I.invalid_intersection_types}),G)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};vo.create=(t,e,n)=>new vo({left:t,right:e,typeName:N.ZodIntersection,...te(n)});Nn=class t extends re{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==z.array)return D(r,{code:I.invalid_type,expected:z.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return D(r,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;!this._def.rest&&r.data.length>this._def.items.length&&(D(r,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new tn(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>at.mergeArray(n,i)):at.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Nn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nn({items:t,typeName:N.ZodTuple,rest:null,...te(e)})};ou=class t extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==z.object)return D(r,{code:I.invalid_type,expected:z.object,received:r.parsedType}),G;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new tn(r,a,r.path,a)),value:i._parse(new tn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?at.mergeObjectAsync(n,o):at.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof re?new t({keyType:e,valueType:n,typeName:N.ZodRecord,...te(r)}):new t({keyType:Pr.create(),valueType:e,typeName:N.ZodRecord,...te(n)})}},Ps=class extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==z.map)return D(r,{code:I.invalid_type,expected:z.map,received:r.parsedType}),G;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],u)=>({key:o._parse(new tn(r,a,r.path,[u,"key"])),value:s._parse(new tn(r,c,r.path,[u,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return G;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return G;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}}}};Ps.create=(t,e,n)=>new Ps({valueType:e,keyType:t,typeName:N.ZodMap,...te(n)});Rs=class t extends re{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==z.set)return D(r,{code:I.invalid_type,expected:z.set,received:r.parsedType}),G;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(D(r,{code:I.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(D(r,{code:I.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return G;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}let a=[...r.data.values()].map((c,u)=>s._parse(new tn(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Rs.create=(t,e)=>new Rs({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...te(e)});su=class t extends re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==z.function)return D(n,{code:I.invalid_type,expected:z.function,received:n.parsedType}),G;function r(a,c){return Vi({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ks(),Yn].filter(u=>!!u),issueData:{code:I.invalid_arguments,argumentsError:c}})}function o(a,c){return Vi({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ks(),Yn].filter(u=>!!u),issueData:{code:I.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Cr){let a=this;return gt(async function(...c){let u=new Ct([]),l=await a._def.args.parseAsync(c,s).catch(f=>{throw u.addIssue(r(c,f)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw u.addIssue(o(d,f)),u})})}else{let a=this;return gt(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Ct([r(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Ct([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Nn.create(e).rest(er.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Nn.create([]).rest(er.create()),returns:n||er.create(),typeName:N.ZodFunction,...te(r)})}},ko=class extends re{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ko.create=(t,e)=>new ko({getter:t,typeName:N.ZodLazy,...te(e)});wo=class extends re{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return D(n,{received:n.data,code:I.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};wo.create=(t,e)=>new wo({value:t,typeName:N.ZodLiteral,...te(e)});Eo=class t extends re{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return D(n,{expected:ce.joinValues(r),received:n.parsedType,code:I.invalid_type}),G}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return D(n,{received:n.data,code:I.invalid_enum_value,options:r}),G}return gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Eo.create=tk;To=class extends re{_parse(e){let n=ce.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==z.string&&r.parsedType!==z.number){let o=ce.objectValues(n);return D(r,{expected:ce.joinValues(o),received:r.parsedType,code:I.invalid_type}),G}if(this._cache||(this._cache=new Set(ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ce.objectValues(n);return D(r,{received:r.data,code:I.invalid_enum_value,options:o}),G}return gt(e.data)}get enum(){return this._def.values}};To.create=(t,e)=>new To({values:t,typeName:N.ZodNativeEnum,...te(e)});Cr=class extends re{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==z.promise&&n.common.async===!1)return D(n,{code:I.invalid_type,expected:z.promise,received:n.parsedType}),G;let r=n.parsedType===z.promise?n.data:Promise.resolve(n.data);return gt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Cr.create=(t,e)=>new Cr({type:t,typeName:N.ZodPromise,...te(e)});nn=class extends re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{D(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return G;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?G:c.status==="dirty"?fo(c.value):n.value==="dirty"?fo(c.value):c});{if(n.value==="aborted")return G;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?G:a.status==="dirty"?fo(a.value):n.value==="dirty"?fo(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?G:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?G:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$r(i))return G;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>$r(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):G);ce.assertNever(o)}};nn.create=(t,e,n)=>new nn({schema:t,typeName:N.ZodEffects,effect:e,...te(n)});nn.createWithPreprocess=(t,e,n)=>new nn({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...te(n)});Ot=class extends re{_parse(e){return this._getType(e)===z.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ot.create=(t,e)=>new Ot({innerType:t,typeName:N.ZodOptional,...te(e)});Mn=class extends re{_parse(e){return this._getType(e)===z.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mn.create=(t,e)=>new Mn({innerType:t,typeName:N.ZodNullable,...te(e)});$o=class extends re{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===z.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};$o.create=(t,e)=>new $o({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...te(e)});Po=class extends re{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ws(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ct(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ct(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Po.create=(t,e)=>new Po({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...te(e)});Cs=class extends re{_parse(e){if(this._getType(e)!==z.nan){let r=this._getOrReturnCtx(e);return D(r,{code:I.invalid_type,expected:z.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};Cs.create=t=>new Cs({typeName:N.ZodNaN,...te(t)});nD=Symbol("zod_brand"),Wi=class extends re{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Ki=class t extends re{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?G:s.status==="dirty"?(n.dirty(),fo(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?G:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:N.ZodPipeline})}},Ro=class extends re{_parse(e){let n=this._def.innerType._parse(e),r=o=>($r(o)&&(o.value=Object.freeze(o.value)),o);return ws(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};Ro.create=(t,e)=>new Ro({innerType:t,typeName:N.ZodReadonly,...te(e)});rD={object:It.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));oD=(t,e={message:`Input not instance of ${t.name}`})=>nk(n=>n instanceof t,e),rk=Pr.create,ok=ho.create,sD=Cs.create,iD=go.create,sk=yo.create,aD=_o.create,cD=Ts.create,uD=bo.create,lD=xo.create,dD=Rr.create,pD=er.create,mD=fn.create,fD=$s.create,hD=tr.create,Im=It.create,gD=It.strictCreate,yD=So.create,_D=ru.create,bD=vo.create,xD=Nn.create,SD=ou.create,vD=Ps.create,kD=Rs.create,wD=su.create,ED=ko.create,TD=wo.create,$D=Eo.create,PD=To.create,RD=Cr.create,CD=nn.create,OD=Ot.create,ID=Mn.create,AD=nn.createWithPreprocess,ND=Ki.create,MD=()=>rk().optional(),DD=()=>ok().optional(),jD=()=>sk().optional(),LD={string:(t=>Pr.create({...t,coerce:!0})),number:(t=>ho.create({...t,coerce:!0})),boolean:(t=>yo.create({...t,coerce:!0})),bigint:(t=>go.create({...t,coerce:!0})),date:(t=>_o.create({...t,coerce:!0}))},zD=G});var j={};_e(j,{BRAND:()=>nD,DIRTY:()=>fo,EMPTY_PATH:()=>NM,INVALID:()=>G,NEVER:()=>zD,OK:()=>gt,ParseStatus:()=>at,Schema:()=>re,ZodAny:()=>Rr,ZodArray:()=>tr,ZodBigInt:()=>go,ZodBoolean:()=>yo,ZodBranded:()=>Wi,ZodCatch:()=>Po,ZodDate:()=>_o,ZodDefault:()=>$o,ZodDiscriminatedUnion:()=>ru,ZodEffects:()=>nn,ZodEnum:()=>Eo,ZodError:()=>Ct,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>su,ZodIntersection:()=>vo,ZodIssueCode:()=>I,ZodLazy:()=>ko,ZodLiteral:()=>wo,ZodMap:()=>Ps,ZodNaN:()=>Cs,ZodNativeEnum:()=>To,ZodNever:()=>fn,ZodNull:()=>xo,ZodNullable:()=>Mn,ZodNumber:()=>ho,ZodObject:()=>It,ZodOptional:()=>Ot,ZodParsedType:()=>z,ZodPipeline:()=>Ki,ZodPromise:()=>Cr,ZodReadonly:()=>Ro,ZodRecord:()=>ou,ZodSchema:()=>re,ZodSet:()=>Rs,ZodString:()=>Pr,ZodSymbol:()=>Ts,ZodTransformer:()=>nn,ZodTuple:()=>Nn,ZodType:()=>re,ZodUndefined:()=>bo,ZodUnion:()=>So,ZodUnknown:()=>er,ZodVoid:()=>$s,addIssueToContext:()=>D,any:()=>dD,array:()=>hD,bigint:()=>iD,boolean:()=>sk,coerce:()=>LD,custom:()=>nk,date:()=>aD,datetimeRegex:()=>ek,defaultErrorMap:()=>Yn,discriminatedUnion:()=>_D,effect:()=>CD,enum:()=>$D,function:()=>wD,getErrorMap:()=>ks,getParsedType:()=>An,instanceof:()=>oD,intersection:()=>bD,isAborted:()=>tu,isAsync:()=>ws,isDirty:()=>nu,isValid:()=>$r,late:()=>rD,lazy:()=>ED,literal:()=>TD,makeIssue:()=>Vi,map:()=>vD,nan:()=>sD,nativeEnum:()=>PD,never:()=>mD,null:()=>lD,nullable:()=>ID,number:()=>ok,object:()=>Im,objectUtil:()=>$m,oboolean:()=>jD,onumber:()=>DD,optional:()=>OD,ostring:()=>MD,pipeline:()=>ND,preprocess:()=>AD,promise:()=>RD,quotelessJson:()=>OM,record:()=>SD,set:()=>kD,setErrorMap:()=>AM,strictObject:()=>gD,string:()=>rk,symbol:()=>cD,transformer:()=>CD,tuple:()=>xD,undefined:()=>uD,union:()=>yD,unknown:()=>pD,util:()=>ce,void:()=>fD});var iu=x(()=>{eu();Rm();Kv();qi();ik();Qc()});var Gi=x(()=>{iu()});function E(t,e,n){function r(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(t),e(a,c);for(let l in i.prototype)l in a||Object.defineProperty(a,l,{value:i.prototype[l].bind(a)});a._zod.constr=i,a._zod.def=c}let o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=n?.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}function Ft(t){return t&&Object.assign(au,t),au}var UD,nr,au,Os=x(()=>{UD=Object.freeze({status:"aborted"});nr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},au={}});var ue={};_e(ue,{BIGINT_FORMAT_RANGES:()=>ck,Class:()=>Nm,NUMBER_FORMAT_RANGES:()=>Um,aborted:()=>Oo,allowsEval:()=>Lm,assert:()=>VD,assertEqual:()=>FD,assertIs:()=>BD,assertNever:()=>qD,assertNotEqual:()=>ZD,assignProp:()=>jm,cached:()=>Yi,captureStackTrace:()=>uu,cleanEnum:()=>sj,cleanRegex:()=>ea,clone:()=>Zt,createTransparentProxy:()=>YD,defineLazy:()=>$e,esc:()=>Co,escapeRegex:()=>Or,extend:()=>tj,finalizeIssue:()=>hn,floatSafeRemainder:()=>Dm,getElementAtPath:()=>WD,getEnumValues:()=>Xi,getLengthableOrigin:()=>ta,getParsedType:()=>XD,getSizableOrigin:()=>uk,isObject:()=>Is,isPlainObject:()=>As,issue:()=>Fm,joinValues:()=>cu,jsonStringifyReplacer:()=>Mm,merge:()=>nj,normalizeParams:()=>J,nullish:()=>Qi,numKeys:()=>JD,omit:()=>ej,optionalKeys:()=>Hm,partial:()=>rj,pick:()=>QD,prefixIssues:()=>Dn,primitiveTypes:()=>ak,promiseAllObject:()=>KD,propertyKeyTypes:()=>zm,randomString:()=>GD,required:()=>oj,stringifyPrimitive:()=>lu,unwrapMessage:()=>Ji});function FD(t){return t}function ZD(t){return t}function BD(t){}function qD(t){throw new Error}function VD(t){}function Xi(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,o])=>e.indexOf(+r)===-1).map(([r,o])=>o)}function cu(t,e="|"){return t.map(n=>lu(n)).join(e)}function Mm(t,e){return typeof e=="bigint"?e.toString():e}function Yi(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Qi(t){return t==null}function ea(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Dm(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}function $e(t,e,n){Object.defineProperty(t,e,{get(){{let o=n();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function jm(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function WD(t,e){return e?e.reduce((n,r)=>n?.[r],t):t}function KD(t){let e=Object.keys(t),n=e.map(r=>t[r]);return Promise.all(n).then(r=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=r[s];return o})}function GD(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<t;r++)n+=e[Math.floor(Math.random()*e.length)];return n}function Co(t){return JSON.stringify(t)}function Is(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function As(t){if(Is(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let n=e.prototype;return!(Is(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function JD(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Or(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zt(t,e,n){let r=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(r._zod.parent=t),r}function J(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function YD(t){let e;return new Proxy({},{get(n,r,o){return e??(e=t()),Reflect.get(e,r,o)},set(n,r,o,s){return e??(e=t()),Reflect.set(e,r,o,s)},has(n,r){return e??(e=t()),Reflect.has(e,r)},deleteProperty(n,r){return e??(e=t()),Reflect.deleteProperty(e,r)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,r){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,r)},defineProperty(n,r,o){return e??(e=t()),Reflect.defineProperty(e,r,o)}})}function lu(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Hm(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function QD(t,e){let n={},r=t._zod.def;for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=r.shape[o])}return Zt(t,{...t._zod.def,shape:n,checks:[]})}function ej(t,e){let n={...t._zod.def.shape},r=t._zod.def;for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return Zt(t,{...t._zod.def,shape:n,checks:[]})}function tj(t,e){if(!As(e))throw new Error("Invalid input to extend: expected a plain object");let n={...t._zod.def,get shape(){let r={...t._zod.def.shape,...e};return jm(this,"shape",r),r},checks:[]};return Zt(t,n)}function nj(t,e){return Zt(t,{...t._zod.def,get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return jm(this,"shape",n),n},catchall:e._zod.def.catchall,checks:[]})}function rj(t,e,n){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in r))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=t?new t({type:"optional",innerType:r[s]}):r[s])}else for(let s in r)o[s]=t?new t({type:"optional",innerType:r[s]}):r[s];return Zt(e,{...e._zod.def,shape:o,checks:[]})}function oj(t,e,n){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)o[s]=new t({type:"nonoptional",innerType:r[s]});return Zt(e,{...e._zod.def,shape:o,checks:[]})}function Oo(t,e=0){for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function Dn(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function Ji(t){return typeof t=="string"?t:t?.message}function hn(t,e,n){let r={...t,path:t.path??[]};if(!t.message){let o=Ji(t.inst?._zod.def?.error?.(t))??Ji(e?.error?.(t))??Ji(n.customError?.(t))??Ji(n.localeError?.(t))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,e?.reportInput||delete r.input,r}function uk(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function ta(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Fm(...t){let[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}function sj(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var uu,Lm,XD,zm,ak,Um,ck,Nm,jn=x(()=>{uu=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};Lm=Yi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});XD=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},zm=new Set(["string","number","symbol"]),ak=new Set(["string","number","bigint","boolean","symbol","undefined"]);Um={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ck={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Nm=class{constructor(...e){}}});function Zm(t,e=n=>n.message){let n={},r=[];for(let o of t.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:n}}function Bm(t,e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(t),r}var lk,du,na,qm=x(()=>{Os();jn();lk=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,Mm,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},du=E("$ZodError",lk),na=E("$ZodError",lk,{Parent:Error})});var Vm,Wm,Km,Gm,Jm,Io,Xm,Ao,Ym=x(()=>{Os();qm();jn();Vm=t=>(e,n,r,o)=>{let s=r?Object.assign(r,{async:!1}):{async:!1},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new nr;if(i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>hn(c,s,Ft())));throw uu(a,o?.callee),a}return i.value},Wm=Vm(na),Km=t=>async(e,n,r,o)=>{let s=r?Object.assign(r,{async:!0}):{async:!0},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>hn(c,s,Ft())));throw uu(a,o?.callee),a}return i.value},Gm=Km(na),Jm=t=>(e,n,r)=>{let o=r?{...r,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new nr;return s.issues.length?{success:!1,error:new(t??du)(s.issues.map(i=>hn(i,o,Ft())))}:{success:!0,data:s.value}},Io=Jm(na),Xm=t=>async(e,n,r)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},s=e._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>hn(i,o,Ft())))}:{success:!0,data:s.value}},Ao=Xm(na)});function xk(){return new RegExp(aj,"u")}function Ck(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ok(t){return new RegExp(`^${Ck(t)}$`)}function Ik(t){let e=Ck({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");let r=`${e}(?:${n.join("|")})`;return new RegExp(`^${Pk}T(?:${r})$`)}var dk,pk,mk,fk,hk,gk,yk,_k,Qm,bk,aj,Sk,vk,kk,wk,Ek,ef,Tk,$k,Pk,Rk,Ak,Nk,Mk,Dk,jk,Lk,zk,mu=x(()=>{dk=/^[cC][^\s-]{8,}$/,pk=/^[0-9a-z]+$/,mk=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fk=/^[0-9a-vA-V]{20}$/,hk=/^[A-Za-z0-9]{27}$/,gk=/^[a-zA-Z0-9_-]{21}$/,yk=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_k=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qm=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,bk=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Sk=/^(?:(?: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])$/,vk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,kk=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,wk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ek=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ef=/^[A-Za-z0-9_-]*$/,Tk=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,$k=/^\+(?:[0-9]){6,14}[0-9]$/,Pk="(?:(?:\\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])))",Rk=new RegExp(`^${Pk}$`);Ak=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Nk=/^\d+$/,Mk=/^-?\d+(?:\.\d+)?/i,Dk=/true|false/i,jk=/null/i,Lk=/^[^A-Z]*$/,zk=/^[^a-z]*$/});var ct,Hk,tf,nf,Uk,Fk,Zk,Bk,qk,ra,Vk,Wk,Kk,Gk,Jk,Xk,Yk,fu=x(()=>{Os();mu();jn();ct=E("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Hk={number:"number",bigint:"bigint",object:"date"},tf=E("$ZodCheckLessThan",(t,e)=>{ct.init(t,e);let n=Hk[typeof e.value];t._zod.onattach.push(r=>{let o=r._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),nf=E("$ZodCheckGreaterThan",(t,e)=>{ct.init(t,e);let n=Hk[typeof e.value];t._zod.onattach.push(r=>{let o=r._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Uk=E("$ZodCheckMultipleOf",(t,e)=>{ct.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Dm(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Fk=E("$ZodCheckNumberFormat",(t,e)=>{ct.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),r=n?"int":"number",[o,s]=Um[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=o,a.maximum=s,n&&(a.pattern=Nk)}),t._zod.check=i=>{let a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:e.format,code:"invalid_type",input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:t})}}),Zk=E("$ZodCheckMaxLength",(t,e)=>{var n;ct.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!Qi(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{let o=r.value;if(o.length<=e.maximum)return;let i=ta(o);r.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Bk=E("$ZodCheckMinLength",(t,e)=>{var n;ct.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!Qi(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let o=r.value;if(o.length>=e.minimum)return;let i=ta(o);r.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),qk=E("$ZodCheckLengthEquals",(t,e)=>{var n;ct.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!Qi(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=r=>{let o=r.value,s=o.length;if(s===e.length)return;let i=ta(o),a=s>e.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),ra=E("$ZodCheckStringFormat",(t,e)=>{var n,r;ct.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),Vk=E("$ZodCheckRegex",(t,e)=>{ra.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Wk=E("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Lk),ra.init(t,e)}),Kk=E("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=zk),ra.init(t,e)}),Gk=E("$ZodCheckIncludes",(t,e)=>{ct.init(t,e);let n=Or(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),Jk=E("$ZodCheckStartsWith",(t,e)=>{ct.init(t,e);let n=new RegExp(`^${Or(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Xk=E("$ZodCheckEndsWith",(t,e)=>{ct.init(t,e);let n=new RegExp(`.*${Or(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Yk=E("$ZodCheckOverwrite",(t,e)=>{ct.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}})});var hu,rf=x(()=>{hu=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
460`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let e=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...n,o.join(`
461`))}}});var ew,of=x(()=>{ew={major:4,minor:0,patch:0}});function fw(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function cj(t){if(!ef.test(t))return!1;let e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return fw(n)}function uj(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function tw(t,e,n){t.issues.length&&e.issues.push(...Dn(n,t.issues)),e.value[n]=t.value}function gu(t,e,n){t.issues.length&&e.issues.push(...Dn(n,t.issues)),e.value[n]=t.value}function nw(t,e,n,r){t.issues.length?r[n]===void 0?n in r?e.value[n]=void 0:e.value[n]=t.value:e.issues.push(...Dn(n,t.issues)):t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}function rw(t,e,n,r){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>hn(s,r,Ft())))}),e}function sf(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(As(t)&&As(e)){let n=Object.keys(e),r=Object.keys(t).filter(s=>n.indexOf(s)!==-1),o={...t,...e};for(let s of r){let i=sf(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<t.length;r++){let o=t[r],s=e[r],i=sf(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ow(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),Oo(t))return t;let r=sf(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}function sw(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function iw(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function aw(t,e,n){return Oo(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}function cw(t){return t.value=Object.freeze(t.value),t}function uw(t,e,n,r){if(!t){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),e.issues.push(Fm(o))}}var we,oa,Pe,af,cf,uf,lf,df,pf,mf,ff,hf,gf,yf,lw,dw,pw,mw,_f,bf,xf,Sf,vf,kf,wf,Ef,yu,Tf,$f,Pf,Rf,Cf,Of,_u,bu,If,Af,Nf,Mf,Df,jf,Lf,zf,Hf,Uf,Ff,Zf,Bf,qf,Vf,hw=x(()=>{fu();Os();rf();Ym();mu();jn();of();jn();we=E("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=ew;let r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(let o of r)for(let s of o._zod.onattach)s(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(s,i,a)=>{let c=Oo(s),u;for(let l of i){if(l._zod.def.when){if(!l._zod.def.when(s))continue}else if(c)continue;let d=s.issues.length,p=l._zod.check(s);if(p instanceof Promise&&a?.async===!1)throw new nr;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,s.issues.length!==d&&(c||(c=Oo(s,d)))});else{if(s.issues.length===d)continue;c||(c=Oo(s,d))}}return u?u.then(()=>s):s};t._zod.run=(s,i)=>{let a=t._zod.parse(s,i);if(a instanceof Promise){if(i.async===!1)throw new nr;return a.then(c=>o(c,r,i))}return o(a,r,i)}}t["~standard"]={validate:o=>{try{let s=Io(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Ao(t,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),oa=E("$ZodString",(t,e)=>{we.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Ak(t._zod.bag),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Pe=E("$ZodStringFormat",(t,e)=>{ra.init(t,e),oa.init(t,e)}),af=E("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=_k),Pe.init(t,e)}),cf=E("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Qm(r))}else e.pattern??(e.pattern=Qm());Pe.init(t,e)}),uf=E("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=bk),Pe.init(t,e)}),lf=E("$ZodURL",(t,e)=>{Pe.init(t,e),t._zod.check=n=>{try{let r=n.value,o=new URL(r),s=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Tk.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),!r.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),df=E("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=xk()),Pe.init(t,e)}),pf=E("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=gk),Pe.init(t,e)}),mf=E("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=dk),Pe.init(t,e)}),ff=E("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=pk),Pe.init(t,e)}),hf=E("$ZodULID",(t,e)=>{e.pattern??(e.pattern=mk),Pe.init(t,e)}),gf=E("$ZodXID",(t,e)=>{e.pattern??(e.pattern=fk),Pe.init(t,e)}),yf=E("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=hk),Pe.init(t,e)}),lw=E("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Ik(e)),Pe.init(t,e)}),dw=E("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Rk),Pe.init(t,e)}),pw=E("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Ok(e)),Pe.init(t,e)}),mw=E("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=yk),Pe.init(t,e)}),_f=E("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Sk),Pe.init(t,e),t._zod.onattach.push(n=>{let r=n._zod.bag;r.format="ipv4"})}),bf=E("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=vk),Pe.init(t,e),t._zod.onattach.push(n=>{let r=n._zod.bag;r.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),xf=E("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=kk),Pe.init(t,e)}),Sf=E("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=wk),Pe.init(t,e),t._zod.check=n=>{let[r,o]=n.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});vf=E("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Ek),Pe.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{fw(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});kf=E("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ef),Pe.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{cj(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),wf=E("$ZodE164",(t,e)=>{e.pattern??(e.pattern=$k),Pe.init(t,e)});Ef=E("$ZodJWT",(t,e)=>{Pe.init(t,e),t._zod.check=n=>{uj(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),yu=E("$ZodNumber",(t,e)=>{we.init(t,e),t._zod.pattern=t._zod.bag.pattern??Mk,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),n}}),Tf=E("$ZodNumber",(t,e)=>{Fk.init(t,e),yu.init(t,e)}),$f=E("$ZodBoolean",(t,e)=>{we.init(t,e),t._zod.pattern=Dk,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}let o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),n}}),Pf=E("$ZodNull",(t,e)=>{we.init(t,e),t._zod.pattern=jk,t._zod.values=new Set([null]),t._zod.parse=(n,r)=>{let o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),n}}),Rf=E("$ZodUnknown",(t,e)=>{we.init(t,e),t._zod.parse=n=>n}),Cf=E("$ZodNever",(t,e)=>{we.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});Of=E("$ZodArray",(t,e)=>{we.init(t,e),t._zod.parse=(n,r)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),n;n.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=e.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(u=>tw(u,n,i))):tw(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});_u=E("$ZodObject",(t,e)=>{we.init(t,e);let n=Yi(()=>{let d=Object.keys(e.shape);for(let f of d)if(!(e.shape[f]instanceof we))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);let p=Hm(e.shape);return{shape:e.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(p)}});$e(t._zod,"propValues",()=>{let d=e.shape,p={};for(let f in d){let m=d[f]._zod;if(m.values){p[f]??(p[f]=new Set);for(let h of m.values)p[f].add(h)}}return p});let r=d=>{let p=new hu(["shape","payload","ctx"]),f=n.value,m=_=>{let b=Co(_);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");let h=Object.create(null),g=0;for(let _ of f.keys)h[_]=`key_${g++}`;p.write("const newResult = {}");for(let _ of f.keys)if(f.optionalKeys.has(_)){let b=h[_];p.write(`const ${b} = ${m(_)};`);let S=Co(_);p.write(`
462 if (${b}.issues.length) {

Callers

nothing calls this directly

Calls 1

EsFunction · 0.70

Tested by

no test coverage detected