veza/apps/web/dist_verification/assets/vendor-utils-D0JLFg89.js
senke 670282989b chore(refactor/sumi-migration): commit pending changes — tests, stream server, dist_verification
- apps/web: test updates (Vitest/setup), playbackAnalyticsService, TrackGrid, serviceErrorHandler
- veza-common: logging, metrics, traits, validation, random
- veza-stream-server: audio pipeline, codecs, cache, monitoring, routes
- apps/web/dist_verification: refresh build assets (content-hashed filenames)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 19:39:18 +01:00

1 line
83 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{a8 as at,a9 as st,aa as it}from"./vendor-CjLUfV8Y.js";var _;(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})(_||(_={}));var Oe;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Oe||(Oe={}));const f=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=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}},d=_.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(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return a(this),r}static assert(e){if(!(e instanceof E))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.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 ye=(n,e)=>{let t;switch(n.code){case d.invalid_type:n.received===f.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,_.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(n.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(n.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(n.options)}, received '${n.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof 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 d.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 d.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 d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(n)}return{message:t}};let ot=ye;function ct(){return ot}const ut=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(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...a,path:s,message:o}};function l(n,e){const t=ct(),r=ut({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===ye?void 0:ye].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"}),Q=n=>({status:"dirty",value:n}),M=n=>({status:"valid",value:n}),Me=n=>n.status==="aborted",Se=n=>n.status==="dirty",q=n=>n.status==="valid",se=n=>typeof Promise<"u"&&n instanceof Promise;var m;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(m||(m={}));class D{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 Ce=(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 I(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:I(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:I(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(se(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:I(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Ce(r,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(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:I(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(se(a)?a:Promise.resolve(a));return Ce(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:d.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 B({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 W.create(this,this._def)}nullable(){return X.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return de.create(this,this._def)}or(e){return oe.create([this,e],this._def)}and(e){return ce.create(this,e,this._def)}transform(e){return new B({...y(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new we({...y(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new jt({typeName:p.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new xe({...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 Te.create(this,e)}readonly(){return ke.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dt=/^c[^\s-]{8,}$/i,lt=/^[0-9a-z]+$/,ft=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ht=/^[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,mt=/^[a-z0-9_-]{21}$/i,pt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,gt=/^[-+]?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)?)??$/,yt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let pe;const _t=/^(?:(?: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])$/,bt=/^(?:(?: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])$/,wt=/^(([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]))$/,xt=/^(([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])$/,kt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Tt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ue="((\\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])))",Ot=new RegExp(`^${Ue}$`);function He(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 Mt(n){return new RegExp(`^${He(n)}$`)}function St(n){let e=`${Ue}T${He(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 Ct(n,e){return!!((e==="v4"||!e)&&_t.test(n)||(e==="v6"||!e)&&wt.test(n))}function Nt(n,e){if(!pt.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 Dt(n,e){return!!((e==="v4"||!e)&&bt.test(n)||(e==="v6"||!e)&&xt.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:d.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.length<s.value&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.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.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?l(a,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&l(a,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")yt.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"email",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")pe||(pe=new RegExp(vt,"u")),pe.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"emoji",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")ht.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"uuid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")mt.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"nanoid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")dt.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"cuid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")lt.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"cuid2",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")ft.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"ulid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),l(a,{validation:"url",code:d.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"regex",code:d.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?St(s).test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Ot.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Mt(s).test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:d.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?gt.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"duration",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Ct(e.data,s.version)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"ip",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?Nt(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"jwt",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Dt(e.data,s.version)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"cidr",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?kt.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"base64",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Tt.test(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{validation:"base64url",code:d.invalid_string,message:s.message}),r.dirty()):_.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:d.invalid_string,...m.errToObj(r)})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.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,...m.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,...m.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...m.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...m.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errToObj(t)})}nonempty(e){return this.min(1,m.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.value<e)&&(e=t.value);return e}}j.create=n=>new j({checks:[],typeName:p.ZodString,coerce:n?.coerce??!1,...y(n)});function Pt(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 U 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:d.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:d.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Pt(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.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:d.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,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,r,a){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:m.toString(a)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.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.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}U.create=n=>new U({checks:[],typeName:p.ZodNumber,coerce:n?.coerce||!1,...y(n)});class G 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.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.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:d.invalid_type,expected:f.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,r,a){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:m.toString(a)}]})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}G.create=n=>new G({checks:[],typeName:p.ZodBigInt,coerce:n?.coerce??!1,...y(n)});class ve 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:d.invalid_type,expected:f.boolean,received:r.parsedType}),g}return M(e.data)}}ve.create=n=>new ve({typeName:p.ZodBoolean,coerce:n?.coerce||!1,...y(n)});class ie 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:d.invalid_type,expected:f.date,received:s.parsedType}),g}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return l(s,{code:d.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:d.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),l(a,{code:d.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 ie({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}ie.create=n=>new ie({checks:[],coerce:n?.coerce||!1,typeName:p.ZodDate,...y(n)});class Ne extends v{_parse(e){if(this._getType(e)!==f.symbol){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.symbol,received:r.parsedType}),g}return M(e.data)}}Ne.create=n=>new Ne({typeName:p.ZodSymbol,...y(n)});class De extends v{_parse(e){if(this._getType(e)!==f.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.undefined,received:r.parsedType}),g}return M(e.data)}}De.create=n=>new De({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:d.invalid_type,expected:f.null,received:r.parsedType}),g}return M(e.data)}}Pe.create=n=>new Pe({typeName:p.ZodNull,...y(n)});class _e extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return M(e.data)}}_e.create=n=>new _e({typeName:p.ZodAny,...y(n)});class je extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return M(e.data)}}je.create=n=>new je({typeName:p.ZodUnknown,...y(n)});class Z extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),g}}Z.create=n=>new Z({typeName:p.ZodNever,...y(n)});class Ee extends v{_parse(e){if(this._getType(e)!==f.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.void,received:r.parsedType}),g}return M(e.data)}}Ee.create=n=>new Ee({typeName:p.ZodVoid,...y(n)});class N extends v{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==f.array)return l(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),g;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(l(t,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(l(t,{code:d.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 D(t,i,t.path,o)))).then(i=>O.mergeArray(r,i));const s=[...t.data].map((i,o)=>a.type._parseSync(new D(t,i,t.path,o)));return O.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(n,e)=>new N({type:n,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...y(e)});function V(n){if(n instanceof k){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=W.create(V(r))}return new k({...n._def,shape:()=>e})}else return n instanceof N?new N({...n._def,type:V(n.element)}):n instanceof W?W.create(V(n.unwrap())):n instanceof X?X.create(V(n.unwrap())):n instanceof Y?Y.create(n.items.map(e=>V(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 c=this._getOrReturnCtx(e);return l(c,{code:d.invalid_type,expected:f.object,received:c.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 c in a.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const h=s[c],w=a.data[c];u.push({key:{status:"valid",value:c},value:h._parse(new D(a,w,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof Z){const c=this._def.unknownKeys;if(c==="passthrough")for(const h of o)u.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(c==="strict")o.length>0&&(l(a,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const h of o){const w=a.data[h];u.push({key:{status:"valid",value:h},value:c._parse(new D(a,w,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const h of u){const w=await h.key,x=await h.value;c.push({key:w,value:x,alwaysSet:h.alwaysSet})}return c}).then(c=>O.mergeObjectSync(r,c)):O.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return m.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:m.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 V(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 W;)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 oe 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:d.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 c={...t,common:{...t.common,issues:[]},parent:null},h=u._parseSync({data:t.data,path:t.path,parent:c});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:c}),c.common.issues.length&&i.push(c.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:d.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}}oe.create=(n,e)=>new oe({options:n,typeName:p.ZodUnion,...y(e)});function be(n,e){const t=I(n),r=I(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=be(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<n.length;s++){const i=n[s],o=e[s],u=be(i,o);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return t===f.date&&r===f.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class ce extends v{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(s,i)=>{if(Me(s)||Me(i))return g;const o=be(s.value,i.value);return o.valid?((Se(s)||Se(i))&&t.dirty(),{status:t.value,value:o.data}):(l(r,{code:d.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}))}}ce.create=(n,e,t)=>new ce({left:n,right:e,typeName:p.ZodIntersection,...y(t)});class Y extends v{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.array)return l(r,{code:d.invalid_type,expected:f.array,received:r.parsedType}),g;if(r.data.length<this._def.items.length)return l(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&r.data.length>this._def.items.length&&(l(r,{code:d.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 D(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 Y({...this._def,rest:e})}}Y.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y({items:n,typeName:p.ZodTuple,rest:null,...y(e)})};class ue 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:d.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 D(r,o,r.path,o)),value:i._parse(new D(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 ue({keyType:e,valueType:t,typeName:p.ZodRecord,...y(r)}):new ue({keyType:j.create(),valueType:e,typeName:p.ZodRecord,...y(t)})}}class Ae 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:d.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],c)=>({key:a._parse(new D(r,o,r.path,[c,"key"])),value:s._parse(new D(r,u,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,h=await u.value;if(c.status==="aborted"||h.status==="aborted")return g;(c.status==="dirty"||h.status==="dirty")&&t.dirty(),o.set(c.value,h.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,h=u.value;if(c.status==="aborted"||h.status==="aborted")return g;(c.status==="dirty"||h.status==="dirty")&&t.dirty(),o.set(c.value,h.value)}return{status:t.value,value:o}}}}Ae.create=(n,e,t)=>new Ae({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:d.invalid_type,expected:f.set,received:r.parsedType}),g;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(l(r,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(l(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function i(u){const c=new Set;for(const h of u){if(h.status==="aborted")return g;h.status==="dirty"&&t.dirty(),c.add(h.value)}return{status:t.value,value:c}}const o=[...r.data.values()].map((u,c)=>s._parse(new D(r,u,r.path,c)));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:m.toString(t)}})}max(e,t){return new K({...this._def,maxSize:{value:e,message:m.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 Re 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})}}Re.create=(n,e)=>new Re({getter:n,typeName:p.ZodLazy,...y(e)});class Ie extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ie.create=(n,e)=>new Ie({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:d.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:d.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 We 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:d.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:d.invalid_enum_value,options:a}),g}return M(e.data)}get enum(){return this._def.values}}We.create=(n,e)=>new We({values:n,typeName:p.ZodNativeEnum,...y(e)});class de 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:d.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})))}}de.create=(n,e)=>new de({type:n,typeName:p.ZodPromise,...y(e)});class B 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"?Q(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"?Q(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)}}B.create=(n,e,t)=>new B({schema:n,typeName:p.ZodEffects,effect:e,...y(t)});B.createWithPreprocess=(n,e,t)=>new B({schema:e,effect:{type:"preprocess",transform:n},typeName:p.ZodEffects,...y(t)});class W extends v{_parse(e){return this._getType(e)===f.undefined?M(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}W.create=(n,e)=>new W({innerType:n,typeName:p.ZodOptional,...y(e)});class X extends v{_parse(e){return this._getType(e)===f.null?M(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}X.create=(n,e)=>new X({innerType:n,typeName:p.ZodNullable,...y(e)});class we 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}}we.create=(n,e)=>new we({innerType:n,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class xe 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 se(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}}xe.create=(n,e)=>new xe({innerType:n,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Ze extends v{_parse(e){if(this._getType(e)!==f.nan){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.nan,received:r.parsedType}),g}return{status:"valid",value:e.data}}}Ze.create=n=>new Ze({typeName:p.ZodNaN,...y(n)});class jt 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 Te 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(),Q(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 Te({in:e,out:t,typeName:p.ZodPipeline})}}class ke extends v{_parse(e){const t=this._def.innerType._parse(e),r=a=>(q(a)&&(a.value=Object.freeze(a.value)),a);return se(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}ke.create=(n,e)=>new ke({innerType:n,typeName:p.ZodReadonly,...y(e)});var 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 $r=j.create,Yr=U.create,Fr=ve.create,Lr=_e.create;Z.create;const Vr=N.create,zr=k.create;oe.create;ce.create;Y.create;const qr=ue.create,Ur=H.create;de.create;W.create;X.create;const Xe=6048e5,Et=864e5,Je=6e4,Qe=36e5,ne=43200,$e=1440,Ye=Symbol.for("constructDateFrom");function P(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&Ye in n?n[Ye](e):n instanceof Date?new n.constructor(e):new Date(e)}function T(n,e){return P(e||n,n)}let At={};function te(){return At}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<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function le(n,e){return ee(n,{...e,weekStartsOn:1})}function Ge(n,e){const t=T(n,e?.in),r=t.getFullYear(),a=P(t,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=le(a),i=P(t,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=le(i);return t.getTime()>=s.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function fe(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 he(n,...e){const t=P.bind(null,n||e.find(r=>typeof r=="object"));return e.map(t)}function Fe(n,e){const t=T(n,e?.in);return t.setHours(0,0,0,0),t}function Rt(n,e,t){const[r,a]=he(t?.in,n,e),s=Fe(r),i=Fe(a),o=+s-fe(s),u=+i-fe(i);return Math.round((o-u)/Et)}function It(n,e){const t=Ge(n,e),r=P(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),le(r)}function ae(n,e){const t=+T(n)-+T(e);return t<0?-1:t>0?1:t}function Wt(n){return P(n,Date.now())}function Zt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function $t(n){return!(!Zt(n)&&typeof n!="number"||isNaN(+T(n)))}function Yt(n,e,t){const[r,a]=he(t?.in,n,e),s=r.getFullYear()-a.getFullYear(),i=r.getMonth()-a.getMonth();return s*12+i}function Ft(n){return e=>{const r=(n?Math[n]:Math.trunc)(e);return r===0?0:r}}function Lt(n,e){return+T(n)-+T(e)}function Vt(n,e){const t=T(n,e?.in);return t.setHours(23,59,59,999),t}function zt(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 qt(n,e){const t=T(n,e?.in);return+Vt(t,e)==+zt(t,e)}function Ut(n,e,t){const[r,a,s]=he(t?.in,n,n,e),i=ae(a,s),o=Math.abs(Yt(a,s));if(o<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-i*o);let u=ae(a,s)===-i;qt(r)&&o===1&&ae(r,s)===1&&(u=!1);const c=i*(o-+u);return c===0?0:c}function Ht(n,e,t){const r=Lt(n,e)/1e3;return Ft(t?.roundingMethod)(r)}function Bt(n,e){const t=T(n,e?.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Xt={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"}},Jt=(n,e,t)=>{let r;const a=Xt[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 Qt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},en={date:z({formats:Qt,defaultWidth:"full"}),time:z({formats:Gt,defaultWidth:"full"}),dateTime:z({formats:Kt,defaultWidth:"full"})},tn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nn=(n,e,t,r)=>tn[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 rn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},an={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sn={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"]},on={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"]},cn={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"}},un={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"}},dn=(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"},ln={ordinalNumber:dn,era:S({values:rn,defaultWidth:"wide"}),quarter:S({values:an,defaultWidth:"wide",argumentCallback:n=>n-1}),month:S({values:sn,defaultWidth:"wide"}),day:S({values:on,defaultWidth:"wide"}),dayPeriod:S({values:cn,defaultWidth:"wide",formattingValues:un,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)?hn(o,w=>w.test(i)):fn(o,w=>w.test(i));let c;c=n.valueCallback?n.valueCallback(u):u,c=t.valueCallback?t.valueCallback(c):c;const h=e.slice(i.length);return{value:c,rest:h}}}function fn(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function hn(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function Ke(n){return(e,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 mn=/^(\d+)(th|st|nd|rd)?/i,pn=/\d+/i,gn={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},yn={any:[/^b/i,/^(a|c)/i]},vn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_n={any:[/1/i,/2/i,/3/i,/4/i]},bn={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},wn={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]},xn={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},kn={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]},Tn={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},On={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}},Mn={ordinalNumber:Ke({matchPattern:mn,parsePattern:pn,valueCallback:n=>parseInt(n,10)}),era:C({matchPatterns:gn,defaultMatchWidth:"wide",parsePatterns:yn,defaultParseWidth:"any"}),quarter:C({matchPatterns:vn,defaultMatchWidth:"wide",parsePatterns:_n,defaultParseWidth:"any",valueCallback:n=>n+1}),month:C({matchPatterns:bn,defaultMatchWidth:"wide",parsePatterns:wn,defaultParseWidth:"any"}),day:C({matchPatterns:xn,defaultMatchWidth:"wide",parsePatterns:kn,defaultParseWidth:"any"}),dayPeriod:C({matchPatterns:Tn,defaultMatchWidth:"any",parsePatterns:On,defaultParseWidth:"any"})},et={code:"en-US",formatDistance:Jt,formatLong:en,formatRelative:nn,localize:ln,match:Mn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Sn(n,e){const t=T(n,e?.in);return Rt(t,Bt(t))+1}function Cn(n,e){const t=T(n,e?.in),r=+le(t)-+It(t);return Math.round(r/Xe)+1}function tt(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=P(e?.in||n,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const o=ee(i,e),u=P(e?.in||n,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const c=ee(u,e);return+t>=+o?r+1:+t>=+c?r:r-1}function Nn(n,e){const t=te(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,a=tt(n,e),s=P(e?.in||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),ee(s,e)}function Dn(n,e){const t=T(n,e?.in),r=+ee(t,e)-+Nn(t,e);return Math.round(r/Xe)+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)}},L={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Le={G:function(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:function(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:function(n,e,t,r){const a=tt(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:function(n,e){const t=Ge(n);return b(t,e.length)},u:function(n,e){const t=n.getFullYear();return b(t,e.length)},Q:function(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:function(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:function(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:function(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:function(n,e,t,r){const a=Dn(n,r);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):b(a,e.length)},I:function(n,e,t){const r=Cn(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):b(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):R.d(n,e)},D:function(n,e,t){const r=Sn(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):b(r,e.length)},E:function(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:function(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:function(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:function(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:function(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:function(n,e,t){const r=n.getHours();let a;switch(r===12?a=L.noon:r===0?a=L.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:function(n,e,t){const r=n.getHours();let a;switch(r>=17?a=L.evening:r>=12?a=L.afternoon:r>=4?a=L.morning:a=L.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:function(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:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):R.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):b(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):R.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):R.s(n,e)},S:function(n,e){return R.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return ze(r);case"XXXX":case"XX":return $(r);default:return $(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return ze(r);case"xxxx":case"xx":return $(r);default:return $(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ve(r,":");default:return"GMT"+$(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ve(r,":");default:return"GMT"+$(r,":")}},t:function(n,e,t){const r=Math.trunc(+n/1e3);return b(r,e.length)},T:function(n,e,t){return b(+n,e.length)}};function Ve(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 ze(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 qe=(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"})}},nt=(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"})}},Pn=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],a=t[2];if(!a)return qe(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}}",qe(r,e)).replace("{{time}}",nt(a,e))},jn={p:nt,P:Pn},En=/^D+$/,An=/^Y+$/,Rn=["D","DD","YY","YYYY"];function In(n){return En.test(n)}function Wn(n){return An.test(n)}function Zn(n,e,t){const r=$n(n,e,t);if(console.warn(r),Rn.includes(n))throw new RangeError(r)}function $n(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 Yn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ln=/^'([^]*?)'?$/,Vn=/''/g,zn=/[a-zA-Z]/;function Hr(n,e,t){const r=te(),a=r.locale??et,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=T(n,t?.in);if(!$t(o))throw new RangeError("Invalid time value");let u=e.match(Fn).map(h=>{const w=h[0];if(w==="p"||w==="P"){const x=jn[w];return x(h,a.formatLong)}return h}).join("").match(Yn).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const w=h[0];if(w==="'")return{isToken:!1,value:qn(h)};if(Le[w])return{isToken:!0,value:h};if(w.match(zn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(u=a.localize.preprocessor(o,u));const c={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return u.map(h=>{if(!h.isToken)return h.value;const w=h.value;(Wn(w)||In(w))&&Zn(w,e,String(n));const x=Le[w[0]];return x(o,w,a.localize,c)}).join("")}function qn(n){const e=n.match(Ln);return e?e[1].replace(Vn,"'"):n}function Un(n,e,t){const r=te(),a=t?.locale??r.locale??et,s=2520,i=ae(n,e);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:i}),[u,c]=he(t?.in,...i>0?[e,n]:[n,e]),h=Ht(c,u),w=(fe(c)-fe(u))/1e3,x=Math.round((h-w)/60);let F;if(x<2)return t?.includeSeconds?h<5?a.formatDistance("lessThanXSeconds",5,o):h<10?a.formatDistance("lessThanXSeconds",10,o):h<20?a.formatDistance("lessThanXSeconds",20,o):h<40?a.formatDistance("halfAMinute",0,o):h<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<$e){const A=Math.round(x/60);return a.formatDistance("aboutXHours",A,o)}else{if(x<s)return a.formatDistance("xDays",1,o);if(x<ne){const A=Math.round(x/$e);return a.formatDistance("xDays",A,o)}else if(x<ne*2)return F=Math.round(x/ne),a.formatDistance("aboutXMonths",F,o)}if(F=Ut(c,u),F<12){const A=Math.round(x/ne);return a.formatDistance("xMonths",A,o)}else{const A=F%12,me=Math.trunc(F/12);return A<3?a.formatDistance("aboutXYears",me,o):A<9?a.formatDistance("overXYears",me,o):a.formatDistance("almostXYears",me+1,o)}}function Br(n,e){return Un(n,Wt(n),e)}function Xr(n,e){const t=()=>P(e?.in,NaN),a=Jn(n);let s;if(a.date){const c=Qn(a.date,2);s=Gn(c.restDateString,c.year)}if(!s||isNaN(+s))return t();const i=+s;let o=0,u;if(a.time&&(o=Kn(a.time),isNaN(o)))return t();if(a.timezone){if(u=er(a.timezone),isNaN(u))return t()}else{const c=new Date(i+o),h=T(0,e?.in);return h.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),h.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),h}return T(i+o+u,e?.in)}const re={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Hn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Bn=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Xn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Jn(n){const e={},t=n.split(re.dateTimeDelimiter);let r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],re.timeZoneDelimiter.test(e.date)&&(e.date=n.split(re.timeZoneDelimiter)[0],r=n.substr(e.date.length,n.length))),r){const a=re.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function Qn(n,e){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=n.match(t);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?a:s*100,restDateString:n.slice((r[1]||r[2]).length)}}function Gn(n,e){if(e===null)return new Date(NaN);const t=n.match(Hn);if(!t)return new Date(NaN);const r=!!t[4],a=J(t[1]),s=J(t[2])-1,i=J(t[3]),o=J(t[4]),u=J(t[5])-1;if(r)return sr(e,o,u)?tr(e,o,u):new Date(NaN);{const c=new Date(0);return!rr(e,s,i)||!ar(e,a)?new Date(NaN):(c.setUTCFullYear(e,s,Math.max(a,i)),c)}}function J(n){return n?parseInt(n):1}function Kn(n){const e=n.match(Bn);if(!e)return NaN;const t=ge(e[1]),r=ge(e[2]),a=ge(e[3]);return ir(t,r,a)?t*Qe+r*Je+a*1e3:NaN}function ge(n){return n&&parseFloat(n.replace(",","."))||0}function er(n){if(n==="Z")return 0;const e=n.match(Xn);if(!e)return 0;const t=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return or(r,a)?t*(r*Qe+a*Je):NaN}function tr(n,e,t){const r=new Date(0);r.setUTCFullYear(n,0,4);const a=r.getUTCDay()||7,s=(e-1)*7+t+1-a;return r.setUTCDate(r.getUTCDate()+s),r}const nr=[31,null,31,30,31,30,31,31,30,31,30,31];function rt(n){return n%400===0||n%4===0&&n%100!==0}function rr(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(nr[e]||(rt(n)?29:28))}function ar(n,e){return e>=1&&e<=(rt(n)?366:365)}function sr(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function ir(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function or(n,e){return e>=0&&e<=59}const cr={lessThanXSeconds:{one:"moins dune seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins dune minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus dun an",other:"plus de {{count}} ans"},almostXYears:{one:"presquun an",other:"presque {{count}} ans"}},ur=(n,e,t)=>{let r;const a=cr[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},dr={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},lr={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},fr={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hr={date:z({formats:dr,defaultWidth:"full"}),time:z({formats:lr,defaultWidth:"full"}),dateTime:z({formats:fr,defaultWidth:"full"})},mr={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourdhui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},pr=(n,e,t,r)=>mr[n],gr={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},yr={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"]},vr={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"]},_r={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"]},br={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 laprès-midi",evening:"du soir",night:"du matin"}},wr=(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},xr=["MMM","MMMM"],kr={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&xr.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:wr,era:S({values:gr,defaultWidth:"wide"}),quarter:S({values:yr,defaultWidth:"wide",argumentCallback:n=>n-1}),month:S({values:vr,defaultWidth:"wide"}),day:S({values:_r,defaultWidth:"wide"}),dayPeriod:S({values:br,defaultWidth:"wide"})},Tr=/^(\d+)(ième|ère|ème|er|e)?/i,Or=/\d+/i,Mr={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},Sr={any:[/^av/i,/^ap/i]},Cr={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Nr={any:[/1/i,/2/i,/3/i,/4/i]},Dr={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},Pr={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]},jr={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},Er={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]},Ar={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},Rr={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}},Ir={ordinalNumber:Ke({matchPattern:Tr,parsePattern:Or,valueCallback:n=>parseInt(n)}),era:C({matchPatterns:Mr,defaultMatchWidth:"wide",parsePatterns:Sr,defaultParseWidth:"any"}),quarter:C({matchPatterns:Cr,defaultMatchWidth:"wide",parsePatterns:Nr,defaultParseWidth:"any",valueCallback:n=>n+1}),month:C({matchPatterns:Dr,defaultMatchWidth:"wide",parsePatterns:Pr,defaultParseWidth:"any"}),day:C({matchPatterns:jr,defaultMatchWidth:"wide",parsePatterns:Er,defaultParseWidth:"any"}),dayPeriod:C({matchPatterns:Ar,defaultMatchWidth:"any",parsePatterns:Rr,defaultParseWidth:"any"})},Jr={code:"fr",formatDistance:ur,formatLong:hr,formatRelative:pr,localize:kr,match:Ir,options:{weekStartsOn:1,firstWeekContainsDate:4}};var Wr=function(n,e){for(var t={};n.length;){var r=n[0],a=r.code,s=r.message,i=r.path.join(".");if(!t[i])if("unionErrors"in r){var 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(h){return h.errors.forEach(function(w){return n.push(w)})}),e){var u=t[i].types,c=u&&u[r.code];t[i]=it(i,e,t,a,c?[].concat(c,r.message):r.message)}n.shift()}return t},Qr=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(c){return s.shouldUseNativeValidation&&at({},s),{errors:{},values:t.raw?r:c}})}catch(c){return o(c)}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:st(Wr(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}};export{E as Z,Br as a,Fr as b,Jr as c,Lr as d,Ur as e,Hr as f,Vr as g,$t as i,Yr as n,zr as o,Xr as p,qr as r,$r as s,Qr as t};