@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.
- package/dist/index.cjs +14 -22
- package/dist/index.mjs +660 -631
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ft = (e = {}) => e, Mt = (e) => [e, void 0], Vt = (e) => [
|
|
2
2
|
void 0,
|
|
3
3
|
e
|
|
4
4
|
];
|
|
5
|
-
class
|
|
5
|
+
class Dt {
|
|
6
6
|
name;
|
|
7
7
|
constructor() {
|
|
8
8
|
this.name = this.constructor.name;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const Lt = (
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
(e) => (n) => !(n instanceof e)
|
|
14
|
-
),
|
|
14
|
+
), Gt = (
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
(e) => (n) => n instanceof e
|
|
17
|
-
),
|
|
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
|
|
23
|
+
function Yt(e) {
|
|
24
24
|
return new Promise((n) => setTimeout(n, e));
|
|
25
25
|
}
|
|
26
|
-
function
|
|
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
|
|
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
|
|
42
|
-
return `${
|
|
41
|
+
function qt(e, n) {
|
|
42
|
+
return `${Le(e, n)} ${Ge(e, n)}`;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
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" &&
|
|
46
|
+
return typeof e == "string" && Ye.test(e);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
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
|
|
54
|
+
const z = [];
|
|
55
55
|
for (let e = 0; e < 256; ++e)
|
|
56
|
-
|
|
57
|
-
function
|
|
58
|
-
return (
|
|
59
|
-
}
|
|
60
|
-
let
|
|
61
|
-
const
|
|
62
|
-
function
|
|
63
|
-
if (!
|
|
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
|
-
|
|
66
|
+
G = crypto.getRandomValues.bind(crypto);
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return G(Be);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
function
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
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?.() ??
|
|
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,
|
|
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
|
-
|
|
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(
|
|
92
|
+
return new x(He());
|
|
93
93
|
}
|
|
94
94
|
static empty() {
|
|
95
|
-
return new x(
|
|
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(
|
|
106
|
-
var
|
|
107
|
-
Object.defineProperty(
|
|
108
|
-
value:
|
|
105
|
+
function r(i, a) {
|
|
106
|
+
var l;
|
|
107
|
+
Object.defineProperty(i, "_zod", {
|
|
108
|
+
value: i._zod ?? {},
|
|
109
109
|
enumerable: !1
|
|
110
|
-
}), (
|
|
111
|
-
for (const
|
|
112
|
-
|
|
113
|
-
|
|
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
|
|
120
|
-
var
|
|
121
|
-
const
|
|
122
|
-
r(
|
|
123
|
-
for (const
|
|
124
|
-
|
|
125
|
-
return
|
|
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(
|
|
128
|
-
value: (
|
|
129
|
-
}), Object.defineProperty(
|
|
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
|
|
137
|
+
function E(e) {
|
|
138
138
|
return ke;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
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
|
|
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
|
|
157
|
+
function W(e) {
|
|
158
158
|
return e == null;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
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
|
|
165
|
-
const t = (e.toString().split(".")[1] || "").length, r =
|
|
166
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
182
|
+
set(o) {
|
|
177
183
|
Object.defineProperty(e, n, {
|
|
178
|
-
value:
|
|
184
|
+
value: o
|
|
179
185
|
// configurable: true,
|
|
180
186
|
});
|
|
181
187
|
},
|
|
182
188
|
configurable: !0
|
|
183
189
|
});
|
|
184
190
|
}
|
|
185
|
-
function
|
|
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
|
|
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 =
|
|
213
|
+
const Ze = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
197
214
|
};
|
|
198
|
-
function
|
|
215
|
+
function J(e) {
|
|
199
216
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
200
217
|
}
|
|
201
|
-
const
|
|
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
|
|
212
|
-
if (
|
|
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 !(
|
|
235
|
+
return !(J(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
219
236
|
}
|
|
220
|
-
|
|
221
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
252
|
-
const t =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
|
265
|
-
const t =
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
|
278
|
-
if (!
|
|
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
|
|
307
|
+
return O(this, "shape", r), r;
|
|
285
308
|
},
|
|
286
309
|
checks: []
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return N(e, t);
|
|
310
|
+
});
|
|
311
|
+
return T(e, t);
|
|
290
312
|
}
|
|
291
|
-
function
|
|
292
|
-
|
|
293
|
-
...e._zod.def,
|
|
313
|
+
function fn(e, n) {
|
|
314
|
+
const t = I(e._zod.def, {
|
|
294
315
|
get shape() {
|
|
295
|
-
const
|
|
296
|
-
return
|
|
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
|
|
304
|
-
const r = n._zod.def
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
|
327
|
-
const r = n._zod.def
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
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
|
|
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
|
|
389
|
+
function C(e) {
|
|
363
390
|
return typeof e == "string" ? e : e?.message;
|
|
364
391
|
}
|
|
365
|
-
function
|
|
392
|
+
function N(e, n, t) {
|
|
366
393
|
const r = { ...e, path: e.path ?? [] };
|
|
367
394
|
if (!e.message) {
|
|
368
|
-
const o =
|
|
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
|
|
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
|
|
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, "
|
|
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
|
-
},
|
|
403
|
-
function
|
|
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
|
|
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
|
|
414
|
-
if (
|
|
415
|
-
|
|
416
|
-
else if (
|
|
417
|
-
o({ issues:
|
|
418
|
-
else if (
|
|
419
|
-
o({ issues:
|
|
420
|
-
else if (
|
|
421
|
-
r._errors.push(t(
|
|
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
|
|
424
|
-
for (;
|
|
425
|
-
const
|
|
426
|
-
|
|
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
|
|
433
|
-
const u = r ? Object.assign(r, { async: !1 }) : { async: !1 },
|
|
434
|
-
if (
|
|
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 (
|
|
437
|
-
const
|
|
438
|
-
throw Ze(
|
|
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
|
|
441
|
-
},
|
|
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
|
|
444
|
-
if (
|
|
445
|
-
const
|
|
446
|
-
throw Ze(
|
|
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
|
|
449
|
-
},
|
|
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 ??
|
|
476
|
+
error: new (e ?? Oe)(u.issues.map((s) => N(s, o, E())))
|
|
456
477
|
} : { success: !0, data: u.value };
|
|
457
|
-
},
|
|
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((
|
|
483
|
+
error: new e(u.issues.map((s) => N(s, o, E())))
|
|
463
484
|
} : { success: !0, data: u.value };
|
|
464
|
-
},
|
|
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
|
-
}),
|
|
488
|
+
}), je = {
|
|
468
489
|
number: "number",
|
|
469
490
|
bigint: "bigint",
|
|
470
491
|
object: "date"
|
|
471
|
-
},
|
|
492
|
+
}, Se = /* @__PURE__ */ c("$ZodCheckLessThan", (e, n) => {
|
|
472
493
|
$.init(e, n);
|
|
473
|
-
const t =
|
|
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
|
-
}),
|
|
509
|
+
}), Ae = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, n) => {
|
|
489
510
|
$.init(e, n);
|
|
490
|
-
const t =
|
|
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
|
-
}),
|
|
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) :
|
|
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
|
-
}),
|
|
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] =
|
|
524
|
-
e._zod.onattach.push((
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
}), e._zod.check = (
|
|
528
|
-
const
|
|
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(
|
|
531
|
-
|
|
551
|
+
if (!Number.isInteger(i)) {
|
|
552
|
+
s.issues.push({
|
|
532
553
|
expected: r,
|
|
533
554
|
format: n.format,
|
|
534
555
|
code: "invalid_type",
|
|
535
|
-
|
|
556
|
+
continue: !1,
|
|
557
|
+
input: i,
|
|
536
558
|
inst: e
|
|
537
559
|
});
|
|
538
560
|
return;
|
|
539
561
|
}
|
|
540
|
-
if (!Number.isSafeInteger(
|
|
541
|
-
|
|
542
|
-
input:
|
|
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
|
-
}) :
|
|
550
|
-
input:
|
|
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
|
-
|
|
583
|
+
i < o && s.issues.push({
|
|
562
584
|
origin: "number",
|
|
563
|
-
input:
|
|
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
|
-
}),
|
|
591
|
+
}), i > u && s.issues.push({
|
|
570
592
|
origin: "number",
|
|
571
|
-
input:
|
|
593
|
+
input: i,
|
|
572
594
|
code: "too_big",
|
|
573
595
|
maximum: u,
|
|
574
596
|
inst: e
|
|
575
597
|
});
|
|
576
598
|
};
|
|
577
|
-
}),
|
|
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 !
|
|
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
|
|
611
|
+
const s = Q(o);
|
|
590
612
|
r.issues.push({
|
|
591
|
-
origin:
|
|
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
|
-
}),
|
|
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 !
|
|
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
|
|
634
|
+
const s = Q(o);
|
|
613
635
|
r.issues.push({
|
|
614
|
-
origin:
|
|
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
|
-
}),
|
|
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 !
|
|
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
|
|
657
|
+
const s = Q(o), i = u > n.length;
|
|
636
658
|
r.issues.push({
|
|
637
|
-
origin:
|
|
638
|
-
...
|
|
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
|
-
}),
|
|
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
|
|
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((
|
|
665
|
-
for (const
|
|
666
|
-
this.content.push(
|
|
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
|
|
696
|
+
const On = {
|
|
675
697
|
major: 4,
|
|
676
698
|
minor: 0,
|
|
677
|
-
patch:
|
|
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 =
|
|
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,
|
|
692
|
-
let
|
|
693
|
-
for (const
|
|
694
|
-
if (
|
|
695
|
-
if (!
|
|
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 (
|
|
719
|
+
} else if (a)
|
|
698
720
|
continue;
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
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 (
|
|
703
|
-
|
|
704
|
-
await
|
|
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 ===
|
|
729
|
+
if (u.issues.length === f)
|
|
708
730
|
continue;
|
|
709
|
-
|
|
731
|
+
a || (a = j(u, f));
|
|
710
732
|
}
|
|
711
733
|
}
|
|
712
|
-
return
|
|
734
|
+
return l ? l.then(() => u) : u;
|
|
713
735
|
};
|
|
714
|
-
e._zod.run = (u,
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
717
|
-
if (
|
|
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
|
|
741
|
+
return i.then((a) => o(a, r, s));
|
|
720
742
|
}
|
|
721
|
-
return o(
|
|
743
|
+
return o(i, r, s);
|
|
722
744
|
};
|
|
723
745
|
}
|
|
724
746
|
e["~standard"] = {
|
|
725
747
|
validate: (o) => {
|
|
726
748
|
try {
|
|
727
|
-
const u =
|
|
749
|
+
const u = vn(e, o);
|
|
728
750
|
return u.success ? { value: u.data } : { issues: u.error?.issues };
|
|
729
751
|
} catch {
|
|
730
|
-
return
|
|
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
|
-
}),
|
|
737
|
-
_.init(e, n), e._zod.pattern = e._zod.bag.pattern ??
|
|
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
|
-
}),
|
|
756
|
-
|
|
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
|
-
}),
|
|
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(...
|
|
790
|
+
e.issues.length && n.issues.push(...Ee(t, e.issues)), n.value[t] = e.value;
|
|
769
791
|
}
|
|
770
|
-
const
|
|
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
|
|
783
|
-
const
|
|
784
|
-
value:
|
|
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
|
-
|
|
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
|
|
793
|
-
e.issues.length && n.issues.push(...
|
|
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
|
|
817
|
+
const Sn = /* @__PURE__ */ c("$ZodObject", (e, n) => {
|
|
799
818
|
_.init(e, n);
|
|
800
819
|
const t = $e(() => {
|
|
801
|
-
const
|
|
802
|
-
for (const d of
|
|
803
|
-
if (!
|
|
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
|
|
824
|
+
const h = un(n.shape);
|
|
806
825
|
return {
|
|
807
826
|
shape: n.shape,
|
|
808
|
-
keys:
|
|
809
|
-
keySet: new Set(
|
|
810
|
-
numKeys:
|
|
811
|
-
optionalKeys: new Set(
|
|
827
|
+
keys: f,
|
|
828
|
+
keySet: new Set(f),
|
|
829
|
+
numKeys: f.length,
|
|
830
|
+
optionalKeys: new Set(h)
|
|
812
831
|
};
|
|
813
832
|
});
|
|
814
|
-
|
|
815
|
-
const
|
|
816
|
-
for (const d in
|
|
817
|
-
const
|
|
818
|
-
if (
|
|
819
|
-
|
|
820
|
-
for (const Z of
|
|
821
|
-
|
|
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
|
|
843
|
+
return h;
|
|
825
844
|
});
|
|
826
|
-
const r = (
|
|
827
|
-
const
|
|
828
|
-
const
|
|
829
|
-
return `shape[${
|
|
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
|
-
|
|
850
|
+
h.write("const input = payload.value;");
|
|
832
851
|
const Z = /* @__PURE__ */ Object.create(null);
|
|
833
852
|
let D = 0;
|
|
834
|
-
for (const
|
|
835
|
-
Z[
|
|
836
|
-
|
|
837
|
-
for (const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
}
|
|
849
|
-
|
|
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[${
|
|
871
|
+
newResult[${w}] = ${g}.value;
|
|
860
872
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
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 =
|
|
876
|
-
let
|
|
877
|
-
e._zod.parse = (
|
|
878
|
-
|
|
879
|
-
const d =
|
|
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
|
|
886
|
+
return f.issues.push({
|
|
882
887
|
expected: "object",
|
|
883
888
|
code: "invalid_type",
|
|
884
889
|
input: d,
|
|
885
890
|
inst: e
|
|
886
|
-
}),
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
889
|
-
o || (o = r(n.shape)),
|
|
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
|
-
|
|
892
|
-
const
|
|
893
|
-
for (const
|
|
894
|
-
const
|
|
895
|
-
|
|
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 (!
|
|
899
|
-
return
|
|
900
|
-
const Z = [], D =
|
|
901
|
-
for (const
|
|
902
|
-
if (D.has(
|
|
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 (
|
|
905
|
-
Z.push(
|
|
909
|
+
if (k === "never") {
|
|
910
|
+
Z.push(g);
|
|
906
911
|
continue;
|
|
907
912
|
}
|
|
908
|
-
const
|
|
909
|
-
|
|
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 &&
|
|
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
|
-
}),
|
|
921
|
+
}), y.length ? Promise.all(y).then(() => f) : f;
|
|
917
922
|
};
|
|
918
923
|
});
|
|
919
|
-
function
|
|
920
|
-
for (const
|
|
921
|
-
if (
|
|
922
|
-
return n.value =
|
|
923
|
-
|
|
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((
|
|
928
|
-
}), n;
|
|
929
|
-
}
|
|
930
|
-
const
|
|
931
|
-
_.init(e, n),
|
|
932
|
-
if (n.options.every((
|
|
933
|
-
return new Set(n.options.flatMap((
|
|
934
|
-
}),
|
|
935
|
-
if (n.options.every((
|
|
936
|
-
const
|
|
937
|
-
return new RegExp(`^(${
|
|
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
|
-
})
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
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
|
-
},
|
|
947
|
-
if (
|
|
948
|
-
|
|
956
|
+
}, u);
|
|
957
|
+
if (l instanceof Promise)
|
|
958
|
+
i.push(l), s = !0;
|
|
949
959
|
else {
|
|
950
|
-
if (
|
|
951
|
-
return
|
|
952
|
-
|
|
960
|
+
if (l.issues.length === 0)
|
|
961
|
+
return l;
|
|
962
|
+
i.push(l);
|
|
953
963
|
}
|
|
954
964
|
}
|
|
955
|
-
return
|
|
965
|
+
return s ? Promise.all(i).then((a) => ue(a, o, e, u)) : ue(i, o, e, u);
|
|
956
966
|
};
|
|
957
|
-
}),
|
|
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),
|
|
960
|
-
return u instanceof Promise ||
|
|
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 (
|
|
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
|
|
972
|
-
if (!
|
|
981
|
+
const s = B(e[u], n[u]);
|
|
982
|
+
if (!s.valid)
|
|
973
983
|
return {
|
|
974
984
|
valid: !1,
|
|
975
|
-
mergeErrorPath: [u, ...
|
|
985
|
+
mergeErrorPath: [u, ...s.mergeErrorPath]
|
|
976
986
|
};
|
|
977
|
-
o[u] =
|
|
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],
|
|
987
|
-
if (!
|
|
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, ...
|
|
1000
|
+
mergeErrorPath: [r, ...s.mergeErrorPath]
|
|
991
1001
|
};
|
|
992
|
-
t.push(
|
|
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
|
|
1016
|
+
const Cn = /* @__PURE__ */ c("$ZodEnum", (e, n) => {
|
|
1007
1017
|
_.init(e, n);
|
|
1008
|
-
const t =
|
|
1009
|
-
e._zod.values =
|
|
1010
|
-
const
|
|
1011
|
-
return
|
|
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:
|
|
1024
|
+
input: s,
|
|
1015
1025
|
inst: e
|
|
1016
|
-
}),
|
|
1026
|
+
}), o;
|
|
1017
1027
|
};
|
|
1018
|
-
}),
|
|
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((
|
|
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
|
-
})
|
|
1028
|
-
|
|
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(`^(${
|
|
1031
|
-
}), e._zod.parse = (t, r) =>
|
|
1032
|
-
|
|
1033
|
-
|
|
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(`^(${
|
|
1036
|
-
}),
|
|
1037
|
-
}),
|
|
1038
|
-
_.init(e, n), e._zod.optin = "optional",
|
|
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
|
|
1049
|
-
_.init(e, n), e._zod.optin = "optional",
|
|
1050
|
-
}),
|
|
1051
|
-
_.init(e, n),
|
|
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
|
|
1068
|
-
_.init(e, n), e._zod
|
|
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((
|
|
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) =>
|
|
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
|
-
}),
|
|
1085
|
-
_.init(e, n),
|
|
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
|
|
1111
|
+
return e.issues.length ? e : n.out._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1092
1112
|
}
|
|
1093
|
-
const
|
|
1094
|
-
_.init(e, n),
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
1158
|
-
return new
|
|
1179
|
+
function Bn() {
|
|
1180
|
+
return new Jn();
|
|
1159
1181
|
}
|
|
1160
|
-
const
|
|
1161
|
-
function
|
|
1182
|
+
const F = /* @__PURE__ */ Bn();
|
|
1183
|
+
function Xn(e, n) {
|
|
1162
1184
|
return new e({
|
|
1163
1185
|
type: "number",
|
|
1164
1186
|
checks: [],
|
|
1165
|
-
...
|
|
1187
|
+
...m(n)
|
|
1166
1188
|
});
|
|
1167
1189
|
}
|
|
1168
|
-
function
|
|
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
|
-
...
|
|
1196
|
+
...m(n)
|
|
1175
1197
|
});
|
|
1176
1198
|
}
|
|
1177
|
-
function
|
|
1199
|
+
function Hn(e) {
|
|
1178
1200
|
return new e({
|
|
1179
1201
|
type: "unknown"
|
|
1180
1202
|
});
|
|
1181
1203
|
}
|
|
1182
|
-
function
|
|
1204
|
+
function Qn(e, n) {
|
|
1183
1205
|
return new e({
|
|
1184
1206
|
type: "never",
|
|
1185
|
-
...
|
|
1207
|
+
...m(n)
|
|
1186
1208
|
});
|
|
1187
1209
|
}
|
|
1188
1210
|
function he(e, n) {
|
|
1189
|
-
return new
|
|
1211
|
+
return new Se({
|
|
1190
1212
|
check: "less_than",
|
|
1191
|
-
...
|
|
1213
|
+
...m(n),
|
|
1192
1214
|
value: e,
|
|
1193
1215
|
inclusive: !1
|
|
1194
1216
|
});
|
|
1195
1217
|
}
|
|
1196
|
-
function
|
|
1197
|
-
return new
|
|
1218
|
+
function K(e, n) {
|
|
1219
|
+
return new Se({
|
|
1198
1220
|
check: "less_than",
|
|
1199
|
-
...
|
|
1221
|
+
...m(n),
|
|
1200
1222
|
value: e,
|
|
1201
1223
|
inclusive: !0
|
|
1202
1224
|
});
|
|
1203
1225
|
}
|
|
1204
1226
|
function de(e, n) {
|
|
1205
|
-
return new
|
|
1227
|
+
return new Ae({
|
|
1206
1228
|
check: "greater_than",
|
|
1207
|
-
...
|
|
1229
|
+
...m(n),
|
|
1208
1230
|
value: e,
|
|
1209
1231
|
inclusive: !1
|
|
1210
1232
|
});
|
|
1211
1233
|
}
|
|
1212
|
-
function
|
|
1213
|
-
return new
|
|
1234
|
+
function Y(e, n) {
|
|
1235
|
+
return new Ae({
|
|
1214
1236
|
check: "greater_than",
|
|
1215
|
-
...
|
|
1237
|
+
...m(n),
|
|
1216
1238
|
value: e,
|
|
1217
1239
|
inclusive: !0
|
|
1218
1240
|
});
|
|
1219
1241
|
}
|
|
1220
1242
|
function me(e, n) {
|
|
1221
|
-
return new
|
|
1243
|
+
return new yn({
|
|
1222
1244
|
check: "multiple_of",
|
|
1223
|
-
...
|
|
1245
|
+
...m(n),
|
|
1224
1246
|
value: e
|
|
1225
1247
|
});
|
|
1226
1248
|
}
|
|
1227
|
-
function
|
|
1228
|
-
return new
|
|
1249
|
+
function et(e, n) {
|
|
1250
|
+
return new $n({
|
|
1229
1251
|
check: "max_length",
|
|
1230
|
-
...
|
|
1252
|
+
...m(n),
|
|
1231
1253
|
maximum: e
|
|
1232
1254
|
});
|
|
1233
1255
|
}
|
|
1234
1256
|
function _e(e, n) {
|
|
1235
|
-
return new
|
|
1257
|
+
return new Zn({
|
|
1236
1258
|
check: "min_length",
|
|
1237
|
-
...
|
|
1259
|
+
...m(n),
|
|
1238
1260
|
minimum: e
|
|
1239
1261
|
});
|
|
1240
1262
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return new
|
|
1263
|
+
function nt(e, n) {
|
|
1264
|
+
return new Pn({
|
|
1243
1265
|
check: "length_equals",
|
|
1244
|
-
...
|
|
1266
|
+
...m(n),
|
|
1245
1267
|
length: e
|
|
1246
1268
|
});
|
|
1247
1269
|
}
|
|
1248
|
-
function
|
|
1249
|
-
return new
|
|
1270
|
+
function tt(e) {
|
|
1271
|
+
return new En({
|
|
1250
1272
|
check: "overwrite",
|
|
1251
1273
|
tx: e
|
|
1252
1274
|
});
|
|
1253
1275
|
}
|
|
1254
|
-
function
|
|
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
|
-
...
|
|
1283
|
+
...m(t)
|
|
1262
1284
|
});
|
|
1263
1285
|
}
|
|
1264
|
-
function
|
|
1286
|
+
function ot(e, n, t) {
|
|
1265
1287
|
return new e({
|
|
1266
1288
|
type: "custom",
|
|
1267
1289
|
check: "custom",
|
|
1268
1290
|
fn: n,
|
|
1269
|
-
...
|
|
1291
|
+
...m(t)
|
|
1270
1292
|
});
|
|
1271
1293
|
}
|
|
1272
|
-
|
|
1273
|
-
|
|
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) =>
|
|
1315
|
+
value: (t) => mn(e, t)
|
|
1276
1316
|
// enumerable: false,
|
|
1277
1317
|
},
|
|
1278
1318
|
flatten: {
|
|
1279
|
-
value: (t) =>
|
|
1319
|
+
value: (t) => dn(e, t)
|
|
1280
1320
|
// enumerable: false,
|
|
1281
1321
|
},
|
|
1282
1322
|
addIssue: {
|
|
1283
|
-
value: (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) =>
|
|
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",
|
|
1341
|
+
}, V = c("ZodError", it, {
|
|
1298
1342
|
Parent: Error
|
|
1299
|
-
}),
|
|
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) =>
|
|
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
|
|
1354
|
+
return F.add(r, { description: t }), r;
|
|
1311
1355
|
}, Object.defineProperty(e, "description", {
|
|
1312
1356
|
get() {
|
|
1313
|
-
return
|
|
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
|
|
1362
|
+
return F.get(e);
|
|
1319
1363
|
const r = e.clone();
|
|
1320
|
-
return
|
|
1321
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
1322
|
-
|
|
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
|
|
1327
|
-
return
|
|
1370
|
+
function P(e) {
|
|
1371
|
+
return Xn(Ce, e);
|
|
1328
1372
|
}
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1373
|
+
const pt = /* @__PURE__ */ c("ZodNumberFormat", (e, n) => {
|
|
1374
|
+
Tn.init(e, n), Ce.init(e, n);
|
|
1331
1375
|
});
|
|
1332
|
-
function
|
|
1333
|
-
return
|
|
1376
|
+
function ge(e) {
|
|
1377
|
+
return Wn(pt, e);
|
|
1334
1378
|
}
|
|
1335
|
-
const
|
|
1336
|
-
In.init(e, n),
|
|
1379
|
+
const ht = /* @__PURE__ */ c("ZodUnknown", (e, n) => {
|
|
1380
|
+
In.init(e, n), v.init(e, n);
|
|
1337
1381
|
});
|
|
1338
|
-
function
|
|
1339
|
-
return
|
|
1382
|
+
function ve() {
|
|
1383
|
+
return Hn(ht);
|
|
1340
1384
|
}
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1385
|
+
const dt = /* @__PURE__ */ c("ZodNever", (e, n) => {
|
|
1386
|
+
xn.init(e, n), v.init(e, n);
|
|
1343
1387
|
});
|
|
1344
|
-
function
|
|
1345
|
-
return
|
|
1388
|
+
function mt(e) {
|
|
1389
|
+
return Qn(dt, e);
|
|
1346
1390
|
}
|
|
1347
|
-
const
|
|
1348
|
-
|
|
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
|
|
1351
|
-
return
|
|
1394
|
+
function Ue(e, n) {
|
|
1395
|
+
return rt(_t, e, n);
|
|
1352
1396
|
}
|
|
1353
|
-
const
|
|
1354
|
-
|
|
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
|
|
1400
|
+
function Fe(e, n) {
|
|
1357
1401
|
const t = {
|
|
1358
1402
|
type: "object",
|
|
1359
1403
|
get shape() {
|
|
1360
|
-
return
|
|
1404
|
+
return O(this, "shape", e ? nn(e) : {}), this.shape;
|
|
1361
1405
|
},
|
|
1362
|
-
...
|
|
1406
|
+
...m(n)
|
|
1363
1407
|
};
|
|
1364
|
-
return new
|
|
1408
|
+
return new gt(t);
|
|
1365
1409
|
}
|
|
1366
|
-
const
|
|
1367
|
-
|
|
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
|
|
1370
|
-
return new
|
|
1413
|
+
function zt(e, n) {
|
|
1414
|
+
return new vt({
|
|
1371
1415
|
type: "union",
|
|
1372
1416
|
options: e,
|
|
1373
|
-
...
|
|
1417
|
+
...m(n)
|
|
1374
1418
|
});
|
|
1375
1419
|
}
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1420
|
+
const bt = /* @__PURE__ */ c("ZodIntersection", (e, n) => {
|
|
1421
|
+
Rn.init(e, n), v.init(e, n);
|
|
1378
1422
|
});
|
|
1379
|
-
function
|
|
1380
|
-
return new
|
|
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
|
-
|
|
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
|
|
1392
|
-
if (t.has(
|
|
1393
|
-
u[
|
|
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 ${
|
|
1439
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
1396
1440
|
return new X({
|
|
1397
1441
|
...n,
|
|
1398
1442
|
checks: [],
|
|
1399
|
-
...
|
|
1443
|
+
...m(o),
|
|
1400
1444
|
entries: u
|
|
1401
1445
|
});
|
|
1402
1446
|
}, e.exclude = (r, o) => {
|
|
1403
1447
|
const u = { ...n.entries };
|
|
1404
|
-
for (const
|
|
1405
|
-
if (t.has(
|
|
1406
|
-
delete u[
|
|
1448
|
+
for (const s of r)
|
|
1449
|
+
if (t.has(s))
|
|
1450
|
+
delete u[s];
|
|
1407
1451
|
else
|
|
1408
|
-
throw new Error(`Key ${
|
|
1452
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
1409
1453
|
return new X({
|
|
1410
1454
|
...n,
|
|
1411
1455
|
checks: [],
|
|
1412
|
-
...
|
|
1456
|
+
...m(o),
|
|
1413
1457
|
entries: u
|
|
1414
1458
|
});
|
|
1415
1459
|
};
|
|
1416
1460
|
});
|
|
1417
|
-
function
|
|
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
|
-
...
|
|
1466
|
+
...m(n)
|
|
1423
1467
|
});
|
|
1424
1468
|
}
|
|
1425
|
-
const
|
|
1426
|
-
|
|
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
|
|
1432
|
-
|
|
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
|
|
1440
|
-
return new
|
|
1483
|
+
function $t(e) {
|
|
1484
|
+
return new kt({
|
|
1441
1485
|
type: "transform",
|
|
1442
1486
|
transform: e
|
|
1443
1487
|
});
|
|
1444
1488
|
}
|
|
1445
|
-
const
|
|
1446
|
-
|
|
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
|
|
1493
|
+
return new Me({
|
|
1450
1494
|
type: "optional",
|
|
1451
1495
|
innerType: e
|
|
1452
1496
|
});
|
|
1453
1497
|
}
|
|
1454
|
-
const
|
|
1455
|
-
|
|
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
|
|
1458
|
-
return new
|
|
1501
|
+
function be(e) {
|
|
1502
|
+
return new Zt({
|
|
1459
1503
|
type: "nullable",
|
|
1460
1504
|
innerType: e
|
|
1461
1505
|
});
|
|
1462
1506
|
}
|
|
1463
|
-
const
|
|
1464
|
-
|
|
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
|
|
1467
|
-
return new
|
|
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
|
|
1476
|
-
|
|
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
|
|
1479
|
-
return new
|
|
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
|
|
1488
|
-
|
|
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
|
|
1491
|
-
return new
|
|
1534
|
+
function Tt(e, n) {
|
|
1535
|
+
return new Ve({
|
|
1492
1536
|
type: "nonoptional",
|
|
1493
1537
|
innerType: e,
|
|
1494
|
-
...
|
|
1538
|
+
...m(n)
|
|
1495
1539
|
});
|
|
1496
1540
|
}
|
|
1497
|
-
const
|
|
1498
|
-
|
|
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
|
|
1501
|
-
return new
|
|
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
|
|
1508
|
-
|
|
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
|
|
1511
|
-
return new
|
|
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
|
|
1519
|
-
|
|
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
|
|
1522
|
-
return new
|
|
1565
|
+
function At(e) {
|
|
1566
|
+
return new St({
|
|
1523
1567
|
type: "readonly",
|
|
1524
1568
|
innerType: e
|
|
1525
1569
|
});
|
|
1526
1570
|
}
|
|
1527
|
-
const
|
|
1528
|
-
|
|
1571
|
+
const Rt = /* @__PURE__ */ c("ZodCustom", (e, n) => {
|
|
1572
|
+
qn.init(e, n), v.init(e, n);
|
|
1529
1573
|
});
|
|
1530
|
-
function
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
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
|
-
|
|
1564
|
-
|
|
1592
|
+
Vt as Fail,
|
|
1593
|
+
Dt as Failure,
|
|
1565
1594
|
x as Guid,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
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
|
};
|