import{o as Ke,f as et,h as tt}from"./vendor-IYr-MHu4.js";let _;(function(n){n.assertEqual=a=>{};function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{const s={};for(const i of a)s[i]=i;return s},n.getValidEnumValues=a=>{const s=n.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of s)i[o]=a[o];return n.objectValues(i)},n.objectValues=a=>n.objectKeys(a).map(function(s){return a[s]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},n.find=(a,s)=>{for(const i of a)if(s(i))return i},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(_||(_={}));let ke;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(ke||(ke={}));const f=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),W=n=>{switch(typeof n){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(n)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(n)?f.array:n===null?f.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?f.promise:typeof Map<"u"&&n instanceof Map?f.map:typeof Set<"u"&&n instanceof Set?f.set:typeof Date<"u"&&n instanceof Date?f.date:f.object;default:return f.unknown}},c=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class E 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]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(s){return s.message},r={_errors:[]},a=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,u=0;for(;ut.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const s=a.path[0];t[s]=t[s]||[],t[s].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}E.create=n=>new E(n);const pe=(n,e)=>{let t;switch(n.code){case c.invalid_type:n.received===f.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,_.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(n.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(n.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(n.options)}, received '${n.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:_.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case c.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case c.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(n)}return{message:t}};const nt=pe;function rt(){return nt}const at=n=>{const{data:e,path:t,errorMaps:r,issueData:a}=n,s=[...t,...a.path||[]],i={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)o=d(i,{data:e,defaultError:o}).message;return{...a,path:s,message:o}};function l(n,e){const t=rt(),r=at({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===pe?void 0:pe].filter(a=>!!a)});n.common.issues.push(r)}class O{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return g;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const s=await a.key,i=await a.value;r.push({key:s,value:i})}return O.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:s,value:i}=a;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"||a.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}}const g=Object.freeze({status:"aborted"}),U=n=>({status:"dirty",value:n}),M=n=>({status:"valid",value:n}),Te=n=>n.status==="aborted",Oe=n=>n.status==="dirty",q=n=>n.status==="valid",ae=n=>typeof Promise<"u"&&n instanceof Promise;let h;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));class N{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Me=(n,e)=>{if(q(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new E(n.common.issues);return this._error=t,this._error}}};function y(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:u}=n;return i.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:u??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:u??t??o.defaultError}},description:a}}class v{get description(){return this._def.description}_getType(e){return W(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:W(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new O,ctx:{common:e.parent.common,data:e.data,parsedType:W(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ae(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 r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:W(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Me(r,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:W(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return q(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>q(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:W(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(ae(a)?a:Promise.resolve(a));return Me(r,s)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const i=e(a),o=()=>s.addIssue({code:c.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new X({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return I.create(this,this._def)}nullable(){return J.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return P.create(this)}promise(){return ue.create(this,this._def)}or(e){return ie.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new X({...y(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new _e({...y(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new St({typeName:p.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new be({...y(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return we.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const st=/^c[^\s-]{8,}$/i,it=/^[0-9a-z]+$/,ot=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ct=/^[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,ut=/^[a-z0-9_-]{21}$/i,dt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lt=/^[-+]?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)?)??$/,ft=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ht="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let me;const mt=/^(?:(?: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])$/,pt=/^(?:(?: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])$/,gt=/^(([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]))$/,yt=/^(([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])$/,vt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ze="((\\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])))",bt=new RegExp(`^${ze}$`);function qe(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function wt(n){return new RegExp(`^${qe(n)}$`)}function xt(n){let e=`${ze}T${qe(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function kt(n,e){return!!((e==="v4"||!e)&&mt.test(n)||(e==="v6"||!e)&>.test(n))}function Tt(n,e){if(!dt.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Ot(n,e){return!!((e==="v4"||!e)&&pt.test(n)||(e==="v6"||!e)&&yt.test(n))}class j extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.string,received:s.parsedType}),g}const r=new O;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(a=this._getOrReturnCtx(e,a),l(a,{code:c.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.lengthe.test(a),{validation:t,code:c.invalid_string,...h.errToObj(r)})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.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,...h.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,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew j({checks:[],typeName:p.ZodString,coerce:n?.coerce??!1,...y(n)});function Mt(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,s=Number.parseInt(n.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return s%i/10**a}class B extends v{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)!==f.number){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.number,received:s.parsedType}),g}let r;const a=new O;for(const s of this._def.checks)s.kind==="int"?_.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:c.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:c.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Mt(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),l(r,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:c.not_finite,message:s.message}),a.dirty()):_.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:p.ZodNumber,coerce:n?.coerce||!1,...y(n)});class Q extends v{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)!==f.bigint)return this._getInvalidInput(e);let r;const a=new O;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:c.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),l(r,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):_.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new Q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Q({checks:[],typeName:p.ZodBigInt,coerce:n?.coerce??!1,...y(n)});class ge extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.boolean,received:r.parsedType}),g}return M(e.data)}}ge.create=n=>new ge({typeName:p.ZodBoolean,coerce:n?.coerce||!1,...y(n)});class se extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.date,received:s.parsedType}),g}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_date}),g}const r=new O;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(a=this._getOrReturnCtx(e,a),l(a,{code:c.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):_.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew se({checks:[],coerce:n?.coerce||!1,typeName:p.ZodDate,...y(n)});class Se extends v{_parse(e){if(this._getType(e)!==f.symbol){const r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.symbol,received:r.parsedType}),g}return M(e.data)}}Se.create=n=>new Se({typeName:p.ZodSymbol,...y(n)});class Ce extends v{_parse(e){if(this._getType(e)!==f.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.undefined,received:r.parsedType}),g}return M(e.data)}}Ce.create=n=>new Ce({typeName:p.ZodUndefined,...y(n)});class Pe extends v{_parse(e){if(this._getType(e)!==f.null){const r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.null,received:r.parsedType}),g}return M(e.data)}}Pe.create=n=>new Pe({typeName:p.ZodNull,...y(n)});class G extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return M(e.data)}}G.create=n=>new G({typeName:p.ZodAny,...y(n)});class Ne extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return M(e.data)}}Ne.create=n=>new Ne({typeName:p.ZodUnknown,...y(n)});class Z extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),g}}Z.create=n=>new Z({typeName:p.ZodNever,...y(n)});class De extends v{_parse(e){if(this._getType(e)!==f.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.void,received:r.parsedType}),g}return M(e.data)}}De.create=n=>new De({typeName:p.ZodVoid,...y(n)});class P extends v{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==f.array)return l(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),g;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.lengtha.maxLength.value&&(l(t,{code:c.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new N(t,i,t.path,o)))).then(i=>O.mergeArray(r,i));const s=[...t.data].map((i,o)=>a.type._parseSync(new N(t,i,t.path,o)));return O.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new P({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new P({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new P({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}P.create=(n,e)=>new P({type:n,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...y(e)});function F(n){if(n instanceof k){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=I.create(F(r))}return new k({...n._def,shape:()=>e})}else return n instanceof P?new P({...n._def,type:F(n.element)}):n instanceof I?I.create(F(n.unwrap())):n instanceof J?J.create(F(n.unwrap())):n instanceof L?L.create(n.items.map(e=>F(e))):n}class k extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){const d=this._getOrReturnCtx(e);return l(d,{code:c.invalid_type,expected:f.object,received:d.parsedType}),g}const{status:r,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Z&&this._def.unknownKeys==="strip"))for(const d in a.data)i.includes(d)||o.push(d);const u=[];for(const d of i){const m=s[d],w=a.data[d];u.push({key:{status:"valid",value:d},value:m._parse(new N(a,w,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof Z){const d=this._def.unknownKeys;if(d==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(d==="strict")o.length>0&&(l(a,{code:c.unrecognized_keys,keys:o}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const m of o){const w=a.data[m];u.push({key:{status:"valid",value:m},value:d._parse(new N(a,w,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const d=[];for(const m of u){const w=await m.key,x=await m.value;d.push({key:w,value:x,alwaysSet:m.alwaysSet})}return d}).then(d=>O.mergeObjectSync(r,d)):O.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{const a=this._def.errorMap?.(t,r).message??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};for(const r of _.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new k({...this._def,shape:()=>t})}omit(e){const t={};for(const r of _.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new k({...this._def,shape:()=>t})}deepPartial(){return F(this)}partial(e){const t={};for(const r of _.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new k({...this._def,shape:()=>t})}required(e){const t={};for(const r of _.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof I;)s=s._def.innerType;t[r]=s}return new k({...this._def,shape:()=>t})}keyof(){return Be(_.objectKeys(this.shape))}}k.create=(n,e)=>new k({shape:()=>n,unknownKeys:"strip",catchall:Z.create(),typeName:p.ZodObject,...y(e)});k.strictCreate=(n,e)=>new k({shape:()=>n,unknownKeys:"strict",catchall:Z.create(),typeName:p.ZodObject,...y(e)});k.lazycreate=(n,e)=>new k({shape:n,unknownKeys:"strip",catchall:Z.create(),typeName:p.ZodObject,...y(e)});class ie extends v{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new E(o.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:i}),g}if(t.common.async)return Promise.all(r.map(async s=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let s;const i=[];for(const u of r){const d={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:d});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(u=>new E(u));return l(t,{code:c.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}}ie.create=(n,e)=>new ie({options:n,typeName:p.ZodUnion,...y(e)});function ye(n,e){const t=W(n),r=W(e);if(n===e)return{valid:!0,data:n};if(t===f.object&&r===f.object){const a=_.objectKeys(e),s=_.objectKeys(n).filter(o=>a.indexOf(o)!==-1),i={...n,...e};for(const o of s){const u=ye(n[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&r===f.array){if(n.length!==e.length)return{valid:!1};const a=[];for(let s=0;s{if(Te(s)||Te(i))return g;const o=ye(s.value,i.value);return o.valid?((Oe(s)||Oe(i))&&t.dirty(),{status:t.value,value:o.data}):(l(r,{code:c.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])=>a(s,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}oe.create=(n,e,t)=>new oe({left:n,right:e,typeName:p.ZodIntersection,...y(t)});class L extends v{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.array)return l(r,{code:c.invalid_type,expected:f.array,received:r.parsedType}),g;if(r.data.lengththis._def.items.length&&(l(r,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new N(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>O.mergeArray(t,i)):O.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new L({...this._def,rest:e})}}L.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new L({items:n,typeName:p.ZodTuple,rest:null,...y(e)})};class ce extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.object)return l(r,{code:c.invalid_type,expected:f.object,received:r.parsedType}),g;const a=[],s=this._def.keyType,i=this._def.valueType;for(const o in r.data)a.push({key:s._parse(new N(r,o,r.path,o)),value:i._parse(new N(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?O.mergeObjectAsync(t,a):O.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof v?new ce({keyType:e,valueType:t,typeName:p.ZodRecord,...y(r)}):new ce({keyType:j.create(),valueType:e,typeName:p.ZodRecord,...y(t)})}}class je extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.map)return l(r,{code:c.invalid_type,expected:f.map,received:r.parsedType}),g;const a=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([o,u],d)=>({key:a._parse(new N(r,o,r.path,[d,"key"])),value:s._parse(new N(r,u,r.path,[d,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const d=await u.key,m=await u.value;if(d.status==="aborted"||m.status==="aborted")return g;(d.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(d.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const d=u.key,m=u.value;if(d.status==="aborted"||m.status==="aborted")return g;(d.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(d.value,m.value)}return{status:t.value,value:o}}}}je.create=(n,e,t)=>new je({valueType:e,keyType:n,typeName:p.ZodMap,...y(t)});class K extends v{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.set)return l(r,{code:c.invalid_type,expected:f.set,received:r.parsedType}),g;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(l(r,{code:c.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function i(u){const d=new Set;for(const m of u){if(m.status==="aborted")return g;m.status==="dirty"&&t.dirty(),d.add(m.value)}return{status:t.value,value:d}}const o=[...r.data.values()].map((u,d)=>s._parse(new N(r,u,r.path,d)));return r.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new K({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new K({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}K.create=(n,e)=>new K({valueType:n,minSize:null,maxSize:null,typeName:p.ZodSet,...y(e)});class Ee extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ee.create=(n,e)=>new Ee({getter:n,typeName:p.ZodLazy,...y(e)});class ve extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}ve.create=(n,e)=>new ve({value:n,typeName:p.ZodLiteral,...y(e)});function Be(n,e){return new H({values:n,typeName:p.ZodEnum,...y(e)})}class H extends v{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return l(t,{expected:_.joinValues(r),received:t.parsedType,code:c.invalid_type}),g}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:r}),g}return M(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return H.create(e,{...this._def,...t})}exclude(e,t=this._def){return H.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}H.create=Be;class Ae extends v{_parse(e){const t=_.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==f.string&&r.parsedType!==f.number){const a=_.objectValues(t);return l(r,{expected:_.joinValues(a),received:r.parsedType,code:c.invalid_type}),g}if(this._cache||(this._cache=new Set(_.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=_.objectValues(t);return l(r,{received:r.data,code:c.invalid_enum_value,options:a}),g}return M(e.data)}get enum(){return this._def.values}}Ae.create=(n,e)=>new Ae({values:n,typeName:p.ZodNativeEnum,...y(e)});class ue extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return l(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),g;const r=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return M(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ue.create=(n,e)=>new ue({type:n,typeName:p.ZodPromise,...y(e)});class X extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:i=>{l(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const i=a.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return g;const u=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return u.status==="aborted"?g:u.status==="dirty"||t.value==="dirty"?U(u.value):u});{if(t.value==="aborted")return g;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?g:o.status==="dirty"||t.value==="dirty"?U(o.value):o}}if(a.type==="refinement"){const i=o=>{const u=a.refinement(o,s);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!q(i))return g;const o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>q(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:t.value,value:o})):g);_.assertNever(a)}}X.create=(n,e,t)=>new X({schema:n,typeName:p.ZodEffects,effect:e,...y(t)});X.createWithPreprocess=(n,e,t)=>new X({schema:e,effect:{type:"preprocess",transform:n},typeName:p.ZodEffects,...y(t)});class I extends v{_parse(e){return this._getType(e)===f.undefined?M(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}I.create=(n,e)=>new I({innerType:n,typeName:p.ZodOptional,...y(e)});class J extends v{_parse(e){return this._getType(e)===f.null?M(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}J.create=(n,e)=>new J({innerType:n,typeName:p.ZodNullable,...y(e)});class _e extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===f.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_e.create=(n,e)=>new _e({innerType:n,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class be extends v{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ae(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new E(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new E(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}be.create=(n,e)=>new be({innerType:n,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Re extends v{_parse(e){if(this._getType(e)!==f.nan){const r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.nan,received:r.parsedType}),g}return{status:"valid",value:e.data}}}Re.create=n=>new Re({typeName:p.ZodNaN,...y(n)});class St extends v{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class xe extends v{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?g:s.status==="dirty"?(t.dirty(),U(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?g:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new xe({in:e,out:t,typeName:p.ZodPipeline})}}class we extends v{_parse(e){const t=this._def.innerType._parse(e),r=a=>(q(a)&&(a.value=Object.freeze(a.value)),a);return ae(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}we.create=(n,e)=>new we({innerType:n,typeName:p.ZodReadonly,...y(e)});function We(n,e){const t=typeof n=="function"?n(e):typeof n=="string"?{message:n}:n;return typeof t=="string"?{message:t}:t}function Ct(n,e={},t){return n?G.create().superRefine((r,a)=>{const s=n(r);if(s instanceof Promise)return s.then(i=>{if(!i){const o=We(e,r),u=o.fatal??t??!0;a.addIssue({code:"custom",...o,fatal:u})}});if(!s){const i=We(e,r),o=i.fatal??t??!0;a.addIssue({code:"custom",...i,fatal:o})}}):G.create()}let p;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(p||(p={}));const wr=(n,e={message:`Input not instance of ${n.name}`})=>Ct(t=>t instanceof n,e),xr=j.create,kr=B.create,Tr=ge.create,Or=G.create;Z.create;const Mr=P.create,Sr=k.create;ie.create;oe.create;L.create;const Cr=ce.create,Pr=ve.create,Nr=H.create;ue.create;I.create;J.create;const He=6048e5,Pt=864e5,ne=43200,Ie=1440,Ze=Symbol.for("constructDateFrom");function D(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&Ze in n?n[Ze](e):n instanceof Date?new n.constructor(e):new Date(e)}function T(n,e){return D(e||n,n)}function Nt(n,e,t){const r=T(n,t?.in);return isNaN(e)?D(n,NaN):(e&&r.setDate(r.getDate()+e),r)}const Dt={};function te(){return Dt}function ee(n,e){const t=te(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=T(n,e?.in),s=a.getDay(),i=(s=s.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function le(n){const e=T(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function fe(n,...e){const t=D.bind(null,n||e.find(r=>typeof r=="object"));return e.map(t)}function $e(n,e){const t=T(n,e?.in);return t.setHours(0,0,0,0),t}function jt(n,e,t){const[r,a]=fe(t?.in,n,e),s=$e(r),i=$e(a),o=+s-le(s),u=+i-le(i);return Math.round((o-u)/Pt)}function Et(n,e){const t=Xe(n,e),r=D(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),de(r)}function re(n,e){const t=+T(n)-+T(e);return t<0?-1:t>0?1:t}function At(n){return D(n,Date.now())}function Rt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Wt(n){return!(!Rt(n)&&typeof n!="number"||isNaN(+T(n)))}function It(n,e,t){const[r,a]=fe(t?.in,n,e),s=r.getFullYear()-a.getFullYear(),i=r.getMonth()-a.getMonth();return s*12+i}function Zt(n){return e=>{const r=(n?Math[n]:Math.trunc)(e);return r===0?0:r}}function $t(n,e){return+T(n)-+T(e)}function Lt(n,e){const t=T(n,e?.in);return t.setHours(23,59,59,999),t}function Yt(n,e){const t=T(n,e?.in),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function Vt(n,e){const t=T(n,e?.in);return+Lt(t,e)==+Yt(t,e)}function Ft(n,e,t){const[r,a,s]=fe(t?.in,n,n,e),i=re(a,s),o=Math.abs(It(a,s));if(o<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-i*o);let u=re(a,s)===-i;Vt(r)&&o===1&&re(r,s)===1&&(u=!1);const d=i*(o-+u);return d===0?0:d}function zt(n,e,t){const r=$t(n,e)/1e3;return Zt(t?.roundingMethod)(r)}function qt(n,e){const t=T(n,e?.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Bt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ht=(n,e,t)=>{let r;const a=Bt[n];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?`in ${r}`:`${r} ago`:r};function z(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const Xt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Qt={date:z({formats:Xt,defaultWidth:"full"}),time:z({formats:Jt,defaultWidth:"full"}),dateTime:z({formats:Ut,defaultWidth:"full"})},Gt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Kt=(n,e,t,r)=>Gt[n];function S(n){return(e,t)=>{const r=t?.context?String(t.context):"standalone";let a;if(r==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,o=t?.width?String(t.width):i;a=n.formattingValues[o]||n.formattingValues[i]}else{const i=n.defaultWidth,o=t?.width?String(t.width):n.defaultWidth;a=n.values[o]||n.values[i]}const s=n.argumentCallback?n.argumentCallback(e):e;return a[s]}}const en={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tn={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rn={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},an={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},sn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},on=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return `${t}st`;case 2:return `${t}nd`;case 3:return `${t}rd`}return `${t}th`},cn={ordinalNumber:on,era:S({values:en,defaultWidth:"wide"}),quarter:S({values:tn,defaultWidth:"wide",argumentCallback:n=>n-1}),month:S({values:nn,defaultWidth:"wide"}),day:S({values:rn,defaultWidth:"wide"}),dayPeriod:S({values:an,defaultWidth:"wide",formattingValues:sn,defaultFormattingWidth:"wide"})};function C(n){return(e,t={})=>{const r=t.width,a=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=e.match(a);if(!s)return null;const i=s[0],o=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(o)?dn(o,w=>w.test(i)):un(o,w=>w.test(i));let d;d=n.valueCallback?n.valueCallback(u):u,d=t.valueCallback?t.valueCallback(d):d;const m=e.slice(i.length);return{value:d,rest:m}}}function un(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function dn(n,e){for(let t=0;t{const r=e.match(n.matchPattern);if(!r)return null;const a=r[0],s=e.match(n.parsePattern);if(!s)return null;let i=n.valueCallback?n.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const o=e.slice(a.length);return{value:i,rest:o}}}const ln=/^(\d+)(th|st|nd|rd)?/i,fn=/\d+/i,hn={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},mn={any:[/^b/i,/^(a|c)/i]},pn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gn={any:[/1/i,/2/i,/3/i,/4/i]},yn={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},vn={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},_n={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},bn={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},wn={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xn={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kn={ordinalNumber:Je({matchPattern:ln,parsePattern:fn,valueCallback:n=>parseInt(n,10)}),era:C({matchPatterns:hn,defaultMatchWidth:"wide",parsePatterns:mn,defaultParseWidth:"any"}),quarter:C({matchPatterns:pn,defaultMatchWidth:"wide",parsePatterns:gn,defaultParseWidth:"any",valueCallback:n=>n+1}),month:C({matchPatterns:yn,defaultMatchWidth:"wide",parsePatterns:vn,defaultParseWidth:"any"}),day:C({matchPatterns:_n,defaultMatchWidth:"wide",parsePatterns:bn,defaultParseWidth:"any"}),dayPeriod:C({matchPatterns:wn,defaultMatchWidth:"any",parsePatterns:xn,defaultParseWidth:"any"})},Ue={code:"en-US",formatDistance:Ht,formatLong:Qt,formatRelative:Kt,localize:cn,match:kn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Tn(n,e){const t=T(n,e?.in);return jt(t,qt(t))+1}function On(n,e){const t=T(n,e?.in),r=+de(t)-+Et(t);return Math.round(r/He)+1}function Qe(n,e){const t=T(n,e?.in),r=t.getFullYear(),a=te(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=D(e?.in||n,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const o=ee(i,e),u=D(e?.in||n,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const d=ee(u,e);return+t>=+o?r+1:+t>=+d?r:r-1}function Mn(n,e){const t=te(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,a=Qe(n,e),s=D(e?.in||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),ee(s,e)}function Sn(n,e){const t=T(n,e?.in),r=+ee(t,e)-+Mn(t,e);return Math.round(r/He)+1}function b(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const R={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return b(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):b(t+1,2)},d(n,e){return b(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];default:return t==="am"?"a.m.":"p.m."}},h(n,e){return b(n.getHours()%12||12,e.length)},H(n,e){return b(n.getHours(),e.length)},m(n,e){return b(n.getMinutes(),e.length)},s(n,e){return b(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),a=Math.trunc(r*Math.pow(10,t-3));return b(a,e.length)}},V={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Le={G(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});default:return t.era(r,{width:"wide"})}},y(n,e,t){if(e==="yo"){const r=n.getFullYear(),a=r>0?r:1-r;return t.ordinalNumber(a,{unit:"year"})}return R.y(n,e)},Y(n,e,t,r){const a=Qe(n,r),s=a>0?a:1-a;if(e==="YY"){const i=s%100;return b(i,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):b(s,e.length)},R(n,e){const t=Xe(n);return b(t,e.length)},u(n,e){const t=n.getFullYear();return b(t,e.length)},Q(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return b(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});default:return t.quarter(r,{width:"wide",context:"formatting"})}},q(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return b(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});default:return t.quarter(r,{width:"wide",context:"standalone"})}},M(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return R.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});default:return t.month(r,{width:"wide",context:"formatting"})}},L(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return b(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});default:return t.month(r,{width:"wide",context:"standalone"})}},w(n,e,t,r){const a=Sn(n,r);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):b(a,e.length)},I(n,e,t){const r=On(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):b(r,e.length)},d(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):R.d(n,e)},D(n,e,t){const r=Tn(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):b(r,e.length)},E(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});default:return t.day(r,{width:"wide",context:"formatting"})}},e(n,e,t,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return b(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});default:return t.day(a,{width:"wide",context:"formatting"})}},c(n,e,t,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return b(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});default:return t.day(a,{width:"wide",context:"standalone"})}},i(n,e,t){const r=n.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return b(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});default:return t.day(r,{width:"wide",context:"formatting"})}},a(n,e,t){const a=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b(n,e,t){const r=n.getHours();let a;switch(r===12?a=V.noon:r===0?a=V.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B(n,e,t){const r=n.getHours();let a;switch(r>=17?a=V.evening:r>=12?a=V.afternoon:r>=4?a=V.morning:a=V.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return R.h(n,e)},H(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):R.H(n,e)},K(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},k(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},m(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):R.m(n,e)},s(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):R.s(n,e)},S(n,e){return R.S(n,e)},X(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Ve(r);case"XXXX":case"XX":return $(r);default:return $(r,":")}},x(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return Ve(r);case"xxxx":case"xx":return $(r);default:return $(r,":")}},O(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return`GMT${Ye(r,":")}`;default:return`GMT${$(r,":")}`}},z(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return`GMT${Ye(r,":")}`;default:return`GMT${$(r,":")}`}},t(n,e,t){const r=Math.trunc(+n/1e3);return b(r,e.length)},T(n,e,t){return b(+n,e.length)}};function Ye(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),a=Math.trunc(r/60),s=r%60;return s===0?t+String(a):t+String(a)+e+b(s,2)}function Ve(n,e){return n%60===0?(n>0?"-":"+")+b(Math.abs(n)/60,2):$(n,e)}function $(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),a=b(Math.trunc(r/60),2),s=b(r%60,2);return t+a+e+s}const Fe=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Ge=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Cn=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],a=t[2];if(!a)return Fe(n,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Fe(r,e)).replace("{{time}}",Ge(a,e))},Pn={p:Ge,P:Cn},Nn=/^D+$/,Dn=/^Y+$/,jn=["D","DD","YY","YYYY"];function En(n){return Nn.test(n)}function An(n){return Dn.test(n)}function Rn(n,e,t){const r=Wn(n,e,t);if(console.warn(r),jn.includes(n))throw new RangeError(r)}function Wn(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const In=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$n=/^'([^]*?)'?$/,Ln=/''/g,Yn=/[a-zA-Z]/;function Dr(n,e,t){const r=te(),a=t?.locale??r.locale??Ue,s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=T(n,t?.in);if(!Wt(o))throw new RangeError("Invalid time value");let u=e.match(Zn).map(m=>{const w=m[0];if(w==="p"||w==="P"){const x=Pn[w];return x(m,a.formatLong)}return m}).join("").match(In).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const w=m[0];if(w==="'")return{isToken:!1,value:Vn(m)};if(Le[w])return{isToken:!0,value:m};if(w.match(Yn))throw new RangeError(`Format string contains an unescaped latin alphabet character \`${w}\``);return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(o,u));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const w=m.value;(!t?.useAdditionalWeekYearTokens&&An(w)||!t?.useAdditionalDayOfYearTokens&&En(w))&&Rn(w,e,String(n));const x=Le[w[0]];return x(o,w,a.localize,d)}).join("")}function Vn(n){const e=n.match($n);return e?e[1].replace(Ln,"'"):n}function Fn(n,e,t){const r=te(),a=t?.locale??r.locale??Ue,s=2520,i=re(n,e);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:i}),[u,d]=fe(t?.in,...i>0?[e,n]:[n,e]),m=zt(d,u),w=(le(d)-le(u))/1e3,x=Math.round((m-w)/60);let Y;if(x<2)return t?.includeSeconds?m<5?a.formatDistance("lessThanXSeconds",5,o):m<10?a.formatDistance("lessThanXSeconds",10,o):m<20?a.formatDistance("lessThanXSeconds",20,o):m<40?a.formatDistance("halfAMinute",0,o):m<60?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",1,o):x===0?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",x,o);if(x<45)return a.formatDistance("xMinutes",x,o);if(x<90)return a.formatDistance("aboutXHours",1,o);if(x{let r;const a=zn[n];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",String(e)),t?.addSuffix?t.comparison&&t.comparison>0?`dans ${r}`:`il y a ${r}`:r},Bn={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Hn={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Xn={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jn={date:z({formats:Bn,defaultWidth:"full"}),time:z({formats:Hn,defaultWidth:"full"}),dateTime:z({formats:Xn,defaultWidth:"full"})},Un={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},Qn=(n,e,t,r)=>Un[n],Gn={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},Kn={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},er={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},tr={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},nr={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},rr=(n,e)=>{const t=Number(n),r=e?.unit;if(t===0)return"0";const a=["year","week","hour","minute","second"];let s;return t===1?s=r&&a.includes(r)?"ère":"er":s="ème",t+s},ar=["MMM","MMMM"],sr={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&ar.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:rr,era:S({values:Gn,defaultWidth:"wide"}),quarter:S({values:Kn,defaultWidth:"wide",argumentCallback:n=>n-1}),month:S({values:er,defaultWidth:"wide"}),day:S({values:tr,defaultWidth:"wide"}),dayPeriod:S({values:nr,defaultWidth:"wide"})},ir=/^(\d+)(ième|ère|ème|er|e)?/i,or=/\d+/i,cr={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},ur={any:[/^av/i,/^ap/i]},dr={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},lr={any:[/1/i,/2/i,/3/i,/4/i]},fr={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},hr={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},mr={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},pr={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},gr={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},yr={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},vr={ordinalNumber:Je({matchPattern:ir,parsePattern:or,valueCallback:n=>parseInt(n)}),era:C({matchPatterns:cr,defaultMatchWidth:"wide",parsePatterns:ur,defaultParseWidth:"any"}),quarter:C({matchPatterns:dr,defaultMatchWidth:"wide",parsePatterns:lr,defaultParseWidth:"any",valueCallback:n=>n+1}),month:C({matchPatterns:fr,defaultMatchWidth:"wide",parsePatterns:hr,defaultParseWidth:"any"}),day:C({matchPatterns:mr,defaultMatchWidth:"wide",parsePatterns:pr,defaultParseWidth:"any"}),dayPeriod:C({matchPatterns:gr,defaultMatchWidth:"any",parsePatterns:yr,defaultParseWidth:"any"})},Ar={code:"fr",formatDistance:qn,formatLong:Jn,formatRelative:Qn,localize:sr,match:vr,options:{weekStartsOn:1,firstWeekContainsDate:4}};const _r=function(n,e){for(var t={};n.length;){const r=n[0],a=r.code,s=r.message,i=r.path.join(".");if(!t[i])if("unionErrors"in r){const o=r.unionErrors[0].errors[0];t[i]={message:o.message,type:o.code}}else t[i]={message:s,type:a};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(w){return n.push(w)})}),e){const u=t[i].types,d=u&&u[r.code];t[i]=tt(i,e,t,a,d?[].concat(d,r.message):r.message)}n.shift()}return t},Rr=function(n,e,t){return t===void 0&&(t={}),function(r,a,s){try{return Promise.resolve((function(i,o){try{var u=Promise.resolve(n[t.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(d){return s.shouldUseNativeValidation&&Ke({},s),{errors:{},values:t.raw?r:d}})}catch(d){return o(d)}return u&&u.then?u.then(void 0,o):u})(0,function(i){if((function(o){return Array.isArray(o?.errors)})(i))return{values:{},errors:et(_r(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}};export{E as Z,Or as a,Tr as b,Mr as c,Ar as d,Nr as e,jr as f,Er as g,Dr as h,wr as i,Pr as l,kr as n,Sr as o,Cr as r,xr as s,Rr as t};