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