@connectedxm/zpl-generator 0.0.22 → 0.0.24
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.es.js +564 -553
- package/dist/src/generate.d.ts +1 -1
- package/dist/src/validate.d.ts +8 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -11,8 +11,8 @@ function u(e, t, n) {
|
|
|
11
11
|
return;
|
|
12
12
|
c._zod.traits.add(e), t(c, a);
|
|
13
13
|
const l = i.prototype, f = Object.keys(l);
|
|
14
|
-
for (let
|
|
15
|
-
const p = f[
|
|
14
|
+
for (let d = 0; d < f.length; d++) {
|
|
15
|
+
const p = f[d];
|
|
16
16
|
p in c || (c[p] = l[p].bind(c));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -37,23 +37,23 @@ class L extends Error {
|
|
|
37
37
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
class
|
|
40
|
+
class Ye extends Error {
|
|
41
41
|
constructor(t) {
|
|
42
42
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
function
|
|
47
|
-
return
|
|
45
|
+
const Ge = {};
|
|
46
|
+
function j(e) {
|
|
47
|
+
return Ge;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Ke(e) {
|
|
50
50
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
51
51
|
return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function me(e, t) {
|
|
54
54
|
return typeof t == "bigint" ? t.toString() : t;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function se(e) {
|
|
57
57
|
return {
|
|
58
58
|
get value() {
|
|
59
59
|
{
|
|
@@ -63,10 +63,10 @@ function ce(e) {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ve(e) {
|
|
67
67
|
return e == null;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function be(e) {
|
|
70
70
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
71
71
|
return e.slice(t, n);
|
|
72
72
|
}
|
|
@@ -80,13 +80,13 @@ function xt(e, t) {
|
|
|
80
80
|
const s = n > o ? n : o, i = Number.parseInt(e.toFixed(s).replace(".", "")), c = Number.parseInt(t.toFixed(s).replace(".", ""));
|
|
81
81
|
return i % c / 10 ** s;
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const ke = /* @__PURE__ */ Symbol("evaluating");
|
|
84
84
|
function g(e, t, n) {
|
|
85
85
|
let r;
|
|
86
86
|
Object.defineProperty(e, t, {
|
|
87
87
|
get() {
|
|
88
|
-
if (r !==
|
|
89
|
-
return r === void 0 && (r =
|
|
88
|
+
if (r !== ke)
|
|
89
|
+
return r === void 0 && (r = ke, r = n()), r;
|
|
90
90
|
},
|
|
91
91
|
set(o) {
|
|
92
92
|
Object.defineProperty(e, t, {
|
|
@@ -97,7 +97,7 @@ function g(e, t, n) {
|
|
|
97
97
|
configurable: !0
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function D(e, t, n) {
|
|
101
101
|
Object.defineProperty(e, t, {
|
|
102
102
|
value: n,
|
|
103
103
|
writable: !0,
|
|
@@ -113,18 +113,18 @@ function P(...e) {
|
|
|
113
113
|
}
|
|
114
114
|
return Object.defineProperties({}, t);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Se(e) {
|
|
117
117
|
return JSON.stringify(e);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Rt(e) {
|
|
120
120
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
121
121
|
}
|
|
122
|
-
const
|
|
122
|
+
const Xe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
123
123
|
};
|
|
124
124
|
function B(e) {
|
|
125
125
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const jt = se(() => {
|
|
128
128
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
129
129
|
return !1;
|
|
130
130
|
try {
|
|
@@ -143,10 +143,10 @@ function V(e) {
|
|
|
143
143
|
const n = t.prototype;
|
|
144
144
|
return !(B(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function qe(e) {
|
|
147
147
|
return V(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const Ct = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
150
150
|
function M(e) {
|
|
151
151
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
152
152
|
}
|
|
@@ -154,7 +154,7 @@ function x(e, t, n) {
|
|
|
154
154
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
155
155
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function h(e) {
|
|
158
158
|
const t = e;
|
|
159
159
|
if (!t)
|
|
160
160
|
return {};
|
|
@@ -167,10 +167,10 @@ function d(e) {
|
|
|
167
167
|
}
|
|
168
168
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function Dt(e) {
|
|
171
171
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
172
172
|
}
|
|
173
|
-
const
|
|
173
|
+
const Ft = {
|
|
174
174
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
175
175
|
int32: [-2147483648, 2147483647],
|
|
176
176
|
uint32: [0, 4294967295],
|
|
@@ -189,7 +189,7 @@ function Lt(e, t) {
|
|
|
189
189
|
throw new Error(`Unrecognized key: "${c}"`);
|
|
190
190
|
t[c] && (i[c] = n.shape[c]);
|
|
191
191
|
}
|
|
192
|
-
return
|
|
192
|
+
return D(this, "shape", i), i;
|
|
193
193
|
},
|
|
194
194
|
checks: []
|
|
195
195
|
});
|
|
@@ -207,7 +207,7 @@ function Mt(e, t) {
|
|
|
207
207
|
throw new Error(`Unrecognized key: "${c}"`);
|
|
208
208
|
t[c] && delete i[c];
|
|
209
209
|
}
|
|
210
|
-
return
|
|
210
|
+
return D(this, "shape", i), i;
|
|
211
211
|
},
|
|
212
212
|
checks: []
|
|
213
213
|
});
|
|
@@ -226,7 +226,7 @@ function Ut(e, t) {
|
|
|
226
226
|
const o = P(e._zod.def, {
|
|
227
227
|
get shape() {
|
|
228
228
|
const s = { ...e._zod.def.shape, ...t };
|
|
229
|
-
return
|
|
229
|
+
return D(this, "shape", s), s;
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
return x(e, o);
|
|
@@ -237,7 +237,7 @@ function Jt(e, t) {
|
|
|
237
237
|
const n = P(e._zod.def, {
|
|
238
238
|
get shape() {
|
|
239
239
|
const r = { ...e._zod.def.shape, ...t };
|
|
240
|
-
return
|
|
240
|
+
return D(this, "shape", r), r;
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
243
|
return x(e, n);
|
|
@@ -246,7 +246,7 @@ function Wt(e, t) {
|
|
|
246
246
|
const n = P(e._zod.def, {
|
|
247
247
|
get shape() {
|
|
248
248
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
249
|
-
return
|
|
249
|
+
return D(this, "shape", r), r;
|
|
250
250
|
},
|
|
251
251
|
get catchall() {
|
|
252
252
|
return t._zod.def.catchall;
|
|
@@ -278,7 +278,7 @@ function Bt(e, t, n) {
|
|
|
278
278
|
type: "optional",
|
|
279
279
|
innerType: c[l]
|
|
280
280
|
}) : c[l];
|
|
281
|
-
return
|
|
281
|
+
return D(this, "shape", a), a;
|
|
282
282
|
},
|
|
283
283
|
checks: []
|
|
284
284
|
});
|
|
@@ -303,12 +303,12 @@ function Vt(e, t, n) {
|
|
|
303
303
|
type: "nonoptional",
|
|
304
304
|
innerType: o[i]
|
|
305
305
|
});
|
|
306
|
-
return
|
|
306
|
+
return D(this, "shape", s), s;
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
return x(t, r);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function F(e, t = 0) {
|
|
312
312
|
if (e.aborted === !0)
|
|
313
313
|
return !0;
|
|
314
314
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -316,24 +316,24 @@ function D(e, t = 0) {
|
|
|
316
316
|
return !0;
|
|
317
317
|
return !1;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Qe(e, t) {
|
|
320
320
|
return t.map((n) => {
|
|
321
321
|
var r;
|
|
322
322
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function X(e) {
|
|
326
326
|
return typeof e == "string" ? e : e?.message;
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function C(e, t, n) {
|
|
329
329
|
const r = { ...e, path: e.path ?? [] };
|
|
330
330
|
if (!e.message) {
|
|
331
|
-
const o =
|
|
331
|
+
const o = X(e.inst?._zod.def?.error?.(e)) ?? X(t?.error?.(e)) ?? X(n.customError?.(e)) ?? X(n.localeError?.(e)) ?? "Invalid input";
|
|
332
332
|
r.message = o;
|
|
333
333
|
}
|
|
334
334
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function ye(e) {
|
|
337
337
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
338
338
|
}
|
|
339
339
|
function H(...e) {
|
|
@@ -345,18 +345,18 @@ function H(...e) {
|
|
|
345
345
|
inst: r
|
|
346
346
|
} : { ...t };
|
|
347
347
|
}
|
|
348
|
-
const
|
|
348
|
+
const et = (e, t) => {
|
|
349
349
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
350
350
|
value: e._zod,
|
|
351
351
|
enumerable: !1
|
|
352
352
|
}), Object.defineProperty(e, "issues", {
|
|
353
353
|
value: t,
|
|
354
354
|
enumerable: !1
|
|
355
|
-
}), e.message = JSON.stringify(t,
|
|
355
|
+
}), e.message = JSON.stringify(t, me, 2), Object.defineProperty(e, "toString", {
|
|
356
356
|
value: () => e.message,
|
|
357
357
|
enumerable: !1
|
|
358
358
|
});
|
|
359
|
-
},
|
|
359
|
+
}, tt = u("$ZodError", et), nt = u("$ZodError", et, { Parent: Error });
|
|
360
360
|
function Ht(e, t = (n) => n.message) {
|
|
361
361
|
const n = {}, r = [];
|
|
362
362
|
for (const o of e.issues)
|
|
@@ -384,81 +384,81 @@ function Yt(e, t = (n) => n.message) {
|
|
|
384
384
|
};
|
|
385
385
|
return r(e), n;
|
|
386
386
|
}
|
|
387
|
-
const
|
|
387
|
+
const we = (e) => (t, n, r, o) => {
|
|
388
388
|
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
|
|
389
389
|
if (i instanceof Promise)
|
|
390
390
|
throw new L();
|
|
391
391
|
if (i.issues.length) {
|
|
392
|
-
const c = new (o?.Err ?? e)(i.issues.map((a) =>
|
|
393
|
-
throw
|
|
392
|
+
const c = new (o?.Err ?? e)(i.issues.map((a) => C(a, s, j())));
|
|
393
|
+
throw Xe(c, o?.callee), c;
|
|
394
394
|
}
|
|
395
395
|
return i.value;
|
|
396
|
-
},
|
|
396
|
+
}, ze = (e) => async (t, n, r, o) => {
|
|
397
397
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
398
398
|
let i = t._zod.run({ value: n, issues: [] }, s);
|
|
399
399
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
400
|
-
const c = new (o?.Err ?? e)(i.issues.map((a) =>
|
|
401
|
-
throw
|
|
400
|
+
const c = new (o?.Err ?? e)(i.issues.map((a) => C(a, s, j())));
|
|
401
|
+
throw Xe(c, o?.callee), c;
|
|
402
402
|
}
|
|
403
403
|
return i.value;
|
|
404
|
-
},
|
|
404
|
+
}, ce = (e) => (t, n, r) => {
|
|
405
405
|
const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
|
|
406
406
|
if (s instanceof Promise)
|
|
407
407
|
throw new L();
|
|
408
408
|
return s.issues.length ? {
|
|
409
409
|
success: !1,
|
|
410
|
-
error: new (e ??
|
|
410
|
+
error: new (e ?? tt)(s.issues.map((i) => C(i, o, j())))
|
|
411
411
|
} : { success: !0, data: s.value };
|
|
412
|
-
}, Gt = /* @__PURE__ */
|
|
412
|
+
}, Gt = /* @__PURE__ */ ce(nt), ae = (e) => async (t, n, r) => {
|
|
413
413
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
414
414
|
let s = t._zod.run({ value: n, issues: [] }, o);
|
|
415
415
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
416
416
|
success: !1,
|
|
417
|
-
error: new e(s.issues.map((i) =>
|
|
417
|
+
error: new e(s.issues.map((i) => C(i, o, j())))
|
|
418
418
|
} : { success: !0, data: s.value };
|
|
419
|
-
}, Kt = /* @__PURE__ */
|
|
419
|
+
}, Kt = /* @__PURE__ */ ae(nt), Xt = (e) => (t, n, r) => {
|
|
420
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
421
|
+
return we(e)(t, n, o);
|
|
422
|
+
}, qt = (e) => (t, n, r) => we(e)(t, n, r), Qt = (e) => async (t, n, r) => {
|
|
420
423
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
421
424
|
return ze(e)(t, n, o);
|
|
422
|
-
},
|
|
425
|
+
}, en = (e) => async (t, n, r) => ze(e)(t, n, r), tn = (e) => (t, n, r) => {
|
|
423
426
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
424
|
-
return
|
|
425
|
-
},
|
|
427
|
+
return ce(e)(t, n, o);
|
|
428
|
+
}, nn = (e) => (t, n, r) => ce(e)(t, n, r), rn = (e) => async (t, n, r) => {
|
|
426
429
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
427
430
|
return ae(e)(t, n, o);
|
|
428
|
-
},
|
|
429
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
430
|
-
return ue(e)(t, n, o);
|
|
431
|
-
}, on = (e) => async (t, n, r) => ue(e)(t, n, r), sn = /^[cC][^\s-]{8,}$/, cn = /^[0-9a-z]+$/, an = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, un = /^[0-9a-vA-V]{20}$/, ln = /^[A-Za-z0-9]{27}$/, fn = /^[a-zA-Z0-9_-]{21}$/, pn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, dn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Oe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, hn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, mn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
431
|
+
}, on = (e) => async (t, n, r) => ae(e)(t, n, r), sn = /^[cC][^\s-]{8,}$/, cn = /^[0-9a-z]+$/, an = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, un = /^[0-9a-vA-V]{20}$/, ln = /^[A-Za-z0-9]{27}$/, fn = /^[a-zA-Z0-9_-]{21}$/, pn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, dn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Ze = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, hn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, mn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
432
432
|
function gn() {
|
|
433
433
|
return new RegExp(mn, "u");
|
|
434
434
|
}
|
|
435
|
-
const _n = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, vn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, bn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, yn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, wn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,
|
|
436
|
-
function
|
|
435
|
+
const _n = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, vn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, bn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, yn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, wn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, rt = /^[A-Za-z0-9_-]*$/, zn = /^\+[1-9]\d{6,14}$/, ot = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", $n = /* @__PURE__ */ new RegExp(`^${ot}$`);
|
|
436
|
+
function it(e) {
|
|
437
437
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
438
438
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
439
439
|
}
|
|
440
440
|
function kn(e) {
|
|
441
|
-
return new RegExp(`^${
|
|
441
|
+
return new RegExp(`^${it(e)}$`);
|
|
442
442
|
}
|
|
443
443
|
function Sn(e) {
|
|
444
|
-
const t =
|
|
444
|
+
const t = it({ precision: e.precision }), n = ["Z"];
|
|
445
445
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
446
446
|
const r = `${t}(?:${n.join("|")})`;
|
|
447
|
-
return new RegExp(`^${
|
|
447
|
+
return new RegExp(`^${ot}T(?:${r})$`);
|
|
448
448
|
}
|
|
449
449
|
const Zn = (e) => {
|
|
450
450
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
451
451
|
return new RegExp(`^${t}$`);
|
|
452
|
-
}, On = /^-?\d+$/, Tn = /^-?\d+(?:\.\d+)?$/,
|
|
452
|
+
}, On = /^-?\d+$/, Tn = /^-?\d+(?:\.\d+)?$/, En = /^(?:true|false)$/i, An = /^[^A-Z]*$/, In = /^[^a-z]*$/, T = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
|
|
453
453
|
var n;
|
|
454
454
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
455
|
-
}),
|
|
455
|
+
}), st = {
|
|
456
456
|
number: "number",
|
|
457
457
|
bigint: "bigint",
|
|
458
458
|
object: "date"
|
|
459
|
-
},
|
|
459
|
+
}, ct = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
|
|
460
460
|
T.init(e, t);
|
|
461
|
-
const n =
|
|
461
|
+
const n = st[typeof t.value];
|
|
462
462
|
e._zod.onattach.push((r) => {
|
|
463
463
|
const o = r._zod.bag, s = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
464
464
|
t.value < s && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
|
|
@@ -473,9 +473,9 @@ const Zn = (e) => {
|
|
|
473
473
|
continue: !t.abort
|
|
474
474
|
});
|
|
475
475
|
};
|
|
476
|
-
}),
|
|
476
|
+
}), at = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
|
|
477
477
|
T.init(e, t);
|
|
478
|
-
const n =
|
|
478
|
+
const n = st[typeof t.value];
|
|
479
479
|
e._zod.onattach.push((r) => {
|
|
480
480
|
const o = r._zod.bag, s = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
481
481
|
t.value > s && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
|
|
@@ -508,7 +508,7 @@ const Zn = (e) => {
|
|
|
508
508
|
};
|
|
509
509
|
}), Pn = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, t) => {
|
|
510
510
|
T.init(e, t), t.format = t.format || "float64";
|
|
511
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] =
|
|
511
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] = Ft[t.format];
|
|
512
512
|
e._zod.onattach.push((i) => {
|
|
513
513
|
const c = i._zod.bag;
|
|
514
514
|
c.format = t.format, c.minimum = o, c.maximum = s, n && (c.pattern = On);
|
|
@@ -571,7 +571,7 @@ const Zn = (e) => {
|
|
|
571
571
|
var n;
|
|
572
572
|
T.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
573
573
|
const o = r.value;
|
|
574
|
-
return !
|
|
574
|
+
return !ve(o) && o.length !== void 0;
|
|
575
575
|
}), e._zod.onattach.push((r) => {
|
|
576
576
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
577
577
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -579,7 +579,7 @@ const Zn = (e) => {
|
|
|
579
579
|
const o = r.value;
|
|
580
580
|
if (o.length <= t.maximum)
|
|
581
581
|
return;
|
|
582
|
-
const i =
|
|
582
|
+
const i = ye(o);
|
|
583
583
|
r.issues.push({
|
|
584
584
|
origin: i,
|
|
585
585
|
code: "too_big",
|
|
@@ -590,11 +590,11 @@ const Zn = (e) => {
|
|
|
590
590
|
continue: !t.abort
|
|
591
591
|
});
|
|
592
592
|
};
|
|
593
|
-
}),
|
|
593
|
+
}), Rn = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
|
|
594
594
|
var n;
|
|
595
595
|
T.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
596
596
|
const o = r.value;
|
|
597
|
-
return !
|
|
597
|
+
return !ve(o) && o.length !== void 0;
|
|
598
598
|
}), e._zod.onattach.push((r) => {
|
|
599
599
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
600
600
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -602,7 +602,7 @@ const Zn = (e) => {
|
|
|
602
602
|
const o = r.value;
|
|
603
603
|
if (o.length >= t.minimum)
|
|
604
604
|
return;
|
|
605
|
-
const i =
|
|
605
|
+
const i = ye(o);
|
|
606
606
|
r.issues.push({
|
|
607
607
|
origin: i,
|
|
608
608
|
code: "too_small",
|
|
@@ -613,11 +613,11 @@ const Zn = (e) => {
|
|
|
613
613
|
continue: !t.abort
|
|
614
614
|
});
|
|
615
615
|
};
|
|
616
|
-
}),
|
|
616
|
+
}), jn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
|
|
617
617
|
var n;
|
|
618
618
|
T.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
619
619
|
const o = r.value;
|
|
620
|
-
return !
|
|
620
|
+
return !ve(o) && o.length !== void 0;
|
|
621
621
|
}), e._zod.onattach.push((r) => {
|
|
622
622
|
const o = r._zod.bag;
|
|
623
623
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -625,7 +625,7 @@ const Zn = (e) => {
|
|
|
625
625
|
const o = r.value, s = o.length;
|
|
626
626
|
if (s === t.length)
|
|
627
627
|
return;
|
|
628
|
-
const i =
|
|
628
|
+
const i = ye(o), c = s > t.length;
|
|
629
629
|
r.issues.push({
|
|
630
630
|
origin: i,
|
|
631
631
|
...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -636,7 +636,7 @@ const Zn = (e) => {
|
|
|
636
636
|
continue: !t.abort
|
|
637
637
|
});
|
|
638
638
|
};
|
|
639
|
-
}),
|
|
639
|
+
}), ue = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, t) => {
|
|
640
640
|
var n, r;
|
|
641
641
|
T.init(e, t), e._zod.onattach.push((o) => {
|
|
642
642
|
const s = o._zod.bag;
|
|
@@ -653,8 +653,8 @@ const Zn = (e) => {
|
|
|
653
653
|
});
|
|
654
654
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
655
655
|
});
|
|
656
|
-
}),
|
|
657
|
-
|
|
656
|
+
}), Cn = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
|
|
657
|
+
ue.init(e, t), e._zod.check = (n) => {
|
|
658
658
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
659
659
|
origin: "string",
|
|
660
660
|
code: "invalid_format",
|
|
@@ -665,10 +665,10 @@ const Zn = (e) => {
|
|
|
665
665
|
continue: !t.abort
|
|
666
666
|
});
|
|
667
667
|
};
|
|
668
|
-
}),
|
|
669
|
-
t.pattern ?? (t.pattern =
|
|
670
|
-
}),
|
|
671
|
-
t.pattern ?? (t.pattern = In),
|
|
668
|
+
}), Dn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
669
|
+
t.pattern ?? (t.pattern = An), ue.init(e, t);
|
|
670
|
+
}), Fn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
671
|
+
t.pattern ?? (t.pattern = In), ue.init(e, t);
|
|
672
672
|
}), Ln = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
673
673
|
T.init(e, t);
|
|
674
674
|
const n = M(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
@@ -752,7 +752,7 @@ const Bn = {
|
|
|
752
752
|
major: 4,
|
|
753
753
|
minor: 3,
|
|
754
754
|
patch: 6
|
|
755
|
-
},
|
|
755
|
+
}, w = /* @__PURE__ */ u("$ZodType", (e, t) => {
|
|
756
756
|
var n;
|
|
757
757
|
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Bn;
|
|
758
758
|
const r = [...e._zod.def.checks ?? []];
|
|
@@ -766,29 +766,29 @@ const Bn = {
|
|
|
766
766
|
});
|
|
767
767
|
else {
|
|
768
768
|
const o = (i, c, a) => {
|
|
769
|
-
let l =
|
|
770
|
-
for (const
|
|
771
|
-
if (
|
|
772
|
-
if (!
|
|
769
|
+
let l = F(i), f;
|
|
770
|
+
for (const d of c) {
|
|
771
|
+
if (d._zod.def.when) {
|
|
772
|
+
if (!d._zod.def.when(i))
|
|
773
773
|
continue;
|
|
774
774
|
} else if (l)
|
|
775
775
|
continue;
|
|
776
|
-
const p = i.issues.length, m =
|
|
776
|
+
const p = i.issues.length, m = d._zod.check(i);
|
|
777
777
|
if (m instanceof Promise && a?.async === !1)
|
|
778
778
|
throw new L();
|
|
779
779
|
if (f || m instanceof Promise)
|
|
780
780
|
f = (f ?? Promise.resolve()).then(async () => {
|
|
781
|
-
await m, i.issues.length !== p && (l || (l =
|
|
781
|
+
await m, i.issues.length !== p && (l || (l = F(i, p)));
|
|
782
782
|
});
|
|
783
783
|
else {
|
|
784
784
|
if (i.issues.length === p)
|
|
785
785
|
continue;
|
|
786
|
-
l || (l =
|
|
786
|
+
l || (l = F(i, p));
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
789
|
return f ? f.then(() => i) : i;
|
|
790
790
|
}, s = (i, c, a) => {
|
|
791
|
-
if (
|
|
791
|
+
if (F(i))
|
|
792
792
|
return i.aborted = !0, i;
|
|
793
793
|
const l = o(c, r, a);
|
|
794
794
|
if (l instanceof Promise) {
|
|
@@ -826,8 +826,8 @@ const Bn = {
|
|
|
826
826
|
vendor: "zod",
|
|
827
827
|
version: 1
|
|
828
828
|
}));
|
|
829
|
-
}),
|
|
830
|
-
|
|
829
|
+
}), $e = /* @__PURE__ */ u("$ZodString", (e, t) => {
|
|
830
|
+
w.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Zn(e._zod.bag), e._zod.parse = (n, r) => {
|
|
831
831
|
if (t.coerce)
|
|
832
832
|
try {
|
|
833
833
|
n.value = String(n.value);
|
|
@@ -841,7 +841,7 @@ const Bn = {
|
|
|
841
841
|
}), n;
|
|
842
842
|
};
|
|
843
843
|
}), v = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
844
|
-
|
|
844
|
+
ue.init(e, t), $e.init(e, t);
|
|
845
845
|
}), Vn = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
846
846
|
t.pattern ?? (t.pattern = dn), v.init(e, t);
|
|
847
847
|
}), Hn = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
@@ -858,9 +858,9 @@ const Bn = {
|
|
|
858
858
|
}[t.version];
|
|
859
859
|
if (r === void 0)
|
|
860
860
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
861
|
-
t.pattern ?? (t.pattern =
|
|
861
|
+
t.pattern ?? (t.pattern = Ze(r));
|
|
862
862
|
} else
|
|
863
|
-
t.pattern ?? (t.pattern =
|
|
863
|
+
t.pattern ?? (t.pattern = Ze());
|
|
864
864
|
v.init(e, t);
|
|
865
865
|
}), Yn = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
866
866
|
t.pattern ?? (t.pattern = hn), v.init(e, t);
|
|
@@ -962,7 +962,7 @@ const Bn = {
|
|
|
962
962
|
}
|
|
963
963
|
};
|
|
964
964
|
});
|
|
965
|
-
function
|
|
965
|
+
function ut(e) {
|
|
966
966
|
if (e === "")
|
|
967
967
|
return !0;
|
|
968
968
|
if (e.length % 4 !== 0)
|
|
@@ -975,7 +975,7 @@ function lt(e) {
|
|
|
975
975
|
}
|
|
976
976
|
const fr = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
977
977
|
t.pattern ?? (t.pattern = wn), v.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
978
|
-
|
|
978
|
+
ut(n.value) || n.issues.push({
|
|
979
979
|
code: "invalid_format",
|
|
980
980
|
format: "base64",
|
|
981
981
|
input: n.value,
|
|
@@ -985,13 +985,13 @@ const fr = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
|
985
985
|
};
|
|
986
986
|
});
|
|
987
987
|
function pr(e) {
|
|
988
|
-
if (!
|
|
988
|
+
if (!rt.test(e))
|
|
989
989
|
return !1;
|
|
990
990
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
991
|
-
return
|
|
991
|
+
return ut(n);
|
|
992
992
|
}
|
|
993
993
|
const dr = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
994
|
-
t.pattern ?? (t.pattern =
|
|
994
|
+
t.pattern ?? (t.pattern = rt), v.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
995
995
|
pr(n.value) || n.issues.push({
|
|
996
996
|
code: "invalid_format",
|
|
997
997
|
format: "base64url",
|
|
@@ -1027,8 +1027,8 @@ const gr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1027
1027
|
continue: !t.abort
|
|
1028
1028
|
});
|
|
1029
1029
|
};
|
|
1030
|
-
}),
|
|
1031
|
-
|
|
1030
|
+
}), lt = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
|
|
1031
|
+
w.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Tn, e._zod.parse = (n, r) => {
|
|
1032
1032
|
if (t.coerce)
|
|
1033
1033
|
try {
|
|
1034
1034
|
n.value = Number(n.value);
|
|
@@ -1047,9 +1047,9 @@ const gr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1047
1047
|
}), n;
|
|
1048
1048
|
};
|
|
1049
1049
|
}), _r = /* @__PURE__ */ u("$ZodNumberFormat", (e, t) => {
|
|
1050
|
-
Pn.init(e, t),
|
|
1050
|
+
Pn.init(e, t), lt.init(e, t);
|
|
1051
1051
|
}), vr = /* @__PURE__ */ u("$ZodBoolean", (e, t) => {
|
|
1052
|
-
|
|
1052
|
+
w.init(e, t), e._zod.pattern = En, e._zod.parse = (n, r) => {
|
|
1053
1053
|
if (t.coerce)
|
|
1054
1054
|
try {
|
|
1055
1055
|
n.value = !!n.value;
|
|
@@ -1064,20 +1064,20 @@ const gr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1064
1064
|
}), n;
|
|
1065
1065
|
};
|
|
1066
1066
|
}), br = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
|
|
1067
|
-
|
|
1067
|
+
w.init(e, t), e._zod.parse = (n) => n;
|
|
1068
1068
|
}), yr = /* @__PURE__ */ u("$ZodNever", (e, t) => {
|
|
1069
|
-
|
|
1069
|
+
w.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
1070
1070
|
expected: "never",
|
|
1071
1071
|
code: "invalid_type",
|
|
1072
1072
|
input: n.value,
|
|
1073
1073
|
inst: e
|
|
1074
1074
|
}), n);
|
|
1075
1075
|
});
|
|
1076
|
-
function
|
|
1077
|
-
e.issues.length && t.issues.push(...
|
|
1076
|
+
function Oe(e, t, n) {
|
|
1077
|
+
e.issues.length && t.issues.push(...Qe(n, e.issues)), t.value[n] = e.value;
|
|
1078
1078
|
}
|
|
1079
1079
|
const wr = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
1080
|
-
|
|
1080
|
+
w.init(e, t), e._zod.parse = (n, r) => {
|
|
1081
1081
|
const o = n.value;
|
|
1082
1082
|
if (!Array.isArray(o))
|
|
1083
1083
|
return n.issues.push({
|
|
@@ -1093,25 +1093,25 @@ const wr = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
|
1093
1093
|
value: c,
|
|
1094
1094
|
issues: []
|
|
1095
1095
|
}, r);
|
|
1096
|
-
a instanceof Promise ? s.push(a.then((l) =>
|
|
1096
|
+
a instanceof Promise ? s.push(a.then((l) => Oe(l, n, i))) : Oe(a, n, i);
|
|
1097
1097
|
}
|
|
1098
1098
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
1099
1099
|
};
|
|
1100
1100
|
});
|
|
1101
|
-
function
|
|
1101
|
+
function te(e, t, n, r, o) {
|
|
1102
1102
|
if (e.issues.length) {
|
|
1103
1103
|
if (o && !(n in r))
|
|
1104
1104
|
return;
|
|
1105
|
-
t.issues.push(...
|
|
1105
|
+
t.issues.push(...Qe(n, e.issues));
|
|
1106
1106
|
}
|
|
1107
1107
|
e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1109
|
+
function ft(e) {
|
|
1110
1110
|
const t = Object.keys(e.shape);
|
|
1111
1111
|
for (const r of t)
|
|
1112
1112
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
1113
1113
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
1114
|
-
const n =
|
|
1114
|
+
const n = Dt(e.shape);
|
|
1115
1115
|
return {
|
|
1116
1116
|
...e,
|
|
1117
1117
|
keys: t,
|
|
@@ -1120,17 +1120,17 @@ function pt(e) {
|
|
|
1120
1120
|
optionalKeys: new Set(n)
|
|
1121
1121
|
};
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function pt(e, t, n, r, o, s) {
|
|
1124
1124
|
const i = [], c = o.keySet, a = o.catchall._zod, l = a.def.type, f = a.optout === "optional";
|
|
1125
|
-
for (const
|
|
1126
|
-
if (c.has(
|
|
1125
|
+
for (const d in t) {
|
|
1126
|
+
if (c.has(d))
|
|
1127
1127
|
continue;
|
|
1128
1128
|
if (l === "never") {
|
|
1129
|
-
i.push(
|
|
1129
|
+
i.push(d);
|
|
1130
1130
|
continue;
|
|
1131
1131
|
}
|
|
1132
|
-
const p = a.run({ value: t[
|
|
1133
|
-
p instanceof Promise ? e.push(p.then((m) =>
|
|
1132
|
+
const p = a.run({ value: t[d], issues: [] }, r);
|
|
1133
|
+
p instanceof Promise ? e.push(p.then((m) => te(m, n, d, t, f))) : te(p, n, d, t, f);
|
|
1134
1134
|
}
|
|
1135
1135
|
return i.length && n.issues.push({
|
|
1136
1136
|
code: "unrecognized_keys",
|
|
@@ -1140,7 +1140,7 @@ function dt(e, t, n, r, o, s) {
|
|
|
1140
1140
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1141
1141
|
}
|
|
1142
1142
|
const zr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
1143
|
-
if (
|
|
1143
|
+
if (w.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1144
1144
|
const c = t.shape;
|
|
1145
1145
|
Object.defineProperty(t, "shape", {
|
|
1146
1146
|
get: () => {
|
|
@@ -1151,15 +1151,15 @@ const zr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
});
|
|
1153
1153
|
}
|
|
1154
|
-
const r =
|
|
1154
|
+
const r = se(() => ft(t));
|
|
1155
1155
|
g(e._zod, "propValues", () => {
|
|
1156
1156
|
const c = t.shape, a = {};
|
|
1157
1157
|
for (const l in c) {
|
|
1158
1158
|
const f = c[l]._zod;
|
|
1159
1159
|
if (f.values) {
|
|
1160
1160
|
a[l] ?? (a[l] = /* @__PURE__ */ new Set());
|
|
1161
|
-
for (const
|
|
1162
|
-
a[l].add(
|
|
1161
|
+
for (const d of f.values)
|
|
1162
|
+
a[l].add(d);
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
1165
|
return a;
|
|
@@ -1177,60 +1177,60 @@ const zr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1177
1177
|
inst: e
|
|
1178
1178
|
}), c;
|
|
1179
1179
|
c.value = {};
|
|
1180
|
-
const f = [],
|
|
1180
|
+
const f = [], d = i.shape;
|
|
1181
1181
|
for (const p of i.keys) {
|
|
1182
|
-
const m =
|
|
1183
|
-
|
|
1182
|
+
const m = d[p], $ = m._zod.optout === "optional", b = m._zod.run({ value: l[p], issues: [] }, a);
|
|
1183
|
+
b instanceof Promise ? f.push(b.then((K) => te(K, c, p, l, $))) : te(b, c, p, l, $);
|
|
1184
1184
|
}
|
|
1185
|
-
return s ?
|
|
1185
|
+
return s ? pt(f, l, c, a, r.value, e) : f.length ? Promise.all(f).then(() => c) : c;
|
|
1186
1186
|
};
|
|
1187
1187
|
}), $r = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1188
1188
|
zr.init(e, t);
|
|
1189
|
-
const n = e._zod.parse, r =
|
|
1190
|
-
const m = new Wn(["shape", "payload", "ctx"]),
|
|
1191
|
-
const O =
|
|
1189
|
+
const n = e._zod.parse, r = se(() => ft(t)), o = (p) => {
|
|
1190
|
+
const m = new Wn(["shape", "payload", "ctx"]), $ = r.value, b = (I) => {
|
|
1191
|
+
const O = Se(I);
|
|
1192
1192
|
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
1193
1193
|
};
|
|
1194
1194
|
m.write("const input = payload.value;");
|
|
1195
|
-
const
|
|
1195
|
+
const K = /* @__PURE__ */ Object.create(null);
|
|
1196
1196
|
let It = 0;
|
|
1197
|
-
for (const I of
|
|
1198
|
-
|
|
1197
|
+
for (const I of $.keys)
|
|
1198
|
+
K[I] = `key_${It++}`;
|
|
1199
1199
|
m.write("const newResult = {};");
|
|
1200
|
-
for (const I of
|
|
1201
|
-
const O =
|
|
1202
|
-
m.write(`const ${O} = ${
|
|
1200
|
+
for (const I of $.keys) {
|
|
1201
|
+
const O = K[I], A = Se(I), Pt = p[I]?._zod?.optout === "optional";
|
|
1202
|
+
m.write(`const ${O} = ${b(I)};`), Pt ? m.write(`
|
|
1203
1203
|
if (${O}.issues.length) {
|
|
1204
|
-
if (${
|
|
1204
|
+
if (${A} in input) {
|
|
1205
1205
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1206
1206
|
...iss,
|
|
1207
|
-
path: iss.path ? [${
|
|
1207
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
1208
1208
|
})));
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
1211
|
|
|
1212
1212
|
if (${O}.value === undefined) {
|
|
1213
|
-
if (${
|
|
1214
|
-
newResult[${
|
|
1213
|
+
if (${A} in input) {
|
|
1214
|
+
newResult[${A}] = undefined;
|
|
1215
1215
|
}
|
|
1216
1216
|
} else {
|
|
1217
|
-
newResult[${
|
|
1217
|
+
newResult[${A}] = ${O}.value;
|
|
1218
1218
|
}
|
|
1219
1219
|
|
|
1220
1220
|
`) : m.write(`
|
|
1221
1221
|
if (${O}.issues.length) {
|
|
1222
1222
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1223
1223
|
...iss,
|
|
1224
|
-
path: iss.path ? [${
|
|
1224
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
1225
1225
|
})));
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
1228
|
if (${O}.value === undefined) {
|
|
1229
|
-
if (${
|
|
1230
|
-
newResult[${
|
|
1229
|
+
if (${A} in input) {
|
|
1230
|
+
newResult[${A}] = undefined;
|
|
1231
1231
|
}
|
|
1232
1232
|
} else {
|
|
1233
|
-
newResult[${
|
|
1233
|
+
newResult[${A}] = ${O}.value;
|
|
1234
1234
|
}
|
|
1235
1235
|
|
|
1236
1236
|
`);
|
|
@@ -1240,39 +1240,39 @@ const zr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1240
1240
|
return (I, O) => Nt(p, I, O);
|
|
1241
1241
|
};
|
|
1242
1242
|
let s;
|
|
1243
|
-
const i = B, c = !
|
|
1244
|
-
let
|
|
1243
|
+
const i = B, c = !Ge.jitless, l = c && jt.value, f = t.catchall;
|
|
1244
|
+
let d;
|
|
1245
1245
|
e._zod.parse = (p, m) => {
|
|
1246
|
-
|
|
1247
|
-
const
|
|
1248
|
-
return i(
|
|
1246
|
+
d ?? (d = r.value);
|
|
1247
|
+
const $ = p.value;
|
|
1248
|
+
return i($) ? c && l && m?.async === !1 && m.jitless !== !0 ? (s || (s = o(t.shape)), p = s(p, m), f ? pt([], $, p, m, d, e) : p) : n(p, m) : (p.issues.push({
|
|
1249
1249
|
expected: "object",
|
|
1250
1250
|
code: "invalid_type",
|
|
1251
|
-
input:
|
|
1251
|
+
input: $,
|
|
1252
1252
|
inst: e
|
|
1253
1253
|
}), p);
|
|
1254
1254
|
};
|
|
1255
1255
|
});
|
|
1256
|
-
function
|
|
1256
|
+
function Te(e, t, n, r) {
|
|
1257
1257
|
for (const s of e)
|
|
1258
1258
|
if (s.issues.length === 0)
|
|
1259
1259
|
return t.value = s.value, t;
|
|
1260
|
-
const o = e.filter((s) => !
|
|
1260
|
+
const o = e.filter((s) => !F(s));
|
|
1261
1261
|
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
1262
1262
|
code: "invalid_union",
|
|
1263
1263
|
input: t.value,
|
|
1264
1264
|
inst: n,
|
|
1265
|
-
errors: e.map((s) => s.issues.map((i) =>
|
|
1265
|
+
errors: e.map((s) => s.issues.map((i) => C(i, r, j())))
|
|
1266
1266
|
}), t);
|
|
1267
1267
|
}
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1268
|
+
const dt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
1269
|
+
w.init(e, t), g(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), g(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), g(e._zod, "values", () => {
|
|
1270
1270
|
if (t.options.every((o) => o._zod.values))
|
|
1271
1271
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1272
1272
|
}), g(e._zod, "pattern", () => {
|
|
1273
1273
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
1274
1274
|
const o = t.options.map((s) => s._zod.pattern);
|
|
1275
|
-
return new RegExp(`^(${o.map((s) =>
|
|
1275
|
+
return new RegExp(`^(${o.map((s) => be(s.source)).join("|")})$`);
|
|
1276
1276
|
}
|
|
1277
1277
|
});
|
|
1278
1278
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
@@ -1294,10 +1294,10 @@ const ht = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1294
1294
|
c.push(l);
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
|
-
return i ? Promise.all(c).then((a) =>
|
|
1297
|
+
return i ? Promise.all(c).then((a) => Te(a, o, e, s)) : Te(c, o, e, s);
|
|
1298
1298
|
};
|
|
1299
1299
|
}), kr = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (e, t) => {
|
|
1300
|
-
t.inclusive = !1,
|
|
1300
|
+
t.inclusive = !1, dt.init(e, t);
|
|
1301
1301
|
const n = e._zod.parse;
|
|
1302
1302
|
g(e._zod, "propValues", () => {
|
|
1303
1303
|
const o = {};
|
|
@@ -1313,7 +1313,7 @@ const ht = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
return o;
|
|
1315
1315
|
});
|
|
1316
|
-
const r =
|
|
1316
|
+
const r = se(() => {
|
|
1317
1317
|
const o = t.options, s = /* @__PURE__ */ new Map();
|
|
1318
1318
|
for (const i of o) {
|
|
1319
1319
|
const c = i._zod.propValues?.[t.discriminator];
|
|
@@ -1348,12 +1348,12 @@ const ht = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1348
1348
|
}), o);
|
|
1349
1349
|
};
|
|
1350
1350
|
}), Sr = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
|
|
1351
|
-
|
|
1351
|
+
w.init(e, t), e._zod.parse = (n, r) => {
|
|
1352
1352
|
const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
|
|
1353
1353
|
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([a, l]) => Ee(n, a, l)) : Ee(n, s, i);
|
|
1354
1354
|
};
|
|
1355
1355
|
});
|
|
1356
|
-
function
|
|
1356
|
+
function ge(e, t) {
|
|
1357
1357
|
if (e === t)
|
|
1358
1358
|
return { valid: !0, data: e };
|
|
1359
1359
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
@@ -1361,7 +1361,7 @@ function _e(e, t) {
|
|
|
1361
1361
|
if (V(e) && V(t)) {
|
|
1362
1362
|
const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
|
|
1363
1363
|
for (const s of r) {
|
|
1364
|
-
const i =
|
|
1364
|
+
const i = ge(e[s], t[s]);
|
|
1365
1365
|
if (!i.valid)
|
|
1366
1366
|
return {
|
|
1367
1367
|
valid: !1,
|
|
@@ -1376,7 +1376,7 @@ function _e(e, t) {
|
|
|
1376
1376
|
return { valid: !1, mergeErrorPath: [] };
|
|
1377
1377
|
const n = [];
|
|
1378
1378
|
for (let r = 0; r < e.length; r++) {
|
|
1379
|
-
const o = e[r], s = t[r], i =
|
|
1379
|
+
const o = e[r], s = t[r], i = ge(o, s);
|
|
1380
1380
|
if (!i.valid)
|
|
1381
1381
|
return {
|
|
1382
1382
|
valid: !1,
|
|
@@ -1405,17 +1405,17 @@ function Ee(e, t, n) {
|
|
|
1405
1405
|
else
|
|
1406
1406
|
e.issues.push(c);
|
|
1407
1407
|
const s = [...r].filter(([, c]) => c.l && c.r).map(([c]) => c);
|
|
1408
|
-
if (s.length && o && e.issues.push({ ...o, keys: s }),
|
|
1408
|
+
if (s.length && o && e.issues.push({ ...o, keys: s }), F(e))
|
|
1409
1409
|
return e;
|
|
1410
|
-
const i =
|
|
1410
|
+
const i = ge(t.value, n.value);
|
|
1411
1411
|
if (!i.valid)
|
|
1412
1412
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
1413
1413
|
return e.value = i.data, e;
|
|
1414
1414
|
}
|
|
1415
1415
|
const Zr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
1416
|
-
|
|
1417
|
-
const n =
|
|
1418
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) =>
|
|
1416
|
+
w.init(e, t);
|
|
1417
|
+
const n = Ke(t.entries), r = new Set(n);
|
|
1418
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => Ct.has(typeof o)).map((o) => typeof o == "string" ? M(o) : o.toString()).join("|")})$`), e._zod.parse = (o, s) => {
|
|
1419
1419
|
const i = o.value;
|
|
1420
1420
|
return r.has(i) || o.issues.push({
|
|
1421
1421
|
code: "invalid_value",
|
|
@@ -1425,7 +1425,7 @@ const Zr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1425
1425
|
}), o;
|
|
1426
1426
|
};
|
|
1427
1427
|
}), Or = /* @__PURE__ */ u("$ZodLiteral", (e, t) => {
|
|
1428
|
-
if (
|
|
1428
|
+
if (w.init(e, t), t.values.length === 0)
|
|
1429
1429
|
throw new Error("Cannot create literal schema with no valid values");
|
|
1430
1430
|
const n = new Set(t.values);
|
|
1431
1431
|
e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ? M(r) : r ? M(r.toString()) : String(r)).join("|")})$`), e._zod.parse = (r, o) => {
|
|
@@ -1438,9 +1438,9 @@ const Zr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1438
1438
|
}), r;
|
|
1439
1439
|
};
|
|
1440
1440
|
}), Tr = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
|
|
1441
|
-
|
|
1441
|
+
w.init(e, t), e._zod.parse = (n, r) => {
|
|
1442
1442
|
if (r.direction === "backward")
|
|
1443
|
-
throw new
|
|
1443
|
+
throw new Ye(e.constructor.name);
|
|
1444
1444
|
const o = t.transform(n.value, n);
|
|
1445
1445
|
if (r.async)
|
|
1446
1446
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
|
|
@@ -1449,52 +1449,52 @@ const Zr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1449
1449
|
return n.value = o, n;
|
|
1450
1450
|
};
|
|
1451
1451
|
});
|
|
1452
|
-
function
|
|
1452
|
+
function Ae(e, t) {
|
|
1453
1453
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1454
1454
|
}
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1455
|
+
const ht = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
1456
|
+
w.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", g(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), g(e._zod, "pattern", () => {
|
|
1457
1457
|
const n = t.innerType._zod.pattern;
|
|
1458
|
-
return n ? new RegExp(`^(${
|
|
1458
|
+
return n ? new RegExp(`^(${be(n.source)})?$`) : void 0;
|
|
1459
1459
|
}), e._zod.parse = (n, r) => {
|
|
1460
1460
|
if (t.innerType._zod.optin === "optional") {
|
|
1461
1461
|
const o = t.innerType._zod.run(n, r);
|
|
1462
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1462
|
+
return o instanceof Promise ? o.then((s) => Ae(s, n.value)) : Ae(o, n.value);
|
|
1463
1463
|
}
|
|
1464
1464
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
1465
1465
|
};
|
|
1466
|
-
}),
|
|
1467
|
-
|
|
1468
|
-
}),
|
|
1469
|
-
|
|
1466
|
+
}), Er = /* @__PURE__ */ u("$ZodExactOptional", (e, t) => {
|
|
1467
|
+
ht.init(e, t), g(e._zod, "values", () => t.innerType._zod.values), g(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
1468
|
+
}), Ar = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1469
|
+
w.init(e, t), g(e._zod, "optin", () => t.innerType._zod.optin), g(e._zod, "optout", () => t.innerType._zod.optout), g(e._zod, "pattern", () => {
|
|
1470
1470
|
const n = t.innerType._zod.pattern;
|
|
1471
|
-
return n ? new RegExp(`^(${
|
|
1471
|
+
return n ? new RegExp(`^(${be(n.source)}|null)$`) : void 0;
|
|
1472
1472
|
}), g(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
1473
1473
|
}), Ir = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
|
|
1474
|
-
|
|
1474
|
+
w.init(e, t), e._zod.optin = "optional", g(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1475
1475
|
if (r.direction === "backward")
|
|
1476
1476
|
return t.innerType._zod.run(n, r);
|
|
1477
1477
|
if (n.value === void 0)
|
|
1478
1478
|
return n.value = t.defaultValue, n;
|
|
1479
1479
|
const o = t.innerType._zod.run(n, r);
|
|
1480
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1480
|
+
return o instanceof Promise ? o.then((s) => Ie(s, t)) : Ie(o, t);
|
|
1481
1481
|
};
|
|
1482
1482
|
});
|
|
1483
|
-
function
|
|
1483
|
+
function Ie(e, t) {
|
|
1484
1484
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1485
1485
|
}
|
|
1486
1486
|
const Nr = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
1487
|
-
|
|
1487
|
+
w.init(e, t), e._zod.optin = "optional", g(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
1488
1488
|
}), Pr = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
|
|
1489
|
-
|
|
1489
|
+
w.init(e, t), g(e._zod, "values", () => {
|
|
1490
1490
|
const n = t.innerType._zod.values;
|
|
1491
1491
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
1492
1492
|
}), e._zod.parse = (n, r) => {
|
|
1493
1493
|
const o = t.innerType._zod.run(n, r);
|
|
1494
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1494
|
+
return o instanceof Promise ? o.then((s) => Ne(s, e)) : Ne(o, e);
|
|
1495
1495
|
};
|
|
1496
1496
|
});
|
|
1497
|
-
function
|
|
1497
|
+
function Ne(e, t) {
|
|
1498
1498
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1499
1499
|
code: "invalid_type",
|
|
1500
1500
|
expected: "nonoptional",
|
|
@@ -1503,57 +1503,57 @@ function Pe(e, t) {
|
|
|
1503
1503
|
}), e;
|
|
1504
1504
|
}
|
|
1505
1505
|
const xr = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
1506
|
-
|
|
1506
|
+
w.init(e, t), g(e._zod, "optin", () => t.innerType._zod.optin), g(e._zod, "optout", () => t.innerType._zod.optout), g(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1507
1507
|
if (r.direction === "backward")
|
|
1508
1508
|
return t.innerType._zod.run(n, r);
|
|
1509
1509
|
const o = t.innerType._zod.run(n, r);
|
|
1510
1510
|
return o instanceof Promise ? o.then((s) => (n.value = s.value, s.issues.length && (n.value = t.catchValue({
|
|
1511
1511
|
...n,
|
|
1512
1512
|
error: {
|
|
1513
|
-
issues: s.issues.map((i) =>
|
|
1513
|
+
issues: s.issues.map((i) => C(i, r, j()))
|
|
1514
1514
|
},
|
|
1515
1515
|
input: n.value
|
|
1516
1516
|
}), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
|
|
1517
1517
|
...n,
|
|
1518
1518
|
error: {
|
|
1519
|
-
issues: o.issues.map((s) =>
|
|
1519
|
+
issues: o.issues.map((s) => C(s, r, j()))
|
|
1520
1520
|
},
|
|
1521
1521
|
input: n.value
|
|
1522
1522
|
}), n.issues = []), n);
|
|
1523
1523
|
};
|
|
1524
|
-
}),
|
|
1525
|
-
|
|
1524
|
+
}), Rr = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
|
|
1525
|
+
w.init(e, t), g(e._zod, "values", () => t.in._zod.values), g(e._zod, "optin", () => t.in._zod.optin), g(e._zod, "optout", () => t.out._zod.optout), g(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
1526
1526
|
if (r.direction === "backward") {
|
|
1527
1527
|
const s = t.out._zod.run(n, r);
|
|
1528
|
-
return s instanceof Promise ? s.then((i) =>
|
|
1528
|
+
return s instanceof Promise ? s.then((i) => q(i, t.in, r)) : q(s, t.in, r);
|
|
1529
1529
|
}
|
|
1530
1530
|
const o = t.in._zod.run(n, r);
|
|
1531
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1531
|
+
return o instanceof Promise ? o.then((s) => q(s, t.out, r)) : q(o, t.out, r);
|
|
1532
1532
|
};
|
|
1533
1533
|
});
|
|
1534
|
-
function
|
|
1534
|
+
function q(e, t, n) {
|
|
1535
1535
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1536
1536
|
}
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1537
|
+
const jr = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
1538
|
+
w.init(e, t), g(e._zod, "propValues", () => t.innerType._zod.propValues), g(e._zod, "values", () => t.innerType._zod.values), g(e._zod, "optin", () => t.innerType?._zod?.optin), g(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
1539
1539
|
if (r.direction === "backward")
|
|
1540
1540
|
return t.innerType._zod.run(n, r);
|
|
1541
1541
|
const o = t.innerType._zod.run(n, r);
|
|
1542
|
-
return o instanceof Promise ? o.then(
|
|
1542
|
+
return o instanceof Promise ? o.then(Pe) : Pe(o);
|
|
1543
1543
|
};
|
|
1544
1544
|
});
|
|
1545
|
-
function
|
|
1545
|
+
function Pe(e) {
|
|
1546
1546
|
return e.value = Object.freeze(e.value), e;
|
|
1547
1547
|
}
|
|
1548
|
-
const
|
|
1549
|
-
T.init(e, t),
|
|
1548
|
+
const Cr = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
|
|
1549
|
+
T.init(e, t), w.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
1550
1550
|
const r = n.value, o = t.fn(r);
|
|
1551
1551
|
if (o instanceof Promise)
|
|
1552
|
-
return o.then((s) =>
|
|
1553
|
-
|
|
1552
|
+
return o.then((s) => xe(s, n, r, e));
|
|
1553
|
+
xe(o, n, r, e);
|
|
1554
1554
|
};
|
|
1555
1555
|
});
|
|
1556
|
-
function
|
|
1556
|
+
function xe(e, t, n, r) {
|
|
1557
1557
|
if (!e) {
|
|
1558
1558
|
const o = {
|
|
1559
1559
|
code: "custom",
|
|
@@ -1568,8 +1568,8 @@ function je(e, t, n, r) {
|
|
|
1568
1568
|
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(H(o));
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
|
-
var
|
|
1572
|
-
class
|
|
1571
|
+
var Re;
|
|
1572
|
+
class Dr {
|
|
1573
1573
|
constructor() {
|
|
1574
1574
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1575
1575
|
}
|
|
@@ -1598,16 +1598,16 @@ class Fr {
|
|
|
1598
1598
|
return this._map.has(t);
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1602
|
-
return new
|
|
1601
|
+
function Fr() {
|
|
1602
|
+
return new Dr();
|
|
1603
1603
|
}
|
|
1604
|
-
(
|
|
1604
|
+
(Re = globalThis).__zod_globalRegistry ?? (Re.__zod_globalRegistry = Fr());
|
|
1605
1605
|
const J = globalThis.__zod_globalRegistry;
|
|
1606
1606
|
// @__NO_SIDE_EFFECTS__
|
|
1607
1607
|
function Lr(e, t) {
|
|
1608
1608
|
return new e({
|
|
1609
1609
|
type: "string",
|
|
1610
|
-
...
|
|
1610
|
+
...h(t)
|
|
1611
1611
|
});
|
|
1612
1612
|
}
|
|
1613
1613
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1617,17 +1617,17 @@ function Mr(e, t) {
|
|
|
1617
1617
|
format: "email",
|
|
1618
1618
|
check: "string_format",
|
|
1619
1619
|
abort: !1,
|
|
1620
|
-
...
|
|
1620
|
+
...h(t)
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
// @__NO_SIDE_EFFECTS__
|
|
1624
|
-
function
|
|
1624
|
+
function je(e, t) {
|
|
1625
1625
|
return new e({
|
|
1626
1626
|
type: "string",
|
|
1627
1627
|
format: "guid",
|
|
1628
1628
|
check: "string_format",
|
|
1629
1629
|
abort: !1,
|
|
1630
|
-
...
|
|
1630
|
+
...h(t)
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
1633
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1637,7 +1637,7 @@ function Ur(e, t) {
|
|
|
1637
1637
|
format: "uuid",
|
|
1638
1638
|
check: "string_format",
|
|
1639
1639
|
abort: !1,
|
|
1640
|
-
...
|
|
1640
|
+
...h(t)
|
|
1641
1641
|
});
|
|
1642
1642
|
}
|
|
1643
1643
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1648,7 +1648,7 @@ function Jr(e, t) {
|
|
|
1648
1648
|
check: "string_format",
|
|
1649
1649
|
abort: !1,
|
|
1650
1650
|
version: "v4",
|
|
1651
|
-
...
|
|
1651
|
+
...h(t)
|
|
1652
1652
|
});
|
|
1653
1653
|
}
|
|
1654
1654
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1659,7 +1659,7 @@ function Wr(e, t) {
|
|
|
1659
1659
|
check: "string_format",
|
|
1660
1660
|
abort: !1,
|
|
1661
1661
|
version: "v6",
|
|
1662
|
-
...
|
|
1662
|
+
...h(t)
|
|
1663
1663
|
});
|
|
1664
1664
|
}
|
|
1665
1665
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1670,7 +1670,7 @@ function Br(e, t) {
|
|
|
1670
1670
|
check: "string_format",
|
|
1671
1671
|
abort: !1,
|
|
1672
1672
|
version: "v7",
|
|
1673
|
-
...
|
|
1673
|
+
...h(t)
|
|
1674
1674
|
});
|
|
1675
1675
|
}
|
|
1676
1676
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1680,7 +1680,7 @@ function Vr(e, t) {
|
|
|
1680
1680
|
format: "url",
|
|
1681
1681
|
check: "string_format",
|
|
1682
1682
|
abort: !1,
|
|
1683
|
-
...
|
|
1683
|
+
...h(t)
|
|
1684
1684
|
});
|
|
1685
1685
|
}
|
|
1686
1686
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1690,7 +1690,7 @@ function Hr(e, t) {
|
|
|
1690
1690
|
format: "emoji",
|
|
1691
1691
|
check: "string_format",
|
|
1692
1692
|
abort: !1,
|
|
1693
|
-
...
|
|
1693
|
+
...h(t)
|
|
1694
1694
|
});
|
|
1695
1695
|
}
|
|
1696
1696
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1700,7 +1700,7 @@ function Yr(e, t) {
|
|
|
1700
1700
|
format: "nanoid",
|
|
1701
1701
|
check: "string_format",
|
|
1702
1702
|
abort: !1,
|
|
1703
|
-
...
|
|
1703
|
+
...h(t)
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
1706
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1710,7 +1710,7 @@ function Gr(e, t) {
|
|
|
1710
1710
|
format: "cuid",
|
|
1711
1711
|
check: "string_format",
|
|
1712
1712
|
abort: !1,
|
|
1713
|
-
...
|
|
1713
|
+
...h(t)
|
|
1714
1714
|
});
|
|
1715
1715
|
}
|
|
1716
1716
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1720,7 +1720,7 @@ function Kr(e, t) {
|
|
|
1720
1720
|
format: "cuid2",
|
|
1721
1721
|
check: "string_format",
|
|
1722
1722
|
abort: !1,
|
|
1723
|
-
...
|
|
1723
|
+
...h(t)
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
1726
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1730,7 +1730,7 @@ function Xr(e, t) {
|
|
|
1730
1730
|
format: "ulid",
|
|
1731
1731
|
check: "string_format",
|
|
1732
1732
|
abort: !1,
|
|
1733
|
-
...
|
|
1733
|
+
...h(t)
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1740,7 +1740,7 @@ function qr(e, t) {
|
|
|
1740
1740
|
format: "xid",
|
|
1741
1741
|
check: "string_format",
|
|
1742
1742
|
abort: !1,
|
|
1743
|
-
...
|
|
1743
|
+
...h(t)
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1750,7 +1750,7 @@ function Qr(e, t) {
|
|
|
1750
1750
|
format: "ksuid",
|
|
1751
1751
|
check: "string_format",
|
|
1752
1752
|
abort: !1,
|
|
1753
|
-
...
|
|
1753
|
+
...h(t)
|
|
1754
1754
|
});
|
|
1755
1755
|
}
|
|
1756
1756
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1760,7 +1760,7 @@ function eo(e, t) {
|
|
|
1760
1760
|
format: "ipv4",
|
|
1761
1761
|
check: "string_format",
|
|
1762
1762
|
abort: !1,
|
|
1763
|
-
...
|
|
1763
|
+
...h(t)
|
|
1764
1764
|
});
|
|
1765
1765
|
}
|
|
1766
1766
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1770,7 +1770,7 @@ function to(e, t) {
|
|
|
1770
1770
|
format: "ipv6",
|
|
1771
1771
|
check: "string_format",
|
|
1772
1772
|
abort: !1,
|
|
1773
|
-
...
|
|
1773
|
+
...h(t)
|
|
1774
1774
|
});
|
|
1775
1775
|
}
|
|
1776
1776
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1780,7 +1780,7 @@ function no(e, t) {
|
|
|
1780
1780
|
format: "cidrv4",
|
|
1781
1781
|
check: "string_format",
|
|
1782
1782
|
abort: !1,
|
|
1783
|
-
...
|
|
1783
|
+
...h(t)
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
1786
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1790,7 +1790,7 @@ function ro(e, t) {
|
|
|
1790
1790
|
format: "cidrv6",
|
|
1791
1791
|
check: "string_format",
|
|
1792
1792
|
abort: !1,
|
|
1793
|
-
...
|
|
1793
|
+
...h(t)
|
|
1794
1794
|
});
|
|
1795
1795
|
}
|
|
1796
1796
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1800,7 +1800,7 @@ function oo(e, t) {
|
|
|
1800
1800
|
format: "base64",
|
|
1801
1801
|
check: "string_format",
|
|
1802
1802
|
abort: !1,
|
|
1803
|
-
...
|
|
1803
|
+
...h(t)
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
1806
1806
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1810,7 +1810,7 @@ function io(e, t) {
|
|
|
1810
1810
|
format: "base64url",
|
|
1811
1811
|
check: "string_format",
|
|
1812
1812
|
abort: !1,
|
|
1813
|
-
...
|
|
1813
|
+
...h(t)
|
|
1814
1814
|
});
|
|
1815
1815
|
}
|
|
1816
1816
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1820,7 +1820,7 @@ function so(e, t) {
|
|
|
1820
1820
|
format: "e164",
|
|
1821
1821
|
check: "string_format",
|
|
1822
1822
|
abort: !1,
|
|
1823
|
-
...
|
|
1823
|
+
...h(t)
|
|
1824
1824
|
});
|
|
1825
1825
|
}
|
|
1826
1826
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1830,7 +1830,7 @@ function co(e, t) {
|
|
|
1830
1830
|
format: "jwt",
|
|
1831
1831
|
check: "string_format",
|
|
1832
1832
|
abort: !1,
|
|
1833
|
-
...
|
|
1833
|
+
...h(t)
|
|
1834
1834
|
});
|
|
1835
1835
|
}
|
|
1836
1836
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1842,7 +1842,7 @@ function ao(e, t) {
|
|
|
1842
1842
|
offset: !1,
|
|
1843
1843
|
local: !1,
|
|
1844
1844
|
precision: null,
|
|
1845
|
-
...
|
|
1845
|
+
...h(t)
|
|
1846
1846
|
});
|
|
1847
1847
|
}
|
|
1848
1848
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1851,7 +1851,7 @@ function uo(e, t) {
|
|
|
1851
1851
|
type: "string",
|
|
1852
1852
|
format: "date",
|
|
1853
1853
|
check: "string_format",
|
|
1854
|
-
...
|
|
1854
|
+
...h(t)
|
|
1855
1855
|
});
|
|
1856
1856
|
}
|
|
1857
1857
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1861,7 +1861,7 @@ function lo(e, t) {
|
|
|
1861
1861
|
format: "time",
|
|
1862
1862
|
check: "string_format",
|
|
1863
1863
|
precision: null,
|
|
1864
|
-
...
|
|
1864
|
+
...h(t)
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
1867
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1870,7 +1870,7 @@ function fo(e, t) {
|
|
|
1870
1870
|
type: "string",
|
|
1871
1871
|
format: "duration",
|
|
1872
1872
|
check: "string_format",
|
|
1873
|
-
...
|
|
1873
|
+
...h(t)
|
|
1874
1874
|
});
|
|
1875
1875
|
}
|
|
1876
1876
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1878,7 +1878,7 @@ function po(e, t) {
|
|
|
1878
1878
|
return new e({
|
|
1879
1879
|
type: "number",
|
|
1880
1880
|
checks: [],
|
|
1881
|
-
...
|
|
1881
|
+
...h(t)
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
1884
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1888,14 +1888,14 @@ function ho(e, t) {
|
|
|
1888
1888
|
check: "number_format",
|
|
1889
1889
|
abort: !1,
|
|
1890
1890
|
format: "safeint",
|
|
1891
|
-
...
|
|
1891
|
+
...h(t)
|
|
1892
1892
|
});
|
|
1893
1893
|
}
|
|
1894
1894
|
// @__NO_SIDE_EFFECTS__
|
|
1895
1895
|
function mo(e, t) {
|
|
1896
1896
|
return new e({
|
|
1897
1897
|
type: "boolean",
|
|
1898
|
-
...
|
|
1898
|
+
...h(t)
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
1901
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1908,100 +1908,100 @@ function go(e) {
|
|
|
1908
1908
|
function _o(e, t) {
|
|
1909
1909
|
return new e({
|
|
1910
1910
|
type: "never",
|
|
1911
|
-
...
|
|
1911
|
+
...h(t)
|
|
1912
1912
|
});
|
|
1913
1913
|
}
|
|
1914
1914
|
// @__NO_SIDE_EFFECTS__
|
|
1915
|
-
function
|
|
1916
|
-
return new
|
|
1915
|
+
function Ce(e, t) {
|
|
1916
|
+
return new ct({
|
|
1917
1917
|
check: "less_than",
|
|
1918
|
-
...
|
|
1918
|
+
...h(t),
|
|
1919
1919
|
value: e,
|
|
1920
1920
|
inclusive: !1
|
|
1921
1921
|
});
|
|
1922
1922
|
}
|
|
1923
1923
|
// @__NO_SIDE_EFFECTS__
|
|
1924
|
-
function
|
|
1925
|
-
return new
|
|
1924
|
+
function pe(e, t) {
|
|
1925
|
+
return new ct({
|
|
1926
1926
|
check: "less_than",
|
|
1927
|
-
...
|
|
1927
|
+
...h(t),
|
|
1928
1928
|
value: e,
|
|
1929
1929
|
inclusive: !0
|
|
1930
1930
|
});
|
|
1931
1931
|
}
|
|
1932
1932
|
// @__NO_SIDE_EFFECTS__
|
|
1933
1933
|
function De(e, t) {
|
|
1934
|
-
return new
|
|
1934
|
+
return new at({
|
|
1935
1935
|
check: "greater_than",
|
|
1936
|
-
...
|
|
1936
|
+
...h(t),
|
|
1937
1937
|
value: e,
|
|
1938
1938
|
inclusive: !1
|
|
1939
1939
|
});
|
|
1940
1940
|
}
|
|
1941
1941
|
// @__NO_SIDE_EFFECTS__
|
|
1942
|
-
function
|
|
1943
|
-
return new
|
|
1942
|
+
function de(e, t) {
|
|
1943
|
+
return new at({
|
|
1944
1944
|
check: "greater_than",
|
|
1945
|
-
...
|
|
1945
|
+
...h(t),
|
|
1946
1946
|
value: e,
|
|
1947
1947
|
inclusive: !0
|
|
1948
1948
|
});
|
|
1949
1949
|
}
|
|
1950
1950
|
// @__NO_SIDE_EFFECTS__
|
|
1951
|
-
function
|
|
1951
|
+
function Fe(e, t) {
|
|
1952
1952
|
return new Nn({
|
|
1953
1953
|
check: "multiple_of",
|
|
1954
|
-
...
|
|
1954
|
+
...h(t),
|
|
1955
1955
|
value: e
|
|
1956
1956
|
});
|
|
1957
1957
|
}
|
|
1958
1958
|
// @__NO_SIDE_EFFECTS__
|
|
1959
|
-
function
|
|
1959
|
+
function mt(e, t) {
|
|
1960
1960
|
return new xn({
|
|
1961
1961
|
check: "max_length",
|
|
1962
|
-
...
|
|
1962
|
+
...h(t),
|
|
1963
1963
|
maximum: e
|
|
1964
1964
|
});
|
|
1965
1965
|
}
|
|
1966
1966
|
// @__NO_SIDE_EFFECTS__
|
|
1967
|
-
function
|
|
1968
|
-
return new
|
|
1967
|
+
function ne(e, t) {
|
|
1968
|
+
return new Rn({
|
|
1969
1969
|
check: "min_length",
|
|
1970
|
-
...
|
|
1970
|
+
...h(t),
|
|
1971
1971
|
minimum: e
|
|
1972
1972
|
});
|
|
1973
1973
|
}
|
|
1974
1974
|
// @__NO_SIDE_EFFECTS__
|
|
1975
|
-
function
|
|
1976
|
-
return new
|
|
1975
|
+
function gt(e, t) {
|
|
1976
|
+
return new jn({
|
|
1977
1977
|
check: "length_equals",
|
|
1978
|
-
...
|
|
1978
|
+
...h(t),
|
|
1979
1979
|
length: e
|
|
1980
1980
|
});
|
|
1981
1981
|
}
|
|
1982
1982
|
// @__NO_SIDE_EFFECTS__
|
|
1983
1983
|
function vo(e, t) {
|
|
1984
|
-
return new
|
|
1984
|
+
return new Cn({
|
|
1985
1985
|
check: "string_format",
|
|
1986
1986
|
format: "regex",
|
|
1987
|
-
...
|
|
1987
|
+
...h(t),
|
|
1988
1988
|
pattern: e
|
|
1989
1989
|
});
|
|
1990
1990
|
}
|
|
1991
1991
|
// @__NO_SIDE_EFFECTS__
|
|
1992
1992
|
function bo(e) {
|
|
1993
|
-
return new
|
|
1993
|
+
return new Dn({
|
|
1994
1994
|
check: "string_format",
|
|
1995
1995
|
format: "lowercase",
|
|
1996
|
-
...
|
|
1996
|
+
...h(e)
|
|
1997
1997
|
});
|
|
1998
1998
|
}
|
|
1999
1999
|
// @__NO_SIDE_EFFECTS__
|
|
2000
2000
|
function yo(e) {
|
|
2001
|
-
return new
|
|
2001
|
+
return new Fn({
|
|
2002
2002
|
check: "string_format",
|
|
2003
2003
|
format: "uppercase",
|
|
2004
|
-
...
|
|
2004
|
+
...h(e)
|
|
2005
2005
|
});
|
|
2006
2006
|
}
|
|
2007
2007
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2009,7 +2009,7 @@ function wo(e, t) {
|
|
|
2009
2009
|
return new Ln({
|
|
2010
2010
|
check: "string_format",
|
|
2011
2011
|
format: "includes",
|
|
2012
|
-
...
|
|
2012
|
+
...h(t),
|
|
2013
2013
|
includes: e
|
|
2014
2014
|
});
|
|
2015
2015
|
}
|
|
@@ -2018,7 +2018,7 @@ function zo(e, t) {
|
|
|
2018
2018
|
return new Mn({
|
|
2019
2019
|
check: "string_format",
|
|
2020
2020
|
format: "starts_with",
|
|
2021
|
-
...
|
|
2021
|
+
...h(t),
|
|
2022
2022
|
prefix: e
|
|
2023
2023
|
});
|
|
2024
2024
|
}
|
|
@@ -2027,7 +2027,7 @@ function $o(e, t) {
|
|
|
2027
2027
|
return new Un({
|
|
2028
2028
|
check: "string_format",
|
|
2029
2029
|
format: "ends_with",
|
|
2030
|
-
...
|
|
2030
|
+
...h(t),
|
|
2031
2031
|
suffix: e
|
|
2032
2032
|
});
|
|
2033
2033
|
}
|
|
@@ -2056,26 +2056,26 @@ function Oo() {
|
|
|
2056
2056
|
}
|
|
2057
2057
|
// @__NO_SIDE_EFFECTS__
|
|
2058
2058
|
function To() {
|
|
2059
|
-
return /* @__PURE__ */ U((e) =>
|
|
2059
|
+
return /* @__PURE__ */ U((e) => Rt(e));
|
|
2060
2060
|
}
|
|
2061
2061
|
// @__NO_SIDE_EFFECTS__
|
|
2062
|
-
function
|
|
2062
|
+
function Eo(e, t, n) {
|
|
2063
2063
|
return new e({
|
|
2064
2064
|
type: "array",
|
|
2065
2065
|
element: t,
|
|
2066
2066
|
// get element() {
|
|
2067
2067
|
// return element;
|
|
2068
2068
|
// },
|
|
2069
|
-
...
|
|
2069
|
+
...h(n)
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
2072
2072
|
// @__NO_SIDE_EFFECTS__
|
|
2073
|
-
function
|
|
2073
|
+
function Ao(e, t, n) {
|
|
2074
2074
|
return new e({
|
|
2075
2075
|
type: "custom",
|
|
2076
2076
|
check: "custom",
|
|
2077
2077
|
fn: t,
|
|
2078
|
-
...
|
|
2078
|
+
...h(n)
|
|
2079
2079
|
});
|
|
2080
2080
|
}
|
|
2081
2081
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2094,11 +2094,11 @@ function Io(e) {
|
|
|
2094
2094
|
function No(e, t) {
|
|
2095
2095
|
const n = new T({
|
|
2096
2096
|
check: "custom",
|
|
2097
|
-
...
|
|
2097
|
+
...h(t)
|
|
2098
2098
|
});
|
|
2099
2099
|
return n._zod.check = e, n;
|
|
2100
2100
|
}
|
|
2101
|
-
function
|
|
2101
|
+
function _t(e) {
|
|
2102
2102
|
let t = e?.target ?? "draft-2020-12";
|
|
2103
2103
|
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2104
2104
|
processors: e.processors ?? {},
|
|
@@ -2139,13 +2139,13 @@ function S(e, t, n = { path: [], schemaPath: [] }) {
|
|
|
2139
2139
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
2140
2140
|
m(e, t, p, f);
|
|
2141
2141
|
}
|
|
2142
|
-
const
|
|
2143
|
-
|
|
2142
|
+
const d = e._zod.parent;
|
|
2143
|
+
d && (i.ref || (i.ref = d), S(d, t, f), t.seen.get(d).isParent = !0);
|
|
2144
2144
|
}
|
|
2145
2145
|
const a = t.metadataRegistry.get(e);
|
|
2146
2146
|
return a && Object.assign(i.schema, a), t.io === "input" && Z(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
2147
2147
|
}
|
|
2148
|
-
function
|
|
2148
|
+
function vt(e, t) {
|
|
2149
2149
|
const n = e.seen.get(t);
|
|
2150
2150
|
if (!n)
|
|
2151
2151
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -2162,9 +2162,9 @@ function bt(e, t) {
|
|
|
2162
2162
|
const o = (i) => {
|
|
2163
2163
|
const c = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2164
2164
|
if (e.external) {
|
|
2165
|
-
const
|
|
2166
|
-
if (
|
|
2167
|
-
return { ref: p(
|
|
2165
|
+
const d = e.external.registry.get(i[0])?.id, p = e.external.uri ?? (($) => $);
|
|
2166
|
+
if (d)
|
|
2167
|
+
return { ref: p(d) };
|
|
2168
2168
|
const m = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
2169
2169
|
return i[1].defId = m, { defId: m, ref: `${p("__shared")}#/${c}/${m}` };
|
|
2170
2170
|
}
|
|
@@ -2178,8 +2178,8 @@ function bt(e, t) {
|
|
|
2178
2178
|
const c = i[1], { ref: a, defId: l } = o(i);
|
|
2179
2179
|
c.def = { ...c.schema }, l && (c.defId = l);
|
|
2180
2180
|
const f = c.schema;
|
|
2181
|
-
for (const
|
|
2182
|
-
delete f[
|
|
2181
|
+
for (const d in f)
|
|
2182
|
+
delete f[d];
|
|
2183
2183
|
f.$ref = a;
|
|
2184
2184
|
};
|
|
2185
2185
|
if (e.cycles === "throw")
|
|
@@ -2217,7 +2217,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2220
|
+
function bt(e, t) {
|
|
2221
2221
|
const n = e.seen.get(t);
|
|
2222
2222
|
if (!n)
|
|
2223
2223
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -2230,16 +2230,16 @@ function yt(e, t) {
|
|
|
2230
2230
|
r(f);
|
|
2231
2231
|
const p = e.seen.get(f), m = p.schema;
|
|
2232
2232
|
if (m.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (a.allOf = a.allOf ?? [], a.allOf.push(m)) : Object.assign(a, m), Object.assign(a, l), i._zod.parent === f)
|
|
2233
|
-
for (const
|
|
2234
|
-
|
|
2233
|
+
for (const b in a)
|
|
2234
|
+
b === "$ref" || b === "allOf" || b in l || delete a[b];
|
|
2235
2235
|
if (m.$ref && p.def)
|
|
2236
|
-
for (const
|
|
2237
|
-
|
|
2236
|
+
for (const b in a)
|
|
2237
|
+
b === "$ref" || b === "allOf" || b in p.def && JSON.stringify(a[b]) === JSON.stringify(p.def[b]) && delete a[b];
|
|
2238
2238
|
}
|
|
2239
|
-
const
|
|
2240
|
-
if (
|
|
2241
|
-
r(
|
|
2242
|
-
const p = e.seen.get(
|
|
2239
|
+
const d = i._zod.parent;
|
|
2240
|
+
if (d && d !== f) {
|
|
2241
|
+
r(d);
|
|
2242
|
+
const p = e.seen.get(d);
|
|
2243
2243
|
if (p?.schema.$ref && (a.$ref = p.schema.$ref, p.def))
|
|
2244
2244
|
for (const m in a)
|
|
2245
2245
|
m === "$ref" || m === "allOf" || m in p.def && JSON.stringify(a[m]) === JSON.stringify(p.def[m]) && delete a[m];
|
|
@@ -2272,8 +2272,8 @@ function yt(e, t) {
|
|
|
2272
2272
|
value: {
|
|
2273
2273
|
...t["~standard"],
|
|
2274
2274
|
jsonSchema: {
|
|
2275
|
-
input:
|
|
2276
|
-
output:
|
|
2275
|
+
input: re(t, "input", e.processors),
|
|
2276
|
+
output: re(t, "output", e.processors)
|
|
2277
2277
|
}
|
|
2278
2278
|
},
|
|
2279
2279
|
enumerable: !1,
|
|
@@ -2326,11 +2326,11 @@ function Z(e, t) {
|
|
|
2326
2326
|
return !1;
|
|
2327
2327
|
}
|
|
2328
2328
|
const Po = (e, t = {}) => (n) => {
|
|
2329
|
-
const r =
|
|
2330
|
-
return S(e, r),
|
|
2331
|
-
},
|
|
2332
|
-
const { libraryOptions: o, target: s } = r ?? {}, i =
|
|
2333
|
-
return S(e, i),
|
|
2329
|
+
const r = _t({ ...n, processors: t });
|
|
2330
|
+
return S(e, r), vt(r, e), bt(r, e);
|
|
2331
|
+
}, re = (e, t, n = {}) => (r) => {
|
|
2332
|
+
const { libraryOptions: o, target: s } = r ?? {}, i = _t({ ...o ?? {}, target: s, io: t, processors: n });
|
|
2333
|
+
return S(e, i), vt(i, e), bt(i, e);
|
|
2334
2334
|
}, xo = {
|
|
2335
2335
|
guid: "uuid",
|
|
2336
2336
|
url: "uri",
|
|
@@ -2338,29 +2338,29 @@ const Po = (e, t = {}) => (n) => {
|
|
|
2338
2338
|
json_string: "json-string",
|
|
2339
2339
|
regex: ""
|
|
2340
2340
|
// do not set
|
|
2341
|
-
},
|
|
2341
|
+
}, Ro = (e, t, n, r) => {
|
|
2342
2342
|
const o = n;
|
|
2343
2343
|
o.type = "string";
|
|
2344
2344
|
const { minimum: s, maximum: i, format: c, patterns: a, contentEncoding: l } = e._zod.bag;
|
|
2345
2345
|
if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), c && (o.format = xo[c] ?? c, o.format === "" && delete o.format, c === "time" && delete o.format), l && (o.contentEncoding = l), a && a.size > 0) {
|
|
2346
2346
|
const f = [...a];
|
|
2347
2347
|
f.length === 1 ? o.pattern = f[0].source : f.length > 1 && (o.allOf = [
|
|
2348
|
-
...f.map((
|
|
2348
|
+
...f.map((d) => ({
|
|
2349
2349
|
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2350
|
-
pattern:
|
|
2350
|
+
pattern: d.source
|
|
2351
2351
|
}))
|
|
2352
2352
|
]);
|
|
2353
2353
|
}
|
|
2354
|
-
},
|
|
2354
|
+
}, jo = (e, t, n, r) => {
|
|
2355
2355
|
const o = n, { minimum: s, maximum: i, format: c, multipleOf: a, exclusiveMaximum: l, exclusiveMinimum: f } = e._zod.bag;
|
|
2356
2356
|
typeof c == "string" && c.includes("int") ? o.type = "integer" : o.type = "number", typeof f == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.minimum = f, o.exclusiveMinimum = !0) : o.exclusiveMinimum = f), typeof s == "number" && (o.minimum = s, typeof f == "number" && t.target !== "draft-04" && (f >= s ? delete o.minimum : delete o.exclusiveMinimum)), typeof l == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.maximum = l, o.exclusiveMaximum = !0) : o.exclusiveMaximum = l), typeof i == "number" && (o.maximum = i, typeof l == "number" && t.target !== "draft-04" && (l <= i ? delete o.maximum : delete o.exclusiveMaximum)), typeof a == "number" && (o.multipleOf = a);
|
|
2357
|
-
},
|
|
2357
|
+
}, Co = (e, t, n, r) => {
|
|
2358
2358
|
n.type = "boolean";
|
|
2359
|
-
}, Fo = (e, t, n, r) => {
|
|
2360
|
-
n.not = {};
|
|
2361
2359
|
}, Do = (e, t, n, r) => {
|
|
2360
|
+
n.not = {};
|
|
2361
|
+
}, Fo = (e, t, n, r) => {
|
|
2362
2362
|
}, Lo = (e, t, n, r) => {
|
|
2363
|
-
const o = e._zod.def, s =
|
|
2363
|
+
const o = e._zod.def, s = Ke(o.entries);
|
|
2364
2364
|
s.every((i) => typeof i == "number") && (n.type = "number"), s.every((i) => typeof i == "string") && (n.type = "string"), n.enum = s;
|
|
2365
2365
|
}, Mo = (e, t, n, r) => {
|
|
2366
2366
|
const o = e._zod.def, s = [];
|
|
@@ -2463,37 +2463,37 @@ const Po = (e, t = {}) => (n) => {
|
|
|
2463
2463
|
S(o.innerType, t, r);
|
|
2464
2464
|
const s = t.seen.get(e);
|
|
2465
2465
|
s.ref = o.innerType, n.readOnly = !0;
|
|
2466
|
-
},
|
|
2466
|
+
}, yt = (e, t, n, r) => {
|
|
2467
2467
|
const o = e._zod.def;
|
|
2468
2468
|
S(o.innerType, t, r);
|
|
2469
2469
|
const s = t.seen.get(e);
|
|
2470
2470
|
s.ref = o.innerType;
|
|
2471
2471
|
}, ti = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
|
|
2472
|
-
rr.init(e, t),
|
|
2472
|
+
rr.init(e, t), y.init(e, t);
|
|
2473
2473
|
});
|
|
2474
2474
|
function ni(e) {
|
|
2475
2475
|
return /* @__PURE__ */ ao(ti, e);
|
|
2476
2476
|
}
|
|
2477
2477
|
const ri = /* @__PURE__ */ u("ZodISODate", (e, t) => {
|
|
2478
|
-
or.init(e, t),
|
|
2478
|
+
or.init(e, t), y.init(e, t);
|
|
2479
2479
|
});
|
|
2480
2480
|
function oi(e) {
|
|
2481
2481
|
return /* @__PURE__ */ uo(ri, e);
|
|
2482
2482
|
}
|
|
2483
2483
|
const ii = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
|
|
2484
|
-
ir.init(e, t),
|
|
2484
|
+
ir.init(e, t), y.init(e, t);
|
|
2485
2485
|
});
|
|
2486
2486
|
function si(e) {
|
|
2487
2487
|
return /* @__PURE__ */ lo(ii, e);
|
|
2488
2488
|
}
|
|
2489
2489
|
const ci = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
|
|
2490
|
-
sr.init(e, t),
|
|
2490
|
+
sr.init(e, t), y.init(e, t);
|
|
2491
2491
|
});
|
|
2492
2492
|
function ai(e) {
|
|
2493
2493
|
return /* @__PURE__ */ fo(ci, e);
|
|
2494
2494
|
}
|
|
2495
2495
|
const ui = (e, t) => {
|
|
2496
|
-
|
|
2496
|
+
tt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2497
2497
|
format: {
|
|
2498
2498
|
value: (n) => Yt(e, n)
|
|
2499
2499
|
// enumerable: false,
|
|
@@ -2504,13 +2504,13 @@ const ui = (e, t) => {
|
|
|
2504
2504
|
},
|
|
2505
2505
|
addIssue: {
|
|
2506
2506
|
value: (n) => {
|
|
2507
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2507
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, me, 2);
|
|
2508
2508
|
}
|
|
2509
2509
|
// enumerable: false,
|
|
2510
2510
|
},
|
|
2511
2511
|
addIssues: {
|
|
2512
2512
|
value: (n) => {
|
|
2513
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2513
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, me, 2);
|
|
2514
2514
|
}
|
|
2515
2515
|
// enumerable: false,
|
|
2516
2516
|
},
|
|
@@ -2521,12 +2521,12 @@ const ui = (e, t) => {
|
|
|
2521
2521
|
// enumerable: false,
|
|
2522
2522
|
}
|
|
2523
2523
|
});
|
|
2524
|
-
},
|
|
2524
|
+
}, E = u("ZodError", ui, {
|
|
2525
2525
|
Parent: Error
|
|
2526
|
-
}), li = /* @__PURE__ */
|
|
2526
|
+
}), li = /* @__PURE__ */ we(E), fi = /* @__PURE__ */ ze(E), pi = /* @__PURE__ */ ce(E), di = /* @__PURE__ */ ae(E), hi = /* @__PURE__ */ Xt(E), mi = /* @__PURE__ */ qt(E), gi = /* @__PURE__ */ Qt(E), _i = /* @__PURE__ */ en(E), vi = /* @__PURE__ */ tn(E), bi = /* @__PURE__ */ nn(E), yi = /* @__PURE__ */ rn(E), wi = /* @__PURE__ */ on(E), z = /* @__PURE__ */ u("ZodType", (e, t) => (w.init(e, t), Object.assign(e["~standard"], {
|
|
2527
2527
|
jsonSchema: {
|
|
2528
|
-
input:
|
|
2529
|
-
output:
|
|
2528
|
+
input: re(e, "input"),
|
|
2529
|
+
output: re(e, "output")
|
|
2530
2530
|
}
|
|
2531
2531
|
}), e.toJSONSchema = Po(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(P(t, {
|
|
2532
2532
|
checks: [
|
|
@@ -2535,7 +2535,7 @@ const ui = (e, t) => {
|
|
|
2535
2535
|
]
|
|
2536
2536
|
}), {
|
|
2537
2537
|
parent: !0
|
|
2538
|
-
}), e.with = e.check, e.clone = (n, r) => x(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => li(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => pi(e, n, r), e.parseAsync = async (n, r) => fi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => di(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => hi(e, n, r), e.decode = (n, r) => mi(e, n, r), e.encodeAsync = async (n, r) => gi(e, n, r), e.decodeAsync = async (n, r) => _i(e, n, r), e.safeEncode = (n, r) => vi(e, n, r), e.safeDecode = (n, r) => bi(e, n, r), e.safeEncodeAsync = async (n, r) => yi(e, n, r), e.safeDecodeAsync = async (n, r) => wi(e, n, r), e.refine = (n, r) => e.check(ms(n, r)), e.superRefine = (n) => e.check(gs(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ U(n)), e.optional = () =>
|
|
2538
|
+
}), e.with = e.check, e.clone = (n, r) => x(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => li(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => pi(e, n, r), e.parseAsync = async (n, r) => fi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => di(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => hi(e, n, r), e.decode = (n, r) => mi(e, n, r), e.encodeAsync = async (n, r) => gi(e, n, r), e.decodeAsync = async (n, r) => _i(e, n, r), e.safeEncode = (n, r) => vi(e, n, r), e.safeDecode = (n, r) => bi(e, n, r), e.safeEncodeAsync = async (n, r) => yi(e, n, r), e.safeDecodeAsync = async (n, r) => wi(e, n, r), e.refine = (n, r) => e.check(ms(n, r)), e.superRefine = (n) => e.check(gs(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ U(n)), e.optional = () => We(e), e.exactOptional = () => ns(e), e.nullable = () => Be(e), e.nullish = () => We(Be(e)), e.nonoptional = (n) => as(e, n), e.array = () => oe(e), e.or = (n) => Hi([e, n]), e.and = (n) => Xi(e, n), e.transform = (n) => Ve(e, es(n)), e.default = (n) => is(e, n), e.prefault = (n) => cs(e, n), e.catch = (n) => ls(e, n), e.pipe = (n) => Ve(e, n), e.readonly = () => ds(e), e.describe = (n) => {
|
|
2539
2539
|
const r = e.clone();
|
|
2540
2540
|
return J.add(r, { description: n }), r;
|
|
2541
2541
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2548,128 +2548,128 @@ const ui = (e, t) => {
|
|
|
2548
2548
|
return J.get(e);
|
|
2549
2549
|
const r = e.clone();
|
|
2550
2550
|
return J.add(r, n[0]), r;
|
|
2551
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)),
|
|
2552
|
-
|
|
2551
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), wt = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2552
|
+
$e.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, s) => Ro(e, r, o);
|
|
2553
2553
|
const n = e._zod.bag;
|
|
2554
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ vo(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ wo(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ zo(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ $o(...r)), e.min = (...r) => e.check(/* @__PURE__ */
|
|
2554
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ vo(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ wo(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ zo(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ $o(...r)), e.min = (...r) => e.check(/* @__PURE__ */ ne(...r)), e.max = (...r) => e.check(/* @__PURE__ */ mt(...r)), e.length = (...r) => e.check(/* @__PURE__ */ gt(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ ne(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ bo(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ yo(r)), e.trim = () => e.check(/* @__PURE__ */ So()), e.normalize = (...r) => e.check(/* @__PURE__ */ ko(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Zo()), e.toUpperCase = () => e.check(/* @__PURE__ */ Oo()), e.slugify = () => e.check(/* @__PURE__ */ To());
|
|
2555
2555
|
}), zi = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2556
|
-
|
|
2556
|
+
$e.init(e, t), wt.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Mr($i, n)), e.url = (n) => e.check(/* @__PURE__ */ Vr(ki, n)), e.jwt = (n) => e.check(/* @__PURE__ */ co(Fi, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Hr(Si, n)), e.guid = (n) => e.check(/* @__PURE__ */ je(Le, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Ur(Q, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Jr(Q, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Wr(Q, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Br(Q, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Yr(Zi, n)), e.guid = (n) => e.check(/* @__PURE__ */ je(Le, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Gr(Oi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Kr(Ti, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Xr(Ei, n)), e.base64 = (n) => e.check(/* @__PURE__ */ oo(ji, n)), e.base64url = (n) => e.check(/* @__PURE__ */ io(Ci, n)), e.xid = (n) => e.check(/* @__PURE__ */ qr(Ai, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Qr(Ii, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ eo(Ni, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ to(Pi, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ no(xi, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ ro(Ri, n)), e.e164 = (n) => e.check(/* @__PURE__ */ so(Di, n)), e.datetime = (n) => e.check(ni(n)), e.date = (n) => e.check(oi(n)), e.time = (n) => e.check(si(n)), e.duration = (n) => e.check(ai(n));
|
|
2557
2557
|
});
|
|
2558
2558
|
function N(e) {
|
|
2559
2559
|
return /* @__PURE__ */ Lr(zi, e);
|
|
2560
2560
|
}
|
|
2561
|
-
const
|
|
2562
|
-
v.init(e, t),
|
|
2561
|
+
const y = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
2562
|
+
v.init(e, t), wt.init(e, t);
|
|
2563
2563
|
}), $i = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2564
|
-
Yn.init(e, t),
|
|
2565
|
-
}),
|
|
2566
|
-
Vn.init(e, t),
|
|
2567
|
-
}),
|
|
2568
|
-
Hn.init(e, t),
|
|
2564
|
+
Yn.init(e, t), y.init(e, t);
|
|
2565
|
+
}), Le = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
2566
|
+
Vn.init(e, t), y.init(e, t);
|
|
2567
|
+
}), Q = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2568
|
+
Hn.init(e, t), y.init(e, t);
|
|
2569
2569
|
}), ki = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2570
|
-
Gn.init(e, t),
|
|
2570
|
+
Gn.init(e, t), y.init(e, t);
|
|
2571
2571
|
}), Si = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2572
|
-
Kn.init(e, t),
|
|
2572
|
+
Kn.init(e, t), y.init(e, t);
|
|
2573
2573
|
}), Zi = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
|
|
2574
|
-
Xn.init(e, t),
|
|
2574
|
+
Xn.init(e, t), y.init(e, t);
|
|
2575
2575
|
}), Oi = /* @__PURE__ */ u("ZodCUID", (e, t) => {
|
|
2576
|
-
qn.init(e, t),
|
|
2576
|
+
qn.init(e, t), y.init(e, t);
|
|
2577
2577
|
}), Ti = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
|
|
2578
|
-
Qn.init(e, t),
|
|
2579
|
-
}),
|
|
2580
|
-
er.init(e, t),
|
|
2581
|
-
}),
|
|
2582
|
-
tr.init(e, t),
|
|
2578
|
+
Qn.init(e, t), y.init(e, t);
|
|
2579
|
+
}), Ei = /* @__PURE__ */ u("ZodULID", (e, t) => {
|
|
2580
|
+
er.init(e, t), y.init(e, t);
|
|
2581
|
+
}), Ai = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2582
|
+
tr.init(e, t), y.init(e, t);
|
|
2583
2583
|
}), Ii = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
|
|
2584
|
-
nr.init(e, t),
|
|
2584
|
+
nr.init(e, t), y.init(e, t);
|
|
2585
2585
|
}), Ni = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
|
|
2586
|
-
cr.init(e, t),
|
|
2586
|
+
cr.init(e, t), y.init(e, t);
|
|
2587
2587
|
}), Pi = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
|
|
2588
|
-
ar.init(e, t),
|
|
2588
|
+
ar.init(e, t), y.init(e, t);
|
|
2589
2589
|
}), xi = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
|
|
2590
|
-
ur.init(e, t),
|
|
2591
|
-
}),
|
|
2592
|
-
lr.init(e, t),
|
|
2593
|
-
}),
|
|
2594
|
-
fr.init(e, t),
|
|
2595
|
-
}),
|
|
2596
|
-
dr.init(e, t),
|
|
2597
|
-
}),
|
|
2598
|
-
hr.init(e, t),
|
|
2599
|
-
}),
|
|
2600
|
-
gr.init(e, t),
|
|
2601
|
-
}),
|
|
2602
|
-
|
|
2590
|
+
ur.init(e, t), y.init(e, t);
|
|
2591
|
+
}), Ri = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
|
|
2592
|
+
lr.init(e, t), y.init(e, t);
|
|
2593
|
+
}), ji = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2594
|
+
fr.init(e, t), y.init(e, t);
|
|
2595
|
+
}), Ci = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
|
|
2596
|
+
dr.init(e, t), y.init(e, t);
|
|
2597
|
+
}), Di = /* @__PURE__ */ u("ZodE164", (e, t) => {
|
|
2598
|
+
hr.init(e, t), y.init(e, t);
|
|
2599
|
+
}), Fi = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2600
|
+
gr.init(e, t), y.init(e, t);
|
|
2601
|
+
}), zt = /* @__PURE__ */ u("ZodNumber", (e, t) => {
|
|
2602
|
+
lt.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, s) => jo(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ De(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ de(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ de(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ Ce(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ pe(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ pe(r, o)), e.int = (r) => e.check(Me(r)), e.safe = (r) => e.check(Me(r)), e.positive = (r) => e.check(/* @__PURE__ */ De(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ de(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ Ce(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ pe(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ Fe(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ Fe(r, o)), e.finite = () => e;
|
|
2603
2603
|
const n = e._zod.bag;
|
|
2604
2604
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2605
2605
|
});
|
|
2606
2606
|
function _(e) {
|
|
2607
|
-
return /* @__PURE__ */ po(
|
|
2607
|
+
return /* @__PURE__ */ po(zt, e);
|
|
2608
2608
|
}
|
|
2609
2609
|
const Li = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
|
|
2610
|
-
_r.init(e, t),
|
|
2610
|
+
_r.init(e, t), zt.init(e, t);
|
|
2611
2611
|
});
|
|
2612
|
-
function
|
|
2612
|
+
function Me(e) {
|
|
2613
2613
|
return /* @__PURE__ */ ho(Li, e);
|
|
2614
2614
|
}
|
|
2615
2615
|
const Mi = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
|
|
2616
|
-
vr.init(e, t),
|
|
2616
|
+
vr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Co(e, n, r);
|
|
2617
2617
|
});
|
|
2618
|
-
function
|
|
2618
|
+
function Ue(e) {
|
|
2619
2619
|
return /* @__PURE__ */ mo(Mi, e);
|
|
2620
2620
|
}
|
|
2621
2621
|
const Ui = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2622
|
-
br.init(e, t),
|
|
2622
|
+
br.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Fo();
|
|
2623
2623
|
});
|
|
2624
|
-
function
|
|
2624
|
+
function Je() {
|
|
2625
2625
|
return /* @__PURE__ */ go(Ui);
|
|
2626
2626
|
}
|
|
2627
2627
|
const Ji = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
2628
|
-
yr.init(e, t),
|
|
2628
|
+
yr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Do(e, n, r);
|
|
2629
2629
|
});
|
|
2630
2630
|
function Wi(e) {
|
|
2631
2631
|
return /* @__PURE__ */ _o(Ji, e);
|
|
2632
2632
|
}
|
|
2633
2633
|
const Bi = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2634
|
-
wr.init(e, t),
|
|
2634
|
+
wr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Wo(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ ne(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ ne(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ mt(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ gt(n, r)), e.unwrap = () => e.element;
|
|
2635
2635
|
});
|
|
2636
|
-
function
|
|
2637
|
-
return /* @__PURE__ */
|
|
2636
|
+
function oe(e, t) {
|
|
2637
|
+
return /* @__PURE__ */ Eo(Bi, e, t);
|
|
2638
2638
|
}
|
|
2639
2639
|
const Vi = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2640
|
-
$r.init(e, t),
|
|
2640
|
+
$r.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Bo(e, n, r, o), g(e, "shape", () => t.shape), e.keyof = () => kt(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Je() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Je() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Wi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Ut(e, n), e.safeExtend = (n) => Jt(e, n), e.merge = (n) => Wt(e, n), e.pick = (n) => Lt(e, n), e.omit = (n) => Mt(e, n), e.partial = (...n) => Bt(St, e, n[0]), e.required = (...n) => Vt(Zt, e, n[0]);
|
|
2641
2641
|
});
|
|
2642
|
-
function
|
|
2642
|
+
function le(e, t) {
|
|
2643
2643
|
const n = {
|
|
2644
2644
|
type: "object",
|
|
2645
2645
|
shape: e ?? {},
|
|
2646
|
-
...
|
|
2646
|
+
...h(t)
|
|
2647
2647
|
};
|
|
2648
2648
|
return new Vi(n);
|
|
2649
2649
|
}
|
|
2650
|
-
const
|
|
2651
|
-
|
|
2650
|
+
const $t = /* @__PURE__ */ u("ZodUnion", (e, t) => {
|
|
2651
|
+
dt.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Vo(e, n, r, o), e.options = t.options;
|
|
2652
2652
|
});
|
|
2653
2653
|
function Hi(e, t) {
|
|
2654
|
-
return new
|
|
2654
|
+
return new $t({
|
|
2655
2655
|
type: "union",
|
|
2656
2656
|
options: e,
|
|
2657
|
-
...
|
|
2657
|
+
...h(t)
|
|
2658
2658
|
});
|
|
2659
2659
|
}
|
|
2660
2660
|
const Yi = /* @__PURE__ */ u("ZodDiscriminatedUnion", (e, t) => {
|
|
2661
|
-
|
|
2661
|
+
$t.init(e, t), kr.init(e, t);
|
|
2662
2662
|
});
|
|
2663
2663
|
function Gi(e, t, n) {
|
|
2664
2664
|
return new Yi({
|
|
2665
2665
|
type: "union",
|
|
2666
2666
|
options: t,
|
|
2667
2667
|
discriminator: e,
|
|
2668
|
-
...
|
|
2668
|
+
...h(n)
|
|
2669
2669
|
});
|
|
2670
2670
|
}
|
|
2671
2671
|
const Ki = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
|
|
2672
|
-
Sr.init(e, t),
|
|
2672
|
+
Sr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ho(e, n, r, o);
|
|
2673
2673
|
});
|
|
2674
2674
|
function Xi(e, t) {
|
|
2675
2675
|
return new Ki({
|
|
@@ -2678,8 +2678,8 @@ function Xi(e, t) {
|
|
|
2678
2678
|
right: t
|
|
2679
2679
|
});
|
|
2680
2680
|
}
|
|
2681
|
-
const
|
|
2682
|
-
Zr.init(e, t),
|
|
2681
|
+
const ie = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
2682
|
+
Zr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, s) => Lo(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2683
2683
|
const n = new Set(Object.keys(t.entries));
|
|
2684
2684
|
e.extract = (r, o) => {
|
|
2685
2685
|
const s = {};
|
|
@@ -2688,10 +2688,10 @@ const oe = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
|
2688
2688
|
s[i] = t.entries[i];
|
|
2689
2689
|
else
|
|
2690
2690
|
throw new Error(`Key ${i} not found in enum`);
|
|
2691
|
-
return new
|
|
2691
|
+
return new ie({
|
|
2692
2692
|
...t,
|
|
2693
2693
|
checks: [],
|
|
2694
|
-
...
|
|
2694
|
+
...h(o),
|
|
2695
2695
|
entries: s
|
|
2696
2696
|
});
|
|
2697
2697
|
}, e.exclude = (r, o) => {
|
|
@@ -2701,31 +2701,31 @@ const oe = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
|
2701
2701
|
delete s[i];
|
|
2702
2702
|
else
|
|
2703
2703
|
throw new Error(`Key ${i} not found in enum`);
|
|
2704
|
-
return new
|
|
2704
|
+
return new ie({
|
|
2705
2705
|
...t,
|
|
2706
2706
|
checks: [],
|
|
2707
|
-
...
|
|
2707
|
+
...h(o),
|
|
2708
2708
|
entries: s
|
|
2709
2709
|
});
|
|
2710
2710
|
};
|
|
2711
2711
|
});
|
|
2712
|
-
function
|
|
2712
|
+
function kt(e, t) {
|
|
2713
2713
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2714
|
-
return new
|
|
2714
|
+
return new ie({
|
|
2715
2715
|
type: "enum",
|
|
2716
2716
|
entries: n,
|
|
2717
|
-
...
|
|
2717
|
+
...h(t)
|
|
2718
2718
|
});
|
|
2719
2719
|
}
|
|
2720
2720
|
function k(e, t) {
|
|
2721
|
-
return new
|
|
2721
|
+
return new ie({
|
|
2722
2722
|
type: "enum",
|
|
2723
2723
|
entries: e,
|
|
2724
|
-
...
|
|
2724
|
+
...h(t)
|
|
2725
2725
|
});
|
|
2726
2726
|
}
|
|
2727
2727
|
const qi = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
2728
|
-
Or.init(e, t),
|
|
2728
|
+
Or.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Mo(e, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
2729
2729
|
get() {
|
|
2730
2730
|
if (t.values.length > 1)
|
|
2731
2731
|
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
@@ -2733,17 +2733,17 @@ const qi = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
|
2733
2733
|
}
|
|
2734
2734
|
});
|
|
2735
2735
|
});
|
|
2736
|
-
function
|
|
2736
|
+
function R(e, t) {
|
|
2737
2737
|
return new qi({
|
|
2738
2738
|
type: "literal",
|
|
2739
2739
|
values: Array.isArray(e) ? e : [e],
|
|
2740
|
-
...
|
|
2740
|
+
...h(t)
|
|
2741
2741
|
});
|
|
2742
2742
|
}
|
|
2743
2743
|
const Qi = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
2744
|
-
Tr.init(e, t),
|
|
2744
|
+
Tr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Jo(e, n), e._zod.parse = (n, r) => {
|
|
2745
2745
|
if (r.direction === "backward")
|
|
2746
|
-
throw new
|
|
2746
|
+
throw new Ye(e.constructor.name);
|
|
2747
2747
|
n.addIssue = (s) => {
|
|
2748
2748
|
if (typeof s == "string")
|
|
2749
2749
|
n.issues.push(H(s, n.value, t));
|
|
@@ -2762,17 +2762,17 @@ function es(e) {
|
|
|
2762
2762
|
transform: e
|
|
2763
2763
|
});
|
|
2764
2764
|
}
|
|
2765
|
-
const
|
|
2766
|
-
|
|
2765
|
+
const St = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
2766
|
+
ht.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => yt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2767
2767
|
});
|
|
2768
|
-
function
|
|
2769
|
-
return new
|
|
2768
|
+
function We(e) {
|
|
2769
|
+
return new St({
|
|
2770
2770
|
type: "optional",
|
|
2771
2771
|
innerType: e
|
|
2772
2772
|
});
|
|
2773
2773
|
}
|
|
2774
2774
|
const ts = /* @__PURE__ */ u("ZodExactOptional", (e, t) => {
|
|
2775
|
-
|
|
2775
|
+
Er.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => yt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2776
2776
|
});
|
|
2777
2777
|
function ns(e) {
|
|
2778
2778
|
return new ts({
|
|
@@ -2781,50 +2781,50 @@ function ns(e) {
|
|
|
2781
2781
|
});
|
|
2782
2782
|
}
|
|
2783
2783
|
const rs = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
2784
|
-
|
|
2784
|
+
Ar.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Yo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2785
2785
|
});
|
|
2786
|
-
function
|
|
2786
|
+
function Be(e) {
|
|
2787
2787
|
return new rs({
|
|
2788
2788
|
type: "nullable",
|
|
2789
2789
|
innerType: e
|
|
2790
2790
|
});
|
|
2791
2791
|
}
|
|
2792
2792
|
const os = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
2793
|
-
Ir.init(e, t),
|
|
2793
|
+
Ir.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ko(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2794
2794
|
});
|
|
2795
2795
|
function is(e, t) {
|
|
2796
2796
|
return new os({
|
|
2797
2797
|
type: "default",
|
|
2798
2798
|
innerType: e,
|
|
2799
2799
|
get defaultValue() {
|
|
2800
|
-
return typeof t == "function" ? t() :
|
|
2800
|
+
return typeof t == "function" ? t() : qe(t);
|
|
2801
2801
|
}
|
|
2802
2802
|
});
|
|
2803
2803
|
}
|
|
2804
2804
|
const ss = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
|
|
2805
|
-
Nr.init(e, t),
|
|
2805
|
+
Nr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Xo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2806
2806
|
});
|
|
2807
2807
|
function cs(e, t) {
|
|
2808
2808
|
return new ss({
|
|
2809
2809
|
type: "prefault",
|
|
2810
2810
|
innerType: e,
|
|
2811
2811
|
get defaultValue() {
|
|
2812
|
-
return typeof t == "function" ? t() :
|
|
2812
|
+
return typeof t == "function" ? t() : qe(t);
|
|
2813
2813
|
}
|
|
2814
2814
|
});
|
|
2815
2815
|
}
|
|
2816
|
-
const
|
|
2817
|
-
Pr.init(e, t),
|
|
2816
|
+
const Zt = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
|
|
2817
|
+
Pr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Go(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2818
2818
|
});
|
|
2819
2819
|
function as(e, t) {
|
|
2820
|
-
return new
|
|
2820
|
+
return new Zt({
|
|
2821
2821
|
type: "nonoptional",
|
|
2822
2822
|
innerType: e,
|
|
2823
|
-
...
|
|
2823
|
+
...h(t)
|
|
2824
2824
|
});
|
|
2825
2825
|
}
|
|
2826
2826
|
const us = /* @__PURE__ */ u("ZodCatch", (e, t) => {
|
|
2827
|
-
xr.init(e, t),
|
|
2827
|
+
xr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => qo(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2828
2828
|
});
|
|
2829
2829
|
function ls(e, t) {
|
|
2830
2830
|
return new us({
|
|
@@ -2834,9 +2834,9 @@ function ls(e, t) {
|
|
|
2834
2834
|
});
|
|
2835
2835
|
}
|
|
2836
2836
|
const fs = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
2837
|
-
|
|
2837
|
+
Rr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Qo(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
2838
2838
|
});
|
|
2839
|
-
function
|
|
2839
|
+
function Ve(e, t) {
|
|
2840
2840
|
return new fs({
|
|
2841
2841
|
type: "pipe",
|
|
2842
2842
|
in: e,
|
|
@@ -2845,7 +2845,7 @@ function He(e, t) {
|
|
|
2845
2845
|
});
|
|
2846
2846
|
}
|
|
2847
2847
|
const ps = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
|
|
2848
|
-
|
|
2848
|
+
jr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ei(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2849
2849
|
});
|
|
2850
2850
|
function ds(e) {
|
|
2851
2851
|
return new ps({
|
|
@@ -2854,10 +2854,10 @@ function ds(e) {
|
|
|
2854
2854
|
});
|
|
2855
2855
|
}
|
|
2856
2856
|
const hs = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
2857
|
-
|
|
2857
|
+
Cr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Uo(e, n);
|
|
2858
2858
|
});
|
|
2859
2859
|
function ms(e, t = {}) {
|
|
2860
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ Ao(hs, e, t);
|
|
2861
2861
|
}
|
|
2862
2862
|
function gs(e) {
|
|
2863
2863
|
return /* @__PURE__ */ Io(e);
|
|
@@ -2897,10 +2897,10 @@ const _s = {
|
|
|
2897
2897
|
Half: "B"
|
|
2898
2898
|
}, Ts = k(
|
|
2899
2899
|
Os
|
|
2900
|
-
),
|
|
2900
|
+
), Es = {
|
|
2901
2901
|
Enable: "Y",
|
|
2902
2902
|
Disable: "N"
|
|
2903
|
-
},
|
|
2903
|
+
}, As = k(Es), Is = {
|
|
2904
2904
|
TearOff: "T",
|
|
2905
2905
|
PeelOff: "P",
|
|
2906
2906
|
Rewind: "R",
|
|
@@ -2912,35 +2912,35 @@ const _s = {
|
|
|
2912
2912
|
}, Ns = k(Is), Ps = {
|
|
2913
2913
|
Prepeel: "Y",
|
|
2914
2914
|
NoPrepeel: "N"
|
|
2915
|
-
}, xs = k(Ps),
|
|
2915
|
+
}, xs = k(Ps), Rs = {
|
|
2916
2916
|
AllMedia: "Y",
|
|
2917
2917
|
ContinuousOnly: "N"
|
|
2918
|
-
},
|
|
2918
|
+
}, js = k(Rs), _e = {
|
|
2919
2919
|
NoRotation: "N",
|
|
2920
2920
|
Rotate90: "R",
|
|
2921
2921
|
Rotate180: "I",
|
|
2922
2922
|
Rotate270: "B"
|
|
2923
|
-
},
|
|
2923
|
+
}, Ot = k(_e), Tt = {
|
|
2924
2924
|
Left: "L",
|
|
2925
2925
|
Right: "R",
|
|
2926
2926
|
Center: "C",
|
|
2927
2927
|
Justified: "J"
|
|
2928
|
-
},
|
|
2928
|
+
}, Cs = k(Tt), ee = {
|
|
2929
2929
|
Left: "L",
|
|
2930
2930
|
Right: "R",
|
|
2931
2931
|
Center: "C"
|
|
2932
|
-
},
|
|
2932
|
+
}, Ds = k(ee), Fs = {
|
|
2933
2933
|
Highest: "H",
|
|
2934
2934
|
High: "Q",
|
|
2935
2935
|
Medium: "M",
|
|
2936
2936
|
Lower: "L"
|
|
2937
|
-
}, Ls = k(
|
|
2937
|
+
}, Ls = k(Fs), Ms = {
|
|
2938
2938
|
Yes: "Y",
|
|
2939
2939
|
No: "N"
|
|
2940
|
-
},
|
|
2940
|
+
}, he = k(Ms), G = {
|
|
2941
2941
|
Start: "start",
|
|
2942
2942
|
End: "end"
|
|
2943
|
-
}, Us = k(
|
|
2943
|
+
}, Us = k(G), Js = {
|
|
2944
2944
|
account: "account",
|
|
2945
2945
|
accountAttributes: "accountAttributes",
|
|
2946
2946
|
accountTiers: "accountTiers",
|
|
@@ -2953,11 +2953,11 @@ const _s = {
|
|
|
2953
2953
|
Uppercase: "Uppercase",
|
|
2954
2954
|
Lowercase: "Lowercase",
|
|
2955
2955
|
Capitalize: "Capitalize"
|
|
2956
|
-
}, Bs = k(W), Vs =
|
|
2956
|
+
}, Bs = k(W), Vs = le({
|
|
2957
2957
|
word: N(),
|
|
2958
2958
|
width: _().min(0),
|
|
2959
2959
|
spaceWidth: _().min(0)
|
|
2960
|
-
}),
|
|
2960
|
+
}), fe = le({
|
|
2961
2961
|
name: N(),
|
|
2962
2962
|
x: _().int(),
|
|
2963
2963
|
y: _().int(),
|
|
@@ -2966,54 +2966,54 @@ const _s = {
|
|
|
2966
2966
|
sourceType: Ws,
|
|
2967
2967
|
sourceLookup: N(),
|
|
2968
2968
|
sourceSeperator: N(),
|
|
2969
|
-
hideEmpty:
|
|
2970
|
-
editable:
|
|
2971
|
-
}), Hs =
|
|
2972
|
-
type:
|
|
2969
|
+
hideEmpty: Ue(),
|
|
2970
|
+
editable: Ue()
|
|
2971
|
+
}), Hs = fe.extend({
|
|
2972
|
+
type: R("text"),
|
|
2973
2973
|
// ^A font, height
|
|
2974
2974
|
font: N().regex(/^[A-Z0-9]$/, "Font must be a single character A-Z or 0-9"),
|
|
2975
|
-
fontOrientation:
|
|
2975
|
+
fontOrientation: Ot,
|
|
2976
2976
|
fontHeight: _().int().min(1).max(32e3),
|
|
2977
2977
|
// ^FB maxWidth, maxLines, lineSpacing, alignment, hangingIndent
|
|
2978
2978
|
maxWidth: _().int().min(0).max(9999),
|
|
2979
2979
|
maxLines: _().int().min(1).max(9999),
|
|
2980
2980
|
lineSpacing: _().int().min(-9999).max(9999),
|
|
2981
|
-
alignment:
|
|
2981
|
+
alignment: Cs,
|
|
2982
2982
|
hangingIndent: _().int().min(0).max(9999),
|
|
2983
2983
|
// CUSTOM
|
|
2984
2984
|
charsPerLine: _().int().min(1).max(100),
|
|
2985
2985
|
transformation: Bs,
|
|
2986
2986
|
maxCharacters: _().int().min(1).max(100),
|
|
2987
2987
|
measuredWidth: _().min(0).optional(),
|
|
2988
|
-
wordWidths:
|
|
2988
|
+
wordWidths: oe(Vs).optional(),
|
|
2989
2989
|
minFontHeight: _().int().min(1).max(32e3).optional()
|
|
2990
|
-
}), Ys =
|
|
2991
|
-
type:
|
|
2990
|
+
}), Ys = fe.extend({
|
|
2991
|
+
type: R("barcode"),
|
|
2992
2992
|
// ^BY barWidth
|
|
2993
2993
|
barWidth: _().int().min(1).max(100),
|
|
2994
2994
|
// ^BC orientation, height, line, lineAbove, checkDigit
|
|
2995
|
-
orientation:
|
|
2995
|
+
orientation: Ot,
|
|
2996
2996
|
height: _().int().min(1).max(32e3),
|
|
2997
|
-
line:
|
|
2998
|
-
lineAbove:
|
|
2999
|
-
checkDigit:
|
|
2997
|
+
line: he,
|
|
2998
|
+
lineAbove: he,
|
|
2999
|
+
checkDigit: he,
|
|
3000
3000
|
// Horizontal anchor: which point on the barcode lines up with x.
|
|
3001
3001
|
// Left (default when omitted) → x is the left edge of the barcode
|
|
3002
3002
|
// Center → x is the horizontal center
|
|
3003
3003
|
// Right → x is the right edge
|
|
3004
3004
|
// Vertical anchor is controlled by `verticalAlignment` (Start → ^FO top edge,
|
|
3005
3005
|
// End → ^FT bottom edge), so the two fields combine to address 6 anchor points.
|
|
3006
|
-
alignment:
|
|
3007
|
-
}), Gs =
|
|
3008
|
-
type:
|
|
3006
|
+
alignment: Ds.optional()
|
|
3007
|
+
}), Gs = fe.extend({
|
|
3008
|
+
type: R("qrcode"),
|
|
3009
3009
|
// ^BQ orientation, model, magnification, errorCorrection, mask
|
|
3010
|
-
orientation:
|
|
3011
|
-
model:
|
|
3010
|
+
orientation: R("N"),
|
|
3011
|
+
model: R("2"),
|
|
3012
3012
|
magnification: _().int().min(1).max(100),
|
|
3013
3013
|
errorCorrection: Ls,
|
|
3014
3014
|
mask: _().int().min(0).max(7)
|
|
3015
|
-
}), Ks =
|
|
3016
|
-
type:
|
|
3015
|
+
}), Ks = fe.extend({
|
|
3016
|
+
type: R("image"),
|
|
3017
3017
|
// ^CF imagePath
|
|
3018
3018
|
data: N(),
|
|
3019
3019
|
// When set, the image renders only if the resolved source value equals the
|
|
@@ -3025,9 +3025,9 @@ const _s = {
|
|
|
3025
3025
|
Ys,
|
|
3026
3026
|
Gs,
|
|
3027
3027
|
Ks
|
|
3028
|
-
]), qs =
|
|
3028
|
+
]), qs = le({
|
|
3029
3029
|
alias: N().length(1),
|
|
3030
|
-
name:
|
|
3030
|
+
name: kt([
|
|
3031
3031
|
// DEFAULT
|
|
3032
3032
|
"Arial",
|
|
3033
3033
|
"Open Sans",
|
|
@@ -3042,7 +3042,10 @@ const _s = {
|
|
|
3042
3042
|
"Paris",
|
|
3043
3043
|
"London",
|
|
3044
3044
|
"GT Walsheim",
|
|
3045
|
-
"Domain Display"
|
|
3045
|
+
"Domain Display",
|
|
3046
|
+
// PAPARAZZI
|
|
3047
|
+
"Editors Note Light",
|
|
3048
|
+
"Editors Note Medium"
|
|
3046
3049
|
])
|
|
3047
3050
|
}), Qs = {
|
|
3048
3051
|
// DEFAULT
|
|
@@ -3059,9 +3062,12 @@ const _s = {
|
|
|
3059
3062
|
Paris: "PARIS.TTF",
|
|
3060
3063
|
London: "LONDON.TTF",
|
|
3061
3064
|
"GT Walsheim": "GT_WALSHEIM.TTF",
|
|
3062
|
-
"Domain Display": "DOMAIN_DISPLAY.TTF"
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
+
"Domain Display": "DOMAIN_DISPLAY.TTF",
|
|
3066
|
+
// PAPARAZZI
|
|
3067
|
+
"Editors Note Light": "EDITORS_NOTE_LIGHT.TTF",
|
|
3068
|
+
"Editors Note Medium": "EDITORS_NOTE_MEDIUM.TTF"
|
|
3069
|
+
}, Et = le({
|
|
3070
|
+
type: R("thermal"),
|
|
3065
3071
|
// ~TA adjustment
|
|
3066
3072
|
tearOffAdjustment: _().int().min(0).max(120),
|
|
3067
3073
|
// ~JS sequence
|
|
@@ -3087,7 +3093,7 @@ const _s = {
|
|
|
3087
3093
|
// ~SD darkness
|
|
3088
3094
|
darkness: _().int().min(0).max(30),
|
|
3089
3095
|
// ^LR reverse
|
|
3090
|
-
reverse:
|
|
3096
|
+
reverse: As,
|
|
3091
3097
|
// ^MM mode, prepeel
|
|
3092
3098
|
postPrintMode: Ns,
|
|
3093
3099
|
prepeel: xs,
|
|
@@ -3095,10 +3101,10 @@ const _s = {
|
|
|
3095
3101
|
printWidth: _().int().min(2),
|
|
3096
3102
|
// ^LL length, allMedia
|
|
3097
3103
|
labelLength: _().int().min(1).max(32e3),
|
|
3098
|
-
allMedia:
|
|
3104
|
+
allMedia: js,
|
|
3099
3105
|
// Fields
|
|
3100
|
-
fields:
|
|
3101
|
-
fonts:
|
|
3106
|
+
fields: oe(Xs),
|
|
3107
|
+
fonts: oe(qs)
|
|
3102
3108
|
});
|
|
3103
3109
|
function mc(e) {
|
|
3104
3110
|
return Et.safeParse(e);
|
|
@@ -3106,7 +3112,7 @@ function mc(e) {
|
|
|
3106
3112
|
function gc(e) {
|
|
3107
3113
|
return Et.parse(e);
|
|
3108
3114
|
}
|
|
3109
|
-
const
|
|
3115
|
+
const At = 1.05;
|
|
3110
3116
|
function _c(e, t, n) {
|
|
3111
3117
|
if (e.type === "thermal")
|
|
3112
3118
|
return ec(e, t, n);
|
|
@@ -3171,49 +3177,49 @@ function rc(e, t) {
|
|
|
3171
3177
|
let i;
|
|
3172
3178
|
for (const c of s) {
|
|
3173
3179
|
const a = c.match(/^(.+)\[(\d+)\]$/), l = a ? a[1].trim() : c, f = a ? parseInt(a[2], 10) : void 0;
|
|
3174
|
-
let
|
|
3180
|
+
let d;
|
|
3175
3181
|
switch (e.sourceType) {
|
|
3176
3182
|
case "account":
|
|
3177
|
-
|
|
3183
|
+
d = t.account[l];
|
|
3178
3184
|
break;
|
|
3179
3185
|
case "accountAttributes":
|
|
3180
|
-
|
|
3186
|
+
d = t.accountAttributes.find(
|
|
3181
3187
|
(p) => p.id === l
|
|
3182
3188
|
)?.value;
|
|
3183
3189
|
break;
|
|
3184
3190
|
case "accountTiers":
|
|
3185
|
-
|
|
3191
|
+
d = t.accountTier?.name;
|
|
3186
3192
|
break;
|
|
3187
3193
|
case "pass":
|
|
3188
|
-
|
|
3194
|
+
d = t.pass[l];
|
|
3189
3195
|
break;
|
|
3190
3196
|
case "passResponses":
|
|
3191
|
-
|
|
3197
|
+
d = t.passResponses.find(
|
|
3192
3198
|
(p) => p.name === l || p.id === l
|
|
3193
3199
|
)?.value;
|
|
3194
3200
|
break;
|
|
3195
3201
|
case "passAttributes":
|
|
3196
|
-
|
|
3202
|
+
d = t.passAttributes.find(
|
|
3197
3203
|
(p) => p.name === l || p.id === l
|
|
3198
3204
|
)?.value;
|
|
3199
3205
|
break;
|
|
3200
3206
|
case "passAddOns":
|
|
3201
|
-
|
|
3207
|
+
d = t.passAddOns?.find(
|
|
3202
3208
|
({ addOn: p }) => p.name === l || p.id === l
|
|
3203
3209
|
)?.addOn.name;
|
|
3204
3210
|
break;
|
|
3205
3211
|
default:
|
|
3206
|
-
|
|
3212
|
+
d = "";
|
|
3207
3213
|
break;
|
|
3208
3214
|
}
|
|
3209
|
-
if (
|
|
3210
|
-
const p = String(
|
|
3215
|
+
if (d != null && d !== "") {
|
|
3216
|
+
const p = String(d);
|
|
3211
3217
|
if (f !== void 0) {
|
|
3212
|
-
const
|
|
3213
|
-
if (
|
|
3214
|
-
const
|
|
3215
|
-
if (
|
|
3216
|
-
i =
|
|
3218
|
+
const $ = p.split(",")[f];
|
|
3219
|
+
if ($ !== void 0) {
|
|
3220
|
+
const b = $.trim();
|
|
3221
|
+
if (b) {
|
|
3222
|
+
i = b;
|
|
3217
3223
|
break;
|
|
3218
3224
|
}
|
|
3219
3225
|
}
|
|
@@ -3247,97 +3253,102 @@ function oc(e, t) {
|
|
|
3247
3253
|
return e.maxCharacters !== void 0 && (t = t.slice(0, e.maxCharacters)), t;
|
|
3248
3254
|
}
|
|
3249
3255
|
function ic(e, t) {
|
|
3250
|
-
const n = e.fontOrientation
|
|
3251
|
-
let
|
|
3252
|
-
if (e.verticalAlignment ===
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3256
|
+
const n = e.fontOrientation;
|
|
3257
|
+
let r = ac(e, t), o = "^FO", s = e.maxLines;
|
|
3258
|
+
if (e.verticalAlignment === G.End)
|
|
3259
|
+
for (o = "^FT"; ; ) {
|
|
3260
|
+
const a = Y(e, t, r);
|
|
3261
|
+
s = Math.min(a, e.maxLines);
|
|
3262
|
+
const l = Y(e, t, r, 1);
|
|
3263
|
+
if (a > e.maxLines || a <= l) break;
|
|
3264
|
+
const f = Math.floor(r / At);
|
|
3265
|
+
if (f < (e.minFontHeight ?? 1)) break;
|
|
3266
|
+
r = f;
|
|
3267
|
+
}
|
|
3268
|
+
const i = `^A${e.font}${n},${r}`, c = `^FB${e.maxWidth},${s},${e.lineSpacing},${e.alignment},${e.hangingIndent}`;
|
|
3269
|
+
return e.alignment === Tt.Center && (t = t + "\\&"), `${o}${e.x},${e.y}${i}${c}^FD${t}^FS`;
|
|
3259
3270
|
}
|
|
3260
3271
|
function sc(e) {
|
|
3261
3272
|
return e.split("\\&").map((t) => t.split(/\s+/).filter(Boolean));
|
|
3262
3273
|
}
|
|
3263
|
-
function cc(e, t, n) {
|
|
3264
|
-
const
|
|
3265
|
-
if (!
|
|
3274
|
+
function cc(e, t, n, r) {
|
|
3275
|
+
const o = e.wordWidths;
|
|
3276
|
+
if (!o || o.length === 0 || e.maxWidth <= 0)
|
|
3266
3277
|
return;
|
|
3267
|
-
const
|
|
3268
|
-
if (
|
|
3269
|
-
for (let
|
|
3270
|
-
if (
|
|
3271
|
-
let
|
|
3272
|
-
for (const
|
|
3273
|
-
if (
|
|
3274
|
-
|
|
3278
|
+
const s = sc(t), i = s.flat();
|
|
3279
|
+
if (i.length !== o.length) return;
|
|
3280
|
+
for (let l = 0; l < i.length; l++)
|
|
3281
|
+
if (i[l] !== o[l].word) return;
|
|
3282
|
+
let c = 0, a = 0;
|
|
3283
|
+
for (const l of s) {
|
|
3284
|
+
if (l.length === 0) {
|
|
3285
|
+
c += 1;
|
|
3275
3286
|
continue;
|
|
3276
3287
|
}
|
|
3277
|
-
let
|
|
3278
|
-
for (let
|
|
3279
|
-
const
|
|
3280
|
-
if (
|
|
3281
|
-
|
|
3288
|
+
let f = 1, d = 0;
|
|
3289
|
+
for (let p = 0; p < l.length; p++, a++) {
|
|
3290
|
+
const m = o[a].width * n * r, $ = o[a].spaceWidth * n * r;
|
|
3291
|
+
if (d > 0 && d + $ + m <= e.maxWidth) {
|
|
3292
|
+
d += $ + m;
|
|
3282
3293
|
continue;
|
|
3283
3294
|
}
|
|
3284
|
-
|
|
3285
|
-
const
|
|
3286
|
-
|
|
3295
|
+
d > 0 && (f += 1);
|
|
3296
|
+
const b = Math.max(0, Math.ceil(m / e.maxWidth) - 1);
|
|
3297
|
+
f += b, d = m - b * e.maxWidth;
|
|
3287
3298
|
}
|
|
3288
|
-
|
|
3299
|
+
c += f;
|
|
3289
3300
|
}
|
|
3290
|
-
return
|
|
3301
|
+
return c;
|
|
3291
3302
|
}
|
|
3292
|
-
function
|
|
3293
|
-
const
|
|
3294
|
-
if (
|
|
3303
|
+
function Y(e, t, n, r = At) {
|
|
3304
|
+
const o = e.fontHeight > 0 ? n / e.fontHeight : 1, s = cc(e, t, o, r);
|
|
3305
|
+
if (s !== void 0) return s;
|
|
3295
3306
|
if (e.measuredWidth !== void 0 && e.maxWidth > 0) {
|
|
3296
|
-
const
|
|
3297
|
-
return Math.max(1, Math.floor((
|
|
3307
|
+
const d = e.measuredWidth * o * r;
|
|
3308
|
+
return Math.max(1, Math.floor((d + 10) / e.maxWidth) + 1);
|
|
3298
3309
|
}
|
|
3299
|
-
const
|
|
3300
|
-
if (
|
|
3301
|
-
const
|
|
3302
|
-
let
|
|
3303
|
-
for (const
|
|
3304
|
-
|
|
3310
|
+
const i = t.split("\\&"), c = e.charsPerLine ?? 0;
|
|
3311
|
+
if (c <= 0) return i.length;
|
|
3312
|
+
const l = (o > 0 ? c / o : c) / r;
|
|
3313
|
+
let f = 0;
|
|
3314
|
+
for (const d of i)
|
|
3315
|
+
f += Math.max(
|
|
3305
3316
|
1,
|
|
3306
|
-
Math.ceil(
|
|
3317
|
+
Math.ceil(d.length / l)
|
|
3307
3318
|
);
|
|
3308
|
-
return
|
|
3319
|
+
return f;
|
|
3309
3320
|
}
|
|
3310
3321
|
function vc(e, t) {
|
|
3311
|
-
return
|
|
3322
|
+
return Y(e, t, e.fontHeight);
|
|
3312
3323
|
}
|
|
3313
3324
|
function ac(e, t) {
|
|
3314
3325
|
const n = e.minFontHeight ?? 1;
|
|
3315
|
-
if (e.fontHeight <= n ||
|
|
3326
|
+
if (e.fontHeight <= n || Y(e, t, e.fontHeight) <= e.maxLines)
|
|
3316
3327
|
return e.fontHeight;
|
|
3317
3328
|
let r = n, o = e.fontHeight, s = n;
|
|
3318
3329
|
for (; r <= o; ) {
|
|
3319
3330
|
const i = Math.floor((r + o) / 2);
|
|
3320
|
-
|
|
3331
|
+
Y(e, t, i) <= e.maxLines ? (s = i, r = i + 1) : o = i - 1;
|
|
3321
3332
|
}
|
|
3322
3333
|
return s;
|
|
3323
3334
|
}
|
|
3324
3335
|
function uc(e, t) {
|
|
3325
3336
|
return ((/^\d+$/.test(e) ? Math.ceil(e.length / 2) : e.length) * 11 + 35) * t;
|
|
3326
3337
|
}
|
|
3327
|
-
function
|
|
3338
|
+
function He(e, t) {
|
|
3328
3339
|
const n = uc(t, e.barWidth);
|
|
3329
|
-
return e.orientation ===
|
|
3340
|
+
return e.orientation === _e.Rotate90 || e.orientation === _e.Rotate270 ? e.height : n;
|
|
3330
3341
|
}
|
|
3331
3342
|
function lc(e, t) {
|
|
3332
3343
|
let n = "^FO";
|
|
3333
|
-
e.verticalAlignment ===
|
|
3344
|
+
e.verticalAlignment === G.End && (n = "^FT");
|
|
3334
3345
|
let r = e.x;
|
|
3335
|
-
const o = e.alignment ??
|
|
3336
|
-
if (o ===
|
|
3337
|
-
const c =
|
|
3346
|
+
const o = e.alignment ?? ee.Left;
|
|
3347
|
+
if (o === ee.Center) {
|
|
3348
|
+
const c = He(e, t);
|
|
3338
3349
|
r = e.x - Math.floor(c / 2);
|
|
3339
|
-
} else if (o ===
|
|
3340
|
-
const c =
|
|
3350
|
+
} else if (o === ee.Right) {
|
|
3351
|
+
const c = He(e, t);
|
|
3341
3352
|
r = e.x - c;
|
|
3342
3353
|
}
|
|
3343
3354
|
const s = `^BY${e.barWidth}`, i = `^BC${e.orientation},${e.height},${e.line},${e.lineAbove},${e.checkDigit},A`;
|
|
@@ -3345,7 +3356,7 @@ function lc(e, t) {
|
|
|
3345
3356
|
}
|
|
3346
3357
|
function fc(e, t) {
|
|
3347
3358
|
let n = "^FO";
|
|
3348
|
-
e.verticalAlignment ===
|
|
3359
|
+
e.verticalAlignment === G.End && (n = "^FT");
|
|
3349
3360
|
const r = `^BQ${e.orientation},${e.model},${e.magnification},${e.errorCorrection},${e.mask}`;
|
|
3350
3361
|
return `${n}${e.x},${e.y}${r}^FDQA,${t}^FS`;
|
|
3351
3362
|
}
|
|
@@ -3356,39 +3367,39 @@ function pc(e, t) {
|
|
|
3356
3367
|
function dc(e, t) {
|
|
3357
3368
|
if (t === "") return "";
|
|
3358
3369
|
let n = "^FO";
|
|
3359
|
-
return e.verticalAlignment ===
|
|
3370
|
+
return e.verticalAlignment === G.End && (n = "^FT"), `${n}${e.x},${e.y}^GF${e.data}^FS`;
|
|
3360
3371
|
}
|
|
3361
3372
|
export {
|
|
3362
|
-
|
|
3373
|
+
Rs as AllMediaMode,
|
|
3363
3374
|
_s as BackfeedAction,
|
|
3364
|
-
|
|
3375
|
+
ee as BarcodeAlignment,
|
|
3365
3376
|
Qs as FontFamilyToFontZPLName,
|
|
3366
|
-
|
|
3377
|
+
_e as FontOrientation,
|
|
3367
3378
|
bs as MediaType,
|
|
3368
3379
|
Ss as MirrorMode,
|
|
3369
3380
|
Is as PostPrintMode,
|
|
3370
3381
|
Ps as PrepeelMode,
|
|
3371
3382
|
Os as PrintDensityAdjustment,
|
|
3372
3383
|
$s as PrintOrientation,
|
|
3373
|
-
|
|
3374
|
-
|
|
3384
|
+
Fs as QRCodeErrorCorrection,
|
|
3385
|
+
Es as ReverseMode,
|
|
3375
3386
|
Js as SourceType,
|
|
3376
|
-
|
|
3387
|
+
Tt as TextAlignment,
|
|
3377
3388
|
W as TextTransformation,
|
|
3378
3389
|
ws as ThermalMediaType,
|
|
3379
|
-
|
|
3390
|
+
G as VerticalAlignment,
|
|
3380
3391
|
Ms as YesNo,
|
|
3381
|
-
|
|
3392
|
+
js as allMediaModeSchema,
|
|
3382
3393
|
oc as applyTextTransformation,
|
|
3383
3394
|
vs as backfeedActionSchema,
|
|
3384
3395
|
Et as badgeSchema,
|
|
3385
|
-
|
|
3396
|
+
Ds as barcodeAlignmentSchema,
|
|
3386
3397
|
Ys as barcodeFieldSchema,
|
|
3387
3398
|
ac as calculateFittedFontHeight,
|
|
3388
3399
|
vc as countLines,
|
|
3389
|
-
|
|
3400
|
+
Y as countLinesAtHeight,
|
|
3390
3401
|
Xs as fieldSchema,
|
|
3391
|
-
|
|
3402
|
+
Ot as fontOrientationSchema,
|
|
3392
3403
|
qs as fontSchema,
|
|
3393
3404
|
_c as generate,
|
|
3394
3405
|
rc as getFieldValue,
|
|
@@ -3401,9 +3412,9 @@ export {
|
|
|
3401
3412
|
ks as printOrientationSchema,
|
|
3402
3413
|
Ls as qrCodeErrorCorrectionSchema,
|
|
3403
3414
|
Gs as qrcodeFieldSchema,
|
|
3404
|
-
|
|
3415
|
+
As as reverseModeSchema,
|
|
3405
3416
|
Ws as sourceTypeSchema,
|
|
3406
|
-
|
|
3417
|
+
Cs as textAlignmentSchema,
|
|
3407
3418
|
Hs as textFieldSchema,
|
|
3408
3419
|
Bs as textTransformationSchema,
|
|
3409
3420
|
zs as thermalMediaTypeSchema,
|
|
@@ -3412,5 +3423,5 @@ export {
|
|
|
3412
3423
|
gc as validateBadgeOrThrow,
|
|
3413
3424
|
Us as verticalAlignmentSchema,
|
|
3414
3425
|
Vs as wordWidthSchema,
|
|
3415
|
-
|
|
3426
|
+
he as yesNoSchema
|
|
3416
3427
|
};
|