@jsfsi-core/ts-crossplatform 1.1.9 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +343 -310
- package/dist/src/datetime/datetime.d.ts +11 -0
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -41,11 +41,43 @@ function Ye(e, n) {
|
|
|
41
41
|
function dr(e, n) {
|
|
42
42
|
return `${Ke(e, n)} ${Ye(e, n)}`;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
function hr({
|
|
45
|
+
allDay: e,
|
|
46
|
+
startDate: n,
|
|
47
|
+
startTime: t,
|
|
48
|
+
endTime: r
|
|
49
|
+
}) {
|
|
50
|
+
const o = {
|
|
51
|
+
startDate: new Date(new Date(n).setHours(0, 0, 0, 0)),
|
|
52
|
+
endDate: new Date(new Date(n).setHours(23, 59, 59, 999))
|
|
53
|
+
};
|
|
54
|
+
if (e)
|
|
55
|
+
return o;
|
|
56
|
+
if (t) {
|
|
57
|
+
const u = new Date(n);
|
|
58
|
+
u.setHours(
|
|
59
|
+
t.getHours(),
|
|
60
|
+
t.getMinutes(),
|
|
61
|
+
t.getSeconds(),
|
|
62
|
+
t.getMilliseconds()
|
|
63
|
+
), o.startDate = u;
|
|
64
|
+
}
|
|
65
|
+
if (r) {
|
|
66
|
+
const u = new Date(n);
|
|
67
|
+
u.setHours(
|
|
68
|
+
r.getHours(),
|
|
69
|
+
r.getMinutes(),
|
|
70
|
+
r.getSeconds(),
|
|
71
|
+
r.getMilliseconds()
|
|
72
|
+
), o.endDate = u;
|
|
73
|
+
}
|
|
74
|
+
return o;
|
|
75
|
+
}
|
|
76
|
+
const He = "00000000-0000-0000-0000-000000000000", qe = /^(?:[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
77
|
function Ee(e) {
|
|
46
|
-
return typeof e == "string" &&
|
|
78
|
+
return typeof e == "string" && qe.test(e);
|
|
47
79
|
}
|
|
48
|
-
function
|
|
80
|
+
function Be(e) {
|
|
49
81
|
if (!Ee(e))
|
|
50
82
|
throw TypeError("Invalid UUID");
|
|
51
83
|
let n;
|
|
@@ -54,18 +86,18 @@ function Xe(e) {
|
|
|
54
86
|
const v = [];
|
|
55
87
|
for (let e = 0; e < 256; ++e)
|
|
56
88
|
v.push((e + 256).toString(16).slice(1));
|
|
57
|
-
function
|
|
89
|
+
function Xe(e, n = 0) {
|
|
58
90
|
return (v[e[n + 0]] + v[e[n + 1]] + v[e[n + 2]] + v[e[n + 3]] + "-" + v[e[n + 4]] + v[e[n + 5]] + "-" + v[e[n + 6]] + v[e[n + 7]] + "-" + v[e[n + 8]] + v[e[n + 9]] + "-" + v[e[n + 10]] + v[e[n + 11]] + v[e[n + 12]] + v[e[n + 13]] + v[e[n + 14]] + v[e[n + 15]]).toLowerCase();
|
|
59
91
|
}
|
|
60
92
|
let J;
|
|
61
|
-
const
|
|
93
|
+
const We = new Uint8Array(16);
|
|
62
94
|
function Qe() {
|
|
63
95
|
if (!J) {
|
|
64
96
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
65
97
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
66
98
|
J = crypto.getRandomValues.bind(crypto);
|
|
67
99
|
}
|
|
68
|
-
return J(
|
|
100
|
+
return J(We);
|
|
69
101
|
}
|
|
70
102
|
const en = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: en };
|
|
71
103
|
function nn(e, n, t) {
|
|
@@ -73,7 +105,7 @@ function nn(e, n, t) {
|
|
|
73
105
|
const r = e.random ?? e.rng?.() ?? Qe();
|
|
74
106
|
if (r.length < 16)
|
|
75
107
|
throw new Error("Random bytes length must be >= 16");
|
|
76
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
108
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Xe(r);
|
|
77
109
|
}
|
|
78
110
|
function tn(e, n, t) {
|
|
79
111
|
return oe.randomUUID && !e ? oe.randomUUID() : nn(e);
|
|
@@ -81,7 +113,7 @@ function tn(e, n, t) {
|
|
|
81
113
|
class S {
|
|
82
114
|
uuid;
|
|
83
115
|
constructor(n) {
|
|
84
|
-
|
|
116
|
+
Be(n), this.uuid = n;
|
|
85
117
|
}
|
|
86
118
|
toString() {
|
|
87
119
|
return this.uuid;
|
|
@@ -93,7 +125,7 @@ class S {
|
|
|
93
125
|
return new S(tn());
|
|
94
126
|
}
|
|
95
127
|
static empty() {
|
|
96
|
-
return new S(
|
|
128
|
+
return new S(He);
|
|
97
129
|
}
|
|
98
130
|
static isValid(n) {
|
|
99
131
|
return !!(n && Ee(n));
|
|
@@ -109,25 +141,25 @@ function a(e, n, t) {
|
|
|
109
141
|
value: i._zod ?? {},
|
|
110
142
|
enumerable: !1
|
|
111
143
|
}), (l = i._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), i._zod.traits.add(e), n(i, c);
|
|
112
|
-
for (const f in
|
|
113
|
-
f in i || Object.defineProperty(i, f, { value:
|
|
114
|
-
i._zod.constr =
|
|
144
|
+
for (const f in s.prototype)
|
|
145
|
+
f in i || Object.defineProperty(i, f, { value: s.prototype[f].bind(i) });
|
|
146
|
+
i._zod.constr = s, i._zod.def = c;
|
|
115
147
|
}
|
|
116
148
|
const o = t?.Parent ?? Object;
|
|
117
|
-
class
|
|
149
|
+
class u extends o {
|
|
118
150
|
}
|
|
119
|
-
Object.defineProperty(
|
|
120
|
-
function
|
|
151
|
+
Object.defineProperty(u, "name", { value: e });
|
|
152
|
+
function s(i) {
|
|
121
153
|
var c;
|
|
122
|
-
const l = t?.Parent ? new
|
|
154
|
+
const l = t?.Parent ? new u() : this;
|
|
123
155
|
r(l, i), (c = l._zod).deferred ?? (c.deferred = []);
|
|
124
156
|
for (const f of l._zod.deferred)
|
|
125
157
|
f();
|
|
126
158
|
return l;
|
|
127
159
|
}
|
|
128
|
-
return Object.defineProperty(
|
|
160
|
+
return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
|
|
129
161
|
value: (i) => t?.Parent && i instanceof t.Parent ? !0 : i?._zod?.traits?.has(e)
|
|
130
|
-
}), Object.defineProperty(
|
|
162
|
+
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
131
163
|
}
|
|
132
164
|
class j extends Error {
|
|
133
165
|
constructor() {
|
|
@@ -147,10 +179,10 @@ function rn(e) {
|
|
|
147
179
|
const n = Object.values(e).filter((r) => typeof r == "number");
|
|
148
180
|
return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
|
|
149
181
|
}
|
|
150
|
-
function
|
|
182
|
+
function H(e, n) {
|
|
151
183
|
return typeof n == "bigint" ? n.toString() : n;
|
|
152
184
|
}
|
|
153
|
-
function
|
|
185
|
+
function X(e) {
|
|
154
186
|
return {
|
|
155
187
|
get value() {
|
|
156
188
|
{
|
|
@@ -160,7 +192,7 @@ function W(e) {
|
|
|
160
192
|
}
|
|
161
193
|
};
|
|
162
194
|
}
|
|
163
|
-
function
|
|
195
|
+
function W(e) {
|
|
164
196
|
return e == null;
|
|
165
197
|
}
|
|
166
198
|
function Q(e) {
|
|
@@ -174,8 +206,8 @@ function on(e, n) {
|
|
|
174
206
|
const c = r.match(/\d?e-(\d?)/);
|
|
175
207
|
c?.[1] && (o = Number.parseInt(c[1]));
|
|
176
208
|
}
|
|
177
|
-
const
|
|
178
|
-
return
|
|
209
|
+
const u = t > o ? t : o, s = Number.parseInt(e.toFixed(u).replace(".", "")), i = Number.parseInt(n.toFixed(u).replace(".", ""));
|
|
210
|
+
return s % i / 10 ** u;
|
|
179
211
|
}
|
|
180
212
|
const ue = Symbol("evaluating");
|
|
181
213
|
function d(e, n, t) {
|
|
@@ -194,7 +226,7 @@ function d(e, n, t) {
|
|
|
194
226
|
configurable: !0
|
|
195
227
|
});
|
|
196
228
|
}
|
|
197
|
-
function
|
|
229
|
+
function I(e, n, t) {
|
|
198
230
|
Object.defineProperty(e, n, {
|
|
199
231
|
value: t,
|
|
200
232
|
writable: !0,
|
|
@@ -202,7 +234,7 @@ function T(e, n, t) {
|
|
|
202
234
|
configurable: !0
|
|
203
235
|
});
|
|
204
236
|
}
|
|
205
|
-
function
|
|
237
|
+
function T(...e) {
|
|
206
238
|
const n = {};
|
|
207
239
|
for (const t of e) {
|
|
208
240
|
const r = Object.getOwnPropertyDescriptors(t);
|
|
@@ -215,10 +247,10 @@ function se(e) {
|
|
|
215
247
|
}
|
|
216
248
|
const Pe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
217
249
|
};
|
|
218
|
-
function
|
|
250
|
+
function U(e) {
|
|
219
251
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
220
252
|
}
|
|
221
|
-
const un =
|
|
253
|
+
const un = X(() => {
|
|
222
254
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
223
255
|
return !1;
|
|
224
256
|
try {
|
|
@@ -229,13 +261,13 @@ const un = W(() => {
|
|
|
229
261
|
}
|
|
230
262
|
});
|
|
231
263
|
function x(e) {
|
|
232
|
-
if (
|
|
264
|
+
if (U(e) === !1)
|
|
233
265
|
return !1;
|
|
234
266
|
const n = e.constructor;
|
|
235
267
|
if (n === void 0)
|
|
236
268
|
return !0;
|
|
237
269
|
const t = n.prototype;
|
|
238
|
-
return !(
|
|
270
|
+
return !(U(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
239
271
|
}
|
|
240
272
|
function Oe(e) {
|
|
241
273
|
return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
@@ -272,30 +304,30 @@ const ln = {
|
|
|
272
304
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
273
305
|
};
|
|
274
306
|
function fn(e, n) {
|
|
275
|
-
const t = e._zod.def, r =
|
|
307
|
+
const t = e._zod.def, r = T(e._zod.def, {
|
|
276
308
|
get shape() {
|
|
277
309
|
const o = {};
|
|
278
|
-
for (const
|
|
279
|
-
if (!(
|
|
280
|
-
throw new Error(`Unrecognized key: "${
|
|
281
|
-
n[
|
|
310
|
+
for (const u in n) {
|
|
311
|
+
if (!(u in t.shape))
|
|
312
|
+
throw new Error(`Unrecognized key: "${u}"`);
|
|
313
|
+
n[u] && (o[u] = t.shape[u]);
|
|
282
314
|
}
|
|
283
|
-
return
|
|
315
|
+
return I(this, "shape", o), o;
|
|
284
316
|
},
|
|
285
317
|
checks: []
|
|
286
318
|
});
|
|
287
319
|
return $(e, r);
|
|
288
320
|
}
|
|
289
321
|
function dn(e, n) {
|
|
290
|
-
const t = e._zod.def, r =
|
|
322
|
+
const t = e._zod.def, r = T(e._zod.def, {
|
|
291
323
|
get shape() {
|
|
292
324
|
const o = { ...e._zod.def.shape };
|
|
293
|
-
for (const
|
|
294
|
-
if (!(
|
|
295
|
-
throw new Error(`Unrecognized key: "${
|
|
296
|
-
n[
|
|
325
|
+
for (const u in n) {
|
|
326
|
+
if (!(u in t.shape))
|
|
327
|
+
throw new Error(`Unrecognized key: "${u}"`);
|
|
328
|
+
n[u] && delete o[u];
|
|
297
329
|
}
|
|
298
|
-
return
|
|
330
|
+
return I(this, "shape", o), o;
|
|
299
331
|
},
|
|
300
332
|
checks: []
|
|
301
333
|
});
|
|
@@ -307,10 +339,10 @@ function hn(e, n) {
|
|
|
307
339
|
const t = e._zod.def.checks;
|
|
308
340
|
if (t && t.length > 0)
|
|
309
341
|
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
310
|
-
const o =
|
|
342
|
+
const o = T(e._zod.def, {
|
|
311
343
|
get shape() {
|
|
312
|
-
const
|
|
313
|
-
return
|
|
344
|
+
const u = { ...e._zod.def.shape, ...n };
|
|
345
|
+
return I(this, "shape", u), u;
|
|
314
346
|
},
|
|
315
347
|
checks: []
|
|
316
348
|
});
|
|
@@ -323,17 +355,17 @@ function pn(e, n) {
|
|
|
323
355
|
...e._zod.def,
|
|
324
356
|
get shape() {
|
|
325
357
|
const r = { ...e._zod.def.shape, ...n };
|
|
326
|
-
return
|
|
358
|
+
return I(this, "shape", r), r;
|
|
327
359
|
},
|
|
328
360
|
checks: e._zod.def.checks
|
|
329
361
|
};
|
|
330
362
|
return $(e, t);
|
|
331
363
|
}
|
|
332
364
|
function mn(e, n) {
|
|
333
|
-
const t =
|
|
365
|
+
const t = T(e._zod.def, {
|
|
334
366
|
get shape() {
|
|
335
367
|
const r = { ...e._zod.def.shape, ...n._zod.def.shape };
|
|
336
|
-
return
|
|
368
|
+
return I(this, "shape", r), r;
|
|
337
369
|
},
|
|
338
370
|
get catchall() {
|
|
339
371
|
return n._zod.def.catchall;
|
|
@@ -344,50 +376,50 @@ function mn(e, n) {
|
|
|
344
376
|
return $(e, t);
|
|
345
377
|
}
|
|
346
378
|
function _n(e, n, t) {
|
|
347
|
-
const r =
|
|
379
|
+
const r = T(n._zod.def, {
|
|
348
380
|
get shape() {
|
|
349
|
-
const o = n._zod.def.shape,
|
|
381
|
+
const o = n._zod.def.shape, u = { ...o };
|
|
350
382
|
if (t)
|
|
351
|
-
for (const
|
|
352
|
-
if (!(
|
|
353
|
-
throw new Error(`Unrecognized key: "${
|
|
354
|
-
t[
|
|
383
|
+
for (const s in t) {
|
|
384
|
+
if (!(s in o))
|
|
385
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
386
|
+
t[s] && (u[s] = e ? new e({
|
|
355
387
|
type: "optional",
|
|
356
|
-
innerType: o[
|
|
357
|
-
}) : o[
|
|
388
|
+
innerType: o[s]
|
|
389
|
+
}) : o[s]);
|
|
358
390
|
}
|
|
359
391
|
else
|
|
360
|
-
for (const
|
|
361
|
-
s
|
|
392
|
+
for (const s in o)
|
|
393
|
+
u[s] = e ? new e({
|
|
362
394
|
type: "optional",
|
|
363
|
-
innerType: o[
|
|
364
|
-
}) : o[
|
|
365
|
-
return
|
|
395
|
+
innerType: o[s]
|
|
396
|
+
}) : o[s];
|
|
397
|
+
return I(this, "shape", u), u;
|
|
366
398
|
},
|
|
367
399
|
checks: []
|
|
368
400
|
});
|
|
369
401
|
return $(n, r);
|
|
370
402
|
}
|
|
371
403
|
function gn(e, n, t) {
|
|
372
|
-
const r =
|
|
404
|
+
const r = T(n._zod.def, {
|
|
373
405
|
get shape() {
|
|
374
|
-
const o = n._zod.def.shape,
|
|
406
|
+
const o = n._zod.def.shape, u = { ...o };
|
|
375
407
|
if (t)
|
|
376
|
-
for (const
|
|
377
|
-
if (!(
|
|
378
|
-
throw new Error(`Unrecognized key: "${
|
|
379
|
-
t[
|
|
408
|
+
for (const s in t) {
|
|
409
|
+
if (!(s in u))
|
|
410
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
411
|
+
t[s] && (u[s] = new e({
|
|
380
412
|
type: "nonoptional",
|
|
381
|
-
innerType: o[
|
|
413
|
+
innerType: o[s]
|
|
382
414
|
}));
|
|
383
415
|
}
|
|
384
416
|
else
|
|
385
|
-
for (const
|
|
386
|
-
s
|
|
417
|
+
for (const s in o)
|
|
418
|
+
u[s] = new e({
|
|
387
419
|
type: "nonoptional",
|
|
388
|
-
innerType: o[
|
|
420
|
+
innerType: o[s]
|
|
389
421
|
});
|
|
390
|
-
return
|
|
422
|
+
return I(this, "shape", u), u;
|
|
391
423
|
},
|
|
392
424
|
checks: []
|
|
393
425
|
});
|
|
@@ -401,19 +433,19 @@ function N(e, n = 0) {
|
|
|
401
433
|
return !0;
|
|
402
434
|
return !1;
|
|
403
435
|
}
|
|
404
|
-
function
|
|
436
|
+
function Ie(e, n) {
|
|
405
437
|
return n.map((t) => {
|
|
406
438
|
var r;
|
|
407
439
|
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
|
|
408
440
|
});
|
|
409
441
|
}
|
|
410
|
-
function
|
|
442
|
+
function D(e) {
|
|
411
443
|
return typeof e == "string" ? e : e?.message;
|
|
412
444
|
}
|
|
413
445
|
function O(e, n, t) {
|
|
414
446
|
const r = { ...e, path: e.path ?? [] };
|
|
415
447
|
if (!e.message) {
|
|
416
|
-
const o =
|
|
448
|
+
const o = D(e.inst?._zod.def?.error?.(e)) ?? D(n?.error?.(e)) ?? D(t.customError?.(e)) ?? D(t.localeError?.(e)) ?? "Invalid input";
|
|
417
449
|
r.message = o;
|
|
418
450
|
}
|
|
419
451
|
return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
|
|
@@ -430,18 +462,18 @@ function R(...e) {
|
|
|
430
462
|
inst: r
|
|
431
463
|
} : { ...n };
|
|
432
464
|
}
|
|
433
|
-
const
|
|
465
|
+
const Te = (e, n) => {
|
|
434
466
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
435
467
|
value: e._zod,
|
|
436
468
|
enumerable: !1
|
|
437
469
|
}), Object.defineProperty(e, "issues", {
|
|
438
470
|
value: n,
|
|
439
471
|
enumerable: !1
|
|
440
|
-
}), e.message = JSON.stringify(n,
|
|
472
|
+
}), e.message = JSON.stringify(n, H, 2), Object.defineProperty(e, "toString", {
|
|
441
473
|
value: () => e.message,
|
|
442
474
|
enumerable: !1
|
|
443
475
|
});
|
|
444
|
-
}, Ne = a("$ZodError",
|
|
476
|
+
}, Ne = a("$ZodError", Te), je = a("$ZodError", Te, { Parent: Error });
|
|
445
477
|
function vn(e, n = (t) => t.message) {
|
|
446
478
|
const t = {}, r = [];
|
|
447
479
|
for (const o of e.issues)
|
|
@@ -450,57 +482,57 @@ function vn(e, n = (t) => t.message) {
|
|
|
450
482
|
}
|
|
451
483
|
function zn(e, n = (t) => t.message) {
|
|
452
484
|
const t = { _errors: [] }, r = (o) => {
|
|
453
|
-
for (const
|
|
454
|
-
if (
|
|
455
|
-
|
|
456
|
-
else if (
|
|
457
|
-
r({ issues:
|
|
458
|
-
else if (
|
|
459
|
-
r({ issues:
|
|
460
|
-
else if (
|
|
461
|
-
t._errors.push(n(
|
|
485
|
+
for (const u of o.issues)
|
|
486
|
+
if (u.code === "invalid_union" && u.errors.length)
|
|
487
|
+
u.errors.map((s) => r({ issues: s }));
|
|
488
|
+
else if (u.code === "invalid_key")
|
|
489
|
+
r({ issues: u.issues });
|
|
490
|
+
else if (u.code === "invalid_element")
|
|
491
|
+
r({ issues: u.issues });
|
|
492
|
+
else if (u.path.length === 0)
|
|
493
|
+
t._errors.push(n(u));
|
|
462
494
|
else {
|
|
463
|
-
let
|
|
464
|
-
for (; i <
|
|
465
|
-
const c =
|
|
466
|
-
i ===
|
|
495
|
+
let s = t, i = 0;
|
|
496
|
+
for (; i < u.path.length; ) {
|
|
497
|
+
const c = u.path[i];
|
|
498
|
+
i === u.path.length - 1 ? (s[c] = s[c] || { _errors: [] }, s[c]._errors.push(n(u))) : s[c] = s[c] || { _errors: [] }, s = s[c], i++;
|
|
467
499
|
}
|
|
468
500
|
}
|
|
469
501
|
};
|
|
470
502
|
return r(e), t;
|
|
471
503
|
}
|
|
472
504
|
const ne = (e) => (n, t, r, o) => {
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
505
|
+
const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, u);
|
|
506
|
+
if (s instanceof Promise)
|
|
475
507
|
throw new j();
|
|
476
|
-
if (
|
|
477
|
-
const i = new (o?.Err ?? e)(
|
|
508
|
+
if (s.issues.length) {
|
|
509
|
+
const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
|
|
478
510
|
throw Pe(i, o?.callee), i;
|
|
479
511
|
}
|
|
480
|
-
return
|
|
512
|
+
return s.value;
|
|
481
513
|
}, te = (e) => async (n, t, r, o) => {
|
|
482
|
-
const
|
|
483
|
-
let
|
|
484
|
-
if (
|
|
485
|
-
const i = new (o?.Err ?? e)(
|
|
514
|
+
const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
515
|
+
let s = n._zod.run({ value: t, issues: [] }, u);
|
|
516
|
+
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
517
|
+
const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
|
|
486
518
|
throw Pe(i, o?.callee), i;
|
|
487
519
|
}
|
|
488
|
-
return
|
|
520
|
+
return s.value;
|
|
489
521
|
}, V = (e) => (n, t, r) => {
|
|
490
|
-
const o = r ? { ...r, async: !1 } : { async: !1 },
|
|
491
|
-
if (
|
|
522
|
+
const o = r ? { ...r, async: !1 } : { async: !1 }, u = n._zod.run({ value: t, issues: [] }, o);
|
|
523
|
+
if (u instanceof Promise)
|
|
492
524
|
throw new j();
|
|
493
|
-
return
|
|
525
|
+
return u.issues.length ? {
|
|
494
526
|
success: !1,
|
|
495
|
-
error: new (e ?? Ne)(
|
|
496
|
-
} : { success: !0, data:
|
|
527
|
+
error: new (e ?? Ne)(u.issues.map((s) => O(s, o, P())))
|
|
528
|
+
} : { success: !0, data: u.value };
|
|
497
529
|
}, bn = /* @__PURE__ */ V(je), L = (e) => async (n, t, r) => {
|
|
498
530
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
499
|
-
let
|
|
500
|
-
return
|
|
531
|
+
let u = n._zod.run({ value: t, issues: [] }, o);
|
|
532
|
+
return u instanceof Promise && (u = await u), u.issues.length ? {
|
|
501
533
|
success: !1,
|
|
502
|
-
error: new e(
|
|
503
|
-
} : { success: !0, data:
|
|
534
|
+
error: new e(u.issues.map((s) => O(s, o, P())))
|
|
535
|
+
} : { success: !0, data: u.value };
|
|
504
536
|
}, wn = /* @__PURE__ */ L(je), yn = (e) => (n, t, r) => {
|
|
505
537
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
506
538
|
return ne(e)(n, t, o);
|
|
@@ -513,7 +545,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
513
545
|
}, Pn = (e) => (n, t, r) => V(e)(n, t, r), On = (e) => async (n, t, r) => {
|
|
514
546
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
515
547
|
return L(e)(n, t, o);
|
|
516
|
-
},
|
|
548
|
+
}, In = (e) => async (n, t, r) => L(e)(n, t, r), Tn = /^-?\d+$/, Nn = /^-?\d+(?:\.\d+)?/, k = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
|
|
517
549
|
var t;
|
|
518
550
|
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
519
551
|
}), Ae = {
|
|
@@ -524,8 +556,8 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
524
556
|
k.init(e, n);
|
|
525
557
|
const t = Ae[typeof n.value];
|
|
526
558
|
e._zod.onattach.push((r) => {
|
|
527
|
-
const o = r._zod.bag,
|
|
528
|
-
n.value <
|
|
559
|
+
const o = r._zod.bag, u = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
560
|
+
n.value < u && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
|
|
529
561
|
}), e._zod.check = (r) => {
|
|
530
562
|
(n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
|
|
531
563
|
origin: t,
|
|
@@ -541,8 +573,8 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
541
573
|
k.init(e, n);
|
|
542
574
|
const t = Ae[typeof n.value];
|
|
543
575
|
e._zod.onattach.push((r) => {
|
|
544
|
-
const o = r._zod.bag,
|
|
545
|
-
n.value >
|
|
576
|
+
const o = r._zod.bag, u = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
577
|
+
n.value > u && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
|
|
546
578
|
}), e._zod.check = (r) => {
|
|
547
579
|
(n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
|
|
548
580
|
origin: t,
|
|
@@ -572,15 +604,15 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
572
604
|
};
|
|
573
605
|
}), An = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
|
|
574
606
|
k.init(e, n), n.format = n.format || "float64";
|
|
575
|
-
const t = n.format?.includes("int"), r = t ? "int" : "number", [o,
|
|
576
|
-
e._zod.onattach.push((
|
|
577
|
-
const i =
|
|
578
|
-
i.format = n.format, i.minimum = o, i.maximum =
|
|
579
|
-
}), e._zod.check = (
|
|
580
|
-
const i =
|
|
607
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = ln[n.format];
|
|
608
|
+
e._zod.onattach.push((s) => {
|
|
609
|
+
const i = s._zod.bag;
|
|
610
|
+
i.format = n.format, i.minimum = o, i.maximum = u, t && (i.pattern = Tn);
|
|
611
|
+
}), e._zod.check = (s) => {
|
|
612
|
+
const i = s.value;
|
|
581
613
|
if (t) {
|
|
582
614
|
if (!Number.isInteger(i)) {
|
|
583
|
-
|
|
615
|
+
s.issues.push({
|
|
584
616
|
expected: r,
|
|
585
617
|
format: n.format,
|
|
586
618
|
code: "invalid_type",
|
|
@@ -591,7 +623,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
591
623
|
return;
|
|
592
624
|
}
|
|
593
625
|
if (!Number.isSafeInteger(i)) {
|
|
594
|
-
i > 0 ?
|
|
626
|
+
i > 0 ? s.issues.push({
|
|
595
627
|
input: i,
|
|
596
628
|
code: "too_big",
|
|
597
629
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
@@ -599,7 +631,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
599
631
|
inst: e,
|
|
600
632
|
origin: r,
|
|
601
633
|
continue: !n.abort
|
|
602
|
-
}) :
|
|
634
|
+
}) : s.issues.push({
|
|
603
635
|
input: i,
|
|
604
636
|
code: "too_small",
|
|
605
637
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
@@ -611,7 +643,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
611
643
|
return;
|
|
612
644
|
}
|
|
613
645
|
}
|
|
614
|
-
i < o &&
|
|
646
|
+
i < o && s.issues.push({
|
|
615
647
|
origin: "number",
|
|
616
648
|
input: i,
|
|
617
649
|
code: "too_small",
|
|
@@ -619,11 +651,11 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
619
651
|
inclusive: !0,
|
|
620
652
|
inst: e,
|
|
621
653
|
continue: !n.abort
|
|
622
|
-
}), i >
|
|
654
|
+
}), i > u && s.issues.push({
|
|
623
655
|
origin: "number",
|
|
624
656
|
input: i,
|
|
625
657
|
code: "too_big",
|
|
626
|
-
maximum:
|
|
658
|
+
maximum: u,
|
|
627
659
|
inst: e
|
|
628
660
|
});
|
|
629
661
|
};
|
|
@@ -631,7 +663,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
631
663
|
var t;
|
|
632
664
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
633
665
|
const o = r.value;
|
|
634
|
-
return !
|
|
666
|
+
return !W(o) && o.length !== void 0;
|
|
635
667
|
}), e._zod.onattach.push((r) => {
|
|
636
668
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
637
669
|
n.maximum < o && (r._zod.bag.maximum = n.maximum);
|
|
@@ -639,9 +671,9 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
639
671
|
const o = r.value;
|
|
640
672
|
if (o.length <= n.maximum)
|
|
641
673
|
return;
|
|
642
|
-
const
|
|
674
|
+
const s = ee(o);
|
|
643
675
|
r.issues.push({
|
|
644
|
-
origin:
|
|
676
|
+
origin: s,
|
|
645
677
|
code: "too_big",
|
|
646
678
|
maximum: n.maximum,
|
|
647
679
|
inclusive: !0,
|
|
@@ -654,7 +686,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
654
686
|
var t;
|
|
655
687
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
656
688
|
const o = r.value;
|
|
657
|
-
return !
|
|
689
|
+
return !W(o) && o.length !== void 0;
|
|
658
690
|
}), e._zod.onattach.push((r) => {
|
|
659
691
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
660
692
|
n.minimum > o && (r._zod.bag.minimum = n.minimum);
|
|
@@ -662,9 +694,9 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
662
694
|
const o = r.value;
|
|
663
695
|
if (o.length >= n.minimum)
|
|
664
696
|
return;
|
|
665
|
-
const
|
|
697
|
+
const s = ee(o);
|
|
666
698
|
r.issues.push({
|
|
667
|
-
origin:
|
|
699
|
+
origin: s,
|
|
668
700
|
code: "too_small",
|
|
669
701
|
minimum: n.minimum,
|
|
670
702
|
inclusive: !0,
|
|
@@ -677,17 +709,17 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
677
709
|
var t;
|
|
678
710
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
679
711
|
const o = r.value;
|
|
680
|
-
return !
|
|
712
|
+
return !W(o) && o.length !== void 0;
|
|
681
713
|
}), e._zod.onattach.push((r) => {
|
|
682
714
|
const o = r._zod.bag;
|
|
683
715
|
o.minimum = n.length, o.maximum = n.length, o.length = n.length;
|
|
684
716
|
}), e._zod.check = (r) => {
|
|
685
|
-
const o = r.value,
|
|
686
|
-
if (
|
|
717
|
+
const o = r.value, u = o.length;
|
|
718
|
+
if (u === n.length)
|
|
687
719
|
return;
|
|
688
|
-
const
|
|
720
|
+
const s = ee(o), i = u > n.length;
|
|
689
721
|
r.issues.push({
|
|
690
|
-
origin:
|
|
722
|
+
origin: s,
|
|
691
723
|
...i ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
|
|
692
724
|
inclusive: !0,
|
|
693
725
|
exact: !0,
|
|
@@ -696,12 +728,12 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
696
728
|
continue: !n.abort
|
|
697
729
|
});
|
|
698
730
|
};
|
|
699
|
-
}),
|
|
731
|
+
}), Dn = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
|
|
700
732
|
k.init(e, n), e._zod.check = (t) => {
|
|
701
733
|
t.value = n.tx(t.value);
|
|
702
734
|
};
|
|
703
735
|
});
|
|
704
|
-
class
|
|
736
|
+
class Cn {
|
|
705
737
|
constructor(n = []) {
|
|
706
738
|
this.content = [], this.indent = 0, this && (this.args = n);
|
|
707
739
|
}
|
|
@@ -714,58 +746,58 @@ class Dn {
|
|
|
714
746
|
return;
|
|
715
747
|
}
|
|
716
748
|
const r = n.split(`
|
|
717
|
-
`).filter((
|
|
718
|
-
for (const
|
|
719
|
-
this.content.push(
|
|
749
|
+
`).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);
|
|
750
|
+
for (const s of u)
|
|
751
|
+
this.content.push(s);
|
|
720
752
|
}
|
|
721
753
|
compile() {
|
|
722
|
-
const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((
|
|
754
|
+
const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
|
|
723
755
|
return new n(...t, o.join(`
|
|
724
756
|
`));
|
|
725
757
|
}
|
|
726
758
|
}
|
|
727
|
-
const
|
|
759
|
+
const Mn = {
|
|
728
760
|
major: 4,
|
|
729
761
|
minor: 1,
|
|
730
762
|
patch: 12
|
|
731
763
|
}, m = /* @__PURE__ */ a("$ZodType", (e, n) => {
|
|
732
764
|
var t;
|
|
733
|
-
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
765
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Mn;
|
|
734
766
|
const r = [...e._zod.def.checks ?? []];
|
|
735
767
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
736
768
|
for (const o of r)
|
|
737
|
-
for (const
|
|
738
|
-
|
|
769
|
+
for (const u of o._zod.onattach)
|
|
770
|
+
u(e);
|
|
739
771
|
if (r.length === 0)
|
|
740
772
|
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
|
|
741
773
|
e._zod.run = e._zod.parse;
|
|
742
774
|
});
|
|
743
775
|
else {
|
|
744
|
-
const o = (
|
|
745
|
-
let l = N(
|
|
776
|
+
const o = (s, i, c) => {
|
|
777
|
+
let l = N(s), f;
|
|
746
778
|
for (const z of i) {
|
|
747
779
|
if (z._zod.def.when) {
|
|
748
|
-
if (!z._zod.def.when(
|
|
780
|
+
if (!z._zod.def.when(s))
|
|
749
781
|
continue;
|
|
750
782
|
} else if (l)
|
|
751
783
|
continue;
|
|
752
|
-
const h =
|
|
784
|
+
const h = s.issues.length, _ = z._zod.check(s);
|
|
753
785
|
if (_ instanceof Promise && c?.async === !1)
|
|
754
786
|
throw new j();
|
|
755
787
|
if (f || _ instanceof Promise)
|
|
756
788
|
f = (f ?? Promise.resolve()).then(async () => {
|
|
757
|
-
await _,
|
|
789
|
+
await _, s.issues.length !== h && (l || (l = N(s, h)));
|
|
758
790
|
});
|
|
759
791
|
else {
|
|
760
|
-
if (
|
|
792
|
+
if (s.issues.length === h)
|
|
761
793
|
continue;
|
|
762
|
-
l || (l = N(
|
|
794
|
+
l || (l = N(s, h));
|
|
763
795
|
}
|
|
764
796
|
}
|
|
765
|
-
return f ? f.then(() =>
|
|
766
|
-
},
|
|
767
|
-
if (N(
|
|
768
|
-
return
|
|
797
|
+
return f ? f.then(() => s) : s;
|
|
798
|
+
}, u = (s, i, c) => {
|
|
799
|
+
if (N(s))
|
|
800
|
+
return s.aborted = !0, s;
|
|
769
801
|
const l = o(i, r, c);
|
|
770
802
|
if (l instanceof Promise) {
|
|
771
803
|
if (c.async === !1)
|
|
@@ -774,14 +806,14 @@ const Un = {
|
|
|
774
806
|
}
|
|
775
807
|
return e._zod.parse(l, c);
|
|
776
808
|
};
|
|
777
|
-
e._zod.run = (
|
|
809
|
+
e._zod.run = (s, i) => {
|
|
778
810
|
if (i.skipChecks)
|
|
779
|
-
return e._zod.parse(
|
|
811
|
+
return e._zod.parse(s, i);
|
|
780
812
|
if (i.direction === "backward") {
|
|
781
|
-
const l = e._zod.parse({ value:
|
|
782
|
-
return l instanceof Promise ? l.then((f) =>
|
|
813
|
+
const l = e._zod.parse({ value: s.value, issues: [] }, { ...i, skipChecks: !0 });
|
|
814
|
+
return l instanceof Promise ? l.then((f) => u(f, s, i)) : u(l, s, i);
|
|
783
815
|
}
|
|
784
|
-
const c = e._zod.parse(
|
|
816
|
+
const c = e._zod.parse(s, i);
|
|
785
817
|
if (c instanceof Promise) {
|
|
786
818
|
if (i.async === !1)
|
|
787
819
|
throw new j();
|
|
@@ -793,10 +825,10 @@ const Un = {
|
|
|
793
825
|
e["~standard"] = {
|
|
794
826
|
validate: (o) => {
|
|
795
827
|
try {
|
|
796
|
-
const
|
|
797
|
-
return
|
|
828
|
+
const u = bn(e, o);
|
|
829
|
+
return u.success ? { value: u.data } : { issues: u.error?.issues };
|
|
798
830
|
} catch {
|
|
799
|
-
return wn(e, o).then((
|
|
831
|
+
return wn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
800
832
|
}
|
|
801
833
|
},
|
|
802
834
|
vendor: "zod",
|
|
@@ -812,18 +844,18 @@ const Un = {
|
|
|
812
844
|
const o = t.value;
|
|
813
845
|
if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
|
|
814
846
|
return t;
|
|
815
|
-
const
|
|
847
|
+
const u = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
|
|
816
848
|
return t.issues.push({
|
|
817
849
|
expected: "number",
|
|
818
850
|
code: "invalid_type",
|
|
819
851
|
input: o,
|
|
820
852
|
inst: e,
|
|
821
|
-
...
|
|
853
|
+
...u ? { received: u } : {}
|
|
822
854
|
}), t;
|
|
823
855
|
};
|
|
824
|
-
}),
|
|
856
|
+
}), Un = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
|
|
825
857
|
An.init(e, n), Re.init(e, n);
|
|
826
|
-
}),
|
|
858
|
+
}), Fn = /* @__PURE__ */ a("$ZodUnknown", (e, n) => {
|
|
827
859
|
m.init(e, n), e._zod.parse = (t) => t;
|
|
828
860
|
}), Vn = /* @__PURE__ */ a("$ZodNever", (e, n) => {
|
|
829
861
|
m.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
|
|
@@ -834,7 +866,7 @@ const Un = {
|
|
|
834
866
|
}), t);
|
|
835
867
|
});
|
|
836
868
|
function ie(e, n, t) {
|
|
837
|
-
e.issues.length && n.issues.push(...
|
|
869
|
+
e.issues.length && n.issues.push(...Ie(t, e.issues)), n.value[t] = e.value;
|
|
838
870
|
}
|
|
839
871
|
const Ln = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
840
872
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
@@ -847,21 +879,21 @@ const Ln = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
|
847
879
|
inst: e
|
|
848
880
|
}), t;
|
|
849
881
|
t.value = Array(o.length);
|
|
850
|
-
const
|
|
851
|
-
for (let
|
|
852
|
-
const i = o[
|
|
882
|
+
const u = [];
|
|
883
|
+
for (let s = 0; s < o.length; s++) {
|
|
884
|
+
const i = o[s], c = n.element._zod.run({
|
|
853
885
|
value: i,
|
|
854
886
|
issues: []
|
|
855
887
|
}, r);
|
|
856
|
-
c instanceof Promise ?
|
|
888
|
+
c instanceof Promise ? u.push(c.then((l) => ie(l, t, s))) : ie(c, t, s);
|
|
857
889
|
}
|
|
858
|
-
return
|
|
890
|
+
return u.length ? Promise.all(u).then(() => t) : t;
|
|
859
891
|
};
|
|
860
892
|
});
|
|
861
|
-
function
|
|
862
|
-
e.issues.length && n.issues.push(...
|
|
893
|
+
function F(e, n, t, r) {
|
|
894
|
+
e.issues.length && n.issues.push(...Ie(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
|
|
863
895
|
}
|
|
864
|
-
function
|
|
896
|
+
function De(e) {
|
|
865
897
|
const n = Object.keys(e.shape);
|
|
866
898
|
for (const r of n)
|
|
867
899
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
@@ -875,23 +907,23 @@ function Ce(e) {
|
|
|
875
907
|
optionalKeys: new Set(t)
|
|
876
908
|
};
|
|
877
909
|
}
|
|
878
|
-
function
|
|
879
|
-
const
|
|
910
|
+
function Ce(e, n, t, r, o, u) {
|
|
911
|
+
const s = [], i = o.keySet, c = o.catchall._zod, l = c.def.type;
|
|
880
912
|
for (const f of Object.keys(n)) {
|
|
881
913
|
if (i.has(f))
|
|
882
914
|
continue;
|
|
883
915
|
if (l === "never") {
|
|
884
|
-
|
|
916
|
+
s.push(f);
|
|
885
917
|
continue;
|
|
886
918
|
}
|
|
887
919
|
const z = c.run({ value: n[f], issues: [] }, r);
|
|
888
|
-
z instanceof Promise ? e.push(z.then((h) =>
|
|
920
|
+
z instanceof Promise ? e.push(z.then((h) => F(h, t, f, n))) : F(z, t, f, n);
|
|
889
921
|
}
|
|
890
|
-
return
|
|
922
|
+
return s.length && t.issues.push({
|
|
891
923
|
code: "unrecognized_keys",
|
|
892
|
-
keys:
|
|
924
|
+
keys: s,
|
|
893
925
|
input: n,
|
|
894
|
-
inst:
|
|
926
|
+
inst: u
|
|
895
927
|
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
896
928
|
}
|
|
897
929
|
const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
@@ -906,7 +938,7 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
906
938
|
}
|
|
907
939
|
});
|
|
908
940
|
}
|
|
909
|
-
const r =
|
|
941
|
+
const r = X(() => De(n));
|
|
910
942
|
d(e._zod, "propValues", () => {
|
|
911
943
|
const i = n.shape, c = {};
|
|
912
944
|
for (const l in i) {
|
|
@@ -919,10 +951,10 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
919
951
|
}
|
|
920
952
|
return c;
|
|
921
953
|
});
|
|
922
|
-
const o =
|
|
923
|
-
let
|
|
954
|
+
const o = U, u = n.catchall;
|
|
955
|
+
let s;
|
|
924
956
|
e._zod.parse = (i, c) => {
|
|
925
|
-
|
|
957
|
+
s ?? (s = r.value);
|
|
926
958
|
const l = i.value;
|
|
927
959
|
if (!o(l))
|
|
928
960
|
return i.issues.push({
|
|
@@ -932,17 +964,17 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
932
964
|
inst: e
|
|
933
965
|
}), i;
|
|
934
966
|
i.value = {};
|
|
935
|
-
const f = [], z =
|
|
936
|
-
for (const h of
|
|
967
|
+
const f = [], z = s.shape;
|
|
968
|
+
for (const h of s.keys) {
|
|
937
969
|
const b = z[h]._zod.run({ value: l[h], issues: [] }, c);
|
|
938
|
-
b instanceof Promise ? f.push(b.then((G) =>
|
|
970
|
+
b instanceof Promise ? f.push(b.then((G) => F(G, i, h, l))) : F(b, i, h, l);
|
|
939
971
|
}
|
|
940
|
-
return
|
|
972
|
+
return u ? Ce(f, l, i, c, r.value, e) : f.length ? Promise.all(f).then(() => i) : i;
|
|
941
973
|
};
|
|
942
974
|
}), Jn = /* @__PURE__ */ a("$ZodObjectJIT", (e, n) => {
|
|
943
975
|
Gn.init(e, n);
|
|
944
|
-
const t = e._zod.parse, r =
|
|
945
|
-
const _ = new
|
|
976
|
+
const t = e._zod.parse, r = X(() => De(n)), o = (h) => {
|
|
977
|
+
const _ = new Cn(["shape", "payload", "ctx"]), b = r.value, G = (E) => {
|
|
946
978
|
const y = se(E);
|
|
947
979
|
return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
|
|
948
980
|
};
|
|
@@ -977,13 +1009,13 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
977
1009
|
const Je = _.compile();
|
|
978
1010
|
return (E, y) => Je(h, E, y);
|
|
979
1011
|
};
|
|
980
|
-
let
|
|
981
|
-
const
|
|
1012
|
+
let u;
|
|
1013
|
+
const s = U, i = !Ze.jitless, l = i && un.value, f = n.catchall;
|
|
982
1014
|
let z;
|
|
983
1015
|
e._zod.parse = (h, _) => {
|
|
984
1016
|
z ?? (z = r.value);
|
|
985
1017
|
const b = h.value;
|
|
986
|
-
return
|
|
1018
|
+
return s(b) ? i && l && _?.async === !1 && _.jitless !== !0 ? (u || (u = o(n.shape)), h = u(h, _), f ? Ce([], b, h, _, z, e) : h) : t(h, _) : (h.issues.push({
|
|
987
1019
|
expected: "object",
|
|
988
1020
|
code: "invalid_type",
|
|
989
1021
|
input: b,
|
|
@@ -992,15 +1024,15 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
992
1024
|
};
|
|
993
1025
|
});
|
|
994
1026
|
function ce(e, n, t, r) {
|
|
995
|
-
for (const
|
|
996
|
-
if (
|
|
997
|
-
return n.value =
|
|
998
|
-
const o = e.filter((
|
|
1027
|
+
for (const u of e)
|
|
1028
|
+
if (u.issues.length === 0)
|
|
1029
|
+
return n.value = u.value, n;
|
|
1030
|
+
const o = e.filter((u) => !N(u));
|
|
999
1031
|
return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
|
|
1000
1032
|
code: "invalid_union",
|
|
1001
1033
|
input: n.value,
|
|
1002
1034
|
inst: t,
|
|
1003
|
-
errors: e.map((
|
|
1035
|
+
errors: e.map((u) => u.issues.map((s) => O(s, r, P())))
|
|
1004
1036
|
}), n);
|
|
1005
1037
|
}
|
|
1006
1038
|
const Kn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
@@ -1009,52 +1041,52 @@ const Kn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
|
1009
1041
|
return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1010
1042
|
}), d(e._zod, "pattern", () => {
|
|
1011
1043
|
if (n.options.every((o) => o._zod.pattern)) {
|
|
1012
|
-
const o = n.options.map((
|
|
1013
|
-
return new RegExp(`^(${o.map((
|
|
1044
|
+
const o = n.options.map((u) => u._zod.pattern);
|
|
1045
|
+
return new RegExp(`^(${o.map((u) => Q(u.source)).join("|")})$`);
|
|
1014
1046
|
}
|
|
1015
1047
|
});
|
|
1016
1048
|
const t = n.options.length === 1, r = n.options[0]._zod.run;
|
|
1017
|
-
e._zod.parse = (o,
|
|
1049
|
+
e._zod.parse = (o, u) => {
|
|
1018
1050
|
if (t)
|
|
1019
|
-
return r(o,
|
|
1020
|
-
let
|
|
1051
|
+
return r(o, u);
|
|
1052
|
+
let s = !1;
|
|
1021
1053
|
const i = [];
|
|
1022
1054
|
for (const c of n.options) {
|
|
1023
1055
|
const l = c._zod.run({
|
|
1024
1056
|
value: o.value,
|
|
1025
1057
|
issues: []
|
|
1026
|
-
},
|
|
1058
|
+
}, u);
|
|
1027
1059
|
if (l instanceof Promise)
|
|
1028
|
-
i.push(l),
|
|
1060
|
+
i.push(l), s = !0;
|
|
1029
1061
|
else {
|
|
1030
1062
|
if (l.issues.length === 0)
|
|
1031
1063
|
return l;
|
|
1032
1064
|
i.push(l);
|
|
1033
1065
|
}
|
|
1034
1066
|
}
|
|
1035
|
-
return
|
|
1067
|
+
return s ? Promise.all(i).then((c) => ce(c, o, e, u)) : ce(i, o, e, u);
|
|
1036
1068
|
};
|
|
1037
1069
|
}), Yn = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
|
|
1038
1070
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
1039
|
-
const o = t.value,
|
|
1040
|
-
return
|
|
1071
|
+
const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
|
|
1072
|
+
return u instanceof Promise || s instanceof Promise ? Promise.all([u, s]).then(([c, l]) => ae(t, c, l)) : ae(t, u, s);
|
|
1041
1073
|
};
|
|
1042
1074
|
});
|
|
1043
|
-
function
|
|
1075
|
+
function q(e, n) {
|
|
1044
1076
|
if (e === n)
|
|
1045
1077
|
return { valid: !0, data: e };
|
|
1046
1078
|
if (e instanceof Date && n instanceof Date && +e == +n)
|
|
1047
1079
|
return { valid: !0, data: e };
|
|
1048
1080
|
if (x(e) && x(n)) {
|
|
1049
|
-
const t = Object.keys(n), r = Object.keys(e).filter((
|
|
1050
|
-
for (const
|
|
1051
|
-
const
|
|
1052
|
-
if (!
|
|
1081
|
+
const t = Object.keys(n), r = Object.keys(e).filter((u) => t.indexOf(u) !== -1), o = { ...e, ...n };
|
|
1082
|
+
for (const u of r) {
|
|
1083
|
+
const s = q(e[u], n[u]);
|
|
1084
|
+
if (!s.valid)
|
|
1053
1085
|
return {
|
|
1054
1086
|
valid: !1,
|
|
1055
|
-
mergeErrorPath: [
|
|
1087
|
+
mergeErrorPath: [u, ...s.mergeErrorPath]
|
|
1056
1088
|
};
|
|
1057
|
-
o[
|
|
1089
|
+
o[u] = s.data;
|
|
1058
1090
|
}
|
|
1059
1091
|
return { valid: !0, data: o };
|
|
1060
1092
|
}
|
|
@@ -1063,13 +1095,13 @@ function B(e, n) {
|
|
|
1063
1095
|
return { valid: !1, mergeErrorPath: [] };
|
|
1064
1096
|
const t = [];
|
|
1065
1097
|
for (let r = 0; r < e.length; r++) {
|
|
1066
|
-
const o = e[r],
|
|
1067
|
-
if (!
|
|
1098
|
+
const o = e[r], u = n[r], s = q(o, u);
|
|
1099
|
+
if (!s.valid)
|
|
1068
1100
|
return {
|
|
1069
1101
|
valid: !1,
|
|
1070
|
-
mergeErrorPath: [r, ...
|
|
1102
|
+
mergeErrorPath: [r, ...s.mergeErrorPath]
|
|
1071
1103
|
};
|
|
1072
|
-
t.push(
|
|
1104
|
+
t.push(s.data);
|
|
1073
1105
|
}
|
|
1074
1106
|
return { valid: !0, data: t };
|
|
1075
1107
|
}
|
|
@@ -1078,30 +1110,30 @@ function B(e, n) {
|
|
|
1078
1110
|
function ae(e, n, t) {
|
|
1079
1111
|
if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), N(e))
|
|
1080
1112
|
return e;
|
|
1081
|
-
const r =
|
|
1113
|
+
const r = q(n.value, t.value);
|
|
1082
1114
|
if (!r.valid)
|
|
1083
1115
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
1084
1116
|
return e.value = r.data, e;
|
|
1085
1117
|
}
|
|
1086
|
-
const
|
|
1118
|
+
const Hn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
1087
1119
|
m.init(e, n);
|
|
1088
1120
|
const t = rn(n.entries), r = new Set(t);
|
|
1089
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => sn.has(typeof o)).map((o) => typeof o == "string" ? cn(o) : o.toString()).join("|")})$`), e._zod.parse = (o,
|
|
1090
|
-
const
|
|
1091
|
-
return r.has(
|
|
1121
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => sn.has(typeof o)).map((o) => typeof o == "string" ? cn(o) : o.toString()).join("|")})$`), e._zod.parse = (o, u) => {
|
|
1122
|
+
const s = o.value;
|
|
1123
|
+
return r.has(s) || o.issues.push({
|
|
1092
1124
|
code: "invalid_value",
|
|
1093
1125
|
values: t,
|
|
1094
|
-
input:
|
|
1126
|
+
input: s,
|
|
1095
1127
|
inst: e
|
|
1096
1128
|
}), o;
|
|
1097
1129
|
};
|
|
1098
|
-
}),
|
|
1130
|
+
}), qn = /* @__PURE__ */ a("$ZodTransform", (e, n) => {
|
|
1099
1131
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
1100
1132
|
if (r.direction === "backward")
|
|
1101
1133
|
throw new $e(e.constructor.name);
|
|
1102
1134
|
const o = n.transform(t.value, t);
|
|
1103
1135
|
if (r.async)
|
|
1104
|
-
return (o instanceof Promise ? o : Promise.resolve(o)).then((
|
|
1136
|
+
return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
|
|
1105
1137
|
if (o instanceof Promise)
|
|
1106
1138
|
throw new j();
|
|
1107
1139
|
return t.value = o, t;
|
|
@@ -1110,30 +1142,30 @@ const qn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
|
1110
1142
|
function le(e, n) {
|
|
1111
1143
|
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
1112
1144
|
}
|
|
1113
|
-
const
|
|
1145
|
+
const Bn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
1114
1146
|
m.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", d(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), d(e._zod, "pattern", () => {
|
|
1115
1147
|
const t = n.innerType._zod.pattern;
|
|
1116
1148
|
return t ? new RegExp(`^(${Q(t.source)})?$`) : void 0;
|
|
1117
1149
|
}), e._zod.parse = (t, r) => {
|
|
1118
1150
|
if (n.innerType._zod.optin === "optional") {
|
|
1119
1151
|
const o = n.innerType._zod.run(t, r);
|
|
1120
|
-
return o instanceof Promise ? o.then((
|
|
1152
|
+
return o instanceof Promise ? o.then((u) => le(u, t.value)) : le(o, t.value);
|
|
1121
1153
|
}
|
|
1122
1154
|
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
1123
1155
|
};
|
|
1124
|
-
}),
|
|
1156
|
+
}), Xn = /* @__PURE__ */ a("$ZodNullable", (e, n) => {
|
|
1125
1157
|
m.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "pattern", () => {
|
|
1126
1158
|
const t = n.innerType._zod.pattern;
|
|
1127
1159
|
return t ? new RegExp(`^(${Q(t.source)}|null)$`) : void 0;
|
|
1128
1160
|
}), d(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);
|
|
1129
|
-
}),
|
|
1161
|
+
}), Wn = /* @__PURE__ */ a("$ZodDefault", (e, n) => {
|
|
1130
1162
|
m.init(e, n), e._zod.optin = "optional", d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1131
1163
|
if (r.direction === "backward")
|
|
1132
1164
|
return n.innerType._zod.run(t, r);
|
|
1133
1165
|
if (t.value === void 0)
|
|
1134
1166
|
return t.value = n.defaultValue, t;
|
|
1135
1167
|
const o = n.innerType._zod.run(t, r);
|
|
1136
|
-
return o instanceof Promise ? o.then((
|
|
1168
|
+
return o instanceof Promise ? o.then((u) => fe(u, n)) : fe(o, n);
|
|
1137
1169
|
};
|
|
1138
1170
|
});
|
|
1139
1171
|
function fe(e, n) {
|
|
@@ -1147,7 +1179,7 @@ const Qn = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
|
|
|
1147
1179
|
return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
|
|
1148
1180
|
}), e._zod.parse = (t, r) => {
|
|
1149
1181
|
const o = n.innerType._zod.run(t, r);
|
|
1150
|
-
return o instanceof Promise ? o.then((
|
|
1182
|
+
return o instanceof Promise ? o.then((u) => de(u, e)) : de(o, e);
|
|
1151
1183
|
};
|
|
1152
1184
|
});
|
|
1153
1185
|
function de(e, n) {
|
|
@@ -1163,16 +1195,16 @@ const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
|
1163
1195
|
if (r.direction === "backward")
|
|
1164
1196
|
return n.innerType._zod.run(t, r);
|
|
1165
1197
|
const o = n.innerType._zod.run(t, r);
|
|
1166
|
-
return o instanceof Promise ? o.then((
|
|
1198
|
+
return o instanceof Promise ? o.then((u) => (t.value = u.value, u.issues.length && (t.value = n.catchValue({
|
|
1167
1199
|
...t,
|
|
1168
1200
|
error: {
|
|
1169
|
-
issues:
|
|
1201
|
+
issues: u.issues.map((s) => O(s, r, P()))
|
|
1170
1202
|
},
|
|
1171
1203
|
input: t.value
|
|
1172
1204
|
}), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
|
|
1173
1205
|
...t,
|
|
1174
1206
|
error: {
|
|
1175
|
-
issues: o.issues.map((
|
|
1207
|
+
issues: o.issues.map((u) => O(u, r, P()))
|
|
1176
1208
|
},
|
|
1177
1209
|
input: t.value
|
|
1178
1210
|
}), t.issues = []), t);
|
|
@@ -1180,14 +1212,14 @@ const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
|
1180
1212
|
}), tt = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
|
|
1181
1213
|
m.init(e, n), d(e._zod, "values", () => n.in._zod.values), d(e._zod, "optin", () => n.in._zod.optin), d(e._zod, "optout", () => n.out._zod.optout), d(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
|
|
1182
1214
|
if (r.direction === "backward") {
|
|
1183
|
-
const
|
|
1184
|
-
return
|
|
1215
|
+
const u = n.out._zod.run(t, r);
|
|
1216
|
+
return u instanceof Promise ? u.then((s) => C(s, n.in, r)) : C(u, n.in, r);
|
|
1185
1217
|
}
|
|
1186
1218
|
const o = n.in._zod.run(t, r);
|
|
1187
|
-
return o instanceof Promise ? o.then((
|
|
1219
|
+
return o instanceof Promise ? o.then((u) => C(u, n.out, r)) : C(o, n.out, r);
|
|
1188
1220
|
};
|
|
1189
1221
|
});
|
|
1190
|
-
function
|
|
1222
|
+
function C(e, n, t) {
|
|
1191
1223
|
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1192
1224
|
}
|
|
1193
1225
|
const rt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
@@ -1205,7 +1237,7 @@ const ot = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
|
|
|
1205
1237
|
k.init(e, n), m.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
|
|
1206
1238
|
const r = t.value, o = n.fn(r);
|
|
1207
1239
|
if (o instanceof Promise)
|
|
1208
|
-
return o.then((
|
|
1240
|
+
return o.then((u) => pe(u, t, r, e));
|
|
1209
1241
|
pe(o, t, r, e);
|
|
1210
1242
|
};
|
|
1211
1243
|
});
|
|
@@ -1261,7 +1293,7 @@ class ut {
|
|
|
1261
1293
|
function st() {
|
|
1262
1294
|
return new ut();
|
|
1263
1295
|
}
|
|
1264
|
-
const
|
|
1296
|
+
const M = /* @__PURE__ */ st();
|
|
1265
1297
|
function it(e, n) {
|
|
1266
1298
|
return new e({
|
|
1267
1299
|
type: "number",
|
|
@@ -1350,7 +1382,7 @@ function dt(e, n) {
|
|
|
1350
1382
|
});
|
|
1351
1383
|
}
|
|
1352
1384
|
function ht(e) {
|
|
1353
|
-
return new
|
|
1385
|
+
return new Dn({
|
|
1354
1386
|
check: "overwrite",
|
|
1355
1387
|
tx: e
|
|
1356
1388
|
});
|
|
@@ -1403,13 +1435,13 @@ const vt = (e, n) => {
|
|
|
1403
1435
|
},
|
|
1404
1436
|
addIssue: {
|
|
1405
1437
|
value: (t) => {
|
|
1406
|
-
e.issues.push(t), e.message = JSON.stringify(e.issues,
|
|
1438
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, H, 2);
|
|
1407
1439
|
}
|
|
1408
1440
|
// enumerable: false,
|
|
1409
1441
|
},
|
|
1410
1442
|
addIssues: {
|
|
1411
1443
|
value: (t) => {
|
|
1412
|
-
e.issues.push(...t), e.message = JSON.stringify(e.issues,
|
|
1444
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, H, 2);
|
|
1413
1445
|
}
|
|
1414
1446
|
// enumerable: false,
|
|
1415
1447
|
},
|
|
@@ -1422,40 +1454,40 @@ const vt = (e, n) => {
|
|
|
1422
1454
|
});
|
|
1423
1455
|
}, w = a("ZodError", vt, {
|
|
1424
1456
|
Parent: Error
|
|
1425
|
-
}), zt = /* @__PURE__ */ ne(w), bt = /* @__PURE__ */ te(w), wt = /* @__PURE__ */ V(w), yt = /* @__PURE__ */ L(w), kt = /* @__PURE__ */ yn(w), Et = /* @__PURE__ */ kn(w), $t = /* @__PURE__ */ En(w), Zt = /* @__PURE__ */ $n(w), Pt = /* @__PURE__ */ Zn(w), Ot = /* @__PURE__ */ Pn(w),
|
|
1457
|
+
}), zt = /* @__PURE__ */ ne(w), bt = /* @__PURE__ */ te(w), wt = /* @__PURE__ */ V(w), yt = /* @__PURE__ */ L(w), kt = /* @__PURE__ */ yn(w), Et = /* @__PURE__ */ kn(w), $t = /* @__PURE__ */ En(w), Zt = /* @__PURE__ */ $n(w), Pt = /* @__PURE__ */ Zn(w), Ot = /* @__PURE__ */ Pn(w), It = /* @__PURE__ */ On(w), Tt = /* @__PURE__ */ In(w), g = /* @__PURE__ */ a("ZodType", (e, n) => (m.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(T(n, {
|
|
1426
1458
|
checks: [
|
|
1427
1459
|
...n.checks ?? [],
|
|
1428
1460
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1429
1461
|
]
|
|
1430
|
-
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => zt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => wt(e, t, r), e.parseAsync = async (t, r) => bt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => yt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => kt(e, t, r), e.decode = (t, r) => Et(e, t, r), e.encodeAsync = async (t, r) => $t(e, t, r), e.decodeAsync = async (t, r) => Zt(e, t, r), e.safeEncode = (t, r) => Pt(e, t, r), e.safeDecode = (t, r) => Ot(e, t, r), e.safeEncodeAsync = async (t, r) =>
|
|
1462
|
+
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => zt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => wt(e, t, r), e.parseAsync = async (t, r) => bt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => yt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => kt(e, t, r), e.decode = (t, r) => Et(e, t, r), e.encodeAsync = async (t, r) => $t(e, t, r), e.decodeAsync = async (t, r) => Zt(e, t, r), e.safeEncode = (t, r) => Pt(e, t, r), e.safeDecode = (t, r) => Ot(e, t, r), e.safeEncodeAsync = async (t, r) => It(e, t, r), e.safeDecodeAsync = async (t, r) => Tt(e, t, r), e.refine = (t, r) => e.check(tr(t, r)), e.superRefine = (t) => e.check(rr(t)), e.overwrite = (t) => e.check(ht(t)), e.optional = () => we(e), e.nullable = () => ye(e), e.nullish = () => we(ye(e)), e.nonoptional = (t) => qt(e, t), e.array = () => Ue(e), e.or = (t) => Ct([e, t]), e.and = (t) => Ut(e, t), e.transform = (t) => ke(e, Lt(t)), e.default = (t) => Kt(e, t), e.prefault = (t) => Ht(e, t), e.catch = (t) => Xt(e, t), e.pipe = (t) => ke(e, t), e.readonly = () => er(e), e.describe = (t) => {
|
|
1431
1463
|
const r = e.clone();
|
|
1432
|
-
return
|
|
1464
|
+
return M.add(r, { description: t }), r;
|
|
1433
1465
|
}, Object.defineProperty(e, "description", {
|
|
1434
1466
|
get() {
|
|
1435
|
-
return
|
|
1467
|
+
return M.get(e)?.description;
|
|
1436
1468
|
},
|
|
1437
1469
|
configurable: !0
|
|
1438
1470
|
}), e.meta = (...t) => {
|
|
1439
1471
|
if (t.length === 0)
|
|
1440
|
-
return
|
|
1472
|
+
return M.get(e);
|
|
1441
1473
|
const r = e.clone();
|
|
1442
|
-
return
|
|
1443
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
1474
|
+
return M.add(r, t[0]), r;
|
|
1475
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Me = /* @__PURE__ */ a("ZodNumber", (e, n) => {
|
|
1444
1476
|
Re.init(e, n), g.init(e, n), e.gt = (r, o) => e.check(_e(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(me(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(ze(r)), e.safe = (r) => e.check(ze(r)), e.positive = (r) => e.check(_e(0, r)), e.nonnegative = (r) => e.check(Y(0, r)), e.negative = (r) => e.check(me(0, r)), e.nonpositive = (r) => e.check(K(0, r)), e.multipleOf = (r, o) => e.check(ge(r, o)), e.step = (r, o) => e.check(ge(r, o)), e.finite = () => e;
|
|
1445
1477
|
const t = e._zod.bag;
|
|
1446
1478
|
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;
|
|
1447
1479
|
});
|
|
1448
1480
|
function Z(e) {
|
|
1449
|
-
return it(
|
|
1481
|
+
return it(Me, e);
|
|
1450
1482
|
}
|
|
1451
1483
|
const Nt = /* @__PURE__ */ a("ZodNumberFormat", (e, n) => {
|
|
1452
|
-
|
|
1484
|
+
Un.init(e, n), Me.init(e, n);
|
|
1453
1485
|
});
|
|
1454
1486
|
function ze(e) {
|
|
1455
1487
|
return ct(Nt, e);
|
|
1456
1488
|
}
|
|
1457
1489
|
const jt = /* @__PURE__ */ a("ZodUnknown", (e, n) => {
|
|
1458
|
-
|
|
1490
|
+
Fn.init(e, n), g.init(e, n);
|
|
1459
1491
|
});
|
|
1460
1492
|
function be() {
|
|
1461
1493
|
return at(jt);
|
|
@@ -1469,13 +1501,13 @@ function St(e) {
|
|
|
1469
1501
|
const xt = /* @__PURE__ */ a("ZodArray", (e, n) => {
|
|
1470
1502
|
Ln.init(e, n), g.init(e, n), e.element = n.element, e.min = (t, r) => e.check(ve(t, r)), e.nonempty = (t) => e.check(ve(1, t)), e.max = (t, r) => e.check(ft(t, r)), e.length = (t, r) => e.check(dt(t, r)), e.unwrap = () => e.element;
|
|
1471
1503
|
});
|
|
1472
|
-
function
|
|
1504
|
+
function Ue(e, n) {
|
|
1473
1505
|
return pt(xt, e, n);
|
|
1474
1506
|
}
|
|
1475
1507
|
const Rt = /* @__PURE__ */ a("ZodObject", (e, n) => {
|
|
1476
|
-
Jn.init(e, n), g.init(e, n), d(e, "shape", () => n.shape), e.keyof = () =>
|
|
1508
|
+
Jn.init(e, n), g.init(e, n), d(e, "shape", () => n.shape), e.keyof = () => Ft(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: be() }), e.loose = () => e.clone({ ...e._zod.def, catchall: be() }), e.strict = () => e.clone({ ...e._zod.def, catchall: St() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => hn(e, t), e.safeExtend = (t) => pn(e, t), e.merge = (t) => mn(e, t), e.pick = (t) => fn(e, t), e.omit = (t) => dn(e, t), e.partial = (...t) => _n(Ve, e, t[0]), e.required = (...t) => gn(Le, e, t[0]);
|
|
1477
1509
|
});
|
|
1478
|
-
function
|
|
1510
|
+
function Fe(e, n) {
|
|
1479
1511
|
const t = {
|
|
1480
1512
|
type: "object",
|
|
1481
1513
|
shape: e ?? {},
|
|
@@ -1483,79 +1515,79 @@ function Me(e, n) {
|
|
|
1483
1515
|
};
|
|
1484
1516
|
return new Rt(t);
|
|
1485
1517
|
}
|
|
1486
|
-
const
|
|
1518
|
+
const Dt = /* @__PURE__ */ a("ZodUnion", (e, n) => {
|
|
1487
1519
|
Kn.init(e, n), g.init(e, n), e.options = n.options;
|
|
1488
1520
|
});
|
|
1489
|
-
function
|
|
1490
|
-
return new
|
|
1521
|
+
function Ct(e, n) {
|
|
1522
|
+
return new Dt({
|
|
1491
1523
|
type: "union",
|
|
1492
1524
|
options: e,
|
|
1493
1525
|
...p(n)
|
|
1494
1526
|
});
|
|
1495
1527
|
}
|
|
1496
|
-
const
|
|
1528
|
+
const Mt = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
|
|
1497
1529
|
Yn.init(e, n), g.init(e, n);
|
|
1498
1530
|
});
|
|
1499
|
-
function
|
|
1500
|
-
return new
|
|
1531
|
+
function Ut(e, n) {
|
|
1532
|
+
return new Mt({
|
|
1501
1533
|
type: "intersection",
|
|
1502
1534
|
left: e,
|
|
1503
1535
|
right: n
|
|
1504
1536
|
});
|
|
1505
1537
|
}
|
|
1506
|
-
const
|
|
1507
|
-
|
|
1538
|
+
const B = /* @__PURE__ */ a("ZodEnum", (e, n) => {
|
|
1539
|
+
Hn.init(e, n), g.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
|
|
1508
1540
|
const t = new Set(Object.keys(n.entries));
|
|
1509
1541
|
e.extract = (r, o) => {
|
|
1510
|
-
const
|
|
1511
|
-
for (const
|
|
1512
|
-
if (t.has(
|
|
1513
|
-
s
|
|
1542
|
+
const u = {};
|
|
1543
|
+
for (const s of r)
|
|
1544
|
+
if (t.has(s))
|
|
1545
|
+
u[s] = n.entries[s];
|
|
1514
1546
|
else
|
|
1515
|
-
throw new Error(`Key ${
|
|
1516
|
-
return new
|
|
1547
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
1548
|
+
return new B({
|
|
1517
1549
|
...n,
|
|
1518
1550
|
checks: [],
|
|
1519
1551
|
...p(o),
|
|
1520
|
-
entries:
|
|
1552
|
+
entries: u
|
|
1521
1553
|
});
|
|
1522
1554
|
}, e.exclude = (r, o) => {
|
|
1523
|
-
const
|
|
1524
|
-
for (const
|
|
1525
|
-
if (t.has(
|
|
1526
|
-
delete s
|
|
1555
|
+
const u = { ...n.entries };
|
|
1556
|
+
for (const s of r)
|
|
1557
|
+
if (t.has(s))
|
|
1558
|
+
delete u[s];
|
|
1527
1559
|
else
|
|
1528
|
-
throw new Error(`Key ${
|
|
1529
|
-
return new
|
|
1560
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
1561
|
+
return new B({
|
|
1530
1562
|
...n,
|
|
1531
1563
|
checks: [],
|
|
1532
1564
|
...p(o),
|
|
1533
|
-
entries:
|
|
1565
|
+
entries: u
|
|
1534
1566
|
});
|
|
1535
1567
|
};
|
|
1536
1568
|
});
|
|
1537
|
-
function
|
|
1569
|
+
function Ft(e, n) {
|
|
1538
1570
|
const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
1539
|
-
return new
|
|
1571
|
+
return new B({
|
|
1540
1572
|
type: "enum",
|
|
1541
1573
|
entries: t,
|
|
1542
1574
|
...p(n)
|
|
1543
1575
|
});
|
|
1544
1576
|
}
|
|
1545
1577
|
const Vt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
|
|
1546
|
-
|
|
1578
|
+
qn.init(e, n), g.init(e, n), e._zod.parse = (t, r) => {
|
|
1547
1579
|
if (r.direction === "backward")
|
|
1548
1580
|
throw new $e(e.constructor.name);
|
|
1549
|
-
t.addIssue = (
|
|
1550
|
-
if (typeof
|
|
1551
|
-
t.issues.push(R(
|
|
1581
|
+
t.addIssue = (u) => {
|
|
1582
|
+
if (typeof u == "string")
|
|
1583
|
+
t.issues.push(R(u, t.value, n));
|
|
1552
1584
|
else {
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1585
|
+
const s = u;
|
|
1586
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(R(s));
|
|
1555
1587
|
}
|
|
1556
1588
|
};
|
|
1557
1589
|
const o = n.transform(t.value, t);
|
|
1558
|
-
return o instanceof Promise ? o.then((
|
|
1590
|
+
return o instanceof Promise ? o.then((u) => (t.value = u, t)) : (t.value = o, t);
|
|
1559
1591
|
};
|
|
1560
1592
|
});
|
|
1561
1593
|
function Lt(e) {
|
|
@@ -1565,7 +1597,7 @@ function Lt(e) {
|
|
|
1565
1597
|
});
|
|
1566
1598
|
}
|
|
1567
1599
|
const Ve = /* @__PURE__ */ a("ZodOptional", (e, n) => {
|
|
1568
|
-
|
|
1600
|
+
Bn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1569
1601
|
});
|
|
1570
1602
|
function we(e) {
|
|
1571
1603
|
return new Ve({
|
|
@@ -1574,7 +1606,7 @@ function we(e) {
|
|
|
1574
1606
|
});
|
|
1575
1607
|
}
|
|
1576
1608
|
const Gt = /* @__PURE__ */ a("ZodNullable", (e, n) => {
|
|
1577
|
-
|
|
1609
|
+
Xn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1578
1610
|
});
|
|
1579
1611
|
function ye(e) {
|
|
1580
1612
|
return new Gt({
|
|
@@ -1583,7 +1615,7 @@ function ye(e) {
|
|
|
1583
1615
|
});
|
|
1584
1616
|
}
|
|
1585
1617
|
const Jt = /* @__PURE__ */ a("ZodDefault", (e, n) => {
|
|
1586
|
-
|
|
1618
|
+
Wn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1587
1619
|
});
|
|
1588
1620
|
function Kt(e, n) {
|
|
1589
1621
|
return new Jt({
|
|
@@ -1597,7 +1629,7 @@ function Kt(e, n) {
|
|
|
1597
1629
|
const Yt = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
|
|
1598
1630
|
Qn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1599
1631
|
});
|
|
1600
|
-
function
|
|
1632
|
+
function Ht(e, n) {
|
|
1601
1633
|
return new Yt({
|
|
1602
1634
|
type: "prefault",
|
|
1603
1635
|
innerType: e,
|
|
@@ -1609,28 +1641,28 @@ function qt(e, n) {
|
|
|
1609
1641
|
const Le = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
|
|
1610
1642
|
et.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1611
1643
|
});
|
|
1612
|
-
function
|
|
1644
|
+
function qt(e, n) {
|
|
1613
1645
|
return new Le({
|
|
1614
1646
|
type: "nonoptional",
|
|
1615
1647
|
innerType: e,
|
|
1616
1648
|
...p(n)
|
|
1617
1649
|
});
|
|
1618
1650
|
}
|
|
1619
|
-
const
|
|
1651
|
+
const Bt = /* @__PURE__ */ a("ZodCatch", (e, n) => {
|
|
1620
1652
|
nt.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1621
1653
|
});
|
|
1622
|
-
function
|
|
1623
|
-
return new
|
|
1654
|
+
function Xt(e, n) {
|
|
1655
|
+
return new Bt({
|
|
1624
1656
|
type: "catch",
|
|
1625
1657
|
innerType: e,
|
|
1626
1658
|
catchValue: typeof n == "function" ? n : () => n
|
|
1627
1659
|
});
|
|
1628
1660
|
}
|
|
1629
|
-
const
|
|
1661
|
+
const Wt = /* @__PURE__ */ a("ZodPipe", (e, n) => {
|
|
1630
1662
|
tt.init(e, n), g.init(e, n), e.in = n.in, e.out = n.out;
|
|
1631
1663
|
});
|
|
1632
1664
|
function ke(e, n) {
|
|
1633
|
-
return new
|
|
1665
|
+
return new Wt({
|
|
1634
1666
|
type: "pipe",
|
|
1635
1667
|
in: e,
|
|
1636
1668
|
out: n
|
|
@@ -1655,14 +1687,14 @@ function tr(e, n = {}) {
|
|
|
1655
1687
|
function rr(e) {
|
|
1656
1688
|
return _t(e);
|
|
1657
1689
|
}
|
|
1658
|
-
const
|
|
1690
|
+
const pr = (e) => Fe({
|
|
1659
1691
|
pages: Z(),
|
|
1660
1692
|
nextPage: Z().optional(),
|
|
1661
1693
|
totalElements: Z(),
|
|
1662
1694
|
currentPage: Z(),
|
|
1663
1695
|
pageSize: Z(),
|
|
1664
|
-
elements:
|
|
1665
|
-
}),
|
|
1696
|
+
elements: Ue(e)
|
|
1697
|
+
}), mr = Fe({
|
|
1666
1698
|
page: Z(),
|
|
1667
1699
|
pageSize: Z()
|
|
1668
1700
|
});
|
|
@@ -1671,8 +1703,9 @@ export {
|
|
|
1671
1703
|
ir as Failure,
|
|
1672
1704
|
S as Guid,
|
|
1673
1705
|
ur as Ok,
|
|
1674
|
-
|
|
1675
|
-
hr as
|
|
1706
|
+
mr as PageQuery,
|
|
1707
|
+
hr as convertDateInfoToDateRange,
|
|
1708
|
+
pr as createPageSchema,
|
|
1676
1709
|
Ke as formatDate,
|
|
1677
1710
|
dr as formatDateTime,
|
|
1678
1711
|
Ye as formatTime,
|