@bylqwjc/media-editor-server 1.0.10

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 (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/dist/adapters/express.cjs +1 -0
  4. package/dist/adapters/express.d.ts +30 -0
  5. package/dist/adapters/express.js +1 -0
  6. package/dist/adapters/web.cjs +1 -0
  7. package/dist/adapters/web.d.ts +15 -0
  8. package/dist/adapters/web.js +1 -0
  9. package/dist/handler-DL4Inp7o.d.ts +47 -0
  10. package/dist/index.cjs +4 -0
  11. package/dist/index.d.ts +59 -0
  12. package/dist/index.js +4 -0
  13. package/node_modules/@media-editor/core/LICENSE +21 -0
  14. package/node_modules/@media-editor/core/README.md +14 -0
  15. package/node_modules/@media-editor/core/dist/browser.cjs +1 -0
  16. package/node_modules/@media-editor/core/dist/browser.d.ts +100 -0
  17. package/node_modules/@media-editor/core/dist/browser.js +3 -0
  18. package/node_modules/@media-editor/core/dist/chunk-MGKYVYOH.js +1 -0
  19. package/node_modules/@media-editor/core/dist/chunk-USY6UDGL.js +1 -0
  20. package/node_modules/@media-editor/core/dist/chunk-XCBM7P7N.js +1 -0
  21. package/node_modules/@media-editor/core/dist/engine.cjs +1 -0
  22. package/node_modules/@media-editor/core/dist/engine.d.ts +359 -0
  23. package/node_modules/@media-editor/core/dist/engine.js +1 -0
  24. package/node_modules/@media-editor/core/dist/filerobot.cjs +1 -0
  25. package/node_modules/@media-editor/core/dist/filerobot.d.ts +88 -0
  26. package/node_modules/@media-editor/core/dist/filerobot.js +1 -0
  27. package/node_modules/@media-editor/core/dist/index.cjs +1 -0
  28. package/node_modules/@media-editor/core/dist/index.d.ts +264 -0
  29. package/node_modules/@media-editor/core/dist/index.js +1 -0
  30. package/node_modules/@media-editor/core/dist/platform-presets-B-o4C6uY.d.ts +80 -0
  31. package/node_modules/@media-editor/core/dist/state-B85vkf7_.d.ts +1027 -0
  32. package/node_modules/@media-editor/core/node_modules/zod/LICENSE +21 -0
  33. package/node_modules/@media-editor/core/node_modules/zod/README.md +208 -0
  34. package/node_modules/@media-editor/core/node_modules/zod/index.cjs +1 -0
  35. package/node_modules/@media-editor/core/node_modules/zod/index.d.cts +4 -0
  36. package/node_modules/@media-editor/core/node_modules/zod/index.js +1 -0
  37. package/node_modules/@media-editor/core/node_modules/zod/package.json +76 -0
  38. package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.cjs +1 -0
  39. package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.d.cts +164 -0
  40. package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.js +1 -0
  41. package/node_modules/@media-editor/core/node_modules/zod/v3/errors.cjs +1 -0
  42. package/node_modules/@media-editor/core/node_modules/zod/v3/errors.d.cts +5 -0
  43. package/node_modules/@media-editor/core/node_modules/zod/v3/errors.js +1 -0
  44. package/node_modules/@media-editor/core/node_modules/zod/v3/external.cjs +1 -0
  45. package/node_modules/@media-editor/core/node_modules/zod/v3/external.d.cts +6 -0
  46. package/node_modules/@media-editor/core/node_modules/zod/v3/external.js +1 -0
  47. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.cjs +1 -0
  48. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  49. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.js +0 -0
  50. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.cjs +1 -0
  51. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  52. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.js +1 -0
  53. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.cjs +1 -0
  54. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  55. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.js +1 -0
  56. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.cjs +1 -0
  57. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  58. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.js +0 -0
  59. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.cjs +1 -0
  60. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  61. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.js +0 -0
  62. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.cjs +1 -0
  63. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.d.cts +85 -0
  64. package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.js +1 -0
  65. package/node_modules/@media-editor/core/node_modules/zod/v3/index.cjs +1 -0
  66. package/node_modules/@media-editor/core/node_modules/zod/v3/index.d.cts +4 -0
  67. package/node_modules/@media-editor/core/node_modules/zod/v3/index.js +1 -0
  68. package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.cjs +1 -0
  69. package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.d.cts +3 -0
  70. package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.js +1 -0
  71. package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.cjs +1 -0
  72. package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.d.cts +102 -0
  73. package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.js +0 -0
  74. package/node_modules/@media-editor/core/node_modules/zod/v3/types.cjs +1 -0
  75. package/node_modules/@media-editor/core/node_modules/zod/v3/types.d.cts +1031 -0
  76. package/node_modules/@media-editor/core/node_modules/zod/v3/types.js +1 -0
  77. package/node_modules/@media-editor/core/package.json +42 -0
  78. package/package.json +43 -0
@@ -0,0 +1,8 @@
1
+ import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from "../types.cjs";
2
+ export declare namespace partialUtil {
3
+ type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
4
+ [k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
5
+ }, T["_def"]["unknownKeys"], T["_def"]["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 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,2 @@
1
+ export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
2
+ export type Scalars = Primitive | Primitive[];
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getParsedType=exports.ZodParsedType=exports.objectUtil=exports.util=void 0;var u;(function(r){r.assertEqual=e=>{};function o(e){}r.assertIs=o;function i(e){throw new Error}r.assertNever=i,r.arrayToEnum=e=>{const n={};for(const t of e)n[t]=t;return n},r.getValidEnumValues=e=>{const n=r.objectKeys(e).filter(s=>typeof e[e[s]]!="number"),t={};for(const s of n)t[s]=e[s];return r.objectValues(t)},r.objectValues=e=>r.objectKeys(e).map(function(n){return e[n]}),r.objectKeys=typeof Object.keys=="function"?e=>Object.keys(e):e=>{const n=[];for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n},r.find=(e,n)=>{for(const t of e)if(n(t))return t},r.isInteger=typeof Number.isInteger=="function"?e=>Number.isInteger(e):e=>typeof e=="number"&&Number.isFinite(e)&&Math.floor(e)===e;function a(e,n=" | "){return e.map(t=>typeof t=="string"?`'${t}'`:t).join(n)}r.joinValues=a,r.jsonStringifyReplacer=(e,n)=>typeof n=="bigint"?n.toString():n})(u||(exports.util=u={}));var f;(function(r){r.mergeShapes=(o,i)=>({...o,...i})})(f||(exports.objectUtil=f={})),exports.ZodParsedType=u.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const c=r=>{switch(typeof r){case"undefined":return exports.ZodParsedType.undefined;case"string":return exports.ZodParsedType.string;case"number":return Number.isNaN(r)?exports.ZodParsedType.nan:exports.ZodParsedType.number;case"boolean":return exports.ZodParsedType.boolean;case"function":return exports.ZodParsedType.function;case"bigint":return exports.ZodParsedType.bigint;case"symbol":return exports.ZodParsedType.symbol;case"object":return Array.isArray(r)?exports.ZodParsedType.array:r===null?exports.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?exports.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?exports.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?exports.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?exports.ZodParsedType.date:exports.ZodParsedType.object;default:return exports.ZodParsedType.unknown}};exports.getParsedType=c;
@@ -0,0 +1,85 @@
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 type isAny<T> = 0 extends 1 & T ? true : false;
4
+ export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
5
+ export function assertIs<T>(_arg: T): void;
6
+ export function assertNever(_x: never): never;
7
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
8
+ export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
9
+ export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
10
+ export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
11
+ export type InexactPartial<T> = {
12
+ [k in keyof T]?: T[k] | undefined;
13
+ };
14
+ export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
15
+ export const getValidEnumValues: (obj: any) => any[];
16
+ export const objectValues: (obj: any) => any[];
17
+ export const objectKeys: ObjectConstructor["keys"];
18
+ export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
19
+ export type identity<T> = objectUtil.identity<T>;
20
+ export type flatten<T> = objectUtil.flatten<T>;
21
+ export type noUndefined<T> = T extends undefined ? never : T;
22
+ export const isInteger: NumberConstructor["isInteger"];
23
+ export function joinValues<T extends any[]>(array: T, separator?: string): string;
24
+ export const jsonStringifyReplacer: (_: string, value: any) => any;
25
+ export {};
26
+ }
27
+ export declare namespace objectUtil {
28
+ export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
29
+ [k in Exclude<keyof U, keyof V>]: U[k];
30
+ } & V;
31
+ type optionalKeys<T extends object> = {
32
+ [k in keyof T]: undefined extends T[k] ? k : never;
33
+ }[keyof T];
34
+ type requiredKeys<T extends object> = {
35
+ [k in keyof T]: undefined extends T[k] ? never : k;
36
+ }[keyof T];
37
+ export type addQuestionMarks<T extends object, _O = any> = {
38
+ [K in requiredKeys<T>]: T[K];
39
+ } & {
40
+ [K in optionalKeys<T>]?: T[K];
41
+ } & {
42
+ [k in keyof T]?: unknown;
43
+ };
44
+ export type identity<T> = T;
45
+ export type flatten<T> = identity<{
46
+ [k in keyof T]: T[k];
47
+ }>;
48
+ export type noNeverKeys<T> = {
49
+ [k in keyof T]: [T[k]] extends [never] ? never : k;
50
+ }[keyof T];
51
+ export type noNever<T> = identity<{
52
+ [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
53
+ }>;
54
+ export const mergeShapes: <U, T>(first: U, second: T) => T & U;
55
+ export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
56
+ [K in keyof A as K extends keyof B ? never : K]: A[K];
57
+ } & {
58
+ [K in keyof B]: B[K];
59
+ };
60
+ export {};
61
+ }
62
+ export declare const ZodParsedType: {
63
+ string: "string";
64
+ nan: "nan";
65
+ number: "number";
66
+ integer: "integer";
67
+ float: "float";
68
+ boolean: "boolean";
69
+ date: "date";
70
+ bigint: "bigint";
71
+ symbol: "symbol";
72
+ function: "function";
73
+ undefined: "undefined";
74
+ null: "null";
75
+ array: "array";
76
+ object: "object";
77
+ unknown: "unknown";
78
+ promise: "promise";
79
+ void: "void";
80
+ never: "never";
81
+ map: "map";
82
+ set: "set";
83
+ };
84
+ export type ZodParsedType = keyof typeof ZodParsedType;
85
+ export declare const getParsedType: (data: any) => ZodParsedType;
@@ -0,0 +1 @@
1
+ var u;(function(n){n.assertEqual=e=>{};function s(e){}n.assertIs=s;function f(e){throw new Error}n.assertNever=f,n.arrayToEnum=e=>{const r={};for(const o of e)r[o]=o;return r},n.getValidEnumValues=e=>{const r=n.objectKeys(e).filter(i=>typeof e[e[i]]!="number"),o={};for(const i of r)o[i]=e[i];return n.objectValues(o)},n.objectValues=e=>n.objectKeys(e).map(function(r){return e[r]}),n.objectKeys=typeof Object.keys=="function"?e=>Object.keys(e):e=>{const r=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.push(o);return r},n.find=(e,r)=>{for(const o of e)if(r(o))return o},n.isInteger=typeof Number.isInteger=="function"?e=>Number.isInteger(e):e=>typeof e=="number"&&Number.isFinite(e)&&Math.floor(e)===e;function a(e,r=" | "){return e.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}n.joinValues=a,n.jsonStringifyReplacer=(e,r)=>typeof r=="bigint"?r.toString():r})(u||(u={}));var c;(function(n){n.mergeShapes=(s,f)=>({...s,...f})})(c||(c={}));const t=u.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),y=n=>{switch(typeof n){case"undefined":return t.undefined;case"string":return t.string;case"number":return Number.isNaN(n)?t.nan:t.number;case"boolean":return t.boolean;case"function":return t.function;case"bigint":return t.bigint;case"symbol":return t.symbol;case"object":return Array.isArray(n)?t.array:n===null?t.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?t.promise:typeof Map<"u"&&n instanceof Map?t.map:typeof Set<"u"&&n instanceof Set?t.set:typeof Date<"u"&&n instanceof Date?t.date:t.object;default:return t.unknown}};export{t as ZodParsedType,y as getParsedType,c as objectUtil,u as util};
@@ -0,0 +1 @@
1
+ "use strict";var u=exports&&exports.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),f=exports&&exports.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),c=exports&&exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&u(t,e,r);return f(t,e),t},l=exports&&exports.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&u(t,e,r)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.z=void 0;const a=c(require("./external.cjs"));exports.z=a,l(require("./external.cjs"),exports),exports.default=a;
@@ -0,0 +1,4 @@
1
+ import * as z from "./external.cjs";
2
+ export * from "./external.cjs";
3
+ export { z };
4
+ export default z;
@@ -0,0 +1 @@
1
+ import*as o from"./external.js";export*from"./external.js";var r=o;export{r as default,o as z};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const a=require("../ZodError.cjs"),n=require("../helpers/util.cjs"),l=(e,i)=>{let t;switch(e.code){case a.ZodIssueCode.invalid_type:e.received===n.ZodParsedType.undefined?t="Required":t=`Expected ${e.expected}, received ${e.received}`;break;case a.ZodIssueCode.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(e.expected,n.util.jsonStringifyReplacer)}`;break;case a.ZodIssueCode.unrecognized_keys:t=`Unrecognized key(s) in object: ${n.util.joinValues(e.keys,", ")}`;break;case a.ZodIssueCode.invalid_union:t="Invalid input";break;case a.ZodIssueCode.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${n.util.joinValues(e.options)}`;break;case a.ZodIssueCode.invalid_enum_value:t=`Invalid enum value. Expected ${n.util.joinValues(e.options)}, received '${e.received}'`;break;case a.ZodIssueCode.invalid_arguments:t="Invalid function arguments";break;case a.ZodIssueCode.invalid_return_type:t="Invalid function return type";break;case a.ZodIssueCode.invalid_date:t="Invalid date";break;case a.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(t=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?t=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?t=`Invalid input: must end with "${e.validation.endsWith}"`:n.util.assertNever(e.validation):e.validation!=="regex"?t=`Invalid ${e.validation}`:t="Invalid";break;case a.ZodIssueCode.too_small:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?t=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:t="Invalid input";break;case a.ZodIssueCode.too_big:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?t=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:t="Invalid input";break;case a.ZodIssueCode.custom:t="Invalid input";break;case a.ZodIssueCode.invalid_intersection_types:t="Intersection results could not be merged";break;case a.ZodIssueCode.not_multiple_of:t=`Number must be a multiple of ${e.multipleOf}`;break;case a.ZodIssueCode.not_finite:t="Number must be finite";break;default:t=i.defaultError,n.util.assertNever(e)}return{message:t}};exports.default=l;
@@ -0,0 +1,3 @@
1
+ import { type ZodErrorMap } from "../ZodError.cjs";
2
+ declare const errorMap: ZodErrorMap;
3
+ export default errorMap;
@@ -0,0 +1 @@
1
+ import{ZodIssueCode as a}from"../ZodError.js";import{util as n,ZodParsedType as l}from"../helpers/util.js";const r=(e,i)=>{let t;switch(e.code){case a.invalid_type:e.received===l.undefined?t="Required":t=`Expected ${e.expected}, received ${e.received}`;break;case a.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(e.expected,n.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:t=`Unrecognized key(s) in object: ${n.joinValues(e.keys,", ")}`;break;case a.invalid_union:t="Invalid input";break;case a.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${n.joinValues(e.options)}`;break;case a.invalid_enum_value:t=`Invalid enum value. Expected ${n.joinValues(e.options)}, received '${e.received}'`;break;case a.invalid_arguments:t="Invalid function arguments";break;case a.invalid_return_type:t="Invalid function return type";break;case a.invalid_date:t="Invalid date";break;case a.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(t=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?t=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?t=`Invalid input: must end with "${e.validation.endsWith}"`:n.assertNever(e.validation):e.validation!=="regex"?t=`Invalid ${e.validation}`:t="Invalid";break;case a.too_small:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?t=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:t="Invalid input";break;case a.too_big:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?t=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:t="Invalid input";break;case a.custom:t="Invalid input";break;case a.invalid_intersection_types:t="Intersection results could not be merged";break;case a.not_multiple_of:t=`Number must be a multiple of ${e.multipleOf}`;break;case a.not_finite:t="Number must be finite";break;default:t=i.defaultError,n.assertNever(e)}return{message:t}};var m=r;export{m as default};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,102 @@
1
+ /**
2
+ * The Standard Schema interface.
3
+ */
4
+ export type StandardSchemaV1<Input = unknown, Output = Input> = {
5
+ /**
6
+ * The Standard Schema properties.
7
+ */
8
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
9
+ };
10
+ export declare namespace StandardSchemaV1 {
11
+ /**
12
+ * The Standard Schema properties interface.
13
+ */
14
+ export interface Props<Input = unknown, Output = Input> {
15
+ /**
16
+ * The version number of the standard.
17
+ */
18
+ readonly version: 1;
19
+ /**
20
+ * The vendor name of the schema library.
21
+ */
22
+ readonly vendor: string;
23
+ /**
24
+ * Validates unknown input values.
25
+ */
26
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
27
+ /**
28
+ * Inferred types associated with the schema.
29
+ */
30
+ readonly types?: Types<Input, Output> | undefined;
31
+ }
32
+ /**
33
+ * The result interface of the validate function.
34
+ */
35
+ export type Result<Output> = SuccessResult<Output> | FailureResult;
36
+ /**
37
+ * The result interface if validation succeeds.
38
+ */
39
+ export interface SuccessResult<Output> {
40
+ /**
41
+ * The typed output value.
42
+ */
43
+ readonly value: Output;
44
+ /**
45
+ * The non-existent issues.
46
+ */
47
+ readonly issues?: undefined;
48
+ }
49
+ /**
50
+ * The result interface if validation fails.
51
+ */
52
+ export interface FailureResult {
53
+ /**
54
+ * The issues of failed validation.
55
+ */
56
+ readonly issues: ReadonlyArray<Issue>;
57
+ }
58
+ /**
59
+ * The issue interface of the failure output.
60
+ */
61
+ export interface Issue {
62
+ /**
63
+ * The error message of the issue.
64
+ */
65
+ readonly message: string;
66
+ /**
67
+ * The path of the issue, if any.
68
+ */
69
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
70
+ }
71
+ /**
72
+ * The path segment interface of the issue.
73
+ */
74
+ export interface PathSegment {
75
+ /**
76
+ * The key representing a path segment.
77
+ */
78
+ readonly key: PropertyKey;
79
+ }
80
+ /**
81
+ * The Standard Schema types interface.
82
+ */
83
+ export interface Types<Input = unknown, Output = Input> {
84
+ /**
85
+ * The input type of the schema.
86
+ */
87
+ readonly input: Input;
88
+ /**
89
+ * The output type of the schema.
90
+ */
91
+ readonly output: Output;
92
+ }
93
+ /**
94
+ * Infers the input type of a Standard Schema.
95
+ */
96
+ export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
97
+ /**
98
+ * Infers the output type of a Standard Schema.
99
+ */
100
+ export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
101
+ export {};
102
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.discriminatedUnion=exports.date=exports.boolean=exports.bigint=exports.array=exports.any=exports.coerce=exports.ZodFirstPartyTypeKind=exports.late=exports.ZodSchema=exports.Schema=exports.ZodReadonly=exports.ZodPipeline=exports.ZodBranded=exports.BRAND=exports.ZodNaN=exports.ZodCatch=exports.ZodDefault=exports.ZodNullable=exports.ZodOptional=exports.ZodTransformer=exports.ZodEffects=exports.ZodPromise=exports.ZodNativeEnum=exports.ZodEnum=exports.ZodLiteral=exports.ZodLazy=exports.ZodFunction=exports.ZodSet=exports.ZodMap=exports.ZodRecord=exports.ZodTuple=exports.ZodIntersection=exports.ZodDiscriminatedUnion=exports.ZodUnion=exports.ZodObject=exports.ZodArray=exports.ZodVoid=exports.ZodNever=exports.ZodUnknown=exports.ZodAny=exports.ZodNull=exports.ZodUndefined=exports.ZodSymbol=exports.ZodDate=exports.ZodBoolean=exports.ZodBigInt=exports.ZodNumber=exports.ZodString=exports.ZodType=void 0,exports.NEVER=exports.void=exports.unknown=exports.union=exports.undefined=exports.tuple=exports.transformer=exports.symbol=exports.string=exports.strictObject=exports.set=exports.record=exports.promise=exports.preprocess=exports.pipeline=exports.ostring=exports.optional=exports.onumber=exports.oboolean=exports.object=exports.number=exports.nullable=exports.null=exports.never=exports.nativeEnum=exports.nan=exports.map=exports.literal=exports.lazy=exports.intersection=exports.instanceof=exports.function=exports.enum=exports.effect=void 0,exports.datetimeRegex=he,exports.custom=me;const u=require("./ZodError.cjs"),Q=require("./errors.cjs"),h=require("./helpers/errorUtil.cjs"),i=require("./helpers/parseUtil.cjs"),c=require("./helpers/util.cjs");class T{constructor(e,t,s,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ue=(r,e)=>{if((0,i.isValid)(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 u.ZodError(r.common.issues);return this._error=t,this._error}}};function m(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:a}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(d,o)=>{const{message:l}=r;return d.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??s??o.defaultError}:d.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:a}}class y{get description(){return this._def.description}_getType(e){return(0,c.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,i.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},a=this._parseSync({data:e,path:s.path,parent:s});return ue(s,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return(0,i.isValid)(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>(0,i.isValid)(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},a=this._parse({data:e,path:s.path,parent:s}),n=await((0,i.isAsync)(a)?a:Promise.resolve(a));return ue(s,n)}refine(e,t){const s=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const d=e(a),o=()=>n.addIssue({code:u.ZodIssueCode.custom,...s(a)});return typeof Promise<"u"&&d instanceof Promise?d.then(l=>l?!0:(o(),!1)):d?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,a)=>e(s)?!0:(a.addIssue(typeof t=="function"?t(s,a):t),!1))}_refinement(e){return new x({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return C.create(this,this._def)}nullable(){return A.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return I.create(this)}promise(){return D.create(this,this._def)}or(e){return $.create([this,e],this._def)}and(e){return B.create(this,e,this._def)}transform(e){return new x({...m(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new K({...m(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new oe({typeName:p.ZodBranded,type:this,...m(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Y({...m(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return H.create(this,e)}readonly(){return J.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}exports.ZodType=y,exports.Schema=y,exports.ZodSchema=y;const xe=/^c[^\s-]{8,}$/i,Ie=/^[0-9a-z]+$/,Ze=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Te=/^[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,Ce=/^[a-z0-9_-]{21}$/i,ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,be=/^[-+]?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)?)??$/,we=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ne;const Ne=/^(?:(?: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])$/,Se=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Oe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Pe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Re=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ve=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ce="((\\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])))",Ue=new RegExp(`^${ce}$`);function le(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Le(r){return new RegExp(`^${le(r)}$`)}function he(r){let e=`${ce}T${le(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 De(r,e){return!!((e==="v4"||!e)&&Ne.test(r)||(e==="v6"||!e)&&Oe.test(r))}function Ee(r,e){if(!ke.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(s));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function je(r,e){return!!((e==="v4"||!e)&&Se.test(r)||(e==="v6"||!e)&&Pe.test(r))}class Z extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){const n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:n.parsedType}),i.INVALID}const s=new i.ParseStatus;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){const d=e.data.length>n.value,o=e.data.length<n.value;(d||o)&&(a=this._getOrReturnCtx(e,a),d?(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")we.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"email",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")ne||(ne=new RegExp(Ae,"u")),ne.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"emoji",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")Te.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"uuid",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")Ce.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"nanoid",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")xe.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"cuid",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")Ie.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"cuid2",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Ze.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"ulid",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"url",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"regex",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?he(n).test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?Ue.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?Le(n).test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?be.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"duration",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?De(e.data,n.version)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"ip",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?Ee(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"jwt",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?je(e.data,n.version)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"cidr",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?Re.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"base64",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?Ve.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{validation:"base64url",code:u.ZodIssueCode.invalid_string,message:n.message}),s.dirty()):c.util.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(a=>e.test(a),{validation:t,code:u.ZodIssueCode.invalid_string,...h.errorUtil.errToObj(s)})}_addCheck(e){return new Z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,h.errorUtil.errToObj(e))}trim(){return new Z({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Z({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Z({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}exports.ZodString=Z,Z.create=r=>new Z({checks:[],typeName:p.ZodString,coerce:r?.coerce??!1,...m(r)});function Me(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,a=t>s?t:s,n=Number.parseInt(r.toFixed(a).replace(".","")),d=Number.parseInt(e.toFixed(a).replace(".",""));return n%d/10**a}class N extends y{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)!==c.ZodParsedType.number){const n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:n.parsedType}),i.INVALID}let s;const a=new i.ParseStatus;for(const n of this._def.checks)n.kind==="int"?c.util.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?Me(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.not_finite,message:n.message}),a.dirty()):c.util.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.errorUtil.toString(t))}setLimit(e,t,s,a){return new N({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.errorUtil.toString(a)}]})}_addCheck(e){return new N({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.errorUtil.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"&&c.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!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}exports.ZodNumber=N,N.create=r=>new N({checks:[],typeName:p.ZodNumber,coerce:r?.coerce||!1,...m(r)});class S extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let s;const a=new i.ParseStatus;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):c.util.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),i.INVALID}gte(e,t){return this.setLimit("min",e,!0,h.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.errorUtil.toString(t))}setLimit(e,t,s,a){return new S({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.errorUtil.toString(a)}]})}_addCheck(e){return new S({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.errorUtil.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}}exports.ZodBigInt=S,S.create=r=>new S({checks:[],typeName:p.ZodBigInt,coerce:r?.coerce??!1,...m(r)});class j extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==c.ZodParsedType.boolean){const s=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:s.parsedType}),i.INVALID}return(0,i.OK)(e.data)}}exports.ZodBoolean=j,j.create=r=>new j({typeName:p.ZodBoolean,coerce:r?.coerce||!1,...m(r)});class R extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){const n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:n.parsedType}),i.INVALID}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(n,{code:u.ZodIssueCode.invalid_date}),i.INVALID}const s=new i.ParseStatus;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),(0,i.addIssueToContext)(a,{code:u.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):c.util.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.errorUtil.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}}exports.ZodDate=R,R.create=r=>new R({checks:[],coerce:r?.coerce||!1,typeName:p.ZodDate,...m(r)});class X extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){const s=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:s.parsedType}),i.INVALID}return(0,i.OK)(e.data)}}exports.ZodSymbol=X,X.create=r=>new X({typeName:p.ZodSymbol,...m(r)});class M extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const s=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:s.parsedType}),i.INVALID}return(0,i.OK)(e.data)}}exports.ZodUndefined=M,M.create=r=>new M({typeName:p.ZodUndefined,...m(r)});class z extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){const s=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:s.parsedType}),i.INVALID}return(0,i.OK)(e.data)}}exports.ZodNull=z,z.create=r=>new z({typeName:p.ZodNull,...m(r)});class U extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,i.OK)(e.data)}}exports.ZodAny=U,U.create=r=>new U({typeName:p.ZodAny,...m(r)});class P extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,i.OK)(e.data)}}exports.ZodUnknown=P,P.create=r=>new P({typeName:p.ZodUnknown,...m(r)});class b extends y{_parse(e){const t=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),i.INVALID}}exports.ZodNever=b,b.create=r=>new b({typeName:p.ZodNever,...m(r)});class ee extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){const s=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:s.parsedType}),i.INVALID}return(0,i.OK)(e.data)}}exports.ZodVoid=ee,ee.create=r=>new ee({typeName:p.ZodVoid,...m(r)});class I extends y{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),a=this._def;if(t.parsedType!==c.ZodParsedType.array)return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),i.INVALID;if(a.exactLength!==null){const d=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(d||o)&&((0,i.addIssueToContext)(t,{code:d?u.ZodIssueCode.too_big:u.ZodIssueCode.too_small,minimum:o?a.exactLength.value:void 0,maximum:d?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&((0,i.addIssueToContext)(t,{code:u.ZodIssueCode.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&((0,i.addIssueToContext)(t,{code:u.ZodIssueCode.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((d,o)=>a.type._parseAsync(new T(t,d,t.path,o)))).then(d=>i.ParseStatus.mergeArray(s,d));const n=[...t.data].map((d,o)=>a.type._parseSync(new T(t,d,t.path,o)));return i.ParseStatus.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new I({...this._def,minLength:{value:e,message:h.errorUtil.toString(t)}})}max(e,t){return new I({...this._def,maxLength:{value:e,message:h.errorUtil.toString(t)}})}length(e,t){return new I({...this._def,exactLength:{value:e,message:h.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}exports.ZodArray=I,I.create=(r,e)=>new I({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...m(e)});function L(r){if(r instanceof g){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=C.create(L(s))}return new g({...r._def,shape:()=>e})}else return r instanceof I?new I({...r._def,type:L(r.element)}):r instanceof C?C.create(L(r.unwrap())):r instanceof A?A.create(L(r.unwrap())):r instanceof k?k.create(r.items.map(e=>L(e))):r}class g extends y{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=c.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){const f=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(f,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:f.parsedType}),i.INVALID}const{status:s,ctx:a}=this._processInputParams(e),{shape:n,keys:d}=this._getCached(),o=[];if(!(this._def.catchall instanceof b&&this._def.unknownKeys==="strip"))for(const f in a.data)d.includes(f)||o.push(f);const l=[];for(const f of d){const _=n[f],v=a.data[f];l.push({key:{status:"valid",value:f},value:_._parse(new T(a,v,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof b){const f=this._def.unknownKeys;if(f==="passthrough")for(const _ of o)l.push({key:{status:"valid",value:_},value:{status:"valid",value:a.data[_]}});else if(f==="strict")o.length>0&&((0,i.addIssueToContext)(a,{code:u.ZodIssueCode.unrecognized_keys,keys:o}),s.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const _ of o){const v=a.data[_];l.push({key:{status:"valid",value:_},value:f._parse(new T(a,v,a.path,_)),alwaysSet:_ in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const _ of l){const v=await _.key,de=await _.value;f.push({key:v,value:de,alwaysSet:_.alwaysSet})}return f}).then(f=>i.ParseStatus.mergeObjectSync(s,f)):i.ParseStatus.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return h.errorUtil.errToObj,new g({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{const a=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:h.errorUtil.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new g({...this._def,unknownKeys:"strip"})}passthrough(){return new g({...this._def,unknownKeys:"passthrough"})}extend(e){return new g({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new g({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new g({...this._def,catchall:e})}pick(e){const t={};for(const s of c.util.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new g({...this._def,shape:()=>t})}omit(e){const t={};for(const s of c.util.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new g({...this._def,shape:()=>t})}deepPartial(){return L(this)}partial(e){const t={};for(const s of c.util.objectKeys(this.shape)){const a=this.shape[s];e&&!e[s]?t[s]=a:t[s]=a.optional()}return new g({...this._def,shape:()=>t})}required(e){const t={};for(const s of c.util.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof C;)n=n._def.innerType;t[s]=n}return new g({...this._def,shape:()=>t})}keyof(){return fe(c.util.objectKeys(this.shape))}}exports.ZodObject=g,g.create=(r,e)=>new g({shape:()=>r,unknownKeys:"strip",catchall:b.create(),typeName:p.ZodObject,...m(e)}),g.strictCreate=(r,e)=>new g({shape:()=>r,unknownKeys:"strict",catchall:b.create(),typeName:p.ZodObject,...m(e)}),g.lazycreate=(r,e)=>new g({shape:r,unknownKeys:"strip",catchall:b.create(),typeName:p.ZodObject,...m(e)});class $ extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const d=n.map(o=>new u.ZodError(o.ctx.common.issues));return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_union,unionErrors:d}),i.INVALID}if(t.common.async)return Promise.all(s.map(async n=>{const d={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:d}),ctx:d}})).then(a);{let n;const d=[];for(const l of s){const f={...t,common:{...t.common,issues:[]},parent:null},_=l._parseSync({data:t.data,path:t.path,parent:f});if(_.status==="valid")return _;_.status==="dirty"&&!n&&(n={result:_,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=d.map(l=>new u.ZodError(l));return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_union,unionErrors:o}),i.INVALID}}get options(){return this._def.options}}exports.ZodUnion=$,$.create=(r,e)=>new $({options:r,typeName:p.ZodUnion,...m(e)});const w=r=>r instanceof F?w(r.schema):r instanceof x?w(r.innerType()):r instanceof W?[r.value]:r instanceof O?r.options:r instanceof q?c.util.objectValues(r.enum):r instanceof K?w(r._def.innerType):r instanceof M?[void 0]:r instanceof z?[null]:r instanceof C?[void 0,...w(r.unwrap())]:r instanceof A?[null,...w(r.unwrap())]:r instanceof oe||r instanceof J?w(r.unwrap()):r instanceof Y?w(r._def.innerType):[];class re extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.object)return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),i.INVALID;const s=this.discriminator,a=t.data[s],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):((0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),i.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const a=new Map;for(const n of t){const d=w(n.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of d){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,n)}}return new re({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...m(s)})}}exports.ZodDiscriminatedUnion=re;function ie(r,e){const t=(0,c.getParsedType)(r),s=(0,c.getParsedType)(e);if(r===e)return{valid:!0,data:r};if(t===c.ZodParsedType.object&&s===c.ZodParsedType.object){const a=c.util.objectKeys(e),n=c.util.objectKeys(r).filter(o=>a.indexOf(o)!==-1),d={...r,...e};for(const o of n){const l=ie(r[o],e[o]);if(!l.valid)return{valid:!1};d[o]=l.data}return{valid:!0,data:d}}else if(t===c.ZodParsedType.array&&s===c.ZodParsedType.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let n=0;n<r.length;n++){const d=r[n],o=e[n],l=ie(d,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return t===c.ZodParsedType.date&&s===c.ZodParsedType.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class B extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),a=(n,d)=>{if((0,i.isAborted)(n)||(0,i.isAborted)(d))return i.INVALID;const o=ie(n.value,d.value);return o.valid?(((0,i.isDirty)(n)||(0,i.isDirty)(d))&&t.dirty(),{status:t.value,value:o.data}):((0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_intersection_types}),i.INVALID)};return s.common.async?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(([n,d])=>a(n,d)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}exports.ZodIntersection=B,B.create=(r,e,t)=>new B({left:r,right:e,typeName:p.ZodIntersection,...m(t)});class k extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.array)return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:s.parsedType}),i.INVALID;if(s.data.length<this._def.items.length)return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.INVALID;!this._def.rest&&s.data.length>this._def.items.length&&((0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...s.data].map((d,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new T(s,d,s.path,o)):null}).filter(d=>!!d);return s.common.async?Promise.all(n).then(d=>i.ParseStatus.mergeArray(t,d)):i.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new k({...this._def,rest:e})}}exports.ZodTuple=k,k.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new k({items:r,typeName:p.ZodTuple,rest:null,...m(e)})};class G extends y{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!==c.ZodParsedType.object)return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:s.parsedType}),i.INVALID;const a=[],n=this._def.keyType,d=this._def.valueType;for(const o in s.data)a.push({key:n._parse(new T(s,o,s.path,o)),value:d._parse(new T(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?i.ParseStatus.mergeObjectAsync(t,a):i.ParseStatus.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof y?new G({keyType:e,valueType:t,typeName:p.ZodRecord,...m(s)}):new G({keyType:Z.create(),valueType:e,typeName:p.ZodRecord,...m(t)})}}exports.ZodRecord=G;class te extends y{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!==c.ZodParsedType.map)return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:s.parsedType}),i.INVALID;const a=this._def.keyType,n=this._def.valueType,d=[...s.data.entries()].map(([o,l],f)=>({key:a._parse(new T(s,o,s.path,[f,"key"])),value:n._parse(new T(s,l,s.path,[f,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of d){const f=await l.key,_=await l.value;if(f.status==="aborted"||_.status==="aborted")return i.INVALID;(f.status==="dirty"||_.status==="dirty")&&t.dirty(),o.set(f.value,_.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of d){const f=l.key,_=l.value;if(f.status==="aborted"||_.status==="aborted")return i.INVALID;(f.status==="dirty"||_.status==="dirty")&&t.dirty(),o.set(f.value,_.value)}return{status:t.value,value:o}}}}exports.ZodMap=te,te.create=(r,e,t)=>new te({valueType:e,keyType:r,typeName:p.ZodMap,...m(t)});class V extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==c.ZodParsedType.set)return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:s.parsedType}),i.INVALID;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&((0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&((0,i.addIssueToContext)(s,{code:u.ZodIssueCode.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function d(l){const f=new Set;for(const _ of l){if(_.status==="aborted")return i.INVALID;_.status==="dirty"&&t.dirty(),f.add(_.value)}return{status:t.value,value:f}}const o=[...s.data.values()].map((l,f)=>n._parse(new T(s,l,s.path,f)));return s.common.async?Promise.all(o).then(l=>d(l)):d(o)}min(e,t){return new V({...this._def,minSize:{value:e,message:h.errorUtil.toString(t)}})}max(e,t){return new V({...this._def,maxSize:{value:e,message:h.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}exports.ZodSet=V,V.create=(r,e)=>new V({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,...m(e)});class E extends y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.function)return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:t.parsedType}),i.INVALID;function s(o,l){return(0,i.makeIssue)({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,Q.getErrorMap)(),Q.defaultErrorMap].filter(f=>!!f),issueData:{code:u.ZodIssueCode.invalid_arguments,argumentsError:l}})}function a(o,l){return(0,i.makeIssue)({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,Q.getErrorMap)(),Q.defaultErrorMap].filter(f=>!!f),issueData:{code:u.ZodIssueCode.invalid_return_type,returnTypeError:l}})}const n={errorMap:t.common.contextualErrorMap},d=t.data;if(this._def.returns instanceof D){const o=this;return(0,i.OK)(async function(...l){const f=new u.ZodError([]),_=await o._def.args.parseAsync(l,n).catch(ae=>{throw f.addIssue(s(l,ae)),f}),v=await Reflect.apply(d,this,_);return await o._def.returns._def.type.parseAsync(v,n).catch(ae=>{throw f.addIssue(a(v,ae)),f})})}else{const o=this;return(0,i.OK)(function(...l){const f=o._def.args.safeParse(l,n);if(!f.success)throw new u.ZodError([s(l,f.error)]);const _=Reflect.apply(d,this,f.data),v=o._def.returns.safeParse(_,n);if(!v.success)throw new u.ZodError([a(_,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new E({...this._def,args:k.create(e).rest(P.create())})}returns(e){return new E({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new E({args:e||k.create([]).rest(P.create()),returns:t||P.create(),typeName:p.ZodFunction,...m(s)})}}exports.ZodFunction=E;class F extends y{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})}}exports.ZodLazy=F,F.create=(r,e)=>new F({getter:r,typeName:p.ZodLazy,...m(e)});class W extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(t,{received:t.data,code:u.ZodIssueCode.invalid_literal,expected:this._def.value}),i.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}exports.ZodLiteral=W,W.create=(r,e)=>new W({value:r,typeName:p.ZodLiteral,...m(e)});function fe(r,e){return new O({values:r,typeName:p.ZodEnum,...m(e)})}class O extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return(0,i.addIssueToContext)(t,{expected:c.util.joinValues(s),received:t.parsedType,code:u.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return(0,i.addIssueToContext)(t,{received:t.data,code:u.ZodIssueCode.invalid_enum_value,options:s}),i.INVALID}return(0,i.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,t=this._def){return O.create(e,{...this._def,...t})}exclude(e,t=this._def){return O.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}exports.ZodEnum=O,O.create=fe;class q extends y{_parse(e){const t=c.util.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==c.ZodParsedType.string&&s.parsedType!==c.ZodParsedType.number){const a=c.util.objectValues(t);return(0,i.addIssueToContext)(s,{expected:c.util.joinValues(a),received:s.parsedType,code:u.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(c.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=c.util.objectValues(t);return(0,i.addIssueToContext)(s,{received:s.data,code:u.ZodIssueCode.invalid_enum_value,options:a}),i.INVALID}return(0,i.OK)(e.data)}get enum(){return this._def.values}}exports.ZodNativeEnum=q,q.create=(r,e)=>new q({values:r,typeName:p.ZodNativeEnum,...m(e)});class D extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&t.common.async===!1)return(0,i.addIssueToContext)(t,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),i.INVALID;const s=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,i.OK)(s.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}exports.ZodPromise=D,D.create=(r,e)=>new D({type:r,typeName:p.ZodPromise,...m(e)});class x extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:d=>{(0,i.addIssueToContext)(s,d),d.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const d=a.transform(s.data,n);if(s.common.async)return Promise.resolve(d).then(async o=>{if(t.value==="aborted")return i.INVALID;const l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?i.INVALID:l.status==="dirty"||t.value==="dirty"?(0,i.DIRTY)(l.value):l});{if(t.value==="aborted")return i.INVALID;const o=this._def.schema._parseSync({data:d,path:s.path,parent:s});return o.status==="aborted"?i.INVALID:o.status==="dirty"||t.value==="dirty"?(0,i.DIRTY)(o.value):o}}if(a.type==="refinement"){const d=o=>{const l=a.refinement(o,n);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?i.INVALID:(o.status==="dirty"&&t.dirty(),d(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?i.INVALID:(o.status==="dirty"&&t.dirty(),d(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!(0,i.isValid)(d))return i.INVALID;const o=a.transform(d.value,n);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(d=>(0,i.isValid)(d)?Promise.resolve(a.transform(d.value,n)).then(o=>({status:t.value,value:o})):i.INVALID);c.util.assertNever(a)}}exports.ZodEffects=x,exports.ZodTransformer=x,x.create=(r,e,t)=>new x({schema:r,typeName:p.ZodEffects,effect:e,...m(t)}),x.createWithPreprocess=(r,e,t)=>new x({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,...m(t)});class C extends y{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?(0,i.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}exports.ZodOptional=C,C.create=(r,e)=>new C({innerType:r,typeName:p.ZodOptional,...m(e)});class A extends y{_parse(e){return this._getType(e)===c.ZodParsedType.null?(0,i.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}exports.ZodNullable=A,A.create=(r,e)=>new A({innerType:r,typeName:p.ZodNullable,...m(e)});class K extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===c.ZodParsedType.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}exports.ZodDefault=K,K.create=(r,e)=>new K({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...m(e)});class Y extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return(0,i.isAsync)(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new u.ZodError(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new u.ZodError(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}exports.ZodCatch=Y,Y.create=(r,e)=>new Y({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...m(e)});class se extends y{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){const s=this._getOrReturnCtx(e);return(0,i.addIssueToContext)(s,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:s.parsedType}),i.INVALID}return{status:"valid",value:e.data}}}exports.ZodNaN=se,se.create=r=>new se({typeName:p.ZodNaN,...m(r)}),exports.BRAND=Symbol("zod_brand");class oe extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}exports.ZodBranded=oe;class H extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?i.INVALID:n.status==="dirty"?(t.dirty(),(0,i.DIRTY)(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?i.INVALID:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(e,t){return new H({in:e,out:t,typeName:p.ZodPipeline})}}exports.ZodPipeline=H;class J extends y{_parse(e){const t=this._def.innerType._parse(e),s=a=>((0,i.isValid)(a)&&(a.value=Object.freeze(a.value)),a);return(0,i.isAsync)(t)?t.then(a=>s(a)):s(t)}unwrap(){return this._def.innerType}}exports.ZodReadonly=J,J.create=(r,e)=>new J({innerType:r,typeName:p.ZodReadonly,...m(e)});function pe(r,e){const t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function me(r,e={},t){return r?U.create().superRefine((s,a)=>{const n=r(s);if(n instanceof Promise)return n.then(d=>{if(!d){const o=pe(e,s),l=o.fatal??t??!0;a.addIssue({code:"custom",...o,fatal:l})}});if(!n){const d=pe(e,s),o=d.fatal??t??!0;a.addIssue({code:"custom",...d,fatal:o})}}):U.create()}exports.late={object:g.lazycreate};var p;(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"})(p||(exports.ZodFirstPartyTypeKind=p={}));class It{constructor(...e){}}const ze=(r,e={message:`Input not instance of ${r.name}`})=>me(t=>t instanceof r,e);exports.instanceof=ze;const ye=Z.create;exports.string=ye;const _e=N.create;exports.number=_e;const $e=se.create;exports.nan=$e;const Be=S.create;exports.bigint=Be;const ge=j.create;exports.boolean=ge;const Fe=R.create;exports.date=Fe;const We=X.create;exports.symbol=We;const qe=M.create;exports.undefined=qe;const Ke=z.create;exports.null=Ke;const Ye=U.create;exports.any=Ye;const Je=P.create;exports.unknown=Je;const He=b.create;exports.never=He;const Ge=ee.create;exports.void=Ge;const Qe=I.create;exports.array=Qe;const Xe=g.create;exports.object=Xe;const et=g.strictCreate;exports.strictObject=et;const tt=$.create;exports.union=tt;const st=re.create;exports.discriminatedUnion=st;const rt=B.create;exports.intersection=rt;const at=k.create;exports.tuple=at;const nt=G.create;exports.record=nt;const it=te.create;exports.map=it;const ot=V.create;exports.set=ot;const dt=E.create;exports.function=dt;const ut=F.create;exports.lazy=ut;const ct=W.create;exports.literal=ct;const lt=O.create;exports.enum=lt;const ht=q.create;exports.nativeEnum=ht;const ft=D.create;exports.promise=ft;const ve=x.create;exports.effect=ve,exports.transformer=ve;const pt=C.create;exports.optional=pt;const mt=A.create;exports.nullable=mt;const yt=x.createWithPreprocess;exports.preprocess=yt;const _t=H.create;exports.pipeline=_t;const gt=()=>ye().optional();exports.ostring=gt;const vt=()=>_e().optional();exports.onumber=vt;const xt=()=>ge().optional();exports.oboolean=xt,exports.coerce={string:(r=>Z.create({...r,coerce:!0})),number:(r=>N.create({...r,coerce:!0})),boolean:(r=>j.create({...r,coerce:!0})),bigint:(r=>S.create({...r,coerce:!0})),date:(r=>R.create({...r,coerce:!0}))},exports.NEVER=i.INVALID;