@jsfsi-core/ts-crossplatform 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +14 -22
  2. package/dist/index.mjs +660 -631
  3. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1,36 +1,36 @@
1
- const At = (e = {}) => e, Rt = (e) => [e, void 0], Ct = (e) => [
1
+ const Ft = (e = {}) => e, Mt = (e) => [e, void 0], Vt = (e) => [
2
2
  void 0,
3
3
  e
4
4
  ];
5
- class Ft {
5
+ class Dt {
6
6
  name;
7
7
  constructor() {
8
8
  this.name = this.constructor.name;
9
9
  }
10
10
  }
11
- const Mt = (
11
+ const Lt = (
12
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
13
  (e) => (n) => !(n instanceof e)
14
- ), Ut = (
14
+ ), Gt = (
15
15
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
16
  (e) => (n) => n instanceof e
17
- ), Vt = (e, n = process.env) => {
17
+ ), Kt = (e, n = process.env) => {
18
18
  const t = e.safeParse(n);
19
19
  if (!t.success)
20
20
  throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);
21
21
  return t.data;
22
22
  };
23
- function Dt(e) {
23
+ function Yt(e) {
24
24
  return new Promise((n) => setTimeout(n, e));
25
25
  }
26
- function Ue(e, n) {
26
+ function Le(e, n) {
27
27
  return new Date(e).toLocaleDateString(n, {
28
28
  year: "numeric",
29
29
  month: "2-digit",
30
30
  day: "2-digit"
31
31
  });
32
32
  }
33
- function Ve(e, n) {
33
+ function Ge(e, n) {
34
34
  return new Date(e).toLocaleTimeString(n, {
35
35
  hour12: !1,
36
36
  hour: "2-digit",
@@ -38,49 +38,49 @@ function Ve(e, n) {
38
38
  second: "2-digit"
39
39
  });
40
40
  }
41
- function Lt(e, n) {
42
- return `${Ue(e, n)} ${Ve(e, n)}`;
41
+ function qt(e, n) {
42
+ return `${Le(e, n)} ${Ge(e, n)}`;
43
43
  }
44
- const De = "00000000-0000-0000-0000-000000000000", Le = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
44
+ const Ke = "00000000-0000-0000-0000-000000000000", Ye = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
45
45
  function ye(e) {
46
- return typeof e == "string" && Le.test(e);
46
+ return typeof e == "string" && Ye.test(e);
47
47
  }
48
- function Ge(e) {
48
+ function qe(e) {
49
49
  if (!ye(e))
50
50
  throw TypeError("Invalid UUID");
51
51
  let n;
52
52
  return Uint8Array.of((n = parseInt(e.slice(0, 8), 16)) >>> 24, n >>> 16 & 255, n >>> 8 & 255, n & 255, (n = parseInt(e.slice(9, 13), 16)) >>> 8, n & 255, (n = parseInt(e.slice(14, 18), 16)) >>> 8, n & 255, (n = parseInt(e.slice(19, 23), 16)) >>> 8, n & 255, (n = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, n / 4294967296 & 255, n >>> 24 & 255, n >>> 16 & 255, n >>> 8 & 255, n & 255);
53
53
  }
54
- const b = [];
54
+ const z = [];
55
55
  for (let e = 0; e < 256; ++e)
56
- b.push((e + 256).toString(16).slice(1));
57
- function Ke(e, n = 0) {
58
- return (b[e[n + 0]] + b[e[n + 1]] + b[e[n + 2]] + b[e[n + 3]] + "-" + b[e[n + 4]] + b[e[n + 5]] + "-" + b[e[n + 6]] + b[e[n + 7]] + "-" + b[e[n + 8]] + b[e[n + 9]] + "-" + b[e[n + 10]] + b[e[n + 11]] + b[e[n + 12]] + b[e[n + 13]] + b[e[n + 14]] + b[e[n + 15]]).toLowerCase();
59
- }
60
- let L;
61
- const Ye = new Uint8Array(16);
62
- function qe() {
63
- if (!L) {
56
+ z.push((e + 256).toString(16).slice(1));
57
+ function Je(e, n = 0) {
58
+ return (z[e[n + 0]] + z[e[n + 1]] + z[e[n + 2]] + z[e[n + 3]] + "-" + z[e[n + 4]] + z[e[n + 5]] + "-" + z[e[n + 6]] + z[e[n + 7]] + "-" + z[e[n + 8]] + z[e[n + 9]] + "-" + z[e[n + 10]] + z[e[n + 11]] + z[e[n + 12]] + z[e[n + 13]] + z[e[n + 14]] + z[e[n + 15]]).toLowerCase();
59
+ }
60
+ let G;
61
+ const Be = new Uint8Array(16);
62
+ function Xe() {
63
+ if (!G) {
64
64
  if (typeof crypto > "u" || !crypto.getRandomValues)
65
65
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
66
- L = crypto.getRandomValues.bind(crypto);
66
+ G = crypto.getRandomValues.bind(crypto);
67
67
  }
68
- return L(Ye);
68
+ return G(Be);
69
69
  }
70
- const Be = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), re = { randomUUID: Be };
71
- function Xe(e, n, t) {
72
- if (re.randomUUID && !e)
73
- return re.randomUUID();
70
+ const We = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ne = { randomUUID: We };
71
+ function He(e, n, t) {
72
+ if (ne.randomUUID && !e)
73
+ return ne.randomUUID();
74
74
  e = e || {};
75
- const r = e.random ?? e.rng?.() ?? qe();
75
+ const r = e.random ?? e.rng?.() ?? Xe();
76
76
  if (r.length < 16)
77
77
  throw new Error("Random bytes length must be >= 16");
78
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Ke(r);
78
+ return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Je(r);
79
79
  }
80
80
  class x {
81
81
  uuid;
82
82
  constructor(n) {
83
- Ge(n), this.uuid = n;
83
+ qe(n), this.uuid = n;
84
84
  }
85
85
  toString() {
86
86
  return this.uuid;
@@ -89,10 +89,10 @@ class x {
89
89
  return this.uuid === n.toString();
90
90
  }
91
91
  static new() {
92
- return new x(Xe());
92
+ return new x(He());
93
93
  }
94
94
  static empty() {
95
- return new x(De);
95
+ return new x(Ke);
96
96
  }
97
97
  static isValid(n) {
98
98
  return !!(n && ye(n));
@@ -102,31 +102,31 @@ class x {
102
102
  }
103
103
  }
104
104
  function c(e, n, t) {
105
- function r(s, l) {
106
- var f;
107
- Object.defineProperty(s, "_zod", {
108
- value: s._zod ?? {},
105
+ function r(i, a) {
106
+ var l;
107
+ Object.defineProperty(i, "_zod", {
108
+ value: i._zod ?? {},
109
109
  enumerable: !1
110
- }), (f = s._zod).traits ?? (f.traits = /* @__PURE__ */ new Set()), s._zod.traits.add(e), n(s, l);
111
- for (const y in i.prototype)
112
- y in s || Object.defineProperty(s, y, { value: i.prototype[y].bind(s) });
113
- s._zod.constr = i, s._zod.def = l;
110
+ }), (l = i._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), i._zod.traits.add(e), n(i, a);
111
+ for (const b in s.prototype)
112
+ b in i || Object.defineProperty(i, b, { value: s.prototype[b].bind(i) });
113
+ i._zod.constr = s, i._zod.def = a;
114
114
  }
115
115
  const o = t?.Parent ?? Object;
116
116
  class u extends o {
117
117
  }
118
118
  Object.defineProperty(u, "name", { value: e });
119
- function i(s) {
120
- var l;
121
- const f = t?.Parent ? new u() : this;
122
- r(f, s), (l = f._zod).deferred ?? (l.deferred = []);
123
- for (const y of f._zod.deferred)
124
- y();
125
- return f;
119
+ function s(i) {
120
+ var a;
121
+ const l = t?.Parent ? new u() : this;
122
+ r(l, i), (a = l._zod).deferred ?? (a.deferred = []);
123
+ for (const b of l._zod.deferred)
124
+ b();
125
+ return l;
126
126
  }
127
- return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
128
- value: (s) => t?.Parent && s instanceof t.Parent ? !0 : s?._zod?.traits?.has(e)
129
- }), Object.defineProperty(i, "name", { value: e }), i;
127
+ return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
128
+ value: (i) => t?.Parent && i instanceof t.Parent ? !0 : i?._zod?.traits?.has(e)
129
+ }), Object.defineProperty(s, "name", { value: e }), s;
130
130
  }
131
131
  class S extends Error {
132
132
  constructor() {
@@ -134,14 +134,14 @@ class S extends Error {
134
134
  }
135
135
  }
136
136
  const ke = {};
137
- function P(e) {
137
+ function E(e) {
138
138
  return ke;
139
139
  }
140
- function Je(e) {
140
+ function Qe(e) {
141
141
  const n = Object.values(e).filter((r) => typeof r == "number");
142
142
  return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
143
143
  }
144
- function We(e, n) {
144
+ function q(e, n) {
145
145
  return typeof n == "bigint" ? n.toString() : n;
146
146
  }
147
147
  function $e(e) {
@@ -154,35 +154,44 @@ function $e(e) {
154
154
  }
155
155
  };
156
156
  }
157
- function J(e) {
157
+ function W(e) {
158
158
  return e == null;
159
159
  }
160
- function W(e) {
160
+ function H(e) {
161
161
  const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
162
162
  return e.slice(n, t);
163
163
  }
164
- function He(e, n) {
165
- const t = (e.toString().split(".")[1] || "").length, r = (n.toString().split(".")[1] || "").length, o = t > r ? t : r, u = Number.parseInt(e.toFixed(o).replace(".", "")), i = Number.parseInt(n.toFixed(o).replace(".", ""));
166
- return u % i / 10 ** o;
164
+ function en(e, n) {
165
+ const t = (e.toString().split(".")[1] || "").length, r = n.toString();
166
+ let o = (r.split(".")[1] || "").length;
167
+ if (o === 0 && /\d?e-\d?/.test(r)) {
168
+ const a = r.match(/\d?e-(\d?)/);
169
+ a?.[1] && (o = Number.parseInt(a[1]));
170
+ }
171
+ const u = t > o ? t : o, s = Number.parseInt(e.toFixed(u).replace(".", "")), i = Number.parseInt(n.toFixed(u).replace(".", ""));
172
+ return s % i / 10 ** u;
167
173
  }
168
- function h(e, n, t) {
174
+ const te = Symbol("evaluating");
175
+ function p(e, n, t) {
176
+ let r;
169
177
  Object.defineProperty(e, n, {
170
178
  get() {
171
- {
172
- const r = t();
173
- return e[n] = r, r;
174
- }
179
+ if (r !== te)
180
+ return r === void 0 && (r = te, r = t()), r;
175
181
  },
176
- set(r) {
182
+ set(o) {
177
183
  Object.defineProperty(e, n, {
178
- value: r
184
+ value: o
179
185
  // configurable: true,
180
186
  });
181
187
  },
182
188
  configurable: !0
183
189
  });
184
190
  }
185
- function H(e, n, t) {
191
+ function nn(e) {
192
+ return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e));
193
+ }
194
+ function O(e, n, t) {
186
195
  Object.defineProperty(e, n, {
187
196
  value: t,
188
197
  writable: !0,
@@ -190,15 +199,23 @@ function H(e, n, t) {
190
199
  configurable: !0
191
200
  });
192
201
  }
193
- function O(e) {
202
+ function I(...e) {
203
+ const n = {};
204
+ for (const t of e) {
205
+ const r = Object.getOwnPropertyDescriptors(t);
206
+ Object.assign(n, r);
207
+ }
208
+ return Object.defineProperties({}, n);
209
+ }
210
+ function re(e) {
194
211
  return JSON.stringify(e);
195
212
  }
196
- const Ze = Error.captureStackTrace ? Error.captureStackTrace : (...e) => {
213
+ const Ze = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
197
214
  };
198
- function Y(e) {
215
+ function J(e) {
199
216
  return typeof e == "object" && e !== null && !Array.isArray(e);
200
217
  }
201
- const Qe = $e(() => {
218
+ const tn = $e(() => {
202
219
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
203
220
  return !1;
204
221
  try {
@@ -208,24 +225,27 @@ const Qe = $e(() => {
208
225
  return !1;
209
226
  }
210
227
  });
211
- function q(e) {
212
- if (Y(e) === !1)
228
+ function M(e) {
229
+ if (J(e) === !1)
213
230
  return !1;
214
231
  const n = e.constructor;
215
232
  if (n === void 0)
216
233
  return !0;
217
234
  const t = n.prototype;
218
- return !(Y(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
235
+ return !(J(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
219
236
  }
220
- const en = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
221
- function nn(e) {
237
+ function Pe(e) {
238
+ return M(e) ? { ...e } : e;
239
+ }
240
+ const rn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
241
+ function on(e) {
222
242
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
223
243
  }
224
- function N(e, n, t) {
244
+ function T(e, n, t) {
225
245
  const r = new e._zod.constr(n ?? e._zod.def);
226
246
  return (!n || t?.parent) && (r._zod.parent = e), r;
227
247
  }
228
- function g(e) {
248
+ function m(e) {
229
249
  const n = e;
230
250
  if (!n)
231
251
  return {};
@@ -238,114 +258,121 @@ function g(e) {
238
258
  }
239
259
  return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
240
260
  }
241
- function tn(e) {
261
+ function un(e) {
242
262
  return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
243
263
  }
244
- const rn = {
264
+ const sn = {
245
265
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
246
266
  int32: [-2147483648, 2147483647],
247
267
  uint32: [0, 4294967295],
248
268
  float32: [-34028234663852886e22, 34028234663852886e22],
249
269
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
250
270
  };
251
- function on(e, n) {
252
- const t = {}, r = e._zod.def;
253
- for (const o in n) {
254
- if (!(o in r.shape))
255
- throw new Error(`Unrecognized key: "${o}"`);
256
- n[o] && (t[o] = r.shape[o]);
257
- }
258
- return N(e, {
259
- ...e._zod.def,
260
- shape: t,
271
+ function cn(e, n) {
272
+ const t = e._zod.def, r = I(e._zod.def, {
273
+ get shape() {
274
+ const o = {};
275
+ for (const u in n) {
276
+ if (!(u in t.shape))
277
+ throw new Error(`Unrecognized key: "${u}"`);
278
+ n[u] && (o[u] = t.shape[u]);
279
+ }
280
+ return O(this, "shape", o), o;
281
+ },
261
282
  checks: []
262
283
  });
284
+ return T(e, r);
263
285
  }
264
- function un(e, n) {
265
- const t = { ...e._zod.def.shape }, r = e._zod.def;
266
- for (const o in n) {
267
- if (!(o in r.shape))
268
- throw new Error(`Unrecognized key: "${o}"`);
269
- n[o] && delete t[o];
270
- }
271
- return N(e, {
272
- ...e._zod.def,
273
- shape: t,
286
+ function an(e, n) {
287
+ const t = e._zod.def, r = I(e._zod.def, {
288
+ get shape() {
289
+ const o = { ...e._zod.def.shape };
290
+ for (const u in n) {
291
+ if (!(u in t.shape))
292
+ throw new Error(`Unrecognized key: "${u}"`);
293
+ n[u] && delete o[u];
294
+ }
295
+ return O(this, "shape", o), o;
296
+ },
274
297
  checks: []
275
298
  });
299
+ return T(e, r);
276
300
  }
277
- function sn(e, n) {
278
- if (!q(n))
301
+ function ln(e, n) {
302
+ if (!M(n))
279
303
  throw new Error("Invalid input to extend: expected a plain object");
280
- const t = {
281
- ...e._zod.def,
304
+ const t = I(e._zod.def, {
282
305
  get shape() {
283
306
  const r = { ...e._zod.def.shape, ...n };
284
- return H(this, "shape", r), r;
307
+ return O(this, "shape", r), r;
285
308
  },
286
309
  checks: []
287
- // delete existing checks
288
- };
289
- return N(e, t);
310
+ });
311
+ return T(e, t);
290
312
  }
291
- function cn(e, n) {
292
- return N(e, {
293
- ...e._zod.def,
313
+ function fn(e, n) {
314
+ const t = I(e._zod.def, {
294
315
  get shape() {
295
- const t = { ...e._zod.def.shape, ...n._zod.def.shape };
296
- return H(this, "shape", t), t;
316
+ const r = { ...e._zod.def.shape, ...n._zod.def.shape };
317
+ return O(this, "shape", r), r;
318
+ },
319
+ get catchall() {
320
+ return n._zod.def.catchall;
297
321
  },
298
- catchall: n._zod.def.catchall,
299
322
  checks: []
300
323
  // delete existing checks
301
324
  });
325
+ return T(e, t);
302
326
  }
303
- function an(e, n, t) {
304
- const r = n._zod.def.shape, o = { ...r };
305
- if (t)
306
- for (const u in t) {
307
- if (!(u in r))
308
- throw new Error(`Unrecognized key: "${u}"`);
309
- t[u] && (o[u] = e ? new e({
310
- type: "optional",
311
- innerType: r[u]
312
- }) : r[u]);
313
- }
314
- else
315
- for (const u in r)
316
- o[u] = e ? new e({
317
- type: "optional",
318
- innerType: r[u]
319
- }) : r[u];
320
- return N(n, {
321
- ...n._zod.def,
322
- shape: o,
327
+ function pn(e, n, t) {
328
+ const r = I(n._zod.def, {
329
+ get shape() {
330
+ const o = n._zod.def.shape, u = { ...o };
331
+ if (t)
332
+ for (const s in t) {
333
+ if (!(s in o))
334
+ throw new Error(`Unrecognized key: "${s}"`);
335
+ t[s] && (u[s] = e ? new e({
336
+ type: "optional",
337
+ innerType: o[s]
338
+ }) : o[s]);
339
+ }
340
+ else
341
+ for (const s in o)
342
+ u[s] = e ? new e({
343
+ type: "optional",
344
+ innerType: o[s]
345
+ }) : o[s];
346
+ return O(this, "shape", u), u;
347
+ },
323
348
  checks: []
324
349
  });
350
+ return T(n, r);
325
351
  }
326
- function ln(e, n, t) {
327
- const r = n._zod.def.shape, o = { ...r };
328
- if (t)
329
- for (const u in t) {
330
- if (!(u in o))
331
- throw new Error(`Unrecognized key: "${u}"`);
332
- t[u] && (o[u] = new e({
333
- type: "nonoptional",
334
- innerType: r[u]
335
- }));
336
- }
337
- else
338
- for (const u in r)
339
- o[u] = new e({
340
- type: "nonoptional",
341
- innerType: r[u]
342
- });
343
- return N(n, {
344
- ...n._zod.def,
345
- shape: o,
346
- // optional: [],
352
+ function hn(e, n, t) {
353
+ const r = I(n._zod.def, {
354
+ get shape() {
355
+ const o = n._zod.def.shape, u = { ...o };
356
+ if (t)
357
+ for (const s in t) {
358
+ if (!(s in u))
359
+ throw new Error(`Unrecognized key: "${s}"`);
360
+ t[s] && (u[s] = new e({
361
+ type: "nonoptional",
362
+ innerType: o[s]
363
+ }));
364
+ }
365
+ else
366
+ for (const s in o)
367
+ u[s] = new e({
368
+ type: "nonoptional",
369
+ innerType: o[s]
370
+ });
371
+ return O(this, "shape", u), u;
372
+ },
347
373
  checks: []
348
374
  });
375
+ return T(n, r);
349
376
  }
350
377
  function j(e, n = 0) {
351
378
  for (let t = n; t < e.issues.length; t++)
@@ -353,24 +380,24 @@ function j(e, n = 0) {
353
380
  return !0;
354
381
  return !1;
355
382
  }
356
- function Q(e, n) {
383
+ function Ee(e, n) {
357
384
  return n.map((t) => {
358
385
  var r;
359
386
  return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
360
387
  });
361
388
  }
362
- function F(e) {
389
+ function C(e) {
363
390
  return typeof e == "string" ? e : e?.message;
364
391
  }
365
- function I(e, n, t) {
392
+ function N(e, n, t) {
366
393
  const r = { ...e, path: e.path ?? [] };
367
394
  if (!e.message) {
368
- const o = F(e.inst?._zod.def?.error?.(e)) ?? F(n?.error?.(e)) ?? F(t.customError?.(e)) ?? F(t.localeError?.(e)) ?? "Invalid input";
395
+ const o = C(e.inst?._zod.def?.error?.(e)) ?? C(n?.error?.(e)) ?? C(t.customError?.(e)) ?? C(t.localeError?.(e)) ?? "Invalid input";
369
396
  r.message = o;
370
397
  }
371
398
  return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
372
399
  }
373
- function ee(e) {
400
+ function Q(e) {
374
401
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
375
402
  }
376
403
  function A(...e) {
@@ -382,95 +409,89 @@ function A(...e) {
382
409
  inst: r
383
410
  } : { ...n };
384
411
  }
385
- const Ee = (e, n) => {
412
+ const Ne = (e, n) => {
386
413
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
387
414
  value: e._zod,
388
415
  enumerable: !1
389
416
  }), Object.defineProperty(e, "issues", {
390
417
  value: n,
391
418
  enumerable: !1
392
- }), Object.defineProperty(e, "message", {
393
- get() {
394
- return JSON.stringify(n, We, 2);
395
- },
396
- enumerable: !0
397
- // configurable: false,
398
- }), Object.defineProperty(e, "toString", {
419
+ }), e.message = JSON.stringify(n, q, 2), Object.defineProperty(e, "toString", {
399
420
  value: () => e.message,
400
421
  enumerable: !1
401
422
  });
402
- }, Pe = c("$ZodError", Ee), Ie = c("$ZodError", Ee, { Parent: Error });
403
- function fn(e, n = (t) => t.message) {
423
+ }, Oe = c("$ZodError", Ne), Te = c("$ZodError", Ne, { Parent: Error });
424
+ function dn(e, n = (t) => t.message) {
404
425
  const t = {}, r = [];
405
426
  for (const o of e.issues)
406
427
  o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
407
428
  return { formErrors: r, fieldErrors: t };
408
429
  }
409
- function pn(e, n) {
430
+ function mn(e, n) {
410
431
  const t = n || function(u) {
411
432
  return u.message;
412
433
  }, r = { _errors: [] }, o = (u) => {
413
- for (const i of u.issues)
414
- if (i.code === "invalid_union" && i.errors.length)
415
- i.errors.map((s) => o({ issues: s }));
416
- else if (i.code === "invalid_key")
417
- o({ issues: i.issues });
418
- else if (i.code === "invalid_element")
419
- o({ issues: i.issues });
420
- else if (i.path.length === 0)
421
- r._errors.push(t(i));
434
+ for (const s of u.issues)
435
+ if (s.code === "invalid_union" && s.errors.length)
436
+ s.errors.map((i) => o({ issues: i }));
437
+ else if (s.code === "invalid_key")
438
+ o({ issues: s.issues });
439
+ else if (s.code === "invalid_element")
440
+ o({ issues: s.issues });
441
+ else if (s.path.length === 0)
442
+ r._errors.push(t(s));
422
443
  else {
423
- let s = r, l = 0;
424
- for (; l < i.path.length; ) {
425
- const f = i.path[l];
426
- l === i.path.length - 1 ? (s[f] = s[f] || { _errors: [] }, s[f]._errors.push(t(i))) : s[f] = s[f] || { _errors: [] }, s = s[f], l++;
444
+ let i = r, a = 0;
445
+ for (; a < s.path.length; ) {
446
+ const l = s.path[a];
447
+ a === s.path.length - 1 ? (i[l] = i[l] || { _errors: [] }, i[l]._errors.push(t(s))) : i[l] = i[l] || { _errors: [] }, i = i[l], a++;
427
448
  }
428
449
  }
429
450
  };
430
451
  return o(e), r;
431
452
  }
432
- const hn = (e) => (n, t, r, o) => {
433
- const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, u);
434
- if (i instanceof Promise)
453
+ const _n = (e) => (n, t, r, o) => {
454
+ const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, u);
455
+ if (s instanceof Promise)
435
456
  throw new S();
436
- if (i.issues.length) {
437
- const s = new (o?.Err ?? e)(i.issues.map((l) => I(l, u, P())));
438
- throw Ze(s, o?.callee), s;
457
+ if (s.issues.length) {
458
+ const i = new (o?.Err ?? e)(s.issues.map((a) => N(a, u, E())));
459
+ throw Ze(i, o?.callee), i;
439
460
  }
440
- return i.value;
441
- }, dn = (e) => async (n, t, r, o) => {
461
+ return s.value;
462
+ }, gn = (e) => async (n, t, r, o) => {
442
463
  const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
443
- let i = n._zod.run({ value: t, issues: [] }, u);
444
- if (i instanceof Promise && (i = await i), i.issues.length) {
445
- const s = new (o?.Err ?? e)(i.issues.map((l) => I(l, u, P())));
446
- throw Ze(s, o?.callee), s;
464
+ let s = n._zod.run({ value: t, issues: [] }, u);
465
+ if (s instanceof Promise && (s = await s), s.issues.length) {
466
+ const i = new (o?.Err ?? e)(s.issues.map((a) => N(a, u, E())));
467
+ throw Ze(i, o?.callee), i;
447
468
  }
448
- return i.value;
449
- }, Ne = (e) => (n, t, r) => {
469
+ return s.value;
470
+ }, Ie = (e) => (n, t, r) => {
450
471
  const o = r ? { ...r, async: !1 } : { async: !1 }, u = n._zod.run({ value: t, issues: [] }, o);
451
472
  if (u instanceof Promise)
452
473
  throw new S();
453
474
  return u.issues.length ? {
454
475
  success: !1,
455
- error: new (e ?? Pe)(u.issues.map((i) => I(i, o, P())))
476
+ error: new (e ?? Oe)(u.issues.map((s) => N(s, o, E())))
456
477
  } : { success: !0, data: u.value };
457
- }, mn = /* @__PURE__ */ Ne(Ie), Te = (e) => async (n, t, r) => {
478
+ }, vn = /* @__PURE__ */ Ie(Te), xe = (e) => async (n, t, r) => {
458
479
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
459
480
  let u = n._zod.run({ value: t, issues: [] }, o);
460
481
  return u instanceof Promise && (u = await u), u.issues.length ? {
461
482
  success: !1,
462
- error: new e(u.issues.map((i) => I(i, o, P())))
483
+ error: new e(u.issues.map((s) => N(s, o, E())))
463
484
  } : { success: !0, data: u.value };
464
- }, _n = /* @__PURE__ */ Te(Ie), vn = /^\d+$/, gn = /^-?\d+(?:\.\d+)?/i, $ = /* @__PURE__ */ c("$ZodCheck", (e, n) => {
485
+ }, zn = /* @__PURE__ */ xe(Te), bn = /^\d+$/, wn = /^-?\d+(?:\.\d+)?/i, $ = /* @__PURE__ */ c("$ZodCheck", (e, n) => {
465
486
  var t;
466
487
  e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
467
- }), Oe = {
488
+ }), je = {
468
489
  number: "number",
469
490
  bigint: "bigint",
470
491
  object: "date"
471
- }, xe = /* @__PURE__ */ c("$ZodCheckLessThan", (e, n) => {
492
+ }, Se = /* @__PURE__ */ c("$ZodCheckLessThan", (e, n) => {
472
493
  $.init(e, n);
473
- const t = Oe[typeof n.value];
494
+ const t = je[typeof n.value];
474
495
  e._zod.onattach.push((r) => {
475
496
  const o = r._zod.bag, u = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
476
497
  n.value < u && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
@@ -485,9 +506,9 @@ const hn = (e) => (n, t, r, o) => {
485
506
  continue: !n.abort
486
507
  });
487
508
  };
488
- }), je = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, n) => {
509
+ }), Ae = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, n) => {
489
510
  $.init(e, n);
490
- const t = Oe[typeof n.value];
511
+ const t = je[typeof n.value];
491
512
  e._zod.onattach.push((r) => {
492
513
  const o = r._zod.bag, u = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
493
514
  n.value > u && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
@@ -502,14 +523,14 @@ const hn = (e) => (n, t, r, o) => {
502
523
  continue: !n.abort
503
524
  });
504
525
  };
505
- }), zn = /* @__PURE__ */ c("$ZodCheckMultipleOf", (e, n) => {
526
+ }), yn = /* @__PURE__ */ c("$ZodCheckMultipleOf", (e, n) => {
506
527
  $.init(e, n), e._zod.onattach.push((t) => {
507
528
  var r;
508
529
  (r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
509
530
  }), e._zod.check = (t) => {
510
531
  if (typeof t.value != typeof n.value)
511
532
  throw new Error("Cannot mix number and bigint in multiple_of check.");
512
- (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : He(t.value, n.value) === 0) || t.issues.push({
533
+ (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : en(t.value, n.value) === 0) || t.issues.push({
513
534
  origin: typeof t.value,
514
535
  code: "not_multiple_of",
515
536
  divisor: n.value,
@@ -518,36 +539,37 @@ const hn = (e) => (n, t, r, o) => {
518
539
  continue: !n.abort
519
540
  });
520
541
  };
521
- }), wn = /* @__PURE__ */ c("$ZodCheckNumberFormat", (e, n) => {
542
+ }), kn = /* @__PURE__ */ c("$ZodCheckNumberFormat", (e, n) => {
522
543
  $.init(e, n), n.format = n.format || "float64";
523
- const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = rn[n.format];
524
- e._zod.onattach.push((i) => {
525
- const s = i._zod.bag;
526
- s.format = n.format, s.minimum = o, s.maximum = u, t && (s.pattern = vn);
527
- }), e._zod.check = (i) => {
528
- const s = i.value;
544
+ const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = sn[n.format];
545
+ e._zod.onattach.push((s) => {
546
+ const i = s._zod.bag;
547
+ i.format = n.format, i.minimum = o, i.maximum = u, t && (i.pattern = bn);
548
+ }), e._zod.check = (s) => {
549
+ const i = s.value;
529
550
  if (t) {
530
- if (!Number.isInteger(s)) {
531
- i.issues.push({
551
+ if (!Number.isInteger(i)) {
552
+ s.issues.push({
532
553
  expected: r,
533
554
  format: n.format,
534
555
  code: "invalid_type",
535
- input: s,
556
+ continue: !1,
557
+ input: i,
536
558
  inst: e
537
559
  });
538
560
  return;
539
561
  }
540
- if (!Number.isSafeInteger(s)) {
541
- s > 0 ? i.issues.push({
542
- input: s,
562
+ if (!Number.isSafeInteger(i)) {
563
+ i > 0 ? s.issues.push({
564
+ input: i,
543
565
  code: "too_big",
544
566
  maximum: Number.MAX_SAFE_INTEGER,
545
567
  note: "Integers must be within the safe integer range.",
546
568
  inst: e,
547
569
  origin: r,
548
570
  continue: !n.abort
549
- }) : i.issues.push({
550
- input: s,
571
+ }) : s.issues.push({
572
+ input: i,
551
573
  code: "too_small",
552
574
  minimum: Number.MIN_SAFE_INTEGER,
553
575
  note: "Integers must be within the safe integer range.",
@@ -558,27 +580,27 @@ const hn = (e) => (n, t, r, o) => {
558
580
  return;
559
581
  }
560
582
  }
561
- s < o && i.issues.push({
583
+ i < o && s.issues.push({
562
584
  origin: "number",
563
- input: s,
585
+ input: i,
564
586
  code: "too_small",
565
587
  minimum: o,
566
588
  inclusive: !0,
567
589
  inst: e,
568
590
  continue: !n.abort
569
- }), s > u && i.issues.push({
591
+ }), i > u && s.issues.push({
570
592
  origin: "number",
571
- input: s,
593
+ input: i,
572
594
  code: "too_big",
573
595
  maximum: u,
574
596
  inst: e
575
597
  });
576
598
  };
577
- }), bn = /* @__PURE__ */ c("$ZodCheckMaxLength", (e, n) => {
599
+ }), $n = /* @__PURE__ */ c("$ZodCheckMaxLength", (e, n) => {
578
600
  var t;
579
601
  $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
580
602
  const o = r.value;
581
- return !J(o) && o.length !== void 0;
603
+ return !W(o) && o.length !== void 0;
582
604
  }), e._zod.onattach.push((r) => {
583
605
  const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
584
606
  n.maximum < o && (r._zod.bag.maximum = n.maximum);
@@ -586,9 +608,9 @@ const hn = (e) => (n, t, r, o) => {
586
608
  const o = r.value;
587
609
  if (o.length <= n.maximum)
588
610
  return;
589
- const i = ee(o);
611
+ const s = Q(o);
590
612
  r.issues.push({
591
- origin: i,
613
+ origin: s,
592
614
  code: "too_big",
593
615
  maximum: n.maximum,
594
616
  inclusive: !0,
@@ -597,11 +619,11 @@ const hn = (e) => (n, t, r, o) => {
597
619
  continue: !n.abort
598
620
  });
599
621
  };
600
- }), yn = /* @__PURE__ */ c("$ZodCheckMinLength", (e, n) => {
622
+ }), Zn = /* @__PURE__ */ c("$ZodCheckMinLength", (e, n) => {
601
623
  var t;
602
624
  $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
603
625
  const o = r.value;
604
- return !J(o) && o.length !== void 0;
626
+ return !W(o) && o.length !== void 0;
605
627
  }), e._zod.onattach.push((r) => {
606
628
  const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
607
629
  n.minimum > o && (r._zod.bag.minimum = n.minimum);
@@ -609,9 +631,9 @@ const hn = (e) => (n, t, r, o) => {
609
631
  const o = r.value;
610
632
  if (o.length >= n.minimum)
611
633
  return;
612
- const i = ee(o);
634
+ const s = Q(o);
613
635
  r.issues.push({
614
- origin: i,
636
+ origin: s,
615
637
  code: "too_small",
616
638
  minimum: n.minimum,
617
639
  inclusive: !0,
@@ -620,11 +642,11 @@ const hn = (e) => (n, t, r, o) => {
620
642
  continue: !n.abort
621
643
  });
622
644
  };
623
- }), kn = /* @__PURE__ */ c("$ZodCheckLengthEquals", (e, n) => {
645
+ }), Pn = /* @__PURE__ */ c("$ZodCheckLengthEquals", (e, n) => {
624
646
  var t;
625
647
  $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
626
648
  const o = r.value;
627
- return !J(o) && o.length !== void 0;
649
+ return !W(o) && o.length !== void 0;
628
650
  }), e._zod.onattach.push((r) => {
629
651
  const o = r._zod.bag;
630
652
  o.minimum = n.length, o.maximum = n.length, o.length = n.length;
@@ -632,10 +654,10 @@ const hn = (e) => (n, t, r, o) => {
632
654
  const o = r.value, u = o.length;
633
655
  if (u === n.length)
634
656
  return;
635
- const i = ee(o), s = u > n.length;
657
+ const s = Q(o), i = u > n.length;
636
658
  r.issues.push({
637
- origin: i,
638
- ...s ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
659
+ origin: s,
660
+ ...i ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
639
661
  inclusive: !0,
640
662
  exact: !0,
641
663
  input: r.value,
@@ -643,12 +665,12 @@ const hn = (e) => (n, t, r, o) => {
643
665
  continue: !n.abort
644
666
  });
645
667
  };
646
- }), $n = /* @__PURE__ */ c("$ZodCheckOverwrite", (e, n) => {
668
+ }), En = /* @__PURE__ */ c("$ZodCheckOverwrite", (e, n) => {
647
669
  $.init(e, n), e._zod.check = (t) => {
648
670
  t.value = n.tx(t.value);
649
671
  };
650
672
  });
651
- class Zn {
673
+ class Nn {
652
674
  constructor(n = []) {
653
675
  this.content = [], this.indent = 0, this && (this.args = n);
654
676
  }
@@ -661,9 +683,9 @@ class Zn {
661
683
  return;
662
684
  }
663
685
  const r = n.split(`
664
- `).filter((i) => i), o = Math.min(...r.map((i) => i.length - i.trimStart().length)), u = r.map((i) => i.slice(o)).map((i) => " ".repeat(this.indent * 2) + i);
665
- for (const i of u)
666
- this.content.push(i);
686
+ `).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), u = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
687
+ for (const s of u)
688
+ this.content.push(s);
667
689
  }
668
690
  compile() {
669
691
  const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
@@ -671,13 +693,13 @@ class Zn {
671
693
  `));
672
694
  }
673
695
  }
674
- const En = {
696
+ const On = {
675
697
  major: 4,
676
698
  minor: 0,
677
- patch: 5
699
+ patch: 17
678
700
  }, _ = /* @__PURE__ */ c("$ZodType", (e, n) => {
679
701
  var t;
680
- e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = En;
702
+ e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = On;
681
703
  const r = [...e._zod.def.checks ?? []];
682
704
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
683
705
  for (const o of r)
@@ -688,53 +710,53 @@ const En = {
688
710
  e._zod.run = e._zod.parse;
689
711
  });
690
712
  else {
691
- const o = (u, i, s) => {
692
- let l = j(u), f;
693
- for (const y of i) {
694
- if (y._zod.def.when) {
695
- if (!y._zod.def.when(u))
713
+ const o = (u, s, i) => {
714
+ let a = j(u), l;
715
+ for (const b of s) {
716
+ if (b._zod.def.when) {
717
+ if (!b._zod.def.when(u))
696
718
  continue;
697
- } else if (l)
719
+ } else if (a)
698
720
  continue;
699
- const a = u.issues.length, p = y._zod.check(u);
700
- if (p instanceof Promise && s?.async === !1)
721
+ const f = u.issues.length, h = b._zod.check(u);
722
+ if (h instanceof Promise && i?.async === !1)
701
723
  throw new S();
702
- if (f || p instanceof Promise)
703
- f = (f ?? Promise.resolve()).then(async () => {
704
- await p, u.issues.length !== a && (l || (l = j(u, a)));
724
+ if (l || h instanceof Promise)
725
+ l = (l ?? Promise.resolve()).then(async () => {
726
+ await h, u.issues.length !== f && (a || (a = j(u, f)));
705
727
  });
706
728
  else {
707
- if (u.issues.length === a)
729
+ if (u.issues.length === f)
708
730
  continue;
709
- l || (l = j(u, a));
731
+ a || (a = j(u, f));
710
732
  }
711
733
  }
712
- return f ? f.then(() => u) : u;
734
+ return l ? l.then(() => u) : u;
713
735
  };
714
- e._zod.run = (u, i) => {
715
- const s = e._zod.parse(u, i);
716
- if (s instanceof Promise) {
717
- if (i.async === !1)
736
+ e._zod.run = (u, s) => {
737
+ const i = e._zod.parse(u, s);
738
+ if (i instanceof Promise) {
739
+ if (s.async === !1)
718
740
  throw new S();
719
- return s.then((l) => o(l, r, i));
741
+ return i.then((a) => o(a, r, s));
720
742
  }
721
- return o(s, r, i);
743
+ return o(i, r, s);
722
744
  };
723
745
  }
724
746
  e["~standard"] = {
725
747
  validate: (o) => {
726
748
  try {
727
- const u = mn(e, o);
749
+ const u = vn(e, o);
728
750
  return u.success ? { value: u.data } : { issues: u.error?.issues };
729
751
  } catch {
730
- return _n(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
752
+ return zn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
731
753
  }
732
754
  },
733
755
  vendor: "zod",
734
756
  version: 1
735
757
  };
736
- }), Se = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
737
- _.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? gn, e._zod.parse = (t, r) => {
758
+ }), Re = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
759
+ _.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? wn, e._zod.parse = (t, r) => {
738
760
  if (n.coerce)
739
761
  try {
740
762
  t.value = Number(t.value);
@@ -752,11 +774,11 @@ const En = {
752
774
  ...u ? { received: u } : {}
753
775
  }), t;
754
776
  };
755
- }), Pn = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
756
- wn.init(e, n), Se.init(e, n);
777
+ }), Tn = /* @__PURE__ */ c("$ZodNumber", (e, n) => {
778
+ kn.init(e, n), Re.init(e, n);
757
779
  }), In = /* @__PURE__ */ c("$ZodUnknown", (e, n) => {
758
780
  _.init(e, n), e._zod.parse = (t) => t;
759
- }), Nn = /* @__PURE__ */ c("$ZodNever", (e, n) => {
781
+ }), xn = /* @__PURE__ */ c("$ZodNever", (e, n) => {
760
782
  _.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
761
783
  expected: "never",
762
784
  code: "invalid_type",
@@ -765,9 +787,9 @@ const En = {
765
787
  }), t);
766
788
  });
767
789
  function oe(e, n, t) {
768
- e.issues.length && n.issues.push(...Q(t, e.issues)), n.value[t] = e.value;
790
+ e.issues.length && n.issues.push(...Ee(t, e.issues)), n.value[t] = e.value;
769
791
  }
770
- const Tn = /* @__PURE__ */ c("$ZodArray", (e, n) => {
792
+ const jn = /* @__PURE__ */ c("$ZodArray", (e, n) => {
771
793
  _.init(e, n), e._zod.parse = (t, r) => {
772
794
  const o = t.value;
773
795
  if (!Array.isArray(o))
@@ -779,185 +801,173 @@ const Tn = /* @__PURE__ */ c("$ZodArray", (e, n) => {
779
801
  }), t;
780
802
  t.value = Array(o.length);
781
803
  const u = [];
782
- for (let i = 0; i < o.length; i++) {
783
- const s = o[i], l = n.element._zod.run({
784
- value: s,
804
+ for (let s = 0; s < o.length; s++) {
805
+ const i = o[s], a = n.element._zod.run({
806
+ value: i,
785
807
  issues: []
786
808
  }, r);
787
- l instanceof Promise ? u.push(l.then((f) => oe(f, t, i))) : oe(l, t, i);
809
+ a instanceof Promise ? u.push(a.then((l) => oe(l, t, s))) : oe(a, t, s);
788
810
  }
789
811
  return u.length ? Promise.all(u).then(() => t) : t;
790
812
  };
791
813
  });
792
- function M(e, n, t) {
793
- e.issues.length && n.issues.push(...Q(t, e.issues)), n.value[t] = e.value;
794
- }
795
- function ue(e, n, t, r) {
796
- e.issues.length ? r[t] === void 0 ? t in r ? n.value[t] = void 0 : n.value[t] = e.value : n.issues.push(...Q(t, e.issues)) : e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
814
+ function U(e, n, t, r) {
815
+ e.issues.length && n.issues.push(...Ee(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
797
816
  }
798
- const On = /* @__PURE__ */ c("$ZodObject", (e, n) => {
817
+ const Sn = /* @__PURE__ */ c("$ZodObject", (e, n) => {
799
818
  _.init(e, n);
800
819
  const t = $e(() => {
801
- const a = Object.keys(n.shape);
802
- for (const d of a)
803
- if (!(n.shape[d] instanceof _))
820
+ const f = Object.keys(n.shape);
821
+ for (const d of f)
822
+ if (!n.shape[d]._zod.traits.has("$ZodType"))
804
823
  throw new Error(`Invalid element at key "${d}": expected a Zod schema`);
805
- const p = tn(n.shape);
824
+ const h = un(n.shape);
806
825
  return {
807
826
  shape: n.shape,
808
- keys: a,
809
- keySet: new Set(a),
810
- numKeys: a.length,
811
- optionalKeys: new Set(p)
827
+ keys: f,
828
+ keySet: new Set(f),
829
+ numKeys: f.length,
830
+ optionalKeys: new Set(h)
812
831
  };
813
832
  });
814
- h(e._zod, "propValues", () => {
815
- const a = n.shape, p = {};
816
- for (const d in a) {
817
- const k = a[d]._zod;
818
- if (k.values) {
819
- p[d] ?? (p[d] = /* @__PURE__ */ new Set());
820
- for (const Z of k.values)
821
- p[d].add(Z);
833
+ p(e._zod, "propValues", () => {
834
+ const f = n.shape, h = {};
835
+ for (const d in f) {
836
+ const y = f[d]._zod;
837
+ if (y.values) {
838
+ h[d] ?? (h[d] = /* @__PURE__ */ new Set());
839
+ for (const Z of y.values)
840
+ h[d].add(Z);
822
841
  }
823
842
  }
824
- return p;
843
+ return h;
825
844
  });
826
- const r = (a) => {
827
- const p = new Zn(["shape", "payload", "ctx"]), d = t.value, k = (w) => {
828
- const m = O(w);
829
- return `shape[${m}]._zod.run({ value: input[${m}], issues: [] }, ctx)`;
845
+ const r = (f) => {
846
+ const h = new Nn(["shape", "payload", "ctx"]), d = t.value, y = (k) => {
847
+ const g = re(k);
848
+ return `shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`;
830
849
  };
831
- p.write("const input = payload.value;");
850
+ h.write("const input = payload.value;");
832
851
  const Z = /* @__PURE__ */ Object.create(null);
833
852
  let D = 0;
834
- for (const w of d.keys)
835
- Z[w] = `key_${D++}`;
836
- p.write("const newResult = {}");
837
- for (const w of d.keys)
838
- if (d.optionalKeys.has(w)) {
839
- const m = Z[w];
840
- p.write(`const ${m} = ${k(w)};`);
841
- const v = O(w);
842
- p.write(`
843
- if (${m}.issues.length) {
844
- if (input[${v}] === undefined) {
845
- if (${v} in input) {
846
- newResult[${v}] = undefined;
847
- }
848
- } else {
849
- payload.issues = payload.issues.concat(
850
- ${m}.issues.map((iss) => ({
851
- ...iss,
852
- path: iss.path ? [${v}, ...iss.path] : [${v}],
853
- }))
854
- );
853
+ for (const k of d.keys)
854
+ Z[k] = `key_${D++}`;
855
+ h.write("const newResult = {}");
856
+ for (const k of d.keys) {
857
+ const g = Z[k], w = re(k);
858
+ h.write(`const ${g} = ${y(k)};`), h.write(`
859
+ if (${g}.issues.length) {
860
+ payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
861
+ ...iss,
862
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
863
+ })));
864
+ }
865
+
866
+ if (${g}.value === undefined) {
867
+ if (${w} in input) {
868
+ newResult[${w}] = undefined;
855
869
  }
856
- } else if (${m}.value === undefined) {
857
- if (${v} in input) newResult[${v}] = undefined;
858
870
  } else {
859
- newResult[${v}] = ${m}.value;
871
+ newResult[${w}] = ${g}.value;
860
872
  }
861
- `);
862
- } else {
863
- const m = Z[w];
864
- p.write(`const ${m} = ${k(w)};`), p.write(`
865
- if (${m}.issues.length) payload.issues = payload.issues.concat(${m}.issues.map(iss => ({
866
- ...iss,
867
- path: iss.path ? [${O(w)}, ...iss.path] : [${O(w)}]
868
- })));`), p.write(`newResult[${O(w)}] = ${m}.value`);
869
- }
870
- p.write("payload.value = newResult;"), p.write("return payload;");
871
- const R = p.compile();
872
- return (w, m) => R(a, w, m);
873
+ `);
874
+ }
875
+ h.write("payload.value = newResult;"), h.write("return payload;");
876
+ const R = h.compile();
877
+ return (k, g) => R(f, k, g);
873
878
  };
874
879
  let o;
875
- const u = Y, i = !ke.jitless, l = i && Qe.value, f = n.catchall;
876
- let y;
877
- e._zod.parse = (a, p) => {
878
- y ?? (y = t.value);
879
- const d = a.value;
880
+ const u = J, s = !ke.jitless, a = s && tn.value, l = n.catchall;
881
+ let b;
882
+ e._zod.parse = (f, h) => {
883
+ b ?? (b = t.value);
884
+ const d = f.value;
880
885
  if (!u(d))
881
- return a.issues.push({
886
+ return f.issues.push({
882
887
  expected: "object",
883
888
  code: "invalid_type",
884
889
  input: d,
885
890
  inst: e
886
- }), a;
887
- const k = [];
888
- if (i && l && p?.async === !1 && p.jitless !== !0)
889
- o || (o = r(n.shape)), a = o(a, p);
891
+ }), f;
892
+ const y = [];
893
+ if (s && a && h?.async === !1 && h.jitless !== !0)
894
+ o || (o = r(n.shape)), f = o(f, h);
890
895
  else {
891
- a.value = {};
892
- const m = y.shape;
893
- for (const v of y.keys) {
894
- const T = m[v], C = T._zod.run({ value: d[v], issues: [] }, p), ne = T._zod.optin === "optional" && T._zod.optout === "optional";
895
- C instanceof Promise ? k.push(C.then((te) => ne ? ue(te, a, v, d) : M(te, a, v))) : ne ? ue(C, a, v, d) : M(C, a, v);
896
+ f.value = {};
897
+ const g = b.shape;
898
+ for (const w of b.keys) {
899
+ const L = g[w]._zod.run({ value: d[w], issues: [] }, h);
900
+ L instanceof Promise ? y.push(L.then((De) => U(De, f, w, d))) : U(L, f, w, d);
896
901
  }
897
902
  }
898
- if (!f)
899
- return k.length ? Promise.all(k).then(() => a) : a;
900
- const Z = [], D = y.keySet, R = f._zod, w = R.def.type;
901
- for (const m of Object.keys(d)) {
902
- if (D.has(m))
903
+ if (!l)
904
+ return y.length ? Promise.all(y).then(() => f) : f;
905
+ const Z = [], D = b.keySet, R = l._zod, k = R.def.type;
906
+ for (const g of Object.keys(d)) {
907
+ if (D.has(g))
903
908
  continue;
904
- if (w === "never") {
905
- Z.push(m);
909
+ if (k === "never") {
910
+ Z.push(g);
906
911
  continue;
907
912
  }
908
- const v = R.run({ value: d[m], issues: [] }, p);
909
- v instanceof Promise ? k.push(v.then((T) => M(T, a, m))) : M(v, a, m);
913
+ const w = R.run({ value: d[g], issues: [] }, h);
914
+ w instanceof Promise ? y.push(w.then((ee) => U(ee, f, g, d))) : U(w, f, g, d);
910
915
  }
911
- return Z.length && a.issues.push({
916
+ return Z.length && f.issues.push({
912
917
  code: "unrecognized_keys",
913
918
  keys: Z,
914
919
  input: d,
915
920
  inst: e
916
- }), k.length ? Promise.all(k).then(() => a) : a;
921
+ }), y.length ? Promise.all(y).then(() => f) : f;
917
922
  };
918
923
  });
919
- function ie(e, n, t, r) {
920
- for (const o of e)
921
- if (o.issues.length === 0)
922
- return n.value = o.value, n;
923
- return n.issues.push({
924
+ function ue(e, n, t, r) {
925
+ for (const u of e)
926
+ if (u.issues.length === 0)
927
+ return n.value = u.value, n;
928
+ const o = e.filter((u) => !j(u));
929
+ return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
924
930
  code: "invalid_union",
925
931
  input: n.value,
926
932
  inst: t,
927
- errors: e.map((o) => o.issues.map((u) => I(u, r, P())))
928
- }), n;
929
- }
930
- const xn = /* @__PURE__ */ c("$ZodUnion", (e, n) => {
931
- _.init(e, n), h(e._zod, "optin", () => n.options.some((t) => t._zod.optin === "optional") ? "optional" : void 0), h(e._zod, "optout", () => n.options.some((t) => t._zod.optout === "optional") ? "optional" : void 0), h(e._zod, "values", () => {
932
- if (n.options.every((t) => t._zod.values))
933
- return new Set(n.options.flatMap((t) => Array.from(t._zod.values)));
934
- }), h(e._zod, "pattern", () => {
935
- if (n.options.every((t) => t._zod.pattern)) {
936
- const t = n.options.map((r) => r._zod.pattern);
937
- return new RegExp(`^(${t.map((r) => W(r.source)).join("|")})$`);
933
+ errors: e.map((u) => u.issues.map((s) => N(s, r, E())))
934
+ }), n);
935
+ }
936
+ const An = /* @__PURE__ */ c("$ZodUnion", (e, n) => {
937
+ _.init(e, n), p(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), p(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), p(e._zod, "values", () => {
938
+ if (n.options.every((o) => o._zod.values))
939
+ return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
940
+ }), p(e._zod, "pattern", () => {
941
+ if (n.options.every((o) => o._zod.pattern)) {
942
+ const o = n.options.map((u) => u._zod.pattern);
943
+ return new RegExp(`^(${o.map((u) => H(u.source)).join("|")})$`);
938
944
  }
939
- }), e._zod.parse = (t, r) => {
940
- let o = !1;
941
- const u = [];
942
- for (const i of n.options) {
943
- const s = i._zod.run({
944
- value: t.value,
945
+ });
946
+ const t = n.options.length === 1, r = n.options[0]._zod.run;
947
+ e._zod.parse = (o, u) => {
948
+ if (t)
949
+ return r(o, u);
950
+ let s = !1;
951
+ const i = [];
952
+ for (const a of n.options) {
953
+ const l = a._zod.run({
954
+ value: o.value,
945
955
  issues: []
946
- }, r);
947
- if (s instanceof Promise)
948
- u.push(s), o = !0;
956
+ }, u);
957
+ if (l instanceof Promise)
958
+ i.push(l), s = !0;
949
959
  else {
950
- if (s.issues.length === 0)
951
- return s;
952
- u.push(s);
960
+ if (l.issues.length === 0)
961
+ return l;
962
+ i.push(l);
953
963
  }
954
964
  }
955
- return o ? Promise.all(u).then((i) => ie(i, t, e, r)) : ie(u, t, e, r);
965
+ return s ? Promise.all(i).then((a) => ue(a, o, e, u)) : ue(i, o, e, u);
956
966
  };
957
- }), jn = /* @__PURE__ */ c("$ZodIntersection", (e, n) => {
967
+ }), Rn = /* @__PURE__ */ c("$ZodIntersection", (e, n) => {
958
968
  _.init(e, n), e._zod.parse = (t, r) => {
959
- const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), i = n.right._zod.run({ value: o, issues: [] }, r);
960
- return u instanceof Promise || i instanceof Promise ? Promise.all([u, i]).then(([l, f]) => se(t, l, f)) : se(t, u, i);
969
+ const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
970
+ return u instanceof Promise || s instanceof Promise ? Promise.all([u, s]).then(([a, l]) => se(t, a, l)) : se(t, u, s);
961
971
  };
962
972
  });
963
973
  function B(e, n) {
@@ -965,16 +975,16 @@ function B(e, n) {
965
975
  return { valid: !0, data: e };
966
976
  if (e instanceof Date && n instanceof Date && +e == +n)
967
977
  return { valid: !0, data: e };
968
- if (q(e) && q(n)) {
978
+ if (M(e) && M(n)) {
969
979
  const t = Object.keys(n), r = Object.keys(e).filter((u) => t.indexOf(u) !== -1), o = { ...e, ...n };
970
980
  for (const u of r) {
971
- const i = B(e[u], n[u]);
972
- if (!i.valid)
981
+ const s = B(e[u], n[u]);
982
+ if (!s.valid)
973
983
  return {
974
984
  valid: !1,
975
- mergeErrorPath: [u, ...i.mergeErrorPath]
985
+ mergeErrorPath: [u, ...s.mergeErrorPath]
976
986
  };
977
- o[u] = i.data;
987
+ o[u] = s.data;
978
988
  }
979
989
  return { valid: !0, data: o };
980
990
  }
@@ -983,13 +993,13 @@ function B(e, n) {
983
993
  return { valid: !1, mergeErrorPath: [] };
984
994
  const t = [];
985
995
  for (let r = 0; r < e.length; r++) {
986
- const o = e[r], u = n[r], i = B(o, u);
987
- if (!i.valid)
996
+ const o = e[r], u = n[r], s = B(o, u);
997
+ if (!s.valid)
988
998
  return {
989
999
  valid: !1,
990
- mergeErrorPath: [r, ...i.mergeErrorPath]
1000
+ mergeErrorPath: [r, ...s.mergeErrorPath]
991
1001
  };
992
- t.push(i.data);
1002
+ t.push(s.data);
993
1003
  }
994
1004
  return { valid: !0, data: t };
995
1005
  }
@@ -1003,39 +1013,49 @@ function se(e, n, t) {
1003
1013
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1004
1014
  return e.value = r.data, e;
1005
1015
  }
1006
- const Sn = /* @__PURE__ */ c("$ZodEnum", (e, n) => {
1016
+ const Cn = /* @__PURE__ */ c("$ZodEnum", (e, n) => {
1007
1017
  _.init(e, n);
1008
- const t = Je(n.entries);
1009
- e._zod.values = new Set(t), e._zod.pattern = new RegExp(`^(${t.filter((r) => en.has(typeof r)).map((r) => typeof r == "string" ? nn(r) : r.toString()).join("|")})$`), e._zod.parse = (r, o) => {
1010
- const u = r.value;
1011
- return e._zod.values.has(u) || r.issues.push({
1018
+ const t = Qe(n.entries), r = new Set(t);
1019
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => rn.has(typeof o)).map((o) => typeof o == "string" ? on(o) : o.toString()).join("|")})$`), e._zod.parse = (o, u) => {
1020
+ const s = o.value;
1021
+ return r.has(s) || o.issues.push({
1012
1022
  code: "invalid_value",
1013
1023
  values: t,
1014
- input: u,
1024
+ input: s,
1015
1025
  inst: e
1016
- }), r;
1026
+ }), o;
1017
1027
  };
1018
- }), An = /* @__PURE__ */ c("$ZodTransform", (e, n) => {
1028
+ }), Un = /* @__PURE__ */ c("$ZodTransform", (e, n) => {
1019
1029
  _.init(e, n), e._zod.parse = (t, r) => {
1020
1030
  const o = n.transform(t.value, t);
1021
1031
  if (r.async)
1022
- return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (t.value = i, t));
1032
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
1023
1033
  if (o instanceof Promise)
1024
1034
  throw new S();
1025
1035
  return t.value = o, t;
1026
1036
  };
1027
- }), Rn = /* @__PURE__ */ c("$ZodOptional", (e, n) => {
1028
- _.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), h(e._zod, "pattern", () => {
1037
+ });
1038
+ function ie(e, n) {
1039
+ return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
1040
+ }
1041
+ const Fn = /* @__PURE__ */ c("$ZodOptional", (e, n) => {
1042
+ _.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", p(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), p(e._zod, "pattern", () => {
1029
1043
  const t = n.innerType._zod.pattern;
1030
- return t ? new RegExp(`^(${W(t.source)})?$`) : void 0;
1031
- }), e._zod.parse = (t, r) => n.innerType._zod.optin === "optional" ? n.innerType._zod.run(t, r) : t.value === void 0 ? t : n.innerType._zod.run(t, r);
1032
- }), Cn = /* @__PURE__ */ c("$ZodNullable", (e, n) => {
1033
- _.init(e, n), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "pattern", () => {
1044
+ return t ? new RegExp(`^(${H(t.source)})?$`) : void 0;
1045
+ }), e._zod.parse = (t, r) => {
1046
+ if (n.innerType._zod.optin === "optional") {
1047
+ const o = n.innerType._zod.run(t, r);
1048
+ return o instanceof Promise ? o.then((u) => ie(u, t.value)) : ie(o, t.value);
1049
+ }
1050
+ return t.value === void 0 ? t : n.innerType._zod.run(t, r);
1051
+ };
1052
+ }), Mn = /* @__PURE__ */ c("$ZodNullable", (e, n) => {
1053
+ _.init(e, n), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), p(e._zod, "pattern", () => {
1034
1054
  const t = n.innerType._zod.pattern;
1035
- return t ? new RegExp(`^(${W(t.source)}|null)$`) : void 0;
1036
- }), h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1037
- }), Fn = /* @__PURE__ */ c("$ZodDefault", (e, n) => {
1038
- _.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1055
+ return t ? new RegExp(`^(${H(t.source)}|null)$`) : void 0;
1056
+ }), p(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1057
+ }), Vn = /* @__PURE__ */ c("$ZodDefault", (e, n) => {
1058
+ _.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1039
1059
  if (t.value === void 0)
1040
1060
  return t.value = n.defaultValue, t;
1041
1061
  const o = n.innerType._zod.run(t, r);
@@ -1045,10 +1065,10 @@ const Sn = /* @__PURE__ */ c("$ZodEnum", (e, n) => {
1045
1065
  function ce(e, n) {
1046
1066
  return e.value === void 0 && (e.value = n.defaultValue), e;
1047
1067
  }
1048
- const Mn = /* @__PURE__ */ c("$ZodPrefault", (e, n) => {
1049
- _.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1050
- }), Un = /* @__PURE__ */ c("$ZodNonOptional", (e, n) => {
1051
- _.init(e, n), h(e._zod, "values", () => {
1068
+ const Dn = /* @__PURE__ */ c("$ZodPrefault", (e, n) => {
1069
+ _.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1070
+ }), Ln = /* @__PURE__ */ c("$ZodNonOptional", (e, n) => {
1071
+ _.init(e, n), p(e._zod, "values", () => {
1052
1072
  const t = n.innerType._zod.values;
1053
1073
  return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
1054
1074
  }), e._zod.parse = (t, r) => {
@@ -1064,34 +1084,34 @@ function ae(e, n) {
1064
1084
  inst: n
1065
1085
  }), e;
1066
1086
  }
1067
- const Vn = /* @__PURE__ */ c("$ZodCatch", (e, n) => {
1068
- _.init(e, n), e._zod.optin = "optional", h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1087
+ const Gn = /* @__PURE__ */ c("$ZodCatch", (e, n) => {
1088
+ _.init(e, n), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1069
1089
  const o = n.innerType._zod.run(t, r);
1070
1090
  return o instanceof Promise ? o.then((u) => (t.value = u.value, u.issues.length && (t.value = n.catchValue({
1071
1091
  ...t,
1072
1092
  error: {
1073
- issues: u.issues.map((i) => I(i, r, P()))
1093
+ issues: u.issues.map((s) => N(s, r, E()))
1074
1094
  },
1075
1095
  input: t.value
1076
1096
  }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
1077
1097
  ...t,
1078
1098
  error: {
1079
- issues: o.issues.map((u) => I(u, r, P()))
1099
+ issues: o.issues.map((u) => N(u, r, E()))
1080
1100
  },
1081
1101
  input: t.value
1082
1102
  }), t.issues = []), t);
1083
1103
  };
1084
- }), Dn = /* @__PURE__ */ c("$ZodPipe", (e, n) => {
1085
- _.init(e, n), h(e._zod, "values", () => n.in._zod.values), h(e._zod, "optin", () => n.in._zod.optin), h(e._zod, "optout", () => n.out._zod.optout), h(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1104
+ }), Kn = /* @__PURE__ */ c("$ZodPipe", (e, n) => {
1105
+ _.init(e, n), p(e._zod, "values", () => n.in._zod.values), p(e._zod, "optin", () => n.in._zod.optin), p(e._zod, "optout", () => n.out._zod.optout), p(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1086
1106
  const o = n.in._zod.run(t, r);
1087
1107
  return o instanceof Promise ? o.then((u) => le(u, n, r)) : le(o, n, r);
1088
1108
  };
1089
1109
  });
1090
1110
  function le(e, n, t) {
1091
- return j(e) ? e : n.out._zod.run({ value: e.value, issues: e.issues }, t);
1111
+ return e.issues.length ? e : n.out._zod.run({ value: e.value, issues: e.issues }, t);
1092
1112
  }
1093
- const Ln = /* @__PURE__ */ c("$ZodReadonly", (e, n) => {
1094
- _.init(e, n), h(e._zod, "propValues", () => n.innerType._zod.propValues), h(e._zod, "values", () => n.innerType._zod.values), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1113
+ const Yn = /* @__PURE__ */ c("$ZodReadonly", (e, n) => {
1114
+ _.init(e, n), p(e._zod, "propValues", () => n.innerType._zod.propValues), p(e._zod, "values", () => n.innerType._zod.values), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1095
1115
  const o = n.innerType._zod.run(t, r);
1096
1116
  return o instanceof Promise ? o.then(fe) : fe(o);
1097
1117
  };
@@ -1099,7 +1119,7 @@ const Ln = /* @__PURE__ */ c("$ZodReadonly", (e, n) => {
1099
1119
  function fe(e) {
1100
1120
  return e.value = Object.freeze(e.value), e;
1101
1121
  }
1102
- const Gn = /* @__PURE__ */ c("$ZodCustom", (e, n) => {
1122
+ const qn = /* @__PURE__ */ c("$ZodCustom", (e, n) => {
1103
1123
  $.init(e, n), _.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1104
1124
  const r = t.value, o = n.fn(r);
1105
1125
  if (o instanceof Promise)
@@ -1122,7 +1142,7 @@ function pe(e, n, t, r) {
1122
1142
  r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(A(o));
1123
1143
  }
1124
1144
  }
1125
- class Kn {
1145
+ class Jn {
1126
1146
  constructor() {
1127
1147
  this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map();
1128
1148
  }
@@ -1146,7 +1166,9 @@ class Kn {
1146
1166
  const t = n._zod.parent;
1147
1167
  if (t) {
1148
1168
  const r = { ...this.get(t) ?? {} };
1149
- return delete r.id, { ...r, ...this._map.get(n) };
1169
+ delete r.id;
1170
+ const o = { ...r, ...this._map.get(n) };
1171
+ return Object.keys(o).length ? o : void 0;
1150
1172
  }
1151
1173
  return this._map.get(n);
1152
1174
  }
@@ -1154,137 +1176,159 @@ class Kn {
1154
1176
  return this._map.has(n);
1155
1177
  }
1156
1178
  }
1157
- function Yn() {
1158
- return new Kn();
1179
+ function Bn() {
1180
+ return new Jn();
1159
1181
  }
1160
- const U = /* @__PURE__ */ Yn();
1161
- function qn(e, n) {
1182
+ const F = /* @__PURE__ */ Bn();
1183
+ function Xn(e, n) {
1162
1184
  return new e({
1163
1185
  type: "number",
1164
1186
  checks: [],
1165
- ...g(n)
1187
+ ...m(n)
1166
1188
  });
1167
1189
  }
1168
- function Bn(e, n) {
1190
+ function Wn(e, n) {
1169
1191
  return new e({
1170
1192
  type: "number",
1171
1193
  check: "number_format",
1172
1194
  abort: !1,
1173
1195
  format: "safeint",
1174
- ...g(n)
1196
+ ...m(n)
1175
1197
  });
1176
1198
  }
1177
- function Xn(e) {
1199
+ function Hn(e) {
1178
1200
  return new e({
1179
1201
  type: "unknown"
1180
1202
  });
1181
1203
  }
1182
- function Jn(e, n) {
1204
+ function Qn(e, n) {
1183
1205
  return new e({
1184
1206
  type: "never",
1185
- ...g(n)
1207
+ ...m(n)
1186
1208
  });
1187
1209
  }
1188
1210
  function he(e, n) {
1189
- return new xe({
1211
+ return new Se({
1190
1212
  check: "less_than",
1191
- ...g(n),
1213
+ ...m(n),
1192
1214
  value: e,
1193
1215
  inclusive: !1
1194
1216
  });
1195
1217
  }
1196
- function G(e, n) {
1197
- return new xe({
1218
+ function K(e, n) {
1219
+ return new Se({
1198
1220
  check: "less_than",
1199
- ...g(n),
1221
+ ...m(n),
1200
1222
  value: e,
1201
1223
  inclusive: !0
1202
1224
  });
1203
1225
  }
1204
1226
  function de(e, n) {
1205
- return new je({
1227
+ return new Ae({
1206
1228
  check: "greater_than",
1207
- ...g(n),
1229
+ ...m(n),
1208
1230
  value: e,
1209
1231
  inclusive: !1
1210
1232
  });
1211
1233
  }
1212
- function K(e, n) {
1213
- return new je({
1234
+ function Y(e, n) {
1235
+ return new Ae({
1214
1236
  check: "greater_than",
1215
- ...g(n),
1237
+ ...m(n),
1216
1238
  value: e,
1217
1239
  inclusive: !0
1218
1240
  });
1219
1241
  }
1220
1242
  function me(e, n) {
1221
- return new zn({
1243
+ return new yn({
1222
1244
  check: "multiple_of",
1223
- ...g(n),
1245
+ ...m(n),
1224
1246
  value: e
1225
1247
  });
1226
1248
  }
1227
- function Wn(e, n) {
1228
- return new bn({
1249
+ function et(e, n) {
1250
+ return new $n({
1229
1251
  check: "max_length",
1230
- ...g(n),
1252
+ ...m(n),
1231
1253
  maximum: e
1232
1254
  });
1233
1255
  }
1234
1256
  function _e(e, n) {
1235
- return new yn({
1257
+ return new Zn({
1236
1258
  check: "min_length",
1237
- ...g(n),
1259
+ ...m(n),
1238
1260
  minimum: e
1239
1261
  });
1240
1262
  }
1241
- function Hn(e, n) {
1242
- return new kn({
1263
+ function nt(e, n) {
1264
+ return new Pn({
1243
1265
  check: "length_equals",
1244
- ...g(n),
1266
+ ...m(n),
1245
1267
  length: e
1246
1268
  });
1247
1269
  }
1248
- function Qn(e) {
1249
- return new $n({
1270
+ function tt(e) {
1271
+ return new En({
1250
1272
  check: "overwrite",
1251
1273
  tx: e
1252
1274
  });
1253
1275
  }
1254
- function et(e, n, t) {
1276
+ function rt(e, n, t) {
1255
1277
  return new e({
1256
1278
  type: "array",
1257
1279
  element: n,
1258
1280
  // get element() {
1259
1281
  // return element;
1260
1282
  // },
1261
- ...g(t)
1283
+ ...m(t)
1262
1284
  });
1263
1285
  }
1264
- function nt(e, n, t) {
1286
+ function ot(e, n, t) {
1265
1287
  return new e({
1266
1288
  type: "custom",
1267
1289
  check: "custom",
1268
1290
  fn: n,
1269
- ...g(t)
1291
+ ...m(t)
1270
1292
  });
1271
1293
  }
1272
- const tt = (e, n) => {
1273
- Pe.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1294
+ function ut(e) {
1295
+ const n = st((t) => (t.addIssue = (r) => {
1296
+ if (typeof r == "string")
1297
+ t.issues.push(A(r, t.value, n._zod.def));
1298
+ else {
1299
+ const o = r;
1300
+ o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(A(o));
1301
+ }
1302
+ }, e(t.value, t)));
1303
+ return n;
1304
+ }
1305
+ function st(e, n) {
1306
+ const t = new $({
1307
+ check: "custom",
1308
+ ...m(n)
1309
+ });
1310
+ return t._zod.check = e, t;
1311
+ }
1312
+ const it = (e, n) => {
1313
+ Oe.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1274
1314
  format: {
1275
- value: (t) => pn(e, t)
1315
+ value: (t) => mn(e, t)
1276
1316
  // enumerable: false,
1277
1317
  },
1278
1318
  flatten: {
1279
- value: (t) => fn(e, t)
1319
+ value: (t) => dn(e, t)
1280
1320
  // enumerable: false,
1281
1321
  },
1282
1322
  addIssue: {
1283
- value: (t) => e.issues.push(t)
1323
+ value: (t) => {
1324
+ e.issues.push(t), e.message = JSON.stringify(e.issues, q, 2);
1325
+ }
1284
1326
  // enumerable: false,
1285
1327
  },
1286
1328
  addIssues: {
1287
- value: (t) => e.issues.push(...t)
1329
+ value: (t) => {
1330
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, q, 2);
1331
+ }
1288
1332
  // enumerable: false,
1289
1333
  },
1290
1334
  isEmpty: {
@@ -1294,9 +1338,9 @@ const tt = (e, n) => {
1294
1338
  // enumerable: false,
1295
1339
  }
1296
1340
  });
1297
- }, V = c("ZodError", tt, {
1341
+ }, V = c("ZodError", it, {
1298
1342
  Parent: Error
1299
- }), rt = /* @__PURE__ */ hn(V), ot = /* @__PURE__ */ dn(V), ut = /* @__PURE__ */ Ne(V), it = /* @__PURE__ */ Te(V), z = /* @__PURE__ */ c("ZodType", (e, n) => (_.init(e, n), e.def = n, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(
1343
+ }), ct = /* @__PURE__ */ _n(V), at = /* @__PURE__ */ gn(V), lt = /* @__PURE__ */ Ie(V), ft = /* @__PURE__ */ xe(V), v = /* @__PURE__ */ c("ZodType", (e, n) => (_.init(e, n), e.def = n, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(
1300
1344
  {
1301
1345
  ...n,
1302
1346
  checks: [
@@ -1305,273 +1349,258 @@ const tt = (e, n) => {
1305
1349
  ]
1306
1350
  }
1307
1351
  // { parent: true }
1308
- ), e.clone = (t, r) => N(e, t, r), e.brand = () => e, e.register = (t, r) => (t.add(e, r), e), e.parse = (t, r) => rt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => ut(e, t, r), e.parseAsync = async (t, r) => ot(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => it(e, t, r), e.spa = e.safeParseAsync, e.refine = (t, r) => e.check(jt(t, r)), e.superRefine = (t) => e.check(St(t)), e.overwrite = (t) => e.check(Qn(t)), e.optional = () => ze(e), e.nullable = () => we(e), e.nullish = () => ze(we(e)), e.nonoptional = (t) => Zt(e, t), e.array = () => Re(e), e.or = (t) => dt([e, t]), e.and = (t) => _t(e, t), e.transform = (t) => be(e, zt(t)), e.default = (t) => yt(e, t), e.prefault = (t) => $t(e, t), e.catch = (t) => Pt(e, t), e.pipe = (t) => be(e, t), e.readonly = () => Tt(e), e.describe = (t) => {
1352
+ ), e.clone = (t, r) => T(e, t, r), e.brand = () => e, e.register = (t, r) => (t.add(e, r), e), e.parse = (t, r) => ct(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => lt(e, t, r), e.parseAsync = async (t, r) => at(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => ft(e, t, r), e.spa = e.safeParseAsync, e.refine = (t, r) => e.check(Ct(t, r)), e.superRefine = (t) => e.check(Ut(t)), e.overwrite = (t) => e.check(tt(t)), e.optional = () => ze(e), e.nullable = () => be(e), e.nullish = () => ze(be(e)), e.nonoptional = (t) => Tt(e, t), e.array = () => Ue(e), e.or = (t) => zt([e, t]), e.and = (t) => wt(e, t), e.transform = (t) => we(e, $t(t)), e.default = (t) => Et(e, t), e.prefault = (t) => Ot(e, t), e.catch = (t) => xt(e, t), e.pipe = (t) => we(e, t), e.readonly = () => At(e), e.describe = (t) => {
1309
1353
  const r = e.clone();
1310
- return U.add(r, { description: t }), r;
1354
+ return F.add(r, { description: t }), r;
1311
1355
  }, Object.defineProperty(e, "description", {
1312
1356
  get() {
1313
- return U.get(e)?.description;
1357
+ return F.get(e)?.description;
1314
1358
  },
1315
1359
  configurable: !0
1316
1360
  }), e.meta = (...t) => {
1317
1361
  if (t.length === 0)
1318
- return U.get(e);
1362
+ return F.get(e);
1319
1363
  const r = e.clone();
1320
- return U.add(r, t[0]), r;
1321
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ae = /* @__PURE__ */ c("ZodNumber", (e, n) => {
1322
- Se.init(e, n), z.init(e, n), e.gt = (r, o) => e.check(de(r, o)), e.gte = (r, o) => e.check(K(r, o)), e.min = (r, o) => e.check(K(r, o)), e.lt = (r, o) => e.check(he(r, o)), e.lte = (r, o) => e.check(G(r, o)), e.max = (r, o) => e.check(G(r, o)), e.int = (r) => e.check(ve(r)), e.safe = (r) => e.check(ve(r)), e.positive = (r) => e.check(de(0, r)), e.nonnegative = (r) => e.check(K(0, r)), e.negative = (r) => e.check(he(0, r)), e.nonpositive = (r) => e.check(G(0, r)), e.multipleOf = (r, o) => e.check(me(r, o)), e.step = (r, o) => e.check(me(r, o)), e.finite = () => e;
1364
+ return F.add(r, t[0]), r;
1365
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ce = /* @__PURE__ */ c("ZodNumber", (e, n) => {
1366
+ Re.init(e, n), v.init(e, n), e.gt = (r, o) => e.check(de(r, o)), e.gte = (r, o) => e.check(Y(r, o)), e.min = (r, o) => e.check(Y(r, o)), e.lt = (r, o) => e.check(he(r, o)), e.lte = (r, o) => e.check(K(r, o)), e.max = (r, o) => e.check(K(r, o)), e.int = (r) => e.check(ge(r)), e.safe = (r) => e.check(ge(r)), e.positive = (r) => e.check(de(0, r)), e.nonnegative = (r) => e.check(Y(0, r)), e.negative = (r) => e.check(he(0, r)), e.nonpositive = (r) => e.check(K(0, r)), e.multipleOf = (r, o) => e.check(me(r, o)), e.step = (r, o) => e.check(me(r, o)), e.finite = () => e;
1323
1367
  const t = e._zod.bag;
1324
1368
  e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
1325
1369
  });
1326
- function E(e) {
1327
- return qn(Ae, e);
1370
+ function P(e) {
1371
+ return Xn(Ce, e);
1328
1372
  }
1329
- const st = /* @__PURE__ */ c("ZodNumberFormat", (e, n) => {
1330
- Pn.init(e, n), Ae.init(e, n);
1373
+ const pt = /* @__PURE__ */ c("ZodNumberFormat", (e, n) => {
1374
+ Tn.init(e, n), Ce.init(e, n);
1331
1375
  });
1332
- function ve(e) {
1333
- return Bn(st, e);
1376
+ function ge(e) {
1377
+ return Wn(pt, e);
1334
1378
  }
1335
- const ct = /* @__PURE__ */ c("ZodUnknown", (e, n) => {
1336
- In.init(e, n), z.init(e, n);
1379
+ const ht = /* @__PURE__ */ c("ZodUnknown", (e, n) => {
1380
+ In.init(e, n), v.init(e, n);
1337
1381
  });
1338
- function ge() {
1339
- return Xn(ct);
1382
+ function ve() {
1383
+ return Hn(ht);
1340
1384
  }
1341
- const at = /* @__PURE__ */ c("ZodNever", (e, n) => {
1342
- Nn.init(e, n), z.init(e, n);
1385
+ const dt = /* @__PURE__ */ c("ZodNever", (e, n) => {
1386
+ xn.init(e, n), v.init(e, n);
1343
1387
  });
1344
- function lt(e) {
1345
- return Jn(at, e);
1388
+ function mt(e) {
1389
+ return Qn(dt, e);
1346
1390
  }
1347
- const ft = /* @__PURE__ */ c("ZodArray", (e, n) => {
1348
- Tn.init(e, n), z.init(e, n), e.element = n.element, e.min = (t, r) => e.check(_e(t, r)), e.nonempty = (t) => e.check(_e(1, t)), e.max = (t, r) => e.check(Wn(t, r)), e.length = (t, r) => e.check(Hn(t, r)), e.unwrap = () => e.element;
1391
+ const _t = /* @__PURE__ */ c("ZodArray", (e, n) => {
1392
+ jn.init(e, n), v.init(e, n), e.element = n.element, e.min = (t, r) => e.check(_e(t, r)), e.nonempty = (t) => e.check(_e(1, t)), e.max = (t, r) => e.check(et(t, r)), e.length = (t, r) => e.check(nt(t, r)), e.unwrap = () => e.element;
1349
1393
  });
1350
- function Re(e, n) {
1351
- return et(ft, e, n);
1394
+ function Ue(e, n) {
1395
+ return rt(_t, e, n);
1352
1396
  }
1353
- const pt = /* @__PURE__ */ c("ZodObject", (e, n) => {
1354
- On.init(e, n), z.init(e, n), h(e, "shape", () => n.shape), e.keyof = () => vt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ge() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ge() }), e.strict = () => e.clone({ ...e._zod.def, catchall: lt() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => sn(e, t), e.merge = (t) => cn(e, t), e.pick = (t) => on(e, t), e.omit = (t) => un(e, t), e.partial = (...t) => an(Fe, e, t[0]), e.required = (...t) => ln(Me, e, t[0]);
1397
+ const gt = /* @__PURE__ */ c("ZodObject", (e, n) => {
1398
+ Sn.init(e, n), v.init(e, n), p(e, "shape", () => n.shape), e.keyof = () => yt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ve() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ve() }), e.strict = () => e.clone({ ...e._zod.def, catchall: mt() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => ln(e, t), e.merge = (t) => fn(e, t), e.pick = (t) => cn(e, t), e.omit = (t) => an(e, t), e.partial = (...t) => pn(Me, e, t[0]), e.required = (...t) => hn(Ve, e, t[0]);
1355
1399
  });
1356
- function Ce(e, n) {
1400
+ function Fe(e, n) {
1357
1401
  const t = {
1358
1402
  type: "object",
1359
1403
  get shape() {
1360
- return H(this, "shape", { ...e }), this.shape;
1404
+ return O(this, "shape", e ? nn(e) : {}), this.shape;
1361
1405
  },
1362
- ...g(n)
1406
+ ...m(n)
1363
1407
  };
1364
- return new pt(t);
1408
+ return new gt(t);
1365
1409
  }
1366
- const ht = /* @__PURE__ */ c("ZodUnion", (e, n) => {
1367
- xn.init(e, n), z.init(e, n), e.options = n.options;
1410
+ const vt = /* @__PURE__ */ c("ZodUnion", (e, n) => {
1411
+ An.init(e, n), v.init(e, n), e.options = n.options;
1368
1412
  });
1369
- function dt(e, n) {
1370
- return new ht({
1413
+ function zt(e, n) {
1414
+ return new vt({
1371
1415
  type: "union",
1372
1416
  options: e,
1373
- ...g(n)
1417
+ ...m(n)
1374
1418
  });
1375
1419
  }
1376
- const mt = /* @__PURE__ */ c("ZodIntersection", (e, n) => {
1377
- jn.init(e, n), z.init(e, n);
1420
+ const bt = /* @__PURE__ */ c("ZodIntersection", (e, n) => {
1421
+ Rn.init(e, n), v.init(e, n);
1378
1422
  });
1379
- function _t(e, n) {
1380
- return new mt({
1423
+ function wt(e, n) {
1424
+ return new bt({
1381
1425
  type: "intersection",
1382
1426
  left: e,
1383
1427
  right: n
1384
1428
  });
1385
1429
  }
1386
1430
  const X = /* @__PURE__ */ c("ZodEnum", (e, n) => {
1387
- Sn.init(e, n), z.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
1431
+ Cn.init(e, n), v.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
1388
1432
  const t = new Set(Object.keys(n.entries));
1389
1433
  e.extract = (r, o) => {
1390
1434
  const u = {};
1391
- for (const i of r)
1392
- if (t.has(i))
1393
- u[i] = n.entries[i];
1435
+ for (const s of r)
1436
+ if (t.has(s))
1437
+ u[s] = n.entries[s];
1394
1438
  else
1395
- throw new Error(`Key ${i} not found in enum`);
1439
+ throw new Error(`Key ${s} not found in enum`);
1396
1440
  return new X({
1397
1441
  ...n,
1398
1442
  checks: [],
1399
- ...g(o),
1443
+ ...m(o),
1400
1444
  entries: u
1401
1445
  });
1402
1446
  }, e.exclude = (r, o) => {
1403
1447
  const u = { ...n.entries };
1404
- for (const i of r)
1405
- if (t.has(i))
1406
- delete u[i];
1448
+ for (const s of r)
1449
+ if (t.has(s))
1450
+ delete u[s];
1407
1451
  else
1408
- throw new Error(`Key ${i} not found in enum`);
1452
+ throw new Error(`Key ${s} not found in enum`);
1409
1453
  return new X({
1410
1454
  ...n,
1411
1455
  checks: [],
1412
- ...g(o),
1456
+ ...m(o),
1413
1457
  entries: u
1414
1458
  });
1415
1459
  };
1416
1460
  });
1417
- function vt(e, n) {
1461
+ function yt(e, n) {
1418
1462
  const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
1419
1463
  return new X({
1420
1464
  type: "enum",
1421
1465
  entries: t,
1422
- ...g(n)
1466
+ ...m(n)
1423
1467
  });
1424
1468
  }
1425
- const gt = /* @__PURE__ */ c("ZodTransform", (e, n) => {
1426
- An.init(e, n), z.init(e, n), e._zod.parse = (t, r) => {
1469
+ const kt = /* @__PURE__ */ c("ZodTransform", (e, n) => {
1470
+ Un.init(e, n), v.init(e, n), e._zod.parse = (t, r) => {
1427
1471
  t.addIssue = (u) => {
1428
1472
  if (typeof u == "string")
1429
1473
  t.issues.push(A(u, t.value, n));
1430
1474
  else {
1431
- const i = u;
1432
- i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = t.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !0), t.issues.push(A(i));
1475
+ const s = u;
1476
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(A(s));
1433
1477
  }
1434
1478
  };
1435
1479
  const o = n.transform(t.value, t);
1436
1480
  return o instanceof Promise ? o.then((u) => (t.value = u, t)) : (t.value = o, t);
1437
1481
  };
1438
1482
  });
1439
- function zt(e) {
1440
- return new gt({
1483
+ function $t(e) {
1484
+ return new kt({
1441
1485
  type: "transform",
1442
1486
  transform: e
1443
1487
  });
1444
1488
  }
1445
- const Fe = /* @__PURE__ */ c("ZodOptional", (e, n) => {
1446
- Rn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
1489
+ const Me = /* @__PURE__ */ c("ZodOptional", (e, n) => {
1490
+ Fn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1447
1491
  });
1448
1492
  function ze(e) {
1449
- return new Fe({
1493
+ return new Me({
1450
1494
  type: "optional",
1451
1495
  innerType: e
1452
1496
  });
1453
1497
  }
1454
- const wt = /* @__PURE__ */ c("ZodNullable", (e, n) => {
1455
- Cn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
1498
+ const Zt = /* @__PURE__ */ c("ZodNullable", (e, n) => {
1499
+ Mn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1456
1500
  });
1457
- function we(e) {
1458
- return new wt({
1501
+ function be(e) {
1502
+ return new Zt({
1459
1503
  type: "nullable",
1460
1504
  innerType: e
1461
1505
  });
1462
1506
  }
1463
- const bt = /* @__PURE__ */ c("ZodDefault", (e, n) => {
1464
- Fn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1507
+ const Pt = /* @__PURE__ */ c("ZodDefault", (e, n) => {
1508
+ Vn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1465
1509
  });
1466
- function yt(e, n) {
1467
- return new bt({
1510
+ function Et(e, n) {
1511
+ return new Pt({
1468
1512
  type: "default",
1469
1513
  innerType: e,
1470
1514
  get defaultValue() {
1471
- return typeof n == "function" ? n() : n;
1515
+ return typeof n == "function" ? n() : Pe(n);
1472
1516
  }
1473
1517
  });
1474
1518
  }
1475
- const kt = /* @__PURE__ */ c("ZodPrefault", (e, n) => {
1476
- Mn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
1519
+ const Nt = /* @__PURE__ */ c("ZodPrefault", (e, n) => {
1520
+ Dn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1477
1521
  });
1478
- function $t(e, n) {
1479
- return new kt({
1522
+ function Ot(e, n) {
1523
+ return new Nt({
1480
1524
  type: "prefault",
1481
1525
  innerType: e,
1482
1526
  get defaultValue() {
1483
- return typeof n == "function" ? n() : n;
1527
+ return typeof n == "function" ? n() : Pe(n);
1484
1528
  }
1485
1529
  });
1486
1530
  }
1487
- const Me = /* @__PURE__ */ c("ZodNonOptional", (e, n) => {
1488
- Un.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType;
1531
+ const Ve = /* @__PURE__ */ c("ZodNonOptional", (e, n) => {
1532
+ Ln.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1489
1533
  });
1490
- function Zt(e, n) {
1491
- return new Me({
1534
+ function Tt(e, n) {
1535
+ return new Ve({
1492
1536
  type: "nonoptional",
1493
1537
  innerType: e,
1494
- ...g(n)
1538
+ ...m(n)
1495
1539
  });
1496
1540
  }
1497
- const Et = /* @__PURE__ */ c("ZodCatch", (e, n) => {
1498
- Vn.init(e, n), z.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1541
+ const It = /* @__PURE__ */ c("ZodCatch", (e, n) => {
1542
+ Gn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1499
1543
  });
1500
- function Pt(e, n) {
1501
- return new Et({
1544
+ function xt(e, n) {
1545
+ return new It({
1502
1546
  type: "catch",
1503
1547
  innerType: e,
1504
1548
  catchValue: typeof n == "function" ? n : () => n
1505
1549
  });
1506
1550
  }
1507
- const It = /* @__PURE__ */ c("ZodPipe", (e, n) => {
1508
- Dn.init(e, n), z.init(e, n), e.in = n.in, e.out = n.out;
1551
+ const jt = /* @__PURE__ */ c("ZodPipe", (e, n) => {
1552
+ Kn.init(e, n), v.init(e, n), e.in = n.in, e.out = n.out;
1509
1553
  });
1510
- function be(e, n) {
1511
- return new It({
1554
+ function we(e, n) {
1555
+ return new jt({
1512
1556
  type: "pipe",
1513
1557
  in: e,
1514
1558
  out: n
1515
1559
  // ...util.normalizeParams(params),
1516
1560
  });
1517
1561
  }
1518
- const Nt = /* @__PURE__ */ c("ZodReadonly", (e, n) => {
1519
- Ln.init(e, n), z.init(e, n);
1562
+ const St = /* @__PURE__ */ c("ZodReadonly", (e, n) => {
1563
+ Yn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
1520
1564
  });
1521
- function Tt(e) {
1522
- return new Nt({
1565
+ function At(e) {
1566
+ return new St({
1523
1567
  type: "readonly",
1524
1568
  innerType: e
1525
1569
  });
1526
1570
  }
1527
- const Ot = /* @__PURE__ */ c("ZodCustom", (e, n) => {
1528
- Gn.init(e, n), z.init(e, n);
1571
+ const Rt = /* @__PURE__ */ c("ZodCustom", (e, n) => {
1572
+ qn.init(e, n), v.init(e, n);
1529
1573
  });
1530
- function xt(e) {
1531
- const n = new $({
1532
- check: "custom"
1533
- // ...util.normalizeParams(params),
1534
- });
1535
- return n._zod.check = e, n;
1536
- }
1537
- function jt(e, n = {}) {
1538
- return nt(Ot, e, n);
1539
- }
1540
- function St(e) {
1541
- const n = xt((t) => (t.addIssue = (r) => {
1542
- if (typeof r == "string")
1543
- t.issues.push(A(r, t.value, n._zod.def));
1544
- else {
1545
- const o = r;
1546
- o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(A(o));
1547
- }
1548
- }, e(t.value, t)));
1549
- return n;
1550
- }
1551
- const Gt = (e) => Ce({
1552
- pages: E(),
1553
- nextPage: E().optional(),
1554
- totalElements: E(),
1555
- currentPage: E(),
1556
- pageSize: E(),
1557
- elements: Re(e)
1558
- }), Kt = Ce({
1559
- page: E(),
1560
- pageSize: E()
1574
+ function Ct(e, n = {}) {
1575
+ return ot(Rt, e, n);
1576
+ }
1577
+ function Ut(e) {
1578
+ return ut(e);
1579
+ }
1580
+ const Jt = (e) => Fe({
1581
+ pages: P(),
1582
+ nextPage: P().optional(),
1583
+ totalElements: P(),
1584
+ currentPage: P(),
1585
+ pageSize: P(),
1586
+ elements: Ue(e)
1587
+ }), Bt = Fe({
1588
+ page: P(),
1589
+ pageSize: P()
1561
1590
  });
1562
1591
  export {
1563
- Ct as Fail,
1564
- Ft as Failure,
1592
+ Vt as Fail,
1593
+ Dt as Failure,
1565
1594
  x as Guid,
1566
- Rt as Ok,
1567
- Kt as PageQuery,
1568
- Gt as createPageSchema,
1569
- Ue as formatDate,
1570
- Lt as formatDateTime,
1571
- Ve as formatTime,
1572
- Ut as isFailure,
1573
- At as mock,
1574
- Mt as notFailure,
1575
- Vt as parseConfig,
1576
- Dt as sleep
1595
+ Mt as Ok,
1596
+ Bt as PageQuery,
1597
+ Jt as createPageSchema,
1598
+ Le as formatDate,
1599
+ qt as formatDateTime,
1600
+ Ge as formatTime,
1601
+ Gt as isFailure,
1602
+ Ft as mock,
1603
+ Lt as notFailure,
1604
+ Kt as parseConfig,
1605
+ Yt as sleep
1577
1606
  };