@connectedxm/zpl-generator 0.0.11 → 0.0.14
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 +502 -469
- package/dist/src/validate.d.ts +47 -4
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -37,14 +37,14 @@ class M extends Error {
|
|
|
37
37
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
class
|
|
40
|
+
class Be extends Error {
|
|
41
41
|
constructor(t) {
|
|
42
42
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const Ve = {};
|
|
46
46
|
function C(e) {
|
|
47
|
-
return
|
|
47
|
+
return Ve;
|
|
48
48
|
}
|
|
49
49
|
function We(e) {
|
|
50
50
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
@@ -80,13 +80,13 @@ function Et(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 we = /* @__PURE__ */ Symbol("evaluating");
|
|
84
84
|
function _(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 !== we)
|
|
89
|
+
return r === void 0 && (r = we, r = n()), r;
|
|
90
90
|
},
|
|
91
91
|
set(o) {
|
|
92
92
|
Object.defineProperty(e, t, {
|
|
@@ -105,7 +105,7 @@ function D(e, t, n) {
|
|
|
105
105
|
configurable: !0
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function P(...e) {
|
|
109
109
|
const t = {};
|
|
110
110
|
for (const n of e) {
|
|
111
111
|
const r = Object.getOwnPropertyDescriptors(n);
|
|
@@ -113,18 +113,18 @@ function A(...e) {
|
|
|
113
113
|
}
|
|
114
114
|
return Object.defineProperties({}, t);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function ze(e) {
|
|
117
117
|
return JSON.stringify(e);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function It(e) {
|
|
120
120
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
121
121
|
}
|
|
122
122
|
const Ye = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
123
123
|
};
|
|
124
|
-
function
|
|
124
|
+
function V(e) {
|
|
125
125
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const At = re(() => {
|
|
128
128
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
129
129
|
return !1;
|
|
130
130
|
try {
|
|
@@ -135,19 +135,19 @@ const It = re(() => {
|
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
function W(e) {
|
|
138
|
-
if (
|
|
138
|
+
if (V(e) === !1)
|
|
139
139
|
return !1;
|
|
140
140
|
const t = e.constructor;
|
|
141
141
|
if (t === void 0 || typeof t != "function")
|
|
142
142
|
return !0;
|
|
143
143
|
const n = t.prototype;
|
|
144
|
-
return !(
|
|
144
|
+
return !(V(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ge(e) {
|
|
147
147
|
return W(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
148
148
|
}
|
|
149
149
|
const Nt = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
150
|
-
function
|
|
150
|
+
function L(e) {
|
|
151
151
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
152
152
|
}
|
|
153
153
|
function j(e, t, n) {
|
|
@@ -170,18 +170,18 @@ function p(e) {
|
|
|
170
170
|
function Pt(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 jt = {
|
|
174
174
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
175
175
|
int32: [-2147483648, 2147483647],
|
|
176
176
|
uint32: [0, 4294967295],
|
|
177
177
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
178
178
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
179
179
|
};
|
|
180
|
-
function
|
|
180
|
+
function xt(e, t) {
|
|
181
181
|
const n = e._zod.def, r = n.checks;
|
|
182
182
|
if (r && r.length > 0)
|
|
183
183
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
184
|
-
const s =
|
|
184
|
+
const s = P(e._zod.def, {
|
|
185
185
|
get shape() {
|
|
186
186
|
const i = {};
|
|
187
187
|
for (const c in t) {
|
|
@@ -195,11 +195,11 @@ function jt(e, t) {
|
|
|
195
195
|
});
|
|
196
196
|
return j(e, s);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Ct(e, t) {
|
|
199
199
|
const n = e._zod.def, r = n.checks;
|
|
200
200
|
if (r && r.length > 0)
|
|
201
201
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
202
|
-
const s =
|
|
202
|
+
const s = P(e._zod.def, {
|
|
203
203
|
get shape() {
|
|
204
204
|
const i = { ...e._zod.def.shape };
|
|
205
205
|
for (const c in t) {
|
|
@@ -213,7 +213,7 @@ function xt(e, t) {
|
|
|
213
213
|
});
|
|
214
214
|
return j(e, s);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Rt(e, t) {
|
|
217
217
|
if (!W(t))
|
|
218
218
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
219
219
|
const n = e._zod.def.checks;
|
|
@@ -223,7 +223,7 @@ function Ct(e, t) {
|
|
|
223
223
|
if (Object.getOwnPropertyDescriptor(s, i) !== void 0)
|
|
224
224
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
225
225
|
}
|
|
226
|
-
const o =
|
|
226
|
+
const o = P(e._zod.def, {
|
|
227
227
|
get shape() {
|
|
228
228
|
const s = { ...e._zod.def.shape, ...t };
|
|
229
229
|
return D(this, "shape", s), s;
|
|
@@ -231,10 +231,10 @@ function Ct(e, t) {
|
|
|
231
231
|
});
|
|
232
232
|
return j(e, o);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Dt(e, t) {
|
|
235
235
|
if (!W(t))
|
|
236
236
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
237
|
-
const n =
|
|
237
|
+
const n = P(e._zod.def, {
|
|
238
238
|
get shape() {
|
|
239
239
|
const r = { ...e._zod.def.shape, ...t };
|
|
240
240
|
return D(this, "shape", r), r;
|
|
@@ -242,8 +242,8 @@ function Rt(e, t) {
|
|
|
242
242
|
});
|
|
243
243
|
return j(e, n);
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
const n =
|
|
245
|
+
function Ft(e, t) {
|
|
246
|
+
const n = P(e._zod.def, {
|
|
247
247
|
get shape() {
|
|
248
248
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
249
249
|
return D(this, "shape", r), r;
|
|
@@ -256,11 +256,11 @@ function Dt(e, t) {
|
|
|
256
256
|
});
|
|
257
257
|
return j(e, n);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Mt(e, t, n) {
|
|
260
260
|
const o = t._zod.def.checks;
|
|
261
261
|
if (o && o.length > 0)
|
|
262
262
|
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
263
|
-
const i =
|
|
263
|
+
const i = P(t._zod.def, {
|
|
264
264
|
get shape() {
|
|
265
265
|
const c = t._zod.def.shape, a = { ...c };
|
|
266
266
|
if (n)
|
|
@@ -284,8 +284,8 @@ function Ft(e, t, n) {
|
|
|
284
284
|
});
|
|
285
285
|
return j(t, i);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const r =
|
|
287
|
+
function Lt(e, t, n) {
|
|
288
|
+
const r = P(t._zod.def, {
|
|
289
289
|
get shape() {
|
|
290
290
|
const o = t._zod.def.shape, s = { ...o };
|
|
291
291
|
if (n)
|
|
@@ -316,7 +316,7 @@ function F(e, t = 0) {
|
|
|
316
316
|
return !0;
|
|
317
317
|
return !1;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Ke(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;
|
|
@@ -363,7 +363,7 @@ function Ut(e, t = (n) => n.message) {
|
|
|
363
363
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
364
364
|
return { formErrors: r, fieldErrors: n };
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Jt(e, t = (n) => n.message) {
|
|
367
367
|
const n = { _errors: [] }, r = (o) => {
|
|
368
368
|
for (const s of o.issues)
|
|
369
369
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -409,47 +409,47 @@ const ve = (e) => (t, n, r, o) => {
|
|
|
409
409
|
success: !1,
|
|
410
410
|
error: new (e ?? qe)(s.issues.map((i) => R(i, o, C())))
|
|
411
411
|
} : { success: !0, data: s.value };
|
|
412
|
-
},
|
|
412
|
+
}, Bt = /* @__PURE__ */ oe(Xe), ie = (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
417
|
error: new e(s.issues.map((i) => R(i, o, C())))
|
|
418
418
|
} : { success: !0, data: s.value };
|
|
419
|
-
}, Vt = /* @__PURE__ */ ie(Xe),
|
|
419
|
+
}, Vt = /* @__PURE__ */ ie(Xe), Wt = (e) => (t, n, r) => {
|
|
420
420
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
421
421
|
return ve(e)(t, n, o);
|
|
422
|
-
},
|
|
422
|
+
}, Yt = (e) => (t, n, r) => ve(e)(t, n, r), Gt = (e) => async (t, n, r) => {
|
|
423
423
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
424
424
|
return be(e)(t, n, o);
|
|
425
|
-
}, Kt = (e) => async (t, n, r) => be(e)(t, n, r),
|
|
425
|
+
}, Kt = (e) => async (t, n, r) => be(e)(t, n, r), Ht = (e) => (t, n, r) => {
|
|
426
426
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
427
427
|
return oe(e)(t, n, o);
|
|
428
|
-
},
|
|
428
|
+
}, qt = (e) => (t, n, r) => oe(e)(t, n, r), Xt = (e) => async (t, n, r) => {
|
|
429
429
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
430
430
|
return ie(e)(t, n, o);
|
|
431
|
-
},
|
|
432
|
-
function
|
|
433
|
-
return new RegExp(
|
|
431
|
+
}, Qt = (e) => async (t, n, r) => ie(e)(t, n, r), en = /^[cC][^\s-]{8,}$/, tn = /^[0-9a-z]+$/, nn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, rn = /^[0-9a-vA-V]{20}$/, on = /^[A-Za-z0-9]{27}$/, sn = /^[a-zA-Z0-9_-]{21}$/, cn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, an = /^([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})$/, $e = (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)$/, un = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ln = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
432
|
+
function fn() {
|
|
433
|
+
return new RegExp(ln, "u");
|
|
434
434
|
}
|
|
435
|
-
const
|
|
435
|
+
const pn = /^(?:(?: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])$/, dn = /^(([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}|:))$/, hn = /^((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])$/, mn = /^(([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])$/, _n = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Qe = /^[A-Za-z0-9_-]*$/, gn = /^\+[1-9]\d{6,14}$/, et = "(?:(?:\\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])))", vn = /* @__PURE__ */ new RegExp(`^${et}$`);
|
|
436
436
|
function tt(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
|
-
function
|
|
440
|
+
function bn(e) {
|
|
441
441
|
return new RegExp(`^${tt(e)}$`);
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function yn(e) {
|
|
444
444
|
const t = tt({ 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
447
|
return new RegExp(`^${et}T(?:${r})$`);
|
|
448
448
|
}
|
|
449
|
-
const
|
|
449
|
+
const wn = (e) => {
|
|
450
450
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
451
451
|
return new RegExp(`^${t}$`);
|
|
452
|
-
}, zn = /^-?\d+$/,
|
|
452
|
+
}, zn = /^-?\d+$/, $n = /^-?\d+(?:\.\d+)?$/, kn = /^(?:true|false)$/i, Sn = /^[^A-Z]*$/, Zn = /^[^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
|
}), nt = {
|
|
@@ -457,7 +457,7 @@ const yn = (e) => {
|
|
|
457
457
|
bigint: "bigint",
|
|
458
458
|
object: "date"
|
|
459
459
|
}, rt = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
|
|
460
|
-
|
|
460
|
+
T.init(e, t);
|
|
461
461
|
const n = nt[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;
|
|
@@ -474,7 +474,7 @@ const yn = (e) => {
|
|
|
474
474
|
});
|
|
475
475
|
};
|
|
476
476
|
}), ot = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
|
|
477
|
-
|
|
477
|
+
T.init(e, t);
|
|
478
478
|
const n = nt[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;
|
|
@@ -490,8 +490,8 @@ const yn = (e) => {
|
|
|
490
490
|
continue: !t.abort
|
|
491
491
|
});
|
|
492
492
|
};
|
|
493
|
-
}),
|
|
494
|
-
|
|
493
|
+
}), On = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, t) => {
|
|
494
|
+
T.init(e, t), e._zod.onattach.push((n) => {
|
|
495
495
|
var r;
|
|
496
496
|
(r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
|
|
497
497
|
}), e._zod.check = (n) => {
|
|
@@ -506,9 +506,9 @@ const yn = (e) => {
|
|
|
506
506
|
continue: !t.abort
|
|
507
507
|
});
|
|
508
508
|
};
|
|
509
|
-
}),
|
|
510
|
-
|
|
511
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] =
|
|
509
|
+
}), Tn = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, t) => {
|
|
510
|
+
T.init(e, t), t.format = t.format || "float64";
|
|
511
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] = jt[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 = zn);
|
|
@@ -569,7 +569,7 @@ const yn = (e) => {
|
|
|
569
569
|
};
|
|
570
570
|
}), En = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
|
|
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
574
|
return !me(o) && o.length !== void 0;
|
|
575
575
|
}), e._zod.onattach.push((r) => {
|
|
@@ -590,9 +590,9 @@ const yn = (e) => {
|
|
|
590
590
|
continue: !t.abort
|
|
591
591
|
});
|
|
592
592
|
};
|
|
593
|
-
}),
|
|
593
|
+
}), In = /* @__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
597
|
return !me(o) && o.length !== void 0;
|
|
598
598
|
}), e._zod.onattach.push((r) => {
|
|
@@ -613,9 +613,9 @@ const yn = (e) => {
|
|
|
613
613
|
continue: !t.abort
|
|
614
614
|
});
|
|
615
615
|
};
|
|
616
|
-
}),
|
|
616
|
+
}), An = /* @__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
620
|
return !me(o) && o.length !== void 0;
|
|
621
621
|
}), e._zod.onattach.push((r) => {
|
|
@@ -638,7 +638,7 @@ const yn = (e) => {
|
|
|
638
638
|
};
|
|
639
639
|
}), se = /* @__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;
|
|
643
643
|
s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
|
|
644
644
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
|
|
@@ -666,12 +666,12 @@ const yn = (e) => {
|
|
|
666
666
|
});
|
|
667
667
|
};
|
|
668
668
|
}), Pn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
669
|
-
t.pattern ?? (t.pattern =
|
|
670
|
-
}),
|
|
669
|
+
t.pattern ?? (t.pattern = Sn), se.init(e, t);
|
|
670
|
+
}), jn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
671
671
|
t.pattern ?? (t.pattern = Zn), se.init(e, t);
|
|
672
|
-
}),
|
|
673
|
-
|
|
674
|
-
const n =
|
|
672
|
+
}), xn = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
673
|
+
T.init(e, t);
|
|
674
|
+
const n = L(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
675
675
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
676
676
|
const s = o._zod.bag;
|
|
677
677
|
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
@@ -686,9 +686,9 @@ const yn = (e) => {
|
|
|
686
686
|
continue: !t.abort
|
|
687
687
|
});
|
|
688
688
|
};
|
|
689
|
-
}),
|
|
690
|
-
|
|
691
|
-
const n = new RegExp(`^${
|
|
689
|
+
}), Cn = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
|
|
690
|
+
T.init(e, t);
|
|
691
|
+
const n = new RegExp(`^${L(t.prefix)}.*`);
|
|
692
692
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
693
693
|
const o = r._zod.bag;
|
|
694
694
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -703,9 +703,9 @@ const yn = (e) => {
|
|
|
703
703
|
continue: !t.abort
|
|
704
704
|
});
|
|
705
705
|
};
|
|
706
|
-
}),
|
|
707
|
-
|
|
708
|
-
const n = new RegExp(`.*${
|
|
706
|
+
}), Rn = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
|
|
707
|
+
T.init(e, t);
|
|
708
|
+
const n = new RegExp(`.*${L(t.suffix)}$`);
|
|
709
709
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
710
710
|
const o = r._zod.bag;
|
|
711
711
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -720,12 +720,12 @@ const yn = (e) => {
|
|
|
720
720
|
continue: !t.abort
|
|
721
721
|
});
|
|
722
722
|
};
|
|
723
|
-
}),
|
|
724
|
-
|
|
723
|
+
}), Dn = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
|
|
724
|
+
T.init(e, t), e._zod.check = (n) => {
|
|
725
725
|
n.value = t.tx(n.value);
|
|
726
726
|
};
|
|
727
727
|
});
|
|
728
|
-
class
|
|
728
|
+
class Fn {
|
|
729
729
|
constructor(t = []) {
|
|
730
730
|
this.content = [], this.indent = 0, this && (this.args = t);
|
|
731
731
|
}
|
|
@@ -748,13 +748,13 @@ class Dn {
|
|
|
748
748
|
`));
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
const
|
|
751
|
+
const Mn = {
|
|
752
752
|
major: 4,
|
|
753
753
|
minor: 3,
|
|
754
754
|
patch: 6
|
|
755
755
|
}, y = /* @__PURE__ */ u("$ZodType", (e, t) => {
|
|
756
756
|
var n;
|
|
757
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
757
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Mn;
|
|
758
758
|
const r = [...e._zod.def.checks ?? []];
|
|
759
759
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
760
760
|
for (const o of r)
|
|
@@ -817,7 +817,7 @@ const Fn = {
|
|
|
817
817
|
_(e, "~standard", () => ({
|
|
818
818
|
validate: (o) => {
|
|
819
819
|
try {
|
|
820
|
-
const s =
|
|
820
|
+
const s = Bt(e, o);
|
|
821
821
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
822
822
|
} catch {
|
|
823
823
|
return Vt(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
@@ -827,7 +827,7 @@ const Fn = {
|
|
|
827
827
|
version: 1
|
|
828
828
|
}));
|
|
829
829
|
}), ye = /* @__PURE__ */ u("$ZodString", (e, t) => {
|
|
830
|
-
y.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ??
|
|
830
|
+
y.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? wn(e._zod.bag), e._zod.parse = (n, r) => {
|
|
831
831
|
if (t.coerce)
|
|
832
832
|
try {
|
|
833
833
|
n.value = String(n.value);
|
|
@@ -842,8 +842,8 @@ const Fn = {
|
|
|
842
842
|
};
|
|
843
843
|
}), v = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
844
844
|
se.init(e, t), ye.init(e, t);
|
|
845
|
-
}),
|
|
846
|
-
t.pattern ?? (t.pattern =
|
|
845
|
+
}), Ln = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
846
|
+
t.pattern ?? (t.pattern = an), v.init(e, t);
|
|
847
847
|
}), Un = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
848
848
|
if (t.version) {
|
|
849
849
|
const r = {
|
|
@@ -862,9 +862,9 @@ const Fn = {
|
|
|
862
862
|
} else
|
|
863
863
|
t.pattern ?? (t.pattern = $e());
|
|
864
864
|
v.init(e, t);
|
|
865
|
-
}),
|
|
866
|
-
t.pattern ?? (t.pattern =
|
|
867
|
-
}),
|
|
865
|
+
}), Jn = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
866
|
+
t.pattern ?? (t.pattern = un), v.init(e, t);
|
|
867
|
+
}), Bn = /* @__PURE__ */ u("$ZodURL", (e, t) => {
|
|
868
868
|
v.init(e, t), e._zod.check = (n) => {
|
|
869
869
|
try {
|
|
870
870
|
const r = n.value.trim(), o = new URL(r);
|
|
@@ -897,31 +897,31 @@ const Fn = {
|
|
|
897
897
|
}
|
|
898
898
|
};
|
|
899
899
|
}), Vn = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
|
|
900
|
-
t.pattern ?? (t.pattern =
|
|
901
|
-
}),
|
|
902
|
-
t.pattern ?? (t.pattern =
|
|
903
|
-
}),
|
|
904
|
-
t.pattern ?? (t.pattern = Qt), v.init(e, t);
|
|
905
|
-
}), Yn = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
900
|
+
t.pattern ?? (t.pattern = fn()), v.init(e, t);
|
|
901
|
+
}), Wn = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
|
|
902
|
+
t.pattern ?? (t.pattern = sn), v.init(e, t);
|
|
903
|
+
}), Yn = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
|
|
906
904
|
t.pattern ?? (t.pattern = en), v.init(e, t);
|
|
907
|
-
}),
|
|
905
|
+
}), Gn = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
908
906
|
t.pattern ?? (t.pattern = tn), v.init(e, t);
|
|
909
|
-
}),
|
|
907
|
+
}), Kn = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
910
908
|
t.pattern ?? (t.pattern = nn), v.init(e, t);
|
|
911
|
-
}), Hn = /* @__PURE__ */ u("$
|
|
909
|
+
}), Hn = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
912
910
|
t.pattern ?? (t.pattern = rn), v.init(e, t);
|
|
913
|
-
}), qn = /* @__PURE__ */ u("$
|
|
911
|
+
}), qn = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
|
|
912
|
+
t.pattern ?? (t.pattern = on), v.init(e, t);
|
|
913
|
+
}), Xn = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
|
|
914
|
+
t.pattern ?? (t.pattern = yn(t)), v.init(e, t);
|
|
915
|
+
}), Qn = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
|
|
916
|
+
t.pattern ?? (t.pattern = vn), v.init(e, t);
|
|
917
|
+
}), er = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
|
|
914
918
|
t.pattern ?? (t.pattern = bn(t)), v.init(e, t);
|
|
915
|
-
}),
|
|
916
|
-
t.pattern ?? (t.pattern =
|
|
917
|
-
}),
|
|
918
|
-
t.pattern ?? (t.pattern =
|
|
919
|
-
}),
|
|
920
|
-
t.pattern ?? (t.pattern =
|
|
921
|
-
}), tr = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
|
|
922
|
-
t.pattern ?? (t.pattern = fn), v.init(e, t), e._zod.bag.format = "ipv4";
|
|
923
|
-
}), nr = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
|
|
924
|
-
t.pattern ?? (t.pattern = pn), v.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
919
|
+
}), tr = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
920
|
+
t.pattern ?? (t.pattern = cn), v.init(e, t);
|
|
921
|
+
}), nr = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
|
|
922
|
+
t.pattern ?? (t.pattern = pn), v.init(e, t), e._zod.bag.format = "ipv4";
|
|
923
|
+
}), rr = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
|
|
924
|
+
t.pattern ?? (t.pattern = dn), v.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
925
925
|
try {
|
|
926
926
|
new URL(`http://[${n.value}]`);
|
|
927
927
|
} catch {
|
|
@@ -934,10 +934,10 @@ const Fn = {
|
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
936
|
};
|
|
937
|
-
}),
|
|
938
|
-
t.pattern ?? (t.pattern =
|
|
939
|
-
}),
|
|
940
|
-
t.pattern ?? (t.pattern =
|
|
937
|
+
}), or = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
|
|
938
|
+
t.pattern ?? (t.pattern = hn), v.init(e, t);
|
|
939
|
+
}), ir = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
|
|
940
|
+
t.pattern ?? (t.pattern = mn), v.init(e, t), e._zod.check = (n) => {
|
|
941
941
|
const r = n.value.split("/");
|
|
942
942
|
try {
|
|
943
943
|
if (r.length !== 2)
|
|
@@ -973,8 +973,8 @@ function it(e) {
|
|
|
973
973
|
return !1;
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
|
-
const
|
|
977
|
-
t.pattern ?? (t.pattern =
|
|
976
|
+
const sr = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
977
|
+
t.pattern ?? (t.pattern = _n), v.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
978
978
|
it(n.value) || n.issues.push({
|
|
979
979
|
code: "invalid_format",
|
|
980
980
|
format: "base64",
|
|
@@ -984,15 +984,15 @@ const ir = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
|
984
984
|
});
|
|
985
985
|
};
|
|
986
986
|
});
|
|
987
|
-
function
|
|
987
|
+
function cr(e) {
|
|
988
988
|
if (!Qe.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
991
|
return it(n);
|
|
992
992
|
}
|
|
993
|
-
const
|
|
993
|
+
const ar = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
994
994
|
t.pattern ?? (t.pattern = Qe), v.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
995
|
-
|
|
995
|
+
cr(n.value) || n.issues.push({
|
|
996
996
|
code: "invalid_format",
|
|
997
997
|
format: "base64url",
|
|
998
998
|
input: n.value,
|
|
@@ -1000,10 +1000,10 @@ const cr = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
|
1000
1000
|
continue: !t.abort
|
|
1001
1001
|
});
|
|
1002
1002
|
};
|
|
1003
|
-
}),
|
|
1004
|
-
t.pattern ?? (t.pattern =
|
|
1003
|
+
}), ur = /* @__PURE__ */ u("$ZodE164", (e, t) => {
|
|
1004
|
+
t.pattern ?? (t.pattern = gn), v.init(e, t);
|
|
1005
1005
|
});
|
|
1006
|
-
function
|
|
1006
|
+
function lr(e, t = null) {
|
|
1007
1007
|
try {
|
|
1008
1008
|
const n = e.split(".");
|
|
1009
1009
|
if (n.length !== 3)
|
|
@@ -1017,9 +1017,9 @@ function ur(e, t = null) {
|
|
|
1017
1017
|
return !1;
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
const
|
|
1020
|
+
const fr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
1021
1021
|
v.init(e, t), e._zod.check = (n) => {
|
|
1022
|
-
|
|
1022
|
+
lr(n.value, t.alg) || n.issues.push({
|
|
1023
1023
|
code: "invalid_format",
|
|
1024
1024
|
format: "jwt",
|
|
1025
1025
|
input: n.value,
|
|
@@ -1028,7 +1028,7 @@ const lr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1028
1028
|
});
|
|
1029
1029
|
};
|
|
1030
1030
|
}), st = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
|
|
1031
|
-
y.init(e, t), e._zod.pattern = e._zod.bag.pattern ??
|
|
1031
|
+
y.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? $n, e._zod.parse = (n, r) => {
|
|
1032
1032
|
if (t.coerce)
|
|
1033
1033
|
try {
|
|
1034
1034
|
n.value = Number(n.value);
|
|
@@ -1046,10 +1046,10 @@ const lr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1046
1046
|
...s ? { received: s } : {}
|
|
1047
1047
|
}), n;
|
|
1048
1048
|
};
|
|
1049
|
-
}),
|
|
1050
|
-
|
|
1051
|
-
}),
|
|
1052
|
-
y.init(e, t), e._zod.pattern =
|
|
1049
|
+
}), pr = /* @__PURE__ */ u("$ZodNumberFormat", (e, t) => {
|
|
1050
|
+
Tn.init(e, t), st.init(e, t);
|
|
1051
|
+
}), dr = /* @__PURE__ */ u("$ZodBoolean", (e, t) => {
|
|
1052
|
+
y.init(e, t), e._zod.pattern = kn, e._zod.parse = (n, r) => {
|
|
1053
1053
|
if (t.coerce)
|
|
1054
1054
|
try {
|
|
1055
1055
|
n.value = !!n.value;
|
|
@@ -1063,9 +1063,9 @@ const lr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1063
1063
|
inst: e
|
|
1064
1064
|
}), n;
|
|
1065
1065
|
};
|
|
1066
|
-
}),
|
|
1066
|
+
}), hr = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
|
|
1067
1067
|
y.init(e, t), e._zod.parse = (n) => n;
|
|
1068
|
-
}),
|
|
1068
|
+
}), mr = /* @__PURE__ */ u("$ZodNever", (e, t) => {
|
|
1069
1069
|
y.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
1070
1070
|
expected: "never",
|
|
1071
1071
|
code: "invalid_type",
|
|
@@ -1074,9 +1074,9 @@ const lr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1074
1074
|
}), n);
|
|
1075
1075
|
});
|
|
1076
1076
|
function ke(e, t, n) {
|
|
1077
|
-
e.issues.length && t.issues.push(...
|
|
1077
|
+
e.issues.length && t.issues.push(...Ke(n, e.issues)), t.value[n] = e.value;
|
|
1078
1078
|
}
|
|
1079
|
-
const
|
|
1079
|
+
const _r = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
1080
1080
|
y.init(e, t), e._zod.parse = (n, r) => {
|
|
1081
1081
|
const o = n.value;
|
|
1082
1082
|
if (!Array.isArray(o))
|
|
@@ -1102,7 +1102,7 @@ function Q(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(...Ke(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
|
}
|
|
@@ -1139,7 +1139,7 @@ function at(e, t, n, r, o, s) {
|
|
|
1139
1139
|
inst: s
|
|
1140
1140
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1142
|
+
const gr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
1143
1143
|
if (y.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1144
1144
|
const c = t.shape;
|
|
1145
1145
|
Object.defineProperty(t, "shape", {
|
|
@@ -1164,7 +1164,7 @@ const _r = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
return a;
|
|
1166
1166
|
});
|
|
1167
|
-
const o =
|
|
1167
|
+
const o = V, s = t.catchall;
|
|
1168
1168
|
let i;
|
|
1169
1169
|
e._zod.parse = (c, a) => {
|
|
1170
1170
|
i ?? (i = r.value);
|
|
@@ -1179,27 +1179,27 @@ const _r = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1179
1179
|
c.value = {};
|
|
1180
1180
|
const f = [], h = i.shape;
|
|
1181
1181
|
for (const d of i.keys) {
|
|
1182
|
-
const m = h[d], $ = m._zod.optout === "optional",
|
|
1183
|
-
|
|
1182
|
+
const m = h[d], $ = m._zod.optout === "optional", z = m._zod.run({ value: l[d], issues: [] }, a);
|
|
1183
|
+
z instanceof Promise ? f.push(z.then((K) => Q(K, c, d, l, $))) : Q(z, c, d, l, $);
|
|
1184
1184
|
}
|
|
1185
1185
|
return s ? at(f, l, c, a, r.value, e) : f.length ? Promise.all(f).then(() => c) : c;
|
|
1186
1186
|
};
|
|
1187
|
-
}),
|
|
1188
|
-
|
|
1187
|
+
}), vr = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1188
|
+
gr.init(e, t);
|
|
1189
1189
|
const n = e._zod.parse, r = re(() => ct(t)), o = (d) => {
|
|
1190
|
-
const m = new
|
|
1191
|
-
const O =
|
|
1190
|
+
const m = new Fn(["shape", "payload", "ctx"]), $ = r.value, z = (A) => {
|
|
1191
|
+
const O = ze(A);
|
|
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 Zt = 0;
|
|
1197
|
-
for (const
|
|
1198
|
-
|
|
1197
|
+
for (const A of $.keys)
|
|
1198
|
+
K[A] = `key_${Zt++}`;
|
|
1199
1199
|
m.write("const newResult = {};");
|
|
1200
|
-
for (const
|
|
1201
|
-
const O =
|
|
1202
|
-
m.write(`const ${O} = ${
|
|
1200
|
+
for (const A of $.keys) {
|
|
1201
|
+
const O = K[A], I = ze(A), Tt = d[A]?._zod?.optout === "optional";
|
|
1202
|
+
m.write(`const ${O} = ${z(A)};`), Tt ? m.write(`
|
|
1203
1203
|
if (${O}.issues.length) {
|
|
1204
1204
|
if (${I} in input) {
|
|
1205
1205
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
@@ -1236,11 +1236,11 @@ const _r = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1236
1236
|
`);
|
|
1237
1237
|
}
|
|
1238
1238
|
m.write("payload.value = newResult;"), m.write("return payload;");
|
|
1239
|
-
const
|
|
1240
|
-
return (
|
|
1239
|
+
const Ot = m.compile();
|
|
1240
|
+
return (A, O) => Ot(d, A, O);
|
|
1241
1241
|
};
|
|
1242
1242
|
let s;
|
|
1243
|
-
const i =
|
|
1243
|
+
const i = V, c = !Ve.jitless, l = c && At.value, f = t.catchall;
|
|
1244
1244
|
let h;
|
|
1245
1245
|
e._zod.parse = (d, m) => {
|
|
1246
1246
|
h ?? (h = r.value);
|
|
@@ -1253,7 +1253,7 @@ const _r = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1253
1253
|
}), d);
|
|
1254
1254
|
};
|
|
1255
1255
|
});
|
|
1256
|
-
function
|
|
1256
|
+
function Se(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;
|
|
@@ -1294,9 +1294,9 @@ const ut = /* @__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) => Se(a, o, e, s)) : Se(c, o, e, s);
|
|
1298
1298
|
};
|
|
1299
|
-
}),
|
|
1299
|
+
}), br = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (e, t) => {
|
|
1300
1300
|
t.inclusive = !1, ut.init(e, t);
|
|
1301
1301
|
const n = e._zod.parse;
|
|
1302
1302
|
_(e._zod, "propValues", () => {
|
|
@@ -1329,7 +1329,7 @@ const ut = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1329
1329
|
});
|
|
1330
1330
|
e._zod.parse = (o, s) => {
|
|
1331
1331
|
const i = o.value;
|
|
1332
|
-
if (!
|
|
1332
|
+
if (!V(i))
|
|
1333
1333
|
return o.issues.push({
|
|
1334
1334
|
code: "invalid_type",
|
|
1335
1335
|
expected: "object",
|
|
@@ -1347,10 +1347,10 @@ const ut = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1347
1347
|
inst: e
|
|
1348
1348
|
}), o);
|
|
1349
1349
|
};
|
|
1350
|
-
}),
|
|
1350
|
+
}), yr = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
|
|
1351
1351
|
y.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
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([a, l]) =>
|
|
1353
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([a, l]) => Ze(n, a, l)) : Ze(n, s, i);
|
|
1354
1354
|
};
|
|
1355
1355
|
});
|
|
1356
1356
|
function de(e, t) {
|
|
@@ -1388,7 +1388,7 @@ function de(e, t) {
|
|
|
1388
1388
|
}
|
|
1389
1389
|
return { valid: !1, mergeErrorPath: [] };
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function Ze(e, t, n) {
|
|
1392
1392
|
const r = /* @__PURE__ */ new Map();
|
|
1393
1393
|
let o;
|
|
1394
1394
|
for (const c of t.issues)
|
|
@@ -1412,10 +1412,10 @@ function Se(e, t, n) {
|
|
|
1412
1412
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
1413
1413
|
return e.value = i.data, e;
|
|
1414
1414
|
}
|
|
1415
|
-
const
|
|
1415
|
+
const wr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
1416
1416
|
y.init(e, t);
|
|
1417
1417
|
const n = We(t.entries), r = new Set(n);
|
|
1418
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => Nt.has(typeof o)).map((o) => typeof o == "string" ?
|
|
1418
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => Nt.has(typeof o)).map((o) => typeof o == "string" ? L(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",
|
|
@@ -1428,7 +1428,7 @@ const yr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1428
1428
|
if (y.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
|
-
e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ?
|
|
1431
|
+
e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ? L(r) : r ? L(r.toString()) : String(r)).join("|")})$`), e._zod.parse = (r, o) => {
|
|
1432
1432
|
const s = r.value;
|
|
1433
1433
|
return n.has(s) || r.issues.push({
|
|
1434
1434
|
code: "invalid_value",
|
|
@@ -1437,10 +1437,10 @@ const yr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1437
1437
|
inst: e
|
|
1438
1438
|
}), r;
|
|
1439
1439
|
};
|
|
1440
|
-
}),
|
|
1440
|
+
}), $r = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
|
|
1441
1441
|
y.init(e, t), e._zod.parse = (n, r) => {
|
|
1442
1442
|
if (r.direction === "backward")
|
|
1443
|
-
throw new
|
|
1443
|
+
throw new Be(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));
|
|
@@ -1463,9 +1463,9 @@ const lt = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
1465
1465
|
};
|
|
1466
|
-
}),
|
|
1466
|
+
}), kr = /* @__PURE__ */ u("$ZodExactOptional", (e, t) => {
|
|
1467
1467
|
lt.init(e, t), _(e._zod, "values", () => t.innerType._zod.values), _(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
1468
|
-
}),
|
|
1468
|
+
}), Sr = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1469
1469
|
y.init(e, t), _(e._zod, "optin", () => t.innerType._zod.optin), _(e._zod, "optout", () => t.innerType._zod.optout), _(e._zod, "pattern", () => {
|
|
1470
1470
|
const n = t.innerType._zod.pattern;
|
|
1471
1471
|
return n ? new RegExp(`^(${_e(n.source)}|null)$`) : void 0;
|
|
@@ -1477,24 +1477,24 @@ const lt = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
|
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) => Te(s, t)) : Te(o, t);
|
|
1481
1481
|
};
|
|
1482
1482
|
});
|
|
1483
|
-
function
|
|
1483
|
+
function Te(e, t) {
|
|
1484
1484
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1485
1485
|
}
|
|
1486
|
-
const
|
|
1486
|
+
const Or = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
1487
1487
|
y.init(e, t), e._zod.optin = "optional", _(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
|
+
}), Tr = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
|
|
1489
1489
|
y.init(e, t), _(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) => Ee(s, e)) : Ee(o, e);
|
|
1495
1495
|
};
|
|
1496
1496
|
});
|
|
1497
|
-
function
|
|
1497
|
+
function Ee(e, t) {
|
|
1498
1498
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1499
1499
|
code: "invalid_type",
|
|
1500
1500
|
expected: "nonoptional",
|
|
@@ -1521,7 +1521,7 @@ const Er = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
|
1521
1521
|
input: n.value
|
|
1522
1522
|
}), n.issues = []), n);
|
|
1523
1523
|
};
|
|
1524
|
-
}),
|
|
1524
|
+
}), Ir = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
|
|
1525
1525
|
y.init(e, t), _(e._zod, "values", () => t.in._zod.values), _(e._zod, "optin", () => t.in._zod.optin), _(e._zod, "optout", () => t.out._zod.optout), _(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);
|
|
@@ -1534,7 +1534,7 @@ const Er = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
|
1534
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
|
|
1537
|
+
const Ar = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
1538
1538
|
y.init(e, t), _(e._zod, "propValues", () => t.innerType._zod.propValues), _(e._zod, "values", () => t.innerType._zod.values), _(e._zod, "optin", () => t.innerType?._zod?.optin), _(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);
|
|
@@ -1546,14 +1546,14 @@ function Ie(e) {
|
|
|
1546
1546
|
return e.value = Object.freeze(e.value), e;
|
|
1547
1547
|
}
|
|
1548
1548
|
const Nr = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
|
|
1549
|
-
|
|
1549
|
+
T.init(e, t), y.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) => Ae(s, n, r, e));
|
|
1553
|
+
Ae(o, n, r, e);
|
|
1554
1554
|
};
|
|
1555
1555
|
});
|
|
1556
|
-
function
|
|
1556
|
+
function Ae(e, t, n, r) {
|
|
1557
1557
|
if (!e) {
|
|
1558
1558
|
const o = {
|
|
1559
1559
|
code: "custom",
|
|
@@ -1568,7 +1568,7 @@ function Ne(e, t, n, r) {
|
|
|
1568
1568
|
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(Y(o));
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
|
-
var
|
|
1571
|
+
var Ne;
|
|
1572
1572
|
class Pr {
|
|
1573
1573
|
constructor() {
|
|
1574
1574
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
@@ -1598,20 +1598,20 @@ class Pr {
|
|
|
1598
1598
|
return this._map.has(t);
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1601
|
+
function jr() {
|
|
1602
1602
|
return new Pr();
|
|
1603
1603
|
}
|
|
1604
|
-
(
|
|
1604
|
+
(Ne = globalThis).__zod_globalRegistry ?? (Ne.__zod_globalRegistry = jr());
|
|
1605
1605
|
const J = globalThis.__zod_globalRegistry;
|
|
1606
1606
|
// @__NO_SIDE_EFFECTS__
|
|
1607
|
-
function
|
|
1607
|
+
function xr(e, t) {
|
|
1608
1608
|
return new e({
|
|
1609
1609
|
type: "string",
|
|
1610
1610
|
...p(t)
|
|
1611
1611
|
});
|
|
1612
1612
|
}
|
|
1613
1613
|
// @__NO_SIDE_EFFECTS__
|
|
1614
|
-
function
|
|
1614
|
+
function Cr(e, t) {
|
|
1615
1615
|
return new e({
|
|
1616
1616
|
type: "string",
|
|
1617
1617
|
format: "email",
|
|
@@ -1621,7 +1621,7 @@ function xr(e, t) {
|
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
// @__NO_SIDE_EFFECTS__
|
|
1624
|
-
function
|
|
1624
|
+
function Pe(e, t) {
|
|
1625
1625
|
return new e({
|
|
1626
1626
|
type: "string",
|
|
1627
1627
|
format: "guid",
|
|
@@ -1631,7 +1631,7 @@ function Ae(e, t) {
|
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
1633
|
// @__NO_SIDE_EFFECTS__
|
|
1634
|
-
function
|
|
1634
|
+
function Rr(e, t) {
|
|
1635
1635
|
return new e({
|
|
1636
1636
|
type: "string",
|
|
1637
1637
|
format: "uuid",
|
|
@@ -1641,7 +1641,7 @@ function Cr(e, t) {
|
|
|
1641
1641
|
});
|
|
1642
1642
|
}
|
|
1643
1643
|
// @__NO_SIDE_EFFECTS__
|
|
1644
|
-
function
|
|
1644
|
+
function Dr(e, t) {
|
|
1645
1645
|
return new e({
|
|
1646
1646
|
type: "string",
|
|
1647
1647
|
format: "uuid",
|
|
@@ -1652,7 +1652,7 @@ function Rr(e, t) {
|
|
|
1652
1652
|
});
|
|
1653
1653
|
}
|
|
1654
1654
|
// @__NO_SIDE_EFFECTS__
|
|
1655
|
-
function
|
|
1655
|
+
function Fr(e, t) {
|
|
1656
1656
|
return new e({
|
|
1657
1657
|
type: "string",
|
|
1658
1658
|
format: "uuid",
|
|
@@ -1663,7 +1663,7 @@ function Dr(e, t) {
|
|
|
1663
1663
|
});
|
|
1664
1664
|
}
|
|
1665
1665
|
// @__NO_SIDE_EFFECTS__
|
|
1666
|
-
function
|
|
1666
|
+
function Mr(e, t) {
|
|
1667
1667
|
return new e({
|
|
1668
1668
|
type: "string",
|
|
1669
1669
|
format: "uuid",
|
|
@@ -1674,7 +1674,7 @@ function Fr(e, t) {
|
|
|
1674
1674
|
});
|
|
1675
1675
|
}
|
|
1676
1676
|
// @__NO_SIDE_EFFECTS__
|
|
1677
|
-
function
|
|
1677
|
+
function Lr(e, t) {
|
|
1678
1678
|
return new e({
|
|
1679
1679
|
type: "string",
|
|
1680
1680
|
format: "url",
|
|
@@ -1694,7 +1694,7 @@ function Ur(e, t) {
|
|
|
1694
1694
|
});
|
|
1695
1695
|
}
|
|
1696
1696
|
// @__NO_SIDE_EFFECTS__
|
|
1697
|
-
function
|
|
1697
|
+
function Jr(e, t) {
|
|
1698
1698
|
return new e({
|
|
1699
1699
|
type: "string",
|
|
1700
1700
|
format: "nanoid",
|
|
@@ -1704,7 +1704,7 @@ function Lr(e, t) {
|
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
1706
|
// @__NO_SIDE_EFFECTS__
|
|
1707
|
-
function
|
|
1707
|
+
function Br(e, t) {
|
|
1708
1708
|
return new e({
|
|
1709
1709
|
type: "string",
|
|
1710
1710
|
format: "cuid",
|
|
@@ -1724,7 +1724,7 @@ function Vr(e, t) {
|
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
1726
|
// @__NO_SIDE_EFFECTS__
|
|
1727
|
-
function
|
|
1727
|
+
function Wr(e, t) {
|
|
1728
1728
|
return new e({
|
|
1729
1729
|
type: "string",
|
|
1730
1730
|
format: "ulid",
|
|
@@ -1734,7 +1734,7 @@ function Br(e, t) {
|
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
// @__NO_SIDE_EFFECTS__
|
|
1737
|
-
function
|
|
1737
|
+
function Yr(e, t) {
|
|
1738
1738
|
return new e({
|
|
1739
1739
|
type: "string",
|
|
1740
1740
|
format: "xid",
|
|
@@ -1744,7 +1744,7 @@ function Wr(e, t) {
|
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
// @__NO_SIDE_EFFECTS__
|
|
1747
|
-
function
|
|
1747
|
+
function Gr(e, t) {
|
|
1748
1748
|
return new e({
|
|
1749
1749
|
type: "string",
|
|
1750
1750
|
format: "ksuid",
|
|
@@ -1764,7 +1764,7 @@ function Kr(e, t) {
|
|
|
1764
1764
|
});
|
|
1765
1765
|
}
|
|
1766
1766
|
// @__NO_SIDE_EFFECTS__
|
|
1767
|
-
function
|
|
1767
|
+
function Hr(e, t) {
|
|
1768
1768
|
return new e({
|
|
1769
1769
|
type: "string",
|
|
1770
1770
|
format: "ipv6",
|
|
@@ -1774,7 +1774,7 @@ function Gr(e, t) {
|
|
|
1774
1774
|
});
|
|
1775
1775
|
}
|
|
1776
1776
|
// @__NO_SIDE_EFFECTS__
|
|
1777
|
-
function
|
|
1777
|
+
function qr(e, t) {
|
|
1778
1778
|
return new e({
|
|
1779
1779
|
type: "string",
|
|
1780
1780
|
format: "cidrv4",
|
|
@@ -1784,7 +1784,7 @@ function Hr(e, t) {
|
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
1786
|
// @__NO_SIDE_EFFECTS__
|
|
1787
|
-
function
|
|
1787
|
+
function Xr(e, t) {
|
|
1788
1788
|
return new e({
|
|
1789
1789
|
type: "string",
|
|
1790
1790
|
format: "cidrv6",
|
|
@@ -1794,7 +1794,7 @@ function qr(e, t) {
|
|
|
1794
1794
|
});
|
|
1795
1795
|
}
|
|
1796
1796
|
// @__NO_SIDE_EFFECTS__
|
|
1797
|
-
function
|
|
1797
|
+
function Qr(e, t) {
|
|
1798
1798
|
return new e({
|
|
1799
1799
|
type: "string",
|
|
1800
1800
|
format: "base64",
|
|
@@ -1804,7 +1804,7 @@ function Xr(e, t) {
|
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
1806
1806
|
// @__NO_SIDE_EFFECTS__
|
|
1807
|
-
function
|
|
1807
|
+
function eo(e, t) {
|
|
1808
1808
|
return new e({
|
|
1809
1809
|
type: "string",
|
|
1810
1810
|
format: "base64url",
|
|
@@ -1814,7 +1814,7 @@ function Qr(e, t) {
|
|
|
1814
1814
|
});
|
|
1815
1815
|
}
|
|
1816
1816
|
// @__NO_SIDE_EFFECTS__
|
|
1817
|
-
function
|
|
1817
|
+
function to(e, t) {
|
|
1818
1818
|
return new e({
|
|
1819
1819
|
type: "string",
|
|
1820
1820
|
format: "e164",
|
|
@@ -1824,7 +1824,7 @@ function eo(e, t) {
|
|
|
1824
1824
|
});
|
|
1825
1825
|
}
|
|
1826
1826
|
// @__NO_SIDE_EFFECTS__
|
|
1827
|
-
function
|
|
1827
|
+
function no(e, t) {
|
|
1828
1828
|
return new e({
|
|
1829
1829
|
type: "string",
|
|
1830
1830
|
format: "jwt",
|
|
@@ -1834,7 +1834,7 @@ function to(e, t) {
|
|
|
1834
1834
|
});
|
|
1835
1835
|
}
|
|
1836
1836
|
// @__NO_SIDE_EFFECTS__
|
|
1837
|
-
function
|
|
1837
|
+
function ro(e, t) {
|
|
1838
1838
|
return new e({
|
|
1839
1839
|
type: "string",
|
|
1840
1840
|
format: "datetime",
|
|
@@ -1846,7 +1846,7 @@ function no(e, t) {
|
|
|
1846
1846
|
});
|
|
1847
1847
|
}
|
|
1848
1848
|
// @__NO_SIDE_EFFECTS__
|
|
1849
|
-
function
|
|
1849
|
+
function oo(e, t) {
|
|
1850
1850
|
return new e({
|
|
1851
1851
|
type: "string",
|
|
1852
1852
|
format: "date",
|
|
@@ -1855,7 +1855,7 @@ function ro(e, t) {
|
|
|
1855
1855
|
});
|
|
1856
1856
|
}
|
|
1857
1857
|
// @__NO_SIDE_EFFECTS__
|
|
1858
|
-
function
|
|
1858
|
+
function io(e, t) {
|
|
1859
1859
|
return new e({
|
|
1860
1860
|
type: "string",
|
|
1861
1861
|
format: "time",
|
|
@@ -1865,7 +1865,7 @@ function oo(e, t) {
|
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
1867
|
// @__NO_SIDE_EFFECTS__
|
|
1868
|
-
function
|
|
1868
|
+
function so(e, t) {
|
|
1869
1869
|
return new e({
|
|
1870
1870
|
type: "string",
|
|
1871
1871
|
format: "duration",
|
|
@@ -1874,7 +1874,7 @@ function io(e, t) {
|
|
|
1874
1874
|
});
|
|
1875
1875
|
}
|
|
1876
1876
|
// @__NO_SIDE_EFFECTS__
|
|
1877
|
-
function
|
|
1877
|
+
function co(e, t) {
|
|
1878
1878
|
return new e({
|
|
1879
1879
|
type: "number",
|
|
1880
1880
|
checks: [],
|
|
@@ -1882,7 +1882,7 @@ function so(e, t) {
|
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
1884
|
// @__NO_SIDE_EFFECTS__
|
|
1885
|
-
function
|
|
1885
|
+
function ao(e, t) {
|
|
1886
1886
|
return new e({
|
|
1887
1887
|
type: "number",
|
|
1888
1888
|
check: "number_format",
|
|
@@ -1892,20 +1892,20 @@ function co(e, t) {
|
|
|
1892
1892
|
});
|
|
1893
1893
|
}
|
|
1894
1894
|
// @__NO_SIDE_EFFECTS__
|
|
1895
|
-
function
|
|
1895
|
+
function uo(e, t) {
|
|
1896
1896
|
return new e({
|
|
1897
1897
|
type: "boolean",
|
|
1898
1898
|
...p(t)
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
1901
|
// @__NO_SIDE_EFFECTS__
|
|
1902
|
-
function
|
|
1902
|
+
function lo(e) {
|
|
1903
1903
|
return new e({
|
|
1904
1904
|
type: "unknown"
|
|
1905
1905
|
});
|
|
1906
1906
|
}
|
|
1907
1907
|
// @__NO_SIDE_EFFECTS__
|
|
1908
|
-
function
|
|
1908
|
+
function fo(e, t) {
|
|
1909
1909
|
return new e({
|
|
1910
1910
|
type: "never",
|
|
1911
1911
|
...p(t)
|
|
@@ -1949,7 +1949,7 @@ function le(e, t) {
|
|
|
1949
1949
|
}
|
|
1950
1950
|
// @__NO_SIDE_EFFECTS__
|
|
1951
1951
|
function Ce(e, t) {
|
|
1952
|
-
return new
|
|
1952
|
+
return new On({
|
|
1953
1953
|
check: "multiple_of",
|
|
1954
1954
|
...p(t),
|
|
1955
1955
|
value: e
|
|
@@ -1965,7 +1965,7 @@ function ft(e, t) {
|
|
|
1965
1965
|
}
|
|
1966
1966
|
// @__NO_SIDE_EFFECTS__
|
|
1967
1967
|
function ee(e, t) {
|
|
1968
|
-
return new
|
|
1968
|
+
return new In({
|
|
1969
1969
|
check: "min_length",
|
|
1970
1970
|
...p(t),
|
|
1971
1971
|
minimum: e
|
|
@@ -1973,14 +1973,14 @@ function ee(e, t) {
|
|
|
1973
1973
|
}
|
|
1974
1974
|
// @__NO_SIDE_EFFECTS__
|
|
1975
1975
|
function pt(e, t) {
|
|
1976
|
-
return new
|
|
1976
|
+
return new An({
|
|
1977
1977
|
check: "length_equals",
|
|
1978
1978
|
...p(t),
|
|
1979
1979
|
length: e
|
|
1980
1980
|
});
|
|
1981
1981
|
}
|
|
1982
1982
|
// @__NO_SIDE_EFFECTS__
|
|
1983
|
-
function
|
|
1983
|
+
function po(e, t) {
|
|
1984
1984
|
return new Nn({
|
|
1985
1985
|
check: "string_format",
|
|
1986
1986
|
format: "regex",
|
|
@@ -1989,7 +1989,7 @@ function fo(e, t) {
|
|
|
1989
1989
|
});
|
|
1990
1990
|
}
|
|
1991
1991
|
// @__NO_SIDE_EFFECTS__
|
|
1992
|
-
function
|
|
1992
|
+
function ho(e) {
|
|
1993
1993
|
return new Pn({
|
|
1994
1994
|
check: "string_format",
|
|
1995
1995
|
format: "lowercase",
|
|
@@ -1997,16 +1997,16 @@ function po(e) {
|
|
|
1997
1997
|
});
|
|
1998
1998
|
}
|
|
1999
1999
|
// @__NO_SIDE_EFFECTS__
|
|
2000
|
-
function
|
|
2001
|
-
return new
|
|
2000
|
+
function mo(e) {
|
|
2001
|
+
return new jn({
|
|
2002
2002
|
check: "string_format",
|
|
2003
2003
|
format: "uppercase",
|
|
2004
2004
|
...p(e)
|
|
2005
2005
|
});
|
|
2006
2006
|
}
|
|
2007
2007
|
// @__NO_SIDE_EFFECTS__
|
|
2008
|
-
function
|
|
2009
|
-
return new
|
|
2008
|
+
function _o(e, t) {
|
|
2009
|
+
return new xn({
|
|
2010
2010
|
check: "string_format",
|
|
2011
2011
|
format: "includes",
|
|
2012
2012
|
...p(t),
|
|
@@ -2014,8 +2014,8 @@ function mo(e, t) {
|
|
|
2014
2014
|
});
|
|
2015
2015
|
}
|
|
2016
2016
|
// @__NO_SIDE_EFFECTS__
|
|
2017
|
-
function
|
|
2018
|
-
return new
|
|
2017
|
+
function go(e, t) {
|
|
2018
|
+
return new Cn({
|
|
2019
2019
|
check: "string_format",
|
|
2020
2020
|
format: "starts_with",
|
|
2021
2021
|
...p(t),
|
|
@@ -2023,8 +2023,8 @@ function _o(e, t) {
|
|
|
2023
2023
|
});
|
|
2024
2024
|
}
|
|
2025
2025
|
// @__NO_SIDE_EFFECTS__
|
|
2026
|
-
function
|
|
2027
|
-
return new
|
|
2026
|
+
function vo(e, t) {
|
|
2027
|
+
return new Rn({
|
|
2028
2028
|
check: "string_format",
|
|
2029
2029
|
format: "ends_with",
|
|
2030
2030
|
...p(t),
|
|
@@ -2032,34 +2032,34 @@ function go(e, t) {
|
|
|
2032
2032
|
});
|
|
2033
2033
|
}
|
|
2034
2034
|
// @__NO_SIDE_EFFECTS__
|
|
2035
|
-
function
|
|
2036
|
-
return new
|
|
2035
|
+
function U(e) {
|
|
2036
|
+
return new Dn({
|
|
2037
2037
|
check: "overwrite",
|
|
2038
2038
|
tx: e
|
|
2039
2039
|
});
|
|
2040
2040
|
}
|
|
2041
2041
|
// @__NO_SIDE_EFFECTS__
|
|
2042
|
-
function
|
|
2043
|
-
return /* @__PURE__ */
|
|
2042
|
+
function bo(e) {
|
|
2043
|
+
return /* @__PURE__ */ U((t) => t.normalize(e));
|
|
2044
2044
|
}
|
|
2045
2045
|
// @__NO_SIDE_EFFECTS__
|
|
2046
|
-
function
|
|
2047
|
-
return /* @__PURE__ */
|
|
2046
|
+
function yo() {
|
|
2047
|
+
return /* @__PURE__ */ U((e) => e.trim());
|
|
2048
2048
|
}
|
|
2049
2049
|
// @__NO_SIDE_EFFECTS__
|
|
2050
|
-
function
|
|
2051
|
-
return /* @__PURE__ */
|
|
2050
|
+
function wo() {
|
|
2051
|
+
return /* @__PURE__ */ U((e) => e.toLowerCase());
|
|
2052
2052
|
}
|
|
2053
2053
|
// @__NO_SIDE_EFFECTS__
|
|
2054
2054
|
function zo() {
|
|
2055
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ U((e) => e.toUpperCase());
|
|
2056
2056
|
}
|
|
2057
2057
|
// @__NO_SIDE_EFFECTS__
|
|
2058
|
-
function
|
|
2059
|
-
return /* @__PURE__ */
|
|
2058
|
+
function $o() {
|
|
2059
|
+
return /* @__PURE__ */ U((e) => It(e));
|
|
2060
2060
|
}
|
|
2061
2061
|
// @__NO_SIDE_EFFECTS__
|
|
2062
|
-
function
|
|
2062
|
+
function ko(e, t, n) {
|
|
2063
2063
|
return new e({
|
|
2064
2064
|
type: "array",
|
|
2065
2065
|
element: t,
|
|
@@ -2070,7 +2070,7 @@ function $o(e, t, n) {
|
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
2072
2072
|
// @__NO_SIDE_EFFECTS__
|
|
2073
|
-
function
|
|
2073
|
+
function So(e, t, n) {
|
|
2074
2074
|
return new e({
|
|
2075
2075
|
type: "custom",
|
|
2076
2076
|
check: "custom",
|
|
@@ -2080,7 +2080,7 @@ function ko(e, t, n) {
|
|
|
2080
2080
|
}
|
|
2081
2081
|
// @__NO_SIDE_EFFECTS__
|
|
2082
2082
|
function Zo(e) {
|
|
2083
|
-
const t = /* @__PURE__ */
|
|
2083
|
+
const t = /* @__PURE__ */ Oo((n) => (n.addIssue = (r) => {
|
|
2084
2084
|
if (typeof r == "string")
|
|
2085
2085
|
n.issues.push(Y(r, n.value, t._zod.def));
|
|
2086
2086
|
else {
|
|
@@ -2091,8 +2091,8 @@ function Zo(e) {
|
|
|
2091
2091
|
return t;
|
|
2092
2092
|
}
|
|
2093
2093
|
// @__NO_SIDE_EFFECTS__
|
|
2094
|
-
function
|
|
2095
|
-
const n = new
|
|
2094
|
+
function Oo(e, t) {
|
|
2095
|
+
const n = new T({
|
|
2096
2096
|
check: "custom",
|
|
2097
2097
|
...p(t)
|
|
2098
2098
|
});
|
|
@@ -2143,7 +2143,7 @@ function k(e, t, n = { path: [], schemaPath: [] }) {
|
|
|
2143
2143
|
h && (i.ref || (i.ref = h), k(h, t, f), t.seen.get(h).isParent = !0);
|
|
2144
2144
|
}
|
|
2145
2145
|
const a = t.metadataRegistry.get(e);
|
|
2146
|
-
return a && Object.assign(i.schema, a), t.io === "input" &&
|
|
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
2148
|
function ht(e, t) {
|
|
2149
2149
|
const n = e.seen.get(t);
|
|
@@ -2230,11 +2230,11 @@ function mt(e, t) {
|
|
|
2230
2230
|
r(f);
|
|
2231
2231
|
const d = e.seen.get(f), m = d.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 z in a)
|
|
2234
|
+
z === "$ref" || z === "allOf" || z in l || delete a[z];
|
|
2235
2235
|
if (m.$ref && d.def)
|
|
2236
|
-
for (const
|
|
2237
|
-
|
|
2236
|
+
for (const z in a)
|
|
2237
|
+
z === "$ref" || z === "allOf" || z in d.def && JSON.stringify(a[z]) === JSON.stringify(d.def[z]) && delete a[z];
|
|
2238
2238
|
}
|
|
2239
2239
|
const h = i._zod.parent;
|
|
2240
2240
|
if (h && h !== f) {
|
|
@@ -2283,7 +2283,7 @@ function mt(e, t) {
|
|
|
2283
2283
|
throw new Error("Error converting schema to JSON.");
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2286
|
+
function Z(e, t) {
|
|
2287
2287
|
const n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
2288
2288
|
if (n.seen.has(e))
|
|
2289
2289
|
return !1;
|
|
@@ -2292,40 +2292,40 @@ function S(e, t) {
|
|
|
2292
2292
|
if (r.type === "transform")
|
|
2293
2293
|
return !0;
|
|
2294
2294
|
if (r.type === "array")
|
|
2295
|
-
return
|
|
2295
|
+
return Z(r.element, n);
|
|
2296
2296
|
if (r.type === "set")
|
|
2297
|
-
return
|
|
2297
|
+
return Z(r.valueType, n);
|
|
2298
2298
|
if (r.type === "lazy")
|
|
2299
|
-
return
|
|
2299
|
+
return Z(r.getter(), n);
|
|
2300
2300
|
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
2301
|
-
return
|
|
2301
|
+
return Z(r.innerType, n);
|
|
2302
2302
|
if (r.type === "intersection")
|
|
2303
|
-
return
|
|
2303
|
+
return Z(r.left, n) || Z(r.right, n);
|
|
2304
2304
|
if (r.type === "record" || r.type === "map")
|
|
2305
|
-
return
|
|
2305
|
+
return Z(r.keyType, n) || Z(r.valueType, n);
|
|
2306
2306
|
if (r.type === "pipe")
|
|
2307
|
-
return
|
|
2307
|
+
return Z(r.in, n) || Z(r.out, n);
|
|
2308
2308
|
if (r.type === "object") {
|
|
2309
2309
|
for (const o in r.shape)
|
|
2310
|
-
if (
|
|
2310
|
+
if (Z(r.shape[o], n))
|
|
2311
2311
|
return !0;
|
|
2312
2312
|
return !1;
|
|
2313
2313
|
}
|
|
2314
2314
|
if (r.type === "union") {
|
|
2315
2315
|
for (const o of r.options)
|
|
2316
|
-
if (
|
|
2316
|
+
if (Z(o, n))
|
|
2317
2317
|
return !0;
|
|
2318
2318
|
return !1;
|
|
2319
2319
|
}
|
|
2320
2320
|
if (r.type === "tuple") {
|
|
2321
2321
|
for (const o of r.items)
|
|
2322
|
-
if (
|
|
2322
|
+
if (Z(o, n))
|
|
2323
2323
|
return !0;
|
|
2324
|
-
return !!(r.rest &&
|
|
2324
|
+
return !!(r.rest && Z(r.rest, n));
|
|
2325
2325
|
}
|
|
2326
2326
|
return !1;
|
|
2327
2327
|
}
|
|
2328
|
-
const
|
|
2328
|
+
const To = (e, t = {}) => (n) => {
|
|
2329
2329
|
const r = dt({ ...n, processors: t });
|
|
2330
2330
|
return k(e, r), ht(r, e), mt(r, e);
|
|
2331
2331
|
}, te = (e, t, n = {}) => (r) => {
|
|
@@ -2338,7 +2338,7 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2338
2338
|
json_string: "json-string",
|
|
2339
2339
|
regex: ""
|
|
2340
2340
|
// do not set
|
|
2341
|
-
},
|
|
2341
|
+
}, Io = (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;
|
|
@@ -2351,18 +2351,18 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2351
2351
|
}))
|
|
2352
2352
|
]);
|
|
2353
2353
|
}
|
|
2354
|
-
},
|
|
2354
|
+
}, Ao = (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
|
}, No = (e, t, n, r) => {
|
|
2358
2358
|
n.type = "boolean";
|
|
2359
2359
|
}, Po = (e, t, n, r) => {
|
|
2360
2360
|
n.not = {};
|
|
2361
|
-
}, Ao = (e, t, n, r) => {
|
|
2362
2361
|
}, jo = (e, t, n, r) => {
|
|
2362
|
+
}, xo = (e, t, n, r) => {
|
|
2363
2363
|
const o = e._zod.def, s = We(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
|
+
}, Co = (e, t, n, r) => {
|
|
2366
2366
|
const o = e._zod.def, s = [];
|
|
2367
2367
|
for (const i of o.values)
|
|
2368
2368
|
if (i === void 0) {
|
|
@@ -2379,16 +2379,16 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2379
2379
|
n.type = i === null ? "null" : typeof i, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [i] : n.const = i;
|
|
2380
2380
|
} else
|
|
2381
2381
|
s.every((i) => typeof i == "number") && (n.type = "number"), s.every((i) => typeof i == "string") && (n.type = "string"), s.every((i) => typeof i == "boolean") && (n.type = "boolean"), s.every((i) => i === null) && (n.type = "null"), n.enum = s;
|
|
2382
|
-
},
|
|
2382
|
+
}, Ro = (e, t, n, r) => {
|
|
2383
2383
|
if (t.unrepresentable === "throw")
|
|
2384
2384
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
2385
|
-
},
|
|
2385
|
+
}, Do = (e, t, n, r) => {
|
|
2386
2386
|
if (t.unrepresentable === "throw")
|
|
2387
2387
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2388
|
-
},
|
|
2388
|
+
}, Fo = (e, t, n, r) => {
|
|
2389
2389
|
const o = n, s = e._zod.def, { minimum: i, maximum: c } = e._zod.bag;
|
|
2390
2390
|
typeof i == "number" && (o.minItems = i), typeof c == "number" && (o.maxItems = c), o.type = "array", o.items = k(s.element, t, { ...r, path: [...r.path, "items"] });
|
|
2391
|
-
},
|
|
2391
|
+
}, Mo = (e, t, n, r) => {
|
|
2392
2392
|
const o = n, s = e._zod.def;
|
|
2393
2393
|
o.type = "object", o.properties = {};
|
|
2394
2394
|
const i = s.shape;
|
|
@@ -2405,7 +2405,7 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2405
2405
|
...r,
|
|
2406
2406
|
path: [...r.path, "additionalProperties"]
|
|
2407
2407
|
})) : t.io === "output" && (o.additionalProperties = !1);
|
|
2408
|
-
},
|
|
2408
|
+
}, Lo = (e, t, n, r) => {
|
|
2409
2409
|
const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((c, a) => k(c, t, {
|
|
2410
2410
|
...r,
|
|
2411
2411
|
path: [...r.path, s ? "oneOf" : "anyOf", a]
|
|
@@ -2423,10 +2423,10 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2423
2423
|
...c(i) ? i.allOf : [i]
|
|
2424
2424
|
];
|
|
2425
2425
|
n.allOf = a;
|
|
2426
|
-
},
|
|
2426
|
+
}, Jo = (e, t, n, r) => {
|
|
2427
2427
|
const o = e._zod.def, s = k(o.innerType, t, r), i = t.seen.get(e);
|
|
2428
2428
|
t.target === "openapi-3.0" ? (i.ref = o.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
|
|
2429
|
-
},
|
|
2429
|
+
}, Bo = (e, t, n, r) => {
|
|
2430
2430
|
const o = e._zod.def;
|
|
2431
2431
|
k(o.innerType, t, r);
|
|
2432
2432
|
const s = t.seen.get(e);
|
|
@@ -2436,12 +2436,12 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2436
2436
|
k(o.innerType, t, r);
|
|
2437
2437
|
const s = t.seen.get(e);
|
|
2438
2438
|
s.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
2439
|
-
},
|
|
2439
|
+
}, Wo = (e, t, n, r) => {
|
|
2440
2440
|
const o = e._zod.def;
|
|
2441
2441
|
k(o.innerType, t, r);
|
|
2442
2442
|
const s = t.seen.get(e);
|
|
2443
2443
|
s.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
2444
|
-
},
|
|
2444
|
+
}, Yo = (e, t, n, r) => {
|
|
2445
2445
|
const o = e._zod.def;
|
|
2446
2446
|
k(o.innerType, t, r);
|
|
2447
2447
|
const s = t.seen.get(e);
|
|
@@ -2453,7 +2453,7 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2453
2453
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
2454
2454
|
}
|
|
2455
2455
|
n.default = i;
|
|
2456
|
-
},
|
|
2456
|
+
}, Go = (e, t, n, r) => {
|
|
2457
2457
|
const o = e._zod.def, s = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
2458
2458
|
k(s, t, r);
|
|
2459
2459
|
const i = t.seen.get(e);
|
|
@@ -2468,34 +2468,34 @@ const Oo = (e, t = {}) => (n) => {
|
|
|
2468
2468
|
k(o.innerType, t, r);
|
|
2469
2469
|
const s = t.seen.get(e);
|
|
2470
2470
|
s.ref = o.innerType;
|
|
2471
|
-
},
|
|
2472
|
-
qn.init(e, t), b.init(e, t);
|
|
2473
|
-
});
|
|
2474
|
-
function Ho(e) {
|
|
2475
|
-
return /* @__PURE__ */ no(Go, e);
|
|
2476
|
-
}
|
|
2477
|
-
const qo = /* @__PURE__ */ u("ZodISODate", (e, t) => {
|
|
2471
|
+
}, Ho = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
|
|
2478
2472
|
Xn.init(e, t), b.init(e, t);
|
|
2479
2473
|
});
|
|
2480
|
-
function
|
|
2481
|
-
return /* @__PURE__ */ ro(
|
|
2474
|
+
function qo(e) {
|
|
2475
|
+
return /* @__PURE__ */ ro(Ho, e);
|
|
2482
2476
|
}
|
|
2483
|
-
const
|
|
2477
|
+
const Xo = /* @__PURE__ */ u("ZodISODate", (e, t) => {
|
|
2484
2478
|
Qn.init(e, t), b.init(e, t);
|
|
2485
2479
|
});
|
|
2486
|
-
function
|
|
2487
|
-
return /* @__PURE__ */ oo(
|
|
2480
|
+
function Qo(e) {
|
|
2481
|
+
return /* @__PURE__ */ oo(Xo, e);
|
|
2488
2482
|
}
|
|
2489
|
-
const
|
|
2483
|
+
const ei = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
|
|
2490
2484
|
er.init(e, t), b.init(e, t);
|
|
2491
2485
|
});
|
|
2492
|
-
function
|
|
2493
|
-
return /* @__PURE__ */ io(
|
|
2486
|
+
function ti(e) {
|
|
2487
|
+
return /* @__PURE__ */ io(ei, e);
|
|
2488
|
+
}
|
|
2489
|
+
const ni = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
|
|
2490
|
+
tr.init(e, t), b.init(e, t);
|
|
2491
|
+
});
|
|
2492
|
+
function ri(e) {
|
|
2493
|
+
return /* @__PURE__ */ so(ni, e);
|
|
2494
2494
|
}
|
|
2495
|
-
const
|
|
2495
|
+
const oi = (e, t) => {
|
|
2496
2496
|
qe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2497
2497
|
format: {
|
|
2498
|
-
value: (n) =>
|
|
2498
|
+
value: (n) => Jt(e, n)
|
|
2499
2499
|
// enumerable: false,
|
|
2500
2500
|
},
|
|
2501
2501
|
flatten: {
|
|
@@ -2521,21 +2521,21 @@ const ri = (e, t) => {
|
|
|
2521
2521
|
// enumerable: false,
|
|
2522
2522
|
}
|
|
2523
2523
|
});
|
|
2524
|
-
},
|
|
2524
|
+
}, E = u("ZodError", oi, {
|
|
2525
2525
|
Parent: Error
|
|
2526
|
-
}),
|
|
2526
|
+
}), ii = /* @__PURE__ */ ve(E), si = /* @__PURE__ */ be(E), ci = /* @__PURE__ */ oe(E), ai = /* @__PURE__ */ ie(E), ui = /* @__PURE__ */ Wt(E), li = /* @__PURE__ */ Yt(E), fi = /* @__PURE__ */ Gt(E), pi = /* @__PURE__ */ Kt(E), di = /* @__PURE__ */ Ht(E), hi = /* @__PURE__ */ qt(E), mi = /* @__PURE__ */ Xt(E), _i = /* @__PURE__ */ Qt(E), w = /* @__PURE__ */ u("ZodType", (e, t) => (y.init(e, t), Object.assign(e["~standard"], {
|
|
2527
2527
|
jsonSchema: {
|
|
2528
2528
|
input: te(e, "input"),
|
|
2529
2529
|
output: te(e, "output")
|
|
2530
2530
|
}
|
|
2531
|
-
}), e.toJSONSchema =
|
|
2531
|
+
}), e.toJSONSchema = To(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(P(t, {
|
|
2532
2532
|
checks: [
|
|
2533
2533
|
...t.checks ?? [],
|
|
2534
2534
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2535
2535
|
]
|
|
2536
2536
|
}), {
|
|
2537
2537
|
parent: !0
|
|
2538
|
-
}), e.with = e.check, e.clone = (n, r) => j(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) =>
|
|
2538
|
+
}), e.with = e.check, e.clone = (n, r) => j(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => ii(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => ci(e, n, r), e.parseAsync = async (n, r) => si(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ai(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => ui(e, n, r), e.decode = (n, r) => li(e, n, r), e.encodeAsync = async (n, r) => fi(e, n, r), e.decodeAsync = async (n, r) => pi(e, n, r), e.safeEncode = (n, r) => di(e, n, r), e.safeDecode = (n, r) => hi(e, n, r), e.safeEncodeAsync = async (n, r) => mi(e, n, r), e.safeDecodeAsync = async (n, r) => _i(e, n, r), e.refine = (n, r) => e.check(ls(n, r)), e.superRefine = (n) => e.check(fs(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ U(n)), e.optional = () => Le(e), e.exactOptional = () => qi(e), e.nullable = () => Ue(e), e.nullish = () => Le(Ue(e)), e.nonoptional = (n) => rs(e, n), e.array = () => he(e), e.or = (n) => Ui([e, n]), e.and = (n) => Wi(e, n), e.transform = (n) => Je(e, Ki(n)), e.default = (n) => es(e, n), e.prefault = (n) => ns(e, n), e.catch = (n) => is(e, n), e.pipe = (n) => Je(e, n), e.readonly = () => as(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", {
|
|
@@ -2549,95 +2549,95 @@ const ri = (e, t) => {
|
|
|
2549
2549
|
const r = e.clone();
|
|
2550
2550
|
return J.add(r, n[0]), r;
|
|
2551
2551
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), gt = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2552
|
-
ye.init(e, t),
|
|
2552
|
+
ye.init(e, t), w.init(e, t), e._zod.processJSONSchema = (r, o, s) => Io(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__ */
|
|
2555
|
-
}),
|
|
2556
|
-
ye.init(e, t), gt.init(e, t), e.email = (n) => 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__ */ po(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ _o(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ go(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ vo(...r)), e.min = (...r) => e.check(/* @__PURE__ */ ee(...r)), e.max = (...r) => e.check(/* @__PURE__ */ ft(...r)), e.length = (...r) => e.check(/* @__PURE__ */ pt(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ ee(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ ho(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ mo(r)), e.trim = () => e.check(/* @__PURE__ */ yo()), e.normalize = (...r) => e.check(/* @__PURE__ */ bo(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ wo()), e.toUpperCase = () => e.check(/* @__PURE__ */ zo()), e.slugify = () => e.check(/* @__PURE__ */ $o());
|
|
2555
|
+
}), gi = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2556
|
+
ye.init(e, t), gt.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Cr(vi, n)), e.url = (n) => e.check(/* @__PURE__ */ Lr(bi, n)), e.jwt = (n) => e.check(/* @__PURE__ */ no(ji, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Ur(yi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Pe(Re, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Rr(X, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Dr(X, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Fr(X, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Mr(X, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Jr(wi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Pe(Re, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Br(zi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Vr($i, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Wr(ki, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Qr(Ai, n)), e.base64url = (n) => e.check(/* @__PURE__ */ eo(Ni, n)), e.xid = (n) => e.check(/* @__PURE__ */ Yr(Si, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Gr(Zi, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Kr(Oi, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ Hr(Ti, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ qr(Ei, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Xr(Ii, n)), e.e164 = (n) => e.check(/* @__PURE__ */ to(Pi, n)), e.datetime = (n) => e.check(qo(n)), e.date = (n) => e.check(Qo(n)), e.time = (n) => e.check(ti(n)), e.duration = (n) => e.check(ri(n));
|
|
2557
2557
|
});
|
|
2558
|
-
function
|
|
2559
|
-
return /* @__PURE__ */
|
|
2558
|
+
function N(e) {
|
|
2559
|
+
return /* @__PURE__ */ xr(gi, e);
|
|
2560
2560
|
}
|
|
2561
2561
|
const b = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
2562
2562
|
v.init(e, t), gt.init(e, t);
|
|
2563
|
-
}),
|
|
2564
|
-
|
|
2563
|
+
}), vi = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2564
|
+
Jn.init(e, t), b.init(e, t);
|
|
2565
2565
|
}), Re = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
2566
|
-
|
|
2566
|
+
Ln.init(e, t), b.init(e, t);
|
|
2567
2567
|
}), X = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2568
2568
|
Un.init(e, t), b.init(e, t);
|
|
2569
|
-
}),
|
|
2570
|
-
Jn.init(e, t), b.init(e, t);
|
|
2571
|
-
}), bi = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2572
|
-
Vn.init(e, t), b.init(e, t);
|
|
2573
|
-
}), yi = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
|
|
2569
|
+
}), bi = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2574
2570
|
Bn.init(e, t), b.init(e, t);
|
|
2575
|
-
}),
|
|
2571
|
+
}), yi = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2572
|
+
Vn.init(e, t), b.init(e, t);
|
|
2573
|
+
}), wi = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
|
|
2576
2574
|
Wn.init(e, t), b.init(e, t);
|
|
2577
|
-
}),
|
|
2575
|
+
}), zi = /* @__PURE__ */ u("ZodCUID", (e, t) => {
|
|
2578
2576
|
Yn.init(e, t), b.init(e, t);
|
|
2579
|
-
}), $i = /* @__PURE__ */ u("
|
|
2580
|
-
Kn.init(e, t), b.init(e, t);
|
|
2581
|
-
}), ki = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2577
|
+
}), $i = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
|
|
2582
2578
|
Gn.init(e, t), b.init(e, t);
|
|
2583
|
-
}),
|
|
2579
|
+
}), ki = /* @__PURE__ */ u("ZodULID", (e, t) => {
|
|
2580
|
+
Kn.init(e, t), b.init(e, t);
|
|
2581
|
+
}), Si = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2584
2582
|
Hn.init(e, t), b.init(e, t);
|
|
2585
|
-
}),
|
|
2586
|
-
|
|
2587
|
-
}), Oi = /* @__PURE__ */ u("
|
|
2583
|
+
}), Zi = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
|
|
2584
|
+
qn.init(e, t), b.init(e, t);
|
|
2585
|
+
}), Oi = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
|
|
2588
2586
|
nr.init(e, t), b.init(e, t);
|
|
2589
|
-
}),
|
|
2587
|
+
}), Ti = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
|
|
2590
2588
|
rr.init(e, t), b.init(e, t);
|
|
2591
|
-
}),
|
|
2589
|
+
}), Ei = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
|
|
2592
2590
|
or.init(e, t), b.init(e, t);
|
|
2593
|
-
}), Ii = /* @__PURE__ */ u("
|
|
2591
|
+
}), Ii = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
|
|
2594
2592
|
ir.init(e, t), b.init(e, t);
|
|
2593
|
+
}), Ai = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2594
|
+
sr.init(e, t), b.init(e, t);
|
|
2595
2595
|
}), Ni = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
|
|
2596
|
-
cr.init(e, t), b.init(e, t);
|
|
2597
|
-
}), Pi = /* @__PURE__ */ u("ZodE164", (e, t) => {
|
|
2598
2596
|
ar.init(e, t), b.init(e, t);
|
|
2599
|
-
}),
|
|
2600
|
-
|
|
2597
|
+
}), Pi = /* @__PURE__ */ u("ZodE164", (e, t) => {
|
|
2598
|
+
ur.init(e, t), b.init(e, t);
|
|
2599
|
+
}), ji = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2600
|
+
fr.init(e, t), b.init(e, t);
|
|
2601
2601
|
}), vt = /* @__PURE__ */ u("ZodNumber", (e, t) => {
|
|
2602
|
-
st.init(e, t),
|
|
2602
|
+
st.init(e, t), w.init(e, t), e._zod.processJSONSchema = (r, o, s) => Ao(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ xe(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ le(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ le(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ je(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ ue(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ ue(r, o)), e.int = (r) => e.check(De(r)), e.safe = (r) => e.check(De(r)), e.positive = (r) => e.check(/* @__PURE__ */ xe(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ le(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ je(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ ue(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ Ce(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ Ce(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 g(e) {
|
|
2607
|
-
return /* @__PURE__ */
|
|
2607
|
+
return /* @__PURE__ */ co(vt, e);
|
|
2608
2608
|
}
|
|
2609
|
-
const
|
|
2610
|
-
|
|
2609
|
+
const xi = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
|
|
2610
|
+
pr.init(e, t), vt.init(e, t);
|
|
2611
2611
|
});
|
|
2612
2612
|
function De(e) {
|
|
2613
|
-
return /* @__PURE__ */
|
|
2613
|
+
return /* @__PURE__ */ ao(xi, e);
|
|
2614
2614
|
}
|
|
2615
|
-
const
|
|
2616
|
-
|
|
2615
|
+
const Ci = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
|
|
2616
|
+
dr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => No(e, n, r);
|
|
2617
2617
|
});
|
|
2618
2618
|
function Fe(e) {
|
|
2619
|
-
return /* @__PURE__ */
|
|
2619
|
+
return /* @__PURE__ */ uo(Ci, e);
|
|
2620
2620
|
}
|
|
2621
|
-
const
|
|
2622
|
-
|
|
2621
|
+
const Ri = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2622
|
+
hr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => jo();
|
|
2623
2623
|
});
|
|
2624
2624
|
function Me() {
|
|
2625
|
-
return /* @__PURE__ */
|
|
2625
|
+
return /* @__PURE__ */ lo(Ri);
|
|
2626
2626
|
}
|
|
2627
|
-
const
|
|
2628
|
-
|
|
2627
|
+
const Di = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
2628
|
+
mr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Po(e, n, r);
|
|
2629
2629
|
});
|
|
2630
|
-
function
|
|
2631
|
-
return /* @__PURE__ */
|
|
2630
|
+
function Fi(e) {
|
|
2631
|
+
return /* @__PURE__ */ fo(Di, e);
|
|
2632
2632
|
}
|
|
2633
|
-
const
|
|
2634
|
-
|
|
2633
|
+
const Mi = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2634
|
+
_r.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Fo(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ ee(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ ee(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ ft(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ pt(n, r)), e.unwrap = () => e.element;
|
|
2635
2635
|
});
|
|
2636
2636
|
function he(e, t) {
|
|
2637
|
-
return /* @__PURE__ */
|
|
2637
|
+
return /* @__PURE__ */ ko(Mi, e, t);
|
|
2638
2638
|
}
|
|
2639
|
-
const
|
|
2640
|
-
|
|
2639
|
+
const Li = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2640
|
+
vr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Mo(e, n, r, o), _(e, "shape", () => t.shape), e.keyof = () => yt(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Me() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Me() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Fi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Rt(e, n), e.safeExtend = (n) => Dt(e, n), e.merge = (n) => Ft(e, n), e.pick = (n) => xt(e, n), e.omit = (n) => Ct(e, n), e.partial = (...n) => Mt(wt, e, n[0]), e.required = (...n) => Lt(zt, e, n[0]);
|
|
2641
2641
|
});
|
|
2642
2642
|
function ce(e, t) {
|
|
2643
2643
|
const n = {
|
|
@@ -2645,10 +2645,10 @@ function ce(e, t) {
|
|
|
2645
2645
|
shape: e ?? {},
|
|
2646
2646
|
...p(t)
|
|
2647
2647
|
};
|
|
2648
|
-
return new
|
|
2648
|
+
return new Li(n);
|
|
2649
2649
|
}
|
|
2650
2650
|
const bt = /* @__PURE__ */ u("ZodUnion", (e, t) => {
|
|
2651
|
-
ut.init(e, t),
|
|
2651
|
+
ut.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Lo(e, n, r, o), e.options = t.options;
|
|
2652
2652
|
});
|
|
2653
2653
|
function Ui(e, t) {
|
|
2654
2654
|
return new bt({
|
|
@@ -2657,11 +2657,11 @@ function Ui(e, t) {
|
|
|
2657
2657
|
...p(t)
|
|
2658
2658
|
});
|
|
2659
2659
|
}
|
|
2660
|
-
const
|
|
2661
|
-
bt.init(e, t),
|
|
2660
|
+
const Ji = /* @__PURE__ */ u("ZodDiscriminatedUnion", (e, t) => {
|
|
2661
|
+
bt.init(e, t), br.init(e, t);
|
|
2662
2662
|
});
|
|
2663
|
-
function
|
|
2664
|
-
return new
|
|
2663
|
+
function Bi(e, t, n) {
|
|
2664
|
+
return new Ji({
|
|
2665
2665
|
type: "union",
|
|
2666
2666
|
options: t,
|
|
2667
2667
|
discriminator: e,
|
|
@@ -2669,9 +2669,9 @@ function Ji(e, t, n) {
|
|
|
2669
2669
|
});
|
|
2670
2670
|
}
|
|
2671
2671
|
const Vi = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
|
|
2672
|
-
|
|
2672
|
+
yr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Uo(e, n, r, o);
|
|
2673
2673
|
});
|
|
2674
|
-
function
|
|
2674
|
+
function Wi(e, t) {
|
|
2675
2675
|
return new Vi({
|
|
2676
2676
|
type: "intersection",
|
|
2677
2677
|
left: e,
|
|
@@ -2679,7 +2679,7 @@ function Bi(e, t) {
|
|
|
2679
2679
|
});
|
|
2680
2680
|
}
|
|
2681
2681
|
const ne = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
2682
|
-
|
|
2682
|
+
wr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (r, o, s) => xo(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 = {};
|
|
@@ -2709,7 +2709,7 @@ const ne = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
|
2709
2709
|
});
|
|
2710
2710
|
};
|
|
2711
2711
|
});
|
|
2712
|
-
function
|
|
2712
|
+
function yt(e, t) {
|
|
2713
2713
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2714
2714
|
return new ne({
|
|
2715
2715
|
type: "enum",
|
|
@@ -2717,7 +2717,7 @@ function Wi(e, t) {
|
|
|
2717
2717
|
...p(t)
|
|
2718
2718
|
});
|
|
2719
2719
|
}
|
|
2720
|
-
function
|
|
2720
|
+
function S(e, t) {
|
|
2721
2721
|
return new ne({
|
|
2722
2722
|
type: "enum",
|
|
2723
2723
|
entries: e,
|
|
@@ -2725,7 +2725,7 @@ function Z(e, t) {
|
|
|
2725
2725
|
});
|
|
2726
2726
|
}
|
|
2727
2727
|
const Yi = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
2728
|
-
zr.init(e, t),
|
|
2728
|
+
zr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Co(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.");
|
|
@@ -2740,10 +2740,10 @@ function x(e, t) {
|
|
|
2740
2740
|
...p(t)
|
|
2741
2741
|
});
|
|
2742
2742
|
}
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2743
|
+
const Gi = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
2744
|
+
$r.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Do(e, n), e._zod.parse = (n, r) => {
|
|
2745
2745
|
if (r.direction === "backward")
|
|
2746
|
-
throw new
|
|
2746
|
+
throw new Be(e.constructor.name);
|
|
2747
2747
|
n.addIssue = (s) => {
|
|
2748
2748
|
if (typeof s == "string")
|
|
2749
2749
|
n.issues.push(Y(s, n.value, t));
|
|
@@ -2756,23 +2756,23 @@ const Ki = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
|
2756
2756
|
return o instanceof Promise ? o.then((s) => (n.value = s, n)) : (n.value = o, n);
|
|
2757
2757
|
};
|
|
2758
2758
|
});
|
|
2759
|
-
function
|
|
2760
|
-
return new
|
|
2759
|
+
function Ki(e) {
|
|
2760
|
+
return new Gi({
|
|
2761
2761
|
type: "transform",
|
|
2762
2762
|
transform: e
|
|
2763
2763
|
});
|
|
2764
2764
|
}
|
|
2765
|
-
const
|
|
2766
|
-
lt.init(e, t),
|
|
2765
|
+
const wt = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
2766
|
+
lt.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => _t(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2767
2767
|
});
|
|
2768
|
-
function
|
|
2769
|
-
return new
|
|
2768
|
+
function Le(e) {
|
|
2769
|
+
return new wt({
|
|
2770
2770
|
type: "optional",
|
|
2771
2771
|
innerType: e
|
|
2772
2772
|
});
|
|
2773
2773
|
}
|
|
2774
2774
|
const Hi = /* @__PURE__ */ u("ZodExactOptional", (e, t) => {
|
|
2775
|
-
|
|
2775
|
+
kr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => _t(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2776
2776
|
});
|
|
2777
2777
|
function qi(e) {
|
|
2778
2778
|
return new Hi({
|
|
@@ -2781,40 +2781,40 @@ function qi(e) {
|
|
|
2781
2781
|
});
|
|
2782
2782
|
}
|
|
2783
2783
|
const Xi = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
2784
|
-
|
|
2784
|
+
Sr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Jo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2785
2785
|
});
|
|
2786
|
-
function
|
|
2786
|
+
function Ue(e) {
|
|
2787
2787
|
return new Xi({
|
|
2788
2788
|
type: "nullable",
|
|
2789
2789
|
innerType: e
|
|
2790
2790
|
});
|
|
2791
2791
|
}
|
|
2792
2792
|
const Qi = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
2793
|
-
Zr.init(e, t),
|
|
2793
|
+
Zr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Vo(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2794
2794
|
});
|
|
2795
2795
|
function es(e, t) {
|
|
2796
2796
|
return new Qi({
|
|
2797
2797
|
type: "default",
|
|
2798
2798
|
innerType: e,
|
|
2799
2799
|
get defaultValue() {
|
|
2800
|
-
return typeof t == "function" ? t() :
|
|
2800
|
+
return typeof t == "function" ? t() : Ge(t);
|
|
2801
2801
|
}
|
|
2802
2802
|
});
|
|
2803
2803
|
}
|
|
2804
2804
|
const ts = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
|
|
2805
|
-
|
|
2805
|
+
Or.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Wo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2806
2806
|
});
|
|
2807
2807
|
function ns(e, t) {
|
|
2808
2808
|
return new ts({
|
|
2809
2809
|
type: "prefault",
|
|
2810
2810
|
innerType: e,
|
|
2811
2811
|
get defaultValue() {
|
|
2812
|
-
return typeof t == "function" ? t() :
|
|
2812
|
+
return typeof t == "function" ? t() : Ge(t);
|
|
2813
2813
|
}
|
|
2814
2814
|
});
|
|
2815
2815
|
}
|
|
2816
2816
|
const zt = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
|
|
2817
|
-
|
|
2817
|
+
Tr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Bo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2818
2818
|
});
|
|
2819
2819
|
function rs(e, t) {
|
|
2820
2820
|
return new zt({
|
|
@@ -2824,7 +2824,7 @@ function rs(e, t) {
|
|
|
2824
2824
|
});
|
|
2825
2825
|
}
|
|
2826
2826
|
const os = /* @__PURE__ */ u("ZodCatch", (e, t) => {
|
|
2827
|
-
Er.init(e, t),
|
|
2827
|
+
Er.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Yo(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2828
2828
|
});
|
|
2829
2829
|
function is(e, t) {
|
|
2830
2830
|
return new os({
|
|
@@ -2834,7 +2834,7 @@ function is(e, t) {
|
|
|
2834
2834
|
});
|
|
2835
2835
|
}
|
|
2836
2836
|
const ss = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
2837
|
-
|
|
2837
|
+
Ir.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Go(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
2838
2838
|
});
|
|
2839
2839
|
function Je(e, t) {
|
|
2840
2840
|
return new ss({
|
|
@@ -2845,7 +2845,7 @@ function Je(e, t) {
|
|
|
2845
2845
|
});
|
|
2846
2846
|
}
|
|
2847
2847
|
const cs = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
|
|
2848
|
-
|
|
2848
|
+
Ar.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ko(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2849
2849
|
});
|
|
2850
2850
|
function as(e) {
|
|
2851
2851
|
return new cs({
|
|
@@ -2854,10 +2854,10 @@ function as(e) {
|
|
|
2854
2854
|
});
|
|
2855
2855
|
}
|
|
2856
2856
|
const us = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
2857
|
-
Nr.init(e, t),
|
|
2857
|
+
Nr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ro(e, n);
|
|
2858
2858
|
});
|
|
2859
2859
|
function ls(e, t = {}) {
|
|
2860
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ So(us, e, t);
|
|
2861
2861
|
}
|
|
2862
2862
|
function fs(e) {
|
|
2863
2863
|
return /* @__PURE__ */ Zo(e);
|
|
@@ -2876,31 +2876,31 @@ const ps = {
|
|
|
2876
2876
|
Backfeed70: "70",
|
|
2877
2877
|
Backfeed80: "80",
|
|
2878
2878
|
Backfeed90: "90"
|
|
2879
|
-
}, ds =
|
|
2879
|
+
}, ds = S(ps), hs = {
|
|
2880
2880
|
Continuous: "N",
|
|
2881
2881
|
VariableLengthContinuous: "V",
|
|
2882
2882
|
NonContinuousWebSensing: "W",
|
|
2883
2883
|
NonContinuousWebSensingAlt: "Y",
|
|
2884
2884
|
NonContinuousMarkSensing: "M",
|
|
2885
2885
|
AutoDetect: "A"
|
|
2886
|
-
}, ms =
|
|
2886
|
+
}, ms = S(hs), _s = {
|
|
2887
2887
|
DirectThermal: "D",
|
|
2888
2888
|
ThermalTransfer: "T"
|
|
2889
|
-
}, gs =
|
|
2889
|
+
}, gs = S(_s), vs = {
|
|
2890
2890
|
Invert: "I",
|
|
2891
2891
|
Normal: "N"
|
|
2892
|
-
}, bs =
|
|
2892
|
+
}, bs = S(vs), ys = {
|
|
2893
2893
|
Mirror: "Y",
|
|
2894
2894
|
Normal: "N"
|
|
2895
|
-
},
|
|
2895
|
+
}, ws = S(ys), zs = {
|
|
2896
2896
|
Normal: "A",
|
|
2897
2897
|
Half: "B"
|
|
2898
|
-
}, $s =
|
|
2899
|
-
|
|
2898
|
+
}, $s = S(
|
|
2899
|
+
zs
|
|
2900
2900
|
), ks = {
|
|
2901
2901
|
Enable: "Y",
|
|
2902
2902
|
Disable: "N"
|
|
2903
|
-
},
|
|
2903
|
+
}, Ss = S(ks), Zs = {
|
|
2904
2904
|
TearOff: "T",
|
|
2905
2905
|
PeelOff: "P",
|
|
2906
2906
|
Rewind: "R",
|
|
@@ -2909,83 +2909,83 @@ const ps = {
|
|
|
2909
2909
|
DelayedCut: "D",
|
|
2910
2910
|
EncodeRFID: "F",
|
|
2911
2911
|
Kiosk: "K"
|
|
2912
|
-
}, Os =
|
|
2912
|
+
}, Os = S(Zs), Ts = {
|
|
2913
2913
|
Prepeel: "Y",
|
|
2914
2914
|
NoPrepeel: "N"
|
|
2915
|
-
},
|
|
2915
|
+
}, Es = S(Ts), Is = {
|
|
2916
2916
|
AllMedia: "Y",
|
|
2917
2917
|
ContinuousOnly: "N"
|
|
2918
|
-
},
|
|
2918
|
+
}, As = S(Is), Ns = {
|
|
2919
2919
|
NoRotation: "N",
|
|
2920
2920
|
Rotate90: "R",
|
|
2921
2921
|
Rotate180: "I",
|
|
2922
2922
|
Rotate270: "B"
|
|
2923
|
-
},
|
|
2923
|
+
}, $t = S(Ns), kt = {
|
|
2924
2924
|
Left: "L",
|
|
2925
2925
|
Right: "R",
|
|
2926
2926
|
Center: "C",
|
|
2927
2927
|
Justified: "J"
|
|
2928
|
-
},
|
|
2928
|
+
}, Ps = S(kt), js = {
|
|
2929
2929
|
Highest: "H",
|
|
2930
2930
|
High: "Q",
|
|
2931
2931
|
Medium: "M",
|
|
2932
2932
|
Lower: "L"
|
|
2933
|
-
}, xs =
|
|
2933
|
+
}, xs = S(js), Cs = {
|
|
2934
2934
|
Yes: "Y",
|
|
2935
2935
|
No: "N"
|
|
2936
|
-
}, fe =
|
|
2936
|
+
}, fe = S(Cs), G = {
|
|
2937
2937
|
Start: "start",
|
|
2938
2938
|
End: "end"
|
|
2939
|
-
}, Rs =
|
|
2939
|
+
}, Rs = S(G), Ds = {
|
|
2940
2940
|
account: "account",
|
|
2941
2941
|
accountAttributes: "accountAttributes",
|
|
2942
2942
|
accountTiers: "accountTiers",
|
|
2943
2943
|
pass: "pass",
|
|
2944
2944
|
passResponses: "passResponses",
|
|
2945
2945
|
passAttributes: "passAttributes"
|
|
2946
|
-
}, Fs =
|
|
2946
|
+
}, Fs = S(Ds), B = {
|
|
2947
2947
|
None: "None",
|
|
2948
2948
|
Uppercase: "Uppercase",
|
|
2949
2949
|
Lowercase: "Lowercase",
|
|
2950
2950
|
Capitalize: "Capitalize"
|
|
2951
|
-
}, Ms =
|
|
2952
|
-
word:
|
|
2951
|
+
}, Ms = S(B), sc = ce({
|
|
2952
|
+
word: N(),
|
|
2953
2953
|
width: g(),
|
|
2954
2954
|
spaceWidth: g()
|
|
2955
2955
|
}), ae = ce({
|
|
2956
|
-
name:
|
|
2956
|
+
name: N(),
|
|
2957
2957
|
x: g().int(),
|
|
2958
2958
|
y: g().int(),
|
|
2959
|
-
defaultValue:
|
|
2959
|
+
defaultValue: N(),
|
|
2960
2960
|
verticalAlignment: Rs,
|
|
2961
2961
|
sourceType: Fs,
|
|
2962
|
-
sourceLookup:
|
|
2963
|
-
sourceSeperator:
|
|
2962
|
+
sourceLookup: N(),
|
|
2963
|
+
sourceSeperator: N(),
|
|
2964
2964
|
hideEmpty: Fe(),
|
|
2965
2965
|
editable: Fe()
|
|
2966
|
-
}),
|
|
2966
|
+
}), Ls = ae.extend({
|
|
2967
2967
|
type: x("text"),
|
|
2968
2968
|
// ^A font, height
|
|
2969
|
-
font:
|
|
2970
|
-
fontOrientation:
|
|
2969
|
+
font: N().regex(/^[A-Z0-9]$/, "Font must be a single character A-Z or 0-9"),
|
|
2970
|
+
fontOrientation: $t,
|
|
2971
2971
|
fontHeight: g().int().min(1).max(32e3),
|
|
2972
2972
|
// ^FB maxWidth, maxLines, lineSpacing, alignment, hangingIndent
|
|
2973
2973
|
maxWidth: g().int().min(0).max(9999),
|
|
2974
2974
|
maxLines: g().int().min(1).max(9999),
|
|
2975
2975
|
lineSpacing: g().int().min(-9999).max(9999),
|
|
2976
|
-
alignment:
|
|
2976
|
+
alignment: Ps,
|
|
2977
2977
|
hangingIndent: g().int().min(0).max(9999),
|
|
2978
2978
|
// CUSTOM
|
|
2979
2979
|
charsPerLine: g().int().min(1).max(100),
|
|
2980
2980
|
transformation: Ms,
|
|
2981
2981
|
maxCharacters: g().int().min(1).max(100),
|
|
2982
2982
|
measuredWidth: g().min(0).optional()
|
|
2983
|
-
}),
|
|
2983
|
+
}), Us = ae.extend({
|
|
2984
2984
|
type: x("barcode"),
|
|
2985
2985
|
// ^BY barWidth
|
|
2986
2986
|
barWidth: g().int().min(1).max(100),
|
|
2987
2987
|
// ^BC orientation, height, line, lineAbove, checkDigit
|
|
2988
|
-
orientation:
|
|
2988
|
+
orientation: $t,
|
|
2989
2989
|
height: g().int().min(1).max(32e3),
|
|
2990
2990
|
line: fe,
|
|
2991
2991
|
lineAbove: fe,
|
|
@@ -2998,19 +2998,51 @@ const ps = {
|
|
|
2998
2998
|
magnification: g().int().min(1).max(100),
|
|
2999
2999
|
errorCorrection: xs,
|
|
3000
3000
|
mask: g().int().min(0).max(7)
|
|
3001
|
-
}),
|
|
3001
|
+
}), Bs = ae.extend({
|
|
3002
3002
|
type: x("image"),
|
|
3003
3003
|
// ^CF imagePath
|
|
3004
|
-
data:
|
|
3005
|
-
}),
|
|
3006
|
-
Us,
|
|
3004
|
+
data: N()
|
|
3005
|
+
}), Vs = Bi("type", [
|
|
3007
3006
|
Ls,
|
|
3007
|
+
Us,
|
|
3008
3008
|
Js,
|
|
3009
|
-
|
|
3009
|
+
Bs
|
|
3010
3010
|
]), Ws = ce({
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3011
|
+
alias: N().length(1),
|
|
3012
|
+
name: yt([
|
|
3013
|
+
// DEFAULT
|
|
3014
|
+
"Arial",
|
|
3015
|
+
"Open Sans",
|
|
3016
|
+
"Roboto",
|
|
3017
|
+
"Lato",
|
|
3018
|
+
"Montserrat",
|
|
3019
|
+
"Inter",
|
|
3020
|
+
"Oswald",
|
|
3021
|
+
// CUSTOM
|
|
3022
|
+
"Raleway",
|
|
3023
|
+
"Raleway Bold",
|
|
3024
|
+
"Paris",
|
|
3025
|
+
"London",
|
|
3026
|
+
"GT Walsheim",
|
|
3027
|
+
"Domain Display"
|
|
3028
|
+
])
|
|
3029
|
+
}), Ys = {
|
|
3030
|
+
// DEFAULT
|
|
3031
|
+
Arial: "ARIAL.TTF",
|
|
3032
|
+
"Open Sans": "OPEN_SANS.TTF",
|
|
3033
|
+
Roboto: "ROBOTO.TTF",
|
|
3034
|
+
Lato: "LATO.TTF",
|
|
3035
|
+
Montserrat: "MONTSERRAT.TTF",
|
|
3036
|
+
Inter: "INTER.TTF",
|
|
3037
|
+
Oswald: "OSWALD.TTF",
|
|
3038
|
+
// CUSTOM
|
|
3039
|
+
Raleway: "RALEWAY.TTF",
|
|
3040
|
+
"Raleway Bold": "RALEWAY_BOLD.TTF",
|
|
3041
|
+
Paris: "PARIS.TTF",
|
|
3042
|
+
London: "LONDON.TTF",
|
|
3043
|
+
"GT Walsheim": "GT_WALSHEIM.TTF",
|
|
3044
|
+
"Domain Display": "DOMAIN_DISPLAY.TTF"
|
|
3045
|
+
}, St = ce({
|
|
3014
3046
|
type: x("thermal"),
|
|
3015
3047
|
// ~TA adjustment
|
|
3016
3048
|
tearOffAdjustment: g().int().min(0).max(120),
|
|
@@ -3024,7 +3056,7 @@ const ps = {
|
|
|
3024
3056
|
// ^PO orientation
|
|
3025
3057
|
printOrientation: bs,
|
|
3026
3058
|
// ^PM mirror
|
|
3027
|
-
mirror:
|
|
3059
|
+
mirror: ws,
|
|
3028
3060
|
// ^LH x,y
|
|
3029
3061
|
labelHomeX: g().int().min(0).max(32e3),
|
|
3030
3062
|
labelHomeY: g().int().min(0).max(32e3),
|
|
@@ -3037,34 +3069,34 @@ const ps = {
|
|
|
3037
3069
|
// ~SD darkness
|
|
3038
3070
|
darkness: g().int().min(0).max(30),
|
|
3039
3071
|
// ^LR reverse
|
|
3040
|
-
reverse:
|
|
3072
|
+
reverse: Ss,
|
|
3041
3073
|
// ^MM mode, prepeel
|
|
3042
3074
|
postPrintMode: Os,
|
|
3043
|
-
prepeel:
|
|
3075
|
+
prepeel: Es,
|
|
3044
3076
|
// ^PW width
|
|
3045
3077
|
printWidth: g().int().min(2),
|
|
3046
3078
|
// ^LL length, allMedia
|
|
3047
3079
|
labelLength: g().int().min(1).max(32e3),
|
|
3048
|
-
allMedia:
|
|
3080
|
+
allMedia: As,
|
|
3049
3081
|
// Fields
|
|
3050
|
-
fields: he(
|
|
3082
|
+
fields: he(Vs),
|
|
3051
3083
|
fonts: he(Ws)
|
|
3052
3084
|
});
|
|
3053
|
-
function sc(e) {
|
|
3054
|
-
return kt.safeParse(e);
|
|
3055
|
-
}
|
|
3056
3085
|
function cc(e) {
|
|
3057
|
-
return
|
|
3086
|
+
return St.safeParse(e);
|
|
3058
3087
|
}
|
|
3059
|
-
function ac(e
|
|
3088
|
+
function ac(e) {
|
|
3089
|
+
return St.parse(e);
|
|
3090
|
+
}
|
|
3091
|
+
function uc(e, t, n) {
|
|
3060
3092
|
if (e.type === "thermal")
|
|
3061
|
-
return
|
|
3093
|
+
return Gs(e, t, n);
|
|
3062
3094
|
throw new Error(`Unsupported badge type: ${e.type}`);
|
|
3063
3095
|
}
|
|
3064
|
-
function
|
|
3096
|
+
function Gs(e, t, n) {
|
|
3065
3097
|
const r = ["^XA", Ks(e)];
|
|
3066
3098
|
for (const o of e.fields) {
|
|
3067
|
-
const s =
|
|
3099
|
+
const s = Hs(o, t, n?.[o.name]);
|
|
3068
3100
|
s && r.push(s);
|
|
3069
3101
|
}
|
|
3070
3102
|
return r.push("^XZ"), r.join(`
|
|
@@ -3090,29 +3122,29 @@ function Ks(e) {
|
|
|
3090
3122
|
`^LL${e.labelLength},${e.allMedia}`
|
|
3091
3123
|
);
|
|
3092
3124
|
for (const r of e.fonts)
|
|
3093
|
-
n.push(`^CW${r.alias},E:${r.name}`);
|
|
3125
|
+
n.push(`^CW${r.alias},E:${Ys[r.name]}`);
|
|
3094
3126
|
return n.join(`
|
|
3095
3127
|
`);
|
|
3096
3128
|
}
|
|
3097
|
-
function
|
|
3098
|
-
let r = n ??
|
|
3129
|
+
function Hs(e, t, n) {
|
|
3130
|
+
let r = n ?? qs(e, t);
|
|
3099
3131
|
if (typeof r == "string")
|
|
3100
3132
|
switch (e.type) {
|
|
3101
3133
|
case "text":
|
|
3102
|
-
return r =
|
|
3134
|
+
return r = Xs(e, r), Qs(e, r);
|
|
3103
3135
|
case "barcode":
|
|
3104
|
-
return tc(e, r);
|
|
3105
|
-
case "qrcode":
|
|
3106
3136
|
return nc(e, r);
|
|
3107
|
-
case "
|
|
3137
|
+
case "qrcode":
|
|
3108
3138
|
return rc(e, r);
|
|
3139
|
+
case "image":
|
|
3140
|
+
return oc(e, r);
|
|
3109
3141
|
default: {
|
|
3110
3142
|
const o = e;
|
|
3111
3143
|
throw new Error(`Unsupported field type: ${o.type}`);
|
|
3112
3144
|
}
|
|
3113
3145
|
}
|
|
3114
3146
|
}
|
|
3115
|
-
function
|
|
3147
|
+
function qs(e, t) {
|
|
3116
3148
|
if (!t) return String(e.defaultValue ?? "");
|
|
3117
3149
|
const n = [], r = e.sourceLookup.split(",");
|
|
3118
3150
|
for (const o of r) {
|
|
@@ -3151,9 +3183,9 @@ function Hs(e, t) {
|
|
|
3151
3183
|
if (f !== void 0) {
|
|
3152
3184
|
const $ = d.split(",")[f];
|
|
3153
3185
|
if ($ !== void 0) {
|
|
3154
|
-
const
|
|
3155
|
-
if (
|
|
3156
|
-
i =
|
|
3186
|
+
const z = $.trim();
|
|
3187
|
+
if (z) {
|
|
3188
|
+
i = z;
|
|
3157
3189
|
break;
|
|
3158
3190
|
}
|
|
3159
3191
|
}
|
|
@@ -3167,40 +3199,40 @@ function Hs(e, t) {
|
|
|
3167
3199
|
}
|
|
3168
3200
|
return n.length === 0 ? e.hideEmpty ? void 0 : String(e.defaultValue ?? "").trim() : n.join(String(e.sourceSeperator ?? " ")).trim();
|
|
3169
3201
|
}
|
|
3170
|
-
function
|
|
3202
|
+
function Xs(e, t) {
|
|
3171
3203
|
switch (e.transformation) {
|
|
3172
|
-
case
|
|
3204
|
+
case B.None:
|
|
3173
3205
|
break;
|
|
3174
|
-
case
|
|
3206
|
+
case B.Uppercase:
|
|
3175
3207
|
t = t.toUpperCase();
|
|
3176
3208
|
break;
|
|
3177
|
-
case
|
|
3209
|
+
case B.Lowercase:
|
|
3178
3210
|
t = t.toLowerCase();
|
|
3179
3211
|
break;
|
|
3180
|
-
case
|
|
3212
|
+
case B.Capitalize:
|
|
3181
3213
|
t = t.replace(/\b\w/g, (n) => n.toUpperCase());
|
|
3182
3214
|
break;
|
|
3183
3215
|
}
|
|
3184
3216
|
return e.maxCharacters !== void 0 && (t = t.slice(0, e.maxCharacters)), t;
|
|
3185
3217
|
}
|
|
3186
|
-
function
|
|
3218
|
+
function Qs(e, t) {
|
|
3187
3219
|
const n = e.fontOrientation, r = `^A${e.font}${n},${e.fontHeight}`;
|
|
3188
3220
|
let o = "^FO", s = e.maxLines;
|
|
3189
|
-
if (e.verticalAlignment ===
|
|
3221
|
+
if (e.verticalAlignment === G.End) {
|
|
3190
3222
|
o = "^FT";
|
|
3191
|
-
const c =
|
|
3223
|
+
const c = ec(e, t);
|
|
3192
3224
|
s = Math.min(c, e.maxLines);
|
|
3193
3225
|
}
|
|
3194
3226
|
const i = `^FB${e.maxWidth},${s},${e.lineSpacing},${e.alignment},${e.hangingIndent}`;
|
|
3195
|
-
return e.alignment ===
|
|
3227
|
+
return e.alignment === kt.Center && (t = t + "\\&"), `${o}${e.x},${e.y}${r}${i}^FD${t}^FS`;
|
|
3196
3228
|
}
|
|
3197
|
-
function
|
|
3229
|
+
function ec(e, t) {
|
|
3198
3230
|
if (e.measuredWidth !== void 0 && e.maxWidth > 0)
|
|
3199
3231
|
return Math.max(1, Math.ceil(e.measuredWidth / e.maxWidth));
|
|
3200
3232
|
const n = t.split("\\&"), r = e.charsPerLine ?? 0;
|
|
3201
|
-
return
|
|
3233
|
+
return tc(n, r);
|
|
3202
3234
|
}
|
|
3203
|
-
function
|
|
3235
|
+
function tc(e, t) {
|
|
3204
3236
|
if (t <= 0)
|
|
3205
3237
|
return e.length;
|
|
3206
3238
|
let n = 0;
|
|
@@ -3208,69 +3240,70 @@ function ec(e, t) {
|
|
|
3208
3240
|
n += Math.max(1, Math.ceil(r.length / t));
|
|
3209
3241
|
return n;
|
|
3210
3242
|
}
|
|
3211
|
-
function
|
|
3243
|
+
function nc(e, t) {
|
|
3212
3244
|
let n = "^FO";
|
|
3213
|
-
e.verticalAlignment ===
|
|
3245
|
+
e.verticalAlignment === G.End && (n = "^FT");
|
|
3214
3246
|
const r = `^BY${e.barWidth}`, o = `^BC${e.orientation},${e.height},${e.line},${e.lineAbove},${e.checkDigit},N`;
|
|
3215
3247
|
return `${n}${e.x},${e.y}${r}${o}^FD${t}^FS`;
|
|
3216
3248
|
}
|
|
3217
|
-
function
|
|
3249
|
+
function rc(e, t) {
|
|
3218
3250
|
let n = "^FO";
|
|
3219
|
-
e.verticalAlignment ===
|
|
3251
|
+
e.verticalAlignment === G.End && (n = "^FT");
|
|
3220
3252
|
const r = `^BQ${e.orientation},${e.model},${e.magnification},${e.errorCorrection},${e.mask}`;
|
|
3221
3253
|
return `${n}${e.x},${e.y}${r}^FDQA,${t}^FS`;
|
|
3222
3254
|
}
|
|
3223
|
-
function
|
|
3255
|
+
function oc(e, t) {
|
|
3224
3256
|
if (t === "") return "";
|
|
3225
3257
|
let n = "^FO";
|
|
3226
|
-
return e.verticalAlignment ===
|
|
3258
|
+
return e.verticalAlignment === G.End && (n = "^FT"), `${n}${e.x},${e.y}^GF${e.data}^FS`;
|
|
3227
3259
|
}
|
|
3228
3260
|
export {
|
|
3229
3261
|
Is as AllMediaMode,
|
|
3230
3262
|
ps as BackfeedAction,
|
|
3231
|
-
|
|
3263
|
+
Ys as FontFamilyToFontZPLName,
|
|
3264
|
+
Ns as FontOrientation,
|
|
3232
3265
|
hs as MediaType,
|
|
3233
3266
|
ys as MirrorMode,
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3267
|
+
Zs as PostPrintMode,
|
|
3268
|
+
Ts as PrepeelMode,
|
|
3269
|
+
zs as PrintDensityAdjustment,
|
|
3237
3270
|
vs as PrintOrientation,
|
|
3238
3271
|
js as QRCodeErrorCorrection,
|
|
3239
3272
|
ks as ReverseMode,
|
|
3240
3273
|
Ds as SourceType,
|
|
3241
|
-
|
|
3242
|
-
|
|
3274
|
+
kt as TextAlignment,
|
|
3275
|
+
B as TextTransformation,
|
|
3243
3276
|
_s as ThermalMediaType,
|
|
3244
|
-
|
|
3277
|
+
G as VerticalAlignment,
|
|
3245
3278
|
Cs as YesNo,
|
|
3246
|
-
|
|
3279
|
+
As as allMediaModeSchema,
|
|
3247
3280
|
ds as backfeedActionSchema,
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3281
|
+
St as badgeSchema,
|
|
3282
|
+
Us as barcodeFieldSchema,
|
|
3283
|
+
ec as countLines,
|
|
3284
|
+
Vs as fieldSchema,
|
|
3285
|
+
$t as fontOrientationSchema,
|
|
3253
3286
|
Ws as fontSchema,
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3287
|
+
uc as generate,
|
|
3288
|
+
qs as getFieldValue,
|
|
3289
|
+
Bs as imageFieldSchema,
|
|
3257
3290
|
ms as mediaTypeSchema,
|
|
3258
|
-
|
|
3291
|
+
ws as mirrorModeSchema,
|
|
3259
3292
|
Os as postPrintModeSchema,
|
|
3260
|
-
|
|
3293
|
+
Es as prepeelModeSchema,
|
|
3261
3294
|
$s as printDensityAdjustmentSchema,
|
|
3262
3295
|
bs as printOrientationSchema,
|
|
3263
3296
|
xs as qrCodeErrorCorrectionSchema,
|
|
3264
3297
|
Js as qrcodeFieldSchema,
|
|
3265
|
-
|
|
3298
|
+
Ss as reverseModeSchema,
|
|
3266
3299
|
Fs as sourceTypeSchema,
|
|
3267
|
-
|
|
3268
|
-
|
|
3300
|
+
Ps as textAlignmentSchema,
|
|
3301
|
+
Ls as textFieldSchema,
|
|
3269
3302
|
Ms as textTransformationSchema,
|
|
3270
3303
|
gs as thermalMediaTypeSchema,
|
|
3271
|
-
|
|
3272
|
-
|
|
3304
|
+
cc as validateBadge,
|
|
3305
|
+
ac as validateBadgeOrThrow,
|
|
3273
3306
|
Rs as verticalAlignmentSchema,
|
|
3274
|
-
|
|
3307
|
+
sc as wordWidthSchema,
|
|
3275
3308
|
fe as yesNoSchema
|
|
3276
3309
|
};
|