next
Version:
The React Framework
1 lines • 77.3 kB
JavaScript
(()=>{"use strict";var e={629:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){if(r===undefined)r=s;var a=Object.getOwnPropertyDescriptor(t,s);if(!a||("get"in a?!t.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return t[s]}}}Object.defineProperty(e,r,a)}:function(e,t,s,r){if(r===undefined)r=s;e[r]=t[s]});var a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)if(s!=="default"&&Object.prototype.hasOwnProperty.call(e,s))r(t,e,s);a(t,e);return t};var i=this&&this.__exportStar||function(e,t){for(var s in e)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s))r(t,e,s)};Object.defineProperty(t,"__esModule",{value:true});t.z=void 0;const o=n(s(923));t.z=o;i(s(923),t);t["default"]=o},348:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:true});t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const r=s(709);t.ZodIssueCode=r.util.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"]);const quotelessJson=e=>{const t=JSON.stringify(e,null,2);return t.replace(/"([^"]+)":/g,"$1:")};t.quotelessJson=quotelessJson;class ZodError extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[];this.addIssue=e=>{this.issues=[...this.issues,e]};this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;if(Object.setPrototypeOf){Object.setPrototypeOf(this,t)}else{this.__proto__=t}this.name="ZodError";this.issues=e}format(e){const t=e||function(e){return e.message};const s={_errors:[]};const processError=e=>{for(const r of e.issues){if(r.code==="invalid_union"){r.unionErrors.map(processError)}else if(r.code==="invalid_return_type"){processError(r.returnTypeError)}else if(r.code==="invalid_arguments"){processError(r.argumentsError)}else if(r.path.length===0){s._errors.push(t(r))}else{let e=s;let a=0;while(a<r.path.length){const s=r.path[a];const n=a===r.path.length-1;if(!n){e[s]=e[s]||{_errors:[]}}else{e[s]=e[s]||{_errors:[]};e[s]._errors.push(t(r))}e=e[s];a++}}}};processError(this);return s}static assert(e){if(!(e instanceof ZodError)){throw new Error(`Not a ZodError: ${e}`)}}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(e=>e.message)){const t={};const s=[];for(const r of this.issues){if(r.path.length>0){const s=r.path[0];t[s]=t[s]||[];t[s].push(e(r))}else{s.push(e(r))}}return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=ZodError;ZodError.create=e=>{const t=new ZodError(e);return t}},61:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.defaultErrorMap=void 0;t.setErrorMap=setErrorMap;t.getErrorMap=getErrorMap;const a=r(s(871));t.defaultErrorMap=a.default;let n=a.default;function setErrorMap(e){n=e}function getErrorMap(){return n}},923:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){if(r===undefined)r=s;var a=Object.getOwnPropertyDescriptor(t,s);if(!a||("get"in a?!t.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return t[s]}}}Object.defineProperty(e,r,a)}:function(e,t,s,r){if(r===undefined)r=s;e[r]=t[s]});var a=this&&this.__exportStar||function(e,t){for(var s in e)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s))r(t,e,s)};Object.defineProperty(t,"__esModule",{value:true});a(s(61),t);a(s(818),t);a(s(515),t);a(s(709),t);a(s(155),t);a(s(348),t)},538:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.errorUtil=void 0;var s;(function(e){e.errToObj=e=>typeof e==="string"?{message:e}:e||{};e.toString=e=>typeof e==="string"?e:e?.message})(s||(t.errorUtil=s={}))},818:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.EMPTY_PATH=t.makeIssue=void 0;t.addIssueToContext=addIssueToContext;const a=s(61);const n=r(s(871));const makeIssue=e=>{const{data:t,path:s,errorMaps:r,issueData:a}=e;const n=[...s,...a.path||[]];const i={...a,path:n};if(a.message!==undefined){return{...a,path:n,message:a.message}}let o="";const d=r.filter((e=>!!e)).slice().reverse();for(const e of d){o=e(i,{data:t,defaultError:o}).message}return{...a,path:n,message:o}};t.makeIssue=makeIssue;t.EMPTY_PATH=[];function addIssueToContext(e,s){const r=(0,a.getErrorMap)();const i=(0,t.makeIssue)({issueData:s,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===n.default?undefined:n.default].filter((e=>!!e))});e.common.issues.push(i)}class ParseStatus{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,s){const r=[];for(const a of s){if(a.status==="aborted")return t.INVALID;if(a.status==="dirty")e.dirty();r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const s=[];for(const e of t){const t=await e.key;const r=await e.value;s.push({key:t,value:r})}return ParseStatus.mergeObjectSync(e,s)}static mergeObjectSync(e,s){const r={};for(const a of s){const{key:s,value:n}=a;if(s.status==="aborted")return t.INVALID;if(n.status==="aborted")return t.INVALID;if(s.status==="dirty")e.dirty();if(n.status==="dirty")e.dirty();if(s.value!=="__proto__"&&(typeof n.value!=="undefined"||a.alwaysSet)){r[s.value]=n.value}}return{status:e.value,value:r}}}t.ParseStatus=ParseStatus;t.INVALID=Object.freeze({status:"aborted"});const DIRTY=e=>({status:"dirty",value:e});t.DIRTY=DIRTY;const OK=e=>({status:"valid",value:e});t.OK=OK;const isAborted=e=>e.status==="aborted";t.isAborted=isAborted;const isDirty=e=>e.status==="dirty";t.isDirty=isDirty;const isValid=e=>e.status==="valid";t.isValid=isValid;const isAsync=e=>typeof Promise!=="undefined"&&e instanceof Promise;t.isAsync=isAsync},515:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true})},709:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0;var s;(function(e){e.assertEqual=e=>{};function assertIs(e){}e.assertIs=assertIs;function assertNever(e){throw new Error}e.assertNever=assertNever;e.arrayToEnum=e=>{const t={};for(const s of e){t[s]=s}return t};e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>typeof t[t[e]]!=="number"));const r={};for(const e of s){r[e]=t[e]}return e.objectValues(r)};e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]}));e.objectKeys=typeof Object.keys==="function"?e=>Object.keys(e):e=>{const t=[];for(const s in e){if(Object.prototype.hasOwnProperty.call(e,s)){t.push(s)}}return t};e.find=(e,t)=>{for(const s of e){if(t(s))return s}return undefined};e.isInteger=typeof Number.isInteger==="function"?e=>Number.isInteger(e):e=>typeof e==="number"&&Number.isFinite(e)&&Math.floor(e)===e;function joinValues(e,t=" | "){return e.map((e=>typeof e==="string"?`'${e}'`:e)).join(t)}e.joinValues=joinValues;e.jsonStringifyReplacer=(e,t)=>{if(typeof t==="bigint"){return t.toString()}return t}})(s||(t.util=s={}));var r;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(r||(t.objectUtil=r={}));t.ZodParsedType=s.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const getParsedType=e=>{const s=typeof e;switch(s){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return Number.isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":if(Array.isArray(e)){return t.ZodParsedType.array}if(e===null){return t.ZodParsedType.null}if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function"){return t.ZodParsedType.promise}if(typeof Map!=="undefined"&&e instanceof Map){return t.ZodParsedType.map}if(typeof Set!=="undefined"&&e instanceof Set){return t.ZodParsedType.set}if(typeof Date!=="undefined"&&e instanceof Date){return t.ZodParsedType.date}return t.ZodParsedType.object;default:return t.ZodParsedType.unknown}};t.getParsedType=getParsedType},871:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:true});const r=s(348);const a=s(709);const errorMap=(e,t)=>{let s;switch(e.code){case r.ZodIssueCode.invalid_type:if(e.received===a.ZodParsedType.undefined){s="Required"}else{s=`Expected ${e.expected}, received ${e.received}`}break;case r.ZodIssueCode.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,a.util.jsonStringifyReplacer)}`;break;case r.ZodIssueCode.unrecognized_keys:s=`Unrecognized key(s) in object: ${a.util.joinValues(e.keys,", ")}`;break;case r.ZodIssueCode.invalid_union:s=`Invalid input`;break;case r.ZodIssueCode.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${a.util.joinValues(e.options)}`;break;case r.ZodIssueCode.invalid_enum_value:s=`Invalid enum value. Expected ${a.util.joinValues(e.options)}, received '${e.received}'`;break;case r.ZodIssueCode.invalid_arguments:s=`Invalid function arguments`;break;case r.ZodIssueCode.invalid_return_type:s=`Invalid function return type`;break;case r.ZodIssueCode.invalid_date:s=`Invalid date`;break;case r.ZodIssueCode.invalid_string:if(typeof e.validation==="object"){if("includes"in e.validation){s=`Invalid input: must include "${e.validation.includes}"`;if(typeof e.validation.position==="number"){s=`${s} at one or more positions greater than or equal to ${e.validation.position}`}}else if("startsWith"in e.validation){s=`Invalid input: must start with "${e.validation.startsWith}"`}else if("endsWith"in e.validation){s=`Invalid input: must end with "${e.validation.endsWith}"`}else{a.util.assertNever(e.validation)}}else if(e.validation!=="regex"){s=`Invalid ${e.validation}`}else{s="Invalid"}break;case r.ZodIssueCode.too_small:if(e.type==="array")s=`Array must contain ${e.exact?"exactly":e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`;else if(e.type==="string")s=`String must contain ${e.exact?"exactly":e.inclusive?`at least`:`over`} ${e.minimum} character(s)`;else if(e.type==="number")s=`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`;else if(e.type==="bigint")s=`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`;else if(e.type==="date")s=`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`;else s="Invalid input";break;case r.ZodIssueCode.too_big:if(e.type==="array")s=`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`;else if(e.type==="string")s=`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`;else if(e.type==="number")s=`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`;else if(e.type==="bigint")s=`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`;else if(e.type==="date")s=`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`;else s="Invalid input";break;case r.ZodIssueCode.custom:s=`Invalid input`;break;case r.ZodIssueCode.invalid_intersection_types:s=`Intersection results could not be merged`;break;case r.ZodIssueCode.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case r.ZodIssueCode.not_finite:s="Number must be finite";break;default:s=t.defaultError;a.util.assertNever(e)}return{message:s}};t["default"]=errorMap},155:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:true});t.discriminatedUnion=t.date=t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.ZodType=void 0;t.NEVER=t["void"]=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t["null"]=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t["instanceof"]=t["function"]=t["enum"]=t.effect=void 0;t.datetimeRegex=datetimeRegex;t.custom=custom;const r=s(348);const a=s(61);const n=s(538);const i=s(818);const o=s(709);class ParseInputLazyPath{constructor(e,t,s,r){this._cachedPath=[];this.parent=e;this.data=t;this._path=s;this._key=r}get path(){if(!this._cachedPath.length){if(Array.isArray(this._key)){this._cachedPath.push(...this._path,...this._key)}else{this._cachedPath.push(...this._path,this._key)}}return this._cachedPath}}const handleResult=(e,t)=>{if((0,i.isValid)(t)){return{success:true,data:t.value}}else{if(!e.common.issues.length){throw new Error("Validation failed but no issues detected.")}return{success:false,get error(){if(this._error)return this._error;const t=new r.ZodError(e.common.issues);this._error=t;return this._error}}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:a}=e;if(t&&(s||r)){throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`)}if(t)return{errorMap:t,description:a};const customMap=(t,a)=>{const{message:n}=e;if(t.code==="invalid_enum_value"){return{message:n??a.defaultError}}if(typeof a.data==="undefined"){return{message:n??r??a.defaultError}}if(t.code!=="invalid_type")return{message:a.defaultError};return{message:n??s??a.defaultError}};return{errorMap:customMap,description:a}}class ZodType{get description(){return this._def.description}_getType(e){return(0,o.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,o.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,o.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,i.isAsync)(t)){throw new Error("Synchronous parse encountered promise.")}return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??false,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,o.getParsedType)(e)};const r=this._parseSync({data:e,path:s.path,parent:s});return handleResult(s,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,o.getParsedType)(e)};if(!this["~standard"].async){try{const s=this._parseSync({data:e,path:[],parent:t});return(0,i.isValid)(s)?{value:s.value}:{issues:t.common.issues}}catch(e){if(e?.message?.toLowerCase()?.includes("encountered")){this["~standard"].async=true}t.common={issues:[],async:true}}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>(0,i.isValid)(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:true},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,o.getParsedType)(e)};const r=this._parse({data:e,path:s.path,parent:s});const a=await((0,i.isAsync)(r)?r:Promise.resolve(r));return handleResult(s,a)}refine(e,t){const getIssueProperties=e=>{if(typeof t==="string"||typeof t==="undefined"){return{message:t}}else if(typeof t==="function"){return t(e)}else{return t}};return this._refinement(((t,s)=>{const a=e(t);const setError=()=>s.addIssue({code:r.ZodIssueCode.custom,...getIssueProperties(t)});if(typeof Promise!=="undefined"&&a instanceof Promise){return a.then((e=>{if(!e){setError();return false}else{return true}}))}if(!a){setError();return false}else{return true}}))}refinement(e,t){return this._refinement(((s,r)=>{if(!e(s)){r.addIssue(typeof t==="function"?t(s,r):t);return false}else{return true}}))}_refinement(e){return new ZodEffects({schema:this,typeName:k.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:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e==="function"?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:k.ZodDefault})}brand(){return new ZodBranded({typeName:k.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t=typeof e==="function"?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:k.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(undefined).success}isNullable(){return this.safeParse(null).success}}t.ZodType=ZodType;t.Schema=ZodType;t.ZodSchema=ZodType;const d=/^c[^\s-]{8,}$/i;const u=/^[0-9a-z]+$/;const c=/^[0-9A-HJKMNP-TV-Z]{26}$/i;const l=/^[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;const p=/^[a-z0-9_-]{21}$/i;const f=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;const h=/^[-+]?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)?)??$/;const m=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;const y=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;let Z;const _=/^(?:(?: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])$/;const g=/^(?:(?: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])$/;const v=/^(([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]))$/;const I=/^(([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])$/;const T=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;const b=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;const x=`((\\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])))`;const C=new RegExp(`^${x}$`);function timeRegexSource(e){let t=`[0-5]\\d`;if(e.precision){t=`${t}\\.\\d{${e.precision}}`}else if(e.precision==null){t=`${t}(\\.\\d+)?`}const s=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${x}T${timeRegexSource(e)}`;const s=[];s.push(e.local?`Z?`:`Z`);if(e.offset)s.push(`([+-]\\d{2}:?\\d{2})`);t=`${t}(${s.join("|")})`;return new RegExp(`^${t}$`)}function isValidIP(e,t){if((t==="v4"||!t)&&_.test(e)){return true}if((t==="v6"||!t)&&v.test(e)){return true}return false}function isValidJWT(e,t){if(!f.test(e))return false;try{const[s]=e.split(".");if(!s)return false;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"=");const a=JSON.parse(atob(r));if(typeof a!=="object"||a===null)return false;if("typ"in a&&a?.typ!=="JWT")return false;if(!a.alg)return false;if(t&&a.alg!==t)return false;return true}catch{return false}}function isValidCidr(e,t){if((t==="v4"||!t)&&g.test(e)){return true}if((t==="v6"||!t)&&I.test(e)){return true}return false}class ZodString extends ZodType{_parse(e){if(this._def.coerce){e.data=String(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.string){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.string,received:t.parsedType});return i.INVALID}const s=new i.ParseStatus;let a=undefined;for(const t of this._def.checks){if(t.kind==="min"){if(e.data.length<t.value){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.too_small,minimum:t.value,type:"string",inclusive:true,exact:false,message:t.message});s.dirty()}}else if(t.kind==="max"){if(e.data.length>t.value){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.too_big,maximum:t.value,type:"string",inclusive:true,exact:false,message:t.message});s.dirty()}}else if(t.kind==="length"){const n=e.data.length>t.value;const o=e.data.length<t.value;if(n||o){a=this._getOrReturnCtx(e,a);if(n){(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.too_big,maximum:t.value,type:"string",inclusive:true,exact:true,message:t.message})}else if(o){(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.too_small,minimum:t.value,type:"string",inclusive:true,exact:true,message:t.message})}s.dirty()}}else if(t.kind==="email"){if(!m.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"email",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="emoji"){if(!Z){Z=new RegExp(y,"u")}if(!Z.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"emoji",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="uuid"){if(!l.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"uuid",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="nanoid"){if(!p.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"nanoid",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="cuid"){if(!d.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"cuid",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="cuid2"){if(!u.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"cuid2",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="ulid"){if(!c.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"ulid",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="url"){try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"url",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="regex"){t.regex.lastIndex=0;const n=t.regex.test(e.data);if(!n){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"regex",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="trim"){e.data=e.data.trim()}else if(t.kind==="includes"){if(!e.data.includes(t.value,t.position)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.invalid_string,validation:{includes:t.value,position:t.position},message:t.message});s.dirty()}}else if(t.kind==="toLowerCase"){e.data=e.data.toLowerCase()}else if(t.kind==="toUpperCase"){e.data=e.data.toUpperCase()}else if(t.kind==="startsWith"){if(!e.data.startsWith(t.value)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.invalid_string,validation:{startsWith:t.value},message:t.message});s.dirty()}}else if(t.kind==="endsWith"){if(!e.data.endsWith(t.value)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.invalid_string,validation:{endsWith:t.value},message:t.message});s.dirty()}}else if(t.kind==="datetime"){const n=datetimeRegex(t);if(!n.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.invalid_string,validation:"datetime",message:t.message});s.dirty()}}else if(t.kind==="date"){const n=C;if(!n.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.invalid_string,validation:"date",message:t.message});s.dirty()}}else if(t.kind==="time"){const n=timeRegex(t);if(!n.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.invalid_string,validation:"time",message:t.message});s.dirty()}}else if(t.kind==="duration"){if(!h.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"duration",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="ip"){if(!isValidIP(e.data,t.version)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"ip",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="jwt"){if(!isValidJWT(e.data,t.alg)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"jwt",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="cidr"){if(!isValidCidr(e.data,t.version)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"cidr",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="base64"){if(!T.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"base64",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="base64url"){if(!b.test(e.data)){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{validation:"base64url",code:r.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else{o.util.assertNever(t)}}return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement((t=>e.test(t)),{validation:t,code:r.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(s)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...n.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...n.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...n.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...n.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...n.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...n.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...n.errorUtil.errToObj(e)})}datetime(e){if(typeof e==="string"){return this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e})}return this._addCheck({kind:"datetime",precision:typeof e?.precision==="undefined"?null:e?.precision,offset:e?.offset??false,local:e?.local??false,...n.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string"){return this._addCheck({kind:"time",precision:null,message:e})}return this._addCheck({kind:"time",precision:typeof e?.precision==="undefined"?null:e?.precision,...n.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...n.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...n.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...n.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...n.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...n.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...n.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...n.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...n.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,n.errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>e.kind==="datetime"))}get isDate(){return!!this._def.checks.find((e=>e.kind==="date"))}get isTime(){return!!this._def.checks.find((e=>e.kind==="time"))}get isDuration(){return!!this._def.checks.find((e=>e.kind==="duration"))}get isEmail(){return!!this._def.checks.find((e=>e.kind==="email"))}get isURL(){return!!this._def.checks.find((e=>e.kind==="url"))}get isEmoji(){return!!this._def.checks.find((e=>e.kind==="emoji"))}get isUUID(){return!!this._def.checks.find((e=>e.kind==="uuid"))}get isNANOID(){return!!this._def.checks.find((e=>e.kind==="nanoid"))}get isCUID(){return!!this._def.checks.find((e=>e.kind==="cuid"))}get isCUID2(){return!!this._def.checks.find((e=>e.kind==="cuid2"))}get isULID(){return!!this._def.checks.find((e=>e.kind==="ulid"))}get isIP(){return!!this._def.checks.find((e=>e.kind==="ip"))}get isCIDR(){return!!this._def.checks.find((e=>e.kind==="cidr"))}get isBase64(){return!!this._def.checks.find((e=>e.kind==="base64"))}get isBase64url(){return!!this._def.checks.find((e=>e.kind==="base64url"))}get minLength(){let e=null;for(const t of this._def.checks){if(t.kind==="min"){if(e===null||t.value>e)e=t.value}}return e}get maxLength(){let e=null;for(const t of this._def.checks){if(t.kind==="max"){if(e===null||t.value<e)e=t.value}}return e}}t.ZodString=ZodString;ZodString.create=e=>new ZodString({checks:[],typeName:k.ZodString,coerce:e?.coerce??false,...processCreateParams(e)});function floatSafeRemainder(e,t){const s=(e.toString().split(".")[1]||"").length;const r=(t.toString().split(".")[1]||"").length;const a=s>r?s:r;const n=Number.parseInt(e.toFixed(a).replace(".",""));const i=Number.parseInt(t.toFixed(a).replace(".",""));return n%i/10**a}class ZodNumber extends ZodType{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)}const t=this._getType(e);if(t!==o.ZodParsedType.number){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.number,received:t.parsedType});return i.INVALID}let s=undefined;const a=new i.ParseStatus;for(const t of this._def.checks){if(t.kind==="int"){if(!o.util.isInteger(e.data)){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:t.message});a.dirty()}}else if(t.kind==="min"){const n=t.inclusive?e.data<t.value:e.data<=t.value;if(n){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.too_small,minimum:t.value,type:"number",inclusive:t.inclusive,exact:false,message:t.message});a.dirty()}}else if(t.kind==="max"){const n=t.inclusive?e.data>t.value:e.data>=t.value;if(n){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.too_big,maximum:t.value,type:"number",inclusive:t.inclusive,exact:false,message:t.message});a.dirty()}}else if(t.kind==="multipleOf"){if(floatSafeRemainder(e.data,t.value)!==0){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.not_multiple_of,multipleOf:t.value,message:t.message});a.dirty()}}else if(t.kind==="finite"){if(!Number.isFinite(e.data)){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.not_finite,message:t.message});a.dirty()}}else{o.util.assertNever(t)}}return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,true,n.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,false,n.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,true,n.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,false,n.errorUtil.toString(t))}setLimit(e,t,s,r){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:n.errorUtil.toString(r)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:n.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:n.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:n.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:n.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:n.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:n.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks){if(t.kind==="min"){if(e===null||t.value>e)e=t.value}}return e}get maxValue(){let e=null;for(const t of this._def.checks){if(t.kind==="max"){if(e===null||t.value<e)e=t.value}}return e}get isInt(){return!!this._def.checks.find((e=>e.kind==="int"||e.kind==="multipleOf"&&o.util.isInteger(e.value)))}get isFinite(){let e=null;let t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf"){return true}else if(s.kind==="min"){if(t===null||s.value>t)t=s.value}else if(s.kind==="max"){if(e===null||s.value<e)e=s.value}}return Number.isFinite(t)&&Number.isFinite(e)}}t.ZodNumber=ZodNumber;ZodNumber.create=e=>new ZodNumber({checks:[],typeName:k.ZodNumber,coerce:e?.coerce||false,...processCreateParams(e)});class ZodBigInt extends ZodType{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)}}const t=this._getType(e);if(t!==o.ZodParsedType.bigint){return this._getInvalidInput(e)}let s=undefined;const a=new i.ParseStatus;for(const t of this._def.checks){if(t.kind==="min"){const n=t.inclusive?e.data<t.value:e.data<=t.value;if(n){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.too_small,type:"bigint",minimum:t.value,inclusive:t.inclusive,message:t.message});a.dirty()}}else if(t.kind==="max"){const n=t.inclusive?e.data>t.value:e.data>=t.value;if(n){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.too_big,type:"bigint",maximum:t.value,inclusive:t.inclusive,message:t.message});a.dirty()}}else if(t.kind==="multipleOf"){if(e.data%t.value!==BigInt(0)){s=this._getOrReturnCtx(e,s);(0,i.addIssueToContext)(s,{code:r.ZodIssueCode.not_multiple_of,multipleOf:t.value,message:t.message});a.dirty()}}else{o.util.assertNever(t)}}return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.bigint,received:t.parsedType});return i.INVALID}gte(e,t){return this.setLimit("min",e,true,n.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,false,n.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,true,n.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,false,n.errorUtil.toString(t))}setLimit(e,t,s,r){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:n.errorUtil.toString(r)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:n.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:n.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:n.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:n.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks){if(t.kind==="min"){if(e===null||t.value>e)e=t.value}}return e}get maxValue(){let e=null;for(const t of this._def.checks){if(t.kind==="max"){if(e===null||t.value<e)e=t.value}}return e}}t.ZodBigInt=ZodBigInt;ZodBigInt.create=e=>new ZodBigInt({checks:[],typeName:k.ZodBigInt,coerce:e?.coerce??false,...processCreateParams(e)});class ZodBoolean extends ZodType{_parse(e){if(this._def.coerce){e.data=Boolean(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.boolean,received:t.parsedType});return i.INVALID}return(0,i.OK)(e.data)}}t.ZodBoolean=ZodBoolean;ZodBoolean.create=e=>new ZodBoolean({typeName:k.ZodBoolean,coerce:e?.coerce||false,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){if(this._def.coerce){e.data=new Date(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.date){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.date,received:t.parsedType});return i.INVALID}if(Number.isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_date});return i.INVALID}const s=new i.ParseStatus;let a=undefined;for(const t of this._def.checks){if(t.kind==="min"){if(e.data.getTime()<t.value){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.too_small,message:t.message,inclusive:true,exact:false,minimum:t.value,type:"date"});s.dirty()}}else if(t.kind==="max"){if(e.data.getTime()>t.value){a=this._getOrReturnCtx(e,a);(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.too_big,message:t.message,inclusive:true,exact:false,maximum:t.value,type:"date"});s.dirty()}}else{o.util.assertNever(t)}}return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:n.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:n.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks){if(t.kind==="min"){if(e===null||t.value>e)e=t.value}}return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks){if(t.kind==="max"){if(e===null||t.value<e)e=t.value}}return e!=null?new Date(e):null}}t.ZodDate=ZodDate;ZodDate.create=e=>new ZodDate({checks:[],coerce:e?.coerce||false,typeName:k.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.symbol,received:t.parsedType});return i.INVALID}return(0,i.OK)(e.data)}}t.ZodSymbol=ZodSymbol;ZodSymbol.create=e=>new ZodSymbol({typeName:k.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.undefined,received:t.parsedType});return i.INVALID}return(0,i.OK)(e.data)}}t.ZodUndefined=ZodUndefined;ZodUndefined.create=e=>new ZodUndefined({typeName:k.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.null){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.null,received:t.parsedType});return i.INVALID}return(0,i.OK)(e.data)}}t.ZodNull=ZodNull;ZodNull.create=e=>new ZodNull({typeName:k.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments);this._any=true}_parse(e){return(0,i.OK)(e.data)}}t.ZodAny=ZodAny;ZodAny.create=e=>new ZodAny({typeName:k.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments);this._unknown=true}_parse(e){return(0,i.OK)(e.data)}}t.ZodUnknown=ZodUnknown;ZodUnknown.create=e=>new ZodUnknown({typeName:k.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.never,received:t.parsedType});return i.INVALID}}t.ZodNever=ZodNever;ZodNever.create=e=>new ZodNever({typeName:k.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.void,received:t.parsedType});return i.INVALID}return(0,i.OK)(e.data)}}t.ZodVoid=ZodVoid;ZodVoid.create=e=>new ZodVoid({typeName:k.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:s}=this._processInputParams(e);const a=this._def;if(t.parsedType!==o.ZodParsedType.array){(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.array,received:t.parsedType});return i.INVALID}if(a.exactLength!==null){const e=t.data.length>a.exactLength.value;const n=t.data.length<a.exactLength.value;if(e||n){(0,i.addIssueToContext)(t,{code:e?r.ZodIssueCode.too_big:r.ZodIssueCode.too_small,minimum:n?a.exactLength.value:undefined,maximum:e?a.exactLength.value:undefined,type:"array",inclusive:true,exact:true,message:a.exactLength.message});s.dirty()}}if(a.minLength!==null){if(t.data.length<a.minLength.value){(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.too_small,minimum:a.minLength.value,type:"array",inclusive:true,exact:false,message:a.minLength.message});s.dirty()}}if(a.maxLength!==null){if(t.data.length>a.maxLength.value){(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.too_big,maximum:a.maxLength.value,type:"array",inclusive:true,exact:false,message:a.maxLength.message});s.dirty()}}if(t.common.async){return Promise.all([...t.data].map(((e,s)=>a.type._parseAsync(new ParseInputLazyPath(t,e,t.path,s))))).then((e=>i.ParseStatus.mergeArray(s,e)))}const n=[...t.data].map(((e,s)=>a.type._parseSync(new ParseInputLazyPath(t,e,t.path,s))));return i.ParseStatus.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:n.errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:n.errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:n.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}t.ZodArray=ZodArray;ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray,...processCreateParams(t)});function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=ZodOptional.create(deepPartialify(r))}return new ZodObject({...e._def,shape:()=>t})}else if(e instanceof ZodArray){return new ZodArray({...e._def,type:deepPartialify(e.element)})}else if(e instanceof ZodOptional){return ZodOptional.create(deepPartialify(e.unwrap()))}else if(e instanceof ZodNullable){return ZodNullable.create(deepPartialify(e.unwrap()))}else if(e instanceof ZodTuple){return ZodTuple.create(e.items.map((e=>deepPartialify(e))))}else{return e}}class ZodObject extends ZodType{constructor(){super(...arguments);this._cached=null;this.nonstrict=this.passthrough;this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape();const t=o.util.objectKeys(e);this._cached={shape:e,keys:t};return this._cached}_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.object){const t=this._getOrReturnCtx(e);(0,i.addIssueToContext)(t,{code:r.ZodIssueCode.invalid_type,expected:o.ZodParsedType.object,received:t.parsedType});return i.INVALID}const{status:s,ctx:a}=this._processInputParams(e);const{shape:n,keys:d}=this._getCached();const u=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip")){for(const e in a.data){if(!d.includes(e)){u.push(e)}}}const c=[];for(const e of d){const t=n[e];const s=a.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(a,s,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if(e==="passthrough"){for(const e of u){c.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}})}}else if(e==="strict"){if(u.length>0){(0,i.addIssueToContext)(a,{code:r.ZodIssueCode.unrecognized_keys,keys:u});s.dirty()}}else if(e==="strip"){}else{throw new Error(`Internal ZodObject error: invalid unknownKeys value.`)}}else{const e=this._def.catchall;for(const t of u){const s=a.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(a,s,a.path,t)),alwaysSet:t in a.data})}}if(a.common.async){return Promise.resolve().then((async()=>{const e=[];for(const t of c){const s=await t.key;const r=await t.value;e.push({key:s,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>i.ParseStatus.mergeObjectSync(s,e)))}else{return i.ParseStatus.mergeObjectSync(s,c)}}get shape(){return this._def.shape()}strict(e){n.errorUtil.errToObj;return new ZodObject({...this._def,unknownKeys:"strict",...e!==undefined?{errorMap:(t,s)=>{const r=this._def.errorMap?.(t,s).message??s.defaultError;if(t.code==="unrecognized_keys")return{message:n.errorUtil.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){const t=new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:k.ZodObject});return t}s