@authhero/cloudflare-adapter 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";const tt=require("wretch"),rt=(r,e)=>e.skipDedupe||e.method!=="GET",nt=(r,e)=>e.method+"@"+r,st=r=>r.clone(),at=({skip:r=rt,key:e=nt,resolver:t=st}={})=>{const n=new Map;return s=>(a,o)=>{if(r(a,o))return s(a,o);const i=e(a,o);if(!n.has(i))n.set(i,[]);else return new Promise((u,d)=>{n.get(i).push([u,d])});try{return s(a,o).then(u=>(n.get(i).forEach(([d])=>d(t(u))),n.delete(i),u)).catch(u=>{throw n.get(i).forEach(([,d])=>d(u)),n.delete(i),u})}catch(u){return n.delete(i),Promise.reject(u)}}},it=(r,e)=>r*e,ot=r=>r&&r.ok,dt=({delayTimer:r=500,delayRamp:e=it,maxAttempts:t=10,until:n=ot,onRetry:s=null,retryOnNetworkError:a=!1,resolveWithLatestResponse:o=!1,skip:i}={})=>u=>(d,h)=>{let k=0;if(i&&i(d,h))return u(d,h);const O=(w,P)=>Promise.resolve(n(w,P)).then(je=>je?w&&o?w:P?Promise.reject(P):w:(k++,!t||k<=t?new Promise($=>{const ge=e(r,k);setTimeout(()=>{typeof s=="function"?Promise.resolve(s({response:w,error:P,url:d,options:h})).then((B={})=>{var F,ee;$(u((F=B&&B.url)!==null&&F!==void 0?F:d,(ee=B&&B.options)!==null&&ee!==void 0?ee:h))}):$(u(d,h))},ge)}).then(O).catch($=>{if(!a)throw $;return O(null,$)}):w&&o?w:Promise.reject(P||new Error("Number of attempts exceeded."))));return u(d,h).then(O).catch(w=>{if(!a)throw w;return O(null,w)})};function ct(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function ut(r,e){var t;return((t=r==null?void 0:r._def)===null||t===void 0?void 0:t.typeName)===e}function te(r,e){const t=r.ZodType.prototype[e];r.ZodType.prototype[e]=function(...n){const s=t.apply(this,n);return s._def.openapi=this._def.openapi,s}}function lt(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(s,a){var o,i,u,d,h,k;const O=typeof s=="string"?a:s,w=O??{},{param:P}=w,je=ct(w,["param"]),$=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof s=="string"?{refId:s}:void 0),ge=Object.assign(Object.assign(Object.assign({},(i=this._def.openapi)===null||i===void 0?void 0:i.metadata),je),!((d=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||d===void 0)&&d.param||P?{param:Object.assign(Object.assign({},(k=(h=this._def.openapi)===null||h===void 0?void 0:h.metadata)===null||k===void 0?void 0:k.param),P)}:void 0),B=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys($).length>0?{_internal:$}:void 0),Object.keys(ge).length>0?{metadata:ge}:void 0)}));if(ut(this,"ZodObject")){const F=this.extend;B.extend=function(...ee){var Ee,Ce,Ne,Re,Ie,Ae;const Me=F.apply(this,ee);return Me._def.openapi={_internal:{extendedFrom:!((Ce=(Ee=this._def.openapi)===null||Ee===void 0?void 0:Ee._internal)===null||Ce===void 0)&&Ce.refId?{refId:(Re=(Ne=this._def.openapi)===null||Ne===void 0?void 0:Ne._internal)===null||Re===void 0?void 0:Re.refId,schema:this}:(Ie=this._def.openapi)===null||Ie===void 0?void 0:Ie._internal.extendedFrom},metadata:(Ae=Me._def.openapi)===null||Ae===void 0?void 0:Ae.metadata},Me}}return B},te(r,"optional"),te(r,"nullable"),te(r,"default"),te(r,"transform"),te(r,"refine");const e=r.ZodObject.prototype.deepPartial;r.ZodObject.prototype.deepPartial=function(){const s=this._def.shape(),a=e.apply(this),o=a._def.shape();return Object.entries(o).forEach(([i,u])=>{var d,h;u._def.openapi=(h=(d=s[i])===null||d===void 0?void 0:d._def)===null||h===void 0?void 0:h.openapi}),a._def.openapi=void 0,a};const t=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...s){const a=t.apply(this,s);return a._def.openapi=void 0,a};const n=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...s){const a=n.apply(this,s);return a._def.openapi=void 0,a}}new Set(".\\+*[^]$()");var x;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),o={};for(const i of a)o[i]=s[i];return r.objectValues(o)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},r.find=(s,a)=>{for(const o of s)if(a(o))return o},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var $e;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})($e||($e={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),V=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(r)?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(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=x.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"]),ft=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class S extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let i=n,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(t(o))):i[d]=i[d]||{_errors:[]},i=i[d],u++}}};return s(this),n}static assert(e){if(!(e instanceof S))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}S.create=r=>new S(r);const K=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.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 r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.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 ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let qe=K;function ht(r){qe=r}function xe(){return qe}const be=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let i="";const u=n.filter(d=>!!d).slice().reverse();for(const d of u)i=d(o,{data:e,defaultError:i}).message;return{...s,path:a,message:i}},pt=[];function l(r,e){const t=xe(),n=be({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===K?void 0:K].filter(s=>!!s)});r.common.issues.push(n)}class T{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,o=await s.value;n.push({key:a,value:o})}return T.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return y;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),H=r=>({status:"dirty",value:r}),Z=r=>({status:"valid",value:r}),Ve=r=>r.status==="aborted",De=r=>r.status==="dirty",se=r=>r.status==="valid",ae=r=>typeof Promise<"u"&&r instanceof Promise;function ke(r,e,t,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Je(r,e,t,n,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var m;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var re,ne;class R{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ue=(r,e)=>{if(se(e))return{success:!0,data:e.value};if(!r.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 S(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,i)=>{var u,d;const{message:h}=r;return o.code==="invalid_enum_value"?{message:h??i.defaultError}:typeof i.data>"u"?{message:(u=h??n)!==null&&u!==void 0?u:i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:(d=h??t)!==null&&d!==void 0?d:i.defaultError}},description:s}}class g{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)}get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:V(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Ue(s,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(ae(s)?s:Promise.resolve(s));return Ue(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const o=e(s),i=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new C({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return N.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this,this._def)}promise(){return Q.create(this,this._def)}or(e){return ce.create([this,e],this._def)}and(e){return ue.create(this,e,this._def)}transform(e){return new C({...v(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new me({...v(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new _e({...v(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ve.create(this,e)}readonly(){return ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mt=/^c[^\s-]{8,}$/i,_t=/^[0-9a-z]+$/,yt=/^[0-9A-HJKMNP-TV-Z]{26}$/,vt=/^[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,gt=/^[a-z0-9_-]{21}$/i,xt=/^[-+]?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)?)??$/,bt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Pe;const wt=/^(?:(?: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])$/,Tt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Zt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ye="((\\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])))",St=new RegExp(`^${Ye}$`);function He(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Ot(r){return new RegExp(`^${He(r)}$`)}function Ge(r){let e=`${Ye}T${He(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function jt(r,e){return!!((e==="v4"||!e)&&wt.test(r)||(e==="v6"||!e)&&Tt.test(r))}class j extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),y}const n=new T;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,i=e.data.length<a.value;(o||i)&&(s=this._getOrReturnCtx(e,s),o?l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")bt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Pe||(Pe=new RegExp(kt,"u")),Pe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")vt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")gt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")mt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")_t.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")yt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ge(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?St.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Ot(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?xt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?jt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Zt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,...m.errToObj(n)})}_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)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...m.errToObj(e==null?void 0: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==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...m.errToObj(e==null?void 0: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==null?void 0:t.position,...m.errToObj(t==null?void 0: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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}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=r=>{var e;return new j({checks:[],typeName:_.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};function Et(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return a%o/Math.pow(10,s)}class D extends g{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 a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),y}let n;const s=new T;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?Et(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new D({...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"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}D.create=r=>new D({checks:[],typeName:_.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class L extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.bigint,received:a.parsedType}),y}let n;const s=new T;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new L({...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}}L.create=r=>{var e;return new L({checks:[],typeName:_.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};class ie extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.boolean,received:n.parsedType}),y}return Z(e.data)}}ie.create=r=>new ie({typeName:_.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class q extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),y}const n=new T;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new q({...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}}q.create=r=>new q({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:_.ZodDate,...v(r)});class we extends g{_parse(e){if(this._getType(e)!==f.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.symbol,received:n.parsedType}),y}return Z(e.data)}}we.create=r=>new we({typeName:_.ZodSymbol,...v(r)});class oe extends g{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.undefined,received:n.parsedType}),y}return Z(e.data)}}oe.create=r=>new oe({typeName:_.ZodUndefined,...v(r)});class de extends g{_parse(e){if(this._getType(e)!==f.null){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.null,received:n.parsedType}),y}return Z(e.data)}}de.create=r=>new de({typeName:_.ZodNull,...v(r)});class X extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}X.create=r=>new X({typeName:_.ZodAny,...v(r)});class W extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}W.create=r=>new W({typeName:_.ZodUnknown,...v(r)});class M extends g{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),y}}M.create=r=>new M({typeName:_.ZodNever,...v(r)});class Te extends g{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.void,received:n.parsedType}),y}return Z(e.data)}}Te.create=r=>new Te({typeName:_.ZodVoid,...v(r)});class E extends g{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return l(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),y;if(s.exactLength!==null){const o=t.data.length>s.exactLength.value,i=t.data.length<s.exactLength.value;(o||i)&&(l(t,{code:o?c.too_big:c.too_small,minimum:i?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,i)=>s.type._parseAsync(new R(t,o,t.path,i)))).then(o=>T.mergeArray(n,o));const a=[...t.data].map((o,i)=>s.type._parseSync(new R(t,o,t.path,i)));return T.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new E({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new E({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new E({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}}E.create=(r,e)=>new E({type:r,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...v(e)});function Y(r){if(r instanceof b){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=N.create(Y(n))}return new b({...r._def,shape:()=>e})}else return r instanceof E?new E({...r._def,type:Y(r.element)}):r instanceof N?N.create(Y(r.unwrap())):r instanceof U?U.create(Y(r.unwrap())):r instanceof I?I.create(r.items.map(e=>Y(e))):r}class b extends g{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=x.objectKeys(e);return this._cached={shape:e,keys:t}}_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}),y}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof M&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||i.push(d);const u=[];for(const d of o){const h=a[d],k=s.data[d];u.push({key:{status:"valid",value:d},value:h._parse(new R(s,k,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof M){const d=this._def.unknownKeys;if(d==="passthrough")for(const h of i)u.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(d==="strict")i.length>0&&(l(s,{code:c.unrecognized_keys,keys:i}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const h of i){const k=s.data[h];u.push({key:{status:"valid",value:h},value:d._parse(new R(s,k,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const h of u){const k=await h.key,O=await h.value;d.push({key:k,value:O,alwaysSet:h.alwaysSet})}return d}).then(d=>T.mergeObjectSync(n,d)):T.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,o,i;const u=(o=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(i=m.errToObj(e).message)!==null&&i!==void 0?i:u}:{message:u}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}extend(e){return new b({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new b({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new b({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new b({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof N;)a=a._def.innerType;t[n]=a}}),new b({...this._def,shape:()=>t})}keyof(){return Ke(x.objectKeys(this.shape))}}b.create=(r,e)=>new b({shape:()=>r,unknownKeys:"strip",catchall:M.create(),typeName:_.ZodObject,...v(e)});b.strictCreate=(r,e)=>new b({shape:()=>r,unknownKeys:"strict",catchall:M.create(),typeName:_.ZodObject,...v(e)});b.lazycreate=(r,e)=>new b({shape:r,unknownKeys:"strip",catchall:M.create(),typeName:_.ZodObject,...v(e)});class ce extends g{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const i of a)if(i.result.status==="valid")return i.result;for(const i of a)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;const o=a.map(i=>new S(i.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:o}),y}if(t.common.async)return Promise.all(n.map(async a=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const u of n){const d={...t,common:{...t.common,issues:[]},parent:null},h=u._parseSync({data:t.data,path:t.path,parent:d});if(h.status==="valid")return h;h.status==="dirty"&&!a&&(a={result:h,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(u=>new S(u));return l(t,{code:c.invalid_union,unionErrors:i}),y}}get options(){return this._def.options}}ce.create=(r,e)=>new ce({options:r,typeName:_.ZodUnion,...v(e)});const A=r=>r instanceof fe?A(r.schema):r instanceof C?A(r.innerType()):r instanceof he?[r.value]:r instanceof z?r.options:r instanceof pe?x.objectValues(r.enum):r instanceof me?A(r._def.innerType):r instanceof oe?[void 0]:r instanceof de?[null]:r instanceof N?[void 0,...A(r.unwrap())]:r instanceof U?[null,...A(r.unwrap())]:r instanceof ze||r instanceof ye?A(r.unwrap()):r instanceof _e?A(r._def.innerType):[];class Oe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),y;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const o=A(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of o){if(s.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,a)}}return new Oe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(n)})}}function Le(r,e){const t=V(r),n=V(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&n===f.object){const s=x.objectKeys(e),a=x.objectKeys(r).filter(i=>s.indexOf(i)!==-1),o={...r,...e};for(const i of a){const u=Le(r[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}else if(t===f.array&&n===f.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const o=r[a],i=e[a],u=Le(o,i);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===f.date&&n===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ue extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,o)=>{if(Ve(a)||Ve(o))return y;const i=Le(a.value,o.value);return i.valid?((De(a)||De(o))&&t.dirty(),{status:t.value,value:i.data}):(l(n,{code:c.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ue.create=(r,e,t)=>new ue({left:r,right:e,typeName:_.ZodIntersection,...v(t)});class I extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return l(n,{code:c.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return l(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((o,i)=>{const u=this._def.items[i]||this._def.rest;return u?u._parse(new R(n,o,n.path,i)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>T.mergeArray(t,o)):T.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new I({...this._def,rest:e})}}I.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:r,typeName:_.ZodTuple,rest:null,...v(e)})};class le extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return l(n,{code:c.invalid_type,expected:f.object,received:n.parsedType}),y;const s=[],a=this._def.keyType,o=this._def.valueType;for(const i in n.data)s.push({key:a._parse(new R(n,i,n.path,i)),value:o._parse(new R(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?T.mergeObjectAsync(t,s):T.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof g?new le({keyType:e,valueType:t,typeName:_.ZodRecord,...v(n)}):new le({keyType:j.create(),valueType:e,typeName:_.ZodRecord,...v(t)})}}class Ze extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return l(n,{code:c.invalid_type,expected:f.map,received:n.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([i,u],d)=>({key:s._parse(new R(n,i,n.path,[d,"key"])),value:a._parse(new R(n,u,n.path,[d,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,h=await u.value;if(d.status==="aborted"||h.status==="aborted")return y;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(d.value,h.value)}return{status:t.value,value:i}})}else{const i=new Map;for(const u of o){const d=u.key,h=u.value;if(d.status==="aborted"||h.status==="aborted")return y;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(d.value,h.value)}return{status:t.value,value:i}}}}Ze.create=(r,e,t)=>new Ze({valueType:e,keyType:r,typeName:_.ZodMap,...v(t)});class J extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return l(n,{code:c.invalid_type,expected:f.set,received:n.parsedType}),y;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function o(u){const d=new Set;for(const h of u){if(h.status==="aborted")return y;h.status==="dirty"&&t.dirty(),d.add(h.value)}return{status:t.value,value:d}}const i=[...n.data.values()].map((u,d)=>a._parse(new R(n,u,n.path,d)));return n.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new J({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new J({...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)}}J.create=(r,e)=>new J({valueType:r,minSize:null,maxSize:null,typeName:_.ZodSet,...v(e)});class G extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return l(t,{code:c.invalid_type,expected:f.function,received:t.parsedType}),y;function n(i,u){return be({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xe(),K].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:u}})}function s(i,u){return be({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xe(),K].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:u}})}const a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Q){const i=this;return Z(async function(...u){const d=new S([]),h=await i._def.args.parseAsync(u,a).catch(w=>{throw d.addIssue(n(u,w)),d}),k=await Reflect.apply(o,this,h);return await i._def.returns._def.type.parseAsync(k,a).catch(w=>{throw d.addIssue(s(k,w)),d})})}else{const i=this;return Z(function(...u){const d=i._def.args.safeParse(u,a);if(!d.success)throw new S([n(u,d.error)]);const h=Reflect.apply(o,this,d.data),k=i._def.returns.safeParse(h,a);if(!k.success)throw new S([s(h,k.error)]);return k.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new G({...this._def,args:I.create(e).rest(W.create())})}returns(e){return new G({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new G({args:e||I.create([]).rest(W.create()),returns:t||W.create(),typeName:_.ZodFunction,...v(n)})}}class fe extends g{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})}}fe.create=(r,e)=>new fe({getter:r,typeName:_.ZodLazy,...v(e)});class he extends g{_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}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}he.create=(r,e)=>new he({value:r,typeName:_.ZodLiteral,...v(e)});function Ke(r,e){return new z({values:r,typeName:_.ZodEnum,...v(e)})}class z extends g{constructor(){super(...arguments),re.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:x.joinValues(n),received:t.parsedType,code:c.invalid_type}),y}if(ke(this,re)||Je(this,re,new Set(this._def.values)),!ke(this,re).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:n}),y}return Z(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 z.create(e,{...this._def,...t})}exclude(e,t=this._def){return z.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}re=new WeakMap;z.create=Ke;class pe extends g{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const s=x.objectValues(t);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:c.invalid_type}),y}if(ke(this,ne)||Je(this,ne,new Set(x.getValidEnumValues(this._def.values))),!ke(this,ne).has(e.data)){const s=x.objectValues(t);return l(n,{received:n.data,code:c.invalid_enum_value,options:s}),y}return Z(e.data)}get enum(){return this._def.values}}ne=new WeakMap;pe.create=(r,e)=>new pe({values:r,typeName:_.ZodNativeEnum,...v(e)});class Q extends g{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}),y;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return Z(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Q.create=(r,e)=>new Q({type:r,typeName:_.ZodPromise,...v(e)});class C extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:o=>{l(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?H(u.value):u});{if(t.value==="aborted")return y;const i=this._def.schema._parseSync({data:o,path:n.path,parent:n});return i.status==="aborted"?y:i.status==="dirty"||t.value==="dirty"?H(i.value):i}}if(s.type==="refinement"){const o=i=>{const u=s.refinement(i,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?y:(i.status==="dirty"&&t.dirty(),o(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?y:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!se(o))return o;const i=s.transform(o.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>se(o)?Promise.resolve(s.transform(o.value,a)).then(i=>({status:t.value,value:i})):o);x.assertNever(s)}}C.create=(r,e,t)=>new C({schema:r,typeName:_.ZodEffects,effect:e,...v(t)});C.createWithPreprocess=(r,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:r},typeName:_.ZodEffects,...v(t)});class N extends g{_parse(e){return this._getType(e)===f.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}N.create=(r,e)=>new N({innerType:r,typeName:_.ZodOptional,...v(e)});class U extends g{_parse(e){return this._getType(e)===f.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}U.create=(r,e)=>new U({innerType:r,typeName:_.ZodNullable,...v(e)});class me extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}me.create=(r,e)=>new me({innerType:r,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class _e extends g{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ae(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new S(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new S(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}_e.create=(r,e)=>new _e({innerType:r,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class Se extends g{_parse(e){if(this._getType(e)!==f.nan){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:e.data}}}Se.create=r=>new Se({typeName:_.ZodNaN,...v(r)});const Ct=Symbol("zod_brand");class ze extends g{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ve extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),H(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new ve({in:e,out:t,typeName:_.ZodPipeline})}}class ye extends g{_parse(e){const t=this._def.innerType._parse(e),n=s=>(se(s)&&(s.value=Object.freeze(s.value)),s);return ae(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}ye.create=(r,e)=>new ye({innerType:r,typeName:_.ZodReadonly,...v(e)});function Xe(r,e={},t){return r?X.create().superRefine((n,s)=>{var a,o;if(!r(n)){const i=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(a=i.fatal)!==null&&a!==void 0?a:t)!==null&&o!==void 0?o:!0,d=typeof i=="string"?{message:i}:i;s.addIssue({code:"custom",...d,fatal:u})}}):X.create()}const Nt={object:b.lazycreate};var _;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(_||(_={}));const Rt=(r,e={message:`Input not instance of ${r.name}`})=>Xe(t=>t instanceof r,e),Qe=j.create,Fe=D.create,It=Se.create,At=L.create,et=ie.create,Mt=q.create,Pt=we.create,$t=oe.create,Vt=de.create,Dt=X.create,Lt=W.create,zt=M.create,Ut=Te.create,Bt=E.create,Wt=b.create,qt=b.strictCreate,Jt=ce.create,Yt=Oe.create,Ht=ue.create,Gt=I.create,Kt=le.create,Xt=Ze.create,Qt=J.create,Ft=G.create,er=fe.create,tr=he.create,rr=z.create,nr=pe.create,sr=Q.create,Be=C.create,ar=N.create,ir=U.create,or=C.createWithPreprocess,dr=ve.create,cr=()=>Qe().optional(),ur=()=>Fe().optional(),lr=()=>et().optional(),fr={string:r=>j.create({...r,coerce:!0}),number:r=>D.create({...r,coerce:!0}),boolean:r=>ie.create({...r,coerce:!0}),bigint:r=>L.create({...r,coerce:!0}),date:r=>q.create({...r,coerce:!0})},hr=y;var p=Object.freeze({__proto__:null,defaultErrorMap:K,setErrorMap:ht,getErrorMap:xe,makeIssue:be,EMPTY_PATH:pt,addIssueToContext:l,ParseStatus:T,INVALID:y,DIRTY:H,OK:Z,isAborted:Ve,isDirty:De,isValid:se,isAsync:ae,get util(){return x},get objectUtil(){return $e},ZodParsedType:f,getParsedType:V,ZodType:g,datetimeRegex:Ge,ZodString:j,ZodNumber:D,ZodBigInt:L,ZodBoolean:ie,ZodDate:q,ZodSymbol:we,ZodUndefined:oe,ZodNull:de,ZodAny:X,ZodUnknown:W,ZodNever:M,ZodVoid:Te,ZodArray:E,ZodObject:b,ZodUnion:ce,ZodDiscriminatedUnion:Oe,ZodIntersection:ue,ZodTuple:I,ZodRecord:le,ZodMap:Ze,ZodSet:J,ZodFunction:G,ZodLazy:fe,ZodLiteral:he,ZodEnum:z,ZodNativeEnum:pe,ZodPromise:Q,ZodEffects:C,ZodTransformer:C,ZodOptional:N,ZodNullable:U,ZodDefault:me,ZodCatch:_e,ZodNaN:Se,BRAND:Ct,ZodBranded:ze,ZodPipeline:ve,ZodReadonly:ye,custom:Xe,Schema:g,ZodSchema:g,late:Nt,get ZodFirstPartyTypeKind(){return _},coerce:fr,any:Dt,array:Bt,bigint:At,boolean:et,date:Mt,discriminatedUnion:Yt,effect:Be,enum:rr,function:Ft,instanceof:Rt,intersection:Ht,lazy:er,literal:tr,map:Xt,nan:It,nativeEnum:nr,never:zt,null:Vt,nullable:ir,number:Fe,object:Wt,oboolean:lr,onumber:ur,optional:ar,ostring:cr,pipeline:dr,preprocess:or,promise:sr,record:Kt,set:Qt,strictObject:qt,string:Qe,symbol:Pt,transformer:Be,tuple:Gt,undefined:$t,union:Jt,unknown:Lt,void:Ut,NEVER:hr,ZodIssueCode:c,quotelessJson:ft,ZodError:S});lt(p);const We=p.object({code:p.number(),message:p.string()}),pr=p.object({message:p.string()}),mr=p.object({emails:p.array(p.string()),http_body:p.string(),http_url:p.string(),txt_name:p.string(),txt_value:p.string()}),_r=p.object({ciphers:p.array(p.string()),early_hints:p.string(),http2:p.string(),min_tls_version:p.string(),tls_1_3:p.string()}),yr=p.object({id:p.string(),bundle_method:p.string(),certificate_authority:p.string(),custom_certificate:p.string(),custom_csr_id:p.string(),custom_key:p.string(),expires_on:p.string(),hosts:p.array(p.string()),issuer:p.string(),method:p.string(),serial_number:p.string(),settings:_r,signature:p.string(),type:p.string(),uploaded_on:p.string(),validation_errors:p.array(pr),validation_records:p.array(mr),wildcard:p.boolean()}),vr=p.object({name:p.string(),type:p.string(),value:p.string()}),gr=p.object({http_body:p.string(),http_url:p.string()}),xr=p.object({id:p.string(),ssl:yr,custom_metadata:p.record(p.string()),custom_origin_server:p.string(),custom_origin_sni:p.string(),ownership_verification:vr,ownership_verification_http:gr,status:p.string(),verification_errors:p.array(p.string())}),br=p.object({errors:p.array(We),messages:p.array(We),success:p.boolean(),result:xr});function kr(r){return tt(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({Authorization:`Bearer ${r.apiKey}`,"Content-Type":"application/json"}).middlewares([dt(),at()])}function wr(r){return{create:async(e,t)=>{const{result:n,errors:s,success:a}=br.parse(await kr(r).post({hostname:t.domain,ssl:{method:"http",type:"dv"}},"/custom_hostnames").json());if(!a)throw new Error(JSON.stringify(s));return{custom_domain_id:n.id,tenant_id:e,domain:n.ssl.hosts[0],primary:!1,status:n.status==="active"?"ready":"pending",type:"auth0_managed_certs"}},get:async(e,t)=>{throw console.log("get",e,t),new Error("Not implemented")},list:async e=>{throw console.log("list",e),new Error("Not implemented")},remove:async(e,t)=>{throw console.log("remove",e,t),new Error("Not implemented")},update:async(e,t)=>{throw console.log("update",e,t),new Error("Not implemented")}}}function Tr(r){return{customDomains:wr(r)}}module.exports=Tr;
1
+ "use strict";const tt=require("wretch"),rt=(r,e)=>e.skipDedupe||e.method!=="GET",nt=(r,e)=>e.method+"@"+r,st=r=>r.clone(),at=({skip:r=rt,key:e=nt,resolver:t=st}={})=>{const n=new Map;return s=>(a,o)=>{if(r(a,o))return s(a,o);const i=e(a,o);if(!n.has(i))n.set(i,[]);else return new Promise((u,d)=>{n.get(i).push([u,d])});try{return s(a,o).then(u=>(n.get(i).forEach(([d])=>d(t(u))),n.delete(i),u)).catch(u=>{throw n.get(i).forEach(([,d])=>d(u)),n.delete(i),u})}catch(u){return n.delete(i),Promise.reject(u)}}},it=(r,e)=>r*e,ot=r=>r&&r.ok,dt=({delayTimer:r=500,delayRamp:e=it,maxAttempts:t=10,until:n=ot,onRetry:s=null,retryOnNetworkError:a=!1,resolveWithLatestResponse:o=!1,skip:i}={})=>u=>(d,h)=>{let k=0;if(i&&i(d,h))return u(d,h);const O=(w,P)=>Promise.resolve(n(w,P)).then(Ee=>Ee?w&&o?w:P?Promise.reject(P):w:(k++,!t||k<=t?new Promise($=>{const ge=e(r,k);setTimeout(()=>{typeof s=="function"?Promise.resolve(s({response:w,error:P,url:d,options:h})).then((B={})=>{var F,ee;$(u((F=B&&B.url)!==null&&F!==void 0?F:d,(ee=B&&B.options)!==null&&ee!==void 0?ee:h))}):$(u(d,h))},ge)}).then(O).catch($=>{if(!a)throw $;return O(null,$)}):w&&o?w:Promise.reject(P||new Error("Number of attempts exceeded."))));return u(d,h).then(O).catch(w=>{if(!a)throw w;return O(null,w)})};function ct(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function ut(r,e){var t;return((t=r==null?void 0:r._def)===null||t===void 0?void 0:t.typeName)===e}function te(r,e){const t=r.ZodType.prototype[e];r.ZodType.prototype[e]=function(...n){const s=t.apply(this,n);return s._def.openapi=this._def.openapi,s}}function lt(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(s,a){var o,i,u,d,h,k;const O=typeof s=="string"?a:s,w=O??{},{param:P}=w,Ee=ct(w,["param"]),$=Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o._internal),typeof s=="string"?{refId:s}:void 0),ge=Object.assign(Object.assign(Object.assign({},(i=this._def.openapi)===null||i===void 0?void 0:i.metadata),Ee),!((d=(u=this._def.openapi)===null||u===void 0?void 0:u.metadata)===null||d===void 0)&&d.param||P?{param:Object.assign(Object.assign({},(k=(h=this._def.openapi)===null||h===void 0?void 0:h.metadata)===null||k===void 0?void 0:k.param),P)}:void 0),B=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys($).length>0?{_internal:$}:void 0),Object.keys(ge).length>0?{metadata:ge}:void 0)}));if(ut(this,"ZodObject")){const F=this.extend;B.extend=function(...ee){var je,Ce,Ne,Re,Ie,Ae;const Me=F.apply(this,ee);return Me._def.openapi={_internal:{extendedFrom:!((Ce=(je=this._def.openapi)===null||je===void 0?void 0:je._internal)===null||Ce===void 0)&&Ce.refId?{refId:(Re=(Ne=this._def.openapi)===null||Ne===void 0?void 0:Ne._internal)===null||Re===void 0?void 0:Re.refId,schema:this}:(Ie=this._def.openapi)===null||Ie===void 0?void 0:Ie._internal.extendedFrom},metadata:(Ae=Me._def.openapi)===null||Ae===void 0?void 0:Ae.metadata},Me}}return B},te(r,"optional"),te(r,"nullable"),te(r,"default"),te(r,"transform"),te(r,"refine");const e=r.ZodObject.prototype.deepPartial;r.ZodObject.prototype.deepPartial=function(){const s=this._def.shape(),a=e.apply(this),o=a._def.shape();return Object.entries(o).forEach(([i,u])=>{var d,h;u._def.openapi=(h=(d=s[i])===null||d===void 0?void 0:d._def)===null||h===void 0?void 0:h.openapi}),a._def.openapi=void 0,a};const t=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...s){const a=t.apply(this,s);return a._def.openapi=void 0,a};const n=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...s){const a=n.apply(this,s);return a._def.openapi=void 0,a}}new Set(".\\+*[^]$()");var x;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),o={};for(const i of a)o[i]=s[i];return r.objectValues(o)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},r.find=(s,a)=>{for(const o of s)if(a(o))return o},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var $e;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})($e||($e={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),V=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(r)?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(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=x.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"]),ft=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class S extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let i=n,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(t(o))):i[d]=i[d]||{_errors:[]},i=i[d],u++}}};return s(this),n}static assert(e){if(!(e instanceof S))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}S.create=r=>new S(r);const X=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.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 r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.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 ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let qe=X;function ht(r){qe=r}function xe(){return qe}const be=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let i="";const u=n.filter(d=>!!d).slice().reverse();for(const d of u)i=d(o,{data:e,defaultError:i}).message;return{...s,path:a,message:i}},pt=[];function l(r,e){const t=xe(),n=be({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===X?void 0:X].filter(s=>!!s)});r.common.issues.push(n)}class T{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,o=await s.value;n.push({key:a,value:o})}return T.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return y;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),H=r=>({status:"dirty",value:r}),Z=r=>({status:"valid",value:r}),Ve=r=>r.status==="aborted",De=r=>r.status==="dirty",se=r=>r.status==="valid",ae=r=>typeof Promise<"u"&&r instanceof Promise;function ke(r,e,t,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Je(r,e,t,n,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var m;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var re,ne;class R{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ze=(r,e)=>{if(se(e))return{success:!0,data:e.value};if(!r.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 S(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,i)=>{var u,d;const{message:h}=r;return o.code==="invalid_enum_value"?{message:h??i.defaultError}:typeof i.data>"u"?{message:(u=h??n)!==null&&u!==void 0?u:i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:(d=h??t)!==null&&d!==void 0?d:i.defaultError}},description:s}}class g{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)}get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:V(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},a=this._parseSync({data:e,path:s.path,parent:s});return ze(s,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(ae(s)?s:Promise.resolve(s));return ze(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const o=e(s),i=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new C({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return N.create(this,this._def)}nullable(){return z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return j.create(this,this._def)}promise(){return Q.create(this,this._def)}or(e){return ce.create([this,e],this._def)}and(e){return ue.create(this,e,this._def)}transform(e){return new C({...v(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new me({...v(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Ue({typeName:_.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new _e({...v(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ve.create(this,e)}readonly(){return ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mt=/^c[^\s-]{8,}$/i,_t=/^[0-9a-z]+$/,yt=/^[0-9A-HJKMNP-TV-Z]{26}$/,vt=/^[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,gt=/^[a-z0-9_-]{21}$/i,xt=/^[-+]?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)?)??$/,bt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Pe;const wt=/^(?:(?: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])$/,Tt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Zt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ye="((\\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])))",St=new RegExp(`^${Ye}$`);function He(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Ot(r){return new RegExp(`^${He(r)}$`)}function Ge(r){let e=`${Ye}T${He(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Et(r,e){return!!((e==="v4"||!e)&&wt.test(r)||(e==="v6"||!e)&&Tt.test(r))}class E extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),y}const n=new T;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,i=e.data.length<a.value;(o||i)&&(s=this._getOrReturnCtx(e,s),o?l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")bt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Pe||(Pe=new RegExp(kt,"u")),Pe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")vt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")gt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")mt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")_t.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")yt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ge(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?St.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Ot(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?xt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Et(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Zt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,...m.errToObj(n)})}_addCheck(e){return new E({...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)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...m.errToObj(e==null?void 0: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==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...m.errToObj(e==null?void 0: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==null?void 0:t.position,...m.errToObj(t==null?void 0: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 E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}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}}E.create=r=>{var e;return new E({checks:[],typeName:_.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};function jt(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),o=parseInt(e.toFixed(s).replace(".",""));return a%o/Math.pow(10,s)}class D extends g{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 a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),y}let n;const s=new T;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?jt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new D({...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"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}D.create=r=>new D({checks:[],typeName:_.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class L extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.bigint,received:a.parsedType}),y}let n;const s=new T;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.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,n,s){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new L({...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}}L.create=r=>{var e;return new L({checks:[],typeName:_.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};class ie extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.boolean,received:n.parsedType}),y}return Z(e.data)}}ie.create=r=>new ie({typeName:_.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class q extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),y}const n=new T;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new q({...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}}q.create=r=>new q({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:_.ZodDate,...v(r)});class we extends g{_parse(e){if(this._getType(e)!==f.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.symbol,received:n.parsedType}),y}return Z(e.data)}}we.create=r=>new we({typeName:_.ZodSymbol,...v(r)});class oe extends g{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.undefined,received:n.parsedType}),y}return Z(e.data)}}oe.create=r=>new oe({typeName:_.ZodUndefined,...v(r)});class de extends g{_parse(e){if(this._getType(e)!==f.null){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.null,received:n.parsedType}),y}return Z(e.data)}}de.create=r=>new de({typeName:_.ZodNull,...v(r)});class K extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}K.create=r=>new K({typeName:_.ZodAny,...v(r)});class W extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}W.create=r=>new W({typeName:_.ZodUnknown,...v(r)});class M extends g{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),y}}M.create=r=>new M({typeName:_.ZodNever,...v(r)});class Te extends g{_parse(e){if(this._getType(e)!==f.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.void,received:n.parsedType}),y}return Z(e.data)}}Te.create=r=>new Te({typeName:_.ZodVoid,...v(r)});class j extends g{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return l(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),y;if(s.exactLength!==null){const o=t.data.length>s.exactLength.value,i=t.data.length<s.exactLength.value;(o||i)&&(l(t,{code:o?c.too_big:c.too_small,minimum:i?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,i)=>s.type._parseAsync(new R(t,o,t.path,i)))).then(o=>T.mergeArray(n,o));const a=[...t.data].map((o,i)=>s.type._parseSync(new R(t,o,t.path,i)));return T.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new j({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new j({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new j({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}}j.create=(r,e)=>new j({type:r,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...v(e)});function Y(r){if(r instanceof b){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=N.create(Y(n))}return new b({...r._def,shape:()=>e})}else return r instanceof j?new j({...r._def,type:Y(r.element)}):r instanceof N?N.create(Y(r.unwrap())):r instanceof z?z.create(Y(r.unwrap())):r instanceof I?I.create(r.items.map(e=>Y(e))):r}class b extends g{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=x.objectKeys(e);return this._cached={shape:e,keys:t}}_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}),y}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof M&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||i.push(d);const u=[];for(const d of o){const h=a[d],k=s.data[d];u.push({key:{status:"valid",value:d},value:h._parse(new R(s,k,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof M){const d=this._def.unknownKeys;if(d==="passthrough")for(const h of i)u.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(d==="strict")i.length>0&&(l(s,{code:c.unrecognized_keys,keys:i}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const h of i){const k=s.data[h];u.push({key:{status:"valid",value:h},value:d._parse(new R(s,k,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const h of u){const k=await h.key,O=await h.value;d.push({key:k,value:O,alwaysSet:h.alwaysSet})}return d}).then(d=>T.mergeObjectSync(n,d)):T.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,o,i;const u=(o=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(i=m.errToObj(e).message)!==null&&i!==void 0?i:u}:{message:u}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}extend(e){return new b({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new b({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new b({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new b({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof N;)a=a._def.innerType;t[n]=a}}),new b({...this._def,shape:()=>t})}keyof(){return Xe(x.objectKeys(this.shape))}}b.create=(r,e)=>new b({shape:()=>r,unknownKeys:"strip",catchall:M.create(),typeName:_.ZodObject,...v(e)});b.strictCreate=(r,e)=>new b({shape:()=>r,unknownKeys:"strict",catchall:M.create(),typeName:_.ZodObject,...v(e)});b.lazycreate=(r,e)=>new b({shape:r,unknownKeys:"strip",catchall:M.create(),typeName:_.ZodObject,...v(e)});class ce extends g{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const i of a)if(i.result.status==="valid")return i.result;for(const i of a)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;const o=a.map(i=>new S(i.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:o}),y}if(t.common.async)return Promise.all(n.map(async a=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const u of n){const d={...t,common:{...t.common,issues:[]},parent:null},h=u._parseSync({data:t.data,path:t.path,parent:d});if(h.status==="valid")return h;h.status==="dirty"&&!a&&(a={result:h,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(u=>new S(u));return l(t,{code:c.invalid_union,unionErrors:i}),y}}get options(){return this._def.options}}ce.create=(r,e)=>new ce({options:r,typeName:_.ZodUnion,...v(e)});const A=r=>r instanceof fe?A(r.schema):r instanceof C?A(r.innerType()):r instanceof he?[r.value]:r instanceof U?r.options:r instanceof pe?x.objectValues(r.enum):r instanceof me?A(r._def.innerType):r instanceof oe?[void 0]:r instanceof de?[null]:r instanceof N?[void 0,...A(r.unwrap())]:r instanceof z?[null,...A(r.unwrap())]:r instanceof Ue||r instanceof ye?A(r.unwrap()):r instanceof _e?A(r._def.innerType):[];class Oe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),y;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const o=A(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of o){if(s.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,a)}}return new Oe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(n)})}}function Le(r,e){const t=V(r),n=V(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&n===f.object){const s=x.objectKeys(e),a=x.objectKeys(r).filter(i=>s.indexOf(i)!==-1),o={...r,...e};for(const i of a){const u=Le(r[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}else if(t===f.array&&n===f.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const o=r[a],i=e[a],u=Le(o,i);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===f.date&&n===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ue extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,o)=>{if(Ve(a)||Ve(o))return y;const i=Le(a.value,o.value);return i.valid?((De(a)||De(o))&&t.dirty(),{status:t.value,value:i.data}):(l(n,{code:c.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ue.create=(r,e,t)=>new ue({left:r,right:e,typeName:_.ZodIntersection,...v(t)});class I extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return l(n,{code:c.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return l(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((o,i)=>{const u=this._def.items[i]||this._def.rest;return u?u._parse(new R(n,o,n.path,i)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>T.mergeArray(t,o)):T.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new I({...this._def,rest:e})}}I.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:r,typeName:_.ZodTuple,rest:null,...v(e)})};class le extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return l(n,{code:c.invalid_type,expected:f.object,received:n.parsedType}),y;const s=[],a=this._def.keyType,o=this._def.valueType;for(const i in n.data)s.push({key:a._parse(new R(n,i,n.path,i)),value:o._parse(new R(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?T.mergeObjectAsync(t,s):T.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof g?new le({keyType:e,valueType:t,typeName:_.ZodRecord,...v(n)}):new le({keyType:E.create(),valueType:e,typeName:_.ZodRecord,...v(t)})}}class Ze extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return l(n,{code:c.invalid_type,expected:f.map,received:n.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([i,u],d)=>({key:s._parse(new R(n,i,n.path,[d,"key"])),value:a._parse(new R(n,u,n.path,[d,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,h=await u.value;if(d.status==="aborted"||h.status==="aborted")return y;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(d.value,h.value)}return{status:t.value,value:i}})}else{const i=new Map;for(const u of o){const d=u.key,h=u.value;if(d.status==="aborted"||h.status==="aborted")return y;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(d.value,h.value)}return{status:t.value,value:i}}}}Ze.create=(r,e,t)=>new Ze({valueType:e,keyType:r,typeName:_.ZodMap,...v(t)});class J extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return l(n,{code:c.invalid_type,expected:f.set,received:n.parsedType}),y;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function o(u){const d=new Set;for(const h of u){if(h.status==="aborted")return y;h.status==="dirty"&&t.dirty(),d.add(h.value)}return{status:t.value,value:d}}const i=[...n.data.values()].map((u,d)=>a._parse(new R(n,u,n.path,d)));return n.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new J({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new J({...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)}}J.create=(r,e)=>new J({valueType:r,minSize:null,maxSize:null,typeName:_.ZodSet,...v(e)});class G extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return l(t,{code:c.invalid_type,expected:f.function,received:t.parsedType}),y;function n(i,u){return be({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xe(),X].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:u}})}function s(i,u){return be({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xe(),X].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:u}})}const a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Q){const i=this;return Z(async function(...u){const d=new S([]),h=await i._def.args.parseAsync(u,a).catch(w=>{throw d.addIssue(n(u,w)),d}),k=await Reflect.apply(o,this,h);return await i._def.returns._def.type.parseAsync(k,a).catch(w=>{throw d.addIssue(s(k,w)),d})})}else{const i=this;return Z(function(...u){const d=i._def.args.safeParse(u,a);if(!d.success)throw new S([n(u,d.error)]);const h=Reflect.apply(o,this,d.data),k=i._def.returns.safeParse(h,a);if(!k.success)throw new S([s(h,k.error)]);return k.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new G({...this._def,args:I.create(e).rest(W.create())})}returns(e){return new G({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new G({args:e||I.create([]).rest(W.create()),returns:t||W.create(),typeName:_.ZodFunction,...v(n)})}}class fe extends g{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})}}fe.create=(r,e)=>new fe({getter:r,typeName:_.ZodLazy,...v(e)});class he extends g{_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}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}he.create=(r,e)=>new he({value:r,typeName:_.ZodLiteral,...v(e)});function Xe(r,e){return new U({values:r,typeName:_.ZodEnum,...v(e)})}class U extends g{constructor(){super(...arguments),re.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:x.joinValues(n),received:t.parsedType,code:c.invalid_type}),y}if(ke(this,re)||Je(this,re,new Set(this._def.values)),!ke(this,re).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:n}),y}return Z(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 U.create(e,{...this._def,...t})}exclude(e,t=this._def){return U.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}re=new WeakMap;U.create=Xe;class pe extends g{constructor(){super(...arguments),ne.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const s=x.objectValues(t);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:c.invalid_type}),y}if(ke(this,ne)||Je(this,ne,new Set(x.getValidEnumValues(this._def.values))),!ke(this,ne).has(e.data)){const s=x.objectValues(t);return l(n,{received:n.data,code:c.invalid_enum_value,options:s}),y}return Z(e.data)}get enum(){return this._def.values}}ne=new WeakMap;pe.create=(r,e)=>new pe({values:r,typeName:_.ZodNativeEnum,...v(e)});class Q extends g{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}),y;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return Z(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Q.create=(r,e)=>new Q({type:r,typeName:_.ZodPromise,...v(e)});class C extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:o=>{l(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?H(u.value):u});{if(t.value==="aborted")return y;const i=this._def.schema._parseSync({data:o,path:n.path,parent:n});return i.status==="aborted"?y:i.status==="dirty"||t.value==="dirty"?H(i.value):i}}if(s.type==="refinement"){const o=i=>{const u=s.refinement(i,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?y:(i.status==="dirty"&&t.dirty(),o(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?y:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!se(o))return o;const i=s.transform(o.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>se(o)?Promise.resolve(s.transform(o.value,a)).then(i=>({status:t.value,value:i})):o);x.assertNever(s)}}C.create=(r,e,t)=>new C({schema:r,typeName:_.ZodEffects,effect:e,...v(t)});C.createWithPreprocess=(r,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:r},typeName:_.ZodEffects,...v(t)});class N extends g{_parse(e){return this._getType(e)===f.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}N.create=(r,e)=>new N({innerType:r,typeName:_.ZodOptional,...v(e)});class z extends g{_parse(e){return this._getType(e)===f.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}z.create=(r,e)=>new z({innerType:r,typeName:_.ZodNullable,...v(e)});class me extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}me.create=(r,e)=>new me({innerType:r,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class _e extends g{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ae(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new S(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new S(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}_e.create=(r,e)=>new _e({innerType:r,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class Se extends g{_parse(e){if(this._getType(e)!==f.nan){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:e.data}}}Se.create=r=>new Se({typeName:_.ZodNaN,...v(r)});const Ct=Symbol("zod_brand");class Ue extends g{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ve extends g{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),H(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new ve({in:e,out:t,typeName:_.ZodPipeline})}}class ye extends g{_parse(e){const t=this._def.innerType._parse(e),n=s=>(se(s)&&(s.value=Object.freeze(s.value)),s);return ae(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}ye.create=(r,e)=>new ye({innerType:r,typeName:_.ZodReadonly,...v(e)});function Ke(r,e={},t){return r?K.create().superRefine((n,s)=>{var a,o;if(!r(n)){const i=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(a=i.fatal)!==null&&a!==void 0?a:t)!==null&&o!==void 0?o:!0,d=typeof i=="string"?{message:i}:i;s.addIssue({code:"custom",...d,fatal:u})}}):K.create()}const Nt={object:b.lazycreate};var _;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(_||(_={}));const Rt=(r,e={message:`Input not instance of ${r.name}`})=>Ke(t=>t instanceof r,e),Qe=E.create,Fe=D.create,It=Se.create,At=L.create,et=ie.create,Mt=q.create,Pt=we.create,$t=oe.create,Vt=de.create,Dt=K.create,Lt=W.create,Ut=M.create,zt=Te.create,Bt=j.create,Wt=b.create,qt=b.strictCreate,Jt=ce.create,Yt=Oe.create,Ht=ue.create,Gt=I.create,Xt=le.create,Kt=Ze.create,Qt=J.create,Ft=G.create,er=fe.create,tr=he.create,rr=U.create,nr=pe.create,sr=Q.create,Be=C.create,ar=N.create,ir=z.create,or=C.createWithPreprocess,dr=ve.create,cr=()=>Qe().optional(),ur=()=>Fe().optional(),lr=()=>et().optional(),fr={string:r=>E.create({...r,coerce:!0}),number:r=>D.create({...r,coerce:!0}),boolean:r=>ie.create({...r,coerce:!0}),bigint:r=>L.create({...r,coerce:!0}),date:r=>q.create({...r,coerce:!0})},hr=y;var p=Object.freeze({__proto__:null,defaultErrorMap:X,setErrorMap:ht,getErrorMap:xe,makeIssue:be,EMPTY_PATH:pt,addIssueToContext:l,ParseStatus:T,INVALID:y,DIRTY:H,OK:Z,isAborted:Ve,isDirty:De,isValid:se,isAsync:ae,get util(){return x},get objectUtil(){return $e},ZodParsedType:f,getParsedType:V,ZodType:g,datetimeRegex:Ge,ZodString:E,ZodNumber:D,ZodBigInt:L,ZodBoolean:ie,ZodDate:q,ZodSymbol:we,ZodUndefined:oe,ZodNull:de,ZodAny:K,ZodUnknown:W,ZodNever:M,ZodVoid:Te,ZodArray:j,ZodObject:b,ZodUnion:ce,ZodDiscriminatedUnion:Oe,ZodIntersection:ue,ZodTuple:I,ZodRecord:le,ZodMap:Ze,ZodSet:J,ZodFunction:G,ZodLazy:fe,ZodLiteral:he,ZodEnum:U,ZodNativeEnum:pe,ZodPromise:Q,ZodEffects:C,ZodTransformer:C,ZodOptional:N,ZodNullable:z,ZodDefault:me,ZodCatch:_e,ZodNaN:Se,BRAND:Ct,ZodBranded:Ue,ZodPipeline:ve,ZodReadonly:ye,custom:Ke,Schema:g,ZodSchema:g,late:Nt,get ZodFirstPartyTypeKind(){return _},coerce:fr,any:Dt,array:Bt,bigint:At,boolean:et,date:Mt,discriminatedUnion:Yt,effect:Be,enum:rr,function:Ft,instanceof:Rt,intersection:Ht,lazy:er,literal:tr,map:Kt,nan:It,nativeEnum:nr,never:Ut,null:Vt,nullable:ir,number:Fe,object:Wt,oboolean:lr,onumber:ur,optional:ar,ostring:cr,pipeline:dr,preprocess:or,promise:sr,record:Xt,set:Qt,strictObject:qt,string:Qe,symbol:Pt,transformer:Be,tuple:Gt,undefined:$t,union:Jt,unknown:Lt,void:zt,NEVER:hr,ZodIssueCode:c,quotelessJson:ft,ZodError:S});lt(p);const We=p.object({code:p.number(),message:p.string()}),pr=p.object({message:p.string()}),mr=p.object({emails:p.array(p.string()),http_body:p.string(),http_url:p.string(),txt_name:p.string(),txt_value:p.string()}),_r=p.object({ciphers:p.array(p.string()),early_hints:p.string(),http2:p.string(),min_tls_version:p.string(),tls_1_3:p.string()}),yr=p.object({id:p.string(),bundle_method:p.string(),certificate_authority:p.string(),custom_certificate:p.string(),custom_csr_id:p.string(),custom_key:p.string(),expires_on:p.string(),hosts:p.array(p.string()),issuer:p.string(),method:p.string(),serial_number:p.string(),settings:_r,signature:p.string(),type:p.string(),uploaded_on:p.string(),validation_errors:p.array(pr),validation_records:p.array(mr),wildcard:p.boolean()}),vr=p.object({name:p.string(),type:p.string(),value:p.string()}),gr=p.object({http_body:p.string(),http_url:p.string()}),xr=p.object({id:p.string(),ssl:yr,custom_metadata:p.record(p.string()),custom_origin_server:p.string(),custom_origin_sni:p.string(),ownership_verification:vr,ownership_verification_http:gr,status:p.string(),verification_errors:p.array(p.string())}),br=p.object({errors:p.array(We),messages:p.array(We),success:p.boolean(),result:xr});function kr(r){return tt(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({"X-Auth-Email":r.authEmail,"X-Auth-Key":r.authKey,"Content-Type":"application/json"}).middlewares([dt(),at()])}function wr(r){return{create:async(e,t)=>{const{result:n,errors:s,success:a}=br.parse(await kr(r).post({hostname:t.domain,ssl:{method:"http",type:"dv"}},"/custom_hostnames").json());if(!a)throw new Error(JSON.stringify(s));return{custom_domain_id:n.id,tenant_id:e,domain:n.ssl.hosts[0],primary:!1,status:n.status==="active"?"ready":"pending",type:"auth0_managed_certs"}},get:async(e,t)=>{throw console.log("get",e,t),new Error("Not implemented")},list:async e=>{throw console.log("list",e),new Error("Not implemented")},remove:async(e,t)=>{throw console.log("remove",e,t),new Error("Not implemented")},update:async(e,t)=>{throw console.log("update",e,t),new Error("Not implemented")}}}function Tr(r){return{customDomains:wr(r)}}module.exports=Tr;
@@ -101,7 +101,8 @@ export interface CustomDomainsAdapter {
101
101
  }
102
102
  export interface CloudflareConfig {
103
103
  zoneId: string;
104
- apiKey: string;
104
+ authKey: string;
105
+ authEmail: string;
105
106
  }
106
107
  declare function createAdapters(config: CloudflareConfig): {
107
108
  customDomains: CustomDomainsAdapter;
@@ -23,7 +23,7 @@ const rt = (r, e) => e.skipDedupe || e.method !== "GET", nt = (r, e) => e.method
23
23
  let k = 0;
24
24
  if (i && i(d, h))
25
25
  return u(d, h);
26
- const O = (w, P) => Promise.resolve(n(w, P)).then((je) => je ? w && o ? w : P ? Promise.reject(P) : w : (k++, !t || k <= t ? new Promise(($) => {
26
+ const O = (w, P) => Promise.resolve(n(w, P)).then((Ee) => Ee ? w && o ? w : P ? Promise.reject(P) : w : (k++, !t || k <= t ? new Promise(($) => {
27
27
  const ge = e(r, k);
28
28
  setTimeout(() => {
29
29
  typeof s == "function" ? Promise.resolve(s({
@@ -71,17 +71,17 @@ function lt(r) {
71
71
  return;
72
72
  r.ZodType.prototype.openapi = function(s, a) {
73
73
  var o, i, u, d, h, k;
74
- const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, je = ct(w, ["param"]), $ = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof s == "string" ? { refId: s } : void 0), ge = Object.assign(Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i.metadata), je), !((d = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || d === void 0) && d.param || P ? {
74
+ const O = typeof s == "string" ? a : s, w = O ?? {}, { param: P } = w, Ee = ct(w, ["param"]), $ = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof s == "string" ? { refId: s } : void 0), ge = Object.assign(Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i.metadata), Ee), !((d = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || d === void 0) && d.param || P ? {
75
75
  param: Object.assign(Object.assign({}, (k = (h = this._def.openapi) === null || h === void 0 ? void 0 : h.metadata) === null || k === void 0 ? void 0 : k.param), P)
76
76
  } : void 0), B = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys($).length > 0 ? { _internal: $ } : void 0), Object.keys(ge).length > 0 ? { metadata: ge } : void 0) }));
77
77
  if (ut(this, "ZodObject")) {
78
78
  const F = this.extend;
79
79
  B.extend = function(...ee) {
80
- var Ee, Ce, Ne, Re, Ie, Ae;
80
+ var je, Ce, Ne, Re, Ie, Ae;
81
81
  const Me = F.apply(this, ee);
82
82
  return Me._def.openapi = {
83
83
  _internal: {
84
- extendedFrom: !((Ce = (Ee = this._def.openapi) === null || Ee === void 0 ? void 0 : Ee._internal) === null || Ce === void 0) && Ce.refId ? { refId: (Re = (Ne = this._def.openapi) === null || Ne === void 0 ? void 0 : Ne._internal) === null || Re === void 0 ? void 0 : Re.refId, schema: this } : (Ie = this._def.openapi) === null || Ie === void 0 ? void 0 : Ie._internal.extendedFrom
84
+ extendedFrom: !((Ce = (je = this._def.openapi) === null || je === void 0 ? void 0 : je._internal) === null || Ce === void 0) && Ce.refId ? { refId: (Re = (Ne = this._def.openapi) === null || Ne === void 0 ? void 0 : Ne._internal) === null || Re === void 0 ? void 0 : Re.refId, schema: this } : (Ie = this._def.openapi) === null || Ie === void 0 ? void 0 : Ie._internal.extendedFrom
85
85
  },
86
86
  metadata: (Ae = Me._def.openapi) === null || Ae === void 0 ? void 0 : Ae.metadata
87
87
  }, Me;
@@ -273,7 +273,7 @@ class S extends Error {
273
273
  }
274
274
  }
275
275
  S.create = (r) => new S(r);
276
- const K = (r, e) => {
276
+ const X = (r, e) => {
277
277
  let t;
278
278
  switch (r.code) {
279
279
  case c.invalid_type:
@@ -329,7 +329,7 @@ const K = (r, e) => {
329
329
  }
330
330
  return { message: t };
331
331
  };
332
- let qe = K;
332
+ let qe = X;
333
333
  function ht(r) {
334
334
  qe = r;
335
335
  }
@@ -366,7 +366,7 @@ function l(r, e) {
366
366
  r.common.contextualErrorMap,
367
367
  r.schemaErrorMap,
368
368
  t,
369
- t === K ? void 0 : K
369
+ t === X ? void 0 : X
370
370
  // then global default map
371
371
  ].filter((s) => !!s)
372
372
  });
@@ -437,7 +437,7 @@ class R {
437
437
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
438
438
  }
439
439
  }
440
- const Ue = (r, e) => {
440
+ const ze = (r, e) => {
441
441
  if (se(e))
442
442
  return { success: !0, data: e.value };
443
443
  if (!r.common.issues.length)
@@ -527,7 +527,7 @@ class g {
527
527
  data: e,
528
528
  parsedType: V(e)
529
529
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
530
- return Ue(s, a);
530
+ return ze(s, a);
531
531
  }
532
532
  async parseAsync(e, t) {
533
533
  const n = await this.safeParseAsync(e, t);
@@ -548,7 +548,7 @@ class g {
548
548
  data: e,
549
549
  parsedType: V(e)
550
550
  }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (ae(s) ? s : Promise.resolve(s));
551
- return Ue(n, a);
551
+ return ze(n, a);
552
552
  }
553
553
  refine(e, t) {
554
554
  const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
@@ -577,13 +577,13 @@ class g {
577
577
  return N.create(this, this._def);
578
578
  }
579
579
  nullable() {
580
- return U.create(this, this._def);
580
+ return z.create(this, this._def);
581
581
  }
582
582
  nullish() {
583
583
  return this.nullable().optional();
584
584
  }
585
585
  array() {
586
- return E.create(this, this._def);
586
+ return j.create(this, this._def);
587
587
  }
588
588
  promise() {
589
589
  return Q.create(this, this._def);
@@ -612,7 +612,7 @@ class g {
612
612
  });
613
613
  }
614
614
  brand() {
615
- return new ze({
615
+ return new Ue({
616
616
  typeName: _.ZodBranded,
617
617
  type: this,
618
618
  ...v(this._def)
@@ -662,10 +662,10 @@ function Ge(r) {
662
662
  const t = [];
663
663
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
664
664
  }
665
- function jt(r, e) {
665
+ function Et(r, e) {
666
666
  return !!((e === "v4" || !e) && wt.test(r) || (e === "v6" || !e) && Tt.test(r));
667
667
  }
668
- class j extends g {
668
+ class E extends g {
669
669
  _parse(e) {
670
670
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
671
671
  const a = this._getOrReturnCtx(e);
@@ -797,7 +797,7 @@ class j extends g {
797
797
  validation: "duration",
798
798
  code: c.invalid_string,
799
799
  message: a.message
800
- }), n.dirty()) : a.kind === "ip" ? jt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
800
+ }), n.dirty()) : a.kind === "ip" ? Et(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
801
801
  validation: "ip",
802
802
  code: c.invalid_string,
803
803
  message: a.message
@@ -816,7 +816,7 @@ class j extends g {
816
816
  });
817
817
  }
818
818
  _addCheck(e) {
819
- return new j({
819
+ return new E({
820
820
  ...this._def,
821
821
  checks: [...this._def.checks, e]
822
822
  });
@@ -942,19 +942,19 @@ class j extends g {
942
942
  return this.min(1, m.errToObj(e));
943
943
  }
944
944
  trim() {
945
- return new j({
945
+ return new E({
946
946
  ...this._def,
947
947
  checks: [...this._def.checks, { kind: "trim" }]
948
948
  });
949
949
  }
950
950
  toLowerCase() {
951
- return new j({
951
+ return new E({
952
952
  ...this._def,
953
953
  checks: [...this._def.checks, { kind: "toLowerCase" }]
954
954
  });
955
955
  }
956
956
  toUpperCase() {
957
- return new j({
957
+ return new E({
958
958
  ...this._def,
959
959
  checks: [...this._def.checks, { kind: "toUpperCase" }]
960
960
  });
@@ -1014,16 +1014,16 @@ class j extends g {
1014
1014
  return e;
1015
1015
  }
1016
1016
  }
1017
- j.create = (r) => {
1017
+ E.create = (r) => {
1018
1018
  var e;
1019
- return new j({
1019
+ return new E({
1020
1020
  checks: [],
1021
1021
  typeName: _.ZodString,
1022
1022
  coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
1023
1023
  ...v(r)
1024
1024
  });
1025
1025
  };
1026
- function Et(r, e) {
1026
+ function jt(r, e) {
1027
1027
  const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
1028
1028
  return a % o / Math.pow(10, s);
1029
1029
  }
@@ -1062,7 +1062,7 @@ class D extends g {
1062
1062
  inclusive: a.inclusive,
1063
1063
  exact: !1,
1064
1064
  message: a.message
1065
- }), s.dirty()) : a.kind === "multipleOf" ? Et(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1065
+ }), s.dirty()) : a.kind === "multipleOf" ? jt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
1066
1066
  code: c.not_multiple_of,
1067
1067
  multipleOf: a.value,
1068
1068
  message: a.message
@@ -1474,7 +1474,7 @@ de.create = (r) => new de({
1474
1474
  typeName: _.ZodNull,
1475
1475
  ...v(r)
1476
1476
  });
1477
- class X extends g {
1477
+ class K extends g {
1478
1478
  constructor() {
1479
1479
  super(...arguments), this._any = !0;
1480
1480
  }
@@ -1482,7 +1482,7 @@ class X extends g {
1482
1482
  return Z(e.data);
1483
1483
  }
1484
1484
  }
1485
- X.create = (r) => new X({
1485
+ K.create = (r) => new K({
1486
1486
  typeName: _.ZodAny,
1487
1487
  ...v(r)
1488
1488
  });
@@ -1529,7 +1529,7 @@ Te.create = (r) => new Te({
1529
1529
  typeName: _.ZodVoid,
1530
1530
  ...v(r)
1531
1531
  });
1532
- class E extends g {
1532
+ class j extends g {
1533
1533
  _parse(e) {
1534
1534
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
1535
1535
  if (t.parsedType !== f.array)
@@ -1573,19 +1573,19 @@ class E extends g {
1573
1573
  return this._def.type;
1574
1574
  }
1575
1575
  min(e, t) {
1576
- return new E({
1576
+ return new j({
1577
1577
  ...this._def,
1578
1578
  minLength: { value: e, message: m.toString(t) }
1579
1579
  });
1580
1580
  }
1581
1581
  max(e, t) {
1582
- return new E({
1582
+ return new j({
1583
1583
  ...this._def,
1584
1584
  maxLength: { value: e, message: m.toString(t) }
1585
1585
  });
1586
1586
  }
1587
1587
  length(e, t) {
1588
- return new E({
1588
+ return new j({
1589
1589
  ...this._def,
1590
1590
  exactLength: { value: e, message: m.toString(t) }
1591
1591
  });
@@ -1594,7 +1594,7 @@ class E extends g {
1594
1594
  return this.min(1, e);
1595
1595
  }
1596
1596
  }
1597
- E.create = (r, e) => new E({
1597
+ j.create = (r, e) => new j({
1598
1598
  type: r,
1599
1599
  minLength: null,
1600
1600
  maxLength: null,
@@ -1613,10 +1613,10 @@ function Y(r) {
1613
1613
  ...r._def,
1614
1614
  shape: () => e
1615
1615
  });
1616
- } else return r instanceof E ? new E({
1616
+ } else return r instanceof j ? new j({
1617
1617
  ...r._def,
1618
1618
  type: Y(r.element)
1619
- }) : r instanceof N ? N.create(Y(r.unwrap())) : r instanceof U ? U.create(Y(r.unwrap())) : r instanceof I ? I.create(r.items.map((e) => Y(e))) : r;
1619
+ }) : r instanceof N ? N.create(Y(r.unwrap())) : r instanceof z ? z.create(Y(r.unwrap())) : r instanceof I ? I.create(r.items.map((e) => Y(e))) : r;
1620
1620
  }
1621
1621
  class b extends g {
1622
1622
  constructor() {
@@ -1881,7 +1881,7 @@ class b extends g {
1881
1881
  });
1882
1882
  }
1883
1883
  keyof() {
1884
- return Ke(x.objectKeys(this.shape));
1884
+ return Xe(x.objectKeys(this.shape));
1885
1885
  }
1886
1886
  }
1887
1887
  b.create = (r, e) => new b({
@@ -1978,7 +1978,7 @@ ce.create = (r, e) => new ce({
1978
1978
  typeName: _.ZodUnion,
1979
1979
  ...v(e)
1980
1980
  });
1981
- const A = (r) => r instanceof fe ? A(r.schema) : r instanceof C ? A(r.innerType()) : r instanceof he ? [r.value] : r instanceof z ? r.options : r instanceof pe ? x.objectValues(r.enum) : r instanceof me ? A(r._def.innerType) : r instanceof oe ? [void 0] : r instanceof de ? [null] : r instanceof N ? [void 0, ...A(r.unwrap())] : r instanceof U ? [null, ...A(r.unwrap())] : r instanceof ze || r instanceof ye ? A(r.unwrap()) : r instanceof _e ? A(r._def.innerType) : [];
1981
+ const A = (r) => r instanceof fe ? A(r.schema) : r instanceof C ? A(r.innerType()) : r instanceof he ? [r.value] : r instanceof U ? r.options : r instanceof pe ? x.objectValues(r.enum) : r instanceof me ? A(r._def.innerType) : r instanceof oe ? [void 0] : r instanceof de ? [null] : r instanceof N ? [void 0, ...A(r.unwrap())] : r instanceof z ? [null, ...A(r.unwrap())] : r instanceof Ue || r instanceof ye ? A(r.unwrap()) : r instanceof _e ? A(r._def.innerType) : [];
1982
1982
  class Oe extends g {
1983
1983
  _parse(e) {
1984
1984
  const { ctx: t } = this._processInputParams(e);
@@ -2189,7 +2189,7 @@ class le extends g {
2189
2189
  typeName: _.ZodRecord,
2190
2190
  ...v(n)
2191
2191
  }) : new le({
2192
- keyType: j.create(),
2192
+ keyType: E.create(),
2193
2193
  valueType: e,
2194
2194
  typeName: _.ZodRecord,
2195
2195
  ...v(t)
@@ -2328,7 +2328,7 @@ class G extends g {
2328
2328
  t.common.contextualErrorMap,
2329
2329
  t.schemaErrorMap,
2330
2330
  xe(),
2331
- K
2331
+ X
2332
2332
  ].filter((d) => !!d),
2333
2333
  issueData: {
2334
2334
  code: c.invalid_arguments,
@@ -2344,7 +2344,7 @@ class G extends g {
2344
2344
  t.common.contextualErrorMap,
2345
2345
  t.schemaErrorMap,
2346
2346
  xe(),
2347
- K
2347
+ X
2348
2348
  ].filter((d) => !!d),
2349
2349
  issueData: {
2350
2350
  code: c.invalid_return_type,
@@ -2444,14 +2444,14 @@ he.create = (r, e) => new he({
2444
2444
  typeName: _.ZodLiteral,
2445
2445
  ...v(e)
2446
2446
  });
2447
- function Ke(r, e) {
2448
- return new z({
2447
+ function Xe(r, e) {
2448
+ return new U({
2449
2449
  values: r,
2450
2450
  typeName: _.ZodEnum,
2451
2451
  ...v(e)
2452
2452
  });
2453
2453
  }
2454
- class z extends g {
2454
+ class U extends g {
2455
2455
  constructor() {
2456
2456
  super(...arguments), re.set(this, void 0);
2457
2457
  }
@@ -2496,20 +2496,20 @@ class z extends g {
2496
2496
  return e;
2497
2497
  }
2498
2498
  extract(e, t = this._def) {
2499
- return z.create(e, {
2499
+ return U.create(e, {
2500
2500
  ...this._def,
2501
2501
  ...t
2502
2502
  });
2503
2503
  }
2504
2504
  exclude(e, t = this._def) {
2505
- return z.create(this.options.filter((n) => !e.includes(n)), {
2505
+ return U.create(this.options.filter((n) => !e.includes(n)), {
2506
2506
  ...this._def,
2507
2507
  ...t
2508
2508
  });
2509
2509
  }
2510
2510
  }
2511
2511
  re = /* @__PURE__ */ new WeakMap();
2512
- z.create = Ke;
2512
+ U.create = Xe;
2513
2513
  class pe extends g {
2514
2514
  constructor() {
2515
2515
  super(...arguments), ne.set(this, void 0);
@@ -2670,7 +2670,7 @@ N.create = (r, e) => new N({
2670
2670
  typeName: _.ZodOptional,
2671
2671
  ...v(e)
2672
2672
  });
2673
- class U extends g {
2673
+ class z extends g {
2674
2674
  _parse(e) {
2675
2675
  return this._getType(e) === f.null ? Z(null) : this._def.innerType._parse(e);
2676
2676
  }
@@ -2678,7 +2678,7 @@ class U extends g {
2678
2678
  return this._def.innerType;
2679
2679
  }
2680
2680
  }
2681
- U.create = (r, e) => new U({
2681
+ z.create = (r, e) => new z({
2682
2682
  innerType: r,
2683
2683
  typeName: _.ZodNullable,
2684
2684
  ...v(e)
@@ -2764,7 +2764,7 @@ Se.create = (r) => new Se({
2764
2764
  ...v(r)
2765
2765
  });
2766
2766
  const Ct = Symbol("zod_brand");
2767
- class ze extends g {
2767
+ class Ue extends g {
2768
2768
  _parse(e) {
2769
2769
  const { ctx: t } = this._processInputParams(e), n = t.data;
2770
2770
  return this._def.type._parse({
@@ -2831,14 +2831,14 @@ ye.create = (r, e) => new ye({
2831
2831
  typeName: _.ZodReadonly,
2832
2832
  ...v(e)
2833
2833
  });
2834
- function Xe(r, e = {}, t) {
2835
- return r ? X.create().superRefine((n, s) => {
2834
+ function Ke(r, e = {}, t) {
2835
+ return r ? K.create().superRefine((n, s) => {
2836
2836
  var a, o;
2837
2837
  if (!r(n)) {
2838
2838
  const i = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (o = (a = i.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, d = typeof i == "string" ? { message: i } : i;
2839
2839
  s.addIssue({ code: "custom", ...d, fatal: u });
2840
2840
  }
2841
- }) : X.create();
2841
+ }) : K.create();
2842
2842
  }
2843
2843
  const Nt = {
2844
2844
  object: b.lazycreate
@@ -2849,8 +2849,8 @@ var _;
2849
2849
  })(_ || (_ = {}));
2850
2850
  const Rt = (r, e = {
2851
2851
  message: `Input not instance of ${r.name}`
2852
- }) => Xe((t) => t instanceof r, e), Qe = j.create, Fe = D.create, It = Se.create, At = L.create, et = ie.create, Mt = q.create, Pt = we.create, $t = oe.create, Vt = de.create, Dt = X.create, Lt = W.create, zt = M.create, Ut = Te.create, Bt = E.create, Wt = b.create, qt = b.strictCreate, Jt = ce.create, Yt = Oe.create, Ht = ue.create, Gt = I.create, Kt = le.create, Xt = Ze.create, Qt = J.create, Ft = G.create, er = fe.create, tr = he.create, rr = z.create, nr = pe.create, sr = Q.create, Be = C.create, ar = N.create, ir = U.create, or = C.createWithPreprocess, dr = ve.create, cr = () => Qe().optional(), ur = () => Fe().optional(), lr = () => et().optional(), fr = {
2853
- string: (r) => j.create({ ...r, coerce: !0 }),
2852
+ }) => Ke((t) => t instanceof r, e), Qe = E.create, Fe = D.create, It = Se.create, At = L.create, et = ie.create, Mt = q.create, Pt = we.create, $t = oe.create, Vt = de.create, Dt = K.create, Lt = W.create, Ut = M.create, zt = Te.create, Bt = j.create, Wt = b.create, qt = b.strictCreate, Jt = ce.create, Yt = Oe.create, Ht = ue.create, Gt = I.create, Xt = le.create, Kt = Ze.create, Qt = J.create, Ft = G.create, er = fe.create, tr = he.create, rr = U.create, nr = pe.create, sr = Q.create, Be = C.create, ar = N.create, ir = z.create, or = C.createWithPreprocess, dr = ve.create, cr = () => Qe().optional(), ur = () => Fe().optional(), lr = () => et().optional(), fr = {
2853
+ string: (r) => E.create({ ...r, coerce: !0 }),
2854
2854
  number: (r) => D.create({ ...r, coerce: !0 }),
2855
2855
  boolean: (r) => ie.create({
2856
2856
  ...r,
@@ -2861,7 +2861,7 @@ const Rt = (r, e = {
2861
2861
  }, hr = y;
2862
2862
  var p = /* @__PURE__ */ Object.freeze({
2863
2863
  __proto__: null,
2864
- defaultErrorMap: K,
2864
+ defaultErrorMap: X,
2865
2865
  setErrorMap: ht,
2866
2866
  getErrorMap: xe,
2867
2867
  makeIssue: be,
@@ -2885,7 +2885,7 @@ var p = /* @__PURE__ */ Object.freeze({
2885
2885
  getParsedType: V,
2886
2886
  ZodType: g,
2887
2887
  datetimeRegex: Ge,
2888
- ZodString: j,
2888
+ ZodString: E,
2889
2889
  ZodNumber: D,
2890
2890
  ZodBigInt: L,
2891
2891
  ZodBoolean: ie,
@@ -2893,11 +2893,11 @@ var p = /* @__PURE__ */ Object.freeze({
2893
2893
  ZodSymbol: we,
2894
2894
  ZodUndefined: oe,
2895
2895
  ZodNull: de,
2896
- ZodAny: X,
2896
+ ZodAny: K,
2897
2897
  ZodUnknown: W,
2898
2898
  ZodNever: M,
2899
2899
  ZodVoid: Te,
2900
- ZodArray: E,
2900
+ ZodArray: j,
2901
2901
  ZodObject: b,
2902
2902
  ZodUnion: ce,
2903
2903
  ZodDiscriminatedUnion: Oe,
@@ -2909,21 +2909,21 @@ var p = /* @__PURE__ */ Object.freeze({
2909
2909
  ZodFunction: G,
2910
2910
  ZodLazy: fe,
2911
2911
  ZodLiteral: he,
2912
- ZodEnum: z,
2912
+ ZodEnum: U,
2913
2913
  ZodNativeEnum: pe,
2914
2914
  ZodPromise: Q,
2915
2915
  ZodEffects: C,
2916
2916
  ZodTransformer: C,
2917
2917
  ZodOptional: N,
2918
- ZodNullable: U,
2918
+ ZodNullable: z,
2919
2919
  ZodDefault: me,
2920
2920
  ZodCatch: _e,
2921
2921
  ZodNaN: Se,
2922
2922
  BRAND: Ct,
2923
- ZodBranded: ze,
2923
+ ZodBranded: Ue,
2924
2924
  ZodPipeline: ve,
2925
2925
  ZodReadonly: ye,
2926
- custom: Xe,
2926
+ custom: Ke,
2927
2927
  Schema: g,
2928
2928
  ZodSchema: g,
2929
2929
  late: Nt,
@@ -2944,10 +2944,10 @@ var p = /* @__PURE__ */ Object.freeze({
2944
2944
  intersection: Ht,
2945
2945
  lazy: er,
2946
2946
  literal: tr,
2947
- map: Xt,
2947
+ map: Kt,
2948
2948
  nan: It,
2949
2949
  nativeEnum: nr,
2950
- never: zt,
2950
+ never: Ut,
2951
2951
  null: Vt,
2952
2952
  nullable: ir,
2953
2953
  number: Fe,
@@ -2959,7 +2959,7 @@ var p = /* @__PURE__ */ Object.freeze({
2959
2959
  pipeline: dr,
2960
2960
  preprocess: or,
2961
2961
  promise: sr,
2962
- record: Kt,
2962
+ record: Xt,
2963
2963
  set: Qt,
2964
2964
  strictObject: qt,
2965
2965
  string: Qe,
@@ -2969,7 +2969,7 @@ var p = /* @__PURE__ */ Object.freeze({
2969
2969
  undefined: $t,
2970
2970
  union: Jt,
2971
2971
  unknown: Lt,
2972
- void: Ut,
2972
+ void: zt,
2973
2973
  NEVER: hr,
2974
2974
  ZodIssueCode: c,
2975
2975
  quotelessJson: ft,
@@ -3037,7 +3037,8 @@ const We = p.object({
3037
3037
  });
3038
3038
  function kr(r) {
3039
3039
  return tt(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3040
- Authorization: `Bearer ${r.apiKey}`,
3040
+ "X-Auth-Email": r.authEmail,
3041
+ "X-Auth-Key": r.authKey,
3041
3042
  "Content-Type": "application/json"
3042
3043
  }).middlewares([dt(), at()]);
3043
3044
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "0.2.0",
14
+ "version": "0.3.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],