@authhero/cloudflare-adapter 2.7.4 → 2.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- var ct = Object.defineProperty;
2
- var dt = (r, e, t) => e in r ? ct(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var ke = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { verificationMethodsSchema as ut } from "@authhero/adapter-interfaces";
5
- import lt from "wretch";
6
- function ft(r, e) {
1
+ var ot = Object.defineProperty;
2
+ var ct = (r, e, t) => e in r ? ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var we = (r, e, t) => ct(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { verificationMethodsSchema as dt } from "@authhero/adapter-interfaces";
5
+ import ut from "wretch";
6
+ function lt(r, e) {
7
7
  var t = {};
8
8
  for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && e.indexOf(s) < 0 && (t[s] = r[s]);
9
9
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
@@ -11,46 +11,46 @@ function ft(r, e) {
11
11
  e.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(r, s[n]) && (t[s[n]] = r[s[n]]);
12
12
  return t;
13
13
  }
14
- function ht(r, e) {
14
+ function ft(r, e) {
15
15
  var t;
16
16
  return ((t = r == null ? void 0 : r._def) === null || t === void 0 ? void 0 : t.typeName) === e;
17
17
  }
18
- function ne(r, e) {
18
+ function ie(r, e) {
19
19
  const t = r.ZodType.prototype[e];
20
20
  r.ZodType.prototype[e] = function(...s) {
21
21
  const n = t.apply(this, s);
22
22
  return n._def.openapi = this._def.openapi, n;
23
23
  };
24
24
  }
25
- function pt(r) {
25
+ function ht(r) {
26
26
  if (typeof r.ZodType.prototype.openapi < "u")
27
27
  return;
28
28
  r.ZodType.prototype.openapi = function(n, a) {
29
- var i, o, c, d, h, b;
30
- const C = typeof n == "string" ? a : n, w = C ?? {}, { param: M } = w, Re = ft(w, ["param"]), D = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof n == "string" ? { refId: n } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Re), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || M ? {
31
- param: Object.assign(Object.assign({}, (b = (h = this._def.openapi) === null || h === void 0 ? void 0 : h.metadata) === null || b === void 0 ? void 0 : b.param), M)
32
- } : void 0), B = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(D).length > 0 ? { _internal: D } : void 0), Object.keys(be).length > 0 ? { metadata: be } : void 0) }));
33
- if (ht(this, "ZodObject")) {
34
- const re = this.extend;
35
- B.extend = function(...se) {
36
- var Ne, Ie, $e, Pe, Me, De;
37
- const Ve = re.apply(this, se);
38
- return Ve._def.openapi = {
29
+ var i, o, c, u, p, b;
30
+ const A = typeof n == "string" ? a : n, w = A ?? {}, { param: V } = w, Ze = lt(w, ["param"]), L = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof n == "string" ? { refId: n } : void 0), be = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), Ze), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || V ? {
31
+ param: Object.assign(Object.assign({}, (b = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || b === void 0 ? void 0 : b.param), V)
32
+ } : void 0), q = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(L).length > 0 ? { _internal: L } : void 0), Object.keys(be).length > 0 ? { metadata: be } : void 0) }));
33
+ if (ft(this, "ZodObject")) {
34
+ const ne = this.extend;
35
+ q.extend = function(...ae) {
36
+ var Ee, Ie, $e, Pe, Me, De, Ve;
37
+ const Le = ne.apply(this, ae);
38
+ return Le._def.openapi = {
39
39
  _internal: {
40
- extendedFrom: !((Ie = (Ne = this._def.openapi) === null || Ne === void 0 ? void 0 : Ne._internal) === null || Ie === void 0) && Ie.refId ? { refId: (Pe = ($e = this._def.openapi) === null || $e === void 0 ? void 0 : $e._internal) === null || Pe === void 0 ? void 0 : Pe.refId, schema: this } : (Me = this._def.openapi) === null || Me === void 0 ? void 0 : Me._internal.extendedFrom
40
+ extendedFrom: !((Ie = (Ee = this._def.openapi) === null || Ee === void 0 ? void 0 : Ee._internal) === null || Ie === void 0) && Ie.refId ? { refId: (Pe = ($e = this._def.openapi) === null || $e === void 0 ? void 0 : $e._internal) === null || Pe === void 0 ? void 0 : Pe.refId, schema: this } : (De = (Me = this._def.openapi) === null || Me === void 0 ? void 0 : Me._internal) === null || De === void 0 ? void 0 : De.extendedFrom
41
41
  },
42
- metadata: (De = Ve._def.openapi) === null || De === void 0 ? void 0 : De.metadata
43
- }, Ve;
42
+ metadata: (Ve = Le._def.openapi) === null || Ve === void 0 ? void 0 : Ve.metadata
43
+ }, Le;
44
44
  };
45
45
  }
46
- return B;
47
- }, ne(r, "optional"), ne(r, "nullable"), ne(r, "default"), ne(r, "transform"), ne(r, "refine");
46
+ return q;
47
+ }, ie(r, "optional"), ie(r, "nullable"), ie(r, "default"), ie(r, "transform"), ie(r, "refine");
48
48
  const e = r.ZodObject.prototype.deepPartial;
49
49
  r.ZodObject.prototype.deepPartial = function() {
50
50
  const n = this._def.shape(), a = e.apply(this), i = a._def.shape();
51
51
  return Object.entries(i).forEach(([o, c]) => {
52
- var d, h;
53
- c._def.openapi = (h = (d = n[o]) === null || d === void 0 ? void 0 : d._def) === null || h === void 0 ? void 0 : h.openapi;
52
+ var u, p;
53
+ c._def.openapi = (p = (u = n[o]) === null || u === void 0 ? void 0 : u._def) === null || p === void 0 ? void 0 : p.openapi;
54
54
  }), a._def.openapi = void 0, a;
55
55
  };
56
56
  const t = r.ZodObject.prototype.pick;
@@ -64,11 +64,11 @@ function pt(r) {
64
64
  return a._def.openapi = void 0, a;
65
65
  };
66
66
  }
67
- var H = class extends Error {
67
+ var G = class extends Error {
68
68
  constructor(e = 500, t) {
69
69
  super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
70
- ke(this, "res");
71
- ke(this, "status");
70
+ we(this, "res");
71
+ we(this, "status");
72
72
  this.res = t == null ? void 0 : t.res, this.status = e;
73
73
  }
74
74
  getResponse() {
@@ -83,7 +83,8 @@ var H = class extends Error {
83
83
  new Set(".\\+*[^]$()");
84
84
  var x;
85
85
  (function(r) {
86
- r.assertEqual = (n) => n;
86
+ r.assertEqual = (n) => {
87
+ };
87
88
  function e(n) {
88
89
  }
89
90
  r.assertIs = e;
@@ -111,20 +112,20 @@ var x;
111
112
  for (const i of n)
112
113
  if (a(i))
113
114
  return i;
114
- }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
115
+ }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && Number.isFinite(n) && Math.floor(n) === n;
115
116
  function s(n, a = " | ") {
116
117
  return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
117
118
  }
118
119
  r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
119
120
  })(x || (x = {}));
120
- var Be;
121
+ var Fe;
121
122
  (function(r) {
122
123
  r.mergeShapes = (e, t) => ({
123
124
  ...e,
124
125
  ...t
125
126
  // second overwrites first
126
127
  });
127
- })(Be || (Be = {}));
128
+ })(Fe || (Fe = {}));
128
129
  const f = x.arrayToEnum([
129
130
  "string",
130
131
  "nan",
@@ -146,14 +147,14 @@ const f = x.arrayToEnum([
146
147
  "never",
147
148
  "map",
148
149
  "set"
149
- ]), $ = (r) => {
150
+ ]), M = (r) => {
150
151
  switch (typeof r) {
151
152
  case "undefined":
152
153
  return f.undefined;
153
154
  case "string":
154
155
  return f.string;
155
156
  case "number":
156
- return isNaN(r) ? f.nan : f.number;
157
+ return Number.isNaN(r) ? f.nan : f.number;
157
158
  case "boolean":
158
159
  return f.boolean;
159
160
  case "function":
@@ -167,7 +168,7 @@ const f = x.arrayToEnum([
167
168
  default:
168
169
  return f.unknown;
169
170
  }
170
- }, u = x.arrayToEnum([
171
+ }, d = x.arrayToEnum([
171
172
  "invalid_type",
172
173
  "invalid_literal",
173
174
  "custom",
@@ -184,8 +185,8 @@ const f = x.arrayToEnum([
184
185
  "invalid_intersection_types",
185
186
  "not_multiple_of",
186
187
  "not_finite"
187
- ]), mt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
188
- class Z extends Error {
188
+ ]), pt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
189
+ class S extends Error {
189
190
  get errors() {
190
191
  return this.issues;
191
192
  }
@@ -214,15 +215,15 @@ class Z extends Error {
214
215
  else {
215
216
  let o = s, c = 0;
216
217
  for (; c < i.path.length; ) {
217
- const d = i.path[c];
218
- c === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(t(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], c++;
218
+ const u = i.path[c];
219
+ c === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], c++;
219
220
  }
220
221
  }
221
222
  };
222
223
  return n(this), s;
223
224
  }
224
225
  static assert(e) {
225
- if (!(e instanceof Z))
226
+ if (!(e instanceof S))
226
227
  throw new Error(`Not a ZodError: ${e}`);
227
228
  }
228
229
  toString() {
@@ -237,63 +238,67 @@ class Z extends Error {
237
238
  flatten(e = (t) => t.message) {
238
239
  const t = {}, s = [];
239
240
  for (const n of this.issues)
240
- n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
241
+ if (n.path.length > 0) {
242
+ const a = n.path[0];
243
+ t[a] = t[a] || [], t[a].push(e(n));
244
+ } else
245
+ s.push(e(n));
241
246
  return { formErrors: s, fieldErrors: t };
242
247
  }
243
248
  get formErrors() {
244
249
  return this.flatten();
245
250
  }
246
251
  }
247
- Z.create = (r) => new Z(r);
248
- const Q = (r, e) => {
252
+ S.create = (r) => new S(r);
253
+ const te = (r, e) => {
249
254
  let t;
250
255
  switch (r.code) {
251
- case u.invalid_type:
256
+ case d.invalid_type:
252
257
  r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
253
258
  break;
254
- case u.invalid_literal:
259
+ case d.invalid_literal:
255
260
  t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
256
261
  break;
257
- case u.unrecognized_keys:
262
+ case d.unrecognized_keys:
258
263
  t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
259
264
  break;
260
- case u.invalid_union:
265
+ case d.invalid_union:
261
266
  t = "Invalid input";
262
267
  break;
263
- case u.invalid_union_discriminator:
268
+ case d.invalid_union_discriminator:
264
269
  t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
265
270
  break;
266
- case u.invalid_enum_value:
271
+ case d.invalid_enum_value:
267
272
  t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
268
273
  break;
269
- case u.invalid_arguments:
274
+ case d.invalid_arguments:
270
275
  t = "Invalid function arguments";
271
276
  break;
272
- case u.invalid_return_type:
277
+ case d.invalid_return_type:
273
278
  t = "Invalid function return type";
274
279
  break;
275
- case u.invalid_date:
280
+ case d.invalid_date:
276
281
  t = "Invalid date";
277
282
  break;
278
- case u.invalid_string:
283
+ case d.invalid_string:
279
284
  typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
280
285
  break;
281
- case u.too_small:
282
- r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
286
+ case d.too_small:
287
+ r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "bigint" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
283
288
  break;
284
- case u.too_big:
289
+ case d.too_big:
285
290
  r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
286
291
  break;
287
- case u.custom:
292
+ case d.custom:
288
293
  t = "Invalid input";
289
294
  break;
290
- case u.invalid_intersection_types:
295
+ case d.invalid_intersection_types:
291
296
  t = "Intersection results could not be merged";
292
297
  break;
293
- case u.not_multiple_of:
298
+ case d.not_multiple_of:
294
299
  t = `Number must be a multiple of ${r.multipleOf}`;
295
300
  break;
296
- case u.not_finite:
301
+ case d.not_finite:
297
302
  t = "Number must be finite";
298
303
  break;
299
304
  default:
@@ -301,14 +306,14 @@ const Q = (r, e) => {
301
306
  }
302
307
  return { message: t };
303
308
  };
304
- let Ke = Q;
305
- function _t(r) {
306
- Ke = r;
309
+ let Qe = te;
310
+ function mt(r) {
311
+ Qe = r;
307
312
  }
308
- function we() {
309
- return Ke;
313
+ function Te() {
314
+ return Qe;
310
315
  }
311
- const Te = (r) => {
316
+ const Ce = (r) => {
312
317
  const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
313
318
  ...n,
314
319
  path: a
@@ -320,9 +325,9 @@ const Te = (r) => {
320
325
  message: n.message
321
326
  };
322
327
  let o = "";
323
- const c = s.filter((d) => !!d).slice().reverse();
324
- for (const d of c)
325
- o = d(i, { data: e, defaultError: o }).message;
328
+ const c = s.filter((u) => !!u).slice().reverse();
329
+ for (const u of c)
330
+ o = u(i, { data: e, defaultError: o }).message;
326
331
  return {
327
332
  ...n,
328
333
  path: a,
@@ -330,7 +335,7 @@ const Te = (r) => {
330
335
  };
331
336
  }, yt = [];
332
337
  function l(r, e) {
333
- const t = we(), s = Te({
338
+ const t = Te(), s = Ce({
334
339
  issueData: e,
335
340
  data: r.data,
336
341
  path: r.path,
@@ -341,7 +346,7 @@ function l(r, e) {
341
346
  // then schema-bound map if available
342
347
  t,
343
348
  // then global override map
344
- t === Q ? void 0 : Q
349
+ t === te ? void 0 : te
345
350
  // then global default map
346
351
  ].filter((n) => !!n)
347
352
  });
@@ -361,7 +366,7 @@ class T {
361
366
  const s = [];
362
367
  for (const n of t) {
363
368
  if (n.status === "aborted")
364
- return y;
369
+ return m;
365
370
  n.status === "dirty" && e.dirty(), s.push(n.value);
366
371
  }
367
372
  return { status: e.value, value: s };
@@ -382,38 +387,29 @@ class T {
382
387
  for (const n of t) {
383
388
  const { key: a, value: i } = n;
384
389
  if (a.status === "aborted" || i.status === "aborted")
385
- return y;
390
+ return m;
386
391
  a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (s[a.value] = i.value);
387
392
  }
388
393
  return { status: e.value, value: s };
389
394
  }
390
395
  }
391
- const y = Object.freeze({
396
+ const m = Object.freeze({
392
397
  status: "aborted"
393
- }), K = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Fe = (r) => r.status === "aborted", qe = (r) => r.status === "dirty", q = (r) => r.status === "valid", oe = (r) => typeof Promise < "u" && r instanceof Promise;
394
- function Se(r, e, t, s) {
395
- if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
396
- return e.get(r);
397
- }
398
- function Xe(r, e, t, s, n) {
399
- if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
400
- return e.set(r, t), t;
401
- }
402
- var m;
398
+ }), Q = (r) => ({ status: "dirty", value: r }), C = (r) => ({ status: "valid", value: r }), qe = (r) => r.status === "aborted", We = (r) => r.status === "dirty", J = (r) => r.status === "valid", oe = (r) => typeof Promise < "u" && r instanceof Promise;
399
+ var h;
403
400
  (function(r) {
404
401
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
405
- })(m || (m = {}));
406
- var ae, ie;
407
- class R {
402
+ })(h || (h = {}));
403
+ class I {
408
404
  constructor(e, t, s, n) {
409
405
  this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
410
406
  }
411
407
  get path() {
412
- return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
408
+ return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
413
409
  }
414
410
  }
415
- const He = (r, e) => {
416
- if (q(e))
411
+ const Ge = (r, e) => {
412
+ if (J(e))
417
413
  return { success: !0, data: e.value };
418
414
  if (!r.common.issues.length)
419
415
  throw new Error("Validation failed but no issues detected.");
@@ -422,35 +418,34 @@ const He = (r, e) => {
422
418
  get error() {
423
419
  if (this._error)
424
420
  return this._error;
425
- const t = new Z(r.common.issues);
421
+ const t = new S(r.common.issues);
426
422
  return this._error = t, this._error;
427
423
  }
428
424
  };
429
425
  };
430
- function v(r) {
426
+ function _(r) {
431
427
  if (!r)
432
428
  return {};
433
429
  const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
434
430
  if (e && (t || s))
435
431
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
436
432
  return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
437
- var c, d;
438
- const { message: h } = r;
439
- return i.code === "invalid_enum_value" ? { message: h ?? o.defaultError } : typeof o.data > "u" ? { message: (c = h ?? s) !== null && c !== void 0 ? c : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = h ?? t) !== null && d !== void 0 ? d : o.defaultError };
433
+ const { message: c } = r;
434
+ return i.code === "invalid_enum_value" ? { message: c ?? o.defaultError } : typeof o.data > "u" ? { message: c ?? s ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: c ?? t ?? o.defaultError };
440
435
  }, description: n };
441
436
  }
442
- class g {
437
+ class v {
443
438
  get description() {
444
439
  return this._def.description;
445
440
  }
446
441
  _getType(e) {
447
- return $(e.data);
442
+ return M(e.data);
448
443
  }
449
444
  _getOrReturnCtx(e, t) {
450
445
  return t || {
451
446
  common: e.parent.common,
452
447
  data: e.data,
453
- parsedType: $(e.data),
448
+ parsedType: M(e.data),
454
449
  schemaErrorMap: this._def.errorMap,
455
450
  path: e.path,
456
451
  parent: e.parent
@@ -462,7 +457,7 @@ class g {
462
457
  ctx: {
463
458
  common: e.parent.common,
464
459
  data: e.data,
465
- parsedType: $(e.data),
460
+ parsedType: M(e.data),
466
461
  schemaErrorMap: this._def.errorMap,
467
462
  path: e.path,
468
463
  parent: e.parent
@@ -486,24 +481,23 @@ class g {
486
481
  throw s.error;
487
482
  }
488
483
  safeParse(e, t) {
489
- var s;
490
- const n = {
484
+ const s = {
491
485
  common: {
492
486
  issues: [],
493
- async: (s = t == null ? void 0 : t.async) !== null && s !== void 0 ? s : !1,
487
+ async: (t == null ? void 0 : t.async) ?? !1,
494
488
  contextualErrorMap: t == null ? void 0 : t.errorMap
495
489
  },
496
490
  path: (t == null ? void 0 : t.path) || [],
497
491
  schemaErrorMap: this._def.errorMap,
498
492
  parent: null,
499
493
  data: e,
500
- parsedType: $(e)
501
- }, a = this._parseSync({ data: e, path: n.path, parent: n });
502
- return He(n, a);
494
+ parsedType: M(e)
495
+ }, n = this._parseSync({ data: e, path: s.path, parent: s });
496
+ return Ge(s, n);
503
497
  }
504
498
  "~validate"(e) {
505
- var t, s;
506
- const n = {
499
+ var s, n;
500
+ const t = {
507
501
  common: {
508
502
  issues: [],
509
503
  async: !!this["~standard"].async
@@ -512,26 +506,26 @@ class g {
512
506
  schemaErrorMap: this._def.errorMap,
513
507
  parent: null,
514
508
  data: e,
515
- parsedType: $(e)
509
+ parsedType: M(e)
516
510
  };
517
511
  if (!this["~standard"].async)
518
512
  try {
519
- const a = this._parseSync({ data: e, path: [], parent: n });
520
- return q(a) ? {
513
+ const a = this._parseSync({ data: e, path: [], parent: t });
514
+ return J(a) ? {
521
515
  value: a.value
522
516
  } : {
523
- issues: n.common.issues
517
+ issues: t.common.issues
524
518
  };
525
519
  } catch (a) {
526
- !((s = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), n.common = {
520
+ (n = (s = a == null ? void 0 : a.message) == null ? void 0 : s.toLowerCase()) != null && n.includes("encountered") && (this["~standard"].async = !0), t.common = {
527
521
  issues: [],
528
522
  async: !0
529
523
  };
530
524
  }
531
- return this._parseAsync({ data: e, path: [], parent: n }).then((a) => q(a) ? {
525
+ return this._parseAsync({ data: e, path: [], parent: t }).then((a) => J(a) ? {
532
526
  value: a.value
533
527
  } : {
534
- issues: n.common.issues
528
+ issues: t.common.issues
535
529
  });
536
530
  }
537
531
  async parseAsync(e, t) {
@@ -551,15 +545,15 @@ class g {
551
545
  schemaErrorMap: this._def.errorMap,
552
546
  parent: null,
553
547
  data: e,
554
- parsedType: $(e)
548
+ parsedType: M(e)
555
549
  }, n = this._parse({ data: e, path: s.path, parent: s }), a = await (oe(n) ? n : Promise.resolve(n));
556
- return He(s, a);
550
+ return Ge(s, a);
557
551
  }
558
552
  refine(e, t) {
559
553
  const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
560
554
  return this._refinement((n, a) => {
561
555
  const i = e(n), o = () => a.addIssue({
562
- code: u.custom,
556
+ code: d.custom,
563
557
  ...s(n)
564
558
  });
565
559
  return typeof Promise < "u" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
@@ -569,9 +563,9 @@ class g {
569
563
  return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
570
564
  }
571
565
  _refinement(e) {
572
- return new A({
566
+ return new N({
573
567
  schema: this,
574
- typeName: _.ZodEffects,
568
+ typeName: y.ZodEffects,
575
569
  effect: { type: "refinement", refinement: e }
576
570
  });
577
571
  }
@@ -589,16 +583,16 @@ class g {
589
583
  return E.create(this, this._def);
590
584
  }
591
585
  nullable() {
592
- return U.create(this, this._def);
586
+ return F.create(this, this._def);
593
587
  }
594
588
  nullish() {
595
589
  return this.nullable().optional();
596
590
  }
597
591
  array() {
598
- return j.create(this);
592
+ return R.create(this);
599
593
  }
600
594
  promise() {
601
- return te.create(this, this._def);
595
+ return se.create(this, this._def);
602
596
  }
603
597
  or(e) {
604
598
  return le.create([this, e], this._def);
@@ -607,36 +601,36 @@ class g {
607
601
  return fe.create(this, e, this._def);
608
602
  }
609
603
  transform(e) {
610
- return new A({
611
- ...v(this._def),
604
+ return new N({
605
+ ..._(this._def),
612
606
  schema: this,
613
- typeName: _.ZodEffects,
607
+ typeName: y.ZodEffects,
614
608
  effect: { type: "transform", transform: e }
615
609
  });
616
610
  }
617
611
  default(e) {
618
612
  const t = typeof e == "function" ? e : () => e;
619
- return new ye({
620
- ...v(this._def),
613
+ return new _e({
614
+ ..._(this._def),
621
615
  innerType: this,
622
616
  defaultValue: t,
623
- typeName: _.ZodDefault
617
+ typeName: y.ZodDefault
624
618
  });
625
619
  }
626
620
  brand() {
627
- return new Je({
628
- typeName: _.ZodBranded,
621
+ return new He({
622
+ typeName: y.ZodBranded,
629
623
  type: this,
630
- ...v(this._def)
624
+ ..._(this._def)
631
625
  });
632
626
  }
633
627
  catch(e) {
634
628
  const t = typeof e == "function" ? e : () => e;
635
- return new ve({
636
- ...v(this._def),
629
+ return new ge({
630
+ ..._(this._def),
637
631
  innerType: this,
638
632
  catchValue: t,
639
- typeName: _.ZodCatch
633
+ typeName: y.ZodCatch
640
634
  });
641
635
  }
642
636
  describe(e) {
@@ -650,7 +644,7 @@ class g {
650
644
  return xe.create(this, e);
651
645
  }
652
646
  readonly() {
653
- return ge.create(this);
647
+ return ve.create(this);
654
648
  }
655
649
  isOptional() {
656
650
  return this.safeParse(void 0).success;
@@ -659,55 +653,58 @@ class g {
659
653
  return this.safeParse(null).success;
660
654
  }
661
655
  }
662
- const vt = /^c[^\s-]{8,}$/i, gt = /^[0-9a-z]+$/, xt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, bt = /^[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, kt = /^[a-z0-9_-]{21}$/i, wt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Tt = /^[-+]?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)?)??$/, St = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
663
- let Le;
664
- const Zt = /^(?:(?: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])$/, Ot = /^(?:(?: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])$/, jt = /^(([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]))$/, At = /^(([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])$/, Et = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Rt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Qe = "((\\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])))", Nt = new RegExp(`^${Qe}$`);
665
- function et(r) {
656
+ const _t = /^c[^\s-]{8,}$/i, gt = /^[0-9a-z]+$/, vt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, xt = /^[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, kt = /^[a-z0-9_-]{21}$/i, bt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, wt = /^[-+]?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)?)??$/, Tt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
657
+ let ze;
658
+ const St = /^(?:(?: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])$/, Ot = /^(?:(?: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])$/, At = /^(([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]))$/, jt = /^(([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])$/, Rt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Nt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, et = "((\\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])))", Zt = new RegExp(`^${et}$`);
659
+ function tt(r) {
666
660
  let e = "[0-5]\\d";
667
661
  r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
668
662
  const t = r.precision ? "+" : "?";
669
663
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
670
664
  }
671
- function It(r) {
672
- return new RegExp(`^${et(r)}$`);
665
+ function Et(r) {
666
+ return new RegExp(`^${tt(r)}$`);
673
667
  }
674
- function tt(r) {
675
- let e = `${Qe}T${et(r)}`;
668
+ function rt(r) {
669
+ let e = `${et}T${tt(r)}`;
676
670
  const t = [];
677
671
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
678
672
  }
679
- function $t(r, e) {
680
- return !!((e === "v4" || !e) && Zt.test(r) || (e === "v6" || !e) && jt.test(r));
673
+ function It(r, e) {
674
+ return !!((e === "v4" || !e) && St.test(r) || (e === "v6" || !e) && At.test(r));
681
675
  }
682
- function Pt(r, e) {
683
- if (!wt.test(r))
676
+ function $t(r, e) {
677
+ if (!bt.test(r))
684
678
  return !1;
685
679
  try {
686
- const [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
687
- return !(typeof n != "object" || n === null || !n.typ || !n.alg || e && n.alg !== e);
680
+ const [t] = r.split(".");
681
+ if (!t)
682
+ return !1;
683
+ const s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
684
+ return !(typeof n != "object" || n === null || "typ" in n && (n == null ? void 0 : n.typ) !== "JWT" || !n.alg || e && n.alg !== e);
688
685
  } catch {
689
686
  return !1;
690
687
  }
691
688
  }
692
- function Mt(r, e) {
693
- return !!((e === "v4" || !e) && Ot.test(r) || (e === "v6" || !e) && At.test(r));
689
+ function Pt(r, e) {
690
+ return !!((e === "v4" || !e) && Ot.test(r) || (e === "v6" || !e) && jt.test(r));
694
691
  }
695
- class O extends g {
692
+ class j extends v {
696
693
  _parse(e) {
697
694
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
698
695
  const a = this._getOrReturnCtx(e);
699
696
  return l(a, {
700
- code: u.invalid_type,
697
+ code: d.invalid_type,
701
698
  expected: f.string,
702
699
  received: a.parsedType
703
- }), y;
700
+ }), m;
704
701
  }
705
702
  const s = new T();
706
703
  let n;
707
704
  for (const a of this._def.checks)
708
705
  if (a.kind === "min")
709
706
  e.data.length < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
710
- code: u.too_small,
707
+ code: d.too_small,
711
708
  minimum: a.value,
712
709
  type: "string",
713
710
  inclusive: !0,
@@ -716,7 +713,7 @@ class O extends g {
716
713
  }), s.dirty());
717
714
  else if (a.kind === "max")
718
715
  e.data.length > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
719
- code: u.too_big,
716
+ code: d.too_big,
720
717
  maximum: a.value,
721
718
  type: "string",
722
719
  inclusive: !0,
@@ -726,14 +723,14 @@ class O extends g {
726
723
  else if (a.kind === "length") {
727
724
  const i = e.data.length > a.value, o = e.data.length < a.value;
728
725
  (i || o) && (n = this._getOrReturnCtx(e, n), i ? l(n, {
729
- code: u.too_big,
726
+ code: d.too_big,
730
727
  maximum: a.value,
731
728
  type: "string",
732
729
  inclusive: !0,
733
730
  exact: !0,
734
731
  message: a.message
735
732
  }) : o && l(n, {
736
- code: u.too_small,
733
+ code: d.too_small,
737
734
  minimum: a.value,
738
735
  type: "string",
739
736
  inclusive: !0,
@@ -741,45 +738,45 @@ class O extends g {
741
738
  message: a.message
742
739
  }), s.dirty());
743
740
  } else if (a.kind === "email")
744
- St.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
741
+ Tt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
745
742
  validation: "email",
746
- code: u.invalid_string,
743
+ code: d.invalid_string,
747
744
  message: a.message
748
745
  }), s.dirty());
749
746
  else if (a.kind === "emoji")
750
- Le || (Le = new RegExp(Ct, "u")), Le.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
747
+ ze || (ze = new RegExp(Ct, "u")), ze.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
751
748
  validation: "emoji",
752
- code: u.invalid_string,
749
+ code: d.invalid_string,
753
750
  message: a.message
754
751
  }), s.dirty());
755
752
  else if (a.kind === "uuid")
756
- bt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
753
+ xt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
757
754
  validation: "uuid",
758
- code: u.invalid_string,
755
+ code: d.invalid_string,
759
756
  message: a.message
760
757
  }), s.dirty());
761
758
  else if (a.kind === "nanoid")
762
759
  kt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
763
760
  validation: "nanoid",
764
- code: u.invalid_string,
761
+ code: d.invalid_string,
765
762
  message: a.message
766
763
  }), s.dirty());
767
764
  else if (a.kind === "cuid")
768
- vt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
765
+ _t.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
769
766
  validation: "cuid",
770
- code: u.invalid_string,
767
+ code: d.invalid_string,
771
768
  message: a.message
772
769
  }), s.dirty());
773
770
  else if (a.kind === "cuid2")
774
771
  gt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
775
772
  validation: "cuid2",
776
- code: u.invalid_string,
773
+ code: d.invalid_string,
777
774
  message: a.message
778
775
  }), s.dirty());
779
776
  else if (a.kind === "ulid")
780
- xt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
777
+ vt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
781
778
  validation: "ulid",
782
- code: u.invalid_string,
779
+ code: d.invalid_string,
783
780
  message: a.message
784
781
  }), s.dirty());
785
782
  else if (a.kind === "url")
@@ -788,61 +785,61 @@ class O extends g {
788
785
  } catch {
789
786
  n = this._getOrReturnCtx(e, n), l(n, {
790
787
  validation: "url",
791
- code: u.invalid_string,
788
+ code: d.invalid_string,
792
789
  message: a.message
793
790
  }), s.dirty();
794
791
  }
795
792
  else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
796
793
  validation: "regex",
797
- code: u.invalid_string,
794
+ code: d.invalid_string,
798
795
  message: a.message
799
796
  }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), l(n, {
800
- code: u.invalid_string,
797
+ code: d.invalid_string,
801
798
  validation: { includes: a.value, position: a.position },
802
799
  message: a.message
803
800
  }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
804
- code: u.invalid_string,
801
+ code: d.invalid_string,
805
802
  validation: { startsWith: a.value },
806
803
  message: a.message
807
804
  }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
808
- code: u.invalid_string,
805
+ code: d.invalid_string,
809
806
  validation: { endsWith: a.value },
810
807
  message: a.message
811
- }), s.dirty()) : a.kind === "datetime" ? tt(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
812
- code: u.invalid_string,
808
+ }), s.dirty()) : a.kind === "datetime" ? rt(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
809
+ code: d.invalid_string,
813
810
  validation: "datetime",
814
811
  message: a.message
815
- }), s.dirty()) : a.kind === "date" ? Nt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
816
- code: u.invalid_string,
812
+ }), s.dirty()) : a.kind === "date" ? Zt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
813
+ code: d.invalid_string,
817
814
  validation: "date",
818
815
  message: a.message
819
- }), s.dirty()) : a.kind === "time" ? It(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
820
- code: u.invalid_string,
816
+ }), s.dirty()) : a.kind === "time" ? Et(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
817
+ code: d.invalid_string,
821
818
  validation: "time",
822
819
  message: a.message
823
- }), s.dirty()) : a.kind === "duration" ? Tt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
820
+ }), s.dirty()) : a.kind === "duration" ? wt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
824
821
  validation: "duration",
825
- code: u.invalid_string,
822
+ code: d.invalid_string,
826
823
  message: a.message
827
- }), s.dirty()) : a.kind === "ip" ? $t(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
824
+ }), s.dirty()) : a.kind === "ip" ? It(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
828
825
  validation: "ip",
829
- code: u.invalid_string,
826
+ code: d.invalid_string,
830
827
  message: a.message
831
- }), s.dirty()) : a.kind === "jwt" ? Pt(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), l(n, {
828
+ }), s.dirty()) : a.kind === "jwt" ? $t(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), l(n, {
832
829
  validation: "jwt",
833
- code: u.invalid_string,
830
+ code: d.invalid_string,
834
831
  message: a.message
835
- }), s.dirty()) : a.kind === "cidr" ? Mt(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
832
+ }), s.dirty()) : a.kind === "cidr" ? Pt(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
836
833
  validation: "cidr",
837
- code: u.invalid_string,
834
+ code: d.invalid_string,
838
835
  message: a.message
839
- }), s.dirty()) : a.kind === "base64" ? Et.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
836
+ }), s.dirty()) : a.kind === "base64" ? Rt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
840
837
  validation: "base64",
841
- code: u.invalid_string,
838
+ code: d.invalid_string,
842
839
  message: a.message
843
- }), s.dirty()) : a.kind === "base64url" ? Rt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
840
+ }), s.dirty()) : a.kind === "base64url" ? Nt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
844
841
  validation: "base64url",
845
- code: u.invalid_string,
842
+ code: d.invalid_string,
846
843
  message: a.message
847
844
  }), s.dirty()) : x.assertNever(a);
848
845
  return { status: s.value, value: e.data };
@@ -850,60 +847,59 @@ class O extends g {
850
847
  _regex(e, t, s) {
851
848
  return this.refinement((n) => e.test(n), {
852
849
  validation: t,
853
- code: u.invalid_string,
854
- ...m.errToObj(s)
850
+ code: d.invalid_string,
851
+ ...h.errToObj(s)
855
852
  });
856
853
  }
857
854
  _addCheck(e) {
858
- return new O({
855
+ return new j({
859
856
  ...this._def,
860
857
  checks: [...this._def.checks, e]
861
858
  });
862
859
  }
863
860
  email(e) {
864
- return this._addCheck({ kind: "email", ...m.errToObj(e) });
861
+ return this._addCheck({ kind: "email", ...h.errToObj(e) });
865
862
  }
866
863
  url(e) {
867
- return this._addCheck({ kind: "url", ...m.errToObj(e) });
864
+ return this._addCheck({ kind: "url", ...h.errToObj(e) });
868
865
  }
869
866
  emoji(e) {
870
- return this._addCheck({ kind: "emoji", ...m.errToObj(e) });
867
+ return this._addCheck({ kind: "emoji", ...h.errToObj(e) });
871
868
  }
872
869
  uuid(e) {
873
- return this._addCheck({ kind: "uuid", ...m.errToObj(e) });
870
+ return this._addCheck({ kind: "uuid", ...h.errToObj(e) });
874
871
  }
875
872
  nanoid(e) {
876
- return this._addCheck({ kind: "nanoid", ...m.errToObj(e) });
873
+ return this._addCheck({ kind: "nanoid", ...h.errToObj(e) });
877
874
  }
878
875
  cuid(e) {
879
- return this._addCheck({ kind: "cuid", ...m.errToObj(e) });
876
+ return this._addCheck({ kind: "cuid", ...h.errToObj(e) });
880
877
  }
881
878
  cuid2(e) {
882
- return this._addCheck({ kind: "cuid2", ...m.errToObj(e) });
879
+ return this._addCheck({ kind: "cuid2", ...h.errToObj(e) });
883
880
  }
884
881
  ulid(e) {
885
- return this._addCheck({ kind: "ulid", ...m.errToObj(e) });
882
+ return this._addCheck({ kind: "ulid", ...h.errToObj(e) });
886
883
  }
887
884
  base64(e) {
888
- return this._addCheck({ kind: "base64", ...m.errToObj(e) });
885
+ return this._addCheck({ kind: "base64", ...h.errToObj(e) });
889
886
  }
890
887
  base64url(e) {
891
888
  return this._addCheck({
892
889
  kind: "base64url",
893
- ...m.errToObj(e)
890
+ ...h.errToObj(e)
894
891
  });
895
892
  }
896
893
  jwt(e) {
897
- return this._addCheck({ kind: "jwt", ...m.errToObj(e) });
894
+ return this._addCheck({ kind: "jwt", ...h.errToObj(e) });
898
895
  }
899
896
  ip(e) {
900
- return this._addCheck({ kind: "ip", ...m.errToObj(e) });
897
+ return this._addCheck({ kind: "ip", ...h.errToObj(e) });
901
898
  }
902
899
  cidr(e) {
903
- return this._addCheck({ kind: "cidr", ...m.errToObj(e) });
900
+ return this._addCheck({ kind: "cidr", ...h.errToObj(e) });
904
901
  }
905
902
  datetime(e) {
906
- var t, s;
907
903
  return typeof e == "string" ? this._addCheck({
908
904
  kind: "datetime",
909
905
  precision: null,
@@ -913,9 +909,9 @@ class O extends g {
913
909
  }) : this._addCheck({
914
910
  kind: "datetime",
915
911
  precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
916
- offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
917
- local: (s = e == null ? void 0 : e.local) !== null && s !== void 0 ? s : !1,
918
- ...m.errToObj(e == null ? void 0 : e.message)
912
+ offset: (e == null ? void 0 : e.offset) ?? !1,
913
+ local: (e == null ? void 0 : e.local) ?? !1,
914
+ ...h.errToObj(e == null ? void 0 : e.message)
919
915
  });
920
916
  }
921
917
  date(e) {
@@ -929,17 +925,17 @@ class O extends g {
929
925
  }) : this._addCheck({
930
926
  kind: "time",
931
927
  precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
932
- ...m.errToObj(e == null ? void 0 : e.message)
928
+ ...h.errToObj(e == null ? void 0 : e.message)
933
929
  });
934
930
  }
935
931
  duration(e) {
936
- return this._addCheck({ kind: "duration", ...m.errToObj(e) });
932
+ return this._addCheck({ kind: "duration", ...h.errToObj(e) });
937
933
  }
938
934
  regex(e, t) {
939
935
  return this._addCheck({
940
936
  kind: "regex",
941
937
  regex: e,
942
- ...m.errToObj(t)
938
+ ...h.errToObj(t)
943
939
  });
944
940
  }
945
941
  includes(e, t) {
@@ -947,64 +943,64 @@ class O extends g {
947
943
  kind: "includes",
948
944
  value: e,
949
945
  position: t == null ? void 0 : t.position,
950
- ...m.errToObj(t == null ? void 0 : t.message)
946
+ ...h.errToObj(t == null ? void 0 : t.message)
951
947
  });
952
948
  }
953
949
  startsWith(e, t) {
954
950
  return this._addCheck({
955
951
  kind: "startsWith",
956
952
  value: e,
957
- ...m.errToObj(t)
953
+ ...h.errToObj(t)
958
954
  });
959
955
  }
960
956
  endsWith(e, t) {
961
957
  return this._addCheck({
962
958
  kind: "endsWith",
963
959
  value: e,
964
- ...m.errToObj(t)
960
+ ...h.errToObj(t)
965
961
  });
966
962
  }
967
963
  min(e, t) {
968
964
  return this._addCheck({
969
965
  kind: "min",
970
966
  value: e,
971
- ...m.errToObj(t)
967
+ ...h.errToObj(t)
972
968
  });
973
969
  }
974
970
  max(e, t) {
975
971
  return this._addCheck({
976
972
  kind: "max",
977
973
  value: e,
978
- ...m.errToObj(t)
974
+ ...h.errToObj(t)
979
975
  });
980
976
  }
981
977
  length(e, t) {
982
978
  return this._addCheck({
983
979
  kind: "length",
984
980
  value: e,
985
- ...m.errToObj(t)
981
+ ...h.errToObj(t)
986
982
  });
987
983
  }
988
984
  /**
989
985
  * Equivalent to `.min(1)`
990
986
  */
991
987
  nonempty(e) {
992
- return this.min(1, m.errToObj(e));
988
+ return this.min(1, h.errToObj(e));
993
989
  }
994
990
  trim() {
995
- return new O({
991
+ return new j({
996
992
  ...this._def,
997
993
  checks: [...this._def.checks, { kind: "trim" }]
998
994
  });
999
995
  }
1000
996
  toLowerCase() {
1001
- return new O({
997
+ return new j({
1002
998
  ...this._def,
1003
999
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1004
1000
  });
1005
1001
  }
1006
1002
  toUpperCase() {
1007
- return new O({
1003
+ return new j({
1008
1004
  ...this._def,
1009
1005
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1010
1006
  });
@@ -1070,20 +1066,17 @@ class O extends g {
1070
1066
  return e;
1071
1067
  }
1072
1068
  }
1073
- O.create = (r) => {
1074
- var e;
1075
- return new O({
1076
- checks: [],
1077
- typeName: _.ZodString,
1078
- coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
1079
- ...v(r)
1080
- });
1081
- };
1082
- function Dt(r, e) {
1083
- const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
1084
- return a % i / Math.pow(10, n);
1069
+ j.create = (r) => new j({
1070
+ checks: [],
1071
+ typeName: y.ZodString,
1072
+ coerce: (r == null ? void 0 : r.coerce) ?? !1,
1073
+ ..._(r)
1074
+ });
1075
+ function Mt(r, e) {
1076
+ const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = Number.parseInt(r.toFixed(n).replace(".", "")), i = Number.parseInt(e.toFixed(n).replace(".", ""));
1077
+ return a % i / 10 ** n;
1085
1078
  }
1086
- class V extends g {
1079
+ class z extends v {
1087
1080
  constructor() {
1088
1081
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1089
1082
  }
@@ -1091,57 +1084,57 @@ class V extends g {
1091
1084
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
1092
1085
  const a = this._getOrReturnCtx(e);
1093
1086
  return l(a, {
1094
- code: u.invalid_type,
1087
+ code: d.invalid_type,
1095
1088
  expected: f.number,
1096
1089
  received: a.parsedType
1097
- }), y;
1090
+ }), m;
1098
1091
  }
1099
1092
  let s;
1100
1093
  const n = new T();
1101
1094
  for (const a of this._def.checks)
1102
1095
  a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1103
- code: u.invalid_type,
1096
+ code: d.invalid_type,
1104
1097
  expected: "integer",
1105
1098
  received: "float",
1106
1099
  message: a.message
1107
1100
  }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1108
- code: u.too_small,
1101
+ code: d.too_small,
1109
1102
  minimum: a.value,
1110
1103
  type: "number",
1111
1104
  inclusive: a.inclusive,
1112
1105
  exact: !1,
1113
1106
  message: a.message
1114
1107
  }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1115
- code: u.too_big,
1108
+ code: d.too_big,
1116
1109
  maximum: a.value,
1117
1110
  type: "number",
1118
1111
  inclusive: a.inclusive,
1119
1112
  exact: !1,
1120
1113
  message: a.message
1121
- }), n.dirty()) : a.kind === "multipleOf" ? Dt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
1122
- code: u.not_multiple_of,
1114
+ }), n.dirty()) : a.kind === "multipleOf" ? Mt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
1115
+ code: d.not_multiple_of,
1123
1116
  multipleOf: a.value,
1124
1117
  message: a.message
1125
1118
  }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
1126
- code: u.not_finite,
1119
+ code: d.not_finite,
1127
1120
  message: a.message
1128
1121
  }), n.dirty()) : x.assertNever(a);
1129
1122
  return { status: n.value, value: e.data };
1130
1123
  }
1131
1124
  gte(e, t) {
1132
- return this.setLimit("min", e, !0, m.toString(t));
1125
+ return this.setLimit("min", e, !0, h.toString(t));
1133
1126
  }
1134
1127
  gt(e, t) {
1135
- return this.setLimit("min", e, !1, m.toString(t));
1128
+ return this.setLimit("min", e, !1, h.toString(t));
1136
1129
  }
1137
1130
  lte(e, t) {
1138
- return this.setLimit("max", e, !0, m.toString(t));
1131
+ return this.setLimit("max", e, !0, h.toString(t));
1139
1132
  }
1140
1133
  lt(e, t) {
1141
- return this.setLimit("max", e, !1, m.toString(t));
1134
+ return this.setLimit("max", e, !1, h.toString(t));
1142
1135
  }
1143
1136
  setLimit(e, t, s, n) {
1144
- return new V({
1137
+ return new z({
1145
1138
  ...this._def,
1146
1139
  checks: [
1147
1140
  ...this._def.checks,
@@ -1149,13 +1142,13 @@ class V extends g {
1149
1142
  kind: e,
1150
1143
  value: t,
1151
1144
  inclusive: s,
1152
- message: m.toString(n)
1145
+ message: h.toString(n)
1153
1146
  }
1154
1147
  ]
1155
1148
  });
1156
1149
  }
1157
1150
  _addCheck(e) {
1158
- return new V({
1151
+ return new z({
1159
1152
  ...this._def,
1160
1153
  checks: [...this._def.checks, e]
1161
1154
  });
@@ -1163,7 +1156,7 @@ class V extends g {
1163
1156
  int(e) {
1164
1157
  return this._addCheck({
1165
1158
  kind: "int",
1166
- message: m.toString(e)
1159
+ message: h.toString(e)
1167
1160
  });
1168
1161
  }
1169
1162
  positive(e) {
@@ -1171,7 +1164,7 @@ class V extends g {
1171
1164
  kind: "min",
1172
1165
  value: 0,
1173
1166
  inclusive: !1,
1174
- message: m.toString(e)
1167
+ message: h.toString(e)
1175
1168
  });
1176
1169
  }
1177
1170
  negative(e) {
@@ -1179,7 +1172,7 @@ class V extends g {
1179
1172
  kind: "max",
1180
1173
  value: 0,
1181
1174
  inclusive: !1,
1182
- message: m.toString(e)
1175
+ message: h.toString(e)
1183
1176
  });
1184
1177
  }
1185
1178
  nonpositive(e) {
@@ -1187,7 +1180,7 @@ class V extends g {
1187
1180
  kind: "max",
1188
1181
  value: 0,
1189
1182
  inclusive: !0,
1190
- message: m.toString(e)
1183
+ message: h.toString(e)
1191
1184
  });
1192
1185
  }
1193
1186
  nonnegative(e) {
@@ -1195,20 +1188,20 @@ class V extends g {
1195
1188
  kind: "min",
1196
1189
  value: 0,
1197
1190
  inclusive: !0,
1198
- message: m.toString(e)
1191
+ message: h.toString(e)
1199
1192
  });
1200
1193
  }
1201
1194
  multipleOf(e, t) {
1202
1195
  return this._addCheck({
1203
1196
  kind: "multipleOf",
1204
1197
  value: e,
1205
- message: m.toString(t)
1198
+ message: h.toString(t)
1206
1199
  });
1207
1200
  }
1208
1201
  finite(e) {
1209
1202
  return this._addCheck({
1210
1203
  kind: "finite",
1211
- message: m.toString(e)
1204
+ message: h.toString(e)
1212
1205
  });
1213
1206
  }
1214
1207
  safe(e) {
@@ -1216,12 +1209,12 @@ class V extends g {
1216
1209
  kind: "min",
1217
1210
  inclusive: !0,
1218
1211
  value: Number.MIN_SAFE_INTEGER,
1219
- message: m.toString(e)
1212
+ message: h.toString(e)
1220
1213
  })._addCheck({
1221
1214
  kind: "max",
1222
1215
  inclusive: !0,
1223
1216
  value: Number.MAX_SAFE_INTEGER,
1224
- message: m.toString(e)
1217
+ message: h.toString(e)
1225
1218
  });
1226
1219
  }
1227
1220
  get minValue() {
@@ -1249,13 +1242,13 @@ class V extends g {
1249
1242
  return Number.isFinite(t) && Number.isFinite(e);
1250
1243
  }
1251
1244
  }
1252
- V.create = (r) => new V({
1245
+ z.create = (r) => new z({
1253
1246
  checks: [],
1254
- typeName: _.ZodNumber,
1247
+ typeName: y.ZodNumber,
1255
1248
  coerce: (r == null ? void 0 : r.coerce) || !1,
1256
- ...v(r)
1249
+ ..._(r)
1257
1250
  });
1258
- class L extends g {
1251
+ class U extends v {
1259
1252
  constructor() {
1260
1253
  super(...arguments), this.min = this.gte, this.max = this.lte;
1261
1254
  }
@@ -1272,19 +1265,19 @@ class L extends g {
1272
1265
  const n = new T();
1273
1266
  for (const a of this._def.checks)
1274
1267
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1275
- code: u.too_small,
1268
+ code: d.too_small,
1276
1269
  type: "bigint",
1277
1270
  minimum: a.value,
1278
1271
  inclusive: a.inclusive,
1279
1272
  message: a.message
1280
1273
  }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1281
- code: u.too_big,
1274
+ code: d.too_big,
1282
1275
  type: "bigint",
1283
1276
  maximum: a.value,
1284
1277
  inclusive: a.inclusive,
1285
1278
  message: a.message
1286
1279
  }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), l(s, {
1287
- code: u.not_multiple_of,
1280
+ code: d.not_multiple_of,
1288
1281
  multipleOf: a.value,
1289
1282
  message: a.message
1290
1283
  }), n.dirty()) : x.assertNever(a);
@@ -1293,25 +1286,25 @@ class L extends g {
1293
1286
  _getInvalidInput(e) {
1294
1287
  const t = this._getOrReturnCtx(e);
1295
1288
  return l(t, {
1296
- code: u.invalid_type,
1289
+ code: d.invalid_type,
1297
1290
  expected: f.bigint,
1298
1291
  received: t.parsedType
1299
- }), y;
1292
+ }), m;
1300
1293
  }
1301
1294
  gte(e, t) {
1302
- return this.setLimit("min", e, !0, m.toString(t));
1295
+ return this.setLimit("min", e, !0, h.toString(t));
1303
1296
  }
1304
1297
  gt(e, t) {
1305
- return this.setLimit("min", e, !1, m.toString(t));
1298
+ return this.setLimit("min", e, !1, h.toString(t));
1306
1299
  }
1307
1300
  lte(e, t) {
1308
- return this.setLimit("max", e, !0, m.toString(t));
1301
+ return this.setLimit("max", e, !0, h.toString(t));
1309
1302
  }
1310
1303
  lt(e, t) {
1311
- return this.setLimit("max", e, !1, m.toString(t));
1304
+ return this.setLimit("max", e, !1, h.toString(t));
1312
1305
  }
1313
1306
  setLimit(e, t, s, n) {
1314
- return new L({
1307
+ return new U({
1315
1308
  ...this._def,
1316
1309
  checks: [
1317
1310
  ...this._def.checks,
@@ -1319,13 +1312,13 @@ class L extends g {
1319
1312
  kind: e,
1320
1313
  value: t,
1321
1314
  inclusive: s,
1322
- message: m.toString(n)
1315
+ message: h.toString(n)
1323
1316
  }
1324
1317
  ]
1325
1318
  });
1326
1319
  }
1327
1320
  _addCheck(e) {
1328
- return new L({
1321
+ return new U({
1329
1322
  ...this._def,
1330
1323
  checks: [...this._def.checks, e]
1331
1324
  });
@@ -1335,7 +1328,7 @@ class L extends g {
1335
1328
  kind: "min",
1336
1329
  value: BigInt(0),
1337
1330
  inclusive: !1,
1338
- message: m.toString(e)
1331
+ message: h.toString(e)
1339
1332
  });
1340
1333
  }
1341
1334
  negative(e) {
@@ -1343,7 +1336,7 @@ class L extends g {
1343
1336
  kind: "max",
1344
1337
  value: BigInt(0),
1345
1338
  inclusive: !1,
1346
- message: m.toString(e)
1339
+ message: h.toString(e)
1347
1340
  });
1348
1341
  }
1349
1342
  nonpositive(e) {
@@ -1351,7 +1344,7 @@ class L extends g {
1351
1344
  kind: "max",
1352
1345
  value: BigInt(0),
1353
1346
  inclusive: !0,
1354
- message: m.toString(e)
1347
+ message: h.toString(e)
1355
1348
  });
1356
1349
  }
1357
1350
  nonnegative(e) {
@@ -1359,14 +1352,14 @@ class L extends g {
1359
1352
  kind: "min",
1360
1353
  value: BigInt(0),
1361
1354
  inclusive: !0,
1362
- message: m.toString(e)
1355
+ message: h.toString(e)
1363
1356
  });
1364
1357
  }
1365
1358
  multipleOf(e, t) {
1366
1359
  return this._addCheck({
1367
1360
  kind: "multipleOf",
1368
1361
  value: e,
1369
- message: m.toString(t)
1362
+ message: h.toString(t)
1370
1363
  });
1371
1364
  }
1372
1365
  get minValue() {
@@ -1382,61 +1375,58 @@ class L extends g {
1382
1375
  return e;
1383
1376
  }
1384
1377
  }
1385
- L.create = (r) => {
1386
- var e;
1387
- return new L({
1388
- checks: [],
1389
- typeName: _.ZodBigInt,
1390
- coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
1391
- ...v(r)
1392
- });
1393
- };
1394
- class ce extends g {
1378
+ U.create = (r) => new U({
1379
+ checks: [],
1380
+ typeName: y.ZodBigInt,
1381
+ coerce: (r == null ? void 0 : r.coerce) ?? !1,
1382
+ ..._(r)
1383
+ });
1384
+ class ce extends v {
1395
1385
  _parse(e) {
1396
1386
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1397
1387
  const s = this._getOrReturnCtx(e);
1398
1388
  return l(s, {
1399
- code: u.invalid_type,
1389
+ code: d.invalid_type,
1400
1390
  expected: f.boolean,
1401
1391
  received: s.parsedType
1402
- }), y;
1392
+ }), m;
1403
1393
  }
1404
- return S(e.data);
1394
+ return C(e.data);
1405
1395
  }
1406
1396
  }
1407
1397
  ce.create = (r) => new ce({
1408
- typeName: _.ZodBoolean,
1398
+ typeName: y.ZodBoolean,
1409
1399
  coerce: (r == null ? void 0 : r.coerce) || !1,
1410
- ...v(r)
1400
+ ..._(r)
1411
1401
  });
1412
- class W extends g {
1402
+ class H extends v {
1413
1403
  _parse(e) {
1414
1404
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1415
1405
  const a = this._getOrReturnCtx(e);
1416
1406
  return l(a, {
1417
- code: u.invalid_type,
1407
+ code: d.invalid_type,
1418
1408
  expected: f.date,
1419
1409
  received: a.parsedType
1420
- }), y;
1410
+ }), m;
1421
1411
  }
1422
- if (isNaN(e.data.getTime())) {
1412
+ if (Number.isNaN(e.data.getTime())) {
1423
1413
  const a = this._getOrReturnCtx(e);
1424
1414
  return l(a, {
1425
- code: u.invalid_date
1426
- }), y;
1415
+ code: d.invalid_date
1416
+ }), m;
1427
1417
  }
1428
1418
  const s = new T();
1429
1419
  let n;
1430
1420
  for (const a of this._def.checks)
1431
1421
  a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1432
- code: u.too_small,
1422
+ code: d.too_small,
1433
1423
  message: a.message,
1434
1424
  inclusive: !0,
1435
1425
  exact: !1,
1436
1426
  minimum: a.value,
1437
1427
  type: "date"
1438
1428
  }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1439
- code: u.too_big,
1429
+ code: d.too_big,
1440
1430
  message: a.message,
1441
1431
  inclusive: !0,
1442
1432
  exact: !1,
@@ -1449,7 +1439,7 @@ class W extends g {
1449
1439
  };
1450
1440
  }
1451
1441
  _addCheck(e) {
1452
- return new W({
1442
+ return new H({
1453
1443
  ...this._def,
1454
1444
  checks: [...this._def.checks, e]
1455
1445
  });
@@ -1458,14 +1448,14 @@ class W extends g {
1458
1448
  return this._addCheck({
1459
1449
  kind: "min",
1460
1450
  value: e.getTime(),
1461
- message: m.toString(t)
1451
+ message: h.toString(t)
1462
1452
  });
1463
1453
  }
1464
1454
  max(e, t) {
1465
1455
  return this._addCheck({
1466
1456
  kind: "max",
1467
1457
  value: e.getTime(),
1468
- message: m.toString(t)
1458
+ message: h.toString(t)
1469
1459
  });
1470
1460
  }
1471
1461
  get minDate() {
@@ -1481,131 +1471,131 @@ class W extends g {
1481
1471
  return e != null ? new Date(e) : null;
1482
1472
  }
1483
1473
  }
1484
- W.create = (r) => new W({
1474
+ H.create = (r) => new H({
1485
1475
  checks: [],
1486
1476
  coerce: (r == null ? void 0 : r.coerce) || !1,
1487
- typeName: _.ZodDate,
1488
- ...v(r)
1477
+ typeName: y.ZodDate,
1478
+ ..._(r)
1489
1479
  });
1490
- class Ce extends g {
1480
+ class Se extends v {
1491
1481
  _parse(e) {
1492
1482
  if (this._getType(e) !== f.symbol) {
1493
1483
  const s = this._getOrReturnCtx(e);
1494
1484
  return l(s, {
1495
- code: u.invalid_type,
1485
+ code: d.invalid_type,
1496
1486
  expected: f.symbol,
1497
1487
  received: s.parsedType
1498
- }), y;
1488
+ }), m;
1499
1489
  }
1500
- return S(e.data);
1490
+ return C(e.data);
1501
1491
  }
1502
1492
  }
1503
- Ce.create = (r) => new Ce({
1504
- typeName: _.ZodSymbol,
1505
- ...v(r)
1493
+ Se.create = (r) => new Se({
1494
+ typeName: y.ZodSymbol,
1495
+ ..._(r)
1506
1496
  });
1507
- class de extends g {
1497
+ class de extends v {
1508
1498
  _parse(e) {
1509
1499
  if (this._getType(e) !== f.undefined) {
1510
1500
  const s = this._getOrReturnCtx(e);
1511
1501
  return l(s, {
1512
- code: u.invalid_type,
1502
+ code: d.invalid_type,
1513
1503
  expected: f.undefined,
1514
1504
  received: s.parsedType
1515
- }), y;
1505
+ }), m;
1516
1506
  }
1517
- return S(e.data);
1507
+ return C(e.data);
1518
1508
  }
1519
1509
  }
1520
1510
  de.create = (r) => new de({
1521
- typeName: _.ZodUndefined,
1522
- ...v(r)
1511
+ typeName: y.ZodUndefined,
1512
+ ..._(r)
1523
1513
  });
1524
- class ue extends g {
1514
+ class ue extends v {
1525
1515
  _parse(e) {
1526
1516
  if (this._getType(e) !== f.null) {
1527
1517
  const s = this._getOrReturnCtx(e);
1528
1518
  return l(s, {
1529
- code: u.invalid_type,
1519
+ code: d.invalid_type,
1530
1520
  expected: f.null,
1531
1521
  received: s.parsedType
1532
- }), y;
1522
+ }), m;
1533
1523
  }
1534
- return S(e.data);
1524
+ return C(e.data);
1535
1525
  }
1536
1526
  }
1537
1527
  ue.create = (r) => new ue({
1538
- typeName: _.ZodNull,
1539
- ...v(r)
1528
+ typeName: y.ZodNull,
1529
+ ..._(r)
1540
1530
  });
1541
- class ee extends g {
1531
+ class re extends v {
1542
1532
  constructor() {
1543
1533
  super(...arguments), this._any = !0;
1544
1534
  }
1545
1535
  _parse(e) {
1546
- return S(e.data);
1536
+ return C(e.data);
1547
1537
  }
1548
1538
  }
1549
- ee.create = (r) => new ee({
1550
- typeName: _.ZodAny,
1551
- ...v(r)
1539
+ re.create = (r) => new re({
1540
+ typeName: y.ZodAny,
1541
+ ..._(r)
1552
1542
  });
1553
- class F extends g {
1543
+ class W extends v {
1554
1544
  constructor() {
1555
1545
  super(...arguments), this._unknown = !0;
1556
1546
  }
1557
1547
  _parse(e) {
1558
- return S(e.data);
1548
+ return C(e.data);
1559
1549
  }
1560
1550
  }
1561
- F.create = (r) => new F({
1562
- typeName: _.ZodUnknown,
1563
- ...v(r)
1551
+ W.create = (r) => new W({
1552
+ typeName: y.ZodUnknown,
1553
+ ..._(r)
1564
1554
  });
1565
- class P extends g {
1555
+ class D extends v {
1566
1556
  _parse(e) {
1567
1557
  const t = this._getOrReturnCtx(e);
1568
1558
  return l(t, {
1569
- code: u.invalid_type,
1559
+ code: d.invalid_type,
1570
1560
  expected: f.never,
1571
1561
  received: t.parsedType
1572
- }), y;
1562
+ }), m;
1573
1563
  }
1574
1564
  }
1575
- P.create = (r) => new P({
1576
- typeName: _.ZodNever,
1577
- ...v(r)
1565
+ D.create = (r) => new D({
1566
+ typeName: y.ZodNever,
1567
+ ..._(r)
1578
1568
  });
1579
- class Ze extends g {
1569
+ class Oe extends v {
1580
1570
  _parse(e) {
1581
1571
  if (this._getType(e) !== f.undefined) {
1582
1572
  const s = this._getOrReturnCtx(e);
1583
1573
  return l(s, {
1584
- code: u.invalid_type,
1574
+ code: d.invalid_type,
1585
1575
  expected: f.void,
1586
1576
  received: s.parsedType
1587
- }), y;
1577
+ }), m;
1588
1578
  }
1589
- return S(e.data);
1579
+ return C(e.data);
1590
1580
  }
1591
1581
  }
1592
- Ze.create = (r) => new Ze({
1593
- typeName: _.ZodVoid,
1594
- ...v(r)
1582
+ Oe.create = (r) => new Oe({
1583
+ typeName: y.ZodVoid,
1584
+ ..._(r)
1595
1585
  });
1596
- class j extends g {
1586
+ class R extends v {
1597
1587
  _parse(e) {
1598
1588
  const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
1599
1589
  if (t.parsedType !== f.array)
1600
1590
  return l(t, {
1601
- code: u.invalid_type,
1591
+ code: d.invalid_type,
1602
1592
  expected: f.array,
1603
1593
  received: t.parsedType
1604
- }), y;
1594
+ }), m;
1605
1595
  if (n.exactLength !== null) {
1606
1596
  const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
1607
1597
  (i || o) && (l(t, {
1608
- code: i ? u.too_big : u.too_small,
1598
+ code: i ? d.too_big : d.too_small,
1609
1599
  minimum: o ? n.exactLength.value : void 0,
1610
1600
  maximum: i ? n.exactLength.value : void 0,
1611
1601
  type: "array",
@@ -1615,74 +1605,74 @@ class j extends g {
1615
1605
  }), s.dirty());
1616
1606
  }
1617
1607
  if (n.minLength !== null && t.data.length < n.minLength.value && (l(t, {
1618
- code: u.too_small,
1608
+ code: d.too_small,
1619
1609
  minimum: n.minLength.value,
1620
1610
  type: "array",
1621
1611
  inclusive: !0,
1622
1612
  exact: !1,
1623
1613
  message: n.minLength.message
1624
1614
  }), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (l(t, {
1625
- code: u.too_big,
1615
+ code: d.too_big,
1626
1616
  maximum: n.maxLength.value,
1627
1617
  type: "array",
1628
1618
  inclusive: !0,
1629
1619
  exact: !1,
1630
1620
  message: n.maxLength.message
1631
1621
  }), s.dirty()), t.common.async)
1632
- return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new R(t, i, t.path, o)))).then((i) => T.mergeArray(s, i));
1633
- const a = [...t.data].map((i, o) => n.type._parseSync(new R(t, i, t.path, o)));
1622
+ return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new I(t, i, t.path, o)))).then((i) => T.mergeArray(s, i));
1623
+ const a = [...t.data].map((i, o) => n.type._parseSync(new I(t, i, t.path, o)));
1634
1624
  return T.mergeArray(s, a);
1635
1625
  }
1636
1626
  get element() {
1637
1627
  return this._def.type;
1638
1628
  }
1639
1629
  min(e, t) {
1640
- return new j({
1630
+ return new R({
1641
1631
  ...this._def,
1642
- minLength: { value: e, message: m.toString(t) }
1632
+ minLength: { value: e, message: h.toString(t) }
1643
1633
  });
1644
1634
  }
1645
1635
  max(e, t) {
1646
- return new j({
1636
+ return new R({
1647
1637
  ...this._def,
1648
- maxLength: { value: e, message: m.toString(t) }
1638
+ maxLength: { value: e, message: h.toString(t) }
1649
1639
  });
1650
1640
  }
1651
1641
  length(e, t) {
1652
- return new j({
1642
+ return new R({
1653
1643
  ...this._def,
1654
- exactLength: { value: e, message: m.toString(t) }
1644
+ exactLength: { value: e, message: h.toString(t) }
1655
1645
  });
1656
1646
  }
1657
1647
  nonempty(e) {
1658
1648
  return this.min(1, e);
1659
1649
  }
1660
1650
  }
1661
- j.create = (r, e) => new j({
1651
+ R.create = (r, e) => new R({
1662
1652
  type: r,
1663
1653
  minLength: null,
1664
1654
  maxLength: null,
1665
1655
  exactLength: null,
1666
- typeName: _.ZodArray,
1667
- ...v(e)
1656
+ typeName: y.ZodArray,
1657
+ ..._(e)
1668
1658
  });
1669
- function G(r) {
1659
+ function X(r) {
1670
1660
  if (r instanceof k) {
1671
1661
  const e = {};
1672
1662
  for (const t in r.shape) {
1673
1663
  const s = r.shape[t];
1674
- e[t] = E.create(G(s));
1664
+ e[t] = E.create(X(s));
1675
1665
  }
1676
1666
  return new k({
1677
1667
  ...r._def,
1678
1668
  shape: () => e
1679
1669
  });
1680
- } else return r instanceof j ? new j({
1670
+ } else return r instanceof R ? new R({
1681
1671
  ...r._def,
1682
- type: G(r.element)
1683
- }) : r instanceof E ? E.create(G(r.unwrap())) : r instanceof U ? U.create(G(r.unwrap())) : r instanceof N ? N.create(r.items.map((e) => G(e))) : r;
1672
+ type: X(r.element)
1673
+ }) : r instanceof E ? E.create(X(r.unwrap())) : r instanceof F ? F.create(X(r.unwrap())) : r instanceof $ ? $.create(r.items.map((e) => X(e))) : r;
1684
1674
  }
1685
- class k extends g {
1675
+ class k extends v {
1686
1676
  constructor() {
1687
1677
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1688
1678
  }
@@ -1690,86 +1680,86 @@ class k extends g {
1690
1680
  if (this._cached !== null)
1691
1681
  return this._cached;
1692
1682
  const e = this._def.shape(), t = x.objectKeys(e);
1693
- return this._cached = { shape: e, keys: t };
1683
+ return this._cached = { shape: e, keys: t }, this._cached;
1694
1684
  }
1695
1685
  _parse(e) {
1696
1686
  if (this._getType(e) !== f.object) {
1697
- const d = this._getOrReturnCtx(e);
1698
- return l(d, {
1699
- code: u.invalid_type,
1687
+ const u = this._getOrReturnCtx(e);
1688
+ return l(u, {
1689
+ code: d.invalid_type,
1700
1690
  expected: f.object,
1701
- received: d.parsedType
1702
- }), y;
1691
+ received: u.parsedType
1692
+ }), m;
1703
1693
  }
1704
1694
  const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1705
- if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
1706
- for (const d in n.data)
1707
- i.includes(d) || o.push(d);
1695
+ if (!(this._def.catchall instanceof D && this._def.unknownKeys === "strip"))
1696
+ for (const u in n.data)
1697
+ i.includes(u) || o.push(u);
1708
1698
  const c = [];
1709
- for (const d of i) {
1710
- const h = a[d], b = n.data[d];
1699
+ for (const u of i) {
1700
+ const p = a[u], b = n.data[u];
1711
1701
  c.push({
1712
- key: { status: "valid", value: d },
1713
- value: h._parse(new R(n, b, n.path, d)),
1714
- alwaysSet: d in n.data
1702
+ key: { status: "valid", value: u },
1703
+ value: p._parse(new I(n, b, n.path, u)),
1704
+ alwaysSet: u in n.data
1715
1705
  });
1716
1706
  }
1717
- if (this._def.catchall instanceof P) {
1718
- const d = this._def.unknownKeys;
1719
- if (d === "passthrough")
1720
- for (const h of o)
1707
+ if (this._def.catchall instanceof D) {
1708
+ const u = this._def.unknownKeys;
1709
+ if (u === "passthrough")
1710
+ for (const p of o)
1721
1711
  c.push({
1722
- key: { status: "valid", value: h },
1723
- value: { status: "valid", value: n.data[h] }
1712
+ key: { status: "valid", value: p },
1713
+ value: { status: "valid", value: n.data[p] }
1724
1714
  });
1725
- else if (d === "strict")
1715
+ else if (u === "strict")
1726
1716
  o.length > 0 && (l(n, {
1727
- code: u.unrecognized_keys,
1717
+ code: d.unrecognized_keys,
1728
1718
  keys: o
1729
1719
  }), s.dirty());
1730
- else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1720
+ else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1731
1721
  } else {
1732
- const d = this._def.catchall;
1733
- for (const h of o) {
1734
- const b = n.data[h];
1722
+ const u = this._def.catchall;
1723
+ for (const p of o) {
1724
+ const b = n.data[p];
1735
1725
  c.push({
1736
- key: { status: "valid", value: h },
1737
- value: d._parse(
1738
- new R(n, b, n.path, h)
1726
+ key: { status: "valid", value: p },
1727
+ value: u._parse(
1728
+ new I(n, b, n.path, p)
1739
1729
  //, ctx.child(key), value, getParsedType(value)
1740
1730
  ),
1741
- alwaysSet: h in n.data
1731
+ alwaysSet: p in n.data
1742
1732
  });
1743
1733
  }
1744
1734
  }
1745
1735
  return n.common.async ? Promise.resolve().then(async () => {
1746
- const d = [];
1747
- for (const h of c) {
1748
- const b = await h.key, C = await h.value;
1749
- d.push({
1736
+ const u = [];
1737
+ for (const p of c) {
1738
+ const b = await p.key, A = await p.value;
1739
+ u.push({
1750
1740
  key: b,
1751
- value: C,
1752
- alwaysSet: h.alwaysSet
1741
+ value: A,
1742
+ alwaysSet: p.alwaysSet
1753
1743
  });
1754
1744
  }
1755
- return d;
1756
- }).then((d) => T.mergeObjectSync(s, d)) : T.mergeObjectSync(s, c);
1745
+ return u;
1746
+ }).then((u) => T.mergeObjectSync(s, u)) : T.mergeObjectSync(s, c);
1757
1747
  }
1758
1748
  get shape() {
1759
1749
  return this._def.shape();
1760
1750
  }
1761
1751
  strict(e) {
1762
- return m.errToObj, new k({
1752
+ return h.errToObj, new k({
1763
1753
  ...this._def,
1764
1754
  unknownKeys: "strict",
1765
1755
  ...e !== void 0 ? {
1766
1756
  errorMap: (t, s) => {
1767
- var n, a, i, o;
1768
- const c = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
1757
+ var a, i;
1758
+ const n = ((i = (a = this._def).errorMap) == null ? void 0 : i.call(a, t, s).message) ?? s.defaultError;
1769
1759
  return t.code === "unrecognized_keys" ? {
1770
- message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : c
1760
+ message: h.errToObj(e).message ?? n
1771
1761
  } : {
1772
- message: c
1762
+ message: n
1773
1763
  };
1774
1764
  }
1775
1765
  } : {}
@@ -1826,7 +1816,7 @@ class k extends g {
1826
1816
  ...this._def.shape(),
1827
1817
  ...e._def.shape()
1828
1818
  }),
1829
- typeName: _.ZodObject
1819
+ typeName: y.ZodObject
1830
1820
  });
1831
1821
  }
1832
1822
  // merge<
@@ -1896,18 +1886,18 @@ class k extends g {
1896
1886
  }
1897
1887
  pick(e) {
1898
1888
  const t = {};
1899
- return x.objectKeys(e).forEach((s) => {
1889
+ for (const s of x.objectKeys(e))
1900
1890
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
1901
- }), new k({
1891
+ return new k({
1902
1892
  ...this._def,
1903
1893
  shape: () => t
1904
1894
  });
1905
1895
  }
1906
1896
  omit(e) {
1907
1897
  const t = {};
1908
- return x.objectKeys(this.shape).forEach((s) => {
1898
+ for (const s of x.objectKeys(this.shape))
1909
1899
  e[s] || (t[s] = this.shape[s]);
1910
- }), new k({
1900
+ return new k({
1911
1901
  ...this._def,
1912
1902
  shape: () => t
1913
1903
  });
@@ -1916,21 +1906,22 @@ class k extends g {
1916
1906
  * @deprecated
1917
1907
  */
1918
1908
  deepPartial() {
1919
- return G(this);
1909
+ return X(this);
1920
1910
  }
1921
1911
  partial(e) {
1922
1912
  const t = {};
1923
- return x.objectKeys(this.shape).forEach((s) => {
1913
+ for (const s of x.objectKeys(this.shape)) {
1924
1914
  const n = this.shape[s];
1925
1915
  e && !e[s] ? t[s] = n : t[s] = n.optional();
1926
- }), new k({
1916
+ }
1917
+ return new k({
1927
1918
  ...this._def,
1928
1919
  shape: () => t
1929
1920
  });
1930
1921
  }
1931
1922
  required(e) {
1932
1923
  const t = {};
1933
- return x.objectKeys(this.shape).forEach((s) => {
1924
+ for (const s of x.objectKeys(this.shape))
1934
1925
  if (e && !e[s])
1935
1926
  t[s] = this.shape[s];
1936
1927
  else {
@@ -1939,37 +1930,37 @@ class k extends g {
1939
1930
  a = a._def.innerType;
1940
1931
  t[s] = a;
1941
1932
  }
1942
- }), new k({
1933
+ return new k({
1943
1934
  ...this._def,
1944
1935
  shape: () => t
1945
1936
  });
1946
1937
  }
1947
1938
  keyof() {
1948
- return rt(x.objectKeys(this.shape));
1939
+ return st(x.objectKeys(this.shape));
1949
1940
  }
1950
1941
  }
1951
1942
  k.create = (r, e) => new k({
1952
1943
  shape: () => r,
1953
1944
  unknownKeys: "strip",
1954
- catchall: P.create(),
1955
- typeName: _.ZodObject,
1956
- ...v(e)
1945
+ catchall: D.create(),
1946
+ typeName: y.ZodObject,
1947
+ ..._(e)
1957
1948
  });
1958
1949
  k.strictCreate = (r, e) => new k({
1959
1950
  shape: () => r,
1960
1951
  unknownKeys: "strict",
1961
- catchall: P.create(),
1962
- typeName: _.ZodObject,
1963
- ...v(e)
1952
+ catchall: D.create(),
1953
+ typeName: y.ZodObject,
1954
+ ..._(e)
1964
1955
  });
1965
1956
  k.lazycreate = (r, e) => new k({
1966
1957
  shape: r,
1967
1958
  unknownKeys: "strip",
1968
- catchall: P.create(),
1969
- typeName: _.ZodObject,
1970
- ...v(e)
1959
+ catchall: D.create(),
1960
+ typeName: y.ZodObject,
1961
+ ..._(e)
1971
1962
  });
1972
- class le extends g {
1963
+ class le extends v {
1973
1964
  _parse(e) {
1974
1965
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
1975
1966
  function n(a) {
@@ -1979,11 +1970,11 @@ class le extends g {
1979
1970
  for (const o of a)
1980
1971
  if (o.result.status === "dirty")
1981
1972
  return t.common.issues.push(...o.ctx.common.issues), o.result;
1982
- const i = a.map((o) => new Z(o.ctx.common.issues));
1973
+ const i = a.map((o) => new S(o.ctx.common.issues));
1983
1974
  return l(t, {
1984
- code: u.invalid_union,
1975
+ code: d.invalid_union,
1985
1976
  unionErrors: i
1986
- }), y;
1977
+ }), m;
1987
1978
  }
1988
1979
  if (t.common.async)
1989
1980
  return Promise.all(s.map(async (a) => {
@@ -2008,29 +1999,29 @@ class le extends g {
2008
1999
  let a;
2009
2000
  const i = [];
2010
2001
  for (const c of s) {
2011
- const d = {
2002
+ const u = {
2012
2003
  ...t,
2013
2004
  common: {
2014
2005
  ...t.common,
2015
2006
  issues: []
2016
2007
  },
2017
2008
  parent: null
2018
- }, h = c._parseSync({
2009
+ }, p = c._parseSync({
2019
2010
  data: t.data,
2020
2011
  path: t.path,
2021
- parent: d
2012
+ parent: u
2022
2013
  });
2023
- if (h.status === "valid")
2024
- return h;
2025
- h.status === "dirty" && !a && (a = { result: h, ctx: d }), d.common.issues.length && i.push(d.common.issues);
2014
+ if (p.status === "valid")
2015
+ return p;
2016
+ p.status === "dirty" && !a && (a = { result: p, ctx: u }), u.common.issues.length && i.push(u.common.issues);
2026
2017
  }
2027
2018
  if (a)
2028
2019
  return t.common.issues.push(...a.ctx.common.issues), a.result;
2029
- const o = i.map((c) => new Z(c));
2020
+ const o = i.map((c) => new S(c));
2030
2021
  return l(t, {
2031
- code: u.invalid_union,
2022
+ code: d.invalid_union,
2032
2023
  unionErrors: o
2033
- }), y;
2024
+ }), m;
2034
2025
  }
2035
2026
  }
2036
2027
  get options() {
@@ -2039,19 +2030,19 @@ class le extends g {
2039
2030
  }
2040
2031
  le.create = (r, e) => new le({
2041
2032
  options: r,
2042
- typeName: _.ZodUnion,
2043
- ...v(e)
2033
+ typeName: y.ZodUnion,
2034
+ ..._(e)
2044
2035
  });
2045
- const I = (r) => r instanceof pe ? I(r.schema) : r instanceof A ? I(r.innerType()) : r instanceof me ? [r.value] : r instanceof z ? r.options : r instanceof _e ? x.objectValues(r.enum) : r instanceof ye ? I(r._def.innerType) : r instanceof de ? [void 0] : r instanceof ue ? [null] : r instanceof E ? [void 0, ...I(r.unwrap())] : r instanceof U ? [null, ...I(r.unwrap())] : r instanceof Je || r instanceof ge ? I(r.unwrap()) : r instanceof ve ? I(r._def.innerType) : [];
2046
- class Ee extends g {
2036
+ const P = (r) => r instanceof pe ? P(r.schema) : r instanceof N ? P(r.innerType()) : r instanceof me ? [r.value] : r instanceof B ? r.options : r instanceof ye ? x.objectValues(r.enum) : r instanceof _e ? P(r._def.innerType) : r instanceof de ? [void 0] : r instanceof ue ? [null] : r instanceof E ? [void 0, ...P(r.unwrap())] : r instanceof F ? [null, ...P(r.unwrap())] : r instanceof He || r instanceof ve ? P(r.unwrap()) : r instanceof ge ? P(r._def.innerType) : [];
2037
+ class Ne extends v {
2047
2038
  _parse(e) {
2048
2039
  const { ctx: t } = this._processInputParams(e);
2049
2040
  if (t.parsedType !== f.object)
2050
2041
  return l(t, {
2051
- code: u.invalid_type,
2042
+ code: d.invalid_type,
2052
2043
  expected: f.object,
2053
2044
  received: t.parsedType
2054
- }), y;
2045
+ }), m;
2055
2046
  const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
2056
2047
  return a ? t.common.async ? a._parseAsync({
2057
2048
  data: t.data,
@@ -2062,10 +2053,10 @@ class Ee extends g {
2062
2053
  path: t.path,
2063
2054
  parent: t
2064
2055
  }) : (l(t, {
2065
- code: u.invalid_union_discriminator,
2056
+ code: d.invalid_union_discriminator,
2066
2057
  options: Array.from(this.optionsMap.keys()),
2067
2058
  path: [s]
2068
- }), y);
2059
+ }), m);
2069
2060
  }
2070
2061
  get discriminator() {
2071
2062
  return this._def.discriminator;
@@ -2087,7 +2078,7 @@ class Ee extends g {
2087
2078
  static create(e, t, s) {
2088
2079
  const n = /* @__PURE__ */ new Map();
2089
2080
  for (const a of t) {
2090
- const i = I(a.shape[e]);
2081
+ const i = P(a.shape[e]);
2091
2082
  if (!i.length)
2092
2083
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2093
2084
  for (const o of i) {
@@ -2096,23 +2087,23 @@ class Ee extends g {
2096
2087
  n.set(o, a);
2097
2088
  }
2098
2089
  }
2099
- return new Ee({
2100
- typeName: _.ZodDiscriminatedUnion,
2090
+ return new Ne({
2091
+ typeName: y.ZodDiscriminatedUnion,
2101
2092
  discriminator: e,
2102
2093
  options: t,
2103
2094
  optionsMap: n,
2104
- ...v(s)
2095
+ ..._(s)
2105
2096
  });
2106
2097
  }
2107
2098
  }
2108
- function We(r, e) {
2109
- const t = $(r), s = $(e);
2099
+ function Je(r, e) {
2100
+ const t = M(r), s = M(e);
2110
2101
  if (r === e)
2111
2102
  return { valid: !0, data: r };
2112
2103
  if (t === f.object && s === f.object) {
2113
2104
  const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
2114
2105
  for (const o of a) {
2115
- const c = We(r[o], e[o]);
2106
+ const c = Je(r[o], e[o]);
2116
2107
  if (!c.valid)
2117
2108
  return { valid: !1 };
2118
2109
  i[o] = c.data;
@@ -2123,7 +2114,7 @@ function We(r, e) {
2123
2114
  return { valid: !1 };
2124
2115
  const n = [];
2125
2116
  for (let a = 0; a < r.length; a++) {
2126
- const i = r[a], o = e[a], c = We(i, o);
2117
+ const i = r[a], o = e[a], c = Je(i, o);
2127
2118
  if (!c.valid)
2128
2119
  return { valid: !1 };
2129
2120
  n.push(c.data);
@@ -2131,15 +2122,15 @@ function We(r, e) {
2131
2122
  return { valid: !0, data: n };
2132
2123
  } else return t === f.date && s === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2133
2124
  }
2134
- class fe extends g {
2125
+ class fe extends v {
2135
2126
  _parse(e) {
2136
2127
  const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
2137
- if (Fe(a) || Fe(i))
2138
- return y;
2139
- const o = We(a.value, i.value);
2140
- return o.valid ? ((qe(a) || qe(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
2141
- code: u.invalid_intersection_types
2142
- }), y);
2128
+ if (qe(a) || qe(i))
2129
+ return m;
2130
+ const o = Je(a.value, i.value);
2131
+ return o.valid ? ((We(a) || We(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
2132
+ code: d.invalid_intersection_types
2133
+ }), m);
2143
2134
  };
2144
2135
  return s.common.async ? Promise.all([
2145
2136
  this._def.left._parseAsync({
@@ -2166,28 +2157,28 @@ class fe extends g {
2166
2157
  fe.create = (r, e, t) => new fe({
2167
2158
  left: r,
2168
2159
  right: e,
2169
- typeName: _.ZodIntersection,
2170
- ...v(t)
2160
+ typeName: y.ZodIntersection,
2161
+ ..._(t)
2171
2162
  });
2172
- class N extends g {
2163
+ class $ extends v {
2173
2164
  _parse(e) {
2174
2165
  const { status: t, ctx: s } = this._processInputParams(e);
2175
2166
  if (s.parsedType !== f.array)
2176
2167
  return l(s, {
2177
- code: u.invalid_type,
2168
+ code: d.invalid_type,
2178
2169
  expected: f.array,
2179
2170
  received: s.parsedType
2180
- }), y;
2171
+ }), m;
2181
2172
  if (s.data.length < this._def.items.length)
2182
2173
  return l(s, {
2183
- code: u.too_small,
2174
+ code: d.too_small,
2184
2175
  minimum: this._def.items.length,
2185
2176
  inclusive: !0,
2186
2177
  exact: !1,
2187
2178
  type: "array"
2188
- }), y;
2179
+ }), m;
2189
2180
  !this._def.rest && s.data.length > this._def.items.length && (l(s, {
2190
- code: u.too_big,
2181
+ code: d.too_big,
2191
2182
  maximum: this._def.items.length,
2192
2183
  inclusive: !0,
2193
2184
  exact: !1,
@@ -2195,7 +2186,7 @@ class N extends g {
2195
2186
  }), t.dirty());
2196
2187
  const a = [...s.data].map((i, o) => {
2197
2188
  const c = this._def.items[o] || this._def.rest;
2198
- return c ? c._parse(new R(s, i, s.path, o)) : null;
2189
+ return c ? c._parse(new I(s, i, s.path, o)) : null;
2199
2190
  }).filter((i) => !!i);
2200
2191
  return s.common.async ? Promise.all(a).then((i) => T.mergeArray(t, i)) : T.mergeArray(t, a);
2201
2192
  }
@@ -2203,23 +2194,23 @@ class N extends g {
2203
2194
  return this._def.items;
2204
2195
  }
2205
2196
  rest(e) {
2206
- return new N({
2197
+ return new $({
2207
2198
  ...this._def,
2208
2199
  rest: e
2209
2200
  });
2210
2201
  }
2211
2202
  }
2212
- N.create = (r, e) => {
2203
+ $.create = (r, e) => {
2213
2204
  if (!Array.isArray(r))
2214
2205
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2215
- return new N({
2206
+ return new $({
2216
2207
  items: r,
2217
- typeName: _.ZodTuple,
2208
+ typeName: y.ZodTuple,
2218
2209
  rest: null,
2219
- ...v(e)
2210
+ ..._(e)
2220
2211
  });
2221
2212
  };
2222
- class he extends g {
2213
+ class he extends v {
2223
2214
  get keySchema() {
2224
2215
  return this._def.keyType;
2225
2216
  }
@@ -2230,15 +2221,15 @@ class he extends g {
2230
2221
  const { status: t, ctx: s } = this._processInputParams(e);
2231
2222
  if (s.parsedType !== f.object)
2232
2223
  return l(s, {
2233
- code: u.invalid_type,
2224
+ code: d.invalid_type,
2234
2225
  expected: f.object,
2235
2226
  received: s.parsedType
2236
- }), y;
2227
+ }), m;
2237
2228
  const n = [], a = this._def.keyType, i = this._def.valueType;
2238
2229
  for (const o in s.data)
2239
2230
  n.push({
2240
- key: a._parse(new R(s, o, s.path, o)),
2241
- value: i._parse(new R(s, s.data[o], s.path, o)),
2231
+ key: a._parse(new I(s, o, s.path, o)),
2232
+ value: i._parse(new I(s, s.data[o], s.path, o)),
2242
2233
  alwaysSet: o in s.data
2243
2234
  });
2244
2235
  return s.common.async ? T.mergeObjectAsync(t, n) : T.mergeObjectSync(t, n);
@@ -2247,20 +2238,20 @@ class he extends g {
2247
2238
  return this._def.valueType;
2248
2239
  }
2249
2240
  static create(e, t, s) {
2250
- return t instanceof g ? new he({
2241
+ return t instanceof v ? new he({
2251
2242
  keyType: e,
2252
2243
  valueType: t,
2253
- typeName: _.ZodRecord,
2254
- ...v(s)
2244
+ typeName: y.ZodRecord,
2245
+ ..._(s)
2255
2246
  }) : new he({
2256
- keyType: O.create(),
2247
+ keyType: j.create(),
2257
2248
  valueType: e,
2258
- typeName: _.ZodRecord,
2259
- ...v(t)
2249
+ typeName: y.ZodRecord,
2250
+ ..._(t)
2260
2251
  });
2261
2252
  }
2262
2253
  }
2263
- class Oe extends g {
2254
+ class Ae extends v {
2264
2255
  get keySchema() {
2265
2256
  return this._def.keyType;
2266
2257
  }
@@ -2271,62 +2262,62 @@ class Oe extends g {
2271
2262
  const { status: t, ctx: s } = this._processInputParams(e);
2272
2263
  if (s.parsedType !== f.map)
2273
2264
  return l(s, {
2274
- code: u.invalid_type,
2265
+ code: d.invalid_type,
2275
2266
  expected: f.map,
2276
2267
  received: s.parsedType
2277
- }), y;
2278
- const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], d) => ({
2279
- key: n._parse(new R(s, o, s.path, [d, "key"])),
2280
- value: a._parse(new R(s, c, s.path, [d, "value"]))
2268
+ }), m;
2269
+ const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
2270
+ key: n._parse(new I(s, o, s.path, [u, "key"])),
2271
+ value: a._parse(new I(s, c, s.path, [u, "value"]))
2281
2272
  }));
2282
2273
  if (s.common.async) {
2283
2274
  const o = /* @__PURE__ */ new Map();
2284
2275
  return Promise.resolve().then(async () => {
2285
2276
  for (const c of i) {
2286
- const d = await c.key, h = await c.value;
2287
- if (d.status === "aborted" || h.status === "aborted")
2288
- return y;
2289
- (d.status === "dirty" || h.status === "dirty") && t.dirty(), o.set(d.value, h.value);
2277
+ const u = await c.key, p = await c.value;
2278
+ if (u.status === "aborted" || p.status === "aborted")
2279
+ return m;
2280
+ (u.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(u.value, p.value);
2290
2281
  }
2291
2282
  return { status: t.value, value: o };
2292
2283
  });
2293
2284
  } else {
2294
2285
  const o = /* @__PURE__ */ new Map();
2295
2286
  for (const c of i) {
2296
- const d = c.key, h = c.value;
2297
- if (d.status === "aborted" || h.status === "aborted")
2298
- return y;
2299
- (d.status === "dirty" || h.status === "dirty") && t.dirty(), o.set(d.value, h.value);
2287
+ const u = c.key, p = c.value;
2288
+ if (u.status === "aborted" || p.status === "aborted")
2289
+ return m;
2290
+ (u.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(u.value, p.value);
2300
2291
  }
2301
2292
  return { status: t.value, value: o };
2302
2293
  }
2303
2294
  }
2304
2295
  }
2305
- Oe.create = (r, e, t) => new Oe({
2296
+ Ae.create = (r, e, t) => new Ae({
2306
2297
  valueType: e,
2307
2298
  keyType: r,
2308
- typeName: _.ZodMap,
2309
- ...v(t)
2299
+ typeName: y.ZodMap,
2300
+ ..._(t)
2310
2301
  });
2311
- class J extends g {
2302
+ class Y extends v {
2312
2303
  _parse(e) {
2313
2304
  const { status: t, ctx: s } = this._processInputParams(e);
2314
2305
  if (s.parsedType !== f.set)
2315
2306
  return l(s, {
2316
- code: u.invalid_type,
2307
+ code: d.invalid_type,
2317
2308
  expected: f.set,
2318
2309
  received: s.parsedType
2319
- }), y;
2310
+ }), m;
2320
2311
  const n = this._def;
2321
2312
  n.minSize !== null && s.data.size < n.minSize.value && (l(s, {
2322
- code: u.too_small,
2313
+ code: d.too_small,
2323
2314
  minimum: n.minSize.value,
2324
2315
  type: "set",
2325
2316
  inclusive: !0,
2326
2317
  exact: !1,
2327
2318
  message: n.minSize.message
2328
2319
  }), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (l(s, {
2329
- code: u.too_big,
2320
+ code: d.too_big,
2330
2321
  maximum: n.maxSize.value,
2331
2322
  type: "set",
2332
2323
  inclusive: !0,
@@ -2335,27 +2326,27 @@ class J extends g {
2335
2326
  }), t.dirty());
2336
2327
  const a = this._def.valueType;
2337
2328
  function i(c) {
2338
- const d = /* @__PURE__ */ new Set();
2339
- for (const h of c) {
2340
- if (h.status === "aborted")
2341
- return y;
2342
- h.status === "dirty" && t.dirty(), d.add(h.value);
2329
+ const u = /* @__PURE__ */ new Set();
2330
+ for (const p of c) {
2331
+ if (p.status === "aborted")
2332
+ return m;
2333
+ p.status === "dirty" && t.dirty(), u.add(p.value);
2343
2334
  }
2344
- return { status: t.value, value: d };
2335
+ return { status: t.value, value: u };
2345
2336
  }
2346
- const o = [...s.data.values()].map((c, d) => a._parse(new R(s, c, s.path, d)));
2337
+ const o = [...s.data.values()].map((c, u) => a._parse(new I(s, c, s.path, u)));
2347
2338
  return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
2348
2339
  }
2349
2340
  min(e, t) {
2350
- return new J({
2341
+ return new Y({
2351
2342
  ...this._def,
2352
- minSize: { value: e, message: m.toString(t) }
2343
+ minSize: { value: e, message: h.toString(t) }
2353
2344
  });
2354
2345
  }
2355
2346
  max(e, t) {
2356
- return new J({
2347
+ return new Y({
2357
2348
  ...this._def,
2358
- maxSize: { value: e, message: m.toString(t) }
2349
+ maxSize: { value: e, message: h.toString(t) }
2359
2350
  });
2360
2351
  }
2361
2352
  size(e, t) {
@@ -2365,14 +2356,14 @@ class J extends g {
2365
2356
  return this.min(1, e);
2366
2357
  }
2367
2358
  }
2368
- J.create = (r, e) => new J({
2359
+ Y.create = (r, e) => new Y({
2369
2360
  valueType: r,
2370
2361
  minSize: null,
2371
2362
  maxSize: null,
2372
- typeName: _.ZodSet,
2373
- ...v(e)
2363
+ typeName: y.ZodSet,
2364
+ ..._(e)
2374
2365
  });
2375
- class X extends g {
2366
+ class ee extends v {
2376
2367
  constructor() {
2377
2368
  super(...arguments), this.validate = this.implement;
2378
2369
  }
@@ -2380,62 +2371,52 @@ class X extends g {
2380
2371
  const { ctx: t } = this._processInputParams(e);
2381
2372
  if (t.parsedType !== f.function)
2382
2373
  return l(t, {
2383
- code: u.invalid_type,
2374
+ code: d.invalid_type,
2384
2375
  expected: f.function,
2385
2376
  received: t.parsedType
2386
- }), y;
2377
+ }), m;
2387
2378
  function s(o, c) {
2388
- return Te({
2379
+ return Ce({
2389
2380
  data: o,
2390
2381
  path: t.path,
2391
- errorMaps: [
2392
- t.common.contextualErrorMap,
2393
- t.schemaErrorMap,
2394
- we(),
2395
- Q
2396
- ].filter((d) => !!d),
2382
+ errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, Te(), te].filter((u) => !!u),
2397
2383
  issueData: {
2398
- code: u.invalid_arguments,
2384
+ code: d.invalid_arguments,
2399
2385
  argumentsError: c
2400
2386
  }
2401
2387
  });
2402
2388
  }
2403
2389
  function n(o, c) {
2404
- return Te({
2390
+ return Ce({
2405
2391
  data: o,
2406
2392
  path: t.path,
2407
- errorMaps: [
2408
- t.common.contextualErrorMap,
2409
- t.schemaErrorMap,
2410
- we(),
2411
- Q
2412
- ].filter((d) => !!d),
2393
+ errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, Te(), te].filter((u) => !!u),
2413
2394
  issueData: {
2414
- code: u.invalid_return_type,
2395
+ code: d.invalid_return_type,
2415
2396
  returnTypeError: c
2416
2397
  }
2417
2398
  });
2418
2399
  }
2419
2400
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2420
- if (this._def.returns instanceof te) {
2401
+ if (this._def.returns instanceof se) {
2421
2402
  const o = this;
2422
- return S(async function(...c) {
2423
- const d = new Z([]), h = await o._def.args.parseAsync(c, a).catch((w) => {
2424
- throw d.addIssue(s(c, w)), d;
2425
- }), b = await Reflect.apply(i, this, h);
2403
+ return C(async function(...c) {
2404
+ const u = new S([]), p = await o._def.args.parseAsync(c, a).catch((w) => {
2405
+ throw u.addIssue(s(c, w)), u;
2406
+ }), b = await Reflect.apply(i, this, p);
2426
2407
  return await o._def.returns._def.type.parseAsync(b, a).catch((w) => {
2427
- throw d.addIssue(n(b, w)), d;
2408
+ throw u.addIssue(n(b, w)), u;
2428
2409
  });
2429
2410
  });
2430
2411
  } else {
2431
2412
  const o = this;
2432
- return S(function(...c) {
2433
- const d = o._def.args.safeParse(c, a);
2434
- if (!d.success)
2435
- throw new Z([s(c, d.error)]);
2436
- const h = Reflect.apply(i, this, d.data), b = o._def.returns.safeParse(h, a);
2413
+ return C(function(...c) {
2414
+ const u = o._def.args.safeParse(c, a);
2415
+ if (!u.success)
2416
+ throw new S([s(c, u.error)]);
2417
+ const p = Reflect.apply(i, this, u.data), b = o._def.returns.safeParse(p, a);
2437
2418
  if (!b.success)
2438
- throw new Z([n(h, b.error)]);
2419
+ throw new S([n(p, b.error)]);
2439
2420
  return b.data;
2440
2421
  });
2441
2422
  }
@@ -2447,13 +2428,13 @@ class X extends g {
2447
2428
  return this._def.returns;
2448
2429
  }
2449
2430
  args(...e) {
2450
- return new X({
2431
+ return new ee({
2451
2432
  ...this._def,
2452
- args: N.create(e).rest(F.create())
2433
+ args: $.create(e).rest(W.create())
2453
2434
  });
2454
2435
  }
2455
2436
  returns(e) {
2456
- return new X({
2437
+ return new ee({
2457
2438
  ...this._def,
2458
2439
  returns: e
2459
2440
  });
@@ -2465,15 +2446,15 @@ class X extends g {
2465
2446
  return this.parse(e);
2466
2447
  }
2467
2448
  static create(e, t, s) {
2468
- return new X({
2469
- args: e || N.create([]).rest(F.create()),
2470
- returns: t || F.create(),
2471
- typeName: _.ZodFunction,
2472
- ...v(s)
2449
+ return new ee({
2450
+ args: e || $.create([]).rest(W.create()),
2451
+ returns: t || W.create(),
2452
+ typeName: y.ZodFunction,
2453
+ ..._(s)
2473
2454
  });
2474
2455
  }
2475
2456
  }
2476
- class pe extends g {
2457
+ class pe extends v {
2477
2458
  get schema() {
2478
2459
  return this._def.getter();
2479
2460
  }
@@ -2484,18 +2465,18 @@ class pe extends g {
2484
2465
  }
2485
2466
  pe.create = (r, e) => new pe({
2486
2467
  getter: r,
2487
- typeName: _.ZodLazy,
2488
- ...v(e)
2468
+ typeName: y.ZodLazy,
2469
+ ..._(e)
2489
2470
  });
2490
- class me extends g {
2471
+ class me extends v {
2491
2472
  _parse(e) {
2492
2473
  if (e.data !== this._def.value) {
2493
2474
  const t = this._getOrReturnCtx(e);
2494
2475
  return l(t, {
2495
2476
  received: t.data,
2496
- code: u.invalid_literal,
2477
+ code: d.invalid_literal,
2497
2478
  expected: this._def.value
2498
- }), y;
2479
+ }), m;
2499
2480
  }
2500
2481
  return { status: "valid", value: e.data };
2501
2482
  }
@@ -2505,38 +2486,35 @@ class me extends g {
2505
2486
  }
2506
2487
  me.create = (r, e) => new me({
2507
2488
  value: r,
2508
- typeName: _.ZodLiteral,
2509
- ...v(e)
2489
+ typeName: y.ZodLiteral,
2490
+ ..._(e)
2510
2491
  });
2511
- function rt(r, e) {
2512
- return new z({
2492
+ function st(r, e) {
2493
+ return new B({
2513
2494
  values: r,
2514
- typeName: _.ZodEnum,
2515
- ...v(e)
2495
+ typeName: y.ZodEnum,
2496
+ ..._(e)
2516
2497
  });
2517
2498
  }
2518
- class z extends g {
2519
- constructor() {
2520
- super(...arguments), ae.set(this, void 0);
2521
- }
2499
+ class B extends v {
2522
2500
  _parse(e) {
2523
2501
  if (typeof e.data != "string") {
2524
2502
  const t = this._getOrReturnCtx(e), s = this._def.values;
2525
2503
  return l(t, {
2526
2504
  expected: x.joinValues(s),
2527
2505
  received: t.parsedType,
2528
- code: u.invalid_type
2529
- }), y;
2506
+ code: d.invalid_type
2507
+ }), m;
2530
2508
  }
2531
- if (Se(this, ae) || Xe(this, ae, new Set(this._def.values)), !Se(this, ae).has(e.data)) {
2509
+ if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2532
2510
  const t = this._getOrReturnCtx(e), s = this._def.values;
2533
2511
  return l(t, {
2534
2512
  received: t.data,
2535
- code: u.invalid_enum_value,
2513
+ code: d.invalid_enum_value,
2536
2514
  options: s
2537
- }), y;
2515
+ }), m;
2538
2516
  }
2539
- return S(e.data);
2517
+ return C(e.data);
2540
2518
  }
2541
2519
  get options() {
2542
2520
  return this._def.values;
@@ -2560,24 +2538,20 @@ class z extends g {
2560
2538
  return e;
2561
2539
  }
2562
2540
  extract(e, t = this._def) {
2563
- return z.create(e, {
2541
+ return B.create(e, {
2564
2542
  ...this._def,
2565
2543
  ...t
2566
2544
  });
2567
2545
  }
2568
2546
  exclude(e, t = this._def) {
2569
- return z.create(this.options.filter((s) => !e.includes(s)), {
2547
+ return B.create(this.options.filter((s) => !e.includes(s)), {
2570
2548
  ...this._def,
2571
2549
  ...t
2572
2550
  });
2573
2551
  }
2574
2552
  }
2575
- ae = /* @__PURE__ */ new WeakMap();
2576
- z.create = rt;
2577
- class _e extends g {
2578
- constructor() {
2579
- super(...arguments), ie.set(this, void 0);
2580
- }
2553
+ B.create = st;
2554
+ class ye extends v {
2581
2555
  _parse(e) {
2582
2556
  const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2583
2557
  if (s.parsedType !== f.string && s.parsedType !== f.number) {
@@ -2585,30 +2559,29 @@ class _e extends g {
2585
2559
  return l(s, {
2586
2560
  expected: x.joinValues(n),
2587
2561
  received: s.parsedType,
2588
- code: u.invalid_type
2589
- }), y;
2562
+ code: d.invalid_type
2563
+ }), m;
2590
2564
  }
2591
- if (Se(this, ie) || Xe(this, ie, new Set(x.getValidEnumValues(this._def.values))), !Se(this, ie).has(e.data)) {
2565
+ if (this._cache || (this._cache = new Set(x.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2592
2566
  const n = x.objectValues(t);
2593
2567
  return l(s, {
2594
2568
  received: s.data,
2595
- code: u.invalid_enum_value,
2569
+ code: d.invalid_enum_value,
2596
2570
  options: n
2597
- }), y;
2571
+ }), m;
2598
2572
  }
2599
- return S(e.data);
2573
+ return C(e.data);
2600
2574
  }
2601
2575
  get enum() {
2602
2576
  return this._def.values;
2603
2577
  }
2604
2578
  }
2605
- ie = /* @__PURE__ */ new WeakMap();
2606
- _e.create = (r, e) => new _e({
2579
+ ye.create = (r, e) => new ye({
2607
2580
  values: r,
2608
- typeName: _.ZodNativeEnum,
2609
- ...v(e)
2581
+ typeName: y.ZodNativeEnum,
2582
+ ..._(e)
2610
2583
  });
2611
- class te extends g {
2584
+ class se extends v {
2612
2585
  unwrap() {
2613
2586
  return this._def.type;
2614
2587
  }
@@ -2616,28 +2589,28 @@ class te extends g {
2616
2589
  const { ctx: t } = this._processInputParams(e);
2617
2590
  if (t.parsedType !== f.promise && t.common.async === !1)
2618
2591
  return l(t, {
2619
- code: u.invalid_type,
2592
+ code: d.invalid_type,
2620
2593
  expected: f.promise,
2621
2594
  received: t.parsedType
2622
- }), y;
2595
+ }), m;
2623
2596
  const s = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2624
- return S(s.then((n) => this._def.type.parseAsync(n, {
2597
+ return C(s.then((n) => this._def.type.parseAsync(n, {
2625
2598
  path: t.path,
2626
2599
  errorMap: t.common.contextualErrorMap
2627
2600
  })));
2628
2601
  }
2629
2602
  }
2630
- te.create = (r, e) => new te({
2603
+ se.create = (r, e) => new se({
2631
2604
  type: r,
2632
- typeName: _.ZodPromise,
2633
- ...v(e)
2605
+ typeName: y.ZodPromise,
2606
+ ..._(e)
2634
2607
  });
2635
- class A extends g {
2608
+ class N extends v {
2636
2609
  innerType() {
2637
2610
  return this._def.schema;
2638
2611
  }
2639
2612
  sourceType() {
2640
- return this._def.schema._def.typeName === _.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2613
+ return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2641
2614
  }
2642
2615
  _parse(e) {
2643
2616
  const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
@@ -2653,23 +2626,23 @@ class A extends g {
2653
2626
  if (s.common.async)
2654
2627
  return Promise.resolve(i).then(async (o) => {
2655
2628
  if (t.value === "aborted")
2656
- return y;
2629
+ return m;
2657
2630
  const c = await this._def.schema._parseAsync({
2658
2631
  data: o,
2659
2632
  path: s.path,
2660
2633
  parent: s
2661
2634
  });
2662
- return c.status === "aborted" ? y : c.status === "dirty" || t.value === "dirty" ? K(c.value) : c;
2635
+ return c.status === "aborted" ? m : c.status === "dirty" || t.value === "dirty" ? Q(c.value) : c;
2663
2636
  });
2664
2637
  {
2665
2638
  if (t.value === "aborted")
2666
- return y;
2639
+ return m;
2667
2640
  const o = this._def.schema._parseSync({
2668
2641
  data: i,
2669
2642
  path: s.path,
2670
2643
  parent: s
2671
2644
  });
2672
- return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? K(o.value) : o;
2645
+ return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? Q(o.value) : o;
2673
2646
  }
2674
2647
  }
2675
2648
  if (n.type === "refinement") {
@@ -2687,9 +2660,9 @@ class A extends g {
2687
2660
  path: s.path,
2688
2661
  parent: s
2689
2662
  });
2690
- return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2663
+ return o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2691
2664
  } else
2692
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2665
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2693
2666
  }
2694
2667
  if (n.type === "transform")
2695
2668
  if (s.common.async === !1) {
@@ -2698,32 +2671,35 @@ class A extends g {
2698
2671
  path: s.path,
2699
2672
  parent: s
2700
2673
  });
2701
- if (!q(i))
2702
- return i;
2674
+ if (!J(i))
2675
+ return m;
2703
2676
  const o = n.transform(i.value, a);
2704
2677
  if (o instanceof Promise)
2705
2678
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2706
2679
  return { status: t.value, value: o };
2707
2680
  } else
2708
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => q(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2681
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => J(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({
2682
+ status: t.value,
2683
+ value: o
2684
+ })) : m);
2709
2685
  x.assertNever(n);
2710
2686
  }
2711
2687
  }
2712
- A.create = (r, e, t) => new A({
2688
+ N.create = (r, e, t) => new N({
2713
2689
  schema: r,
2714
- typeName: _.ZodEffects,
2690
+ typeName: y.ZodEffects,
2715
2691
  effect: e,
2716
- ...v(t)
2692
+ ..._(t)
2717
2693
  });
2718
- A.createWithPreprocess = (r, e, t) => new A({
2694
+ N.createWithPreprocess = (r, e, t) => new N({
2719
2695
  schema: e,
2720
2696
  effect: { type: "preprocess", transform: r },
2721
- typeName: _.ZodEffects,
2722
- ...v(t)
2697
+ typeName: y.ZodEffects,
2698
+ ..._(t)
2723
2699
  });
2724
- class E extends g {
2700
+ class E extends v {
2725
2701
  _parse(e) {
2726
- return this._getType(e) === f.undefined ? S(void 0) : this._def.innerType._parse(e);
2702
+ return this._getType(e) === f.undefined ? C(void 0) : this._def.innerType._parse(e);
2727
2703
  }
2728
2704
  unwrap() {
2729
2705
  return this._def.innerType;
@@ -2731,23 +2707,23 @@ class E extends g {
2731
2707
  }
2732
2708
  E.create = (r, e) => new E({
2733
2709
  innerType: r,
2734
- typeName: _.ZodOptional,
2735
- ...v(e)
2710
+ typeName: y.ZodOptional,
2711
+ ..._(e)
2736
2712
  });
2737
- class U extends g {
2713
+ class F extends v {
2738
2714
  _parse(e) {
2739
- return this._getType(e) === f.null ? S(null) : this._def.innerType._parse(e);
2715
+ return this._getType(e) === f.null ? C(null) : this._def.innerType._parse(e);
2740
2716
  }
2741
2717
  unwrap() {
2742
2718
  return this._def.innerType;
2743
2719
  }
2744
2720
  }
2745
- U.create = (r, e) => new U({
2721
+ F.create = (r, e) => new F({
2746
2722
  innerType: r,
2747
- typeName: _.ZodNullable,
2748
- ...v(e)
2723
+ typeName: y.ZodNullable,
2724
+ ..._(e)
2749
2725
  });
2750
- class ye extends g {
2726
+ class _e extends v {
2751
2727
  _parse(e) {
2752
2728
  const { ctx: t } = this._processInputParams(e);
2753
2729
  let s = t.data;
@@ -2761,13 +2737,13 @@ class ye extends g {
2761
2737
  return this._def.innerType;
2762
2738
  }
2763
2739
  }
2764
- ye.create = (r, e) => new ye({
2740
+ _e.create = (r, e) => new _e({
2765
2741
  innerType: r,
2766
- typeName: _.ZodDefault,
2742
+ typeName: y.ZodDefault,
2767
2743
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2768
- ...v(e)
2744
+ ..._(e)
2769
2745
  });
2770
- class ve extends g {
2746
+ class ge extends v {
2771
2747
  _parse(e) {
2772
2748
  const { ctx: t } = this._processInputParams(e), s = {
2773
2749
  ...t,
@@ -2786,7 +2762,7 @@ class ve extends g {
2786
2762
  status: "valid",
2787
2763
  value: a.status === "valid" ? a.value : this._def.catchValue({
2788
2764
  get error() {
2789
- return new Z(s.common.issues);
2765
+ return new S(s.common.issues);
2790
2766
  },
2791
2767
  input: s.data
2792
2768
  })
@@ -2794,7 +2770,7 @@ class ve extends g {
2794
2770
  status: "valid",
2795
2771
  value: n.status === "valid" ? n.value : this._def.catchValue({
2796
2772
  get error() {
2797
- return new Z(s.common.issues);
2773
+ return new S(s.common.issues);
2798
2774
  },
2799
2775
  input: s.data
2800
2776
  })
@@ -2804,31 +2780,31 @@ class ve extends g {
2804
2780
  return this._def.innerType;
2805
2781
  }
2806
2782
  }
2807
- ve.create = (r, e) => new ve({
2783
+ ge.create = (r, e) => new ge({
2808
2784
  innerType: r,
2809
- typeName: _.ZodCatch,
2785
+ typeName: y.ZodCatch,
2810
2786
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2811
- ...v(e)
2787
+ ..._(e)
2812
2788
  });
2813
- class je extends g {
2789
+ class je extends v {
2814
2790
  _parse(e) {
2815
2791
  if (this._getType(e) !== f.nan) {
2816
2792
  const s = this._getOrReturnCtx(e);
2817
2793
  return l(s, {
2818
- code: u.invalid_type,
2794
+ code: d.invalid_type,
2819
2795
  expected: f.nan,
2820
2796
  received: s.parsedType
2821
- }), y;
2797
+ }), m;
2822
2798
  }
2823
2799
  return { status: "valid", value: e.data };
2824
2800
  }
2825
2801
  }
2826
2802
  je.create = (r) => new je({
2827
- typeName: _.ZodNaN,
2828
- ...v(r)
2803
+ typeName: y.ZodNaN,
2804
+ ..._(r)
2829
2805
  });
2830
- const Vt = Symbol("zod_brand");
2831
- class Je extends g {
2806
+ const Dt = Symbol("zod_brand");
2807
+ class He extends v {
2832
2808
  _parse(e) {
2833
2809
  const { ctx: t } = this._processInputParams(e), s = t.data;
2834
2810
  return this._def.type._parse({
@@ -2841,7 +2817,7 @@ class Je extends g {
2841
2817
  return this._def.type;
2842
2818
  }
2843
2819
  }
2844
- class xe extends g {
2820
+ class xe extends v {
2845
2821
  _parse(e) {
2846
2822
  const { status: t, ctx: s } = this._processInputParams(e);
2847
2823
  if (s.common.async)
@@ -2851,7 +2827,7 @@ class xe extends g {
2851
2827
  path: s.path,
2852
2828
  parent: s
2853
2829
  });
2854
- return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(), K(a.value)) : this._def.out._parseAsync({
2830
+ return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), Q(a.value)) : this._def.out._parseAsync({
2855
2831
  data: a.value,
2856
2832
  path: s.path,
2857
2833
  parent: s
@@ -2863,7 +2839,7 @@ class xe extends g {
2863
2839
  path: s.path,
2864
2840
  parent: s
2865
2841
  });
2866
- return n.status === "aborted" ? y : n.status === "dirty" ? (t.dirty(), {
2842
+ return n.status === "aborted" ? m : n.status === "dirty" ? (t.dirty(), {
2867
2843
  status: "dirty",
2868
2844
  value: n.value
2869
2845
  }) : this._def.out._parseSync({
@@ -2877,183 +2853,180 @@ class xe extends g {
2877
2853
  return new xe({
2878
2854
  in: e,
2879
2855
  out: t,
2880
- typeName: _.ZodPipeline
2856
+ typeName: y.ZodPipeline
2881
2857
  });
2882
2858
  }
2883
2859
  }
2884
- class ge extends g {
2860
+ class ve extends v {
2885
2861
  _parse(e) {
2886
- const t = this._def.innerType._parse(e), s = (n) => (q(n) && (n.value = Object.freeze(n.value)), n);
2862
+ const t = this._def.innerType._parse(e), s = (n) => (J(n) && (n.value = Object.freeze(n.value)), n);
2887
2863
  return oe(t) ? t.then((n) => s(n)) : s(t);
2888
2864
  }
2889
2865
  unwrap() {
2890
2866
  return this._def.innerType;
2891
2867
  }
2892
2868
  }
2893
- ge.create = (r, e) => new ge({
2869
+ ve.create = (r, e) => new ve({
2894
2870
  innerType: r,
2895
- typeName: _.ZodReadonly,
2896
- ...v(e)
2871
+ typeName: y.ZodReadonly,
2872
+ ..._(e)
2897
2873
  });
2898
- function Ye(r, e) {
2874
+ function Ke(r, e) {
2899
2875
  const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
2900
2876
  return typeof t == "string" ? { message: t } : t;
2901
2877
  }
2902
- function st(r, e = {}, t) {
2903
- return r ? ee.create().superRefine((s, n) => {
2904
- var a, i;
2905
- const o = r(s);
2906
- if (o instanceof Promise)
2907
- return o.then((c) => {
2908
- var d, h;
2909
- if (!c) {
2910
- const b = Ye(e, s), C = (h = (d = b.fatal) !== null && d !== void 0 ? d : t) !== null && h !== void 0 ? h : !0;
2911
- n.addIssue({ code: "custom", ...b, fatal: C });
2878
+ function nt(r, e = {}, t) {
2879
+ return r ? re.create().superRefine((s, n) => {
2880
+ const a = r(s);
2881
+ if (a instanceof Promise)
2882
+ return a.then((i) => {
2883
+ if (!i) {
2884
+ const o = Ke(e, s), c = o.fatal ?? t ?? !0;
2885
+ n.addIssue({ code: "custom", ...o, fatal: c });
2912
2886
  }
2913
2887
  });
2914
- if (!o) {
2915
- const c = Ye(e, s), d = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
2916
- n.addIssue({ code: "custom", ...c, fatal: d });
2888
+ if (!a) {
2889
+ const i = Ke(e, s), o = i.fatal ?? t ?? !0;
2890
+ n.addIssue({ code: "custom", ...i, fatal: o });
2917
2891
  }
2918
- }) : ee.create();
2892
+ }) : re.create();
2919
2893
  }
2920
- const Lt = {
2894
+ const Vt = {
2921
2895
  object: k.lazycreate
2922
2896
  };
2923
- var _;
2897
+ var y;
2924
2898
  (function(r) {
2925
2899
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2926
- })(_ || (_ = {}));
2927
- const zt = (r, e = {
2900
+ })(y || (y = {}));
2901
+ const Lt = (r, e = {
2928
2902
  message: `Input not instance of ${r.name}`
2929
- }) => st((t) => t instanceof r, e), nt = O.create, at = V.create, Ut = je.create, Bt = L.create, it = ce.create, Ft = W.create, qt = Ce.create, Wt = de.create, Jt = ue.create, Ht = ee.create, Yt = F.create, Gt = P.create, Kt = Ze.create, Xt = j.create, Qt = k.create, er = k.strictCreate, tr = le.create, rr = Ee.create, sr = fe.create, nr = N.create, ar = he.create, ir = Oe.create, or = J.create, cr = X.create, dr = pe.create, ur = me.create, lr = z.create, fr = _e.create, hr = te.create, Ge = A.create, pr = E.create, mr = U.create, _r = A.createWithPreprocess, yr = xe.create, vr = () => nt().optional(), gr = () => at().optional(), xr = () => it().optional(), br = {
2930
- string: (r) => O.create({ ...r, coerce: !0 }),
2931
- number: (r) => V.create({ ...r, coerce: !0 }),
2903
+ }) => nt((t) => t instanceof r, e), g = j.create, Ye = z.create, zt = je.create, Ut = U.create, ke = ce.create, Bt = H.create, Ft = Se.create, qt = de.create, Wt = ue.create, Jt = re.create, Ht = W.create, Yt = D.create, Gt = Oe.create, O = R.create, Z = k.create, Kt = k.strictCreate, Xt = le.create, Qt = Ne.create, er = fe.create, tr = $.create, at = he.create, rr = Ae.create, sr = Y.create, nr = ee.create, ar = pe.create, ir = me.create, or = B.create, cr = ye.create, dr = se.create, Xe = N.create, ur = E.create, lr = F.create, fr = N.createWithPreprocess, hr = xe.create, pr = () => g().optional(), mr = () => Ye().optional(), yr = () => ke().optional(), _r = {
2904
+ string: (r) => j.create({ ...r, coerce: !0 }),
2905
+ number: (r) => z.create({ ...r, coerce: !0 }),
2932
2906
  boolean: (r) => ce.create({
2933
2907
  ...r,
2934
2908
  coerce: !0
2935
2909
  }),
2936
- bigint: (r) => L.create({ ...r, coerce: !0 }),
2937
- date: (r) => W.create({ ...r, coerce: !0 })
2938
- }, kr = y;
2939
- var p = /* @__PURE__ */ Object.freeze({
2910
+ bigint: (r) => U.create({ ...r, coerce: !0 }),
2911
+ date: (r) => H.create({ ...r, coerce: !0 })
2912
+ }, gr = m, vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2940
2913
  __proto__: null,
2941
- defaultErrorMap: Q,
2942
- setErrorMap: _t,
2943
- getErrorMap: we,
2944
- makeIssue: Te,
2914
+ BRAND: Dt,
2915
+ DIRTY: Q,
2945
2916
  EMPTY_PATH: yt,
2946
- addIssueToContext: l,
2917
+ INVALID: m,
2918
+ NEVER: gr,
2919
+ OK: C,
2947
2920
  ParseStatus: T,
2948
- INVALID: y,
2949
- DIRTY: K,
2950
- OK: S,
2951
- isAborted: Fe,
2952
- isDirty: qe,
2953
- isValid: q,
2954
- isAsync: oe,
2955
- get util() {
2956
- return x;
2957
- },
2958
- get objectUtil() {
2959
- return Be;
2960
- },
2961
- ZodParsedType: f,
2962
- getParsedType: $,
2963
- ZodType: g,
2964
- datetimeRegex: tt,
2965
- ZodString: O,
2966
- ZodNumber: V,
2967
- ZodBigInt: L,
2921
+ Schema: v,
2922
+ ZodAny: re,
2923
+ ZodArray: R,
2924
+ ZodBigInt: U,
2968
2925
  ZodBoolean: ce,
2969
- ZodDate: W,
2970
- ZodSymbol: Ce,
2971
- ZodUndefined: de,
2972
- ZodNull: ue,
2973
- ZodAny: ee,
2974
- ZodUnknown: F,
2975
- ZodNever: P,
2976
- ZodVoid: Ze,
2977
- ZodArray: j,
2978
- ZodObject: k,
2979
- ZodUnion: le,
2980
- ZodDiscriminatedUnion: Ee,
2926
+ ZodBranded: He,
2927
+ ZodCatch: ge,
2928
+ ZodDate: H,
2929
+ ZodDefault: _e,
2930
+ ZodDiscriminatedUnion: Ne,
2931
+ ZodEffects: N,
2932
+ ZodEnum: B,
2933
+ ZodError: S,
2934
+ get ZodFirstPartyTypeKind() {
2935
+ return y;
2936
+ },
2937
+ ZodFunction: ee,
2981
2938
  ZodIntersection: fe,
2982
- ZodTuple: N,
2983
- ZodRecord: he,
2984
- ZodMap: Oe,
2985
- ZodSet: J,
2986
- ZodFunction: X,
2939
+ ZodIssueCode: d,
2987
2940
  ZodLazy: pe,
2988
2941
  ZodLiteral: me,
2989
- ZodEnum: z,
2990
- ZodNativeEnum: _e,
2991
- ZodPromise: te,
2992
- ZodEffects: A,
2993
- ZodTransformer: A,
2994
- ZodOptional: E,
2995
- ZodNullable: U,
2996
- ZodDefault: ye,
2997
- ZodCatch: ve,
2942
+ ZodMap: Ae,
2998
2943
  ZodNaN: je,
2999
- BRAND: Vt,
3000
- ZodBranded: Je,
2944
+ ZodNativeEnum: ye,
2945
+ ZodNever: D,
2946
+ ZodNull: ue,
2947
+ ZodNullable: F,
2948
+ ZodNumber: z,
2949
+ ZodObject: k,
2950
+ ZodOptional: E,
2951
+ ZodParsedType: f,
3001
2952
  ZodPipeline: xe,
3002
- ZodReadonly: ge,
3003
- custom: st,
3004
- Schema: g,
3005
- ZodSchema: g,
3006
- late: Lt,
3007
- get ZodFirstPartyTypeKind() {
3008
- return _;
2953
+ ZodPromise: se,
2954
+ ZodReadonly: ve,
2955
+ ZodRecord: he,
2956
+ ZodSchema: v,
2957
+ ZodSet: Y,
2958
+ ZodString: j,
2959
+ ZodSymbol: Se,
2960
+ ZodTransformer: N,
2961
+ ZodTuple: $,
2962
+ ZodType: v,
2963
+ ZodUndefined: de,
2964
+ ZodUnion: le,
2965
+ ZodUnknown: W,
2966
+ ZodVoid: Oe,
2967
+ addIssueToContext: l,
2968
+ any: Jt,
2969
+ array: O,
2970
+ bigint: Ut,
2971
+ boolean: ke,
2972
+ coerce: _r,
2973
+ custom: nt,
2974
+ date: Bt,
2975
+ datetimeRegex: rt,
2976
+ defaultErrorMap: te,
2977
+ discriminatedUnion: Qt,
2978
+ effect: Xe,
2979
+ enum: or,
2980
+ function: nr,
2981
+ getErrorMap: Te,
2982
+ getParsedType: M,
2983
+ instanceof: Lt,
2984
+ intersection: er,
2985
+ isAborted: qe,
2986
+ isAsync: oe,
2987
+ isDirty: We,
2988
+ isValid: J,
2989
+ late: Vt,
2990
+ lazy: ar,
2991
+ literal: ir,
2992
+ makeIssue: Ce,
2993
+ map: rr,
2994
+ nan: zt,
2995
+ nativeEnum: cr,
2996
+ never: Yt,
2997
+ null: Wt,
2998
+ nullable: lr,
2999
+ number: Ye,
3000
+ object: Z,
3001
+ get objectUtil() {
3002
+ return Fe;
3009
3003
  },
3010
- coerce: br,
3011
- any: Ht,
3012
- array: Xt,
3013
- bigint: Bt,
3014
- boolean: it,
3015
- date: Ft,
3016
- discriminatedUnion: rr,
3017
- effect: Ge,
3018
- enum: lr,
3019
- function: cr,
3020
- instanceof: zt,
3021
- intersection: sr,
3022
- lazy: dr,
3023
- literal: ur,
3024
- map: ir,
3025
- nan: Ut,
3026
- nativeEnum: fr,
3027
- never: Gt,
3028
- null: Jt,
3029
- nullable: mr,
3030
- number: at,
3031
- object: Qt,
3032
- oboolean: xr,
3033
- onumber: gr,
3034
- optional: pr,
3035
- ostring: vr,
3036
- pipeline: yr,
3037
- preprocess: _r,
3038
- promise: hr,
3039
- record: ar,
3040
- set: or,
3041
- strictObject: er,
3042
- string: nt,
3043
- symbol: qt,
3044
- transformer: Ge,
3045
- tuple: nr,
3046
- undefined: Wt,
3047
- union: tr,
3048
- unknown: Yt,
3049
- void: Kt,
3050
- NEVER: kr,
3051
- ZodIssueCode: u,
3052
- quotelessJson: mt,
3053
- ZodError: Z
3054
- });
3055
- pt(p);
3056
- const wr = (r, e) => e.skipDedupe || e.method !== "GET", Tr = (r, e) => e.method + "@" + r, Sr = (r) => r.clone(), Cr = ({ skip: r = wr, key: e = Tr, resolver: t = Sr } = {}) => {
3004
+ oboolean: yr,
3005
+ onumber: mr,
3006
+ optional: ur,
3007
+ ostring: pr,
3008
+ pipeline: hr,
3009
+ preprocess: fr,
3010
+ promise: dr,
3011
+ quotelessJson: pt,
3012
+ record: at,
3013
+ set: sr,
3014
+ setErrorMap: mt,
3015
+ strictObject: Kt,
3016
+ string: g,
3017
+ symbol: Ft,
3018
+ transformer: Xe,
3019
+ tuple: tr,
3020
+ undefined: qt,
3021
+ union: Xt,
3022
+ unknown: Ht,
3023
+ get util() {
3024
+ return x;
3025
+ },
3026
+ void: Gt
3027
+ }, Symbol.toStringTag, { value: "Module" }));
3028
+ ht(vr);
3029
+ const xr = (r, e) => e.skipDedupe || e.method !== "GET", kr = (r, e) => e.method + "@" + r, br = (r) => r.clone(), wr = ({ skip: r = xr, key: e = kr, resolver: t = br } = {}) => {
3057
3030
  const s = /* @__PURE__ */ new Map();
3058
3031
  return (n) => (a, i) => {
3059
3032
  if (r(a, i))
@@ -3062,118 +3035,118 @@ const wr = (r, e) => e.skipDedupe || e.method !== "GET", Tr = (r, e) => e.method
3062
3035
  if (!s.has(o))
3063
3036
  s.set(o, []);
3064
3037
  else
3065
- return new Promise((c, d) => {
3066
- s.get(o).push([c, d]);
3038
+ return new Promise((c, u) => {
3039
+ s.get(o).push([c, u]);
3067
3040
  });
3068
3041
  try {
3069
- return n(a, i).then((c) => (s.get(o).forEach(([d]) => d(t(c))), s.delete(o), c)).catch((c) => {
3070
- throw s.get(o).forEach(([, d]) => d(c)), s.delete(o), c;
3042
+ return n(a, i).then((c) => (s.get(o).forEach(([u]) => u(t(c))), s.delete(o), c)).catch((c) => {
3043
+ throw s.get(o).forEach(([, u]) => u(c)), s.delete(o), c;
3071
3044
  });
3072
3045
  } catch (c) {
3073
3046
  return s.delete(o), Promise.reject(c);
3074
3047
  }
3075
3048
  };
3076
- }, Zr = (r, e) => r * e, Or = (r) => r && r.ok, jr = ({ delayTimer: r = 500, delayRamp: e = Zr, maxAttempts: t = 10, until: s = Or, onRetry: n = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, h) => {
3049
+ }, Tr = (r, e) => r * e, Cr = (r) => r && r.ok, Sr = ({ delayTimer: r = 500, delayRamp: e = Tr, maxAttempts: t = 10, until: s = Cr, onRetry: n = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (u, p) => {
3077
3050
  let b = 0;
3078
- if (o && o(d, h))
3079
- return c(d, h);
3080
- const C = (w, M) => Promise.resolve(s(w, M)).then((Re) => Re ? w && i ? w : M ? Promise.reject(M) : w : (b++, !t || b <= t ? new Promise((D) => {
3051
+ if (o && o(u, p))
3052
+ return c(u, p);
3053
+ const A = (w, V) => Promise.resolve(s(w, V)).then((Ze) => Ze ? w && i ? w : V ? Promise.reject(V) : w : (b++, !t || b <= t ? new Promise((L) => {
3081
3054
  const be = e(r, b);
3082
3055
  setTimeout(() => {
3083
3056
  typeof n == "function" ? Promise.resolve(n({
3084
3057
  response: w,
3085
- error: M,
3086
- url: d,
3087
- options: h
3088
- })).then((B = {}) => {
3089
- var re, se;
3090
- D(c((re = B && B.url) !== null && re !== void 0 ? re : d, (se = B && B.options) !== null && se !== void 0 ? se : h));
3091
- }) : D(c(d, h));
3058
+ error: V,
3059
+ url: u,
3060
+ options: p
3061
+ })).then((q = {}) => {
3062
+ var ne, ae;
3063
+ L(c((ne = q && q.url) !== null && ne !== void 0 ? ne : u, (ae = q && q.options) !== null && ae !== void 0 ? ae : p));
3064
+ }) : L(c(u, p));
3092
3065
  }, be);
3093
- }).then(C).catch((D) => {
3066
+ }).then(A).catch((L) => {
3094
3067
  if (!a)
3095
- throw D;
3096
- return C(null, D);
3097
- }) : w && i ? w : Promise.reject(M || new Error("Number of attempts exceeded."))));
3098
- return c(d, h).then(C).catch((w) => {
3068
+ throw L;
3069
+ return A(null, L);
3070
+ }) : w && i ? w : Promise.reject(V || new Error("Number of attempts exceeded."))));
3071
+ return c(u, p).then(A).catch((w) => {
3099
3072
  if (!a)
3100
3073
  throw w;
3101
- return C(null, w);
3074
+ return A(null, w);
3102
3075
  });
3103
- }, Ae = p.object({
3104
- code: p.number(),
3105
- message: p.string()
3106
- }), Ar = p.object({
3107
- message: p.string()
3108
- }), Er = p.object({
3109
- emails: p.array(p.string()).optional(),
3110
- http_body: p.string().optional(),
3111
- http_url: p.string().optional(),
3112
- txt_name: p.string().optional(),
3113
- txt_value: p.string().optional()
3114
- }), Rr = p.object({
3115
- ciphers: p.array(p.string()).optional(),
3116
- early_hints: p.string().optional(),
3117
- http2: p.string().optional(),
3118
- min_tls_version: p.string().optional(),
3119
- tls_1_3: p.string().optional()
3120
- }), Nr = p.object({
3121
- id: p.string(),
3122
- bundle_method: p.string().optional(),
3123
- certificate_authority: p.string(),
3124
- custom_certificate: p.string().optional(),
3125
- custom_csr_id: p.string().optional(),
3126
- custom_key: p.string().optional(),
3127
- expires_on: p.string().optional(),
3128
- hosts: p.array(p.string()).optional(),
3129
- issuer: p.string().optional(),
3130
- method: p.string(),
3131
- serial_number: p.string().optional(),
3132
- settings: Rr.optional(),
3133
- signature: p.string().optional(),
3134
- type: p.string(),
3135
- uploaded_on: p.string().optional(),
3136
- validation_errors: p.array(Ar).optional(),
3137
- validation_records: p.array(Er).optional(),
3138
- wildcard: p.boolean()
3139
- }), Ir = p.object({
3140
- name: p.string(),
3141
- type: p.string(),
3142
- value: p.string()
3143
- }), $r = p.object({
3144
- http_body: p.string().optional(),
3145
- http_url: p.string().optional()
3146
- }), ot = p.object({
3147
- id: p.string(),
3148
- ssl: Nr,
3149
- hostname: p.string(),
3150
- custom_metadata: p.record(p.string()).optional(),
3151
- custom_origin_server: p.string().optional(),
3152
- custom_origin_sni: p.string().optional(),
3153
- ownership_verification: Ir.optional(),
3154
- ownership_verification_http: $r.optional(),
3155
- status: p.string(),
3156
- verification_errors: p.array(p.string()).optional(),
3157
- created_at: p.string()
3158
- }), ze = p.object({
3159
- errors: p.array(Ae),
3160
- messages: p.array(Ae),
3161
- success: p.boolean(),
3162
- result: ot
3163
- }), Pr = p.object({
3164
- errors: p.array(Ae),
3165
- messages: p.array(Ae),
3166
- success: p.boolean(),
3167
- result: p.array(ot)
3076
+ }, Re = Z({
3077
+ code: Ye(),
3078
+ message: g()
3079
+ }), Or = Z({
3080
+ message: g()
3081
+ }), Ar = Z({
3082
+ emails: O(g()).optional(),
3083
+ http_body: g().optional(),
3084
+ http_url: g().optional(),
3085
+ txt_name: g().optional(),
3086
+ txt_value: g().optional()
3087
+ }), jr = Z({
3088
+ ciphers: O(g()).optional(),
3089
+ early_hints: g().optional(),
3090
+ http2: g().optional(),
3091
+ min_tls_version: g().optional(),
3092
+ tls_1_3: g().optional()
3093
+ }), Rr = Z({
3094
+ id: g(),
3095
+ bundle_method: g().optional(),
3096
+ certificate_authority: g(),
3097
+ custom_certificate: g().optional(),
3098
+ custom_csr_id: g().optional(),
3099
+ custom_key: g().optional(),
3100
+ expires_on: g().optional(),
3101
+ hosts: O(g()).optional(),
3102
+ issuer: g().optional(),
3103
+ method: g(),
3104
+ serial_number: g().optional(),
3105
+ settings: jr.optional(),
3106
+ signature: g().optional(),
3107
+ type: g(),
3108
+ uploaded_on: g().optional(),
3109
+ validation_errors: O(Or).optional(),
3110
+ validation_records: O(Ar).optional(),
3111
+ wildcard: ke()
3112
+ }), Nr = Z({
3113
+ name: g(),
3114
+ type: g(),
3115
+ value: g()
3116
+ }), Zr = Z({
3117
+ http_body: g().optional(),
3118
+ http_url: g().optional()
3119
+ }), it = Z({
3120
+ id: g(),
3121
+ ssl: Rr,
3122
+ hostname: g(),
3123
+ custom_metadata: at(g()).optional(),
3124
+ custom_origin_server: g().optional(),
3125
+ custom_origin_sni: g().optional(),
3126
+ ownership_verification: Nr.optional(),
3127
+ ownership_verification_http: Zr.optional(),
3128
+ status: g(),
3129
+ verification_errors: O(g()).optional(),
3130
+ created_at: g()
3131
+ }), Ue = Z({
3132
+ errors: O(Re),
3133
+ messages: O(Re),
3134
+ success: ke(),
3135
+ result: it
3136
+ }), Er = Z({
3137
+ errors: O(Re),
3138
+ messages: O(Re),
3139
+ success: ke(),
3140
+ result: O(it)
3168
3141
  });
3169
- function Y(r) {
3170
- return lt(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3142
+ function K(r) {
3143
+ return ut(`https://api.cloudflare.com/client/v4/zones/${r.zoneId}`).headers({
3171
3144
  "X-Auth-Email": r.authEmail,
3172
3145
  "X-Auth-Key": r.authKey,
3173
3146
  "Content-Type": "application/json"
3174
- }).middlewares([jr(), Cr()]);
3147
+ }).middlewares([Sr(), wr()]);
3175
3148
  }
3176
- function Ue(r) {
3149
+ function Be(r) {
3177
3150
  const e = [];
3178
3151
  if (r.ssl.validation_records)
3179
3152
  for (const t of r.ssl.validation_records)
@@ -3193,15 +3166,15 @@ function Ue(r) {
3193
3166
  status: r.status === "active" ? "ready" : "pending",
3194
3167
  type: "auth0_managed_certs",
3195
3168
  verification: {
3196
- methods: p.array(ut).parse(e)
3169
+ methods: O(dt).parse(e)
3197
3170
  }
3198
3171
  };
3199
3172
  }
3200
- function Mr(r) {
3173
+ function Ir(r) {
3201
3174
  return {
3202
3175
  create: async (e, t) => {
3203
- const { result: s, errors: n, success: a } = ze.parse(
3204
- await Y(r).post(
3176
+ const { result: s, errors: n, success: a } = Ue.parse(
3177
+ await K(r).post(
3205
3178
  {
3206
3179
  hostname: t.domain,
3207
3180
  ssl: {
@@ -3217,7 +3190,7 @@ function Mr(r) {
3217
3190
  );
3218
3191
  if (!a)
3219
3192
  throw new Error(JSON.stringify(n));
3220
- const i = Ue({
3193
+ const i = Be({
3221
3194
  ...s,
3222
3195
  primary: !1
3223
3196
  });
@@ -3234,21 +3207,21 @@ function Mr(r) {
3234
3207
  t
3235
3208
  );
3236
3209
  if (!s)
3237
- throw new H(404);
3238
- const n = await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = ze.parse(n);
3210
+ throw new G(404);
3211
+ const n = await K(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json(), { result: a, errors: i, success: o } = Ue.parse(n);
3239
3212
  if (!o)
3240
- throw new H(503, {
3213
+ throw new G(503, {
3241
3214
  message: JSON.stringify(i)
3242
3215
  });
3243
3216
  if (r.enterprise && ((c = a.custom_metadata) == null ? void 0 : c.tenant_id) !== e)
3244
- throw new H(404);
3245
- return Ue({ ...s, ...a });
3217
+ throw new G(404);
3218
+ return Be({ ...s, ...a });
3246
3219
  },
3247
3220
  getByDomain: async (e) => r.customDomainAdapter.getByDomain(e),
3248
3221
  list: async (e) => {
3249
- const t = await r.customDomainAdapter.list(e), s = await Y(r).get("/custom_hostnames").json(), { result: n, errors: a, success: i } = Pr.parse(s);
3222
+ const t = await r.customDomainAdapter.list(e), s = await K(r).get("/custom_hostnames").json(), { result: n, errors: a, success: i } = Er.parse(s);
3250
3223
  if (!i)
3251
- throw new H(503, {
3224
+ throw new G(503, {
3252
3225
  message: JSON.stringify(a)
3253
3226
  });
3254
3227
  return n.filter(
@@ -3259,7 +3232,7 @@ function Mr(r) {
3259
3232
  return !(r.enterprise && ((c = o.custom_metadata) == null ? void 0 : c.tenant_id) !== e);
3260
3233
  }
3261
3234
  ).map(
3262
- (o) => Ue({
3235
+ (o) => Be({
3263
3236
  ...t.find((c) => c.custom_domain_id === o.id),
3264
3237
  ...o
3265
3238
  })
@@ -3268,22 +3241,22 @@ function Mr(r) {
3268
3241
  remove: async (e, t) => {
3269
3242
  var n;
3270
3243
  if (r.enterprise) {
3271
- const { result: a, success: i } = ze.parse(
3272
- await Y(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
3244
+ const { result: a, success: i } = Ue.parse(
3245
+ await K(r).get(`/custom_hostnames/${encodeURIComponent(t)}`).json()
3273
3246
  );
3274
3247
  if (!i || ((n = a.custom_metadata) == null ? void 0 : n.tenant_id) !== e)
3275
- throw new H(404);
3248
+ throw new G(404);
3276
3249
  }
3277
- const s = await Y(r).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
3250
+ const s = await K(r).delete(`/custom_hostnames/${encodeURIComponent(t)}`).res();
3278
3251
  return s.ok && await r.customDomainAdapter.remove(e, t), s.ok;
3279
3252
  },
3280
3253
  update: async (e, t, s) => {
3281
- const n = await Y(r).patch(
3254
+ const n = await K(r).patch(
3282
3255
  s,
3283
3256
  `/custom_hostnames/${encodeURIComponent(t)}`
3284
3257
  ).res();
3285
3258
  if (!n.ok)
3286
- throw new H(503, {
3259
+ throw new G(503, {
3287
3260
  message: await n.text()
3288
3261
  });
3289
3262
  return r.customDomainAdapter.update(
@@ -3294,9 +3267,9 @@ function Mr(r) {
3294
3267
  }
3295
3268
  };
3296
3269
  }
3297
- class Dr {
3270
+ class $r {
3298
3271
  constructor(e) {
3299
- ke(this, "cache", null);
3272
+ we(this, "cache", null);
3300
3273
  this.config = e;
3301
3274
  }
3302
3275
  async getCache() {
@@ -3331,14 +3304,14 @@ class Dr {
3331
3304
  value: t,
3332
3305
  expiresAt: i ? new Date(Date.now() + (o > 0 ? o * 1e3 : -1)).toISOString() : void 0,
3333
3306
  cachedAt: (/* @__PURE__ */ new Date()).toISOString()
3334
- }, d = this.createRequest(e), h = {
3307
+ }, u = this.createRequest(e), p = {
3335
3308
  "Content-Type": "application/json"
3336
3309
  };
3337
- i && o > 0 && (h["Cache-Control"] = `max-age=${o}`);
3310
+ i && o > 0 && (p["Cache-Control"] = `max-age=${o}`);
3338
3311
  const b = new Response(JSON.stringify(c), {
3339
- headers: h
3312
+ headers: p
3340
3313
  });
3341
- await n.put(d, b);
3314
+ await n.put(u, b);
3342
3315
  } catch (n) {
3343
3316
  console.error(`CloudflareCache: set error for key ${e}:`, n);
3344
3317
  }
@@ -3357,7 +3330,7 @@ class Dr {
3357
3330
  );
3358
3331
  }
3359
3332
  }
3360
- function Vr(r = {}) {
3333
+ function Pr(r = {}) {
3361
3334
  const e = {
3362
3335
  defaultTtlSeconds: 300,
3363
3336
  // 5 minutes default
@@ -3366,13 +3339,13 @@ function Vr(r = {}) {
3366
3339
  ...r
3367
3340
  // user config overrides defaults
3368
3341
  };
3369
- return new Dr(e);
3342
+ return new $r(e);
3370
3343
  }
3371
- function Br(r) {
3344
+ function Lr(r) {
3372
3345
  return {
3373
- customDomains: Mr(r),
3346
+ customDomains: Ir(r),
3374
3347
  // Always create a cache adapter (let createCloudflareCache apply defaults)
3375
- cache: Vr({
3348
+ cache: Pr({
3376
3349
  ...r.cacheName && { cacheName: r.cacheName },
3377
3350
  ...r.defaultTtlSeconds !== void 0 && {
3378
3351
  defaultTtlSeconds: r.defaultTtlSeconds
@@ -3382,5 +3355,5 @@ function Br(r) {
3382
3355
  };
3383
3356
  }
3384
3357
  export {
3385
- Br as default
3358
+ Lr as default
3386
3359
  };