@jsfsi-core/ts-crossplatform 1.0.10 → 1.0.11

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.
package/dist/index.mjs CHANGED
@@ -1,2733 +1,1577 @@
1
- const ct = (s = {}) => s, ut = (s) => [s, void 0], lt = (s) => [
1
+ const At = (e = {}) => e, Rt = (e) => [e, void 0], Ct = (e) => [
2
2
  void 0,
3
- s
3
+ e
4
4
  ];
5
- class ft {
5
+ class Ft {
6
6
  name;
7
7
  constructor() {
8
8
  this.name = this.constructor.name;
9
9
  }
10
10
  }
11
- const ht = (
11
+ const Mt = (
12
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- (s) => (e) => !(e instanceof s)
14
- ), mt = (
13
+ (e) => (n) => !(n instanceof e)
14
+ ), Ut = (
15
15
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- (s) => (e) => e instanceof s
17
- ), pt = (s, e = process.env) => {
18
- const t = s.safeParse(e);
16
+ (e) => (n) => n instanceof e
17
+ ), Vt = (e, n = process.env) => {
18
+ const t = e.safeParse(n);
19
19
  if (!t.success)
20
20
  throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);
21
21
  return t.data;
22
22
  };
23
- function gt(s) {
24
- return new Promise((e) => setTimeout(e, s));
23
+ function Dt(e) {
24
+ return new Promise((n) => setTimeout(n, e));
25
25
  }
26
- function Se(s, e) {
27
- return new Date(s).toLocaleDateString(e, {
26
+ function Ue(e, n) {
27
+ return new Date(e).toLocaleDateString(n, {
28
28
  year: "numeric",
29
29
  month: "2-digit",
30
30
  day: "2-digit"
31
31
  });
32
32
  }
33
- function Oe(s, e) {
34
- return new Date(s).toLocaleTimeString(e, {
33
+ function Ve(e, n) {
34
+ return new Date(e).toLocaleTimeString(n, {
35
35
  hour12: !1,
36
36
  hour: "2-digit",
37
37
  minute: "2-digit",
38
38
  second: "2-digit"
39
39
  });
40
40
  }
41
- function yt(s, e) {
42
- return `${Se(s, e)} ${Oe(s, e)}`;
41
+ function Lt(e, n) {
42
+ return `${Ue(e, n)} ${Ve(e, n)}`;
43
43
  }
44
- const Ne = "00000000-0000-0000-0000-000000000000", Ae = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
45
- function xe(s) {
46
- return typeof s == "string" && Ae.test(s);
44
+ const De = "00000000-0000-0000-0000-000000000000", Le = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
45
+ function ye(e) {
46
+ return typeof e == "string" && Le.test(e);
47
47
  }
48
- function Ze(s) {
49
- if (!xe(s))
48
+ function Ge(e) {
49
+ if (!ye(e))
50
50
  throw TypeError("Invalid UUID");
51
- let e;
52
- return Uint8Array.of((e = parseInt(s.slice(0, 8), 16)) >>> 24, e >>> 16 & 255, e >>> 8 & 255, e & 255, (e = parseInt(s.slice(9, 13), 16)) >>> 8, e & 255, (e = parseInt(s.slice(14, 18), 16)) >>> 8, e & 255, (e = parseInt(s.slice(19, 23), 16)) >>> 8, e & 255, (e = parseInt(s.slice(24, 36), 16)) / 1099511627776 & 255, e / 4294967296 & 255, e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, e & 255);
53
- }
54
- const k = [];
55
- for (let s = 0; s < 256; ++s)
56
- k.push((s + 256).toString(16).slice(1));
57
- function Re(s, e = 0) {
58
- return (k[s[e + 0]] + k[s[e + 1]] + k[s[e + 2]] + k[s[e + 3]] + "-" + k[s[e + 4]] + k[s[e + 5]] + "-" + k[s[e + 6]] + k[s[e + 7]] + "-" + k[s[e + 8]] + k[s[e + 9]] + "-" + k[s[e + 10]] + k[s[e + 11]] + k[s[e + 12]] + k[s[e + 13]] + k[s[e + 14]] + k[s[e + 15]]).toLowerCase();
59
- }
60
- let Y;
61
- const Ie = new Uint8Array(16);
62
- function Ee() {
63
- if (!Y) {
51
+ let n;
52
+ return Uint8Array.of((n = parseInt(e.slice(0, 8), 16)) >>> 24, n >>> 16 & 255, n >>> 8 & 255, n & 255, (n = parseInt(e.slice(9, 13), 16)) >>> 8, n & 255, (n = parseInt(e.slice(14, 18), 16)) >>> 8, n & 255, (n = parseInt(e.slice(19, 23), 16)) >>> 8, n & 255, (n = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, n / 4294967296 & 255, n >>> 24 & 255, n >>> 16 & 255, n >>> 8 & 255, n & 255);
53
+ }
54
+ const b = [];
55
+ for (let e = 0; e < 256; ++e)
56
+ b.push((e + 256).toString(16).slice(1));
57
+ function Ke(e, n = 0) {
58
+ return (b[e[n + 0]] + b[e[n + 1]] + b[e[n + 2]] + b[e[n + 3]] + "-" + b[e[n + 4]] + b[e[n + 5]] + "-" + b[e[n + 6]] + b[e[n + 7]] + "-" + b[e[n + 8]] + b[e[n + 9]] + "-" + b[e[n + 10]] + b[e[n + 11]] + b[e[n + 12]] + b[e[n + 13]] + b[e[n + 14]] + b[e[n + 15]]).toLowerCase();
59
+ }
60
+ let L;
61
+ const Ye = new Uint8Array(16);
62
+ function qe() {
63
+ if (!L) {
64
64
  if (typeof crypto > "u" || !crypto.getRandomValues)
65
65
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
66
- Y = crypto.getRandomValues.bind(crypto);
66
+ L = crypto.getRandomValues.bind(crypto);
67
67
  }
68
- return Y(Ie);
68
+ return L(Ye);
69
69
  }
70
- const je = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), re = { randomUUID: je };
71
- function $e(s, e, t) {
72
- if (re.randomUUID && !s)
70
+ const Be = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), re = { randomUUID: Be };
71
+ function Xe(e, n, t) {
72
+ if (re.randomUUID && !e)
73
73
  return re.randomUUID();
74
- s = s || {};
75
- const r = s.random ?? s.rng?.() ?? Ee();
74
+ e = e || {};
75
+ const r = e.random ?? e.rng?.() ?? qe();
76
76
  if (r.length < 16)
77
77
  throw new Error("Random bytes length must be >= 16");
78
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Re(r);
78
+ return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Ke(r);
79
79
  }
80
- class M {
80
+ class x {
81
81
  uuid;
82
- constructor(e) {
83
- Ze(e), this.uuid = e;
82
+ constructor(n) {
83
+ Ge(n), this.uuid = n;
84
84
  }
85
85
  toString() {
86
86
  return this.uuid;
87
87
  }
88
- equals(e) {
89
- return this.uuid === e.toString();
88
+ equals(n) {
89
+ return this.uuid === n.toString();
90
90
  }
91
91
  static new() {
92
- return new M($e());
92
+ return new x(Xe());
93
93
  }
94
94
  static empty() {
95
- return new M(Ne);
96
- }
97
- static isValid(e) {
98
- return !!(e && xe(e));
99
- }
100
- static parse(e) {
101
- return e && M.isValid(e) ? new M(e) : void 0;
102
- }
103
- }
104
- var _;
105
- (function(s) {
106
- s.assertEqual = (a) => {
107
- };
108
- function e(a) {
109
- }
110
- s.assertIs = e;
111
- function t(a) {
112
- throw new Error();
113
- }
114
- s.assertNever = t, s.arrayToEnum = (a) => {
115
- const n = {};
116
- for (const i of a)
117
- n[i] = i;
118
- return n;
119
- }, s.getValidEnumValues = (a) => {
120
- const n = s.objectKeys(a).filter((o) => typeof a[a[o]] != "number"), i = {};
121
- for (const o of n)
122
- i[o] = a[o];
123
- return s.objectValues(i);
124
- }, s.objectValues = (a) => s.objectKeys(a).map(function(n) {
125
- return a[n];
126
- }), s.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
127
- const n = [];
128
- for (const i in a)
129
- Object.prototype.hasOwnProperty.call(a, i) && n.push(i);
130
- return n;
131
- }, s.find = (a, n) => {
132
- for (const i of a)
133
- if (n(i))
134
- return i;
135
- }, s.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
136
- function r(a, n = " | ") {
137
- return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(n);
138
- }
139
- s.joinValues = r, s.jsonStringifyReplacer = (a, n) => typeof n == "bigint" ? n.toString() : n;
140
- })(_ || (_ = {}));
141
- var ae;
142
- (function(s) {
143
- s.mergeShapes = (e, t) => ({
144
- ...e,
145
- ...t
146
- // second overwrites first
147
- });
148
- })(ae || (ae = {}));
149
- const u = _.arrayToEnum([
150
- "string",
151
- "nan",
152
- "number",
153
- "integer",
154
- "float",
155
- "boolean",
156
- "date",
157
- "bigint",
158
- "symbol",
159
- "function",
160
- "undefined",
161
- "null",
162
- "array",
163
- "object",
164
- "unknown",
165
- "promise",
166
- "void",
167
- "never",
168
- "map",
169
- "set"
170
- ]), S = (s) => {
171
- switch (typeof s) {
172
- case "undefined":
173
- return u.undefined;
174
- case "string":
175
- return u.string;
176
- case "number":
177
- return Number.isNaN(s) ? u.nan : u.number;
178
- case "boolean":
179
- return u.boolean;
180
- case "function":
181
- return u.function;
182
- case "bigint":
183
- return u.bigint;
184
- case "symbol":
185
- return u.symbol;
186
- case "object":
187
- return Array.isArray(s) ? u.array : s === null ? u.null : s.then && typeof s.then == "function" && s.catch && typeof s.catch == "function" ? u.promise : typeof Map < "u" && s instanceof Map ? u.map : typeof Set < "u" && s instanceof Set ? u.set : typeof Date < "u" && s instanceof Date ? u.date : u.object;
188
- default:
189
- return u.unknown;
190
- }
191
- }, d = _.arrayToEnum([
192
- "invalid_type",
193
- "invalid_literal",
194
- "custom",
195
- "invalid_union",
196
- "invalid_union_discriminator",
197
- "invalid_enum_value",
198
- "unrecognized_keys",
199
- "invalid_arguments",
200
- "invalid_return_type",
201
- "invalid_date",
202
- "invalid_string",
203
- "too_small",
204
- "too_big",
205
- "invalid_intersection_types",
206
- "not_multiple_of",
207
- "not_finite"
208
- ]);
209
- class T extends Error {
210
- get errors() {
211
- return this.issues;
212
- }
213
- constructor(e) {
214
- super(), this.issues = [], this.addIssue = (r) => {
215
- this.issues = [...this.issues, r];
216
- }, this.addIssues = (r = []) => {
217
- this.issues = [...this.issues, ...r];
218
- };
219
- const t = new.target.prototype;
220
- Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
221
- }
222
- format(e) {
223
- const t = e || function(n) {
224
- return n.message;
225
- }, r = { _errors: [] }, a = (n) => {
226
- for (const i of n.issues)
227
- if (i.code === "invalid_union")
228
- i.unionErrors.map(a);
229
- else if (i.code === "invalid_return_type")
230
- a(i.returnTypeError);
231
- else if (i.code === "invalid_arguments")
232
- a(i.argumentsError);
233
- else if (i.path.length === 0)
234
- r._errors.push(t(i));
235
- else {
236
- let o = r, f = 0;
237
- for (; f < i.path.length; ) {
238
- const h = i.path[f];
239
- f === i.path.length - 1 ? (o[h] = o[h] || { _errors: [] }, o[h]._errors.push(t(i))) : o[h] = o[h] || { _errors: [] }, o = o[h], f++;
240
- }
241
- }
242
- };
243
- return a(this), r;
244
- }
245
- static assert(e) {
246
- if (!(e instanceof T))
247
- throw new Error(`Not a ZodError: ${e}`);
248
- }
249
- toString() {
250
- return this.message;
251
- }
252
- get message() {
253
- return JSON.stringify(this.issues, _.jsonStringifyReplacer, 2);
254
- }
255
- get isEmpty() {
256
- return this.issues.length === 0;
95
+ return new x(De);
257
96
  }
258
- flatten(e = (t) => t.message) {
259
- const t = {}, r = [];
260
- for (const a of this.issues)
261
- if (a.path.length > 0) {
262
- const n = a.path[0];
263
- t[n] = t[n] || [], t[n].push(e(a));
264
- } else
265
- r.push(e(a));
266
- return { formErrors: r, fieldErrors: t };
97
+ static isValid(n) {
98
+ return !!(n && ye(n));
267
99
  }
268
- get formErrors() {
269
- return this.flatten();
100
+ static parse(n) {
101
+ return n && x.isValid(n) ? new x(n) : void 0;
270
102
  }
271
103
  }
272
- T.create = (s) => new T(s);
273
- const X = (s, e) => {
274
- let t;
275
- switch (s.code) {
276
- case d.invalid_type:
277
- s.received === u.undefined ? t = "Required" : t = `Expected ${s.expected}, received ${s.received}`;
278
- break;
279
- case d.invalid_literal:
280
- t = `Invalid literal value, expected ${JSON.stringify(s.expected, _.jsonStringifyReplacer)}`;
281
- break;
282
- case d.unrecognized_keys:
283
- t = `Unrecognized key(s) in object: ${_.joinValues(s.keys, ", ")}`;
284
- break;
285
- case d.invalid_union:
286
- t = "Invalid input";
287
- break;
288
- case d.invalid_union_discriminator:
289
- t = `Invalid discriminator value. Expected ${_.joinValues(s.options)}`;
290
- break;
291
- case d.invalid_enum_value:
292
- t = `Invalid enum value. Expected ${_.joinValues(s.options)}, received '${s.received}'`;
293
- break;
294
- case d.invalid_arguments:
295
- t = "Invalid function arguments";
296
- break;
297
- case d.invalid_return_type:
298
- t = "Invalid function return type";
299
- break;
300
- case d.invalid_date:
301
- t = "Invalid date";
302
- break;
303
- case d.invalid_string:
304
- typeof s.validation == "object" ? "includes" in s.validation ? (t = `Invalid input: must include "${s.validation.includes}"`, typeof s.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${s.validation.position}`)) : "startsWith" in s.validation ? t = `Invalid input: must start with "${s.validation.startsWith}"` : "endsWith" in s.validation ? t = `Invalid input: must end with "${s.validation.endsWith}"` : _.assertNever(s.validation) : s.validation !== "regex" ? t = `Invalid ${s.validation}` : t = "Invalid";
305
- break;
306
- case d.too_small:
307
- s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "more than"} ${s.minimum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "over"} ${s.minimum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${s.minimum}` : s.type === "bigint" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${s.minimum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
308
- break;
309
- case d.too_big:
310
- s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "less than"} ${s.maximum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "under"} ${s.maximum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "bigint" ? t = `BigInt must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly" : s.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(s.maximum))}` : t = "Invalid input";
311
- break;
312
- case d.custom:
313
- t = "Invalid input";
314
- break;
315
- case d.invalid_intersection_types:
316
- t = "Intersection results could not be merged";
317
- break;
318
- case d.not_multiple_of:
319
- t = `Number must be a multiple of ${s.multipleOf}`;
320
- break;
321
- case d.not_finite:
322
- t = "Number must be finite";
323
- break;
324
- default:
325
- t = e.defaultError, _.assertNever(s);
326
- }
327
- return { message: t };
328
- };
329
- let Ve = X;
330
- function Le() {
331
- return Ve;
332
- }
333
- const Pe = (s) => {
334
- const { data: e, path: t, errorMaps: r, issueData: a } = s, n = [...t, ...a.path || []], i = {
335
- ...a,
336
- path: n
337
- };
338
- if (a.message !== void 0)
339
- return {
340
- ...a,
341
- path: n,
342
- message: a.message
343
- };
344
- let o = "";
345
- const f = r.filter((h) => !!h).slice().reverse();
346
- for (const h of f)
347
- o = h(i, { data: e, defaultError: o }).message;
348
- return {
349
- ...a,
350
- path: n,
351
- message: o
352
- };
353
- };
354
- function c(s, e) {
355
- const t = Le(), r = Pe({
356
- issueData: e,
357
- data: s.data,
358
- path: s.path,
359
- errorMaps: [
360
- s.common.contextualErrorMap,
361
- // contextual error map is first priority
362
- s.schemaErrorMap,
363
- // then schema-bound map if available
364
- t,
365
- // then global override map
366
- t === X ? void 0 : X
367
- // then global default map
368
- ].filter((a) => !!a)
369
- });
370
- s.common.issues.push(r);
104
+ function c(e, n, t) {
105
+ function r(s, l) {
106
+ var f;
107
+ Object.defineProperty(s, "_zod", {
108
+ value: s._zod ?? {},
109
+ enumerable: !1
110
+ }), (f = s._zod).traits ?? (f.traits = /* @__PURE__ */ new Set()), s._zod.traits.add(e), n(s, l);
111
+ for (const y in i.prototype)
112
+ y in s || Object.defineProperty(s, y, { value: i.prototype[y].bind(s) });
113
+ s._zod.constr = i, s._zod.def = l;
114
+ }
115
+ const o = t?.Parent ?? Object;
116
+ class u extends o {
117
+ }
118
+ Object.defineProperty(u, "name", { value: e });
119
+ function i(s) {
120
+ var l;
121
+ const f = t?.Parent ? new u() : this;
122
+ r(f, s), (l = f._zod).deferred ?? (l.deferred = []);
123
+ for (const y of f._zod.deferred)
124
+ y();
125
+ return f;
126
+ }
127
+ return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
128
+ value: (s) => t?.Parent && s instanceof t.Parent ? !0 : s?._zod?.traits?.has(e)
129
+ }), Object.defineProperty(i, "name", { value: e }), i;
371
130
  }
372
- class b {
131
+ class S extends Error {
373
132
  constructor() {
374
- this.value = "valid";
375
- }
376
- dirty() {
377
- this.value === "valid" && (this.value = "dirty");
378
- }
379
- abort() {
380
- this.value !== "aborted" && (this.value = "aborted");
381
- }
382
- static mergeArray(e, t) {
383
- const r = [];
384
- for (const a of t) {
385
- if (a.status === "aborted")
386
- return m;
387
- a.status === "dirty" && e.dirty(), r.push(a.value);
388
- }
389
- return { status: e.value, value: r };
390
- }
391
- static async mergeObjectAsync(e, t) {
392
- const r = [];
393
- for (const a of t) {
394
- const n = await a.key, i = await a.value;
395
- r.push({
396
- key: n,
397
- value: i
398
- });
399
- }
400
- return b.mergeObjectSync(e, r);
401
- }
402
- static mergeObjectSync(e, t) {
403
- const r = {};
404
- for (const a of t) {
405
- const { key: n, value: i } = a;
406
- if (n.status === "aborted" || i.status === "aborted")
407
- return m;
408
- n.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), n.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (r[n.value] = i.value);
409
- }
410
- return { status: e.value, value: r };
133
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
411
134
  }
412
135
  }
413
- const m = Object.freeze({
414
- status: "aborted"
415
- }), z = (s) => ({ status: "dirty", value: s }), w = (s) => ({ status: "valid", value: s }), ne = (s) => s.status === "aborted", ie = (s) => s.status === "dirty", j = (s) => s.status === "valid", F = (s) => typeof Promise < "u" && s instanceof Promise;
416
- var l;
417
- (function(s) {
418
- s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e?.message;
419
- })(l || (l = {}));
420
- class N {
421
- constructor(e, t, r, a) {
422
- this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = a;
423
- }
424
- get path() {
425
- return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
426
- }
136
+ const ke = {};
137
+ function P(e) {
138
+ return ke;
139
+ }
140
+ function Je(e) {
141
+ const n = Object.values(e).filter((r) => typeof r == "number");
142
+ return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
427
143
  }
428
- const oe = (s, e) => {
429
- if (j(e))
430
- return { success: !0, data: e.value };
431
- if (!s.common.issues.length)
432
- throw new Error("Validation failed but no issues detected.");
144
+ function We(e, n) {
145
+ return typeof n == "bigint" ? n.toString() : n;
146
+ }
147
+ function $e(e) {
433
148
  return {
434
- success: !1,
435
- get error() {
436
- if (this._error)
437
- return this._error;
438
- const t = new T(s.common.issues);
439
- return this._error = t, this._error;
149
+ get value() {
150
+ {
151
+ const n = e();
152
+ return Object.defineProperty(this, "value", { value: n }), n;
153
+ }
440
154
  }
441
155
  };
442
- };
443
- function g(s) {
444
- if (!s)
445
- return {};
446
- const { errorMap: e, invalid_type_error: t, required_error: r, description: a } = s;
447
- if (e && (t || r))
448
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
449
- return e ? { errorMap: e, description: a } : { errorMap: (i, o) => {
450
- const { message: f } = s;
451
- return i.code === "invalid_enum_value" ? { message: f ?? o.defaultError } : typeof o.data > "u" ? { message: f ?? r ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: f ?? t ?? o.defaultError };
452
- }, description: a };
453
- }
454
- class y {
455
- get description() {
456
- return this._def.description;
457
- }
458
- _getType(e) {
459
- return S(e.data);
460
- }
461
- _getOrReturnCtx(e, t) {
462
- return t || {
463
- common: e.parent.common,
464
- data: e.data,
465
- parsedType: S(e.data),
466
- schemaErrorMap: this._def.errorMap,
467
- path: e.path,
468
- parent: e.parent
469
- };
470
- }
471
- _processInputParams(e) {
472
- return {
473
- status: new b(),
474
- ctx: {
475
- common: e.parent.common,
476
- data: e.data,
477
- parsedType: S(e.data),
478
- schemaErrorMap: this._def.errorMap,
479
- path: e.path,
480
- parent: e.parent
481
- }
482
- };
483
- }
484
- _parseSync(e) {
485
- const t = this._parse(e);
486
- if (F(t))
487
- throw new Error("Synchronous parse encountered promise.");
488
- return t;
489
- }
490
- _parseAsync(e) {
491
- const t = this._parse(e);
492
- return Promise.resolve(t);
493
- }
494
- parse(e, t) {
495
- const r = this.safeParse(e, t);
496
- if (r.success)
497
- return r.data;
498
- throw r.error;
499
- }
500
- safeParse(e, t) {
501
- const r = {
502
- common: {
503
- issues: [],
504
- async: t?.async ?? !1,
505
- contextualErrorMap: t?.errorMap
506
- },
507
- path: t?.path || [],
508
- schemaErrorMap: this._def.errorMap,
509
- parent: null,
510
- data: e,
511
- parsedType: S(e)
512
- }, a = this._parseSync({ data: e, path: r.path, parent: r });
513
- return oe(r, a);
514
- }
515
- "~validate"(e) {
516
- const t = {
517
- common: {
518
- issues: [],
519
- async: !!this["~standard"].async
520
- },
521
- path: [],
522
- schemaErrorMap: this._def.errorMap,
523
- parent: null,
524
- data: e,
525
- parsedType: S(e)
526
- };
527
- if (!this["~standard"].async)
528
- try {
529
- const r = this._parseSync({ data: e, path: [], parent: t });
530
- return j(r) ? {
531
- value: r.value
532
- } : {
533
- issues: t.common.issues
534
- };
535
- } catch (r) {
536
- r?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
537
- issues: [],
538
- async: !0
539
- };
156
+ }
157
+ function J(e) {
158
+ return e == null;
159
+ }
160
+ function W(e) {
161
+ const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
162
+ return e.slice(n, t);
163
+ }
164
+ function He(e, n) {
165
+ const t = (e.toString().split(".")[1] || "").length, r = (n.toString().split(".")[1] || "").length, o = t > r ? t : r, u = Number.parseInt(e.toFixed(o).replace(".", "")), i = Number.parseInt(n.toFixed(o).replace(".", ""));
166
+ return u % i / 10 ** o;
167
+ }
168
+ function h(e, n, t) {
169
+ Object.defineProperty(e, n, {
170
+ get() {
171
+ {
172
+ const r = t();
173
+ return e[n] = r, r;
540
174
  }
541
- return this._parseAsync({ data: e, path: [], parent: t }).then((r) => j(r) ? {
542
- value: r.value
543
- } : {
544
- issues: t.common.issues
545
- });
546
- }
547
- async parseAsync(e, t) {
548
- const r = await this.safeParseAsync(e, t);
549
- if (r.success)
550
- return r.data;
551
- throw r.error;
552
- }
553
- async safeParseAsync(e, t) {
554
- const r = {
555
- common: {
556
- issues: [],
557
- contextualErrorMap: t?.errorMap,
558
- async: !0
559
- },
560
- path: t?.path || [],
561
- schemaErrorMap: this._def.errorMap,
562
- parent: null,
563
- data: e,
564
- parsedType: S(e)
565
- }, a = this._parse({ data: e, path: r.path, parent: r }), n = await (F(a) ? a : Promise.resolve(a));
566
- return oe(r, n);
567
- }
568
- refine(e, t) {
569
- const r = (a) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(a) : t;
570
- return this._refinement((a, n) => {
571
- const i = e(a), o = () => n.addIssue({
572
- code: d.custom,
573
- ...r(a)
175
+ },
176
+ set(r) {
177
+ Object.defineProperty(e, n, {
178
+ value: r
179
+ // configurable: true,
574
180
  });
575
- return typeof Promise < "u" && i instanceof Promise ? i.then((f) => f ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
576
- });
577
- }
578
- refinement(e, t) {
579
- return this._refinement((r, a) => e(r) ? !0 : (a.addIssue(typeof t == "function" ? t(r, a) : t), !1));
580
- }
581
- _refinement(e) {
582
- return new L({
583
- schema: this,
584
- typeName: p.ZodEffects,
585
- effect: { type: "refinement", refinement: e }
586
- });
587
- }
588
- superRefine(e) {
589
- return this._refinement(e);
590
- }
591
- constructor(e) {
592
- 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"] = {
593
- version: 1,
594
- vendor: "zod",
595
- validate: (t) => this["~validate"](t)
596
- };
597
- }
598
- optional() {
599
- return O.create(this, this._def);
600
- }
601
- nullable() {
602
- return P.create(this, this._def);
603
- }
604
- nullish() {
605
- return this.nullable().optional();
606
- }
607
- array() {
608
- return C.create(this);
609
- }
610
- promise() {
611
- return H.create(this, this._def);
612
- }
613
- or(e) {
614
- return q.create([this, e], this._def);
615
- }
616
- and(e) {
617
- return J.create(this, e, this._def);
618
- }
619
- transform(e) {
620
- return new L({
621
- ...g(this._def),
622
- schema: this,
623
- typeName: p.ZodEffects,
624
- effect: { type: "transform", transform: e }
625
- });
626
- }
627
- default(e) {
628
- const t = typeof e == "function" ? e : () => e;
629
- return new K({
630
- ...g(this._def),
631
- innerType: this,
632
- defaultValue: t,
633
- typeName: p.ZodDefault
634
- });
635
- }
636
- brand() {
637
- return new ot({
638
- typeName: p.ZodBranded,
639
- type: this,
640
- ...g(this._def)
641
- });
642
- }
643
- catch(e) {
644
- const t = typeof e == "function" ? e : () => e;
645
- return new ee({
646
- ...g(this._def),
647
- innerType: this,
648
- catchValue: t,
649
- typeName: p.ZodCatch
650
- });
651
- }
652
- describe(e) {
653
- const t = this.constructor;
654
- return new t({
655
- ...this._def,
656
- description: e
657
- });
658
- }
659
- pipe(e) {
660
- return se.create(this, e);
661
- }
662
- readonly() {
663
- return te.create(this);
664
- }
665
- isOptional() {
666
- return this.safeParse(void 0).success;
667
- }
668
- isNullable() {
669
- return this.safeParse(null).success;
670
- }
671
- }
672
- const De = /^c[^\s-]{8,}$/i, Me = /^[0-9a-z]+$/, ze = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ue = /^[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, Be = /^[a-z0-9_-]{21}$/i, Fe = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, We = /^[-+]?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)?)??$/, qe = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Je = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
673
- let Q;
674
- const He = /^(?:(?: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])$/, Ye = /^(?:(?: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])$/, Qe = /^(([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]))$/, Xe = /^(([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])$/, Ge = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ke = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ke = "((\\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])))", et = new RegExp(`^${ke}$`);
675
- function be(s) {
676
- let e = "[0-5]\\d";
677
- s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`);
678
- const t = s.precision ? "+" : "?";
679
- return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
181
+ },
182
+ configurable: !0
183
+ });
680
184
  }
681
- function tt(s) {
682
- return new RegExp(`^${be(s)}$`);
185
+ function H(e, n, t) {
186
+ Object.defineProperty(e, n, {
187
+ value: t,
188
+ writable: !0,
189
+ enumerable: !0,
190
+ configurable: !0
191
+ });
683
192
  }
684
- function st(s) {
685
- let e = `${ke}T${be(s)}`;
686
- const t = [];
687
- return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
193
+ function O(e) {
194
+ return JSON.stringify(e);
688
195
  }
689
- function rt(s, e) {
690
- return !!((e === "v4" || !e) && He.test(s) || (e === "v6" || !e) && Qe.test(s));
196
+ const Ze = Error.captureStackTrace ? Error.captureStackTrace : (...e) => {
197
+ };
198
+ function Y(e) {
199
+ return typeof e == "object" && e !== null && !Array.isArray(e);
691
200
  }
692
- function at(s, e) {
693
- if (!Fe.test(s))
201
+ const Qe = $e(() => {
202
+ if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
694
203
  return !1;
695
204
  try {
696
- const [t] = s.split(".");
697
- if (!t)
698
- return !1;
699
- const r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), a = JSON.parse(atob(r));
700
- return !(typeof a != "object" || a === null || "typ" in a && a?.typ !== "JWT" || !a.alg || e && a.alg !== e);
205
+ const e = Function;
206
+ return new e(""), !0;
701
207
  } catch {
702
208
  return !1;
703
209
  }
210
+ });
211
+ function q(e) {
212
+ if (Y(e) === !1)
213
+ return !1;
214
+ const n = e.constructor;
215
+ if (n === void 0)
216
+ return !0;
217
+ const t = n.prototype;
218
+ return !(Y(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
704
219
  }
705
- function nt(s, e) {
706
- return !!((e === "v4" || !e) && Ye.test(s) || (e === "v6" || !e) && Xe.test(s));
707
- }
708
- class R extends y {
709
- _parse(e) {
710
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
711
- const n = this._getOrReturnCtx(e);
712
- return c(n, {
713
- code: d.invalid_type,
714
- expected: u.string,
715
- received: n.parsedType
716
- }), m;
717
- }
718
- const r = new b();
719
- let a;
720
- for (const n of this._def.checks)
721
- if (n.kind === "min")
722
- e.data.length < n.value && (a = this._getOrReturnCtx(e, a), c(a, {
723
- code: d.too_small,
724
- minimum: n.value,
725
- type: "string",
726
- inclusive: !0,
727
- exact: !1,
728
- message: n.message
729
- }), r.dirty());
730
- else if (n.kind === "max")
731
- e.data.length > n.value && (a = this._getOrReturnCtx(e, a), c(a, {
732
- code: d.too_big,
733
- maximum: n.value,
734
- type: "string",
735
- inclusive: !0,
736
- exact: !1,
737
- message: n.message
738
- }), r.dirty());
739
- else if (n.kind === "length") {
740
- const i = e.data.length > n.value, o = e.data.length < n.value;
741
- (i || o) && (a = this._getOrReturnCtx(e, a), i ? c(a, {
742
- code: d.too_big,
743
- maximum: n.value,
744
- type: "string",
745
- inclusive: !0,
746
- exact: !0,
747
- message: n.message
748
- }) : o && c(a, {
749
- code: d.too_small,
750
- minimum: n.value,
751
- type: "string",
752
- inclusive: !0,
753
- exact: !0,
754
- message: n.message
755
- }), r.dirty());
756
- } else if (n.kind === "email")
757
- qe.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
758
- validation: "email",
759
- code: d.invalid_string,
760
- message: n.message
761
- }), r.dirty());
762
- else if (n.kind === "emoji")
763
- Q || (Q = new RegExp(Je, "u")), Q.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
764
- validation: "emoji",
765
- code: d.invalid_string,
766
- message: n.message
767
- }), r.dirty());
768
- else if (n.kind === "uuid")
769
- Ue.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
770
- validation: "uuid",
771
- code: d.invalid_string,
772
- message: n.message
773
- }), r.dirty());
774
- else if (n.kind === "nanoid")
775
- Be.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
776
- validation: "nanoid",
777
- code: d.invalid_string,
778
- message: n.message
779
- }), r.dirty());
780
- else if (n.kind === "cuid")
781
- De.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
782
- validation: "cuid",
783
- code: d.invalid_string,
784
- message: n.message
785
- }), r.dirty());
786
- else if (n.kind === "cuid2")
787
- Me.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
788
- validation: "cuid2",
789
- code: d.invalid_string,
790
- message: n.message
791
- }), r.dirty());
792
- else if (n.kind === "ulid")
793
- ze.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
794
- validation: "ulid",
795
- code: d.invalid_string,
796
- message: n.message
797
- }), r.dirty());
798
- else if (n.kind === "url")
799
- try {
800
- new URL(e.data);
801
- } catch {
802
- a = this._getOrReturnCtx(e, a), c(a, {
803
- validation: "url",
804
- code: d.invalid_string,
805
- message: n.message
806
- }), r.dirty();
807
- }
808
- else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
809
- validation: "regex",
810
- code: d.invalid_string,
811
- message: n.message
812
- }), r.dirty())) : n.kind === "trim" ? e.data = e.data.trim() : n.kind === "includes" ? e.data.includes(n.value, n.position) || (a = this._getOrReturnCtx(e, a), c(a, {
813
- code: d.invalid_string,
814
- validation: { includes: n.value, position: n.position },
815
- message: n.message
816
- }), r.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), c(a, {
817
- code: d.invalid_string,
818
- validation: { startsWith: n.value },
819
- message: n.message
820
- }), r.dirty()) : n.kind === "endsWith" ? e.data.endsWith(n.value) || (a = this._getOrReturnCtx(e, a), c(a, {
821
- code: d.invalid_string,
822
- validation: { endsWith: n.value },
823
- message: n.message
824
- }), r.dirty()) : n.kind === "datetime" ? st(n).test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
825
- code: d.invalid_string,
826
- validation: "datetime",
827
- message: n.message
828
- }), r.dirty()) : n.kind === "date" ? et.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
829
- code: d.invalid_string,
830
- validation: "date",
831
- message: n.message
832
- }), r.dirty()) : n.kind === "time" ? tt(n).test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
833
- code: d.invalid_string,
834
- validation: "time",
835
- message: n.message
836
- }), r.dirty()) : n.kind === "duration" ? We.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
837
- validation: "duration",
838
- code: d.invalid_string,
839
- message: n.message
840
- }), r.dirty()) : n.kind === "ip" ? rt(e.data, n.version) || (a = this._getOrReturnCtx(e, a), c(a, {
841
- validation: "ip",
842
- code: d.invalid_string,
843
- message: n.message
844
- }), r.dirty()) : n.kind === "jwt" ? at(e.data, n.alg) || (a = this._getOrReturnCtx(e, a), c(a, {
845
- validation: "jwt",
846
- code: d.invalid_string,
847
- message: n.message
848
- }), r.dirty()) : n.kind === "cidr" ? nt(e.data, n.version) || (a = this._getOrReturnCtx(e, a), c(a, {
849
- validation: "cidr",
850
- code: d.invalid_string,
851
- message: n.message
852
- }), r.dirty()) : n.kind === "base64" ? Ge.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
853
- validation: "base64",
854
- code: d.invalid_string,
855
- message: n.message
856
- }), r.dirty()) : n.kind === "base64url" ? Ke.test(e.data) || (a = this._getOrReturnCtx(e, a), c(a, {
857
- validation: "base64url",
858
- code: d.invalid_string,
859
- message: n.message
860
- }), r.dirty()) : _.assertNever(n);
861
- return { status: r.value, value: e.data };
862
- }
863
- _regex(e, t, r) {
864
- return this.refinement((a) => e.test(a), {
865
- validation: t,
866
- code: d.invalid_string,
867
- ...l.errToObj(r)
868
- });
869
- }
870
- _addCheck(e) {
871
- return new R({
872
- ...this._def,
873
- checks: [...this._def.checks, e]
874
- });
875
- }
876
- email(e) {
877
- return this._addCheck({ kind: "email", ...l.errToObj(e) });
878
- }
879
- url(e) {
880
- return this._addCheck({ kind: "url", ...l.errToObj(e) });
881
- }
882
- emoji(e) {
883
- return this._addCheck({ kind: "emoji", ...l.errToObj(e) });
884
- }
885
- uuid(e) {
886
- return this._addCheck({ kind: "uuid", ...l.errToObj(e) });
887
- }
888
- nanoid(e) {
889
- return this._addCheck({ kind: "nanoid", ...l.errToObj(e) });
890
- }
891
- cuid(e) {
892
- return this._addCheck({ kind: "cuid", ...l.errToObj(e) });
893
- }
894
- cuid2(e) {
895
- return this._addCheck({ kind: "cuid2", ...l.errToObj(e) });
896
- }
897
- ulid(e) {
898
- return this._addCheck({ kind: "ulid", ...l.errToObj(e) });
899
- }
900
- base64(e) {
901
- return this._addCheck({ kind: "base64", ...l.errToObj(e) });
902
- }
903
- base64url(e) {
904
- return this._addCheck({
905
- kind: "base64url",
906
- ...l.errToObj(e)
907
- });
908
- }
909
- jwt(e) {
910
- return this._addCheck({ kind: "jwt", ...l.errToObj(e) });
911
- }
912
- ip(e) {
913
- return this._addCheck({ kind: "ip", ...l.errToObj(e) });
914
- }
915
- cidr(e) {
916
- return this._addCheck({ kind: "cidr", ...l.errToObj(e) });
917
- }
918
- datetime(e) {
919
- return typeof e == "string" ? this._addCheck({
920
- kind: "datetime",
921
- precision: null,
922
- offset: !1,
923
- local: !1,
924
- message: e
925
- }) : this._addCheck({
926
- kind: "datetime",
927
- precision: typeof e?.precision > "u" ? null : e?.precision,
928
- offset: e?.offset ?? !1,
929
- local: e?.local ?? !1,
930
- ...l.errToObj(e?.message)
931
- });
932
- }
933
- date(e) {
934
- return this._addCheck({ kind: "date", message: e });
935
- }
936
- time(e) {
937
- return typeof e == "string" ? this._addCheck({
938
- kind: "time",
939
- precision: null,
940
- message: e
941
- }) : this._addCheck({
942
- kind: "time",
943
- precision: typeof e?.precision > "u" ? null : e?.precision,
944
- ...l.errToObj(e?.message)
945
- });
946
- }
947
- duration(e) {
948
- return this._addCheck({ kind: "duration", ...l.errToObj(e) });
949
- }
950
- regex(e, t) {
951
- return this._addCheck({
952
- kind: "regex",
953
- regex: e,
954
- ...l.errToObj(t)
955
- });
956
- }
957
- includes(e, t) {
958
- return this._addCheck({
959
- kind: "includes",
960
- value: e,
961
- position: t?.position,
962
- ...l.errToObj(t?.message)
963
- });
964
- }
965
- startsWith(e, t) {
966
- return this._addCheck({
967
- kind: "startsWith",
968
- value: e,
969
- ...l.errToObj(t)
970
- });
971
- }
972
- endsWith(e, t) {
973
- return this._addCheck({
974
- kind: "endsWith",
975
- value: e,
976
- ...l.errToObj(t)
977
- });
978
- }
979
- min(e, t) {
980
- return this._addCheck({
981
- kind: "min",
982
- value: e,
983
- ...l.errToObj(t)
984
- });
985
- }
986
- max(e, t) {
987
- return this._addCheck({
988
- kind: "max",
989
- value: e,
990
- ...l.errToObj(t)
991
- });
992
- }
993
- length(e, t) {
994
- return this._addCheck({
995
- kind: "length",
996
- value: e,
997
- ...l.errToObj(t)
998
- });
999
- }
1000
- /**
1001
- * Equivalent to `.min(1)`
1002
- */
1003
- nonempty(e) {
1004
- return this.min(1, l.errToObj(e));
1005
- }
1006
- trim() {
1007
- return new R({
1008
- ...this._def,
1009
- checks: [...this._def.checks, { kind: "trim" }]
1010
- });
1011
- }
1012
- toLowerCase() {
1013
- return new R({
1014
- ...this._def,
1015
- checks: [...this._def.checks, { kind: "toLowerCase" }]
1016
- });
1017
- }
1018
- toUpperCase() {
1019
- return new R({
1020
- ...this._def,
1021
- checks: [...this._def.checks, { kind: "toUpperCase" }]
1022
- });
1023
- }
1024
- get isDatetime() {
1025
- return !!this._def.checks.find((e) => e.kind === "datetime");
1026
- }
1027
- get isDate() {
1028
- return !!this._def.checks.find((e) => e.kind === "date");
1029
- }
1030
- get isTime() {
1031
- return !!this._def.checks.find((e) => e.kind === "time");
1032
- }
1033
- get isDuration() {
1034
- return !!this._def.checks.find((e) => e.kind === "duration");
1035
- }
1036
- get isEmail() {
1037
- return !!this._def.checks.find((e) => e.kind === "email");
1038
- }
1039
- get isURL() {
1040
- return !!this._def.checks.find((e) => e.kind === "url");
1041
- }
1042
- get isEmoji() {
1043
- return !!this._def.checks.find((e) => e.kind === "emoji");
1044
- }
1045
- get isUUID() {
1046
- return !!this._def.checks.find((e) => e.kind === "uuid");
1047
- }
1048
- get isNANOID() {
1049
- return !!this._def.checks.find((e) => e.kind === "nanoid");
1050
- }
1051
- get isCUID() {
1052
- return !!this._def.checks.find((e) => e.kind === "cuid");
1053
- }
1054
- get isCUID2() {
1055
- return !!this._def.checks.find((e) => e.kind === "cuid2");
1056
- }
1057
- get isULID() {
1058
- return !!this._def.checks.find((e) => e.kind === "ulid");
1059
- }
1060
- get isIP() {
1061
- return !!this._def.checks.find((e) => e.kind === "ip");
1062
- }
1063
- get isCIDR() {
1064
- return !!this._def.checks.find((e) => e.kind === "cidr");
1065
- }
1066
- get isBase64() {
1067
- return !!this._def.checks.find((e) => e.kind === "base64");
1068
- }
1069
- get isBase64url() {
1070
- return !!this._def.checks.find((e) => e.kind === "base64url");
1071
- }
1072
- get minLength() {
1073
- let e = null;
1074
- for (const t of this._def.checks)
1075
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1076
- return e;
1077
- }
1078
- get maxLength() {
1079
- let e = null;
1080
- for (const t of this._def.checks)
1081
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1082
- return e;
1083
- }
220
+ const en = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
221
+ function nn(e) {
222
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1084
223
  }
1085
- R.create = (s) => new R({
1086
- checks: [],
1087
- typeName: p.ZodString,
1088
- coerce: s?.coerce ?? !1,
1089
- ...g(s)
1090
- });
1091
- function it(s, e) {
1092
- const t = (s.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, a = t > r ? t : r, n = Number.parseInt(s.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
1093
- return n % i / 10 ** a;
224
+ function N(e, n, t) {
225
+ const r = new e._zod.constr(n ?? e._zod.def);
226
+ return (!n || t?.parent) && (r._zod.parent = e), r;
1094
227
  }
1095
- class $ extends y {
1096
- constructor() {
1097
- super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1098
- }
1099
- _parse(e) {
1100
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
1101
- const n = this._getOrReturnCtx(e);
1102
- return c(n, {
1103
- code: d.invalid_type,
1104
- expected: u.number,
1105
- received: n.parsedType
1106
- }), m;
228
+ function g(e) {
229
+ const n = e;
230
+ if (!n)
231
+ return {};
232
+ if (typeof n == "string")
233
+ return { error: () => n };
234
+ if (n?.message !== void 0) {
235
+ if (n?.error !== void 0)
236
+ throw new Error("Cannot specify both `message` and `error` params");
237
+ n.error = n.message;
238
+ }
239
+ return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
240
+ }
241
+ function tn(e) {
242
+ return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
243
+ }
244
+ const rn = {
245
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
246
+ int32: [-2147483648, 2147483647],
247
+ uint32: [0, 4294967295],
248
+ float32: [-34028234663852886e22, 34028234663852886e22],
249
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
250
+ };
251
+ function on(e, n) {
252
+ const t = {}, r = e._zod.def;
253
+ for (const o in n) {
254
+ if (!(o in r.shape))
255
+ throw new Error(`Unrecognized key: "${o}"`);
256
+ n[o] && (t[o] = r.shape[o]);
257
+ }
258
+ return N(e, {
259
+ ...e._zod.def,
260
+ shape: t,
261
+ checks: []
262
+ });
263
+ }
264
+ function un(e, n) {
265
+ const t = { ...e._zod.def.shape }, r = e._zod.def;
266
+ for (const o in n) {
267
+ if (!(o in r.shape))
268
+ throw new Error(`Unrecognized key: "${o}"`);
269
+ n[o] && delete t[o];
270
+ }
271
+ return N(e, {
272
+ ...e._zod.def,
273
+ shape: t,
274
+ checks: []
275
+ });
276
+ }
277
+ function sn(e, n) {
278
+ if (!q(n))
279
+ throw new Error("Invalid input to extend: expected a plain object");
280
+ const t = {
281
+ ...e._zod.def,
282
+ get shape() {
283
+ const r = { ...e._zod.def.shape, ...n };
284
+ return H(this, "shape", r), r;
285
+ },
286
+ checks: []
287
+ // delete existing checks
288
+ };
289
+ return N(e, t);
290
+ }
291
+ function cn(e, n) {
292
+ return N(e, {
293
+ ...e._zod.def,
294
+ get shape() {
295
+ const t = { ...e._zod.def.shape, ...n._zod.def.shape };
296
+ return H(this, "shape", t), t;
297
+ },
298
+ catchall: n._zod.def.catchall,
299
+ checks: []
300
+ // delete existing checks
301
+ });
302
+ }
303
+ function an(e, n, t) {
304
+ const r = n._zod.def.shape, o = { ...r };
305
+ if (t)
306
+ for (const u in t) {
307
+ if (!(u in r))
308
+ throw new Error(`Unrecognized key: "${u}"`);
309
+ t[u] && (o[u] = e ? new e({
310
+ type: "optional",
311
+ innerType: r[u]
312
+ }) : r[u]);
1107
313
  }
1108
- let r;
1109
- const a = new b();
1110
- for (const n of this._def.checks)
1111
- n.kind === "int" ? _.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
1112
- code: d.invalid_type,
1113
- expected: "integer",
1114
- received: "float",
1115
- message: n.message
1116
- }), a.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1117
- code: d.too_small,
1118
- minimum: n.value,
1119
- type: "number",
1120
- inclusive: n.inclusive,
1121
- exact: !1,
1122
- message: n.message
1123
- }), a.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1124
- code: d.too_big,
1125
- maximum: n.value,
1126
- type: "number",
1127
- inclusive: n.inclusive,
1128
- exact: !1,
1129
- message: n.message
1130
- }), a.dirty()) : n.kind === "multipleOf" ? it(e.data, n.value) !== 0 && (r = this._getOrReturnCtx(e, r), c(r, {
1131
- code: d.not_multiple_of,
1132
- multipleOf: n.value,
1133
- message: n.message
1134
- }), a.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
1135
- code: d.not_finite,
1136
- message: n.message
1137
- }), a.dirty()) : _.assertNever(n);
1138
- return { status: a.value, value: e.data };
1139
- }
1140
- gte(e, t) {
1141
- return this.setLimit("min", e, !0, l.toString(t));
1142
- }
1143
- gt(e, t) {
1144
- return this.setLimit("min", e, !1, l.toString(t));
1145
- }
1146
- lte(e, t) {
1147
- return this.setLimit("max", e, !0, l.toString(t));
1148
- }
1149
- lt(e, t) {
1150
- return this.setLimit("max", e, !1, l.toString(t));
314
+ else
315
+ for (const u in r)
316
+ o[u] = e ? new e({
317
+ type: "optional",
318
+ innerType: r[u]
319
+ }) : r[u];
320
+ return N(n, {
321
+ ...n._zod.def,
322
+ shape: o,
323
+ checks: []
324
+ });
325
+ }
326
+ function ln(e, n, t) {
327
+ const r = n._zod.def.shape, o = { ...r };
328
+ if (t)
329
+ for (const u in t) {
330
+ if (!(u in o))
331
+ throw new Error(`Unrecognized key: "${u}"`);
332
+ t[u] && (o[u] = new e({
333
+ type: "nonoptional",
334
+ innerType: r[u]
335
+ }));
336
+ }
337
+ else
338
+ for (const u in r)
339
+ o[u] = new e({
340
+ type: "nonoptional",
341
+ innerType: r[u]
342
+ });
343
+ return N(n, {
344
+ ...n._zod.def,
345
+ shape: o,
346
+ // optional: [],
347
+ checks: []
348
+ });
349
+ }
350
+ function j(e, n = 0) {
351
+ for (let t = n; t < e.issues.length; t++)
352
+ if (e.issues[t]?.continue !== !0)
353
+ return !0;
354
+ return !1;
355
+ }
356
+ function Q(e, n) {
357
+ return n.map((t) => {
358
+ var r;
359
+ return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
360
+ });
361
+ }
362
+ function F(e) {
363
+ return typeof e == "string" ? e : e?.message;
364
+ }
365
+ function I(e, n, t) {
366
+ const r = { ...e, path: e.path ?? [] };
367
+ if (!e.message) {
368
+ const o = F(e.inst?._zod.def?.error?.(e)) ?? F(n?.error?.(e)) ?? F(t.customError?.(e)) ?? F(t.localeError?.(e)) ?? "Invalid input";
369
+ r.message = o;
1151
370
  }
1152
- setLimit(e, t, r, a) {
1153
- return new $({
1154
- ...this._def,
1155
- checks: [
1156
- ...this._def.checks,
1157
- {
1158
- kind: e,
1159
- value: t,
1160
- inclusive: r,
1161
- message: l.toString(a)
371
+ return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
372
+ }
373
+ function ee(e) {
374
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
375
+ }
376
+ function A(...e) {
377
+ const [n, t, r] = e;
378
+ return typeof n == "string" ? {
379
+ message: n,
380
+ code: "custom",
381
+ input: t,
382
+ inst: r
383
+ } : { ...n };
384
+ }
385
+ const Ee = (e, n) => {
386
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
387
+ value: e._zod,
388
+ enumerable: !1
389
+ }), Object.defineProperty(e, "issues", {
390
+ value: n,
391
+ enumerable: !1
392
+ }), Object.defineProperty(e, "message", {
393
+ get() {
394
+ return JSON.stringify(n, We, 2);
395
+ },
396
+ enumerable: !0
397
+ // configurable: false,
398
+ }), Object.defineProperty(e, "toString", {
399
+ value: () => e.message,
400
+ enumerable: !1
401
+ });
402
+ }, Pe = c("$ZodError", Ee), Ie = c("$ZodError", Ee, { Parent: Error });
403
+ function fn(e, n = (t) => t.message) {
404
+ const t = {}, r = [];
405
+ for (const o of e.issues)
406
+ o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
407
+ return { formErrors: r, fieldErrors: t };
408
+ }
409
+ function pn(e, n) {
410
+ const t = n || function(u) {
411
+ return u.message;
412
+ }, r = { _errors: [] }, o = (u) => {
413
+ for (const i of u.issues)
414
+ if (i.code === "invalid_union" && i.errors.length)
415
+ i.errors.map((s) => o({ issues: s }));
416
+ else if (i.code === "invalid_key")
417
+ o({ issues: i.issues });
418
+ else if (i.code === "invalid_element")
419
+ o({ issues: i.issues });
420
+ else if (i.path.length === 0)
421
+ r._errors.push(t(i));
422
+ else {
423
+ let s = r, l = 0;
424
+ for (; l < i.path.length; ) {
425
+ const f = i.path[l];
426
+ l === i.path.length - 1 ? (s[f] = s[f] || { _errors: [] }, s[f]._errors.push(t(i))) : s[f] = s[f] || { _errors: [] }, s = s[f], l++;
1162
427
  }
1163
- ]
1164
- });
1165
- }
1166
- _addCheck(e) {
1167
- return new $({
1168
- ...this._def,
1169
- checks: [...this._def.checks, e]
1170
- });
1171
- }
1172
- int(e) {
1173
- return this._addCheck({
1174
- kind: "int",
1175
- message: l.toString(e)
428
+ }
429
+ };
430
+ return o(e), r;
431
+ }
432
+ const hn = (e) => (n, t, r, o) => {
433
+ const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, u);
434
+ if (i instanceof Promise)
435
+ throw new S();
436
+ if (i.issues.length) {
437
+ const s = new (o?.Err ?? e)(i.issues.map((l) => I(l, u, P())));
438
+ throw Ze(s, o?.callee), s;
439
+ }
440
+ return i.value;
441
+ }, dn = (e) => async (n, t, r, o) => {
442
+ const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
443
+ let i = n._zod.run({ value: t, issues: [] }, u);
444
+ if (i instanceof Promise && (i = await i), i.issues.length) {
445
+ const s = new (o?.Err ?? e)(i.issues.map((l) => I(l, u, P())));
446
+ throw Ze(s, o?.callee), s;
447
+ }
448
+ return i.value;
449
+ }, Ne = (e) => (n, t, r) => {
450
+ const o = r ? { ...r, async: !1 } : { async: !1 }, u = n._zod.run({ value: t, issues: [] }, o);
451
+ if (u instanceof Promise)
452
+ throw new S();
453
+ return u.issues.length ? {
454
+ success: !1,
455
+ error: new (e ?? Pe)(u.issues.map((i) => I(i, o, P())))
456
+ } : { success: !0, data: u.value };
457
+ }, mn = /* @__PURE__ */ Ne(Ie), Te = (e) => async (n, t, r) => {
458
+ const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
459
+ let u = n._zod.run({ value: t, issues: [] }, o);
460
+ return u instanceof Promise && (u = await u), u.issues.length ? {
461
+ success: !1,
462
+ error: new e(u.issues.map((i) => I(i, o, P())))
463
+ } : { success: !0, data: u.value };
464
+ }, _n = /* @__PURE__ */ Te(Ie), vn = /^\d+$/, gn = /^-?\d+(?:\.\d+)?/i, $ = /* @__PURE__ */ c("$ZodCheck", (e, n) => {
465
+ var t;
466
+ e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
467
+ }), Oe = {
468
+ number: "number",
469
+ bigint: "bigint",
470
+ object: "date"
471
+ }, xe = /* @__PURE__ */ c("$ZodCheckLessThan", (e, n) => {
472
+ $.init(e, n);
473
+ const t = Oe[typeof n.value];
474
+ e._zod.onattach.push((r) => {
475
+ const o = r._zod.bag, u = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
476
+ n.value < u && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
477
+ }), e._zod.check = (r) => {
478
+ (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
479
+ origin: t,
480
+ code: "too_big",
481
+ maximum: n.value,
482
+ input: r.value,
483
+ inclusive: n.inclusive,
484
+ inst: e,
485
+ continue: !n.abort
1176
486
  });
1177
- }
1178
- positive(e) {
1179
- return this._addCheck({
1180
- kind: "min",
1181
- value: 0,
1182
- inclusive: !1,
1183
- message: l.toString(e)
487
+ };
488
+ }), je = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, n) => {
489
+ $.init(e, n);
490
+ const t = Oe[typeof n.value];
491
+ e._zod.onattach.push((r) => {
492
+ const o = r._zod.bag, u = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
493
+ n.value > u && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
494
+ }), e._zod.check = (r) => {
495
+ (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
496
+ origin: t,
497
+ code: "too_small",
498
+ minimum: n.value,
499
+ input: r.value,
500
+ inclusive: n.inclusive,
501
+ inst: e,
502
+ continue: !n.abort
1184
503
  });
1185
- }
1186
- negative(e) {
1187
- return this._addCheck({
1188
- kind: "max",
1189
- value: 0,
1190
- inclusive: !1,
1191
- message: l.toString(e)
504
+ };
505
+ }), zn = /* @__PURE__ */ c("$ZodCheckMultipleOf", (e, n) => {
506
+ $.init(e, n), e._zod.onattach.push((t) => {
507
+ var r;
508
+ (r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
509
+ }), e._zod.check = (t) => {
510
+ if (typeof t.value != typeof n.value)
511
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
512
+ (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : He(t.value, n.value) === 0) || t.issues.push({
513
+ origin: typeof t.value,
514
+ code: "not_multiple_of",
515
+ divisor: n.value,
516
+ input: t.value,
517
+ inst: e,
518
+ continue: !n.abort
1192
519
  });
1193
- }
1194
- nonpositive(e) {
1195
- return this._addCheck({
1196
- kind: "max",
1197
- value: 0,
520
+ };
521
+ }), wn = /* @__PURE__ */ c("$ZodCheckNumberFormat", (e, n) => {
522
+ $.init(e, n), n.format = n.format || "float64";
523
+ const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = rn[n.format];
524
+ e._zod.onattach.push((i) => {
525
+ const s = i._zod.bag;
526
+ s.format = n.format, s.minimum = o, s.maximum = u, t && (s.pattern = vn);
527
+ }), e._zod.check = (i) => {
528
+ const s = i.value;
529
+ if (t) {
530
+ if (!Number.isInteger(s)) {
531
+ i.issues.push({
532
+ expected: r,
533
+ format: n.format,
534
+ code: "invalid_type",
535
+ input: s,
536
+ inst: e
537
+ });
538
+ return;
539
+ }
540
+ if (!Number.isSafeInteger(s)) {
541
+ s > 0 ? i.issues.push({
542
+ input: s,
543
+ code: "too_big",
544
+ maximum: Number.MAX_SAFE_INTEGER,
545
+ note: "Integers must be within the safe integer range.",
546
+ inst: e,
547
+ origin: r,
548
+ continue: !n.abort
549
+ }) : i.issues.push({
550
+ input: s,
551
+ code: "too_small",
552
+ minimum: Number.MIN_SAFE_INTEGER,
553
+ note: "Integers must be within the safe integer range.",
554
+ inst: e,
555
+ origin: r,
556
+ continue: !n.abort
557
+ });
558
+ return;
559
+ }
560
+ }
561
+ s < o && i.issues.push({
562
+ origin: "number",
563
+ input: s,
564
+ code: "too_small",
565
+ minimum: o,
1198
566
  inclusive: !0,
1199
- message: l.toString(e)
567
+ inst: e,
568
+ continue: !n.abort
569
+ }), s > u && i.issues.push({
570
+ origin: "number",
571
+ input: s,
572
+ code: "too_big",
573
+ maximum: u,
574
+ inst: e
1200
575
  });
1201
- }
1202
- nonnegative(e) {
1203
- return this._addCheck({
1204
- kind: "min",
1205
- value: 0,
576
+ };
577
+ }), bn = /* @__PURE__ */ c("$ZodCheckMaxLength", (e, n) => {
578
+ var t;
579
+ $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
580
+ const o = r.value;
581
+ return !J(o) && o.length !== void 0;
582
+ }), e._zod.onattach.push((r) => {
583
+ const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
584
+ n.maximum < o && (r._zod.bag.maximum = n.maximum);
585
+ }), e._zod.check = (r) => {
586
+ const o = r.value;
587
+ if (o.length <= n.maximum)
588
+ return;
589
+ const i = ee(o);
590
+ r.issues.push({
591
+ origin: i,
592
+ code: "too_big",
593
+ maximum: n.maximum,
1206
594
  inclusive: !0,
1207
- message: l.toString(e)
1208
- });
1209
- }
1210
- multipleOf(e, t) {
1211
- return this._addCheck({
1212
- kind: "multipleOf",
1213
- value: e,
1214
- message: l.toString(t)
1215
- });
1216
- }
1217
- finite(e) {
1218
- return this._addCheck({
1219
- kind: "finite",
1220
- message: l.toString(e)
595
+ input: o,
596
+ inst: e,
597
+ continue: !n.abort
1221
598
  });
1222
- }
1223
- safe(e) {
1224
- return this._addCheck({
1225
- kind: "min",
599
+ };
600
+ }), yn = /* @__PURE__ */ c("$ZodCheckMinLength", (e, n) => {
601
+ var t;
602
+ $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
603
+ const o = r.value;
604
+ return !J(o) && o.length !== void 0;
605
+ }), e._zod.onattach.push((r) => {
606
+ const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
607
+ n.minimum > o && (r._zod.bag.minimum = n.minimum);
608
+ }), e._zod.check = (r) => {
609
+ const o = r.value;
610
+ if (o.length >= n.minimum)
611
+ return;
612
+ const i = ee(o);
613
+ r.issues.push({
614
+ origin: i,
615
+ code: "too_small",
616
+ minimum: n.minimum,
1226
617
  inclusive: !0,
1227
- value: Number.MIN_SAFE_INTEGER,
1228
- message: l.toString(e)
1229
- })._addCheck({
1230
- kind: "max",
618
+ input: o,
619
+ inst: e,
620
+ continue: !n.abort
621
+ });
622
+ };
623
+ }), kn = /* @__PURE__ */ c("$ZodCheckLengthEquals", (e, n) => {
624
+ var t;
625
+ $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
626
+ const o = r.value;
627
+ return !J(o) && o.length !== void 0;
628
+ }), e._zod.onattach.push((r) => {
629
+ const o = r._zod.bag;
630
+ o.minimum = n.length, o.maximum = n.length, o.length = n.length;
631
+ }), e._zod.check = (r) => {
632
+ const o = r.value, u = o.length;
633
+ if (u === n.length)
634
+ return;
635
+ const i = ee(o), s = u > n.length;
636
+ r.issues.push({
637
+ origin: i,
638
+ ...s ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
1231
639
  inclusive: !0,
1232
- value: Number.MAX_SAFE_INTEGER,
1233
- message: l.toString(e)
640
+ exact: !0,
641
+ input: r.value,
642
+ inst: e,
643
+ continue: !n.abort
1234
644
  });
645
+ };
646
+ }), $n = /* @__PURE__ */ c("$ZodCheckOverwrite", (e, n) => {
647
+ $.init(e, n), e._zod.check = (t) => {
648
+ t.value = n.tx(t.value);
649
+ };
650
+ });
651
+ class Zn {
652
+ constructor(n = []) {
653
+ this.content = [], this.indent = 0, this && (this.args = n);
1235
654
  }
1236
- get minValue() {
1237
- let e = null;
1238
- for (const t of this._def.checks)
1239
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1240
- return e;
1241
- }
1242
- get maxValue() {
1243
- let e = null;
1244
- for (const t of this._def.checks)
1245
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1246
- return e;
1247
- }
1248
- get isInt() {
1249
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && _.isInteger(e.value));
655
+ indented(n) {
656
+ this.indent += 1, n(this), this.indent -= 1;
1250
657
  }
1251
- get isFinite() {
1252
- let e = null, t = null;
1253
- for (const r of this._def.checks) {
1254
- if (r.kind === "finite" || r.kind === "int" || r.kind === "multipleOf")
1255
- return !0;
1256
- r.kind === "min" ? (t === null || r.value > t) && (t = r.value) : r.kind === "max" && (e === null || r.value < e) && (e = r.value);
658
+ write(n) {
659
+ if (typeof n == "function") {
660
+ n(this, { execution: "sync" }), n(this, { execution: "async" });
661
+ return;
1257
662
  }
1258
- return Number.isFinite(t) && Number.isFinite(e);
663
+ const r = n.split(`
664
+ `).filter((i) => i), o = Math.min(...r.map((i) => i.length - i.trimStart().length)), u = r.map((i) => i.slice(o)).map((i) => " ".repeat(this.indent * 2) + i);
665
+ for (const i of u)
666
+ this.content.push(i);
667
+ }
668
+ compile() {
669
+ const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
670
+ return new n(...t, o.join(`
671
+ `));
1259
672
  }
1260
673
  }
1261
- $.create = (s) => new $({
1262
- checks: [],
1263
- typeName: p.ZodNumber,
1264
- coerce: s?.coerce || !1,
1265
- ...g(s)
1266
- });
1267
- class U extends y {
1268
- constructor() {
1269
- super(...arguments), this.min = this.gte, this.max = this.lte;
674
+ const En = {
675
+ major: 4,
676
+ minor: 0,
677
+ patch: 5
678
+ }, _ = /* @__PURE__ */ c("$ZodType", (e, n) => {
679
+ var t;
680
+ e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = En;
681
+ const r = [...e._zod.def.checks ?? []];
682
+ e._zod.traits.has("$ZodCheck") && r.unshift(e);
683
+ for (const o of r)
684
+ for (const u of o._zod.onattach)
685
+ u(e);
686
+ if (r.length === 0)
687
+ (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
688
+ e._zod.run = e._zod.parse;
689
+ });
690
+ else {
691
+ const o = (u, i, s) => {
692
+ let l = j(u), f;
693
+ for (const y of i) {
694
+ if (y._zod.def.when) {
695
+ if (!y._zod.def.when(u))
696
+ continue;
697
+ } else if (l)
698
+ continue;
699
+ const a = u.issues.length, p = y._zod.check(u);
700
+ if (p instanceof Promise && s?.async === !1)
701
+ throw new S();
702
+ if (f || p instanceof Promise)
703
+ f = (f ?? Promise.resolve()).then(async () => {
704
+ await p, u.issues.length !== a && (l || (l = j(u, a)));
705
+ });
706
+ else {
707
+ if (u.issues.length === a)
708
+ continue;
709
+ l || (l = j(u, a));
710
+ }
711
+ }
712
+ return f ? f.then(() => u) : u;
713
+ };
714
+ e._zod.run = (u, i) => {
715
+ const s = e._zod.parse(u, i);
716
+ if (s instanceof Promise) {
717
+ if (i.async === !1)
718
+ throw new S();
719
+ return s.then((l) => o(l, r, i));
720
+ }
721
+ return o(s, r, i);
722
+ };
1270
723
  }
1271
- _parse(e) {
1272
- if (this._def.coerce)
724
+ e["~standard"] = {
725
+ validate: (o) => {
1273
726
  try {
1274
- e.data = BigInt(e.data);
727
+ const u = mn(e, o);
728
+ return u.success ? { value: u.data } : { issues: u.error?.issues };
1275
729
  } catch {
1276
- return this._getInvalidInput(e);
730
+ return _n(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
1277
731
  }
1278
- if (this._getType(e) !== u.bigint)
1279
- return this._getInvalidInput(e);
1280
- let r;
1281
- const a = new b();
1282
- for (const n of this._def.checks)
1283
- n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1284
- code: d.too_small,
1285
- type: "bigint",
1286
- minimum: n.value,
1287
- inclusive: n.inclusive,
1288
- message: n.message
1289
- }), a.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1290
- code: d.too_big,
1291
- type: "bigint",
1292
- maximum: n.value,
1293
- inclusive: n.inclusive,
1294
- message: n.message
1295
- }), a.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), c(r, {
1296
- code: d.not_multiple_of,
1297
- multipleOf: n.value,
1298
- message: n.message
1299
- }), a.dirty()) : _.assertNever(n);
1300
- return { status: a.value, value: e.data };
1301
- }
1302
- _getInvalidInput(e) {
1303
- const t = this._getOrReturnCtx(e);
1304
- return c(t, {
1305
- code: d.invalid_type,
1306
- expected: u.bigint,
1307
- received: t.parsedType
1308
- }), m;
1309
- }
1310
- gte(e, t) {
1311
- return this.setLimit("min", e, !0, l.toString(t));
1312
- }
1313
- gt(e, t) {
1314
- return this.setLimit("min", e, !1, l.toString(t));
1315
- }
1316
- lte(e, t) {
1317
- return this.setLimit("max", e, !0, l.toString(t));
1318
- }
1319
- lt(e, t) {
1320
- return this.setLimit("max", e, !1, l.toString(t));
1321
- }
1322
- setLimit(e, t, r, a) {
1323
- return new U({
1324
- ...this._def,
1325
- checks: [
1326
- ...this._def.checks,
1327
- {
1328
- kind: e,
1329
- value: t,
1330
- inclusive: r,
1331
- message: l.toString(a)
1332
- }
1333
- ]
1334
- });
1335
- }
1336
- _addCheck(e) {
1337
- return new U({
1338
- ...this._def,
1339
- checks: [...this._def.checks, e]
1340
- });
1341
- }
1342
- positive(e) {
1343
- return this._addCheck({
1344
- kind: "min",
1345
- value: BigInt(0),
1346
- inclusive: !1,
1347
- message: l.toString(e)
1348
- });
1349
- }
1350
- negative(e) {
1351
- return this._addCheck({
1352
- kind: "max",
1353
- value: BigInt(0),
1354
- inclusive: !1,
1355
- message: l.toString(e)
1356
- });
1357
- }
1358
- nonpositive(e) {
1359
- return this._addCheck({
1360
- kind: "max",
1361
- value: BigInt(0),
1362
- inclusive: !0,
1363
- message: l.toString(e)
1364
- });
1365
- }
1366
- nonnegative(e) {
1367
- return this._addCheck({
1368
- kind: "min",
1369
- value: BigInt(0),
1370
- inclusive: !0,
1371
- message: l.toString(e)
1372
- });
1373
- }
1374
- multipleOf(e, t) {
1375
- return this._addCheck({
1376
- kind: "multipleOf",
1377
- value: e,
1378
- message: l.toString(t)
1379
- });
1380
- }
1381
- get minValue() {
1382
- let e = null;
1383
- for (const t of this._def.checks)
1384
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1385
- return e;
1386
- }
1387
- get maxValue() {
1388
- let e = null;
1389
- for (const t of this._def.checks)
1390
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1391
- return e;
1392
- }
1393
- }
1394
- U.create = (s) => new U({
1395
- checks: [],
1396
- typeName: p.ZodBigInt,
1397
- coerce: s?.coerce ?? !1,
1398
- ...g(s)
732
+ },
733
+ vendor: "zod",
734
+ version: 1
735
+ };
736
+ }), Se = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
737
+ _.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? gn, e._zod.parse = (t, r) => {
738
+ if (n.coerce)
739
+ try {
740
+ t.value = Number(t.value);
741
+ } catch {
742
+ }
743
+ const o = t.value;
744
+ if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
745
+ return t;
746
+ const u = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
747
+ return t.issues.push({
748
+ expected: "number",
749
+ code: "invalid_type",
750
+ input: o,
751
+ inst: e,
752
+ ...u ? { received: u } : {}
753
+ }), t;
754
+ };
755
+ }), Pn = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
756
+ wn.init(e, n), Se.init(e, n);
757
+ }), In = /* @__PURE__ */ c("$ZodUnknown", (e, n) => {
758
+ _.init(e, n), e._zod.parse = (t) => t;
759
+ }), Nn = /* @__PURE__ */ c("$ZodNever", (e, n) => {
760
+ _.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
761
+ expected: "never",
762
+ code: "invalid_type",
763
+ input: t.value,
764
+ inst: e
765
+ }), t);
1399
766
  });
1400
- class de extends y {
1401
- _parse(e) {
1402
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
1403
- const r = this._getOrReturnCtx(e);
1404
- return c(r, {
1405
- code: d.invalid_type,
1406
- expected: u.boolean,
1407
- received: r.parsedType
1408
- }), m;
1409
- }
1410
- return w(e.data);
1411
- }
767
+ function oe(e, n, t) {
768
+ e.issues.length && n.issues.push(...Q(t, e.issues)), n.value[t] = e.value;
1412
769
  }
1413
- de.create = (s) => new de({
1414
- typeName: p.ZodBoolean,
1415
- coerce: s?.coerce || !1,
1416
- ...g(s)
1417
- });
1418
- class W extends y {
1419
- _parse(e) {
1420
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
1421
- const n = this._getOrReturnCtx(e);
1422
- return c(n, {
1423
- code: d.invalid_type,
1424
- expected: u.date,
1425
- received: n.parsedType
1426
- }), m;
1427
- }
1428
- if (Number.isNaN(e.data.getTime())) {
1429
- const n = this._getOrReturnCtx(e);
1430
- return c(n, {
1431
- code: d.invalid_date
1432
- }), m;
770
+ const Tn = /* @__PURE__ */ c("$ZodArray", (e, n) => {
771
+ _.init(e, n), e._zod.parse = (t, r) => {
772
+ const o = t.value;
773
+ if (!Array.isArray(o))
774
+ return t.issues.push({
775
+ expected: "array",
776
+ code: "invalid_type",
777
+ input: o,
778
+ inst: e
779
+ }), t;
780
+ t.value = Array(o.length);
781
+ const u = [];
782
+ for (let i = 0; i < o.length; i++) {
783
+ const s = o[i], l = n.element._zod.run({
784
+ value: s,
785
+ issues: []
786
+ }, r);
787
+ l instanceof Promise ? u.push(l.then((f) => oe(f, t, i))) : oe(l, t, i);
1433
788
  }
1434
- const r = new b();
1435
- let a;
1436
- for (const n of this._def.checks)
1437
- n.kind === "min" ? e.data.getTime() < n.value && (a = this._getOrReturnCtx(e, a), c(a, {
1438
- code: d.too_small,
1439
- message: n.message,
1440
- inclusive: !0,
1441
- exact: !1,
1442
- minimum: n.value,
1443
- type: "date"
1444
- }), r.dirty()) : n.kind === "max" ? e.data.getTime() > n.value && (a = this._getOrReturnCtx(e, a), c(a, {
1445
- code: d.too_big,
1446
- message: n.message,
1447
- inclusive: !0,
1448
- exact: !1,
1449
- maximum: n.value,
1450
- type: "date"
1451
- }), r.dirty()) : _.assertNever(n);
789
+ return u.length ? Promise.all(u).then(() => t) : t;
790
+ };
791
+ });
792
+ function M(e, n, t) {
793
+ e.issues.length && n.issues.push(...Q(t, e.issues)), n.value[t] = e.value;
794
+ }
795
+ function ue(e, n, t, r) {
796
+ e.issues.length ? r[t] === void 0 ? t in r ? n.value[t] = void 0 : n.value[t] = e.value : n.issues.push(...Q(t, e.issues)) : e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
797
+ }
798
+ const On = /* @__PURE__ */ c("$ZodObject", (e, n) => {
799
+ _.init(e, n);
800
+ const t = $e(() => {
801
+ const a = Object.keys(n.shape);
802
+ for (const d of a)
803
+ if (!(n.shape[d] instanceof _))
804
+ throw new Error(`Invalid element at key "${d}": expected a Zod schema`);
805
+ const p = tn(n.shape);
1452
806
  return {
1453
- status: r.value,
1454
- value: new Date(e.data.getTime())
807
+ shape: n.shape,
808
+ keys: a,
809
+ keySet: new Set(a),
810
+ numKeys: a.length,
811
+ optionalKeys: new Set(p)
1455
812
  };
1456
- }
1457
- _addCheck(e) {
1458
- return new W({
1459
- ...this._def,
1460
- checks: [...this._def.checks, e]
1461
- });
1462
- }
1463
- min(e, t) {
1464
- return this._addCheck({
1465
- kind: "min",
1466
- value: e.getTime(),
1467
- message: l.toString(t)
1468
- });
1469
- }
1470
- max(e, t) {
1471
- return this._addCheck({
1472
- kind: "max",
1473
- value: e.getTime(),
1474
- message: l.toString(t)
1475
- });
1476
- }
1477
- get minDate() {
1478
- let e = null;
1479
- for (const t of this._def.checks)
1480
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1481
- return e != null ? new Date(e) : null;
1482
- }
1483
- get maxDate() {
1484
- let e = null;
1485
- for (const t of this._def.checks)
1486
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1487
- return e != null ? new Date(e) : null;
1488
- }
1489
- }
1490
- W.create = (s) => new W({
1491
- checks: [],
1492
- coerce: s?.coerce || !1,
1493
- typeName: p.ZodDate,
1494
- ...g(s)
1495
- });
1496
- class ce extends y {
1497
- _parse(e) {
1498
- if (this._getType(e) !== u.symbol) {
1499
- const r = this._getOrReturnCtx(e);
1500
- return c(r, {
1501
- code: d.invalid_type,
1502
- expected: u.symbol,
1503
- received: r.parsedType
1504
- }), m;
813
+ });
814
+ h(e._zod, "propValues", () => {
815
+ const a = n.shape, p = {};
816
+ for (const d in a) {
817
+ const k = a[d]._zod;
818
+ if (k.values) {
819
+ p[d] ?? (p[d] = /* @__PURE__ */ new Set());
820
+ for (const Z of k.values)
821
+ p[d].add(Z);
822
+ }
823
+ }
824
+ return p;
825
+ });
826
+ const r = (a) => {
827
+ const p = new Zn(["shape", "payload", "ctx"]), d = t.value, k = (w) => {
828
+ const m = O(w);
829
+ return `shape[${m}]._zod.run({ value: input[${m}], issues: [] }, ctx)`;
830
+ };
831
+ p.write("const input = payload.value;");
832
+ const Z = /* @__PURE__ */ Object.create(null);
833
+ let D = 0;
834
+ for (const w of d.keys)
835
+ Z[w] = `key_${D++}`;
836
+ p.write("const newResult = {}");
837
+ for (const w of d.keys)
838
+ if (d.optionalKeys.has(w)) {
839
+ const m = Z[w];
840
+ p.write(`const ${m} = ${k(w)};`);
841
+ const v = O(w);
842
+ p.write(`
843
+ if (${m}.issues.length) {
844
+ if (input[${v}] === undefined) {
845
+ if (${v} in input) {
846
+ newResult[${v}] = undefined;
847
+ }
848
+ } else {
849
+ payload.issues = payload.issues.concat(
850
+ ${m}.issues.map((iss) => ({
851
+ ...iss,
852
+ path: iss.path ? [${v}, ...iss.path] : [${v}],
853
+ }))
854
+ );
855
+ }
856
+ } else if (${m}.value === undefined) {
857
+ if (${v} in input) newResult[${v}] = undefined;
858
+ } else {
859
+ newResult[${v}] = ${m}.value;
860
+ }
861
+ `);
862
+ } else {
863
+ const m = Z[w];
864
+ p.write(`const ${m} = ${k(w)};`), p.write(`
865
+ if (${m}.issues.length) payload.issues = payload.issues.concat(${m}.issues.map(iss => ({
866
+ ...iss,
867
+ path: iss.path ? [${O(w)}, ...iss.path] : [${O(w)}]
868
+ })));`), p.write(`newResult[${O(w)}] = ${m}.value`);
869
+ }
870
+ p.write("payload.value = newResult;"), p.write("return payload;");
871
+ const R = p.compile();
872
+ return (w, m) => R(a, w, m);
873
+ };
874
+ let o;
875
+ const u = Y, i = !ke.jitless, l = i && Qe.value, f = n.catchall;
876
+ let y;
877
+ e._zod.parse = (a, p) => {
878
+ y ?? (y = t.value);
879
+ const d = a.value;
880
+ if (!u(d))
881
+ return a.issues.push({
882
+ expected: "object",
883
+ code: "invalid_type",
884
+ input: d,
885
+ inst: e
886
+ }), a;
887
+ const k = [];
888
+ if (i && l && p?.async === !1 && p.jitless !== !0)
889
+ o || (o = r(n.shape)), a = o(a, p);
890
+ else {
891
+ a.value = {};
892
+ const m = y.shape;
893
+ for (const v of y.keys) {
894
+ const T = m[v], C = T._zod.run({ value: d[v], issues: [] }, p), ne = T._zod.optin === "optional" && T._zod.optout === "optional";
895
+ C instanceof Promise ? k.push(C.then((te) => ne ? ue(te, a, v, d) : M(te, a, v))) : ne ? ue(C, a, v, d) : M(C, a, v);
896
+ }
897
+ }
898
+ if (!f)
899
+ return k.length ? Promise.all(k).then(() => a) : a;
900
+ const Z = [], D = y.keySet, R = f._zod, w = R.def.type;
901
+ for (const m of Object.keys(d)) {
902
+ if (D.has(m))
903
+ continue;
904
+ if (w === "never") {
905
+ Z.push(m);
906
+ continue;
907
+ }
908
+ const v = R.run({ value: d[m], issues: [] }, p);
909
+ v instanceof Promise ? k.push(v.then((T) => M(T, a, m))) : M(v, a, m);
1505
910
  }
1506
- return w(e.data);
1507
- }
1508
- }
1509
- ce.create = (s) => new ce({
1510
- typeName: p.ZodSymbol,
1511
- ...g(s)
911
+ return Z.length && a.issues.push({
912
+ code: "unrecognized_keys",
913
+ keys: Z,
914
+ input: d,
915
+ inst: e
916
+ }), k.length ? Promise.all(k).then(() => a) : a;
917
+ };
1512
918
  });
1513
- class ue extends y {
1514
- _parse(e) {
1515
- if (this._getType(e) !== u.undefined) {
1516
- const r = this._getOrReturnCtx(e);
1517
- return c(r, {
1518
- code: d.invalid_type,
1519
- expected: u.undefined,
1520
- received: r.parsedType
1521
- }), m;
1522
- }
1523
- return w(e.data);
1524
- }
919
+ function ie(e, n, t, r) {
920
+ for (const o of e)
921
+ if (o.issues.length === 0)
922
+ return n.value = o.value, n;
923
+ return n.issues.push({
924
+ code: "invalid_union",
925
+ input: n.value,
926
+ inst: t,
927
+ errors: e.map((o) => o.issues.map((u) => I(u, r, P())))
928
+ }), n;
1525
929
  }
1526
- ue.create = (s) => new ue({
1527
- typeName: p.ZodUndefined,
1528
- ...g(s)
930
+ const xn = /* @__PURE__ */ c("$ZodUnion", (e, n) => {
931
+ _.init(e, n), h(e._zod, "optin", () => n.options.some((t) => t._zod.optin === "optional") ? "optional" : void 0), h(e._zod, "optout", () => n.options.some((t) => t._zod.optout === "optional") ? "optional" : void 0), h(e._zod, "values", () => {
932
+ if (n.options.every((t) => t._zod.values))
933
+ return new Set(n.options.flatMap((t) => Array.from(t._zod.values)));
934
+ }), h(e._zod, "pattern", () => {
935
+ if (n.options.every((t) => t._zod.pattern)) {
936
+ const t = n.options.map((r) => r._zod.pattern);
937
+ return new RegExp(`^(${t.map((r) => W(r.source)).join("|")})$`);
938
+ }
939
+ }), e._zod.parse = (t, r) => {
940
+ let o = !1;
941
+ const u = [];
942
+ for (const i of n.options) {
943
+ const s = i._zod.run({
944
+ value: t.value,
945
+ issues: []
946
+ }, r);
947
+ if (s instanceof Promise)
948
+ u.push(s), o = !0;
949
+ else {
950
+ if (s.issues.length === 0)
951
+ return s;
952
+ u.push(s);
953
+ }
954
+ }
955
+ return o ? Promise.all(u).then((i) => ie(i, t, e, r)) : ie(u, t, e, r);
956
+ };
957
+ }), jn = /* @__PURE__ */ c("$ZodIntersection", (e, n) => {
958
+ _.init(e, n), e._zod.parse = (t, r) => {
959
+ const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), i = n.right._zod.run({ value: o, issues: [] }, r);
960
+ return u instanceof Promise || i instanceof Promise ? Promise.all([u, i]).then(([l, f]) => se(t, l, f)) : se(t, u, i);
961
+ };
1529
962
  });
1530
- class le extends y {
1531
- _parse(e) {
1532
- if (this._getType(e) !== u.null) {
1533
- const r = this._getOrReturnCtx(e);
1534
- return c(r, {
1535
- code: d.invalid_type,
1536
- expected: u.null,
1537
- received: r.parsedType
1538
- }), m;
963
+ function B(e, n) {
964
+ if (e === n)
965
+ return { valid: !0, data: e };
966
+ if (e instanceof Date && n instanceof Date && +e == +n)
967
+ return { valid: !0, data: e };
968
+ if (q(e) && q(n)) {
969
+ const t = Object.keys(n), r = Object.keys(e).filter((u) => t.indexOf(u) !== -1), o = { ...e, ...n };
970
+ for (const u of r) {
971
+ const i = B(e[u], n[u]);
972
+ if (!i.valid)
973
+ return {
974
+ valid: !1,
975
+ mergeErrorPath: [u, ...i.mergeErrorPath]
976
+ };
977
+ o[u] = i.data;
978
+ }
979
+ return { valid: !0, data: o };
980
+ }
981
+ if (Array.isArray(e) && Array.isArray(n)) {
982
+ if (e.length !== n.length)
983
+ return { valid: !1, mergeErrorPath: [] };
984
+ const t = [];
985
+ for (let r = 0; r < e.length; r++) {
986
+ const o = e[r], u = n[r], i = B(o, u);
987
+ if (!i.valid)
988
+ return {
989
+ valid: !1,
990
+ mergeErrorPath: [r, ...i.mergeErrorPath]
991
+ };
992
+ t.push(i.data);
1539
993
  }
1540
- return w(e.data);
994
+ return { valid: !0, data: t };
1541
995
  }
996
+ return { valid: !1, mergeErrorPath: [] };
1542
997
  }
1543
- le.create = (s) => new le({
1544
- typeName: p.ZodNull,
1545
- ...g(s)
1546
- });
1547
- class fe extends y {
1548
- constructor() {
1549
- super(...arguments), this._any = !0;
1550
- }
1551
- _parse(e) {
1552
- return w(e.data);
1553
- }
998
+ function se(e, n, t) {
999
+ if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), j(e))
1000
+ return e;
1001
+ const r = B(n.value, t.value);
1002
+ if (!r.valid)
1003
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1004
+ return e.value = r.data, e;
1554
1005
  }
1555
- fe.create = (s) => new fe({
1556
- typeName: p.ZodAny,
1557
- ...g(s)
1006
+ const Sn = /* @__PURE__ */ c("$ZodEnum", (e, n) => {
1007
+ _.init(e, n);
1008
+ const t = Je(n.entries);
1009
+ e._zod.values = new Set(t), e._zod.pattern = new RegExp(`^(${t.filter((r) => en.has(typeof r)).map((r) => typeof r == "string" ? nn(r) : r.toString()).join("|")})$`), e._zod.parse = (r, o) => {
1010
+ const u = r.value;
1011
+ return e._zod.values.has(u) || r.issues.push({
1012
+ code: "invalid_value",
1013
+ values: t,
1014
+ input: u,
1015
+ inst: e
1016
+ }), r;
1017
+ };
1018
+ }), An = /* @__PURE__ */ c("$ZodTransform", (e, n) => {
1019
+ _.init(e, n), e._zod.parse = (t, r) => {
1020
+ const o = n.transform(t.value, t);
1021
+ if (r.async)
1022
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (t.value = i, t));
1023
+ if (o instanceof Promise)
1024
+ throw new S();
1025
+ return t.value = o, t;
1026
+ };
1027
+ }), Rn = /* @__PURE__ */ c("$ZodOptional", (e, n) => {
1028
+ _.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), h(e._zod, "pattern", () => {
1029
+ const t = n.innerType._zod.pattern;
1030
+ return t ? new RegExp(`^(${W(t.source)})?$`) : void 0;
1031
+ }), e._zod.parse = (t, r) => n.innerType._zod.optin === "optional" ? n.innerType._zod.run(t, r) : t.value === void 0 ? t : n.innerType._zod.run(t, r);
1032
+ }), Cn = /* @__PURE__ */ c("$ZodNullable", (e, n) => {
1033
+ _.init(e, n), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "pattern", () => {
1034
+ const t = n.innerType._zod.pattern;
1035
+ return t ? new RegExp(`^(${W(t.source)}|null)$`) : void 0;
1036
+ }), h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1037
+ }), Fn = /* @__PURE__ */ c("$ZodDefault", (e, n) => {
1038
+ _.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1039
+ if (t.value === void 0)
1040
+ return t.value = n.defaultValue, t;
1041
+ const o = n.innerType._zod.run(t, r);
1042
+ return o instanceof Promise ? o.then((u) => ce(u, n)) : ce(o, n);
1043
+ };
1558
1044
  });
1559
- class he extends y {
1560
- constructor() {
1561
- super(...arguments), this._unknown = !0;
1562
- }
1563
- _parse(e) {
1564
- return w(e.data);
1565
- }
1045
+ function ce(e, n) {
1046
+ return e.value === void 0 && (e.value = n.defaultValue), e;
1566
1047
  }
1567
- he.create = (s) => new he({
1568
- typeName: p.ZodUnknown,
1569
- ...g(s)
1048
+ const Mn = /* @__PURE__ */ c("$ZodPrefault", (e, n) => {
1049
+ _.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1050
+ }), Un = /* @__PURE__ */ c("$ZodNonOptional", (e, n) => {
1051
+ _.init(e, n), h(e._zod, "values", () => {
1052
+ const t = n.innerType._zod.values;
1053
+ return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
1054
+ }), e._zod.parse = (t, r) => {
1055
+ const o = n.innerType._zod.run(t, r);
1056
+ return o instanceof Promise ? o.then((u) => ae(u, e)) : ae(o, e);
1057
+ };
1570
1058
  });
1571
- class A extends y {
1572
- _parse(e) {
1573
- const t = this._getOrReturnCtx(e);
1574
- return c(t, {
1575
- code: d.invalid_type,
1576
- expected: u.never,
1577
- received: t.parsedType
1578
- }), m;
1579
- }
1059
+ function ae(e, n) {
1060
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1061
+ code: "invalid_type",
1062
+ expected: "nonoptional",
1063
+ input: e.value,
1064
+ inst: n
1065
+ }), e;
1580
1066
  }
1581
- A.create = (s) => new A({
1582
- typeName: p.ZodNever,
1583
- ...g(s)
1067
+ const Vn = /* @__PURE__ */ c("$ZodCatch", (e, n) => {
1068
+ _.init(e, n), e._zod.optin = "optional", h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1069
+ const o = n.innerType._zod.run(t, r);
1070
+ return o instanceof Promise ? o.then((u) => (t.value = u.value, u.issues.length && (t.value = n.catchValue({
1071
+ ...t,
1072
+ error: {
1073
+ issues: u.issues.map((i) => I(i, r, P()))
1074
+ },
1075
+ input: t.value
1076
+ }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
1077
+ ...t,
1078
+ error: {
1079
+ issues: o.issues.map((u) => I(u, r, P()))
1080
+ },
1081
+ input: t.value
1082
+ }), t.issues = []), t);
1083
+ };
1084
+ }), Dn = /* @__PURE__ */ c("$ZodPipe", (e, n) => {
1085
+ _.init(e, n), h(e._zod, "values", () => n.in._zod.values), h(e._zod, "optin", () => n.in._zod.optin), h(e._zod, "optout", () => n.out._zod.optout), h(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1086
+ const o = n.in._zod.run(t, r);
1087
+ return o instanceof Promise ? o.then((u) => le(u, n, r)) : le(o, n, r);
1088
+ };
1584
1089
  });
1585
- class me extends y {
1586
- _parse(e) {
1587
- if (this._getType(e) !== u.undefined) {
1588
- const r = this._getOrReturnCtx(e);
1589
- return c(r, {
1590
- code: d.invalid_type,
1591
- expected: u.void,
1592
- received: r.parsedType
1593
- }), m;
1594
- }
1595
- return w(e.data);
1596
- }
1090
+ function le(e, n, t) {
1091
+ return j(e) ? e : n.out._zod.run({ value: e.value, issues: e.issues }, t);
1597
1092
  }
1598
- me.create = (s) => new me({
1599
- typeName: p.ZodVoid,
1600
- ...g(s)
1093
+ const Ln = /* @__PURE__ */ c("$ZodReadonly", (e, n) => {
1094
+ _.init(e, n), h(e._zod, "propValues", () => n.innerType._zod.propValues), h(e._zod, "values", () => n.innerType._zod.values), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1095
+ const o = n.innerType._zod.run(t, r);
1096
+ return o instanceof Promise ? o.then(fe) : fe(o);
1097
+ };
1601
1098
  });
1602
- class C extends y {
1603
- _parse(e) {
1604
- const { ctx: t, status: r } = this._processInputParams(e), a = this._def;
1605
- if (t.parsedType !== u.array)
1606
- return c(t, {
1607
- code: d.invalid_type,
1608
- expected: u.array,
1609
- received: t.parsedType
1610
- }), m;
1611
- if (a.exactLength !== null) {
1612
- const i = t.data.length > a.exactLength.value, o = t.data.length < a.exactLength.value;
1613
- (i || o) && (c(t, {
1614
- code: i ? d.too_big : d.too_small,
1615
- minimum: o ? a.exactLength.value : void 0,
1616
- maximum: i ? a.exactLength.value : void 0,
1617
- type: "array",
1618
- inclusive: !0,
1619
- exact: !0,
1620
- message: a.exactLength.message
1621
- }), r.dirty());
1622
- }
1623
- if (a.minLength !== null && t.data.length < a.minLength.value && (c(t, {
1624
- code: d.too_small,
1625
- minimum: a.minLength.value,
1626
- type: "array",
1627
- inclusive: !0,
1628
- exact: !1,
1629
- message: a.minLength.message
1630
- }), r.dirty()), a.maxLength !== null && t.data.length > a.maxLength.value && (c(t, {
1631
- code: d.too_big,
1632
- maximum: a.maxLength.value,
1633
- type: "array",
1634
- inclusive: !0,
1635
- exact: !1,
1636
- message: a.maxLength.message
1637
- }), r.dirty()), t.common.async)
1638
- return Promise.all([...t.data].map((i, o) => a.type._parseAsync(new N(t, i, t.path, o)))).then((i) => b.mergeArray(r, i));
1639
- const n = [...t.data].map((i, o) => a.type._parseSync(new N(t, i, t.path, o)));
1640
- return b.mergeArray(r, n);
1641
- }
1642
- get element() {
1643
- return this._def.type;
1644
- }
1645
- min(e, t) {
1646
- return new C({
1647
- ...this._def,
1648
- minLength: { value: e, message: l.toString(t) }
1649
- });
1650
- }
1651
- max(e, t) {
1652
- return new C({
1653
- ...this._def,
1654
- maxLength: { value: e, message: l.toString(t) }
1655
- });
1656
- }
1657
- length(e, t) {
1658
- return new C({
1659
- ...this._def,
1660
- exactLength: { value: e, message: l.toString(t) }
1661
- });
1662
- }
1663
- nonempty(e) {
1664
- return this.min(1, e);
1665
- }
1099
+ function fe(e) {
1100
+ return e.value = Object.freeze(e.value), e;
1666
1101
  }
1667
- C.create = (s, e) => new C({
1668
- type: s,
1669
- minLength: null,
1670
- maxLength: null,
1671
- exactLength: null,
1672
- typeName: p.ZodArray,
1673
- ...g(e)
1102
+ const Gn = /* @__PURE__ */ c("$ZodCustom", (e, n) => {
1103
+ $.init(e, n), _.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1104
+ const r = t.value, o = n.fn(r);
1105
+ if (o instanceof Promise)
1106
+ return o.then((u) => pe(u, t, r, e));
1107
+ pe(o, t, r, e);
1108
+ };
1674
1109
  });
1675
- function E(s) {
1676
- if (s instanceof x) {
1677
- const e = {};
1678
- for (const t in s.shape) {
1679
- const r = s.shape[t];
1680
- e[t] = O.create(E(r));
1681
- }
1682
- return new x({
1683
- ...s._def,
1684
- shape: () => e
1685
- });
1686
- } else return s instanceof C ? new C({
1687
- ...s._def,
1688
- type: E(s.element)
1689
- }) : s instanceof O ? O.create(E(s.unwrap())) : s instanceof P ? P.create(E(s.unwrap())) : s instanceof I ? I.create(s.items.map((e) => E(e))) : s;
1110
+ function pe(e, n, t, r) {
1111
+ if (!e) {
1112
+ const o = {
1113
+ code: "custom",
1114
+ input: t,
1115
+ inst: r,
1116
+ // incorporates params.error into issue reporting
1117
+ path: [...r._zod.def.path ?? []],
1118
+ // incorporates params.error into issue reporting
1119
+ continue: !r._zod.def.abort
1120
+ // params: inst._zod.def.params,
1121
+ };
1122
+ r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(A(o));
1123
+ }
1690
1124
  }
1691
- class x extends y {
1125
+ class Kn {
1692
1126
  constructor() {
1693
- super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1694
- }
1695
- _getCached() {
1696
- if (this._cached !== null)
1697
- return this._cached;
1698
- const e = this._def.shape(), t = _.objectKeys(e);
1699
- return this._cached = { shape: e, keys: t }, this._cached;
1700
- }
1701
- _parse(e) {
1702
- if (this._getType(e) !== u.object) {
1703
- const h = this._getOrReturnCtx(e);
1704
- return c(h, {
1705
- code: d.invalid_type,
1706
- expected: u.object,
1707
- received: h.parsedType
1708
- }), m;
1709
- }
1710
- const { status: r, ctx: a } = this._processInputParams(e), { shape: n, keys: i } = this._getCached(), o = [];
1711
- if (!(this._def.catchall instanceof A && this._def.unknownKeys === "strip"))
1712
- for (const h in a.data)
1713
- i.includes(h) || o.push(h);
1714
- const f = [];
1715
- for (const h of i) {
1716
- const v = n[h], D = a.data[h];
1717
- f.push({
1718
- key: { status: "valid", value: h },
1719
- value: v._parse(new N(a, D, a.path, h)),
1720
- alwaysSet: h in a.data
1721
- });
1722
- }
1723
- if (this._def.catchall instanceof A) {
1724
- const h = this._def.unknownKeys;
1725
- if (h === "passthrough")
1726
- for (const v of o)
1727
- f.push({
1728
- key: { status: "valid", value: v },
1729
- value: { status: "valid", value: a.data[v] }
1730
- });
1731
- else if (h === "strict")
1732
- o.length > 0 && (c(a, {
1733
- code: d.unrecognized_keys,
1734
- keys: o
1735
- }), r.dirty());
1736
- else if (h !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1737
- } else {
1738
- const h = this._def.catchall;
1739
- for (const v of o) {
1740
- const D = a.data[v];
1741
- f.push({
1742
- key: { status: "valid", value: v },
1743
- value: h._parse(
1744
- new N(a, D, a.path, v)
1745
- //, ctx.child(key), value, getParsedType(value)
1746
- ),
1747
- alwaysSet: v in a.data
1748
- });
1749
- }
1127
+ this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map();
1128
+ }
1129
+ add(n, ...t) {
1130
+ const r = t[0];
1131
+ if (this._map.set(n, r), r && typeof r == "object" && "id" in r) {
1132
+ if (this._idmap.has(r.id))
1133
+ throw new Error(`ID ${r.id} already exists in the registry`);
1134
+ this._idmap.set(r.id, n);
1750
1135
  }
1751
- return a.common.async ? Promise.resolve().then(async () => {
1752
- const h = [];
1753
- for (const v of f) {
1754
- const D = await v.key, Te = await v.value;
1755
- h.push({
1756
- key: D,
1757
- value: Te,
1758
- alwaysSet: v.alwaysSet
1759
- });
1760
- }
1761
- return h;
1762
- }).then((h) => b.mergeObjectSync(r, h)) : b.mergeObjectSync(r, f);
1763
- }
1764
- get shape() {
1765
- return this._def.shape();
1766
- }
1767
- strict(e) {
1768
- return l.errToObj, new x({
1769
- ...this._def,
1770
- unknownKeys: "strict",
1771
- ...e !== void 0 ? {
1772
- errorMap: (t, r) => {
1773
- const a = this._def.errorMap?.(t, r).message ?? r.defaultError;
1774
- return t.code === "unrecognized_keys" ? {
1775
- message: l.errToObj(e).message ?? a
1776
- } : {
1777
- message: a
1778
- };
1779
- }
1780
- } : {}
1781
- });
1782
- }
1783
- strip() {
1784
- return new x({
1785
- ...this._def,
1786
- unknownKeys: "strip"
1787
- });
1788
- }
1789
- passthrough() {
1790
- return new x({
1791
- ...this._def,
1792
- unknownKeys: "passthrough"
1793
- });
1794
- }
1795
- // const AugmentFactory =
1796
- // <Def extends ZodObjectDef>(def: Def) =>
1797
- // <Augmentation extends ZodRawShape>(
1798
- // augmentation: Augmentation
1799
- // ): ZodObject<
1800
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1801
- // Def["unknownKeys"],
1802
- // Def["catchall"]
1803
- // > => {
1804
- // return new ZodObject({
1805
- // ...def,
1806
- // shape: () => ({
1807
- // ...def.shape(),
1808
- // ...augmentation,
1809
- // }),
1810
- // }) as any;
1811
- // };
1812
- extend(e) {
1813
- return new x({
1814
- ...this._def,
1815
- shape: () => ({
1816
- ...this._def.shape(),
1817
- ...e
1818
- })
1819
- });
1820
- }
1821
- /**
1822
- * Prior to zod@1.0.12 there was a bug in the
1823
- * inferred type of merged objects. Please
1824
- * upgrade if you are experiencing issues.
1825
- */
1826
- merge(e) {
1827
- return new x({
1828
- unknownKeys: e._def.unknownKeys,
1829
- catchall: e._def.catchall,
1830
- shape: () => ({
1831
- ...this._def.shape(),
1832
- ...e._def.shape()
1833
- }),
1834
- typeName: p.ZodObject
1835
- });
1836
- }
1837
- // merge<
1838
- // Incoming extends AnyZodObject,
1839
- // Augmentation extends Incoming["shape"],
1840
- // NewOutput extends {
1841
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1842
- // ? Augmentation[k]["_output"]
1843
- // : k extends keyof Output
1844
- // ? Output[k]
1845
- // : never;
1846
- // },
1847
- // NewInput extends {
1848
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1849
- // ? Augmentation[k]["_input"]
1850
- // : k extends keyof Input
1851
- // ? Input[k]
1852
- // : never;
1853
- // }
1854
- // >(
1855
- // merging: Incoming
1856
- // ): ZodObject<
1857
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1858
- // Incoming["_def"]["unknownKeys"],
1859
- // Incoming["_def"]["catchall"],
1860
- // NewOutput,
1861
- // NewInput
1862
- // > {
1863
- // const merged: any = new ZodObject({
1864
- // unknownKeys: merging._def.unknownKeys,
1865
- // catchall: merging._def.catchall,
1866
- // shape: () =>
1867
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1868
- // typeName: ZodFirstPartyTypeKind.ZodObject,
1869
- // }) as any;
1870
- // return merged;
1871
- // }
1872
- setKey(e, t) {
1873
- return this.augment({ [e]: t });
1874
- }
1875
- // merge<Incoming extends AnyZodObject>(
1876
- // merging: Incoming
1877
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
1878
- // ZodObject<
1879
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1880
- // Incoming["_def"]["unknownKeys"],
1881
- // Incoming["_def"]["catchall"]
1882
- // > {
1883
- // // const mergedShape = objectUtil.mergeShapes(
1884
- // // this._def.shape(),
1885
- // // merging._def.shape()
1886
- // // );
1887
- // const merged: any = new ZodObject({
1888
- // unknownKeys: merging._def.unknownKeys,
1889
- // catchall: merging._def.catchall,
1890
- // shape: () =>
1891
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1892
- // typeName: ZodFirstPartyTypeKind.ZodObject,
1893
- // }) as any;
1894
- // return merged;
1895
- // }
1896
- catchall(e) {
1897
- return new x({
1898
- ...this._def,
1899
- catchall: e
1900
- });
1901
- }
1902
- pick(e) {
1903
- const t = {};
1904
- for (const r of _.objectKeys(e))
1905
- e[r] && this.shape[r] && (t[r] = this.shape[r]);
1906
- return new x({
1907
- ...this._def,
1908
- shape: () => t
1909
- });
1136
+ return this;
1910
1137
  }
1911
- omit(e) {
1912
- const t = {};
1913
- for (const r of _.objectKeys(this.shape))
1914
- e[r] || (t[r] = this.shape[r]);
1915
- return new x({
1916
- ...this._def,
1917
- shape: () => t
1918
- });
1138
+ clear() {
1139
+ return this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map(), this;
1919
1140
  }
1920
- /**
1921
- * @deprecated
1922
- */
1923
- deepPartial() {
1924
- return E(this);
1141
+ remove(n) {
1142
+ const t = this._map.get(n);
1143
+ return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
1925
1144
  }
1926
- partial(e) {
1927
- const t = {};
1928
- for (const r of _.objectKeys(this.shape)) {
1929
- const a = this.shape[r];
1930
- e && !e[r] ? t[r] = a : t[r] = a.optional();
1145
+ get(n) {
1146
+ const t = n._zod.parent;
1147
+ if (t) {
1148
+ const r = { ...this.get(t) ?? {} };
1149
+ return delete r.id, { ...r, ...this._map.get(n) };
1931
1150
  }
1932
- return new x({
1933
- ...this._def,
1934
- shape: () => t
1935
- });
1936
- }
1937
- required(e) {
1938
- const t = {};
1939
- for (const r of _.objectKeys(this.shape))
1940
- if (e && !e[r])
1941
- t[r] = this.shape[r];
1942
- else {
1943
- let n = this.shape[r];
1944
- for (; n instanceof O; )
1945
- n = n._def.innerType;
1946
- t[r] = n;
1947
- }
1948
- return new x({
1949
- ...this._def,
1950
- shape: () => t
1951
- });
1151
+ return this._map.get(n);
1952
1152
  }
1953
- keyof() {
1954
- return we(_.objectKeys(this.shape));
1153
+ has(n) {
1154
+ return this._map.has(n);
1955
1155
  }
1956
1156
  }
1957
- x.create = (s, e) => new x({
1958
- shape: () => s,
1959
- unknownKeys: "strip",
1960
- catchall: A.create(),
1961
- typeName: p.ZodObject,
1962
- ...g(e)
1963
- });
1964
- x.strictCreate = (s, e) => new x({
1965
- shape: () => s,
1966
- unknownKeys: "strict",
1967
- catchall: A.create(),
1968
- typeName: p.ZodObject,
1969
- ...g(e)
1970
- });
1971
- x.lazycreate = (s, e) => new x({
1972
- shape: s,
1973
- unknownKeys: "strip",
1974
- catchall: A.create(),
1975
- typeName: p.ZodObject,
1976
- ...g(e)
1977
- });
1978
- class q extends y {
1979
- _parse(e) {
1980
- const { ctx: t } = this._processInputParams(e), r = this._def.options;
1981
- function a(n) {
1982
- for (const o of n)
1983
- if (o.result.status === "valid")
1984
- return o.result;
1985
- for (const o of n)
1986
- if (o.result.status === "dirty")
1987
- return t.common.issues.push(...o.ctx.common.issues), o.result;
1988
- const i = n.map((o) => new T(o.ctx.common.issues));
1989
- return c(t, {
1990
- code: d.invalid_union,
1991
- unionErrors: i
1992
- }), m;
1993
- }
1994
- if (t.common.async)
1995
- return Promise.all(r.map(async (n) => {
1996
- const i = {
1997
- ...t,
1998
- common: {
1999
- ...t.common,
2000
- issues: []
2001
- },
2002
- parent: null
2003
- };
2004
- return {
2005
- result: await n._parseAsync({
2006
- data: t.data,
2007
- path: t.path,
2008
- parent: i
2009
- }),
2010
- ctx: i
2011
- };
2012
- })).then(a);
2013
- {
2014
- let n;
2015
- const i = [];
2016
- for (const f of r) {
2017
- const h = {
2018
- ...t,
2019
- common: {
2020
- ...t.common,
2021
- issues: []
2022
- },
2023
- parent: null
2024
- }, v = f._parseSync({
2025
- data: t.data,
2026
- path: t.path,
2027
- parent: h
2028
- });
2029
- if (v.status === "valid")
2030
- return v;
2031
- v.status === "dirty" && !n && (n = { result: v, ctx: h }), h.common.issues.length && i.push(h.common.issues);
1157
+ function Yn() {
1158
+ return new Kn();
1159
+ }
1160
+ const U = /* @__PURE__ */ Yn();
1161
+ function qn(e, n) {
1162
+ return new e({
1163
+ type: "number",
1164
+ checks: [],
1165
+ ...g(n)
1166
+ });
1167
+ }
1168
+ function Bn(e, n) {
1169
+ return new e({
1170
+ type: "number",
1171
+ check: "number_format",
1172
+ abort: !1,
1173
+ format: "safeint",
1174
+ ...g(n)
1175
+ });
1176
+ }
1177
+ function Xn(e) {
1178
+ return new e({
1179
+ type: "unknown"
1180
+ });
1181
+ }
1182
+ function Jn(e, n) {
1183
+ return new e({
1184
+ type: "never",
1185
+ ...g(n)
1186
+ });
1187
+ }
1188
+ function he(e, n) {
1189
+ return new xe({
1190
+ check: "less_than",
1191
+ ...g(n),
1192
+ value: e,
1193
+ inclusive: !1
1194
+ });
1195
+ }
1196
+ function G(e, n) {
1197
+ return new xe({
1198
+ check: "less_than",
1199
+ ...g(n),
1200
+ value: e,
1201
+ inclusive: !0
1202
+ });
1203
+ }
1204
+ function de(e, n) {
1205
+ return new je({
1206
+ check: "greater_than",
1207
+ ...g(n),
1208
+ value: e,
1209
+ inclusive: !1
1210
+ });
1211
+ }
1212
+ function K(e, n) {
1213
+ return new je({
1214
+ check: "greater_than",
1215
+ ...g(n),
1216
+ value: e,
1217
+ inclusive: !0
1218
+ });
1219
+ }
1220
+ function me(e, n) {
1221
+ return new zn({
1222
+ check: "multiple_of",
1223
+ ...g(n),
1224
+ value: e
1225
+ });
1226
+ }
1227
+ function Wn(e, n) {
1228
+ return new bn({
1229
+ check: "max_length",
1230
+ ...g(n),
1231
+ maximum: e
1232
+ });
1233
+ }
1234
+ function _e(e, n) {
1235
+ return new yn({
1236
+ check: "min_length",
1237
+ ...g(n),
1238
+ minimum: e
1239
+ });
1240
+ }
1241
+ function Hn(e, n) {
1242
+ return new kn({
1243
+ check: "length_equals",
1244
+ ...g(n),
1245
+ length: e
1246
+ });
1247
+ }
1248
+ function Qn(e) {
1249
+ return new $n({
1250
+ check: "overwrite",
1251
+ tx: e
1252
+ });
1253
+ }
1254
+ function et(e, n, t) {
1255
+ return new e({
1256
+ type: "array",
1257
+ element: n,
1258
+ // get element() {
1259
+ // return element;
1260
+ // },
1261
+ ...g(t)
1262
+ });
1263
+ }
1264
+ function nt(e, n, t) {
1265
+ return new e({
1266
+ type: "custom",
1267
+ check: "custom",
1268
+ fn: n,
1269
+ ...g(t)
1270
+ });
1271
+ }
1272
+ const tt = (e, n) => {
1273
+ Pe.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1274
+ format: {
1275
+ value: (t) => pn(e, t)
1276
+ // enumerable: false,
1277
+ },
1278
+ flatten: {
1279
+ value: (t) => fn(e, t)
1280
+ // enumerable: false,
1281
+ },
1282
+ addIssue: {
1283
+ value: (t) => e.issues.push(t)
1284
+ // enumerable: false,
1285
+ },
1286
+ addIssues: {
1287
+ value: (t) => e.issues.push(...t)
1288
+ // enumerable: false,
1289
+ },
1290
+ isEmpty: {
1291
+ get() {
1292
+ return e.issues.length === 0;
2032
1293
  }
2033
- if (n)
2034
- return t.common.issues.push(...n.ctx.common.issues), n.result;
2035
- const o = i.map((f) => new T(f));
2036
- return c(t, {
2037
- code: d.invalid_union,
2038
- unionErrors: o
2039
- }), m;
1294
+ // enumerable: false,
2040
1295
  }
2041
- }
2042
- get options() {
2043
- return this._def.options;
2044
- }
1296
+ });
1297
+ }, V = c("ZodError", tt, {
1298
+ Parent: Error
1299
+ }), rt = /* @__PURE__ */ hn(V), ot = /* @__PURE__ */ dn(V), ut = /* @__PURE__ */ Ne(V), it = /* @__PURE__ */ Te(V), z = /* @__PURE__ */ c("ZodType", (e, n) => (_.init(e, n), e.def = n, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(
1300
+ {
1301
+ ...n,
1302
+ checks: [
1303
+ ...n.checks ?? [],
1304
+ ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1305
+ ]
1306
+ }
1307
+ // { parent: true }
1308
+ ), e.clone = (t, r) => N(e, t, r), e.brand = () => e, e.register = (t, r) => (t.add(e, r), e), e.parse = (t, r) => rt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => ut(e, t, r), e.parseAsync = async (t, r) => ot(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => it(e, t, r), e.spa = e.safeParseAsync, e.refine = (t, r) => e.check(jt(t, r)), e.superRefine = (t) => e.check(St(t)), e.overwrite = (t) => e.check(Qn(t)), e.optional = () => ze(e), e.nullable = () => we(e), e.nullish = () => ze(we(e)), e.nonoptional = (t) => Zt(e, t), e.array = () => Re(e), e.or = (t) => dt([e, t]), e.and = (t) => _t(e, t), e.transform = (t) => be(e, zt(t)), e.default = (t) => yt(e, t), e.prefault = (t) => $t(e, t), e.catch = (t) => Pt(e, t), e.pipe = (t) => be(e, t), e.readonly = () => Tt(e), e.describe = (t) => {
1309
+ const r = e.clone();
1310
+ return U.add(r, { description: t }), r;
1311
+ }, Object.defineProperty(e, "description", {
1312
+ get() {
1313
+ return U.get(e)?.description;
1314
+ },
1315
+ configurable: !0
1316
+ }), e.meta = (...t) => {
1317
+ if (t.length === 0)
1318
+ return U.get(e);
1319
+ const r = e.clone();
1320
+ return U.add(r, t[0]), r;
1321
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ae = /* @__PURE__ */ c("ZodNumber", (e, n) => {
1322
+ Se.init(e, n), z.init(e, n), e.gt = (r, o) => e.check(de(r, o)), e.gte = (r, o) => e.check(K(r, o)), e.min = (r, o) => e.check(K(r, o)), e.lt = (r, o) => e.check(he(r, o)), e.lte = (r, o) => e.check(G(r, o)), e.max = (r, o) => e.check(G(r, o)), e.int = (r) => e.check(ve(r)), e.safe = (r) => e.check(ve(r)), e.positive = (r) => e.check(de(0, r)), e.nonnegative = (r) => e.check(K(0, r)), e.negative = (r) => e.check(he(0, r)), e.nonpositive = (r) => e.check(G(0, r)), e.multipleOf = (r, o) => e.check(me(r, o)), e.step = (r, o) => e.check(me(r, o)), e.finite = () => e;
1323
+ const t = e._zod.bag;
1324
+ e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
1325
+ });
1326
+ function E(e) {
1327
+ return qn(Ae, e);
2045
1328
  }
2046
- q.create = (s, e) => new q({
2047
- options: s,
2048
- typeName: p.ZodUnion,
2049
- ...g(e)
1329
+ const st = /* @__PURE__ */ c("ZodNumberFormat", (e, n) => {
1330
+ Pn.init(e, n), Ae.init(e, n);
2050
1331
  });
2051
- function G(s, e) {
2052
- const t = S(s), r = S(e);
2053
- if (s === e)
2054
- return { valid: !0, data: s };
2055
- if (t === u.object && r === u.object) {
2056
- const a = _.objectKeys(e), n = _.objectKeys(s).filter((o) => a.indexOf(o) !== -1), i = { ...s, ...e };
2057
- for (const o of n) {
2058
- const f = G(s[o], e[o]);
2059
- if (!f.valid)
2060
- return { valid: !1 };
2061
- i[o] = f.data;
2062
- }
2063
- return { valid: !0, data: i };
2064
- } else if (t === u.array && r === u.array) {
2065
- if (s.length !== e.length)
2066
- return { valid: !1 };
2067
- const a = [];
2068
- for (let n = 0; n < s.length; n++) {
2069
- const i = s[n], o = e[n], f = G(i, o);
2070
- if (!f.valid)
2071
- return { valid: !1 };
2072
- a.push(f.data);
2073
- }
2074
- return { valid: !0, data: a };
2075
- } else return t === u.date && r === u.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
2076
- }
2077
- class J extends y {
2078
- _parse(e) {
2079
- const { status: t, ctx: r } = this._processInputParams(e), a = (n, i) => {
2080
- if (ne(n) || ne(i))
2081
- return m;
2082
- const o = G(n.value, i.value);
2083
- return o.valid ? ((ie(n) || ie(i)) && t.dirty(), { status: t.value, value: o.data }) : (c(r, {
2084
- code: d.invalid_intersection_types
2085
- }), m);
2086
- };
2087
- return r.common.async ? Promise.all([
2088
- this._def.left._parseAsync({
2089
- data: r.data,
2090
- path: r.path,
2091
- parent: r
2092
- }),
2093
- this._def.right._parseAsync({
2094
- data: r.data,
2095
- path: r.path,
2096
- parent: r
2097
- })
2098
- ]).then(([n, i]) => a(n, i)) : a(this._def.left._parseSync({
2099
- data: r.data,
2100
- path: r.path,
2101
- parent: r
2102
- }), this._def.right._parseSync({
2103
- data: r.data,
2104
- path: r.path,
2105
- parent: r
2106
- }));
2107
- }
1332
+ function ve(e) {
1333
+ return Bn(st, e);
2108
1334
  }
2109
- J.create = (s, e, t) => new J({
2110
- left: s,
2111
- right: e,
2112
- typeName: p.ZodIntersection,
2113
- ...g(t)
1335
+ const ct = /* @__PURE__ */ c("ZodUnknown", (e, n) => {
1336
+ In.init(e, n), z.init(e, n);
2114
1337
  });
2115
- class I extends y {
2116
- _parse(e) {
2117
- const { status: t, ctx: r } = this._processInputParams(e);
2118
- if (r.parsedType !== u.array)
2119
- return c(r, {
2120
- code: d.invalid_type,
2121
- expected: u.array,
2122
- received: r.parsedType
2123
- }), m;
2124
- if (r.data.length < this._def.items.length)
2125
- return c(r, {
2126
- code: d.too_small,
2127
- minimum: this._def.items.length,
2128
- inclusive: !0,
2129
- exact: !1,
2130
- type: "array"
2131
- }), m;
2132
- !this._def.rest && r.data.length > this._def.items.length && (c(r, {
2133
- code: d.too_big,
2134
- maximum: this._def.items.length,
2135
- inclusive: !0,
2136
- exact: !1,
2137
- type: "array"
2138
- }), t.dirty());
2139
- const n = [...r.data].map((i, o) => {
2140
- const f = this._def.items[o] || this._def.rest;
2141
- return f ? f._parse(new N(r, i, r.path, o)) : null;
2142
- }).filter((i) => !!i);
2143
- return r.common.async ? Promise.all(n).then((i) => b.mergeArray(t, i)) : b.mergeArray(t, n);
2144
- }
2145
- get items() {
2146
- return this._def.items;
2147
- }
2148
- rest(e) {
2149
- return new I({
2150
- ...this._def,
2151
- rest: e
2152
- });
2153
- }
1338
+ function ge() {
1339
+ return Xn(ct);
2154
1340
  }
2155
- I.create = (s, e) => {
2156
- if (!Array.isArray(s))
2157
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2158
- return new I({
2159
- items: s,
2160
- typeName: p.ZodTuple,
2161
- rest: null,
2162
- ...g(e)
2163
- });
2164
- };
2165
- class pe extends y {
2166
- get keySchema() {
2167
- return this._def.keyType;
2168
- }
2169
- get valueSchema() {
2170
- return this._def.valueType;
2171
- }
2172
- _parse(e) {
2173
- const { status: t, ctx: r } = this._processInputParams(e);
2174
- if (r.parsedType !== u.map)
2175
- return c(r, {
2176
- code: d.invalid_type,
2177
- expected: u.map,
2178
- received: r.parsedType
2179
- }), m;
2180
- const a = this._def.keyType, n = this._def.valueType, i = [...r.data.entries()].map(([o, f], h) => ({
2181
- key: a._parse(new N(r, o, r.path, [h, "key"])),
2182
- value: n._parse(new N(r, f, r.path, [h, "value"]))
2183
- }));
2184
- if (r.common.async) {
2185
- const o = /* @__PURE__ */ new Map();
2186
- return Promise.resolve().then(async () => {
2187
- for (const f of i) {
2188
- const h = await f.key, v = await f.value;
2189
- if (h.status === "aborted" || v.status === "aborted")
2190
- return m;
2191
- (h.status === "dirty" || v.status === "dirty") && t.dirty(), o.set(h.value, v.value);
2192
- }
2193
- return { status: t.value, value: o };
2194
- });
2195
- } else {
2196
- const o = /* @__PURE__ */ new Map();
2197
- for (const f of i) {
2198
- const h = f.key, v = f.value;
2199
- if (h.status === "aborted" || v.status === "aborted")
2200
- return m;
2201
- (h.status === "dirty" || v.status === "dirty") && t.dirty(), o.set(h.value, v.value);
2202
- }
2203
- return { status: t.value, value: o };
2204
- }
2205
- }
1341
+ const at = /* @__PURE__ */ c("ZodNever", (e, n) => {
1342
+ Nn.init(e, n), z.init(e, n);
1343
+ });
1344
+ function lt(e) {
1345
+ return Jn(at, e);
2206
1346
  }
2207
- pe.create = (s, e, t) => new pe({
2208
- valueType: e,
2209
- keyType: s,
2210
- typeName: p.ZodMap,
2211
- ...g(t)
1347
+ const ft = /* @__PURE__ */ c("ZodArray", (e, n) => {
1348
+ Tn.init(e, n), z.init(e, n), e.element = n.element, e.min = (t, r) => e.check(_e(t, r)), e.nonempty = (t) => e.check(_e(1, t)), e.max = (t, r) => e.check(Wn(t, r)), e.length = (t, r) => e.check(Hn(t, r)), e.unwrap = () => e.element;
2212
1349
  });
2213
- class B extends y {
2214
- _parse(e) {
2215
- const { status: t, ctx: r } = this._processInputParams(e);
2216
- if (r.parsedType !== u.set)
2217
- return c(r, {
2218
- code: d.invalid_type,
2219
- expected: u.set,
2220
- received: r.parsedType
2221
- }), m;
2222
- const a = this._def;
2223
- a.minSize !== null && r.data.size < a.minSize.value && (c(r, {
2224
- code: d.too_small,
2225
- minimum: a.minSize.value,
2226
- type: "set",
2227
- inclusive: !0,
2228
- exact: !1,
2229
- message: a.minSize.message
2230
- }), t.dirty()), a.maxSize !== null && r.data.size > a.maxSize.value && (c(r, {
2231
- code: d.too_big,
2232
- maximum: a.maxSize.value,
2233
- type: "set",
2234
- inclusive: !0,
2235
- exact: !1,
2236
- message: a.maxSize.message
2237
- }), t.dirty());
2238
- const n = this._def.valueType;
2239
- function i(f) {
2240
- const h = /* @__PURE__ */ new Set();
2241
- for (const v of f) {
2242
- if (v.status === "aborted")
2243
- return m;
2244
- v.status === "dirty" && t.dirty(), h.add(v.value);
2245
- }
2246
- return { status: t.value, value: h };
2247
- }
2248
- const o = [...r.data.values()].map((f, h) => n._parse(new N(r, f, r.path, h)));
2249
- return r.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
2250
- }
2251
- min(e, t) {
2252
- return new B({
2253
- ...this._def,
2254
- minSize: { value: e, message: l.toString(t) }
2255
- });
2256
- }
2257
- max(e, t) {
2258
- return new B({
2259
- ...this._def,
2260
- maxSize: { value: e, message: l.toString(t) }
2261
- });
2262
- }
2263
- size(e, t) {
2264
- return this.min(e, t).max(e, t);
2265
- }
2266
- nonempty(e) {
2267
- return this.min(1, e);
2268
- }
1350
+ function Re(e, n) {
1351
+ return et(ft, e, n);
2269
1352
  }
2270
- B.create = (s, e) => new B({
2271
- valueType: s,
2272
- minSize: null,
2273
- maxSize: null,
2274
- typeName: p.ZodSet,
2275
- ...g(e)
1353
+ const pt = /* @__PURE__ */ c("ZodObject", (e, n) => {
1354
+ On.init(e, n), z.init(e, n), h(e, "shape", () => n.shape), e.keyof = () => vt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ge() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ge() }), e.strict = () => e.clone({ ...e._zod.def, catchall: lt() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => sn(e, t), e.merge = (t) => cn(e, t), e.pick = (t) => on(e, t), e.omit = (t) => un(e, t), e.partial = (...t) => an(Fe, e, t[0]), e.required = (...t) => ln(Me, e, t[0]);
2276
1355
  });
2277
- class ge extends y {
2278
- get schema() {
2279
- return this._def.getter();
2280
- }
2281
- _parse(e) {
2282
- const { ctx: t } = this._processInputParams(e);
2283
- return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2284
- }
1356
+ function Ce(e, n) {
1357
+ const t = {
1358
+ type: "object",
1359
+ get shape() {
1360
+ return H(this, "shape", { ...e }), this.shape;
1361
+ },
1362
+ ...g(n)
1363
+ };
1364
+ return new pt(t);
2285
1365
  }
2286
- ge.create = (s, e) => new ge({
2287
- getter: s,
2288
- typeName: p.ZodLazy,
2289
- ...g(e)
1366
+ const ht = /* @__PURE__ */ c("ZodUnion", (e, n) => {
1367
+ xn.init(e, n), z.init(e, n), e.options = n.options;
2290
1368
  });
2291
- class ye extends y {
2292
- _parse(e) {
2293
- if (e.data !== this._def.value) {
2294
- const t = this._getOrReturnCtx(e);
2295
- return c(t, {
2296
- received: t.data,
2297
- code: d.invalid_literal,
2298
- expected: this._def.value
2299
- }), m;
2300
- }
2301
- return { status: "valid", value: e.data };
2302
- }
2303
- get value() {
2304
- return this._def.value;
2305
- }
1369
+ function dt(e, n) {
1370
+ return new ht({
1371
+ type: "union",
1372
+ options: e,
1373
+ ...g(n)
1374
+ });
2306
1375
  }
2307
- ye.create = (s, e) => new ye({
2308
- value: s,
2309
- typeName: p.ZodLiteral,
2310
- ...g(e)
1376
+ const mt = /* @__PURE__ */ c("ZodIntersection", (e, n) => {
1377
+ jn.init(e, n), z.init(e, n);
2311
1378
  });
2312
- function we(s, e) {
2313
- return new V({
2314
- values: s,
2315
- typeName: p.ZodEnum,
2316
- ...g(e)
1379
+ function _t(e, n) {
1380
+ return new mt({
1381
+ type: "intersection",
1382
+ left: e,
1383
+ right: n
2317
1384
  });
2318
1385
  }
2319
- class V extends y {
2320
- _parse(e) {
2321
- if (typeof e.data != "string") {
2322
- const t = this._getOrReturnCtx(e), r = this._def.values;
2323
- return c(t, {
2324
- expected: _.joinValues(r),
2325
- received: t.parsedType,
2326
- code: d.invalid_type
2327
- }), m;
2328
- }
2329
- if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2330
- const t = this._getOrReturnCtx(e), r = this._def.values;
2331
- return c(t, {
2332
- received: t.data,
2333
- code: d.invalid_enum_value,
2334
- options: r
2335
- }), m;
2336
- }
2337
- return w(e.data);
2338
- }
2339
- get options() {
2340
- return this._def.values;
2341
- }
2342
- get enum() {
2343
- const e = {};
2344
- for (const t of this._def.values)
2345
- e[t] = t;
2346
- return e;
2347
- }
2348
- get Values() {
2349
- const e = {};
2350
- for (const t of this._def.values)
2351
- e[t] = t;
2352
- return e;
2353
- }
2354
- get Enum() {
2355
- const e = {};
2356
- for (const t of this._def.values)
2357
- e[t] = t;
2358
- return e;
2359
- }
2360
- extract(e, t = this._def) {
2361
- return V.create(e, {
2362
- ...this._def,
2363
- ...t
2364
- });
2365
- }
2366
- exclude(e, t = this._def) {
2367
- return V.create(this.options.filter((r) => !e.includes(r)), {
2368
- ...this._def,
2369
- ...t
1386
+ const X = /* @__PURE__ */ c("ZodEnum", (e, n) => {
1387
+ Sn.init(e, n), z.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
1388
+ const t = new Set(Object.keys(n.entries));
1389
+ e.extract = (r, o) => {
1390
+ const u = {};
1391
+ for (const i of r)
1392
+ if (t.has(i))
1393
+ u[i] = n.entries[i];
1394
+ else
1395
+ throw new Error(`Key ${i} not found in enum`);
1396
+ return new X({
1397
+ ...n,
1398
+ checks: [],
1399
+ ...g(o),
1400
+ entries: u
1401
+ });
1402
+ }, e.exclude = (r, o) => {
1403
+ const u = { ...n.entries };
1404
+ for (const i of r)
1405
+ if (t.has(i))
1406
+ delete u[i];
1407
+ else
1408
+ throw new Error(`Key ${i} not found in enum`);
1409
+ return new X({
1410
+ ...n,
1411
+ checks: [],
1412
+ ...g(o),
1413
+ entries: u
2370
1414
  });
2371
- }
1415
+ };
1416
+ });
1417
+ function vt(e, n) {
1418
+ const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
1419
+ return new X({
1420
+ type: "enum",
1421
+ entries: t,
1422
+ ...g(n)
1423
+ });
2372
1424
  }
2373
- V.create = we;
2374
- class _e extends y {
2375
- _parse(e) {
2376
- const t = _.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
2377
- if (r.parsedType !== u.string && r.parsedType !== u.number) {
2378
- const a = _.objectValues(t);
2379
- return c(r, {
2380
- expected: _.joinValues(a),
2381
- received: r.parsedType,
2382
- code: d.invalid_type
2383
- }), m;
2384
- }
2385
- if (this._cache || (this._cache = new Set(_.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2386
- const a = _.objectValues(t);
2387
- return c(r, {
2388
- received: r.data,
2389
- code: d.invalid_enum_value,
2390
- options: a
2391
- }), m;
2392
- }
2393
- return w(e.data);
2394
- }
2395
- get enum() {
2396
- return this._def.values;
2397
- }
1425
+ const gt = /* @__PURE__ */ c("ZodTransform", (e, n) => {
1426
+ An.init(e, n), z.init(e, n), e._zod.parse = (t, r) => {
1427
+ t.addIssue = (u) => {
1428
+ if (typeof u == "string")
1429
+ t.issues.push(A(u, t.value, n));
1430
+ else {
1431
+ const i = u;
1432
+ i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = t.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !0), t.issues.push(A(i));
1433
+ }
1434
+ };
1435
+ const o = n.transform(t.value, t);
1436
+ return o instanceof Promise ? o.then((u) => (t.value = u, t)) : (t.value = o, t);
1437
+ };
1438
+ });
1439
+ function zt(e) {
1440
+ return new gt({
1441
+ type: "transform",
1442
+ transform: e
1443
+ });
2398
1444
  }
2399
- _e.create = (s, e) => new _e({
2400
- values: s,
2401
- typeName: p.ZodNativeEnum,
2402
- ...g(e)
1445
+ const Fe = /* @__PURE__ */ c("ZodOptional", (e, n) => {
1446
+ Rn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
2403
1447
  });
2404
- class H extends y {
2405
- unwrap() {
2406
- return this._def.type;
2407
- }
2408
- _parse(e) {
2409
- const { ctx: t } = this._processInputParams(e);
2410
- if (t.parsedType !== u.promise && t.common.async === !1)
2411
- return c(t, {
2412
- code: d.invalid_type,
2413
- expected: u.promise,
2414
- received: t.parsedType
2415
- }), m;
2416
- const r = t.parsedType === u.promise ? t.data : Promise.resolve(t.data);
2417
- return w(r.then((a) => this._def.type.parseAsync(a, {
2418
- path: t.path,
2419
- errorMap: t.common.contextualErrorMap
2420
- })));
2421
- }
1448
+ function ze(e) {
1449
+ return new Fe({
1450
+ type: "optional",
1451
+ innerType: e
1452
+ });
2422
1453
  }
2423
- H.create = (s, e) => new H({
2424
- type: s,
2425
- typeName: p.ZodPromise,
2426
- ...g(e)
1454
+ const wt = /* @__PURE__ */ c("ZodNullable", (e, n) => {
1455
+ Cn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
2427
1456
  });
2428
- class L extends y {
2429
- innerType() {
2430
- return this._def.schema;
2431
- }
2432
- sourceType() {
2433
- return this._def.schema._def.typeName === p.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2434
- }
2435
- _parse(e) {
2436
- const { status: t, ctx: r } = this._processInputParams(e), a = this._def.effect || null, n = {
2437
- addIssue: (i) => {
2438
- c(r, i), i.fatal ? t.abort() : t.dirty();
2439
- },
2440
- get path() {
2441
- return r.path;
2442
- }
2443
- };
2444
- if (n.addIssue = n.addIssue.bind(n), a.type === "preprocess") {
2445
- const i = a.transform(r.data, n);
2446
- if (r.common.async)
2447
- return Promise.resolve(i).then(async (o) => {
2448
- if (t.value === "aborted")
2449
- return m;
2450
- const f = await this._def.schema._parseAsync({
2451
- data: o,
2452
- path: r.path,
2453
- parent: r
2454
- });
2455
- return f.status === "aborted" ? m : f.status === "dirty" || t.value === "dirty" ? z(f.value) : f;
2456
- });
2457
- {
2458
- if (t.value === "aborted")
2459
- return m;
2460
- const o = this._def.schema._parseSync({
2461
- data: i,
2462
- path: r.path,
2463
- parent: r
2464
- });
2465
- return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? z(o.value) : o;
2466
- }
2467
- }
2468
- if (a.type === "refinement") {
2469
- const i = (o) => {
2470
- const f = a.refinement(o, n);
2471
- if (r.common.async)
2472
- return Promise.resolve(f);
2473
- if (f instanceof Promise)
2474
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2475
- return o;
2476
- };
2477
- if (r.common.async === !1) {
2478
- const o = this._def.schema._parseSync({
2479
- data: r.data,
2480
- path: r.path,
2481
- parent: r
2482
- });
2483
- return o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2484
- } else
2485
- return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2486
- }
2487
- if (a.type === "transform")
2488
- if (r.common.async === !1) {
2489
- const i = this._def.schema._parseSync({
2490
- data: r.data,
2491
- path: r.path,
2492
- parent: r
2493
- });
2494
- if (!j(i))
2495
- return m;
2496
- const o = a.transform(i.value, n);
2497
- if (o instanceof Promise)
2498
- throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2499
- return { status: t.value, value: o };
2500
- } else
2501
- return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => j(i) ? Promise.resolve(a.transform(i.value, n)).then((o) => ({
2502
- status: t.value,
2503
- value: o
2504
- })) : m);
2505
- _.assertNever(a);
2506
- }
1457
+ function we(e) {
1458
+ return new wt({
1459
+ type: "nullable",
1460
+ innerType: e
1461
+ });
2507
1462
  }
2508
- L.create = (s, e, t) => new L({
2509
- schema: s,
2510
- typeName: p.ZodEffects,
2511
- effect: e,
2512
- ...g(t)
1463
+ const bt = /* @__PURE__ */ c("ZodDefault", (e, n) => {
1464
+ Fn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2513
1465
  });
2514
- L.createWithPreprocess = (s, e, t) => new L({
2515
- schema: e,
2516
- effect: { type: "preprocess", transform: s },
2517
- typeName: p.ZodEffects,
2518
- ...g(t)
1466
+ function yt(e, n) {
1467
+ return new bt({
1468
+ type: "default",
1469
+ innerType: e,
1470
+ get defaultValue() {
1471
+ return typeof n == "function" ? n() : n;
1472
+ }
1473
+ });
1474
+ }
1475
+ const kt = /* @__PURE__ */ c("ZodPrefault", (e, n) => {
1476
+ Mn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
2519
1477
  });
2520
- class O extends y {
2521
- _parse(e) {
2522
- return this._getType(e) === u.undefined ? w(void 0) : this._def.innerType._parse(e);
2523
- }
2524
- unwrap() {
2525
- return this._def.innerType;
2526
- }
1478
+ function $t(e, n) {
1479
+ return new kt({
1480
+ type: "prefault",
1481
+ innerType: e,
1482
+ get defaultValue() {
1483
+ return typeof n == "function" ? n() : n;
1484
+ }
1485
+ });
2527
1486
  }
2528
- O.create = (s, e) => new O({
2529
- innerType: s,
2530
- typeName: p.ZodOptional,
2531
- ...g(e)
1487
+ const Me = /* @__PURE__ */ c("ZodNonOptional", (e, n) => {
1488
+ Un.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
2532
1489
  });
2533
- class P extends y {
2534
- _parse(e) {
2535
- return this._getType(e) === u.null ? w(null) : this._def.innerType._parse(e);
2536
- }
2537
- unwrap() {
2538
- return this._def.innerType;
2539
- }
1490
+ function Zt(e, n) {
1491
+ return new Me({
1492
+ type: "nonoptional",
1493
+ innerType: e,
1494
+ ...g(n)
1495
+ });
2540
1496
  }
2541
- P.create = (s, e) => new P({
2542
- innerType: s,
2543
- typeName: p.ZodNullable,
2544
- ...g(e)
1497
+ const Et = /* @__PURE__ */ c("ZodCatch", (e, n) => {
1498
+ Vn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2545
1499
  });
2546
- class K extends y {
2547
- _parse(e) {
2548
- const { ctx: t } = this._processInputParams(e);
2549
- let r = t.data;
2550
- return t.parsedType === u.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
2551
- data: r,
2552
- path: t.path,
2553
- parent: t
2554
- });
2555
- }
2556
- removeDefault() {
2557
- return this._def.innerType;
2558
- }
1500
+ function Pt(e, n) {
1501
+ return new Et({
1502
+ type: "catch",
1503
+ innerType: e,
1504
+ catchValue: typeof n == "function" ? n : () => n
1505
+ });
2559
1506
  }
2560
- K.create = (s, e) => new K({
2561
- innerType: s,
2562
- typeName: p.ZodDefault,
2563
- defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2564
- ...g(e)
1507
+ const It = /* @__PURE__ */ c("ZodPipe", (e, n) => {
1508
+ Dn.init(e, n), z.init(e, n), e.in = n.in, e.out = n.out;
2565
1509
  });
2566
- class ee extends y {
2567
- _parse(e) {
2568
- const { ctx: t } = this._processInputParams(e), r = {
2569
- ...t,
2570
- common: {
2571
- ...t.common,
2572
- issues: []
2573
- }
2574
- }, a = this._def.innerType._parse({
2575
- data: r.data,
2576
- path: r.path,
2577
- parent: {
2578
- ...r
2579
- }
2580
- });
2581
- return F(a) ? a.then((n) => ({
2582
- status: "valid",
2583
- value: n.status === "valid" ? n.value : this._def.catchValue({
2584
- get error() {
2585
- return new T(r.common.issues);
2586
- },
2587
- input: r.data
2588
- })
2589
- })) : {
2590
- status: "valid",
2591
- value: a.status === "valid" ? a.value : this._def.catchValue({
2592
- get error() {
2593
- return new T(r.common.issues);
2594
- },
2595
- input: r.data
2596
- })
2597
- };
2598
- }
2599
- removeCatch() {
2600
- return this._def.innerType;
2601
- }
1510
+ function be(e, n) {
1511
+ return new It({
1512
+ type: "pipe",
1513
+ in: e,
1514
+ out: n
1515
+ // ...util.normalizeParams(params),
1516
+ });
2602
1517
  }
2603
- ee.create = (s, e) => new ee({
2604
- innerType: s,
2605
- typeName: p.ZodCatch,
2606
- catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2607
- ...g(e)
1518
+ const Nt = /* @__PURE__ */ c("ZodReadonly", (e, n) => {
1519
+ Ln.init(e, n), z.init(e, n);
2608
1520
  });
2609
- class ve extends y {
2610
- _parse(e) {
2611
- if (this._getType(e) !== u.nan) {
2612
- const r = this._getOrReturnCtx(e);
2613
- return c(r, {
2614
- code: d.invalid_type,
2615
- expected: u.nan,
2616
- received: r.parsedType
2617
- }), m;
2618
- }
2619
- return { status: "valid", value: e.data };
2620
- }
1521
+ function Tt(e) {
1522
+ return new Nt({
1523
+ type: "readonly",
1524
+ innerType: e
1525
+ });
2621
1526
  }
2622
- ve.create = (s) => new ve({
2623
- typeName: p.ZodNaN,
2624
- ...g(s)
1527
+ const Ot = /* @__PURE__ */ c("ZodCustom", (e, n) => {
1528
+ Gn.init(e, n), z.init(e, n);
2625
1529
  });
2626
- class ot extends y {
2627
- _parse(e) {
2628
- const { ctx: t } = this._processInputParams(e), r = t.data;
2629
- return this._def.type._parse({
2630
- data: r,
2631
- path: t.path,
2632
- parent: t
2633
- });
2634
- }
2635
- unwrap() {
2636
- return this._def.type;
2637
- }
1530
+ function xt(e) {
1531
+ const n = new $({
1532
+ check: "custom"
1533
+ // ...util.normalizeParams(params),
1534
+ });
1535
+ return n._zod.check = e, n;
2638
1536
  }
2639
- class se extends y {
2640
- _parse(e) {
2641
- const { status: t, ctx: r } = this._processInputParams(e);
2642
- if (r.common.async)
2643
- return (async () => {
2644
- const n = await this._def.in._parseAsync({
2645
- data: r.data,
2646
- path: r.path,
2647
- parent: r
2648
- });
2649
- return n.status === "aborted" ? m : n.status === "dirty" ? (t.dirty(), z(n.value)) : this._def.out._parseAsync({
2650
- data: n.value,
2651
- path: r.path,
2652
- parent: r
2653
- });
2654
- })();
2655
- {
2656
- const a = this._def.in._parseSync({
2657
- data: r.data,
2658
- path: r.path,
2659
- parent: r
2660
- });
2661
- return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), {
2662
- status: "dirty",
2663
- value: a.value
2664
- }) : this._def.out._parseSync({
2665
- data: a.value,
2666
- path: r.path,
2667
- parent: r
2668
- });
2669
- }
2670
- }
2671
- static create(e, t) {
2672
- return new se({
2673
- in: e,
2674
- out: t,
2675
- typeName: p.ZodPipeline
2676
- });
2677
- }
1537
+ function jt(e, n = {}) {
1538
+ return nt(Ot, e, n);
2678
1539
  }
2679
- class te extends y {
2680
- _parse(e) {
2681
- const t = this._def.innerType._parse(e), r = (a) => (j(a) && (a.value = Object.freeze(a.value)), a);
2682
- return F(t) ? t.then((a) => r(a)) : r(t);
2683
- }
2684
- unwrap() {
2685
- return this._def.innerType;
2686
- }
1540
+ function St(e) {
1541
+ const n = xt((t) => (t.addIssue = (r) => {
1542
+ if (typeof r == "string")
1543
+ t.issues.push(A(r, t.value, n._zod.def));
1544
+ else {
1545
+ const o = r;
1546
+ o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(A(o));
1547
+ }
1548
+ }, e(t.value, t)));
1549
+ return n;
2687
1550
  }
2688
- te.create = (s, e) => new te({
2689
- innerType: s,
2690
- typeName: p.ZodReadonly,
2691
- ...g(e)
2692
- });
2693
- var p;
2694
- (function(s) {
2695
- s.ZodString = "ZodString", s.ZodNumber = "ZodNumber", s.ZodNaN = "ZodNaN", s.ZodBigInt = "ZodBigInt", s.ZodBoolean = "ZodBoolean", s.ZodDate = "ZodDate", s.ZodSymbol = "ZodSymbol", s.ZodUndefined = "ZodUndefined", s.ZodNull = "ZodNull", s.ZodAny = "ZodAny", s.ZodUnknown = "ZodUnknown", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray", s.ZodObject = "ZodObject", s.ZodUnion = "ZodUnion", s.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", s.ZodIntersection = "ZodIntersection", s.ZodTuple = "ZodTuple", s.ZodRecord = "ZodRecord", s.ZodMap = "ZodMap", s.ZodSet = "ZodSet", s.ZodFunction = "ZodFunction", s.ZodLazy = "ZodLazy", s.ZodLiteral = "ZodLiteral", s.ZodEnum = "ZodEnum", s.ZodEffects = "ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefault", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodReadonly";
2696
- })(p || (p = {}));
2697
- const Z = $.create;
2698
- A.create;
2699
- const dt = C.create, Ce = x.create;
2700
- q.create;
2701
- J.create;
2702
- I.create;
2703
- V.create;
2704
- H.create;
2705
- O.create;
2706
- P.create;
2707
- const _t = (s) => Ce({
2708
- pages: Z(),
2709
- nextPage: Z().optional(),
2710
- totalElements: Z(),
2711
- currentPage: Z(),
2712
- pageSize: Z(),
2713
- elements: dt(s)
2714
- }), vt = Ce({
2715
- page: Z(),
2716
- pageSize: Z()
1551
+ const Gt = (e) => Ce({
1552
+ pages: E(),
1553
+ nextPage: E().optional(),
1554
+ totalElements: E(),
1555
+ currentPage: E(),
1556
+ pageSize: E(),
1557
+ elements: Re(e)
1558
+ }), Kt = Ce({
1559
+ page: E(),
1560
+ pageSize: E()
2717
1561
  });
2718
1562
  export {
2719
- lt as Fail,
2720
- ft as Failure,
2721
- M as Guid,
2722
- ut as Ok,
2723
- vt as PageQuery,
2724
- _t as createPageSchema,
2725
- Se as formatDate,
2726
- yt as formatDateTime,
2727
- Oe as formatTime,
2728
- mt as isFailure,
2729
- ct as mock,
2730
- ht as notFailure,
2731
- pt as parseConfig,
2732
- gt as sleep
1563
+ Ct as Fail,
1564
+ Ft as Failure,
1565
+ x as Guid,
1566
+ Rt as Ok,
1567
+ Kt as PageQuery,
1568
+ Gt as createPageSchema,
1569
+ Ue as formatDate,
1570
+ Lt as formatDateTime,
1571
+ Ve as formatTime,
1572
+ Ut as isFailure,
1573
+ At as mock,
1574
+ Mt as notFailure,
1575
+ Vt as parseConfig,
1576
+ Dt as sleep
2733
1577
  };