@umijs/utils 4.0.55 → 4.0.57

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.
Files changed (42) hide show
  1. package/compiled/zod/LICENSE +21 -0
  2. package/compiled/zod/index.d.ts +2 -0
  3. package/compiled/zod/index.js +1 -0
  4. package/compiled/zod/lib/ZodError.d.ts +159 -0
  5. package/compiled/zod/lib/__tests__/Mocker.d.ts +17 -0
  6. package/compiled/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
  7. package/compiled/zod/lib/benchmarks/index.d.ts +1 -0
  8. package/compiled/zod/lib/benchmarks/object.d.ts +5 -0
  9. package/compiled/zod/lib/benchmarks/primitives.d.ts +5 -0
  10. package/compiled/zod/lib/benchmarks/realworld.d.ts +5 -0
  11. package/compiled/zod/lib/benchmarks/string.d.ts +5 -0
  12. package/compiled/zod/lib/benchmarks/union.d.ts +5 -0
  13. package/compiled/zod/lib/errors.d.ts +5 -0
  14. package/compiled/zod/lib/external.d.ts +6 -0
  15. package/compiled/zod/lib/helpers/enumUtil.d.ts +8 -0
  16. package/compiled/zod/lib/helpers/errorUtil.d.ts +9 -0
  17. package/compiled/zod/lib/helpers/parseUtil.d.ts +78 -0
  18. package/compiled/zod/lib/helpers/partialUtil.d.ts +8 -0
  19. package/compiled/zod/lib/helpers/typeAliases.d.ts +2 -0
  20. package/compiled/zod/lib/helpers/util.d.ts +47 -0
  21. package/compiled/zod/lib/index.d.ts +4 -0
  22. package/compiled/zod/lib/locales/en.d.ts +3 -0
  23. package/compiled/zod/lib/types.d.ts +975 -0
  24. package/compiled/zod/package.json +1 -0
  25. package/dist/BaseGenerator/BaseGenerator.js +4 -0
  26. package/dist/BaseGenerator/generateFile.js +1 -4
  27. package/dist/Generator/Generator.js +4 -0
  28. package/dist/getDevBanner.js +11 -22
  29. package/dist/getGitInfo.js +1 -4
  30. package/dist/importLazy.js +2 -7
  31. package/dist/index.d.ts +4 -1
  32. package/dist/index.js +7 -2
  33. package/dist/installDeps.js +10 -16
  34. package/dist/npmClient.js +4 -0
  35. package/dist/printHelp.js +2 -7
  36. package/dist/randomColor/randomColor.js +1 -4
  37. package/dist/register.js +2 -0
  38. package/dist/zod/isZodSchema.d.ts +2 -0
  39. package/dist/zod/isZodSchema.js +31 -0
  40. package/dist/zod/zod2string.d.ts +2 -0
  41. package/dist/zod/zod2string.js +49 -0
  42. package/package.json +5 -3
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Colin McDonnell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export * from "./lib";
2
+ export as namespace Zod;
@@ -0,0 +1 @@
1
+ (function(){"use strict";var e={117:function(e,t,s){Object.defineProperty(t,"__esModule",{value:true});t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const r=s(342);t.ZodIssueCode=r.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const quotelessJson=e=>{const t=JSON.stringify(e,null,2);return t.replace(/"([^"]+)":/g,"$1:")};t.quotelessJson=quotelessJson;class ZodError extends Error{constructor(e){super();this.issues=[];this.addIssue=e=>{this.issues=[...this.issues,e]};this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;if(Object.setPrototypeOf){Object.setPrototypeOf(this,t)}else{this.__proto__=t}this.name="ZodError";this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message};const s={_errors:[]};const processError=e=>{for(const r of e.issues){if(r.code==="invalid_union"){r.unionErrors.map(processError)}else if(r.code==="invalid_return_type"){processError(r.returnTypeError)}else if(r.code==="invalid_arguments"){processError(r.argumentsError)}else if(r.path.length===0){s._errors.push(t(r))}else{let e=s;let a=0;while(a<r.path.length){const s=r.path[a];const n=a===r.path.length-1;if(!n){e[s]=e[s]||{_errors:[]}}else{e[s]=e[s]||{_errors:[]};e[s]._errors.push(t(r))}e=e[s];a++}}}};processError(this);return s}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(e=>e.message)){const t={};const s=[];for(const r of this.issues){if(r.path.length>0){t[r.path[0]]=t[r.path[0]]||[];t[r.path[0]].push(e(r))}else{s.push(e(r))}}return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=ZodError;ZodError.create=e=>{const t=new ZodError(e);return t}},899:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const a=r(s(121));t.defaultErrorMap=a.default;let n=a.default;function setErrorMap(e){n=e}t.setErrorMap=setErrorMap;function getErrorMap(){return n}t.getErrorMap=getErrorMap},515:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){if(r===undefined)r=s;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[s]}})}:function(e,t,s,r){if(r===undefined)r=s;e[r]=t[s]});var a=this&&this.__exportStar||function(e,t){for(var s in e)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s))r(t,e,s)};Object.defineProperty(t,"__esModule",{value:true});a(s(899),t);a(s(836),t);a(s(632),t);a(s(342),t);a(s(455),t);a(s(117),t)},556:function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.errorUtil=void 0;var s;(function(e){e.errToObj=e=>typeof e==="string"?{message:e}:e||{};e.toString=e=>typeof e==="string"?e:e===null||e===void 0?void 0:e.message})(s=t.errorUtil||(t.errorUtil={}))},836:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const a=s(899);const n=r(s(121));const makeIssue=e=>{const{data:t,path:s,errorMaps:r,issueData:a}=e;const n=[...s,...a.path||[]];const o={...a,path:n};let i="";const d=r.filter((e=>!!e)).slice().reverse();for(const e of d){i=e(o,{data:t,defaultError:i}).message}return{...a,path:n,message:a.message||i}};t.makeIssue=makeIssue;t.EMPTY_PATH=[];function addIssueToContext(e,s){const r=(0,t.makeIssue)({issueData:s,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,(0,a.getErrorMap)(),n.default].filter((e=>!!e))});e.common.issues.push(r)}t.addIssueToContext=addIssueToContext;class ParseStatus{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,s){const r=[];for(const a of s){if(a.status==="aborted")return t.INVALID;if(a.status==="dirty")e.dirty();r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const s=[];for(const e of t){s.push({key:await e.key,value:await e.value})}return ParseStatus.mergeObjectSync(e,s)}static mergeObjectSync(e,s){const r={};for(const a of s){const{key:s,value:n}=a;if(s.status==="aborted")return t.INVALID;if(n.status==="aborted")return t.INVALID;if(s.status==="dirty")e.dirty();if(n.status==="dirty")e.dirty();if(typeof n.value!=="undefined"||a.alwaysSet){r[s.value]=n.value}}return{status:e.value,value:r}}}t.ParseStatus=ParseStatus;t.INVALID=Object.freeze({status:"aborted"});const DIRTY=e=>({status:"dirty",value:e});t.DIRTY=DIRTY;const OK=e=>({status:"valid",value:e});t.OK=OK;const isAborted=e=>e.status==="aborted";t.isAborted=isAborted;const isDirty=e=>e.status==="dirty";t.isDirty=isDirty;const isValid=e=>e.status==="valid";t.isValid=isValid;const isAsync=e=>typeof Promise!=="undefined"&&e instanceof Promise;t.isAsync=isAsync},632:function(e,t){Object.defineProperty(t,"__esModule",{value:true})},342:function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.getParsedType=t.ZodParsedType=t.util=void 0;var s;(function(e){e.assertEqual=e=>e;function assertIs(e){}e.assertIs=assertIs;function assertNever(e){throw new Error}e.assertNever=assertNever;e.arrayToEnum=e=>{const t={};for(const s of e){t[s]=s}return t};e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>typeof t[t[e]]!=="number"));const r={};for(const e of s){r[e]=t[e]}return e.objectValues(r)};e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]}));e.objectKeys=typeof Object.keys==="function"?e=>Object.keys(e):e=>{const t=[];for(const s in e){if(Object.prototype.hasOwnProperty.call(e,s)){t.push(s)}}return t};e.find=(e,t)=>{for(const s of e){if(t(s))return s}return undefined};e.isInteger=typeof Number.isInteger==="function"?e=>Number.isInteger(e):e=>typeof e==="number"&&isFinite(e)&&Math.floor(e)===e;function joinValues(e,t=" | "){return e.map((e=>typeof e==="string"?`'${e}'`:e)).join(t)}e.joinValues=joinValues;e.jsonStringifyReplacer=(e,t)=>{if(typeof t==="bigint"){return t.toString()}return t}})(s=t.util||(t.util={}));t.ZodParsedType=s.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const getParsedType=e=>{const s=typeof e;switch(s){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":if(Array.isArray(e)){return t.ZodParsedType.array}if(e===null){return t.ZodParsedType.null}if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function"){return t.ZodParsedType.promise}if(typeof Map!=="undefined"&&e instanceof Map){return t.ZodParsedType.map}if(typeof Set!=="undefined"&&e instanceof Set){return t.ZodParsedType.set}if(typeof Date!=="undefined"&&e instanceof Date){return t.ZodParsedType.date}return t.ZodParsedType.object;default:return t.ZodParsedType.unknown}};t.getParsedType=getParsedType},918:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){if(r===undefined)r=s;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[s]}})}:function(e,t,s,r){if(r===undefined)r=s;e[r]=t[s]});var a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)if(s!=="default"&&Object.prototype.hasOwnProperty.call(e,s))r(t,e,s);a(t,e);return t};var o=this&&this.__exportStar||function(e,t){for(var s in e)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s))r(t,e,s)};Object.defineProperty(t,"__esModule",{value:true});t.z=void 0;const i=n(s(515));t.z=i;o(s(515),t);t["default"]=i},121:function(e,t,s){Object.defineProperty(t,"__esModule",{value:true});const r=s(342);const a=s(117);const errorMap=(e,t)=>{let s;switch(e.code){case a.ZodIssueCode.invalid_type:if(e.received===r.ZodParsedType.undefined){s="Required"}else{s=`Expected ${e.expected}, received ${e.received}`}break;case a.ZodIssueCode.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,r.util.jsonStringifyReplacer)}`;break;case a.ZodIssueCode.unrecognized_keys:s=`Unrecognized key(s) in object: ${r.util.joinValues(e.keys,", ")}`;break;case a.ZodIssueCode.invalid_union:s=`Invalid input`;break;case a.ZodIssueCode.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${r.util.joinValues(e.options)}`;break;case a.ZodIssueCode.invalid_enum_value:s=`Invalid enum value. Expected ${r.util.joinValues(e.options)}, received '${e.received}'`;break;case a.ZodIssueCode.invalid_arguments:s=`Invalid function arguments`;break;case a.ZodIssueCode.invalid_return_type:s=`Invalid function return type`;break;case a.ZodIssueCode.invalid_date:s=`Invalid date`;break;case a.ZodIssueCode.invalid_string:if(typeof e.validation==="object"){if("startsWith"in e.validation){s=`Invalid input: must start with "${e.validation.startsWith}"`}else if("endsWith"in e.validation){s=`Invalid input: must end with "${e.validation.endsWith}"`}else{r.util.assertNever(e.validation)}}else if(e.validation!=="regex"){s=`Invalid ${e.validation}`}else{s="Invalid"}break;case a.ZodIssueCode.too_small:if(e.type==="array")s=`Array must contain ${e.exact?"exactly":e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`;else if(e.type==="string")s=`String must contain ${e.exact?"exactly":e.inclusive?`at least`:`over`} ${e.minimum} character(s)`;else if(e.type==="number")s=`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`;else if(e.type==="date")s=`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(e.minimum)}`;else s="Invalid input";break;case a.ZodIssueCode.too_big:if(e.type==="array")s=`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`;else if(e.type==="string")s=`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`;else if(e.type==="number")s=`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`;else if(e.type==="date")s=`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(e.maximum)}`;else s="Invalid input";break;case a.ZodIssueCode.custom:s=`Invalid input`;break;case a.ZodIssueCode.invalid_intersection_types:s=`Intersection results could not be merged`;break;case a.ZodIssueCode.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case a.ZodIssueCode.not_finite:s="Number must be finite";break;default:s=t.defaultError;r.util.assertNever(e)}return{message:s}};t["default"]=errorMap},455:function(e,t,s){Object.defineProperty(t,"__esModule",{value:true});t.date=t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.objectUtil=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.ZodType=void 0;t.NEVER=t["void"]=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t["null"]=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t["instanceof"]=t["function"]=t["enum"]=t.effect=t.discriminatedUnion=void 0;const r=s(899);const a=s(556);const n=s(836);const o=s(342);const i=s(117);class ParseInputLazyPath{constructor(e,t,s,r){this.parent=e;this.data=t;this._path=s;this._key=r}get path(){return this._path.concat(this._key)}}const handleResult=(e,t)=>{if((0,n.isValid)(t)){return{success:true,data:t.value}}else{if(!e.common.issues.length){throw new Error("Validation failed but no issues detected.")}const t=new i.ZodError(e.common.issues);return{success:false,error:t}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:a}=e;if(t&&(s||r)){throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`)}if(t)return{errorMap:t,description:a};const customMap=(e,t)=>{if(e.code!=="invalid_type")return{message:t.defaultError};if(typeof t.data==="undefined"){return{message:r!==null&&r!==void 0?r:t.defaultError}}return{message:s!==null&&s!==void 0?s:t.defaultError}};return{errorMap:customMap,description:a}}class ZodType{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.isNullable=this.isNullable.bind(this);this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return(0,o.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,o.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new n.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,o.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,n.isAsync)(t)){throw new Error("Synchronous parse encountered promise.")}return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const r={common:{issues:[],async:(s=t===null||t===void 0?void 0:t.async)!==null&&s!==void 0?s:false,contextualErrorMap:t===null||t===void 0?void 0:t.errorMap},path:(t===null||t===void 0?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,o.getParsedType)(e)};const a=this._parseSync({data:e,path:r.path,parent:r});return handleResult(r,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t===null||t===void 0?void 0:t.errorMap,async:true},path:(t===null||t===void 0?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,o.getParsedType)(e)};const r=this._parse({data:e,path:s.path,parent:s});const a=await((0,n.isAsync)(r)?r:Promise.resolve(r));return handleResult(s,a)}refine(e,t){const getIssueProperties=e=>{if(typeof t==="string"||typeof t==="undefined"){return{message:t}}else if(typeof t==="function"){return t(e)}else{return t}};return this._refinement(((t,s)=>{const r=e(t);const setError=()=>s.addIssue({code:i.ZodIssueCode.custom,...getIssueProperties(t)});if(typeof Promise!=="undefined"&&r instanceof Promise){return r.then((e=>{if(!e){setError();return false}else{return true}}))}if(!r){setError();return false}else{return true}}))}refinement(e,t){return this._refinement(((s,r)=>{if(!e(s)){r.addIssue(typeof t==="function"?t(s,r):t);return false}else{return true}}))}_refinement(e){return new ZodEffects({schema:this,typeName:f.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:f.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e==="function"?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:f.ZodDefault})}brand(){return new ZodBranded({typeName:f.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t=typeof e==="function"?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:f.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}isOptional(){return this.safeParse(undefined).success}isNullable(){return this.safeParse(null).success}}t.ZodType=ZodType;t.Schema=ZodType;t.ZodSchema=ZodType;const d=/^c[^\s-]{8,}$/i;const u=/^[a-z][a-z0-9]*$/;const c=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;const l=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;const datetimeRegex=e=>{if(e.precision){if(e.offset){return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`)}else{return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`)}}else if(e.precision===0){if(e.offset){return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`)}else{return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`)}}else{if(e.offset){return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`)}else{return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`)}}};class ZodString extends ZodType{constructor(){super(...arguments);this._regex=(e,t,s)=>this.refinement((t=>e.test(t)),{validation:t,code:i.ZodIssueCode.invalid_string,...a.errorUtil.errToObj(s)});this.nonempty=e=>this.min(1,a.errorUtil.errToObj(e));this.trim=()=>new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce){e.data=String(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.string){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.string,received:t.parsedType});return n.INVALID}const s=new n.ParseStatus;let r=undefined;for(const t of this._def.checks){if(t.kind==="min"){if(e.data.length<t.value){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.too_small,minimum:t.value,type:"string",inclusive:true,exact:false,message:t.message});s.dirty()}}else if(t.kind==="max"){if(e.data.length>t.value){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.too_big,maximum:t.value,type:"string",inclusive:true,exact:false,message:t.message});s.dirty()}}else if(t.kind==="length"){const a=e.data.length>t.value;const o=e.data.length<t.value;if(a||o){r=this._getOrReturnCtx(e,r);if(a){(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.too_big,maximum:t.value,type:"string",inclusive:true,exact:true,message:t.message})}else if(o){(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.too_small,minimum:t.value,type:"string",inclusive:true,exact:true,message:t.message})}s.dirty()}}else if(t.kind==="email"){if(!l.test(e.data)){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{validation:"email",code:i.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="uuid"){if(!c.test(e.data)){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{validation:"uuid",code:i.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="cuid"){if(!d.test(e.data)){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{validation:"cuid",code:i.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="cuid2"){if(!u.test(e.data)){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{validation:"cuid2",code:i.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="url"){try{new URL(e.data)}catch(a){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{validation:"url",code:i.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="regex"){t.regex.lastIndex=0;const a=t.regex.test(e.data);if(!a){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{validation:"regex",code:i.ZodIssueCode.invalid_string,message:t.message});s.dirty()}}else if(t.kind==="trim"){e.data=e.data.trim()}else if(t.kind==="startsWith"){if(!e.data.startsWith(t.value)){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_string,validation:{startsWith:t.value},message:t.message});s.dirty()}}else if(t.kind==="endsWith"){if(!e.data.endsWith(t.value)){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_string,validation:{endsWith:t.value},message:t.message});s.dirty()}}else if(t.kind==="datetime"){const a=datetimeRegex(t);if(!a.test(e.data)){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.invalid_string,validation:"datetime",message:t.message});s.dirty()}}else{o.util.assertNever(t)}}return{status:s.value,value:e.data}}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errorUtil.errToObj(e)})}datetime(e){var t;if(typeof e==="string"){return this._addCheck({kind:"datetime",precision:null,offset:false,message:e})}return this._addCheck({kind:"datetime",precision:typeof(e===null||e===void 0?void 0:e.precision)==="undefined"?null:e===null||e===void 0?void 0:e.precision,offset:(t=e===null||e===void 0?void 0:e.offset)!==null&&t!==void 0?t:false,...a.errorUtil.errToObj(e===null||e===void 0?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a.errorUtil.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a.errorUtil.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>e.kind==="datetime"))}get isEmail(){return!!this._def.checks.find((e=>e.kind==="email"))}get isURL(){return!!this._def.checks.find((e=>e.kind==="url"))}get isUUID(){return!!this._def.checks.find((e=>e.kind==="uuid"))}get isCUID(){return!!this._def.checks.find((e=>e.kind==="cuid"))}get isCUID2(){return!!this._def.checks.find((e=>e.kind==="cuid2"))}get minLength(){let e=null;for(const t of this._def.checks){if(t.kind==="min"){if(e===null||t.value>e)e=t.value}}return e}get maxLength(){let e=null;for(const t of this._def.checks){if(t.kind==="max"){if(e===null||t.value<e)e=t.value}}return e}}t.ZodString=ZodString;ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:f.ZodString,coerce:(t=e===null||e===void 0?void 0:e.coerce)!==null&&t!==void 0?t:false,...processCreateParams(e)})};function floatSafeRemainder(e,t){const s=(e.toString().split(".")[1]||"").length;const r=(t.toString().split(".")[1]||"").length;const a=s>r?s:r;const n=parseInt(e.toFixed(a).replace(".",""));const o=parseInt(t.toFixed(a).replace(".",""));return n%o/Math.pow(10,a)}class ZodNumber extends ZodType{constructor(){super(...arguments);this.min=this.gte;this.max=this.lte;this.step=this.multipleOf}_parse(e){if(this._def.coerce){e.data=Number(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.number){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.number,received:t.parsedType});return n.INVALID}let s=undefined;const r=new n.ParseStatus;for(const t of this._def.checks){if(t.kind==="int"){if(!o.util.isInteger(e.data)){s=this._getOrReturnCtx(e,s);(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:t.message});r.dirty()}}else if(t.kind==="min"){const a=t.inclusive?e.data<t.value:e.data<=t.value;if(a){s=this._getOrReturnCtx(e,s);(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.too_small,minimum:t.value,type:"number",inclusive:t.inclusive,exact:false,message:t.message});r.dirty()}}else if(t.kind==="max"){const a=t.inclusive?e.data>t.value:e.data>=t.value;if(a){s=this._getOrReturnCtx(e,s);(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.too_big,maximum:t.value,type:"number",inclusive:t.inclusive,exact:false,message:t.message});r.dirty()}}else if(t.kind==="multipleOf"){if(floatSafeRemainder(e.data,t.value)!==0){s=this._getOrReturnCtx(e,s);(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.not_multiple_of,multipleOf:t.value,message:t.message});r.dirty()}}else if(t.kind==="finite"){if(!Number.isFinite(e.data)){s=this._getOrReturnCtx(e,s);(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.not_finite,message:t.message});r.dirty()}}else{o.util.assertNever(t)}}return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,true,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,false,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,true,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,false,a.errorUtil.toString(t))}setLimit(e,t,s,r){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:a.errorUtil.toString(r)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks){if(t.kind==="min"){if(e===null||t.value>e)e=t.value}}return e}get maxValue(){let e=null;for(const t of this._def.checks){if(t.kind==="max"){if(e===null||t.value<e)e=t.value}}return e}get isInt(){return!!this._def.checks.find((e=>e.kind==="int"||e.kind==="multipleOf"&&o.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf"){return true}else if(s.kind==="min"){if(t===null||s.value>t)t=s.value}else if(s.kind==="max"){if(e===null||s.value<e)e=s.value}}return Number.isFinite(t)&&Number.isFinite(e)}}t.ZodNumber=ZodNumber;ZodNumber.create=e=>new ZodNumber({checks:[],typeName:f.ZodNumber,coerce:(e===null||e===void 0?void 0:e.coerce)||false,...processCreateParams(e)});class ZodBigInt extends ZodType{_parse(e){if(this._def.coerce){e.data=BigInt(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.bigint){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.bigint,received:t.parsedType});return n.INVALID}return(0,n.OK)(e.data)}}t.ZodBigInt=ZodBigInt;ZodBigInt.create=e=>{var t;return new ZodBigInt({typeName:f.ZodBigInt,coerce:(t=e===null||e===void 0?void 0:e.coerce)!==null&&t!==void 0?t:false,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){if(this._def.coerce){e.data=Boolean(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.boolean,received:t.parsedType});return n.INVALID}return(0,n.OK)(e.data)}}t.ZodBoolean=ZodBoolean;ZodBoolean.create=e=>new ZodBoolean({typeName:f.ZodBoolean,coerce:(e===null||e===void 0?void 0:e.coerce)||false,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){if(this._def.coerce){e.data=new Date(e.data)}const t=this._getType(e);if(t!==o.ZodParsedType.date){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.date,received:t.parsedType});return n.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_date});return n.INVALID}const s=new n.ParseStatus;let r=undefined;for(const t of this._def.checks){if(t.kind==="min"){if(e.data.getTime()<t.value){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.too_small,message:t.message,inclusive:true,exact:false,minimum:t.value,type:"date"});s.dirty()}}else if(t.kind==="max"){if(e.data.getTime()>t.value){r=this._getOrReturnCtx(e,r);(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.too_big,message:t.message,inclusive:true,exact:false,maximum:t.value,type:"date"});s.dirty()}}else{o.util.assertNever(t)}}return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks){if(t.kind==="min"){if(e===null||t.value>e)e=t.value}}return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks){if(t.kind==="max"){if(e===null||t.value<e)e=t.value}}return e!=null?new Date(e):null}}t.ZodDate=ZodDate;ZodDate.create=e=>new ZodDate({checks:[],coerce:(e===null||e===void 0?void 0:e.coerce)||false,typeName:f.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.symbol,received:t.parsedType});return n.INVALID}return(0,n.OK)(e.data)}}t.ZodSymbol=ZodSymbol;ZodSymbol.create=e=>new ZodSymbol({typeName:f.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.undefined,received:t.parsedType});return n.INVALID}return(0,n.OK)(e.data)}}t.ZodUndefined=ZodUndefined;ZodUndefined.create=e=>new ZodUndefined({typeName:f.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.null){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.null,received:t.parsedType});return n.INVALID}return(0,n.OK)(e.data)}}t.ZodNull=ZodNull;ZodNull.create=e=>new ZodNull({typeName:f.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments);this._any=true}_parse(e){return(0,n.OK)(e.data)}}t.ZodAny=ZodAny;ZodAny.create=e=>new ZodAny({typeName:f.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments);this._unknown=true}_parse(e){return(0,n.OK)(e.data)}}t.ZodUnknown=ZodUnknown;ZodUnknown.create=e=>new ZodUnknown({typeName:f.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.never,received:t.parsedType});return n.INVALID}}t.ZodNever=ZodNever;ZodNever.create=e=>new ZodNever({typeName:f.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.void,received:t.parsedType});return n.INVALID}return(0,n.OK)(e.data)}}t.ZodVoid=ZodVoid;ZodVoid.create=e=>new ZodVoid({typeName:f.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:s}=this._processInputParams(e);const r=this._def;if(t.parsedType!==o.ZodParsedType.array){(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.array,received:t.parsedType});return n.INVALID}if(r.exactLength!==null){const e=t.data.length>r.exactLength.value;const a=t.data.length<r.exactLength.value;if(e||a){(0,n.addIssueToContext)(t,{code:e?i.ZodIssueCode.too_big:i.ZodIssueCode.too_small,minimum:a?r.exactLength.value:undefined,maximum:e?r.exactLength.value:undefined,type:"array",inclusive:true,exact:true,message:r.exactLength.message});s.dirty()}}if(r.minLength!==null){if(t.data.length<r.minLength.value){(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.too_small,minimum:r.minLength.value,type:"array",inclusive:true,exact:false,message:r.minLength.message});s.dirty()}}if(r.maxLength!==null){if(t.data.length>r.maxLength.value){(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:true,exact:false,message:r.maxLength.message});s.dirty()}}if(t.common.async){return Promise.all([...t.data].map(((e,s)=>r.type._parseAsync(new ParseInputLazyPath(t,e,t.path,s))))).then((e=>n.ParseStatus.mergeArray(s,e)))}const a=[...t.data].map(((e,s)=>r.type._parseSync(new ParseInputLazyPath(t,e,t.path,s))));return n.ParseStatus.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:a.errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:a.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}t.ZodArray=ZodArray;ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:f.ZodArray,...processCreateParams(t)});var p;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(p=t.objectUtil||(t.objectUtil={}));function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=ZodOptional.create(deepPartialify(r))}return new ZodObject({...e._def,shape:()=>t})}else if(e instanceof ZodArray){return ZodArray.create(deepPartialify(e.element))}else if(e instanceof ZodOptional){return ZodOptional.create(deepPartialify(e.unwrap()))}else if(e instanceof ZodNullable){return ZodNullable.create(deepPartialify(e.unwrap()))}else if(e instanceof ZodTuple){return ZodTuple.create(e.items.map((e=>deepPartialify(e))))}else{return e}}class ZodObject extends ZodType{constructor(){super(...arguments);this._cached=null;this.nonstrict=this.passthrough;this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape();const t=o.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.object){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.object,received:t.parsedType});return n.INVALID}const{status:s,ctx:r}=this._processInputParams(e);const{shape:a,keys:d}=this._getCached();const u=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip")){for(const e in r.data){if(!d.includes(e)){u.push(e)}}}const c=[];for(const e of d){const t=a[e];const s=r.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if(e==="passthrough"){for(const e of u){c.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}})}}else if(e==="strict"){if(u.length>0){(0,n.addIssueToContext)(r,{code:i.ZodIssueCode.unrecognized_keys,keys:u});s.dirty()}}else if(e==="strip"){}else{throw new Error(`Internal ZodObject error: invalid unknownKeys value.`)}}else{const e=this._def.catchall;for(const t of u){const s=r.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(r,s,r.path,t)),alwaysSet:t in r.data})}}if(r.common.async){return Promise.resolve().then((async()=>{const e=[];for(const t of c){const s=await t.key;e.push({key:s,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>n.ParseStatus.mergeObjectSync(s,e)))}else{return n.ParseStatus.mergeObjectSync(s,c)}}get shape(){return this._def.shape()}strict(e){a.errorUtil.errToObj;return new ZodObject({...this._def,unknownKeys:"strict",...e!==undefined?{errorMap:(t,s)=>{var r,n,o,i;const d=(o=(n=(r=this._def).errorMap)===null||n===void 0?void 0:n.call(r,t,s).message)!==null&&o!==void 0?o:s.defaultError;if(t.code==="unrecognized_keys")return{message:(i=a.errorUtil.errToObj(e).message)!==null&&i!==void 0?i:d};return{message:d}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){const t=new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>p.mergeShapes(this._def.shape(),e._def.shape()),typeName:f.ZodObject});return t}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};o.util.objectKeys(e).forEach((s=>{if(e[s]&&this.shape[s]){t[s]=this.shape[s]}}));return new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};o.util.objectKeys(this.shape).forEach((s=>{if(!e[s]){t[s]=this.shape[s]}}));return new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};o.util.objectKeys(this.shape).forEach((s=>{const r=this.shape[s];if(e&&!e[s]){t[s]=r}else{t[s]=r.optional()}}));return new ZodObject({...this._def,shape:()=>t})}required(e){const t={};o.util.objectKeys(this.shape).forEach((s=>{if(e&&!e[s]){t[s]=this.shape[s]}else{const e=this.shape[s];let r=e;while(r instanceof ZodOptional){r=r._def.innerType}t[s]=r}}));return new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(o.util.objectKeys(this.shape))}}t.ZodObject=ZodObject;ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:f.ZodObject,...processCreateParams(t)});ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:f.ZodObject,...processCreateParams(t)});ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:f.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);const s=this._def.options;function handleResults(e){for(const t of e){if(t.result.status==="valid"){return t.result}}for(const s of e){if(s.result.status==="dirty"){t.common.issues.push(...s.ctx.common.issues);return s.result}}const s=e.map((e=>new i.ZodError(e.ctx.common.issues)));(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_union,unionErrors:s});return n.INVALID}if(t.common.async){return Promise.all(s.map((async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}}))).then(handleResults)}else{let e=undefined;const r=[];for(const a of s){const s={...t,common:{...t.common,issues:[]},parent:null};const n=a._parseSync({data:t.data,path:t.path,parent:s});if(n.status==="valid"){return n}else if(n.status==="dirty"&&!e){e={result:n,ctx:s}}if(s.common.issues.length){r.push(s.common.issues)}}if(e){t.common.issues.push(...e.ctx.common.issues);return e.result}const a=r.map((e=>new i.ZodError(e)));(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_union,unionErrors:a});return n.INVALID}}get options(){return this._def.options}}t.ZodUnion=ZodUnion;ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:f.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>{if(e instanceof ZodLazy){return getDiscriminator(e.schema)}else if(e instanceof ZodEffects){return getDiscriminator(e.innerType())}else if(e instanceof ZodLiteral){return[e.value]}else if(e instanceof ZodEnum){return e.options}else if(e instanceof ZodNativeEnum){return Object.keys(e.enum)}else if(e instanceof ZodDefault){return getDiscriminator(e._def.innerType)}else if(e instanceof ZodUndefined){return[undefined]}else if(e instanceof ZodNull){return[null]}else{return null}};class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.ZodParsedType.object){(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.object,received:t.parsedType});return n.INVALID}const s=this.discriminator;const r=t.data[s];const a=this.optionsMap.get(r);if(!a){(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]});return n.INVALID}if(t.common.async){return a._parseAsync({data:t.data,path:t.path,parent:t})}else{return a._parseSync({data:t.data,path:t.path,parent:t})}}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const r=new Map;for(const s of t){const t=getDiscriminator(s.shape[e]);if(!t){throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`)}for(const a of t){if(r.has(a)){throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`)}r.set(a,s)}}return new ZodDiscriminatedUnion({typeName:f.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...processCreateParams(s)})}}t.ZodDiscriminatedUnion=ZodDiscriminatedUnion;function mergeValues(e,t){const s=(0,o.getParsedType)(e);const r=(0,o.getParsedType)(t);if(e===t){return{valid:true,data:e}}else if(s===o.ZodParsedType.object&&r===o.ZodParsedType.object){const s=o.util.objectKeys(t);const r=o.util.objectKeys(e).filter((e=>s.indexOf(e)!==-1));const a={...e,...t};for(const s of r){const r=mergeValues(e[s],t[s]);if(!r.valid){return{valid:false}}a[s]=r.data}return{valid:true,data:a}}else if(s===o.ZodParsedType.array&&r===o.ZodParsedType.array){if(e.length!==t.length){return{valid:false}}const s=[];for(let r=0;r<e.length;r++){const a=e[r];const n=t[r];const o=mergeValues(a,n);if(!o.valid){return{valid:false}}s.push(o.data)}return{valid:true,data:s}}else if(s===o.ZodParsedType.date&&r===o.ZodParsedType.date&&+e===+t){return{valid:true,data:e}}else{return{valid:false}}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);const handleParsed=(e,r)=>{if((0,n.isAborted)(e)||(0,n.isAborted)(r)){return n.INVALID}const a=mergeValues(e.value,r.value);if(!a.valid){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.invalid_intersection_types});return n.INVALID}if((0,n.isDirty)(e)||(0,n.isDirty)(r)){t.dirty()}return{status:t.value,value:a.data}};if(s.common.async){return Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then((([e,t])=>handleParsed(e,t)))}else{return handleParsed(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}}t.ZodIntersection=ZodIntersection;ZodIntersection.create=(e,t,s)=>new ZodIntersection({left:e,right:t,typeName:f.ZodIntersection,...processCreateParams(s)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==o.ZodParsedType.array){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.array,received:s.parsedType});return n.INVALID}if(s.data.length<this._def.items.length){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"});return n.INVALID}const r=this._def.rest;if(!r&&s.data.length>this._def.items.length){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"});t.dirty()}const a=[...s.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;if(!r)return null;return r._parse(new ParseInputLazyPath(s,e,s.path,t))})).filter((e=>!!e));if(s.common.async){return Promise.all(a).then((e=>n.ParseStatus.mergeArray(t,e)))}else{return n.ParseStatus.mergeArray(t,a)}}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}t.ZodTuple=ZodTuple;ZodTuple.create=(e,t)=>{if(!Array.isArray(e)){throw new Error("You must pass an array of schemas to z.tuple([ ... ])")}return new ZodTuple({items:e,typeName:f.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==o.ZodParsedType.object){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.object,received:s.parsedType});return n.INVALID}const r=[];const a=this._def.keyType;const d=this._def.valueType;for(const e in s.data){r.push({key:a._parse(new ParseInputLazyPath(s,e,s.path,e)),value:d._parse(new ParseInputLazyPath(s,s.data[e],s.path,e))})}if(s.common.async){return n.ParseStatus.mergeObjectAsync(t,r)}else{return n.ParseStatus.mergeObjectSync(t,r)}}get element(){return this._def.valueType}static create(e,t,s){if(t instanceof ZodType){return new ZodRecord({keyType:e,valueType:t,typeName:f.ZodRecord,...processCreateParams(s)})}return new ZodRecord({keyType:ZodString.create(),valueType:e,typeName:f.ZodRecord,...processCreateParams(t)})}}t.ZodRecord=ZodRecord;class ZodMap extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==o.ZodParsedType.map){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.map,received:s.parsedType});return n.INVALID}const r=this._def.keyType;const a=this._def.valueType;const d=[...s.data.entries()].map((([e,t],n)=>({key:r._parse(new ParseInputLazyPath(s,e,s.path,[n,"key"])),value:a._parse(new ParseInputLazyPath(s,t,s.path,[n,"value"]))})));if(s.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const s of d){const r=await s.key;const a=await s.value;if(r.status==="aborted"||a.status==="aborted"){return n.INVALID}if(r.status==="dirty"||a.status==="dirty"){t.dirty()}e.set(r.value,a.value)}return{status:t.value,value:e}}))}else{const e=new Map;for(const s of d){const r=s.key;const a=s.value;if(r.status==="aborted"||a.status==="aborted"){return n.INVALID}if(r.status==="dirty"||a.status==="dirty"){t.dirty()}e.set(r.value,a.value)}return{status:t.value,value:e}}}}t.ZodMap=ZodMap;ZodMap.create=(e,t,s)=>new ZodMap({valueType:t,keyType:e,typeName:f.ZodMap,...processCreateParams(s)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==o.ZodParsedType.set){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.set,received:s.parsedType});return n.INVALID}const r=this._def;if(r.minSize!==null){if(s.data.size<r.minSize.value){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.too_small,minimum:r.minSize.value,type:"set",inclusive:true,exact:false,message:r.minSize.message});t.dirty()}}if(r.maxSize!==null){if(s.data.size>r.maxSize.value){(0,n.addIssueToContext)(s,{code:i.ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:true,exact:false,message:r.maxSize.message});t.dirty()}}const a=this._def.valueType;function finalizeSet(e){const s=new Set;for(const r of e){if(r.status==="aborted")return n.INVALID;if(r.status==="dirty")t.dirty();s.add(r.value)}return{status:t.value,value:s}}const d=[...s.data.values()].map(((e,t)=>a._parse(new ParseInputLazyPath(s,e,s.path,t))));if(s.common.async){return Promise.all(d).then((e=>finalizeSet(e)))}else{return finalizeSet(d)}}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:a.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=ZodSet;ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:f.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments);this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.ZodParsedType.function){(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.function,received:t.parsedType});return n.INVALID}function makeArgsIssue(e,s){return(0,n.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,r.getErrorMap)(),r.defaultErrorMap].filter((e=>!!e)),issueData:{code:i.ZodIssueCode.invalid_arguments,argumentsError:s}})}function makeReturnsIssue(e,s){return(0,n.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,r.getErrorMap)(),r.defaultErrorMap].filter((e=>!!e)),issueData:{code:i.ZodIssueCode.invalid_return_type,returnTypeError:s}})}const s={errorMap:t.common.contextualErrorMap};const a=t.data;if(this._def.returns instanceof ZodPromise){return(0,n.OK)((async(...e)=>{const t=new i.ZodError([]);const r=await this._def.args.parseAsync(e,s).catch((s=>{t.addIssue(makeArgsIssue(e,s));throw t}));const n=await a(...r);const o=await this._def.returns._def.type.parseAsync(n,s).catch((e=>{t.addIssue(makeReturnsIssue(n,e));throw t}));return o}))}else{return(0,n.OK)(((...e)=>{const t=this._def.args.safeParse(e,s);if(!t.success){throw new i.ZodError([makeArgsIssue(e,t.error)])}const r=a(...t.data);const n=this._def.returns.safeParse(r,s);if(!n.success){throw new i.ZodError([makeReturnsIssue(r,n.error)])}return n.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){const t=this.parse(e);return t}strictImplement(e){const t=this.parse(e);return t}static create(e,t,s){return new ZodFunction({args:e?e:ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:f.ZodFunction,...processCreateParams(s)})}}t.ZodFunction=ZodFunction;class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);const s=this._def.getter();return s._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=ZodLazy;ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:f.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{received:t.data,code:i.ZodIssueCode.invalid_literal,expected:this._def.value});return n.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}t.ZodLiteral=ZodLiteral;ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:f.ZodLiteral,...processCreateParams(t)});function createZodEnum(e,t){return new ZodEnum({values:e,typeName:f.ZodEnum,...processCreateParams(t)})}class ZodEnum extends ZodType{_parse(e){if(typeof e.data!=="string"){const t=this._getOrReturnCtx(e);const s=this._def.values;(0,n.addIssueToContext)(t,{expected:o.util.joinValues(s),received:t.parsedType,code:i.ZodIssueCode.invalid_type});return n.INVALID}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e);const s=this._def.values;(0,n.addIssueToContext)(t,{received:t.data,code:i.ZodIssueCode.invalid_enum_value,options:s});return n.INVALID}return(0,n.OK)(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){return ZodEnum.create(e)}exclude(e){return ZodEnum.create(this.options.filter((t=>!e.includes(t))))}}t.ZodEnum=ZodEnum;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(e){const t=o.util.getValidEnumValues(this._def.values);const s=this._getOrReturnCtx(e);if(s.parsedType!==o.ZodParsedType.string&&s.parsedType!==o.ZodParsedType.number){const e=o.util.objectValues(t);(0,n.addIssueToContext)(s,{expected:o.util.joinValues(e),received:s.parsedType,code:i.ZodIssueCode.invalid_type});return n.INVALID}if(t.indexOf(e.data)===-1){const e=o.util.objectValues(t);(0,n.addIssueToContext)(s,{received:s.data,code:i.ZodIssueCode.invalid_enum_value,options:e});return n.INVALID}return(0,n.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=ZodNativeEnum;ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:f.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.ZodParsedType.promise&&t.common.async===false){(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.promise,received:t.parsedType});return n.INVALID}const s=t.parsedType===o.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,n.OK)(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=ZodPromise;ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:f.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===f.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);const r=this._def.effect||null;if(r.type==="preprocess"){const e=r.transform(s.data);if(s.common.async){return Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:s.path,parent:s})))}else{return this._def.schema._parseSync({data:e,path:s.path,parent:s})}}const a={addIssue:e=>{(0,n.addIssueToContext)(s,e);if(e.fatal){t.abort()}else{t.dirty()}},get path(){return s.path}};a.addIssue=a.addIssue.bind(a);if(r.type==="refinement"){const executeRefinement=e=>{const t=r.refinement(e,a);if(s.common.async){return Promise.resolve(t)}if(t instanceof Promise){throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.")}return e};if(s.common.async===false){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(e.status==="aborted")return n.INVALID;if(e.status==="dirty")t.dirty();executeRefinement(e.value);return{status:t.value,value:e.value}}else{return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>{if(e.status==="aborted")return n.INVALID;if(e.status==="dirty")t.dirty();return executeRefinement(e.value).then((()=>({status:t.value,value:e.value})))}))}}if(r.type==="transform"){if(s.common.async===false){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!(0,n.isValid)(e))return e;const o=r.transform(e.value,a);if(o instanceof Promise){throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`)}return{status:t.value,value:o}}else{return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>{if(!(0,n.isValid)(e))return e;return Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e})))}))}}o.util.assertNever(r)}}t.ZodEffects=ZodEffects;t.ZodTransformer=ZodEffects;ZodEffects.create=(e,t,s)=>new ZodEffects({schema:e,typeName:f.ZodEffects,effect:t,...processCreateParams(s)});ZodEffects.createWithPreprocess=(e,t,s)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:f.ZodEffects,...processCreateParams(s)});class ZodOptional extends ZodType{_parse(e){const t=this._getType(e);if(t===o.ZodParsedType.undefined){return(0,n.OK)(undefined)}return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=ZodOptional;ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:f.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){const t=this._getType(e);if(t===o.ZodParsedType.null){return(0,n.OK)(null)}return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=ZodNullable;ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:f.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;if(t.parsedType===o.ZodParsedType.undefined){s=this._def.defaultValue()}return this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=ZodDefault;ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:f.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);const s=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});if((0,n.isAsync)(s)){return s.then((e=>({status:"valid",value:e.status==="valid"?e.value:this._def.catchValue()})))}else{return{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue()}}}removeCatch(){return this._def.innerType}}t.ZodCatch=ZodCatch;ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:f.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){const t=this._getType(e);if(t!==o.ZodParsedType.nan){const t=this._getOrReturnCtx(e);(0,n.addIssueToContext)(t,{code:i.ZodIssueCode.invalid_type,expected:o.ZodParsedType.nan,received:t.parsedType});return n.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=ZodNaN;ZodNaN.create=e=>new ZodNaN({typeName:f.ZodNaN,...processCreateParams(e)});t.BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);const s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=ZodBranded;class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async){const handleAsync=async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});if(e.status==="aborted")return n.INVALID;if(e.status==="dirty"){t.dirty();return(0,n.DIRTY)(e.value)}else{return this._def.out._parseAsync({data:e.value,path:s.path,parent:s})}};return handleAsync()}else{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});if(e.status==="aborted")return n.INVALID;if(e.status==="dirty"){t.dirty();return{status:"dirty",value:e.value}}else{return this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:f.ZodPipeline})}}t.ZodPipeline=ZodPipeline;const custom=(e,t={},s)=>{if(e)return ZodAny.create().superRefine(((r,a)=>{if(!e(r)){const e=typeof t==="function"?t(r):t;const n=typeof e==="string"?{message:e}:e;a.addIssue({code:"custom",...n,fatal:s})}}));return ZodAny.create()};t.custom=custom;t.late={object:ZodObject.lazycreate};var f;(function(e){e["ZodString"]="ZodString";e["ZodNumber"]="ZodNumber";e["ZodNaN"]="ZodNaN";e["ZodBigInt"]="ZodBigInt";e["ZodBoolean"]="ZodBoolean";e["ZodDate"]="ZodDate";e["ZodSymbol"]="ZodSymbol";e["ZodUndefined"]="ZodUndefined";e["ZodNull"]="ZodNull";e["ZodAny"]="ZodAny";e["ZodUnknown"]="ZodUnknown";e["ZodNever"]="ZodNever";e["ZodVoid"]="ZodVoid";e["ZodArray"]="ZodArray";e["ZodObject"]="ZodObject";e["ZodUnion"]="ZodUnion";e["ZodDiscriminatedUnion"]="ZodDiscriminatedUnion";e["ZodIntersection"]="ZodIntersection";e["ZodTuple"]="ZodTuple";e["ZodRecord"]="ZodRecord";e["ZodMap"]="ZodMap";e["ZodSet"]="ZodSet";e["ZodFunction"]="ZodFunction";e["ZodLazy"]="ZodLazy";e["ZodLiteral"]="ZodLiteral";e["ZodEnum"]="ZodEnum";e["ZodEffects"]="ZodEffects";e["ZodNativeEnum"]="ZodNativeEnum";e["ZodOptional"]="ZodOptional";e["ZodNullable"]="ZodNullable";e["ZodDefault"]="ZodDefault";e["ZodCatch"]="ZodCatch";e["ZodPromise"]="ZodPromise";e["ZodBranded"]="ZodBranded";e["ZodPipeline"]="ZodPipeline"})(f=t.ZodFirstPartyTypeKind||(t.ZodFirstPartyTypeKind={}));class Class{constructor(...e){}}const instanceOfType=(e,s={message:`Input not instance of ${e.name}`})=>(0,t.custom)((t=>t instanceof e),s,true);t["instanceof"]=instanceOfType;const h=ZodString.create;t.string=h;const m=ZodNumber.create;t.number=m;const y=ZodNaN.create;t.nan=y;const Z=ZodBigInt.create;t.bigint=Z;const _=ZodBoolean.create;t.boolean=_;const v=ZodDate.create;t.date=v;const g=ZodSymbol.create;t.symbol=g;const I=ZodUndefined.create;t.undefined=I;const T=ZodNull.create;t["null"]=T;const x=ZodAny.create;t.any=x;const b=ZodUnknown.create;t.unknown=b;const C=ZodNever.create;t.never=C;const P=ZodVoid.create;t["void"]=P;const k=ZodArray.create;t.array=k;const N=ZodObject.create;t.object=N;const w=ZodObject.strictCreate;t.strictObject=w;const O=ZodUnion.create;t.union=O;const E=ZodDiscriminatedUnion.create;t.discriminatedUnion=E;const S=ZodIntersection.create;t.intersection=S;const A=ZodTuple.create;t.tuple=A;const j=ZodRecord.create;t.record=j;const D=ZodMap.create;t.map=D;const L=ZodSet.create;t.set=L;const U=ZodFunction.create;t["function"]=U;const V=ZodLazy.create;t.lazy=V;const M=ZodLiteral.create;t.literal=M;const R=ZodEnum.create;t["enum"]=R;const z=ZodNativeEnum.create;t.nativeEnum=z;const $=ZodPromise.create;t.promise=$;const K=ZodEffects.create;t.effect=K;t.transformer=K;const B=ZodOptional.create;t.optional=B;const F=ZodNullable.create;t.nullable=F;const q=ZodEffects.createWithPreprocess;t.preprocess=q;const W=ZodPipeline.create;t.pipeline=W;const ostring=()=>h().optional();t.ostring=ostring;const onumber=()=>m().optional();t.onumber=onumber;const oboolean=()=>_().optional();t.oboolean=oboolean;t.coerce={string:e=>ZodString.create({...e,coerce:true}),number:e=>ZodNumber.create({...e,coerce:true}),boolean:e=>ZodBoolean.create({...e,coerce:true}),bigint:e=>ZodBigInt.create({...e,coerce:true}),date:e=>ZodDate.create({...e,coerce:true})};t.NEVER=n.INVALID}};var t={};function __nccwpck_require__(s){var r=t[s];if(r!==undefined){return r.exports}var a=t[s]={exports:{}};var n=true;try{e[s].call(a.exports,a,a.exports,__nccwpck_require__);n=false}finally{if(n)delete t[s]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s=__nccwpck_require__(918);module.exports=s})();
@@ -0,0 +1,159 @@
1
+ import type { TypeOf, ZodType } from ".";
2
+ import { Primitive } from "./helpers/typeAliases";
3
+ import { util, ZodParsedType } from "./helpers/util";
4
+ declare type allKeys<T> = T extends any ? keyof T : never;
5
+ export declare type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
6
+ export declare type typeToFlattenedError<T, U = string> = {
7
+ formErrors: U[];
8
+ fieldErrors: {
9
+ [P in allKeys<T>]?: U[];
10
+ };
11
+ };
12
+ export declare const ZodIssueCode: {
13
+ invalid_type: "invalid_type";
14
+ invalid_literal: "invalid_literal";
15
+ custom: "custom";
16
+ invalid_union: "invalid_union";
17
+ invalid_union_discriminator: "invalid_union_discriminator";
18
+ invalid_enum_value: "invalid_enum_value";
19
+ unrecognized_keys: "unrecognized_keys";
20
+ invalid_arguments: "invalid_arguments";
21
+ invalid_return_type: "invalid_return_type";
22
+ invalid_date: "invalid_date";
23
+ invalid_string: "invalid_string";
24
+ too_small: "too_small";
25
+ too_big: "too_big";
26
+ invalid_intersection_types: "invalid_intersection_types";
27
+ not_multiple_of: "not_multiple_of";
28
+ not_finite: "not_finite";
29
+ };
30
+ export declare type ZodIssueCode = keyof typeof ZodIssueCode;
31
+ export declare type ZodIssueBase = {
32
+ path: (string | number)[];
33
+ message?: string;
34
+ };
35
+ export interface ZodInvalidTypeIssue extends ZodIssueBase {
36
+ code: typeof ZodIssueCode.invalid_type;
37
+ expected: ZodParsedType;
38
+ received: ZodParsedType;
39
+ }
40
+ export interface ZodInvalidLiteralIssue extends ZodIssueBase {
41
+ code: typeof ZodIssueCode.invalid_literal;
42
+ expected: unknown;
43
+ received: unknown;
44
+ }
45
+ export interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
46
+ code: typeof ZodIssueCode.unrecognized_keys;
47
+ keys: string[];
48
+ }
49
+ export interface ZodInvalidUnionIssue extends ZodIssueBase {
50
+ code: typeof ZodIssueCode.invalid_union;
51
+ unionErrors: ZodError[];
52
+ }
53
+ export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
54
+ code: typeof ZodIssueCode.invalid_union_discriminator;
55
+ options: Primitive[];
56
+ }
57
+ export interface ZodInvalidEnumValueIssue extends ZodIssueBase {
58
+ received: string | number;
59
+ code: typeof ZodIssueCode.invalid_enum_value;
60
+ options: (string | number)[];
61
+ }
62
+ export interface ZodInvalidArgumentsIssue extends ZodIssueBase {
63
+ code: typeof ZodIssueCode.invalid_arguments;
64
+ argumentsError: ZodError;
65
+ }
66
+ export interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
67
+ code: typeof ZodIssueCode.invalid_return_type;
68
+ returnTypeError: ZodError;
69
+ }
70
+ export interface ZodInvalidDateIssue extends ZodIssueBase {
71
+ code: typeof ZodIssueCode.invalid_date;
72
+ }
73
+ export declare type StringValidation = "email" | "url" | "uuid" | "regex" | "cuid" | "cuid2" | "datetime" | {
74
+ startsWith: string;
75
+ } | {
76
+ endsWith: string;
77
+ };
78
+ export interface ZodInvalidStringIssue extends ZodIssueBase {
79
+ code: typeof ZodIssueCode.invalid_string;
80
+ validation: StringValidation;
81
+ }
82
+ export interface ZodTooSmallIssue extends ZodIssueBase {
83
+ code: typeof ZodIssueCode.too_small;
84
+ minimum: number;
85
+ inclusive: boolean;
86
+ exact?: boolean;
87
+ type: "array" | "string" | "number" | "set" | "date";
88
+ }
89
+ export interface ZodTooBigIssue extends ZodIssueBase {
90
+ code: typeof ZodIssueCode.too_big;
91
+ maximum: number;
92
+ inclusive: boolean;
93
+ exact?: boolean;
94
+ type: "array" | "string" | "number" | "set" | "date";
95
+ }
96
+ export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
97
+ code: typeof ZodIssueCode.invalid_intersection_types;
98
+ }
99
+ export interface ZodNotMultipleOfIssue extends ZodIssueBase {
100
+ code: typeof ZodIssueCode.not_multiple_of;
101
+ multipleOf: number;
102
+ }
103
+ export interface ZodNotFiniteIssue extends ZodIssueBase {
104
+ code: typeof ZodIssueCode.not_finite;
105
+ }
106
+ export interface ZodCustomIssue extends ZodIssueBase {
107
+ code: typeof ZodIssueCode.custom;
108
+ params?: {
109
+ [k: string]: any;
110
+ };
111
+ }
112
+ export declare type DenormalizedError = {
113
+ [k: string]: DenormalizedError | string[];
114
+ };
115
+ export declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
116
+ export declare type ZodIssue = ZodIssueOptionalMessage & {
117
+ fatal?: boolean;
118
+ message: string;
119
+ };
120
+ export declare const quotelessJson: (obj: any) => string;
121
+ export declare type ZodFormattedError<T, U = string> = {
122
+ _errors: U[];
123
+ } & (NonNullable<T> extends [any, ...any[]] ? {
124
+ [K in keyof NonNullable<T>]?: ZodFormattedError<NonNullable<T>[K], U>;
125
+ } : NonNullable<T> extends any[] ? {
126
+ [k: number]: ZodFormattedError<NonNullable<T>[number], U>;
127
+ } : NonNullable<T> extends object ? {
128
+ [K in keyof NonNullable<T>]?: ZodFormattedError<NonNullable<T>[K], U>;
129
+ } : unknown);
130
+ export declare type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
131
+ export declare class ZodError<T = any> extends Error {
132
+ issues: ZodIssue[];
133
+ get errors(): ZodIssue[];
134
+ constructor(issues: ZodIssue[]);
135
+ format(): ZodFormattedError<T>;
136
+ format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
137
+ static create: (issues: ZodIssue[]) => ZodError<any>;
138
+ toString(): string;
139
+ get message(): string;
140
+ get isEmpty(): boolean;
141
+ addIssue: (sub: ZodIssue) => void;
142
+ addIssues: (subs?: ZodIssue[]) => void;
143
+ flatten(): typeToFlattenedError<T>;
144
+ flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
145
+ get formErrors(): typeToFlattenedError<T, string>;
146
+ }
147
+ declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
148
+ export declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
149
+ path?: (string | number)[];
150
+ fatal?: boolean;
151
+ };
152
+ export declare type ErrorMapCtx = {
153
+ defaultError: string;
154
+ data: any;
155
+ };
156
+ export declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
157
+ message: string;
158
+ };
159
+ export {};
@@ -0,0 +1,17 @@
1
+ export declare class Mocker {
2
+ pick: (...args: any[]) => any;
3
+ get string(): string;
4
+ get number(): number;
5
+ get bigint(): bigint;
6
+ get boolean(): boolean;
7
+ get date(): Date;
8
+ get symbol(): symbol;
9
+ get null(): null;
10
+ get undefined(): undefined;
11
+ get stringOptional(): any;
12
+ get stringNullable(): any;
13
+ get numberOptional(): any;
14
+ get numberNullable(): any;
15
+ get booleanOptional(): any;
16
+ get booleanNullable(): any;
17
+ }
@@ -0,0 +1,5 @@
1
+ import Benchmark from "benchmark";
2
+ declare const _default: {
3
+ suites: Benchmark.Suite[];
4
+ };
5
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import Benchmark from "benchmark";
2
+ declare const _default: {
3
+ suites: Benchmark.Suite[];
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import Benchmark from "benchmark";
2
+ declare const _default: {
3
+ suites: Benchmark.Suite[];
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import Benchmark from "benchmark";
2
+ declare const _default: {
3
+ suites: Benchmark.Suite[];
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import Benchmark from "benchmark";
2
+ declare const _default: {
3
+ suites: Benchmark.Suite[];
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import Benchmark from "benchmark";
2
+ declare const _default: {
3
+ suites: Benchmark.Suite[];
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import defaultErrorMap from "./locales/en";
2
+ import type { ZodErrorMap } from "./ZodError";
3
+ export { defaultErrorMap };
4
+ export declare function setErrorMap(map: ZodErrorMap): void;
5
+ export declare function getErrorMap(): ZodErrorMap;
@@ -0,0 +1,6 @@
1
+ export * from "./errors";
2
+ export * from "./helpers/parseUtil";
3
+ export * from "./helpers/typeAliases";
4
+ export * from "./helpers/util";
5
+ export * from "./types";
6
+ export * from "./ZodError";
@@ -0,0 +1,8 @@
1
+ export declare namespace enumUtil {
2
+ type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
3
+ type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
4
+ type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
5
+ type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
6
+ export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
7
+ export {};
8
+ }
@@ -0,0 +1,9 @@
1
+ export declare namespace errorUtil {
2
+ type ErrMessage = string | {
3
+ message?: string;
4
+ };
5
+ const errToObj: (message?: ErrMessage | undefined) => {
6
+ message?: string | undefined;
7
+ };
8
+ const toString: (message?: ErrMessage | undefined) => string | undefined;
9
+ }
@@ -0,0 +1,78 @@
1
+ import type { IssueData, ZodErrorMap, ZodIssue } from "../ZodError";
2
+ import type { ZodParsedType } from "./util";
3
+ export declare const makeIssue: (params: {
4
+ data: any;
5
+ path: (string | number)[];
6
+ errorMaps: ZodErrorMap[];
7
+ issueData: IssueData;
8
+ }) => ZodIssue;
9
+ export declare type ParseParams = {
10
+ path: (string | number)[];
11
+ errorMap: ZodErrorMap;
12
+ async: boolean;
13
+ };
14
+ export declare type ParsePathComponent = string | number;
15
+ export declare type ParsePath = ParsePathComponent[];
16
+ export declare const EMPTY_PATH: ParsePath;
17
+ export interface ParseContext {
18
+ readonly common: {
19
+ readonly issues: ZodIssue[];
20
+ readonly contextualErrorMap?: ZodErrorMap;
21
+ readonly async: boolean;
22
+ };
23
+ readonly path: ParsePath;
24
+ readonly schemaErrorMap?: ZodErrorMap;
25
+ readonly parent: ParseContext | null;
26
+ readonly data: any;
27
+ readonly parsedType: ZodParsedType;
28
+ }
29
+ export declare type ParseInput = {
30
+ data: any;
31
+ path: (string | number)[];
32
+ parent: ParseContext;
33
+ };
34
+ export declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
35
+ export declare type ObjectPair = {
36
+ key: SyncParseReturnType<any>;
37
+ value: SyncParseReturnType<any>;
38
+ };
39
+ export declare class ParseStatus {
40
+ value: "aborted" | "dirty" | "valid";
41
+ dirty(): void;
42
+ abort(): void;
43
+ static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
44
+ static mergeObjectAsync(status: ParseStatus, pairs: {
45
+ key: ParseReturnType<any>;
46
+ value: ParseReturnType<any>;
47
+ }[]): Promise<SyncParseReturnType<any>>;
48
+ static mergeObjectSync(status: ParseStatus, pairs: {
49
+ key: SyncParseReturnType<any>;
50
+ value: SyncParseReturnType<any>;
51
+ alwaysSet?: boolean;
52
+ }[]): SyncParseReturnType;
53
+ }
54
+ export interface ParseResult {
55
+ status: "aborted" | "dirty" | "valid";
56
+ data: any;
57
+ }
58
+ export declare type INVALID = {
59
+ status: "aborted";
60
+ };
61
+ export declare const INVALID: INVALID;
62
+ export declare type DIRTY<T> = {
63
+ status: "dirty";
64
+ value: T;
65
+ };
66
+ export declare const DIRTY: <T>(value: T) => DIRTY<T>;
67
+ export declare type OK<T> = {
68
+ status: "valid";
69
+ value: T;
70
+ };
71
+ export declare const OK: <T>(value: T) => OK<T>;
72
+ export declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
73
+ export declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
74
+ export declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
75
+ export declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
76
+ export declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
77
+ export declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
78
+ export declare const isAsync: <T>(x: ParseReturnType<T>) => x is AsyncParseReturnType<T>;
@@ -0,0 +1,8 @@
1
+ import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodTuple, ZodTupleItems, ZodTypeAny } from "../index";
2
+ export declare namespace partialUtil {
3
+ type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<infer Shape, infer Params, infer Catchall> ? ZodObject<{
4
+ [k in keyof Shape]: ZodOptional<DeepPartial<Shape[k]>>;
5
+ }, Params, Catchall> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
6
+ [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
7
+ } extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
8
+ }
@@ -0,0 +1,2 @@
1
+ export declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;
2
+ export declare type Scalars = Primitive | Primitive[];
@@ -0,0 +1,47 @@
1
+ export declare namespace util {
2
+ type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
3
+ export const assertEqual: <A, B>(val: AssertEqual<A, B>) => AssertEqual<A, B>;
4
+ export function assertIs<T>(_arg: T): void;
5
+ export function assertNever(_x: never): never;
6
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
7
+ export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
8
+ export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
9
+ export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
10
+ export const getValidEnumValues: (obj: any) => any[];
11
+ export const objectValues: (obj: any) => any[];
12
+ export const objectKeys: ObjectConstructor["keys"];
13
+ export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
14
+ export type identity<T> = T;
15
+ export type flatten<T> = identity<{
16
+ [k in keyof T]: T[k];
17
+ }>;
18
+ export type noUndefined<T> = T extends undefined ? never : T;
19
+ export const isInteger: NumberConstructor["isInteger"];
20
+ export function joinValues<T extends any[]>(array: T, separator?: string): string;
21
+ export const jsonStringifyReplacer: (_: string, value: any) => any;
22
+ export {};
23
+ }
24
+ export declare const ZodParsedType: {
25
+ function: "function";
26
+ number: "number";
27
+ string: "string";
28
+ nan: "nan";
29
+ integer: "integer";
30
+ float: "float";
31
+ boolean: "boolean";
32
+ date: "date";
33
+ bigint: "bigint";
34
+ symbol: "symbol";
35
+ undefined: "undefined";
36
+ null: "null";
37
+ array: "array";
38
+ object: "object";
39
+ unknown: "unknown";
40
+ promise: "promise";
41
+ void: "void";
42
+ never: "never";
43
+ map: "map";
44
+ set: "set";
45
+ };
46
+ export declare type ZodParsedType = keyof typeof ZodParsedType;
47
+ export declare const getParsedType: (data: any) => ZodParsedType;
@@ -0,0 +1,4 @@
1
+ import * as mod from "./external";
2
+ export * from "./external";
3
+ export { mod as z };
4
+ export default mod;
@@ -0,0 +1,3 @@
1
+ import { ZodErrorMap } from "../ZodError";
2
+ declare const errorMap: ZodErrorMap;
3
+ export default errorMap;