@wso2/am-core-ui 0.0.18 → 0.0.20
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/APIKeysManager-C0phJriD.js +241 -0
- package/dist/CatalogKindListing-DvUuZEpc.js +137 -0
- package/dist/CodeBlock-B2Ecl916.js +21736 -0
- package/dist/EnvironmentCard-CIXhDhlZ.js +319 -0
- package/dist/EnvironmentSelector-D8S6nO9u.js +48 -0
- package/dist/IsolationTierIndicator-cf90kgjL.js +81 -0
- package/dist/LabelChips-7rA7_yre.js +139 -0
- package/dist/MCPLogo-D9IJzzl7.js +30 -0
- package/dist/PolicyListSection-D6aVSKwP.js +1143 -0
- package/dist/ResourceListShell-DFisKftq.js +463 -0
- package/dist/SwaggerSpecViewer-DzjR6U6W.js +106 -0
- package/dist/clipboard-YAzStmkw.js +23 -0
- package/dist/debounce-D17ObVdG.js +208 -0
- package/dist/format-wlHhWjGo.js +29 -0
- package/dist/formatDistanceToNow-DyjnT7l9.js +100 -0
- package/dist/gatewayScripts-D4ZDEDPS.js +72 -0
- package/dist/highlight-BsUzxSR3.js +454 -0
- package/dist/{index-CnXsN5I3.js → index-3K-zqdp-.js} +34 -33
- package/dist/index-6liAPSDn.js +1564 -0
- package/dist/index-B3ASENUJ.js +1290 -0
- package/dist/index-B7Pf4oPq.js +3069 -0
- package/dist/index-BNO3FhZK.js +2304 -0
- package/dist/index-BUZSfCl5.js +335 -0
- package/dist/index-BXiG1r_o.js +1409 -0
- package/dist/index-BYy7Iaam.js +459 -0
- package/dist/index-BbB_yx4V.js +1397 -0
- package/dist/index-BjWJ95lH.js +2728 -0
- package/dist/index-ByEInFlf.js +26408 -0
- package/dist/index-C8WIhzyz.js +123 -0
- package/dist/index-CnzvaT6b.js +2368 -0
- package/dist/index-CrnCf-hJ.js +763 -0
- package/dist/index-Cvsho9xg.js +2346 -0
- package/dist/index-CxnAo1_c.js +119 -0
- package/dist/{index-DYV1jEai.js → index-Cz7-AZwE.js} +22 -20
- package/dist/index-DBdRFjxm.js +1264 -0
- package/dist/index-DFsSvmMZ.js +7981 -0
- package/dist/index-DslzOSGN.js +2549 -0
- package/dist/index-DvpYvchM.js +2341 -0
- package/dist/index-PWsNvJB-.js +546 -0
- package/dist/index.d.ts +1398 -481
- package/dist/index.js +539 -438
- package/dist/js-yaml-CvhD-clg.js +1335 -0
- package/dist/llmProviderPayload-BPzWDy7n.js +332 -0
- package/dist/schemas-DFScWdSL.js +2969 -0
- package/package.json +1 -1
- package/dist/index-B47EJCom.js +0 -236
- package/dist/index-Bl1Y7Sro.js +0 -3037
- package/dist/index-DlS9Lybj.js +0 -80691
|
@@ -0,0 +1,2969 @@
|
|
|
1
|
+
function a(e, n, t) {
|
|
2
|
+
function r(c, u) {
|
|
3
|
+
if (c._zod || Object.defineProperty(c, "_zod", {
|
|
4
|
+
value: {
|
|
5
|
+
def: u,
|
|
6
|
+
constr: s,
|
|
7
|
+
traits: /* @__PURE__ */ new Set()
|
|
8
|
+
},
|
|
9
|
+
enumerable: !1
|
|
10
|
+
}), c._zod.traits.has(e))
|
|
11
|
+
return;
|
|
12
|
+
c._zod.traits.add(e), n(c, u);
|
|
13
|
+
const l = s.prototype, f = Object.keys(l);
|
|
14
|
+
for (let d = 0; d < f.length; d++) {
|
|
15
|
+
const h = f[d];
|
|
16
|
+
h in c || (c[h] = l[h].bind(c));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const o = t?.Parent ?? Object;
|
|
20
|
+
class i extends o {
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(i, "name", { value: e });
|
|
23
|
+
function s(c) {
|
|
24
|
+
var u;
|
|
25
|
+
const l = t?.Parent ? new i() : this;
|
|
26
|
+
r(l, c), (u = l._zod).deferred ?? (u.deferred = []);
|
|
27
|
+
for (const f of l._zod.deferred)
|
|
28
|
+
f();
|
|
29
|
+
return l;
|
|
30
|
+
}
|
|
31
|
+
return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
|
|
32
|
+
value: (c) => t?.Parent && c instanceof t.Parent ? !0 : c?._zod?.traits?.has(e)
|
|
33
|
+
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
34
|
+
}
|
|
35
|
+
class C extends Error {
|
|
36
|
+
constructor() {
|
|
37
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class Ae extends Error {
|
|
41
|
+
constructor(n) {
|
|
42
|
+
super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const De = {};
|
|
46
|
+
function T(e) {
|
|
47
|
+
return De;
|
|
48
|
+
}
|
|
49
|
+
function Re(e) {
|
|
50
|
+
const n = Object.values(e).filter((r) => typeof r == "number");
|
|
51
|
+
return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
|
|
52
|
+
}
|
|
53
|
+
function te(e, n) {
|
|
54
|
+
return typeof n == "bigint" ? n.toString() : n;
|
|
55
|
+
}
|
|
56
|
+
function se(e) {
|
|
57
|
+
return {
|
|
58
|
+
get value() {
|
|
59
|
+
{
|
|
60
|
+
const n = e();
|
|
61
|
+
return Object.defineProperty(this, "value", { value: n }), n;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function ie(e) {
|
|
67
|
+
return e == null;
|
|
68
|
+
}
|
|
69
|
+
function ce(e) {
|
|
70
|
+
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
|
|
71
|
+
return e.slice(n, t);
|
|
72
|
+
}
|
|
73
|
+
function hn(e, n) {
|
|
74
|
+
const t = (e.toString().split(".")[1] || "").length, r = n.toString();
|
|
75
|
+
let o = (r.split(".")[1] || "").length;
|
|
76
|
+
if (o === 0 && /\d?e-\d?/.test(r)) {
|
|
77
|
+
const u = r.match(/\d?e-(\d?)/);
|
|
78
|
+
u?.[1] && (o = Number.parseInt(u[1]));
|
|
79
|
+
}
|
|
80
|
+
const i = t > o ? t : o, s = Number.parseInt(e.toFixed(i).replace(".", "")), c = Number.parseInt(n.toFixed(i).replace(".", ""));
|
|
81
|
+
return s % c / 10 ** i;
|
|
82
|
+
}
|
|
83
|
+
const pe = Symbol("evaluating");
|
|
84
|
+
function _(e, n, t) {
|
|
85
|
+
let r;
|
|
86
|
+
Object.defineProperty(e, n, {
|
|
87
|
+
get() {
|
|
88
|
+
if (r !== pe)
|
|
89
|
+
return r === void 0 && (r = pe, r = t()), r;
|
|
90
|
+
},
|
|
91
|
+
set(o) {
|
|
92
|
+
Object.defineProperty(e, n, {
|
|
93
|
+
value: o
|
|
94
|
+
// configurable: true,
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
configurable: !0
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function A(e, n, t) {
|
|
101
|
+
Object.defineProperty(e, n, {
|
|
102
|
+
value: t,
|
|
103
|
+
writable: !0,
|
|
104
|
+
enumerable: !0,
|
|
105
|
+
configurable: !0
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function N(...e) {
|
|
109
|
+
const n = {};
|
|
110
|
+
for (const t of e) {
|
|
111
|
+
const r = Object.getOwnPropertyDescriptors(t);
|
|
112
|
+
Object.assign(n, r);
|
|
113
|
+
}
|
|
114
|
+
return Object.defineProperties({}, n);
|
|
115
|
+
}
|
|
116
|
+
function de(e) {
|
|
117
|
+
return JSON.stringify(e);
|
|
118
|
+
}
|
|
119
|
+
function mn(e) {
|
|
120
|
+
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
121
|
+
}
|
|
122
|
+
const Ce = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
123
|
+
};
|
|
124
|
+
function Y(e) {
|
|
125
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
126
|
+
}
|
|
127
|
+
const _n = se(() => {
|
|
128
|
+
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
129
|
+
return !1;
|
|
130
|
+
try {
|
|
131
|
+
const e = Function;
|
|
132
|
+
return new e(""), !0;
|
|
133
|
+
} catch {
|
|
134
|
+
return !1;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
function U(e) {
|
|
138
|
+
if (Y(e) === !1)
|
|
139
|
+
return !1;
|
|
140
|
+
const n = e.constructor;
|
|
141
|
+
if (n === void 0 || typeof n != "function")
|
|
142
|
+
return !0;
|
|
143
|
+
const t = n.prototype;
|
|
144
|
+
return !(Y(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
145
|
+
}
|
|
146
|
+
function Ue(e) {
|
|
147
|
+
return U(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
148
|
+
}
|
|
149
|
+
const gn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
150
|
+
function x(e) {
|
|
151
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
152
|
+
}
|
|
153
|
+
function j(e, n, t) {
|
|
154
|
+
const r = new e._zod.constr(n ?? e._zod.def);
|
|
155
|
+
return (!n || t?.parent) && (r._zod.parent = e), r;
|
|
156
|
+
}
|
|
157
|
+
function p(e) {
|
|
158
|
+
const n = e;
|
|
159
|
+
if (!n)
|
|
160
|
+
return {};
|
|
161
|
+
if (typeof n == "string")
|
|
162
|
+
return { error: () => n };
|
|
163
|
+
if (n?.message !== void 0) {
|
|
164
|
+
if (n?.error !== void 0)
|
|
165
|
+
throw new Error("Cannot specify both `message` and `error` params");
|
|
166
|
+
n.error = n.message;
|
|
167
|
+
}
|
|
168
|
+
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
|
|
169
|
+
}
|
|
170
|
+
function vn(e) {
|
|
171
|
+
return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
|
|
172
|
+
}
|
|
173
|
+
const zn = {
|
|
174
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
175
|
+
int32: [-2147483648, 2147483647],
|
|
176
|
+
uint32: [0, 4294967295],
|
|
177
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
178
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
179
|
+
};
|
|
180
|
+
function yn(e, n) {
|
|
181
|
+
const t = e._zod.def, r = t.checks;
|
|
182
|
+
if (r && r.length > 0)
|
|
183
|
+
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
184
|
+
const i = N(e._zod.def, {
|
|
185
|
+
get shape() {
|
|
186
|
+
const s = {};
|
|
187
|
+
for (const c in n) {
|
|
188
|
+
if (!(c in t.shape))
|
|
189
|
+
throw new Error(`Unrecognized key: "${c}"`);
|
|
190
|
+
n[c] && (s[c] = t.shape[c]);
|
|
191
|
+
}
|
|
192
|
+
return A(this, "shape", s), s;
|
|
193
|
+
},
|
|
194
|
+
checks: []
|
|
195
|
+
});
|
|
196
|
+
return j(e, i);
|
|
197
|
+
}
|
|
198
|
+
function bn(e, n) {
|
|
199
|
+
const t = e._zod.def, r = t.checks;
|
|
200
|
+
if (r && r.length > 0)
|
|
201
|
+
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
202
|
+
const i = N(e._zod.def, {
|
|
203
|
+
get shape() {
|
|
204
|
+
const s = { ...e._zod.def.shape };
|
|
205
|
+
for (const c in n) {
|
|
206
|
+
if (!(c in t.shape))
|
|
207
|
+
throw new Error(`Unrecognized key: "${c}"`);
|
|
208
|
+
n[c] && delete s[c];
|
|
209
|
+
}
|
|
210
|
+
return A(this, "shape", s), s;
|
|
211
|
+
},
|
|
212
|
+
checks: []
|
|
213
|
+
});
|
|
214
|
+
return j(e, i);
|
|
215
|
+
}
|
|
216
|
+
function wn(e, n) {
|
|
217
|
+
if (!U(n))
|
|
218
|
+
throw new Error("Invalid input to extend: expected a plain object");
|
|
219
|
+
const t = e._zod.def.checks;
|
|
220
|
+
if (t && t.length > 0) {
|
|
221
|
+
const i = e._zod.def.shape;
|
|
222
|
+
for (const s in n)
|
|
223
|
+
if (Object.getOwnPropertyDescriptor(i, s) !== void 0)
|
|
224
|
+
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
225
|
+
}
|
|
226
|
+
const o = N(e._zod.def, {
|
|
227
|
+
get shape() {
|
|
228
|
+
const i = { ...e._zod.def.shape, ...n };
|
|
229
|
+
return A(this, "shape", i), i;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
return j(e, o);
|
|
233
|
+
}
|
|
234
|
+
function kn(e, n) {
|
|
235
|
+
if (!U(n))
|
|
236
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
237
|
+
const t = N(e._zod.def, {
|
|
238
|
+
get shape() {
|
|
239
|
+
const r = { ...e._zod.def.shape, ...n };
|
|
240
|
+
return A(this, "shape", r), r;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
return j(e, t);
|
|
244
|
+
}
|
|
245
|
+
function $n(e, n) {
|
|
246
|
+
const t = N(e._zod.def, {
|
|
247
|
+
get shape() {
|
|
248
|
+
const r = { ...e._zod.def.shape, ...n._zod.def.shape };
|
|
249
|
+
return A(this, "shape", r), r;
|
|
250
|
+
},
|
|
251
|
+
get catchall() {
|
|
252
|
+
return n._zod.def.catchall;
|
|
253
|
+
},
|
|
254
|
+
checks: []
|
|
255
|
+
// delete existing checks
|
|
256
|
+
});
|
|
257
|
+
return j(e, t);
|
|
258
|
+
}
|
|
259
|
+
function Zn(e, n, t) {
|
|
260
|
+
const o = n._zod.def.checks;
|
|
261
|
+
if (o && o.length > 0)
|
|
262
|
+
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
263
|
+
const s = N(n._zod.def, {
|
|
264
|
+
get shape() {
|
|
265
|
+
const c = n._zod.def.shape, u = { ...c };
|
|
266
|
+
if (t)
|
|
267
|
+
for (const l in t) {
|
|
268
|
+
if (!(l in c))
|
|
269
|
+
throw new Error(`Unrecognized key: "${l}"`);
|
|
270
|
+
t[l] && (u[l] = e ? new e({
|
|
271
|
+
type: "optional",
|
|
272
|
+
innerType: c[l]
|
|
273
|
+
}) : c[l]);
|
|
274
|
+
}
|
|
275
|
+
else
|
|
276
|
+
for (const l in c)
|
|
277
|
+
u[l] = e ? new e({
|
|
278
|
+
type: "optional",
|
|
279
|
+
innerType: c[l]
|
|
280
|
+
}) : c[l];
|
|
281
|
+
return A(this, "shape", u), u;
|
|
282
|
+
},
|
|
283
|
+
checks: []
|
|
284
|
+
});
|
|
285
|
+
return j(n, s);
|
|
286
|
+
}
|
|
287
|
+
function Sn(e, n, t) {
|
|
288
|
+
const r = N(n._zod.def, {
|
|
289
|
+
get shape() {
|
|
290
|
+
const o = n._zod.def.shape, i = { ...o };
|
|
291
|
+
if (t)
|
|
292
|
+
for (const s in t) {
|
|
293
|
+
if (!(s in i))
|
|
294
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
295
|
+
t[s] && (i[s] = new e({
|
|
296
|
+
type: "nonoptional",
|
|
297
|
+
innerType: o[s]
|
|
298
|
+
}));
|
|
299
|
+
}
|
|
300
|
+
else
|
|
301
|
+
for (const s in o)
|
|
302
|
+
i[s] = new e({
|
|
303
|
+
type: "nonoptional",
|
|
304
|
+
innerType: o[s]
|
|
305
|
+
});
|
|
306
|
+
return A(this, "shape", i), i;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
return j(n, r);
|
|
310
|
+
}
|
|
311
|
+
function D(e, n = 0) {
|
|
312
|
+
if (e.aborted === !0)
|
|
313
|
+
return !0;
|
|
314
|
+
for (let t = n; t < e.issues.length; t++)
|
|
315
|
+
if (e.issues[t]?.continue !== !0)
|
|
316
|
+
return !0;
|
|
317
|
+
return !1;
|
|
318
|
+
}
|
|
319
|
+
function R(e, n) {
|
|
320
|
+
return n.map((t) => {
|
|
321
|
+
var r;
|
|
322
|
+
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function V(e) {
|
|
326
|
+
return typeof e == "string" ? e : e?.message;
|
|
327
|
+
}
|
|
328
|
+
function P(e, n, t) {
|
|
329
|
+
const r = { ...e, path: e.path ?? [] };
|
|
330
|
+
if (!e.message) {
|
|
331
|
+
const o = V(e.inst?._zod.def?.error?.(e)) ?? V(n?.error?.(e)) ?? V(t.customError?.(e)) ?? V(t.localeError?.(e)) ?? "Invalid input";
|
|
332
|
+
r.message = o;
|
|
333
|
+
}
|
|
334
|
+
return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
|
|
335
|
+
}
|
|
336
|
+
function ue(e) {
|
|
337
|
+
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
338
|
+
}
|
|
339
|
+
function M(...e) {
|
|
340
|
+
const [n, t, r] = e;
|
|
341
|
+
return typeof n == "string" ? {
|
|
342
|
+
message: n,
|
|
343
|
+
code: "custom",
|
|
344
|
+
input: t,
|
|
345
|
+
inst: r
|
|
346
|
+
} : { ...n };
|
|
347
|
+
}
|
|
348
|
+
const xe = (e, n) => {
|
|
349
|
+
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
350
|
+
value: e._zod,
|
|
351
|
+
enumerable: !1
|
|
352
|
+
}), Object.defineProperty(e, "issues", {
|
|
353
|
+
value: n,
|
|
354
|
+
enumerable: !1
|
|
355
|
+
}), e.message = JSON.stringify(n, te, 2), Object.defineProperty(e, "toString", {
|
|
356
|
+
value: () => e.message,
|
|
357
|
+
enumerable: !1
|
|
358
|
+
});
|
|
359
|
+
}, Fe = a("$ZodError", xe), Je = a("$ZodError", xe, { Parent: Error });
|
|
360
|
+
function On(e, n = (t) => t.message) {
|
|
361
|
+
const t = {}, r = [];
|
|
362
|
+
for (const o of e.issues)
|
|
363
|
+
o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
|
|
364
|
+
return { formErrors: r, fieldErrors: t };
|
|
365
|
+
}
|
|
366
|
+
function En(e, n = (t) => t.message) {
|
|
367
|
+
const t = { _errors: [] }, r = (o) => {
|
|
368
|
+
for (const i of o.issues)
|
|
369
|
+
if (i.code === "invalid_union" && i.errors.length)
|
|
370
|
+
i.errors.map((s) => r({ issues: s }));
|
|
371
|
+
else if (i.code === "invalid_key")
|
|
372
|
+
r({ issues: i.issues });
|
|
373
|
+
else if (i.code === "invalid_element")
|
|
374
|
+
r({ issues: i.issues });
|
|
375
|
+
else if (i.path.length === 0)
|
|
376
|
+
t._errors.push(n(i));
|
|
377
|
+
else {
|
|
378
|
+
let s = t, c = 0;
|
|
379
|
+
for (; c < i.path.length; ) {
|
|
380
|
+
const u = i.path[c];
|
|
381
|
+
c === i.path.length - 1 ? (s[u] = s[u] || { _errors: [] }, s[u]._errors.push(n(i))) : s[u] = s[u] || { _errors: [] }, s = s[u], c++;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
return r(e), t;
|
|
386
|
+
}
|
|
387
|
+
const ae = (e) => (n, t, r, o) => {
|
|
388
|
+
const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, i);
|
|
389
|
+
if (s instanceof Promise)
|
|
390
|
+
throw new C();
|
|
391
|
+
if (s.issues.length) {
|
|
392
|
+
const c = new (o?.Err ?? e)(s.issues.map((u) => P(u, i, T())));
|
|
393
|
+
throw Ce(c, o?.callee), c;
|
|
394
|
+
}
|
|
395
|
+
return s.value;
|
|
396
|
+
}, le = (e) => async (n, t, r, o) => {
|
|
397
|
+
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
398
|
+
let s = n._zod.run({ value: t, issues: [] }, i);
|
|
399
|
+
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
400
|
+
const c = new (o?.Err ?? e)(s.issues.map((u) => P(u, i, T())));
|
|
401
|
+
throw Ce(c, o?.callee), c;
|
|
402
|
+
}
|
|
403
|
+
return s.value;
|
|
404
|
+
}, Q = (e) => (n, t, r) => {
|
|
405
|
+
const o = r ? { ...r, async: !1 } : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, o);
|
|
406
|
+
if (i instanceof Promise)
|
|
407
|
+
throw new C();
|
|
408
|
+
return i.issues.length ? {
|
|
409
|
+
success: !1,
|
|
410
|
+
error: new (e ?? Fe)(i.issues.map((s) => P(s, o, T())))
|
|
411
|
+
} : { success: !0, data: i.value };
|
|
412
|
+
}, In = /* @__PURE__ */ Q(Je), ee = (e) => async (n, t, r) => {
|
|
413
|
+
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
414
|
+
let i = n._zod.run({ value: t, issues: [] }, o);
|
|
415
|
+
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
416
|
+
success: !1,
|
|
417
|
+
error: new e(i.issues.map((s) => P(s, o, T())))
|
|
418
|
+
} : { success: !0, data: i.value };
|
|
419
|
+
}, Tn = /* @__PURE__ */ ee(Je), Pn = (e) => (n, t, r) => {
|
|
420
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
421
|
+
return ae(e)(n, t, o);
|
|
422
|
+
}, Nn = (e) => (n, t, r) => ae(e)(n, t, r), jn = (e) => async (n, t, r) => {
|
|
423
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
424
|
+
return le(e)(n, t, o);
|
|
425
|
+
}, An = (e) => async (n, t, r) => le(e)(n, t, r), Dn = (e) => (n, t, r) => {
|
|
426
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
427
|
+
return Q(e)(n, t, o);
|
|
428
|
+
}, Rn = (e) => (n, t, r) => Q(e)(n, t, r), Cn = (e) => async (n, t, r) => {
|
|
429
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
430
|
+
return ee(e)(n, t, o);
|
|
431
|
+
}, Un = (e) => async (n, t, r) => ee(e)(n, t, r), xn = /^[cC][^\s-]{8,}$/, Fn = /^[0-9a-z]+$/, Jn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Mn = /^[0-9a-vA-V]{20}$/, Ln = /^[A-Za-z0-9]{27}$/, Vn = /^[a-zA-Z0-9_-]{21}$/, Bn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Wn = /^([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})$/, he = (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)$/, Kn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Gn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
432
|
+
function Yn() {
|
|
433
|
+
return new RegExp(Gn, "u");
|
|
434
|
+
}
|
|
435
|
+
const qn = /^(?:(?: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])$/, Xn = /^(([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])$/, Qn = /^(([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])$/, et = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Me = /^[A-Za-z0-9_-]*$/, nt = /^\+[1-9]\d{6,14}$/, Le = "(?:(?:\\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])))", tt = /* @__PURE__ */ new RegExp(`^${Le}$`);
|
|
436
|
+
function Ve(e) {
|
|
437
|
+
const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
438
|
+
return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
439
|
+
}
|
|
440
|
+
function rt(e) {
|
|
441
|
+
return new RegExp(`^${Ve(e)}$`);
|
|
442
|
+
}
|
|
443
|
+
function ot(e) {
|
|
444
|
+
const n = Ve({ precision: e.precision }), t = ["Z"];
|
|
445
|
+
e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
446
|
+
const r = `${n}(?:${t.join("|")})`;
|
|
447
|
+
return new RegExp(`^${Le}T(?:${r})$`);
|
|
448
|
+
}
|
|
449
|
+
const st = (e) => {
|
|
450
|
+
const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
451
|
+
return new RegExp(`^${n}$`);
|
|
452
|
+
}, it = /^-?\d+$/, Be = /^-?\d+(?:\.\d+)?$/, ct = /^(?:true|false)$/i, ut = /^undefined$/i, at = /^[^A-Z]*$/, lt = /^[^a-z]*$/, S = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
|
|
453
|
+
var t;
|
|
454
|
+
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
455
|
+
}), We = {
|
|
456
|
+
number: "number",
|
|
457
|
+
bigint: "bigint",
|
|
458
|
+
object: "date"
|
|
459
|
+
}, Ke = /* @__PURE__ */ a("$ZodCheckLessThan", (e, n) => {
|
|
460
|
+
S.init(e, n);
|
|
461
|
+
const t = We[typeof n.value];
|
|
462
|
+
e._zod.onattach.push((r) => {
|
|
463
|
+
const o = r._zod.bag, i = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
464
|
+
n.value < i && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
|
|
465
|
+
}), e._zod.check = (r) => {
|
|
466
|
+
(n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
|
|
467
|
+
origin: t,
|
|
468
|
+
code: "too_big",
|
|
469
|
+
maximum: typeof n.value == "object" ? n.value.getTime() : n.value,
|
|
470
|
+
input: r.value,
|
|
471
|
+
inclusive: n.inclusive,
|
|
472
|
+
inst: e,
|
|
473
|
+
continue: !n.abort
|
|
474
|
+
});
|
|
475
|
+
};
|
|
476
|
+
}), Ge = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, n) => {
|
|
477
|
+
S.init(e, n);
|
|
478
|
+
const t = We[typeof n.value];
|
|
479
|
+
e._zod.onattach.push((r) => {
|
|
480
|
+
const o = r._zod.bag, i = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
481
|
+
n.value > i && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
|
|
482
|
+
}), e._zod.check = (r) => {
|
|
483
|
+
(n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
|
|
484
|
+
origin: t,
|
|
485
|
+
code: "too_small",
|
|
486
|
+
minimum: typeof n.value == "object" ? n.value.getTime() : n.value,
|
|
487
|
+
input: r.value,
|
|
488
|
+
inclusive: n.inclusive,
|
|
489
|
+
inst: e,
|
|
490
|
+
continue: !n.abort
|
|
491
|
+
});
|
|
492
|
+
};
|
|
493
|
+
}), ft = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, n) => {
|
|
494
|
+
S.init(e, n), e._zod.onattach.push((t) => {
|
|
495
|
+
var r;
|
|
496
|
+
(r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
|
|
497
|
+
}), e._zod.check = (t) => {
|
|
498
|
+
if (typeof t.value != typeof n.value)
|
|
499
|
+
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
500
|
+
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : hn(t.value, n.value) === 0) || t.issues.push({
|
|
501
|
+
origin: typeof t.value,
|
|
502
|
+
code: "not_multiple_of",
|
|
503
|
+
divisor: n.value,
|
|
504
|
+
input: t.value,
|
|
505
|
+
inst: e,
|
|
506
|
+
continue: !n.abort
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
}), pt = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
|
|
510
|
+
S.init(e, n), n.format = n.format || "float64";
|
|
511
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, i] = zn[n.format];
|
|
512
|
+
e._zod.onattach.push((s) => {
|
|
513
|
+
const c = s._zod.bag;
|
|
514
|
+
c.format = n.format, c.minimum = o, c.maximum = i, t && (c.pattern = it);
|
|
515
|
+
}), e._zod.check = (s) => {
|
|
516
|
+
const c = s.value;
|
|
517
|
+
if (t) {
|
|
518
|
+
if (!Number.isInteger(c)) {
|
|
519
|
+
s.issues.push({
|
|
520
|
+
expected: r,
|
|
521
|
+
format: n.format,
|
|
522
|
+
code: "invalid_type",
|
|
523
|
+
continue: !1,
|
|
524
|
+
input: c,
|
|
525
|
+
inst: e
|
|
526
|
+
});
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
if (!Number.isSafeInteger(c)) {
|
|
530
|
+
c > 0 ? s.issues.push({
|
|
531
|
+
input: c,
|
|
532
|
+
code: "too_big",
|
|
533
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
534
|
+
note: "Integers must be within the safe integer range.",
|
|
535
|
+
inst: e,
|
|
536
|
+
origin: r,
|
|
537
|
+
inclusive: !0,
|
|
538
|
+
continue: !n.abort
|
|
539
|
+
}) : s.issues.push({
|
|
540
|
+
input: c,
|
|
541
|
+
code: "too_small",
|
|
542
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
543
|
+
note: "Integers must be within the safe integer range.",
|
|
544
|
+
inst: e,
|
|
545
|
+
origin: r,
|
|
546
|
+
inclusive: !0,
|
|
547
|
+
continue: !n.abort
|
|
548
|
+
});
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
c < o && s.issues.push({
|
|
553
|
+
origin: "number",
|
|
554
|
+
input: c,
|
|
555
|
+
code: "too_small",
|
|
556
|
+
minimum: o,
|
|
557
|
+
inclusive: !0,
|
|
558
|
+
inst: e,
|
|
559
|
+
continue: !n.abort
|
|
560
|
+
}), c > i && s.issues.push({
|
|
561
|
+
origin: "number",
|
|
562
|
+
input: c,
|
|
563
|
+
code: "too_big",
|
|
564
|
+
maximum: i,
|
|
565
|
+
inclusive: !0,
|
|
566
|
+
inst: e,
|
|
567
|
+
continue: !n.abort
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
}), dt = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, n) => {
|
|
571
|
+
var t;
|
|
572
|
+
S.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
573
|
+
const o = r.value;
|
|
574
|
+
return !ie(o) && o.length !== void 0;
|
|
575
|
+
}), e._zod.onattach.push((r) => {
|
|
576
|
+
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
577
|
+
n.maximum < o && (r._zod.bag.maximum = n.maximum);
|
|
578
|
+
}), e._zod.check = (r) => {
|
|
579
|
+
const o = r.value;
|
|
580
|
+
if (o.length <= n.maximum)
|
|
581
|
+
return;
|
|
582
|
+
const s = ue(o);
|
|
583
|
+
r.issues.push({
|
|
584
|
+
origin: s,
|
|
585
|
+
code: "too_big",
|
|
586
|
+
maximum: n.maximum,
|
|
587
|
+
inclusive: !0,
|
|
588
|
+
input: o,
|
|
589
|
+
inst: e,
|
|
590
|
+
continue: !n.abort
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
}), ht = /* @__PURE__ */ a("$ZodCheckMinLength", (e, n) => {
|
|
594
|
+
var t;
|
|
595
|
+
S.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
596
|
+
const o = r.value;
|
|
597
|
+
return !ie(o) && o.length !== void 0;
|
|
598
|
+
}), e._zod.onattach.push((r) => {
|
|
599
|
+
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
600
|
+
n.minimum > o && (r._zod.bag.minimum = n.minimum);
|
|
601
|
+
}), e._zod.check = (r) => {
|
|
602
|
+
const o = r.value;
|
|
603
|
+
if (o.length >= n.minimum)
|
|
604
|
+
return;
|
|
605
|
+
const s = ue(o);
|
|
606
|
+
r.issues.push({
|
|
607
|
+
origin: s,
|
|
608
|
+
code: "too_small",
|
|
609
|
+
minimum: n.minimum,
|
|
610
|
+
inclusive: !0,
|
|
611
|
+
input: o,
|
|
612
|
+
inst: e,
|
|
613
|
+
continue: !n.abort
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
}), mt = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, n) => {
|
|
617
|
+
var t;
|
|
618
|
+
S.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
619
|
+
const o = r.value;
|
|
620
|
+
return !ie(o) && o.length !== void 0;
|
|
621
|
+
}), e._zod.onattach.push((r) => {
|
|
622
|
+
const o = r._zod.bag;
|
|
623
|
+
o.minimum = n.length, o.maximum = n.length, o.length = n.length;
|
|
624
|
+
}), e._zod.check = (r) => {
|
|
625
|
+
const o = r.value, i = o.length;
|
|
626
|
+
if (i === n.length)
|
|
627
|
+
return;
|
|
628
|
+
const s = ue(o), c = i > n.length;
|
|
629
|
+
r.issues.push({
|
|
630
|
+
origin: s,
|
|
631
|
+
...c ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
|
|
632
|
+
inclusive: !0,
|
|
633
|
+
exact: !0,
|
|
634
|
+
input: r.value,
|
|
635
|
+
inst: e,
|
|
636
|
+
continue: !n.abort
|
|
637
|
+
});
|
|
638
|
+
};
|
|
639
|
+
}), ne = /* @__PURE__ */ a("$ZodCheckStringFormat", (e, n) => {
|
|
640
|
+
var t, r;
|
|
641
|
+
S.init(e, n), e._zod.onattach.push((o) => {
|
|
642
|
+
const i = o._zod.bag;
|
|
643
|
+
i.format = n.format, n.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n.pattern));
|
|
644
|
+
}), n.pattern ? (t = e._zod).check ?? (t.check = (o) => {
|
|
645
|
+
n.pattern.lastIndex = 0, !n.pattern.test(o.value) && o.issues.push({
|
|
646
|
+
origin: "string",
|
|
647
|
+
code: "invalid_format",
|
|
648
|
+
format: n.format,
|
|
649
|
+
input: o.value,
|
|
650
|
+
...n.pattern ? { pattern: n.pattern.toString() } : {},
|
|
651
|
+
inst: e,
|
|
652
|
+
continue: !n.abort
|
|
653
|
+
});
|
|
654
|
+
}) : (r = e._zod).check ?? (r.check = () => {
|
|
655
|
+
});
|
|
656
|
+
}), _t = /* @__PURE__ */ a("$ZodCheckRegex", (e, n) => {
|
|
657
|
+
ne.init(e, n), e._zod.check = (t) => {
|
|
658
|
+
n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
|
|
659
|
+
origin: "string",
|
|
660
|
+
code: "invalid_format",
|
|
661
|
+
format: "regex",
|
|
662
|
+
input: t.value,
|
|
663
|
+
pattern: n.pattern.toString(),
|
|
664
|
+
inst: e,
|
|
665
|
+
continue: !n.abort
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
}), gt = /* @__PURE__ */ a("$ZodCheckLowerCase", (e, n) => {
|
|
669
|
+
n.pattern ?? (n.pattern = at), ne.init(e, n);
|
|
670
|
+
}), vt = /* @__PURE__ */ a("$ZodCheckUpperCase", (e, n) => {
|
|
671
|
+
n.pattern ?? (n.pattern = lt), ne.init(e, n);
|
|
672
|
+
}), zt = /* @__PURE__ */ a("$ZodCheckIncludes", (e, n) => {
|
|
673
|
+
S.init(e, n);
|
|
674
|
+
const t = x(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
|
|
675
|
+
n.pattern = r, e._zod.onattach.push((o) => {
|
|
676
|
+
const i = o._zod.bag;
|
|
677
|
+
i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
|
|
678
|
+
}), e._zod.check = (o) => {
|
|
679
|
+
o.value.includes(n.includes, n.position) || o.issues.push({
|
|
680
|
+
origin: "string",
|
|
681
|
+
code: "invalid_format",
|
|
682
|
+
format: "includes",
|
|
683
|
+
includes: n.includes,
|
|
684
|
+
input: o.value,
|
|
685
|
+
inst: e,
|
|
686
|
+
continue: !n.abort
|
|
687
|
+
});
|
|
688
|
+
};
|
|
689
|
+
}), yt = /* @__PURE__ */ a("$ZodCheckStartsWith", (e, n) => {
|
|
690
|
+
S.init(e, n);
|
|
691
|
+
const t = new RegExp(`^${x(n.prefix)}.*`);
|
|
692
|
+
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
|
|
693
|
+
const o = r._zod.bag;
|
|
694
|
+
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
|
|
695
|
+
}), e._zod.check = (r) => {
|
|
696
|
+
r.value.startsWith(n.prefix) || r.issues.push({
|
|
697
|
+
origin: "string",
|
|
698
|
+
code: "invalid_format",
|
|
699
|
+
format: "starts_with",
|
|
700
|
+
prefix: n.prefix,
|
|
701
|
+
input: r.value,
|
|
702
|
+
inst: e,
|
|
703
|
+
continue: !n.abort
|
|
704
|
+
});
|
|
705
|
+
};
|
|
706
|
+
}), bt = /* @__PURE__ */ a("$ZodCheckEndsWith", (e, n) => {
|
|
707
|
+
S.init(e, n);
|
|
708
|
+
const t = new RegExp(`.*${x(n.suffix)}$`);
|
|
709
|
+
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
|
|
710
|
+
const o = r._zod.bag;
|
|
711
|
+
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
|
|
712
|
+
}), e._zod.check = (r) => {
|
|
713
|
+
r.value.endsWith(n.suffix) || r.issues.push({
|
|
714
|
+
origin: "string",
|
|
715
|
+
code: "invalid_format",
|
|
716
|
+
format: "ends_with",
|
|
717
|
+
suffix: n.suffix,
|
|
718
|
+
input: r.value,
|
|
719
|
+
inst: e,
|
|
720
|
+
continue: !n.abort
|
|
721
|
+
});
|
|
722
|
+
};
|
|
723
|
+
}), wt = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
|
|
724
|
+
S.init(e, n), e._zod.check = (t) => {
|
|
725
|
+
t.value = n.tx(t.value);
|
|
726
|
+
};
|
|
727
|
+
});
|
|
728
|
+
class kt {
|
|
729
|
+
constructor(n = []) {
|
|
730
|
+
this.content = [], this.indent = 0, this && (this.args = n);
|
|
731
|
+
}
|
|
732
|
+
indented(n) {
|
|
733
|
+
this.indent += 1, n(this), this.indent -= 1;
|
|
734
|
+
}
|
|
735
|
+
write(n) {
|
|
736
|
+
if (typeof n == "function") {
|
|
737
|
+
n(this, { execution: "sync" }), n(this, { execution: "async" });
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
const r = n.split(`
|
|
741
|
+
`).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), i = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
|
|
742
|
+
for (const s of i)
|
|
743
|
+
this.content.push(s);
|
|
744
|
+
}
|
|
745
|
+
compile() {
|
|
746
|
+
const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
|
|
747
|
+
return new n(...t, o.join(`
|
|
748
|
+
`));
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
const $t = {
|
|
752
|
+
major: 4,
|
|
753
|
+
minor: 3,
|
|
754
|
+
patch: 6
|
|
755
|
+
}, g = /* @__PURE__ */ a("$ZodType", (e, n) => {
|
|
756
|
+
var t;
|
|
757
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = $t;
|
|
758
|
+
const r = [...e._zod.def.checks ?? []];
|
|
759
|
+
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
760
|
+
for (const o of r)
|
|
761
|
+
for (const i of o._zod.onattach)
|
|
762
|
+
i(e);
|
|
763
|
+
if (r.length === 0)
|
|
764
|
+
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
|
|
765
|
+
e._zod.run = e._zod.parse;
|
|
766
|
+
});
|
|
767
|
+
else {
|
|
768
|
+
const o = (s, c, u) => {
|
|
769
|
+
let l = D(s), f;
|
|
770
|
+
for (const d of c) {
|
|
771
|
+
if (d._zod.def.when) {
|
|
772
|
+
if (!d._zod.def.when(s))
|
|
773
|
+
continue;
|
|
774
|
+
} else if (l)
|
|
775
|
+
continue;
|
|
776
|
+
const h = s.issues.length, m = d._zod.check(s);
|
|
777
|
+
if (m instanceof Promise && u?.async === !1)
|
|
778
|
+
throw new C();
|
|
779
|
+
if (f || m instanceof Promise)
|
|
780
|
+
f = (f ?? Promise.resolve()).then(async () => {
|
|
781
|
+
await m, s.issues.length !== h && (l || (l = D(s, h)));
|
|
782
|
+
});
|
|
783
|
+
else {
|
|
784
|
+
if (s.issues.length === h)
|
|
785
|
+
continue;
|
|
786
|
+
l || (l = D(s, h));
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return f ? f.then(() => s) : s;
|
|
790
|
+
}, i = (s, c, u) => {
|
|
791
|
+
if (D(s))
|
|
792
|
+
return s.aborted = !0, s;
|
|
793
|
+
const l = o(c, r, u);
|
|
794
|
+
if (l instanceof Promise) {
|
|
795
|
+
if (u.async === !1)
|
|
796
|
+
throw new C();
|
|
797
|
+
return l.then((f) => e._zod.parse(f, u));
|
|
798
|
+
}
|
|
799
|
+
return e._zod.parse(l, u);
|
|
800
|
+
};
|
|
801
|
+
e._zod.run = (s, c) => {
|
|
802
|
+
if (c.skipChecks)
|
|
803
|
+
return e._zod.parse(s, c);
|
|
804
|
+
if (c.direction === "backward") {
|
|
805
|
+
const l = e._zod.parse({ value: s.value, issues: [] }, { ...c, skipChecks: !0 });
|
|
806
|
+
return l instanceof Promise ? l.then((f) => i(f, s, c)) : i(l, s, c);
|
|
807
|
+
}
|
|
808
|
+
const u = e._zod.parse(s, c);
|
|
809
|
+
if (u instanceof Promise) {
|
|
810
|
+
if (c.async === !1)
|
|
811
|
+
throw new C();
|
|
812
|
+
return u.then((l) => o(l, r, c));
|
|
813
|
+
}
|
|
814
|
+
return o(u, r, c);
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
_(e, "~standard", () => ({
|
|
818
|
+
validate: (o) => {
|
|
819
|
+
try {
|
|
820
|
+
const i = In(e, o);
|
|
821
|
+
return i.success ? { value: i.data } : { issues: i.error?.issues };
|
|
822
|
+
} catch {
|
|
823
|
+
return Tn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
vendor: "zod",
|
|
827
|
+
version: 1
|
|
828
|
+
}));
|
|
829
|
+
}), fe = /* @__PURE__ */ a("$ZodString", (e, n) => {
|
|
830
|
+
g.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? st(e._zod.bag), e._zod.parse = (t, r) => {
|
|
831
|
+
if (n.coerce)
|
|
832
|
+
try {
|
|
833
|
+
t.value = String(t.value);
|
|
834
|
+
} catch {
|
|
835
|
+
}
|
|
836
|
+
return typeof t.value == "string" || t.issues.push({
|
|
837
|
+
expected: "string",
|
|
838
|
+
code: "invalid_type",
|
|
839
|
+
input: t.value,
|
|
840
|
+
inst: e
|
|
841
|
+
}), t;
|
|
842
|
+
};
|
|
843
|
+
}), z = /* @__PURE__ */ a("$ZodStringFormat", (e, n) => {
|
|
844
|
+
ne.init(e, n), fe.init(e, n);
|
|
845
|
+
}), Zt = /* @__PURE__ */ a("$ZodGUID", (e, n) => {
|
|
846
|
+
n.pattern ?? (n.pattern = Wn), z.init(e, n);
|
|
847
|
+
}), St = /* @__PURE__ */ a("$ZodUUID", (e, n) => {
|
|
848
|
+
if (n.version) {
|
|
849
|
+
const r = {
|
|
850
|
+
v1: 1,
|
|
851
|
+
v2: 2,
|
|
852
|
+
v3: 3,
|
|
853
|
+
v4: 4,
|
|
854
|
+
v5: 5,
|
|
855
|
+
v6: 6,
|
|
856
|
+
v7: 7,
|
|
857
|
+
v8: 8
|
|
858
|
+
}[n.version];
|
|
859
|
+
if (r === void 0)
|
|
860
|
+
throw new Error(`Invalid UUID version: "${n.version}"`);
|
|
861
|
+
n.pattern ?? (n.pattern = he(r));
|
|
862
|
+
} else
|
|
863
|
+
n.pattern ?? (n.pattern = he());
|
|
864
|
+
z.init(e, n);
|
|
865
|
+
}), Ot = /* @__PURE__ */ a("$ZodEmail", (e, n) => {
|
|
866
|
+
n.pattern ?? (n.pattern = Kn), z.init(e, n);
|
|
867
|
+
}), Et = /* @__PURE__ */ a("$ZodURL", (e, n) => {
|
|
868
|
+
z.init(e, n), e._zod.check = (t) => {
|
|
869
|
+
try {
|
|
870
|
+
const r = t.value.trim(), o = new URL(r);
|
|
871
|
+
n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(o.hostname) || t.issues.push({
|
|
872
|
+
code: "invalid_format",
|
|
873
|
+
format: "url",
|
|
874
|
+
note: "Invalid hostname",
|
|
875
|
+
pattern: n.hostname.source,
|
|
876
|
+
input: t.value,
|
|
877
|
+
inst: e,
|
|
878
|
+
continue: !n.abort
|
|
879
|
+
})), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || t.issues.push({
|
|
880
|
+
code: "invalid_format",
|
|
881
|
+
format: "url",
|
|
882
|
+
note: "Invalid protocol",
|
|
883
|
+
pattern: n.protocol.source,
|
|
884
|
+
input: t.value,
|
|
885
|
+
inst: e,
|
|
886
|
+
continue: !n.abort
|
|
887
|
+
})), n.normalize ? t.value = o.href : t.value = r;
|
|
888
|
+
return;
|
|
889
|
+
} catch {
|
|
890
|
+
t.issues.push({
|
|
891
|
+
code: "invalid_format",
|
|
892
|
+
format: "url",
|
|
893
|
+
input: t.value,
|
|
894
|
+
inst: e,
|
|
895
|
+
continue: !n.abort
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
}), It = /* @__PURE__ */ a("$ZodEmoji", (e, n) => {
|
|
900
|
+
n.pattern ?? (n.pattern = Yn()), z.init(e, n);
|
|
901
|
+
}), Tt = /* @__PURE__ */ a("$ZodNanoID", (e, n) => {
|
|
902
|
+
n.pattern ?? (n.pattern = Vn), z.init(e, n);
|
|
903
|
+
}), Pt = /* @__PURE__ */ a("$ZodCUID", (e, n) => {
|
|
904
|
+
n.pattern ?? (n.pattern = xn), z.init(e, n);
|
|
905
|
+
}), Nt = /* @__PURE__ */ a("$ZodCUID2", (e, n) => {
|
|
906
|
+
n.pattern ?? (n.pattern = Fn), z.init(e, n);
|
|
907
|
+
}), jt = /* @__PURE__ */ a("$ZodULID", (e, n) => {
|
|
908
|
+
n.pattern ?? (n.pattern = Jn), z.init(e, n);
|
|
909
|
+
}), At = /* @__PURE__ */ a("$ZodXID", (e, n) => {
|
|
910
|
+
n.pattern ?? (n.pattern = Mn), z.init(e, n);
|
|
911
|
+
}), Dt = /* @__PURE__ */ a("$ZodKSUID", (e, n) => {
|
|
912
|
+
n.pattern ?? (n.pattern = Ln), z.init(e, n);
|
|
913
|
+
}), Rt = /* @__PURE__ */ a("$ZodISODateTime", (e, n) => {
|
|
914
|
+
n.pattern ?? (n.pattern = ot(n)), z.init(e, n);
|
|
915
|
+
}), Ct = /* @__PURE__ */ a("$ZodISODate", (e, n) => {
|
|
916
|
+
n.pattern ?? (n.pattern = tt), z.init(e, n);
|
|
917
|
+
}), Ut = /* @__PURE__ */ a("$ZodISOTime", (e, n) => {
|
|
918
|
+
n.pattern ?? (n.pattern = rt(n)), z.init(e, n);
|
|
919
|
+
}), xt = /* @__PURE__ */ a("$ZodISODuration", (e, n) => {
|
|
920
|
+
n.pattern ?? (n.pattern = Bn), z.init(e, n);
|
|
921
|
+
}), Ft = /* @__PURE__ */ a("$ZodIPv4", (e, n) => {
|
|
922
|
+
n.pattern ?? (n.pattern = qn), z.init(e, n), e._zod.bag.format = "ipv4";
|
|
923
|
+
}), Jt = /* @__PURE__ */ a("$ZodIPv6", (e, n) => {
|
|
924
|
+
n.pattern ?? (n.pattern = Xn), z.init(e, n), e._zod.bag.format = "ipv6", e._zod.check = (t) => {
|
|
925
|
+
try {
|
|
926
|
+
new URL(`http://[${t.value}]`);
|
|
927
|
+
} catch {
|
|
928
|
+
t.issues.push({
|
|
929
|
+
code: "invalid_format",
|
|
930
|
+
format: "ipv6",
|
|
931
|
+
input: t.value,
|
|
932
|
+
inst: e,
|
|
933
|
+
continue: !n.abort
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
}), Mt = /* @__PURE__ */ a("$ZodCIDRv4", (e, n) => {
|
|
938
|
+
n.pattern ?? (n.pattern = Hn), z.init(e, n);
|
|
939
|
+
}), Lt = /* @__PURE__ */ a("$ZodCIDRv6", (e, n) => {
|
|
940
|
+
n.pattern ?? (n.pattern = Qn), z.init(e, n), e._zod.check = (t) => {
|
|
941
|
+
const r = t.value.split("/");
|
|
942
|
+
try {
|
|
943
|
+
if (r.length !== 2)
|
|
944
|
+
throw new Error();
|
|
945
|
+
const [o, i] = r;
|
|
946
|
+
if (!i)
|
|
947
|
+
throw new Error();
|
|
948
|
+
const s = Number(i);
|
|
949
|
+
if (`${s}` !== i)
|
|
950
|
+
throw new Error();
|
|
951
|
+
if (s < 0 || s > 128)
|
|
952
|
+
throw new Error();
|
|
953
|
+
new URL(`http://[${o}]`);
|
|
954
|
+
} catch {
|
|
955
|
+
t.issues.push({
|
|
956
|
+
code: "invalid_format",
|
|
957
|
+
format: "cidrv6",
|
|
958
|
+
input: t.value,
|
|
959
|
+
inst: e,
|
|
960
|
+
continue: !n.abort
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
});
|
|
965
|
+
function Ye(e) {
|
|
966
|
+
if (e === "")
|
|
967
|
+
return !0;
|
|
968
|
+
if (e.length % 4 !== 0)
|
|
969
|
+
return !1;
|
|
970
|
+
try {
|
|
971
|
+
return atob(e), !0;
|
|
972
|
+
} catch {
|
|
973
|
+
return !1;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
const Vt = /* @__PURE__ */ a("$ZodBase64", (e, n) => {
|
|
977
|
+
n.pattern ?? (n.pattern = et), z.init(e, n), e._zod.bag.contentEncoding = "base64", e._zod.check = (t) => {
|
|
978
|
+
Ye(t.value) || t.issues.push({
|
|
979
|
+
code: "invalid_format",
|
|
980
|
+
format: "base64",
|
|
981
|
+
input: t.value,
|
|
982
|
+
inst: e,
|
|
983
|
+
continue: !n.abort
|
|
984
|
+
});
|
|
985
|
+
};
|
|
986
|
+
});
|
|
987
|
+
function Bt(e) {
|
|
988
|
+
if (!Me.test(e))
|
|
989
|
+
return !1;
|
|
990
|
+
const n = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), t = n.padEnd(Math.ceil(n.length / 4) * 4, "=");
|
|
991
|
+
return Ye(t);
|
|
992
|
+
}
|
|
993
|
+
const Wt = /* @__PURE__ */ a("$ZodBase64URL", (e, n) => {
|
|
994
|
+
n.pattern ?? (n.pattern = Me), z.init(e, n), e._zod.bag.contentEncoding = "base64url", e._zod.check = (t) => {
|
|
995
|
+
Bt(t.value) || t.issues.push({
|
|
996
|
+
code: "invalid_format",
|
|
997
|
+
format: "base64url",
|
|
998
|
+
input: t.value,
|
|
999
|
+
inst: e,
|
|
1000
|
+
continue: !n.abort
|
|
1001
|
+
});
|
|
1002
|
+
};
|
|
1003
|
+
}), Kt = /* @__PURE__ */ a("$ZodE164", (e, n) => {
|
|
1004
|
+
n.pattern ?? (n.pattern = nt), z.init(e, n);
|
|
1005
|
+
});
|
|
1006
|
+
function Gt(e, n = null) {
|
|
1007
|
+
try {
|
|
1008
|
+
const t = e.split(".");
|
|
1009
|
+
if (t.length !== 3)
|
|
1010
|
+
return !1;
|
|
1011
|
+
const [r] = t;
|
|
1012
|
+
if (!r)
|
|
1013
|
+
return !1;
|
|
1014
|
+
const o = JSON.parse(atob(r));
|
|
1015
|
+
return !("typ" in o && o?.typ !== "JWT" || !o.alg || n && (!("alg" in o) || o.alg !== n));
|
|
1016
|
+
} catch {
|
|
1017
|
+
return !1;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
const Yt = /* @__PURE__ */ a("$ZodJWT", (e, n) => {
|
|
1021
|
+
z.init(e, n), e._zod.check = (t) => {
|
|
1022
|
+
Gt(t.value, n.alg) || t.issues.push({
|
|
1023
|
+
code: "invalid_format",
|
|
1024
|
+
format: "jwt",
|
|
1025
|
+
input: t.value,
|
|
1026
|
+
inst: e,
|
|
1027
|
+
continue: !n.abort
|
|
1028
|
+
});
|
|
1029
|
+
};
|
|
1030
|
+
}), qe = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
|
|
1031
|
+
g.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? Be, e._zod.parse = (t, r) => {
|
|
1032
|
+
if (n.coerce)
|
|
1033
|
+
try {
|
|
1034
|
+
t.value = Number(t.value);
|
|
1035
|
+
} catch {
|
|
1036
|
+
}
|
|
1037
|
+
const o = t.value;
|
|
1038
|
+
if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
|
|
1039
|
+
return t;
|
|
1040
|
+
const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
|
|
1041
|
+
return t.issues.push({
|
|
1042
|
+
expected: "number",
|
|
1043
|
+
code: "invalid_type",
|
|
1044
|
+
input: o,
|
|
1045
|
+
inst: e,
|
|
1046
|
+
...i ? { received: i } : {}
|
|
1047
|
+
}), t;
|
|
1048
|
+
};
|
|
1049
|
+
}), qt = /* @__PURE__ */ a("$ZodNumberFormat", (e, n) => {
|
|
1050
|
+
pt.init(e, n), qe.init(e, n);
|
|
1051
|
+
}), Xt = /* @__PURE__ */ a("$ZodBoolean", (e, n) => {
|
|
1052
|
+
g.init(e, n), e._zod.pattern = ct, e._zod.parse = (t, r) => {
|
|
1053
|
+
if (n.coerce)
|
|
1054
|
+
try {
|
|
1055
|
+
t.value = !!t.value;
|
|
1056
|
+
} catch {
|
|
1057
|
+
}
|
|
1058
|
+
const o = t.value;
|
|
1059
|
+
return typeof o == "boolean" || t.issues.push({
|
|
1060
|
+
expected: "boolean",
|
|
1061
|
+
code: "invalid_type",
|
|
1062
|
+
input: o,
|
|
1063
|
+
inst: e
|
|
1064
|
+
}), t;
|
|
1065
|
+
};
|
|
1066
|
+
}), Ht = /* @__PURE__ */ a("$ZodUndefined", (e, n) => {
|
|
1067
|
+
g.init(e, n), e._zod.pattern = ut, e._zod.values = /* @__PURE__ */ new Set([void 0]), e._zod.optin = "optional", e._zod.optout = "optional", e._zod.parse = (t, r) => {
|
|
1068
|
+
const o = t.value;
|
|
1069
|
+
return typeof o > "u" || t.issues.push({
|
|
1070
|
+
expected: "undefined",
|
|
1071
|
+
code: "invalid_type",
|
|
1072
|
+
input: o,
|
|
1073
|
+
inst: e
|
|
1074
|
+
}), t;
|
|
1075
|
+
};
|
|
1076
|
+
}), Qt = /* @__PURE__ */ a("$ZodUnknown", (e, n) => {
|
|
1077
|
+
g.init(e, n), e._zod.parse = (t) => t;
|
|
1078
|
+
}), er = /* @__PURE__ */ a("$ZodNever", (e, n) => {
|
|
1079
|
+
g.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
|
|
1080
|
+
expected: "never",
|
|
1081
|
+
code: "invalid_type",
|
|
1082
|
+
input: t.value,
|
|
1083
|
+
inst: e
|
|
1084
|
+
}), t);
|
|
1085
|
+
}), nr = /* @__PURE__ */ a("$ZodDate", (e, n) => {
|
|
1086
|
+
g.init(e, n), e._zod.parse = (t, r) => {
|
|
1087
|
+
if (n.coerce)
|
|
1088
|
+
try {
|
|
1089
|
+
t.value = new Date(t.value);
|
|
1090
|
+
} catch {
|
|
1091
|
+
}
|
|
1092
|
+
const o = t.value, i = o instanceof Date;
|
|
1093
|
+
return i && !Number.isNaN(o.getTime()) || t.issues.push({
|
|
1094
|
+
expected: "date",
|
|
1095
|
+
code: "invalid_type",
|
|
1096
|
+
input: o,
|
|
1097
|
+
...i ? { received: "Invalid Date" } : {},
|
|
1098
|
+
inst: e
|
|
1099
|
+
}), t;
|
|
1100
|
+
};
|
|
1101
|
+
});
|
|
1102
|
+
function me(e, n, t) {
|
|
1103
|
+
e.issues.length && n.issues.push(...R(t, e.issues)), n.value[t] = e.value;
|
|
1104
|
+
}
|
|
1105
|
+
const tr = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
1106
|
+
g.init(e, n), e._zod.parse = (t, r) => {
|
|
1107
|
+
const o = t.value;
|
|
1108
|
+
if (!Array.isArray(o))
|
|
1109
|
+
return t.issues.push({
|
|
1110
|
+
expected: "array",
|
|
1111
|
+
code: "invalid_type",
|
|
1112
|
+
input: o,
|
|
1113
|
+
inst: e
|
|
1114
|
+
}), t;
|
|
1115
|
+
t.value = Array(o.length);
|
|
1116
|
+
const i = [];
|
|
1117
|
+
for (let s = 0; s < o.length; s++) {
|
|
1118
|
+
const c = o[s], u = n.element._zod.run({
|
|
1119
|
+
value: c,
|
|
1120
|
+
issues: []
|
|
1121
|
+
}, r);
|
|
1122
|
+
u instanceof Promise ? i.push(u.then((l) => me(l, t, s))) : me(u, t, s);
|
|
1123
|
+
}
|
|
1124
|
+
return i.length ? Promise.all(i).then(() => t) : t;
|
|
1125
|
+
};
|
|
1126
|
+
});
|
|
1127
|
+
function q(e, n, t, r, o) {
|
|
1128
|
+
if (e.issues.length) {
|
|
1129
|
+
if (o && !(t in r))
|
|
1130
|
+
return;
|
|
1131
|
+
n.issues.push(...R(t, e.issues));
|
|
1132
|
+
}
|
|
1133
|
+
e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
|
|
1134
|
+
}
|
|
1135
|
+
function Xe(e) {
|
|
1136
|
+
const n = Object.keys(e.shape);
|
|
1137
|
+
for (const r of n)
|
|
1138
|
+
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
1139
|
+
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
1140
|
+
const t = vn(e.shape);
|
|
1141
|
+
return {
|
|
1142
|
+
...e,
|
|
1143
|
+
keys: n,
|
|
1144
|
+
keySet: new Set(n),
|
|
1145
|
+
numKeys: n.length,
|
|
1146
|
+
optionalKeys: new Set(t)
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
function He(e, n, t, r, o, i) {
|
|
1150
|
+
const s = [], c = o.keySet, u = o.catchall._zod, l = u.def.type, f = u.optout === "optional";
|
|
1151
|
+
for (const d in n) {
|
|
1152
|
+
if (c.has(d))
|
|
1153
|
+
continue;
|
|
1154
|
+
if (l === "never") {
|
|
1155
|
+
s.push(d);
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
const h = u.run({ value: n[d], issues: [] }, r);
|
|
1159
|
+
h instanceof Promise ? e.push(h.then((m) => q(m, t, d, n, f))) : q(h, t, d, n, f);
|
|
1160
|
+
}
|
|
1161
|
+
return s.length && t.issues.push({
|
|
1162
|
+
code: "unrecognized_keys",
|
|
1163
|
+
keys: s,
|
|
1164
|
+
input: n,
|
|
1165
|
+
inst: i
|
|
1166
|
+
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
1167
|
+
}
|
|
1168
|
+
const rr = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
1169
|
+
if (g.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
|
|
1170
|
+
const c = n.shape;
|
|
1171
|
+
Object.defineProperty(n, "shape", {
|
|
1172
|
+
get: () => {
|
|
1173
|
+
const u = { ...c };
|
|
1174
|
+
return Object.defineProperty(n, "shape", {
|
|
1175
|
+
value: u
|
|
1176
|
+
}), u;
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
const r = se(() => Xe(n));
|
|
1181
|
+
_(e._zod, "propValues", () => {
|
|
1182
|
+
const c = n.shape, u = {};
|
|
1183
|
+
for (const l in c) {
|
|
1184
|
+
const f = c[l]._zod;
|
|
1185
|
+
if (f.values) {
|
|
1186
|
+
u[l] ?? (u[l] = /* @__PURE__ */ new Set());
|
|
1187
|
+
for (const d of f.values)
|
|
1188
|
+
u[l].add(d);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
return u;
|
|
1192
|
+
});
|
|
1193
|
+
const o = Y, i = n.catchall;
|
|
1194
|
+
let s;
|
|
1195
|
+
e._zod.parse = (c, u) => {
|
|
1196
|
+
s ?? (s = r.value);
|
|
1197
|
+
const l = c.value;
|
|
1198
|
+
if (!o(l))
|
|
1199
|
+
return c.issues.push({
|
|
1200
|
+
expected: "object",
|
|
1201
|
+
code: "invalid_type",
|
|
1202
|
+
input: l,
|
|
1203
|
+
inst: e
|
|
1204
|
+
}), c;
|
|
1205
|
+
c.value = {};
|
|
1206
|
+
const f = [], d = s.shape;
|
|
1207
|
+
for (const h of s.keys) {
|
|
1208
|
+
const m = d[h], k = m._zod.optout === "optional", w = m._zod.run({ value: l[h], issues: [] }, u);
|
|
1209
|
+
w instanceof Promise ? f.push(w.then((L) => q(L, c, h, l, k))) : q(w, c, h, l, k);
|
|
1210
|
+
}
|
|
1211
|
+
return i ? He(f, l, c, u, r.value, e) : f.length ? Promise.all(f).then(() => c) : c;
|
|
1212
|
+
};
|
|
1213
|
+
}), or = /* @__PURE__ */ a("$ZodObjectJIT", (e, n) => {
|
|
1214
|
+
rr.init(e, n);
|
|
1215
|
+
const t = e._zod.parse, r = se(() => Xe(n)), o = (h) => {
|
|
1216
|
+
const m = new kt(["shape", "payload", "ctx"]), k = r.value, w = (I) => {
|
|
1217
|
+
const Z = de(I);
|
|
1218
|
+
return `shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`;
|
|
1219
|
+
};
|
|
1220
|
+
m.write("const input = payload.value;");
|
|
1221
|
+
const L = /* @__PURE__ */ Object.create(null);
|
|
1222
|
+
let fn = 0;
|
|
1223
|
+
for (const I of k.keys)
|
|
1224
|
+
L[I] = `key_${fn++}`;
|
|
1225
|
+
m.write("const newResult = {};");
|
|
1226
|
+
for (const I of k.keys) {
|
|
1227
|
+
const Z = L[I], E = de(I), dn = h[I]?._zod?.optout === "optional";
|
|
1228
|
+
m.write(`const ${Z} = ${w(I)};`), dn ? m.write(`
|
|
1229
|
+
if (${Z}.issues.length) {
|
|
1230
|
+
if (${E} in input) {
|
|
1231
|
+
payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
|
|
1232
|
+
...iss,
|
|
1233
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
1234
|
+
})));
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
if (${Z}.value === undefined) {
|
|
1239
|
+
if (${E} in input) {
|
|
1240
|
+
newResult[${E}] = undefined;
|
|
1241
|
+
}
|
|
1242
|
+
} else {
|
|
1243
|
+
newResult[${E}] = ${Z}.value;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
`) : m.write(`
|
|
1247
|
+
if (${Z}.issues.length) {
|
|
1248
|
+
payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
|
|
1249
|
+
...iss,
|
|
1250
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
1251
|
+
})));
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
if (${Z}.value === undefined) {
|
|
1255
|
+
if (${E} in input) {
|
|
1256
|
+
newResult[${E}] = undefined;
|
|
1257
|
+
}
|
|
1258
|
+
} else {
|
|
1259
|
+
newResult[${E}] = ${Z}.value;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
`);
|
|
1263
|
+
}
|
|
1264
|
+
m.write("payload.value = newResult;"), m.write("return payload;");
|
|
1265
|
+
const pn = m.compile();
|
|
1266
|
+
return (I, Z) => pn(h, I, Z);
|
|
1267
|
+
};
|
|
1268
|
+
let i;
|
|
1269
|
+
const s = Y, c = !De.jitless, l = c && _n.value, f = n.catchall;
|
|
1270
|
+
let d;
|
|
1271
|
+
e._zod.parse = (h, m) => {
|
|
1272
|
+
d ?? (d = r.value);
|
|
1273
|
+
const k = h.value;
|
|
1274
|
+
return s(k) ? c && l && m?.async === !1 && m.jitless !== !0 ? (i || (i = o(n.shape)), h = i(h, m), f ? He([], k, h, m, d, e) : h) : t(h, m) : (h.issues.push({
|
|
1275
|
+
expected: "object",
|
|
1276
|
+
code: "invalid_type",
|
|
1277
|
+
input: k,
|
|
1278
|
+
inst: e
|
|
1279
|
+
}), h);
|
|
1280
|
+
};
|
|
1281
|
+
});
|
|
1282
|
+
function _e(e, n, t, r) {
|
|
1283
|
+
for (const i of e)
|
|
1284
|
+
if (i.issues.length === 0)
|
|
1285
|
+
return n.value = i.value, n;
|
|
1286
|
+
const o = e.filter((i) => !D(i));
|
|
1287
|
+
return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
|
|
1288
|
+
code: "invalid_union",
|
|
1289
|
+
input: n.value,
|
|
1290
|
+
inst: t,
|
|
1291
|
+
errors: e.map((i) => i.issues.map((s) => P(s, r, T())))
|
|
1292
|
+
}), n);
|
|
1293
|
+
}
|
|
1294
|
+
const sr = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
1295
|
+
g.init(e, n), _(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), _(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), _(e._zod, "values", () => {
|
|
1296
|
+
if (n.options.every((o) => o._zod.values))
|
|
1297
|
+
return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1298
|
+
}), _(e._zod, "pattern", () => {
|
|
1299
|
+
if (n.options.every((o) => o._zod.pattern)) {
|
|
1300
|
+
const o = n.options.map((i) => i._zod.pattern);
|
|
1301
|
+
return new RegExp(`^(${o.map((i) => ce(i.source)).join("|")})$`);
|
|
1302
|
+
}
|
|
1303
|
+
});
|
|
1304
|
+
const t = n.options.length === 1, r = n.options[0]._zod.run;
|
|
1305
|
+
e._zod.parse = (o, i) => {
|
|
1306
|
+
if (t)
|
|
1307
|
+
return r(o, i);
|
|
1308
|
+
let s = !1;
|
|
1309
|
+
const c = [];
|
|
1310
|
+
for (const u of n.options) {
|
|
1311
|
+
const l = u._zod.run({
|
|
1312
|
+
value: o.value,
|
|
1313
|
+
issues: []
|
|
1314
|
+
}, i);
|
|
1315
|
+
if (l instanceof Promise)
|
|
1316
|
+
c.push(l), s = !0;
|
|
1317
|
+
else {
|
|
1318
|
+
if (l.issues.length === 0)
|
|
1319
|
+
return l;
|
|
1320
|
+
c.push(l);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
return s ? Promise.all(c).then((u) => _e(u, o, e, i)) : _e(c, o, e, i);
|
|
1324
|
+
};
|
|
1325
|
+
}), ir = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
|
|
1326
|
+
g.init(e, n), e._zod.parse = (t, r) => {
|
|
1327
|
+
const o = t.value, i = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
|
|
1328
|
+
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([u, l]) => ge(t, u, l)) : ge(t, i, s);
|
|
1329
|
+
};
|
|
1330
|
+
});
|
|
1331
|
+
function re(e, n) {
|
|
1332
|
+
if (e === n)
|
|
1333
|
+
return { valid: !0, data: e };
|
|
1334
|
+
if (e instanceof Date && n instanceof Date && +e == +n)
|
|
1335
|
+
return { valid: !0, data: e };
|
|
1336
|
+
if (U(e) && U(n)) {
|
|
1337
|
+
const t = Object.keys(n), r = Object.keys(e).filter((i) => t.indexOf(i) !== -1), o = { ...e, ...n };
|
|
1338
|
+
for (const i of r) {
|
|
1339
|
+
const s = re(e[i], n[i]);
|
|
1340
|
+
if (!s.valid)
|
|
1341
|
+
return {
|
|
1342
|
+
valid: !1,
|
|
1343
|
+
mergeErrorPath: [i, ...s.mergeErrorPath]
|
|
1344
|
+
};
|
|
1345
|
+
o[i] = s.data;
|
|
1346
|
+
}
|
|
1347
|
+
return { valid: !0, data: o };
|
|
1348
|
+
}
|
|
1349
|
+
if (Array.isArray(e) && Array.isArray(n)) {
|
|
1350
|
+
if (e.length !== n.length)
|
|
1351
|
+
return { valid: !1, mergeErrorPath: [] };
|
|
1352
|
+
const t = [];
|
|
1353
|
+
for (let r = 0; r < e.length; r++) {
|
|
1354
|
+
const o = e[r], i = n[r], s = re(o, i);
|
|
1355
|
+
if (!s.valid)
|
|
1356
|
+
return {
|
|
1357
|
+
valid: !1,
|
|
1358
|
+
mergeErrorPath: [r, ...s.mergeErrorPath]
|
|
1359
|
+
};
|
|
1360
|
+
t.push(s.data);
|
|
1361
|
+
}
|
|
1362
|
+
return { valid: !0, data: t };
|
|
1363
|
+
}
|
|
1364
|
+
return { valid: !1, mergeErrorPath: [] };
|
|
1365
|
+
}
|
|
1366
|
+
function ge(e, n, t) {
|
|
1367
|
+
const r = /* @__PURE__ */ new Map();
|
|
1368
|
+
let o;
|
|
1369
|
+
for (const c of n.issues)
|
|
1370
|
+
if (c.code === "unrecognized_keys") {
|
|
1371
|
+
o ?? (o = c);
|
|
1372
|
+
for (const u of c.keys)
|
|
1373
|
+
r.has(u) || r.set(u, {}), r.get(u).l = !0;
|
|
1374
|
+
} else
|
|
1375
|
+
e.issues.push(c);
|
|
1376
|
+
for (const c of t.issues)
|
|
1377
|
+
if (c.code === "unrecognized_keys")
|
|
1378
|
+
for (const u of c.keys)
|
|
1379
|
+
r.has(u) || r.set(u, {}), r.get(u).r = !0;
|
|
1380
|
+
else
|
|
1381
|
+
e.issues.push(c);
|
|
1382
|
+
const i = [...r].filter(([, c]) => c.l && c.r).map(([c]) => c);
|
|
1383
|
+
if (i.length && o && e.issues.push({ ...o, keys: i }), D(e))
|
|
1384
|
+
return e;
|
|
1385
|
+
const s = re(n.value, t.value);
|
|
1386
|
+
if (!s.valid)
|
|
1387
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
|
|
1388
|
+
return e.value = s.data, e;
|
|
1389
|
+
}
|
|
1390
|
+
const cr = /* @__PURE__ */ a("$ZodRecord", (e, n) => {
|
|
1391
|
+
g.init(e, n), e._zod.parse = (t, r) => {
|
|
1392
|
+
const o = t.value;
|
|
1393
|
+
if (!U(o))
|
|
1394
|
+
return t.issues.push({
|
|
1395
|
+
expected: "record",
|
|
1396
|
+
code: "invalid_type",
|
|
1397
|
+
input: o,
|
|
1398
|
+
inst: e
|
|
1399
|
+
}), t;
|
|
1400
|
+
const i = [], s = n.keyType._zod.values;
|
|
1401
|
+
if (s) {
|
|
1402
|
+
t.value = {};
|
|
1403
|
+
const c = /* @__PURE__ */ new Set();
|
|
1404
|
+
for (const l of s)
|
|
1405
|
+
if (typeof l == "string" || typeof l == "number" || typeof l == "symbol") {
|
|
1406
|
+
c.add(typeof l == "number" ? l.toString() : l);
|
|
1407
|
+
const f = n.valueType._zod.run({ value: o[l], issues: [] }, r);
|
|
1408
|
+
f instanceof Promise ? i.push(f.then((d) => {
|
|
1409
|
+
d.issues.length && t.issues.push(...R(l, d.issues)), t.value[l] = d.value;
|
|
1410
|
+
})) : (f.issues.length && t.issues.push(...R(l, f.issues)), t.value[l] = f.value);
|
|
1411
|
+
}
|
|
1412
|
+
let u;
|
|
1413
|
+
for (const l in o)
|
|
1414
|
+
c.has(l) || (u = u ?? [], u.push(l));
|
|
1415
|
+
u && u.length > 0 && t.issues.push({
|
|
1416
|
+
code: "unrecognized_keys",
|
|
1417
|
+
input: o,
|
|
1418
|
+
inst: e,
|
|
1419
|
+
keys: u
|
|
1420
|
+
});
|
|
1421
|
+
} else {
|
|
1422
|
+
t.value = {};
|
|
1423
|
+
for (const c of Reflect.ownKeys(o)) {
|
|
1424
|
+
if (c === "__proto__")
|
|
1425
|
+
continue;
|
|
1426
|
+
let u = n.keyType._zod.run({ value: c, issues: [] }, r);
|
|
1427
|
+
if (u instanceof Promise)
|
|
1428
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1429
|
+
if (typeof c == "string" && Be.test(c) && u.issues.length) {
|
|
1430
|
+
const d = n.keyType._zod.run({ value: Number(c), issues: [] }, r);
|
|
1431
|
+
if (d instanceof Promise)
|
|
1432
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1433
|
+
d.issues.length === 0 && (u = d);
|
|
1434
|
+
}
|
|
1435
|
+
if (u.issues.length) {
|
|
1436
|
+
n.mode === "loose" ? t.value[c] = o[c] : t.issues.push({
|
|
1437
|
+
code: "invalid_key",
|
|
1438
|
+
origin: "record",
|
|
1439
|
+
issues: u.issues.map((d) => P(d, r, T())),
|
|
1440
|
+
input: c,
|
|
1441
|
+
path: [c],
|
|
1442
|
+
inst: e
|
|
1443
|
+
});
|
|
1444
|
+
continue;
|
|
1445
|
+
}
|
|
1446
|
+
const f = n.valueType._zod.run({ value: o[c], issues: [] }, r);
|
|
1447
|
+
f instanceof Promise ? i.push(f.then((d) => {
|
|
1448
|
+
d.issues.length && t.issues.push(...R(c, d.issues)), t.value[u.value] = d.value;
|
|
1449
|
+
})) : (f.issues.length && t.issues.push(...R(c, f.issues)), t.value[u.value] = f.value);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
return i.length ? Promise.all(i).then(() => t) : t;
|
|
1453
|
+
};
|
|
1454
|
+
}), ur = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
1455
|
+
g.init(e, n);
|
|
1456
|
+
const t = Re(n.entries), r = new Set(t);
|
|
1457
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => gn.has(typeof o)).map((o) => typeof o == "string" ? x(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
|
|
1458
|
+
const s = o.value;
|
|
1459
|
+
return r.has(s) || o.issues.push({
|
|
1460
|
+
code: "invalid_value",
|
|
1461
|
+
values: t,
|
|
1462
|
+
input: s,
|
|
1463
|
+
inst: e
|
|
1464
|
+
}), o;
|
|
1465
|
+
};
|
|
1466
|
+
}), ar = /* @__PURE__ */ a("$ZodLiteral", (e, n) => {
|
|
1467
|
+
if (g.init(e, n), n.values.length === 0)
|
|
1468
|
+
throw new Error("Cannot create literal schema with no valid values");
|
|
1469
|
+
const t = new Set(n.values);
|
|
1470
|
+
e._zod.values = t, e._zod.pattern = new RegExp(`^(${n.values.map((r) => typeof r == "string" ? x(r) : r ? x(r.toString()) : String(r)).join("|")})$`), e._zod.parse = (r, o) => {
|
|
1471
|
+
const i = r.value;
|
|
1472
|
+
return t.has(i) || r.issues.push({
|
|
1473
|
+
code: "invalid_value",
|
|
1474
|
+
values: n.values,
|
|
1475
|
+
input: i,
|
|
1476
|
+
inst: e
|
|
1477
|
+
}), r;
|
|
1478
|
+
};
|
|
1479
|
+
}), lr = /* @__PURE__ */ a("$ZodTransform", (e, n) => {
|
|
1480
|
+
g.init(e, n), e._zod.parse = (t, r) => {
|
|
1481
|
+
if (r.direction === "backward")
|
|
1482
|
+
throw new Ae(e.constructor.name);
|
|
1483
|
+
const o = n.transform(t.value, t);
|
|
1484
|
+
if (r.async)
|
|
1485
|
+
return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
|
|
1486
|
+
if (o instanceof Promise)
|
|
1487
|
+
throw new C();
|
|
1488
|
+
return t.value = o, t;
|
|
1489
|
+
};
|
|
1490
|
+
});
|
|
1491
|
+
function ve(e, n) {
|
|
1492
|
+
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
1493
|
+
}
|
|
1494
|
+
const Qe = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
1495
|
+
g.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", _(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), _(e._zod, "pattern", () => {
|
|
1496
|
+
const t = n.innerType._zod.pattern;
|
|
1497
|
+
return t ? new RegExp(`^(${ce(t.source)})?$`) : void 0;
|
|
1498
|
+
}), e._zod.parse = (t, r) => {
|
|
1499
|
+
if (n.innerType._zod.optin === "optional") {
|
|
1500
|
+
const o = n.innerType._zod.run(t, r);
|
|
1501
|
+
return o instanceof Promise ? o.then((i) => ve(i, t.value)) : ve(o, t.value);
|
|
1502
|
+
}
|
|
1503
|
+
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
1504
|
+
};
|
|
1505
|
+
}), fr = /* @__PURE__ */ a("$ZodExactOptional", (e, n) => {
|
|
1506
|
+
Qe.init(e, n), _(e._zod, "values", () => n.innerType._zod.values), _(e._zod, "pattern", () => n.innerType._zod.pattern), e._zod.parse = (t, r) => n.innerType._zod.run(t, r);
|
|
1507
|
+
}), pr = /* @__PURE__ */ a("$ZodNullable", (e, n) => {
|
|
1508
|
+
g.init(e, n), _(e._zod, "optin", () => n.innerType._zod.optin), _(e._zod, "optout", () => n.innerType._zod.optout), _(e._zod, "pattern", () => {
|
|
1509
|
+
const t = n.innerType._zod.pattern;
|
|
1510
|
+
return t ? new RegExp(`^(${ce(t.source)}|null)$`) : void 0;
|
|
1511
|
+
}), _(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
|
|
1512
|
+
}), dr = /* @__PURE__ */ a("$ZodDefault", (e, n) => {
|
|
1513
|
+
g.init(e, n), e._zod.optin = "optional", _(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1514
|
+
if (r.direction === "backward")
|
|
1515
|
+
return n.innerType._zod.run(t, r);
|
|
1516
|
+
if (t.value === void 0)
|
|
1517
|
+
return t.value = n.defaultValue, t;
|
|
1518
|
+
const o = n.innerType._zod.run(t, r);
|
|
1519
|
+
return o instanceof Promise ? o.then((i) => ze(i, n)) : ze(o, n);
|
|
1520
|
+
};
|
|
1521
|
+
});
|
|
1522
|
+
function ze(e, n) {
|
|
1523
|
+
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
1524
|
+
}
|
|
1525
|
+
const hr = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
|
|
1526
|
+
g.init(e, n), e._zod.optin = "optional", _(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
|
|
1527
|
+
}), mr = /* @__PURE__ */ a("$ZodNonOptional", (e, n) => {
|
|
1528
|
+
g.init(e, n), _(e._zod, "values", () => {
|
|
1529
|
+
const t = n.innerType._zod.values;
|
|
1530
|
+
return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
|
|
1531
|
+
}), e._zod.parse = (t, r) => {
|
|
1532
|
+
const o = n.innerType._zod.run(t, r);
|
|
1533
|
+
return o instanceof Promise ? o.then((i) => ye(i, e)) : ye(o, e);
|
|
1534
|
+
};
|
|
1535
|
+
});
|
|
1536
|
+
function ye(e, n) {
|
|
1537
|
+
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1538
|
+
code: "invalid_type",
|
|
1539
|
+
expected: "nonoptional",
|
|
1540
|
+
input: e.value,
|
|
1541
|
+
inst: n
|
|
1542
|
+
}), e;
|
|
1543
|
+
}
|
|
1544
|
+
const _r = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
1545
|
+
g.init(e, n), _(e._zod, "optin", () => n.innerType._zod.optin), _(e._zod, "optout", () => n.innerType._zod.optout), _(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1546
|
+
if (r.direction === "backward")
|
|
1547
|
+
return n.innerType._zod.run(t, r);
|
|
1548
|
+
const o = n.innerType._zod.run(t, r);
|
|
1549
|
+
return o instanceof Promise ? o.then((i) => (t.value = i.value, i.issues.length && (t.value = n.catchValue({
|
|
1550
|
+
...t,
|
|
1551
|
+
error: {
|
|
1552
|
+
issues: i.issues.map((s) => P(s, r, T()))
|
|
1553
|
+
},
|
|
1554
|
+
input: t.value
|
|
1555
|
+
}), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
|
|
1556
|
+
...t,
|
|
1557
|
+
error: {
|
|
1558
|
+
issues: o.issues.map((i) => P(i, r, T()))
|
|
1559
|
+
},
|
|
1560
|
+
input: t.value
|
|
1561
|
+
}), t.issues = []), t);
|
|
1562
|
+
};
|
|
1563
|
+
}), gr = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
|
|
1564
|
+
g.init(e, n), _(e._zod, "values", () => n.in._zod.values), _(e._zod, "optin", () => n.in._zod.optin), _(e._zod, "optout", () => n.out._zod.optout), _(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
|
|
1565
|
+
if (r.direction === "backward") {
|
|
1566
|
+
const i = n.out._zod.run(t, r);
|
|
1567
|
+
return i instanceof Promise ? i.then((s) => B(s, n.in, r)) : B(i, n.in, r);
|
|
1568
|
+
}
|
|
1569
|
+
const o = n.in._zod.run(t, r);
|
|
1570
|
+
return o instanceof Promise ? o.then((i) => B(i, n.out, r)) : B(o, n.out, r);
|
|
1571
|
+
};
|
|
1572
|
+
});
|
|
1573
|
+
function B(e, n, t) {
|
|
1574
|
+
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1575
|
+
}
|
|
1576
|
+
const vr = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
1577
|
+
g.init(e, n), _(e._zod, "propValues", () => n.innerType._zod.propValues), _(e._zod, "values", () => n.innerType._zod.values), _(e._zod, "optin", () => n.innerType?._zod?.optin), _(e._zod, "optout", () => n.innerType?._zod?.optout), e._zod.parse = (t, r) => {
|
|
1578
|
+
if (r.direction === "backward")
|
|
1579
|
+
return n.innerType._zod.run(t, r);
|
|
1580
|
+
const o = n.innerType._zod.run(t, r);
|
|
1581
|
+
return o instanceof Promise ? o.then(be) : be(o);
|
|
1582
|
+
};
|
|
1583
|
+
});
|
|
1584
|
+
function be(e) {
|
|
1585
|
+
return e.value = Object.freeze(e.value), e;
|
|
1586
|
+
}
|
|
1587
|
+
const zr = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
|
|
1588
|
+
S.init(e, n), g.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
|
|
1589
|
+
const r = t.value, o = n.fn(r);
|
|
1590
|
+
if (o instanceof Promise)
|
|
1591
|
+
return o.then((i) => we(i, t, r, e));
|
|
1592
|
+
we(o, t, r, e);
|
|
1593
|
+
};
|
|
1594
|
+
});
|
|
1595
|
+
function we(e, n, t, r) {
|
|
1596
|
+
if (!e) {
|
|
1597
|
+
const o = {
|
|
1598
|
+
code: "custom",
|
|
1599
|
+
input: t,
|
|
1600
|
+
inst: r,
|
|
1601
|
+
// incorporates params.error into issue reporting
|
|
1602
|
+
path: [...r._zod.def.path ?? []],
|
|
1603
|
+
// incorporates params.error into issue reporting
|
|
1604
|
+
continue: !r._zod.def.abort
|
|
1605
|
+
// params: inst._zod.def.params,
|
|
1606
|
+
};
|
|
1607
|
+
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(M(o));
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
var ke;
|
|
1611
|
+
class yr {
|
|
1612
|
+
constructor() {
|
|
1613
|
+
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1614
|
+
}
|
|
1615
|
+
add(n, ...t) {
|
|
1616
|
+
const r = t[0];
|
|
1617
|
+
return this._map.set(n, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, n), this;
|
|
1618
|
+
}
|
|
1619
|
+
clear() {
|
|
1620
|
+
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1621
|
+
}
|
|
1622
|
+
remove(n) {
|
|
1623
|
+
const t = this._map.get(n);
|
|
1624
|
+
return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
|
|
1625
|
+
}
|
|
1626
|
+
get(n) {
|
|
1627
|
+
const t = n._zod.parent;
|
|
1628
|
+
if (t) {
|
|
1629
|
+
const r = { ...this.get(t) ?? {} };
|
|
1630
|
+
delete r.id;
|
|
1631
|
+
const o = { ...r, ...this._map.get(n) };
|
|
1632
|
+
return Object.keys(o).length ? o : void 0;
|
|
1633
|
+
}
|
|
1634
|
+
return this._map.get(n);
|
|
1635
|
+
}
|
|
1636
|
+
has(n) {
|
|
1637
|
+
return this._map.has(n);
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
function br() {
|
|
1641
|
+
return new yr();
|
|
1642
|
+
}
|
|
1643
|
+
(ke = globalThis).__zod_globalRegistry ?? (ke.__zod_globalRegistry = br());
|
|
1644
|
+
const J = globalThis.__zod_globalRegistry;
|
|
1645
|
+
// @__NO_SIDE_EFFECTS__
|
|
1646
|
+
function wr(e, n) {
|
|
1647
|
+
return new e({
|
|
1648
|
+
type: "string",
|
|
1649
|
+
...p(n)
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
// @__NO_SIDE_EFFECTS__
|
|
1653
|
+
function kr(e, n) {
|
|
1654
|
+
return new e({
|
|
1655
|
+
type: "string",
|
|
1656
|
+
format: "email",
|
|
1657
|
+
check: "string_format",
|
|
1658
|
+
abort: !1,
|
|
1659
|
+
...p(n)
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
// @__NO_SIDE_EFFECTS__
|
|
1663
|
+
function $e(e, n) {
|
|
1664
|
+
return new e({
|
|
1665
|
+
type: "string",
|
|
1666
|
+
format: "guid",
|
|
1667
|
+
check: "string_format",
|
|
1668
|
+
abort: !1,
|
|
1669
|
+
...p(n)
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1672
|
+
// @__NO_SIDE_EFFECTS__
|
|
1673
|
+
function $r(e, n) {
|
|
1674
|
+
return new e({
|
|
1675
|
+
type: "string",
|
|
1676
|
+
format: "uuid",
|
|
1677
|
+
check: "string_format",
|
|
1678
|
+
abort: !1,
|
|
1679
|
+
...p(n)
|
|
1680
|
+
});
|
|
1681
|
+
}
|
|
1682
|
+
// @__NO_SIDE_EFFECTS__
|
|
1683
|
+
function Zr(e, n) {
|
|
1684
|
+
return new e({
|
|
1685
|
+
type: "string",
|
|
1686
|
+
format: "uuid",
|
|
1687
|
+
check: "string_format",
|
|
1688
|
+
abort: !1,
|
|
1689
|
+
version: "v4",
|
|
1690
|
+
...p(n)
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
// @__NO_SIDE_EFFECTS__
|
|
1694
|
+
function Sr(e, n) {
|
|
1695
|
+
return new e({
|
|
1696
|
+
type: "string",
|
|
1697
|
+
format: "uuid",
|
|
1698
|
+
check: "string_format",
|
|
1699
|
+
abort: !1,
|
|
1700
|
+
version: "v6",
|
|
1701
|
+
...p(n)
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
// @__NO_SIDE_EFFECTS__
|
|
1705
|
+
function Or(e, n) {
|
|
1706
|
+
return new e({
|
|
1707
|
+
type: "string",
|
|
1708
|
+
format: "uuid",
|
|
1709
|
+
check: "string_format",
|
|
1710
|
+
abort: !1,
|
|
1711
|
+
version: "v7",
|
|
1712
|
+
...p(n)
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
// @__NO_SIDE_EFFECTS__
|
|
1716
|
+
function Er(e, n) {
|
|
1717
|
+
return new e({
|
|
1718
|
+
type: "string",
|
|
1719
|
+
format: "url",
|
|
1720
|
+
check: "string_format",
|
|
1721
|
+
abort: !1,
|
|
1722
|
+
...p(n)
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
// @__NO_SIDE_EFFECTS__
|
|
1726
|
+
function Ir(e, n) {
|
|
1727
|
+
return new e({
|
|
1728
|
+
type: "string",
|
|
1729
|
+
format: "emoji",
|
|
1730
|
+
check: "string_format",
|
|
1731
|
+
abort: !1,
|
|
1732
|
+
...p(n)
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1735
|
+
// @__NO_SIDE_EFFECTS__
|
|
1736
|
+
function Tr(e, n) {
|
|
1737
|
+
return new e({
|
|
1738
|
+
type: "string",
|
|
1739
|
+
format: "nanoid",
|
|
1740
|
+
check: "string_format",
|
|
1741
|
+
abort: !1,
|
|
1742
|
+
...p(n)
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
// @__NO_SIDE_EFFECTS__
|
|
1746
|
+
function Pr(e, n) {
|
|
1747
|
+
return new e({
|
|
1748
|
+
type: "string",
|
|
1749
|
+
format: "cuid",
|
|
1750
|
+
check: "string_format",
|
|
1751
|
+
abort: !1,
|
|
1752
|
+
...p(n)
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
// @__NO_SIDE_EFFECTS__
|
|
1756
|
+
function Nr(e, n) {
|
|
1757
|
+
return new e({
|
|
1758
|
+
type: "string",
|
|
1759
|
+
format: "cuid2",
|
|
1760
|
+
check: "string_format",
|
|
1761
|
+
abort: !1,
|
|
1762
|
+
...p(n)
|
|
1763
|
+
});
|
|
1764
|
+
}
|
|
1765
|
+
// @__NO_SIDE_EFFECTS__
|
|
1766
|
+
function jr(e, n) {
|
|
1767
|
+
return new e({
|
|
1768
|
+
type: "string",
|
|
1769
|
+
format: "ulid",
|
|
1770
|
+
check: "string_format",
|
|
1771
|
+
abort: !1,
|
|
1772
|
+
...p(n)
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
// @__NO_SIDE_EFFECTS__
|
|
1776
|
+
function Ar(e, n) {
|
|
1777
|
+
return new e({
|
|
1778
|
+
type: "string",
|
|
1779
|
+
format: "xid",
|
|
1780
|
+
check: "string_format",
|
|
1781
|
+
abort: !1,
|
|
1782
|
+
...p(n)
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
// @__NO_SIDE_EFFECTS__
|
|
1786
|
+
function Dr(e, n) {
|
|
1787
|
+
return new e({
|
|
1788
|
+
type: "string",
|
|
1789
|
+
format: "ksuid",
|
|
1790
|
+
check: "string_format",
|
|
1791
|
+
abort: !1,
|
|
1792
|
+
...p(n)
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
// @__NO_SIDE_EFFECTS__
|
|
1796
|
+
function Rr(e, n) {
|
|
1797
|
+
return new e({
|
|
1798
|
+
type: "string",
|
|
1799
|
+
format: "ipv4",
|
|
1800
|
+
check: "string_format",
|
|
1801
|
+
abort: !1,
|
|
1802
|
+
...p(n)
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
// @__NO_SIDE_EFFECTS__
|
|
1806
|
+
function Cr(e, n) {
|
|
1807
|
+
return new e({
|
|
1808
|
+
type: "string",
|
|
1809
|
+
format: "ipv6",
|
|
1810
|
+
check: "string_format",
|
|
1811
|
+
abort: !1,
|
|
1812
|
+
...p(n)
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
// @__NO_SIDE_EFFECTS__
|
|
1816
|
+
function Ur(e, n) {
|
|
1817
|
+
return new e({
|
|
1818
|
+
type: "string",
|
|
1819
|
+
format: "cidrv4",
|
|
1820
|
+
check: "string_format",
|
|
1821
|
+
abort: !1,
|
|
1822
|
+
...p(n)
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
// @__NO_SIDE_EFFECTS__
|
|
1826
|
+
function xr(e, n) {
|
|
1827
|
+
return new e({
|
|
1828
|
+
type: "string",
|
|
1829
|
+
format: "cidrv6",
|
|
1830
|
+
check: "string_format",
|
|
1831
|
+
abort: !1,
|
|
1832
|
+
...p(n)
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
// @__NO_SIDE_EFFECTS__
|
|
1836
|
+
function Fr(e, n) {
|
|
1837
|
+
return new e({
|
|
1838
|
+
type: "string",
|
|
1839
|
+
format: "base64",
|
|
1840
|
+
check: "string_format",
|
|
1841
|
+
abort: !1,
|
|
1842
|
+
...p(n)
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
// @__NO_SIDE_EFFECTS__
|
|
1846
|
+
function Jr(e, n) {
|
|
1847
|
+
return new e({
|
|
1848
|
+
type: "string",
|
|
1849
|
+
format: "base64url",
|
|
1850
|
+
check: "string_format",
|
|
1851
|
+
abort: !1,
|
|
1852
|
+
...p(n)
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
// @__NO_SIDE_EFFECTS__
|
|
1856
|
+
function Mr(e, n) {
|
|
1857
|
+
return new e({
|
|
1858
|
+
type: "string",
|
|
1859
|
+
format: "e164",
|
|
1860
|
+
check: "string_format",
|
|
1861
|
+
abort: !1,
|
|
1862
|
+
...p(n)
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
// @__NO_SIDE_EFFECTS__
|
|
1866
|
+
function Lr(e, n) {
|
|
1867
|
+
return new e({
|
|
1868
|
+
type: "string",
|
|
1869
|
+
format: "jwt",
|
|
1870
|
+
check: "string_format",
|
|
1871
|
+
abort: !1,
|
|
1872
|
+
...p(n)
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
// @__NO_SIDE_EFFECTS__
|
|
1876
|
+
function Vr(e, n) {
|
|
1877
|
+
return new e({
|
|
1878
|
+
type: "string",
|
|
1879
|
+
format: "datetime",
|
|
1880
|
+
check: "string_format",
|
|
1881
|
+
offset: !1,
|
|
1882
|
+
local: !1,
|
|
1883
|
+
precision: null,
|
|
1884
|
+
...p(n)
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
// @__NO_SIDE_EFFECTS__
|
|
1888
|
+
function Br(e, n) {
|
|
1889
|
+
return new e({
|
|
1890
|
+
type: "string",
|
|
1891
|
+
format: "date",
|
|
1892
|
+
check: "string_format",
|
|
1893
|
+
...p(n)
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
// @__NO_SIDE_EFFECTS__
|
|
1897
|
+
function Wr(e, n) {
|
|
1898
|
+
return new e({
|
|
1899
|
+
type: "string",
|
|
1900
|
+
format: "time",
|
|
1901
|
+
check: "string_format",
|
|
1902
|
+
precision: null,
|
|
1903
|
+
...p(n)
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
// @__NO_SIDE_EFFECTS__
|
|
1907
|
+
function Kr(e, n) {
|
|
1908
|
+
return new e({
|
|
1909
|
+
type: "string",
|
|
1910
|
+
format: "duration",
|
|
1911
|
+
check: "string_format",
|
|
1912
|
+
...p(n)
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
// @__NO_SIDE_EFFECTS__
|
|
1916
|
+
function Gr(e, n) {
|
|
1917
|
+
return new e({
|
|
1918
|
+
type: "number",
|
|
1919
|
+
checks: [],
|
|
1920
|
+
...p(n)
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
// @__NO_SIDE_EFFECTS__
|
|
1924
|
+
function Yr(e, n) {
|
|
1925
|
+
return new e({
|
|
1926
|
+
type: "number",
|
|
1927
|
+
check: "number_format",
|
|
1928
|
+
abort: !1,
|
|
1929
|
+
format: "safeint",
|
|
1930
|
+
...p(n)
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
// @__NO_SIDE_EFFECTS__
|
|
1934
|
+
function qr(e, n) {
|
|
1935
|
+
return new e({
|
|
1936
|
+
type: "boolean",
|
|
1937
|
+
...p(n)
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
// @__NO_SIDE_EFFECTS__
|
|
1941
|
+
function Xr(e, n) {
|
|
1942
|
+
return new e({
|
|
1943
|
+
type: "undefined",
|
|
1944
|
+
...p(n)
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
// @__NO_SIDE_EFFECTS__
|
|
1948
|
+
function Hr(e) {
|
|
1949
|
+
return new e({
|
|
1950
|
+
type: "unknown"
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
// @__NO_SIDE_EFFECTS__
|
|
1954
|
+
function Qr(e, n) {
|
|
1955
|
+
return new e({
|
|
1956
|
+
type: "never",
|
|
1957
|
+
...p(n)
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
// @__NO_SIDE_EFFECTS__
|
|
1961
|
+
function eo(e, n) {
|
|
1962
|
+
return new e({
|
|
1963
|
+
type: "date",
|
|
1964
|
+
...p(n)
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
// @__NO_SIDE_EFFECTS__
|
|
1968
|
+
function Ze(e, n) {
|
|
1969
|
+
return new Ke({
|
|
1970
|
+
check: "less_than",
|
|
1971
|
+
...p(n),
|
|
1972
|
+
value: e,
|
|
1973
|
+
inclusive: !1
|
|
1974
|
+
});
|
|
1975
|
+
}
|
|
1976
|
+
// @__NO_SIDE_EFFECTS__
|
|
1977
|
+
function K(e, n) {
|
|
1978
|
+
return new Ke({
|
|
1979
|
+
check: "less_than",
|
|
1980
|
+
...p(n),
|
|
1981
|
+
value: e,
|
|
1982
|
+
inclusive: !0
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
// @__NO_SIDE_EFFECTS__
|
|
1986
|
+
function Se(e, n) {
|
|
1987
|
+
return new Ge({
|
|
1988
|
+
check: "greater_than",
|
|
1989
|
+
...p(n),
|
|
1990
|
+
value: e,
|
|
1991
|
+
inclusive: !1
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1994
|
+
// @__NO_SIDE_EFFECTS__
|
|
1995
|
+
function G(e, n) {
|
|
1996
|
+
return new Ge({
|
|
1997
|
+
check: "greater_than",
|
|
1998
|
+
...p(n),
|
|
1999
|
+
value: e,
|
|
2000
|
+
inclusive: !0
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
// @__NO_SIDE_EFFECTS__
|
|
2004
|
+
function Oe(e, n) {
|
|
2005
|
+
return new ft({
|
|
2006
|
+
check: "multiple_of",
|
|
2007
|
+
...p(n),
|
|
2008
|
+
value: e
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
// @__NO_SIDE_EFFECTS__
|
|
2012
|
+
function en(e, n) {
|
|
2013
|
+
return new dt({
|
|
2014
|
+
check: "max_length",
|
|
2015
|
+
...p(n),
|
|
2016
|
+
maximum: e
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
// @__NO_SIDE_EFFECTS__
|
|
2020
|
+
function X(e, n) {
|
|
2021
|
+
return new ht({
|
|
2022
|
+
check: "min_length",
|
|
2023
|
+
...p(n),
|
|
2024
|
+
minimum: e
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
// @__NO_SIDE_EFFECTS__
|
|
2028
|
+
function nn(e, n) {
|
|
2029
|
+
return new mt({
|
|
2030
|
+
check: "length_equals",
|
|
2031
|
+
...p(n),
|
|
2032
|
+
length: e
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2035
|
+
// @__NO_SIDE_EFFECTS__
|
|
2036
|
+
function no(e, n) {
|
|
2037
|
+
return new _t({
|
|
2038
|
+
check: "string_format",
|
|
2039
|
+
format: "regex",
|
|
2040
|
+
...p(n),
|
|
2041
|
+
pattern: e
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
// @__NO_SIDE_EFFECTS__
|
|
2045
|
+
function to(e) {
|
|
2046
|
+
return new gt({
|
|
2047
|
+
check: "string_format",
|
|
2048
|
+
format: "lowercase",
|
|
2049
|
+
...p(e)
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
// @__NO_SIDE_EFFECTS__
|
|
2053
|
+
function ro(e) {
|
|
2054
|
+
return new vt({
|
|
2055
|
+
check: "string_format",
|
|
2056
|
+
format: "uppercase",
|
|
2057
|
+
...p(e)
|
|
2058
|
+
});
|
|
2059
|
+
}
|
|
2060
|
+
// @__NO_SIDE_EFFECTS__
|
|
2061
|
+
function oo(e, n) {
|
|
2062
|
+
return new zt({
|
|
2063
|
+
check: "string_format",
|
|
2064
|
+
format: "includes",
|
|
2065
|
+
...p(n),
|
|
2066
|
+
includes: e
|
|
2067
|
+
});
|
|
2068
|
+
}
|
|
2069
|
+
// @__NO_SIDE_EFFECTS__
|
|
2070
|
+
function so(e, n) {
|
|
2071
|
+
return new yt({
|
|
2072
|
+
check: "string_format",
|
|
2073
|
+
format: "starts_with",
|
|
2074
|
+
...p(n),
|
|
2075
|
+
prefix: e
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
// @__NO_SIDE_EFFECTS__
|
|
2079
|
+
function io(e, n) {
|
|
2080
|
+
return new bt({
|
|
2081
|
+
check: "string_format",
|
|
2082
|
+
format: "ends_with",
|
|
2083
|
+
...p(n),
|
|
2084
|
+
suffix: e
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
// @__NO_SIDE_EFFECTS__
|
|
2088
|
+
function F(e) {
|
|
2089
|
+
return new wt({
|
|
2090
|
+
check: "overwrite",
|
|
2091
|
+
tx: e
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
// @__NO_SIDE_EFFECTS__
|
|
2095
|
+
function co(e) {
|
|
2096
|
+
return /* @__PURE__ */ F((n) => n.normalize(e));
|
|
2097
|
+
}
|
|
2098
|
+
// @__NO_SIDE_EFFECTS__
|
|
2099
|
+
function uo() {
|
|
2100
|
+
return /* @__PURE__ */ F((e) => e.trim());
|
|
2101
|
+
}
|
|
2102
|
+
// @__NO_SIDE_EFFECTS__
|
|
2103
|
+
function ao() {
|
|
2104
|
+
return /* @__PURE__ */ F((e) => e.toLowerCase());
|
|
2105
|
+
}
|
|
2106
|
+
// @__NO_SIDE_EFFECTS__
|
|
2107
|
+
function lo() {
|
|
2108
|
+
return /* @__PURE__ */ F((e) => e.toUpperCase());
|
|
2109
|
+
}
|
|
2110
|
+
// @__NO_SIDE_EFFECTS__
|
|
2111
|
+
function fo() {
|
|
2112
|
+
return /* @__PURE__ */ F((e) => mn(e));
|
|
2113
|
+
}
|
|
2114
|
+
// @__NO_SIDE_EFFECTS__
|
|
2115
|
+
function po(e, n, t) {
|
|
2116
|
+
return new e({
|
|
2117
|
+
type: "array",
|
|
2118
|
+
element: n,
|
|
2119
|
+
// get element() {
|
|
2120
|
+
// return element;
|
|
2121
|
+
// },
|
|
2122
|
+
...p(t)
|
|
2123
|
+
});
|
|
2124
|
+
}
|
|
2125
|
+
// @__NO_SIDE_EFFECTS__
|
|
2126
|
+
function ho(e, n, t) {
|
|
2127
|
+
return new e({
|
|
2128
|
+
type: "custom",
|
|
2129
|
+
check: "custom",
|
|
2130
|
+
fn: n,
|
|
2131
|
+
...p(t)
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
// @__NO_SIDE_EFFECTS__
|
|
2135
|
+
function mo(e) {
|
|
2136
|
+
const n = /* @__PURE__ */ _o((t) => (t.addIssue = (r) => {
|
|
2137
|
+
if (typeof r == "string")
|
|
2138
|
+
t.issues.push(M(r, t.value, n._zod.def));
|
|
2139
|
+
else {
|
|
2140
|
+
const o = r;
|
|
2141
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(M(o));
|
|
2142
|
+
}
|
|
2143
|
+
}, e(t.value, t)));
|
|
2144
|
+
return n;
|
|
2145
|
+
}
|
|
2146
|
+
// @__NO_SIDE_EFFECTS__
|
|
2147
|
+
function _o(e, n) {
|
|
2148
|
+
const t = new S({
|
|
2149
|
+
check: "custom",
|
|
2150
|
+
...p(n)
|
|
2151
|
+
});
|
|
2152
|
+
return t._zod.check = e, t;
|
|
2153
|
+
}
|
|
2154
|
+
function tn(e) {
|
|
2155
|
+
let n = e?.target ?? "draft-2020-12";
|
|
2156
|
+
return n === "draft-4" && (n = "draft-04"), n === "draft-7" && (n = "draft-07"), {
|
|
2157
|
+
processors: e.processors ?? {},
|
|
2158
|
+
metadataRegistry: e?.metadata ?? J,
|
|
2159
|
+
target: n,
|
|
2160
|
+
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2161
|
+
override: e?.override ?? (() => {
|
|
2162
|
+
}),
|
|
2163
|
+
io: e?.io ?? "output",
|
|
2164
|
+
counter: 0,
|
|
2165
|
+
seen: /* @__PURE__ */ new Map(),
|
|
2166
|
+
cycles: e?.cycles ?? "ref",
|
|
2167
|
+
reused: e?.reused ?? "inline",
|
|
2168
|
+
external: e?.external ?? void 0
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
function b(e, n, t = { path: [], schemaPath: [] }) {
|
|
2172
|
+
var r;
|
|
2173
|
+
const o = e._zod.def, i = n.seen.get(e);
|
|
2174
|
+
if (i)
|
|
2175
|
+
return i.count++, t.schemaPath.includes(e) && (i.cycle = t.path), i.schema;
|
|
2176
|
+
const s = { schema: {}, count: 1, cycle: void 0, path: t.path };
|
|
2177
|
+
n.seen.set(e, s);
|
|
2178
|
+
const c = e._zod.toJSONSchema?.();
|
|
2179
|
+
if (c)
|
|
2180
|
+
s.schema = c;
|
|
2181
|
+
else {
|
|
2182
|
+
const f = {
|
|
2183
|
+
...t,
|
|
2184
|
+
schemaPath: [...t.schemaPath, e],
|
|
2185
|
+
path: t.path
|
|
2186
|
+
};
|
|
2187
|
+
if (e._zod.processJSONSchema)
|
|
2188
|
+
e._zod.processJSONSchema(n, s.schema, f);
|
|
2189
|
+
else {
|
|
2190
|
+
const h = s.schema, m = n.processors[o.type];
|
|
2191
|
+
if (!m)
|
|
2192
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
2193
|
+
m(e, n, h, f);
|
|
2194
|
+
}
|
|
2195
|
+
const d = e._zod.parent;
|
|
2196
|
+
d && (s.ref || (s.ref = d), b(d, n, f), n.seen.get(d).isParent = !0);
|
|
2197
|
+
}
|
|
2198
|
+
const u = n.metadataRegistry.get(e);
|
|
2199
|
+
return u && Object.assign(s.schema, u), n.io === "input" && $(e) && (delete s.schema.examples, delete s.schema.default), n.io === "input" && s.schema._prefault && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, n.seen.get(e).schema;
|
|
2200
|
+
}
|
|
2201
|
+
function rn(e, n) {
|
|
2202
|
+
const t = e.seen.get(n);
|
|
2203
|
+
if (!t)
|
|
2204
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2205
|
+
const r = /* @__PURE__ */ new Map();
|
|
2206
|
+
for (const s of e.seen.entries()) {
|
|
2207
|
+
const c = e.metadataRegistry.get(s[0])?.id;
|
|
2208
|
+
if (c) {
|
|
2209
|
+
const u = r.get(c);
|
|
2210
|
+
if (u && u !== s[0])
|
|
2211
|
+
throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2212
|
+
r.set(c, s[0]);
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
const o = (s) => {
|
|
2216
|
+
const c = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2217
|
+
if (e.external) {
|
|
2218
|
+
const d = e.external.registry.get(s[0])?.id, h = e.external.uri ?? ((k) => k);
|
|
2219
|
+
if (d)
|
|
2220
|
+
return { ref: h(d) };
|
|
2221
|
+
const m = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
|
|
2222
|
+
return s[1].defId = m, { defId: m, ref: `${h("__shared")}#/${c}/${m}` };
|
|
2223
|
+
}
|
|
2224
|
+
if (s[1] === t)
|
|
2225
|
+
return { ref: "#" };
|
|
2226
|
+
const l = `#/${c}/`, f = s[1].schema.id ?? `__schema${e.counter++}`;
|
|
2227
|
+
return { defId: f, ref: l + f };
|
|
2228
|
+
}, i = (s) => {
|
|
2229
|
+
if (s[1].schema.$ref)
|
|
2230
|
+
return;
|
|
2231
|
+
const c = s[1], { ref: u, defId: l } = o(s);
|
|
2232
|
+
c.def = { ...c.schema }, l && (c.defId = l);
|
|
2233
|
+
const f = c.schema;
|
|
2234
|
+
for (const d in f)
|
|
2235
|
+
delete f[d];
|
|
2236
|
+
f.$ref = u;
|
|
2237
|
+
};
|
|
2238
|
+
if (e.cycles === "throw")
|
|
2239
|
+
for (const s of e.seen.entries()) {
|
|
2240
|
+
const c = s[1];
|
|
2241
|
+
if (c.cycle)
|
|
2242
|
+
throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
2243
|
+
|
|
2244
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
2245
|
+
}
|
|
2246
|
+
for (const s of e.seen.entries()) {
|
|
2247
|
+
const c = s[1];
|
|
2248
|
+
if (n === s[0]) {
|
|
2249
|
+
i(s);
|
|
2250
|
+
continue;
|
|
2251
|
+
}
|
|
2252
|
+
if (e.external) {
|
|
2253
|
+
const l = e.external.registry.get(s[0])?.id;
|
|
2254
|
+
if (n !== s[0] && l) {
|
|
2255
|
+
i(s);
|
|
2256
|
+
continue;
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
if (e.metadataRegistry.get(s[0])?.id) {
|
|
2260
|
+
i(s);
|
|
2261
|
+
continue;
|
|
2262
|
+
}
|
|
2263
|
+
if (c.cycle) {
|
|
2264
|
+
i(s);
|
|
2265
|
+
continue;
|
|
2266
|
+
}
|
|
2267
|
+
if (c.count > 1 && e.reused === "ref") {
|
|
2268
|
+
i(s);
|
|
2269
|
+
continue;
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
function on(e, n) {
|
|
2274
|
+
const t = e.seen.get(n);
|
|
2275
|
+
if (!t)
|
|
2276
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2277
|
+
const r = (s) => {
|
|
2278
|
+
const c = e.seen.get(s);
|
|
2279
|
+
if (c.ref === null)
|
|
2280
|
+
return;
|
|
2281
|
+
const u = c.def ?? c.schema, l = { ...u }, f = c.ref;
|
|
2282
|
+
if (c.ref = null, f) {
|
|
2283
|
+
r(f);
|
|
2284
|
+
const h = e.seen.get(f), m = h.schema;
|
|
2285
|
+
if (m.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (u.allOf = u.allOf ?? [], u.allOf.push(m)) : Object.assign(u, m), Object.assign(u, l), s._zod.parent === f)
|
|
2286
|
+
for (const w in u)
|
|
2287
|
+
w === "$ref" || w === "allOf" || w in l || delete u[w];
|
|
2288
|
+
if (m.$ref && h.def)
|
|
2289
|
+
for (const w in u)
|
|
2290
|
+
w === "$ref" || w === "allOf" || w in h.def && JSON.stringify(u[w]) === JSON.stringify(h.def[w]) && delete u[w];
|
|
2291
|
+
}
|
|
2292
|
+
const d = s._zod.parent;
|
|
2293
|
+
if (d && d !== f) {
|
|
2294
|
+
r(d);
|
|
2295
|
+
const h = e.seen.get(d);
|
|
2296
|
+
if (h?.schema.$ref && (u.$ref = h.schema.$ref, h.def))
|
|
2297
|
+
for (const m in u)
|
|
2298
|
+
m === "$ref" || m === "allOf" || m in h.def && JSON.stringify(u[m]) === JSON.stringify(h.def[m]) && delete u[m];
|
|
2299
|
+
}
|
|
2300
|
+
e.override({
|
|
2301
|
+
zodSchema: s,
|
|
2302
|
+
jsonSchema: u,
|
|
2303
|
+
path: c.path ?? []
|
|
2304
|
+
});
|
|
2305
|
+
};
|
|
2306
|
+
for (const s of [...e.seen.entries()].reverse())
|
|
2307
|
+
r(s[0]);
|
|
2308
|
+
const o = {};
|
|
2309
|
+
if (e.target === "draft-2020-12" ? o.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? o.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? o.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
|
|
2310
|
+
const s = e.external.registry.get(n)?.id;
|
|
2311
|
+
if (!s)
|
|
2312
|
+
throw new Error("Schema is missing an `id` property");
|
|
2313
|
+
o.$id = e.external.uri(s);
|
|
2314
|
+
}
|
|
2315
|
+
Object.assign(o, t.def ?? t.schema);
|
|
2316
|
+
const i = e.external?.defs ?? {};
|
|
2317
|
+
for (const s of e.seen.entries()) {
|
|
2318
|
+
const c = s[1];
|
|
2319
|
+
c.def && c.defId && (i[c.defId] = c.def);
|
|
2320
|
+
}
|
|
2321
|
+
e.external || Object.keys(i).length > 0 && (e.target === "draft-2020-12" ? o.$defs = i : o.definitions = i);
|
|
2322
|
+
try {
|
|
2323
|
+
const s = JSON.parse(JSON.stringify(o));
|
|
2324
|
+
return Object.defineProperty(s, "~standard", {
|
|
2325
|
+
value: {
|
|
2326
|
+
...n["~standard"],
|
|
2327
|
+
jsonSchema: {
|
|
2328
|
+
input: H(n, "input", e.processors),
|
|
2329
|
+
output: H(n, "output", e.processors)
|
|
2330
|
+
}
|
|
2331
|
+
},
|
|
2332
|
+
enumerable: !1,
|
|
2333
|
+
writable: !1
|
|
2334
|
+
}), s;
|
|
2335
|
+
} catch {
|
|
2336
|
+
throw new Error("Error converting schema to JSON.");
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
function $(e, n) {
|
|
2340
|
+
const t = n ?? { seen: /* @__PURE__ */ new Set() };
|
|
2341
|
+
if (t.seen.has(e))
|
|
2342
|
+
return !1;
|
|
2343
|
+
t.seen.add(e);
|
|
2344
|
+
const r = e._zod.def;
|
|
2345
|
+
if (r.type === "transform")
|
|
2346
|
+
return !0;
|
|
2347
|
+
if (r.type === "array")
|
|
2348
|
+
return $(r.element, t);
|
|
2349
|
+
if (r.type === "set")
|
|
2350
|
+
return $(r.valueType, t);
|
|
2351
|
+
if (r.type === "lazy")
|
|
2352
|
+
return $(r.getter(), t);
|
|
2353
|
+
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
2354
|
+
return $(r.innerType, t);
|
|
2355
|
+
if (r.type === "intersection")
|
|
2356
|
+
return $(r.left, t) || $(r.right, t);
|
|
2357
|
+
if (r.type === "record" || r.type === "map")
|
|
2358
|
+
return $(r.keyType, t) || $(r.valueType, t);
|
|
2359
|
+
if (r.type === "pipe")
|
|
2360
|
+
return $(r.in, t) || $(r.out, t);
|
|
2361
|
+
if (r.type === "object") {
|
|
2362
|
+
for (const o in r.shape)
|
|
2363
|
+
if ($(r.shape[o], t))
|
|
2364
|
+
return !0;
|
|
2365
|
+
return !1;
|
|
2366
|
+
}
|
|
2367
|
+
if (r.type === "union") {
|
|
2368
|
+
for (const o of r.options)
|
|
2369
|
+
if ($(o, t))
|
|
2370
|
+
return !0;
|
|
2371
|
+
return !1;
|
|
2372
|
+
}
|
|
2373
|
+
if (r.type === "tuple") {
|
|
2374
|
+
for (const o of r.items)
|
|
2375
|
+
if ($(o, t))
|
|
2376
|
+
return !0;
|
|
2377
|
+
return !!(r.rest && $(r.rest, t));
|
|
2378
|
+
}
|
|
2379
|
+
return !1;
|
|
2380
|
+
}
|
|
2381
|
+
const go = (e, n = {}) => (t) => {
|
|
2382
|
+
const r = tn({ ...t, processors: n });
|
|
2383
|
+
return b(e, r), rn(r, e), on(r, e);
|
|
2384
|
+
}, H = (e, n, t = {}) => (r) => {
|
|
2385
|
+
const { libraryOptions: o, target: i } = r ?? {}, s = tn({ ...o ?? {}, target: i, io: n, processors: t });
|
|
2386
|
+
return b(e, s), rn(s, e), on(s, e);
|
|
2387
|
+
}, vo = {
|
|
2388
|
+
guid: "uuid",
|
|
2389
|
+
url: "uri",
|
|
2390
|
+
datetime: "date-time",
|
|
2391
|
+
json_string: "json-string",
|
|
2392
|
+
regex: ""
|
|
2393
|
+
// do not set
|
|
2394
|
+
}, zo = (e, n, t, r) => {
|
|
2395
|
+
const o = t;
|
|
2396
|
+
o.type = "string";
|
|
2397
|
+
const { minimum: i, maximum: s, format: c, patterns: u, contentEncoding: l } = e._zod.bag;
|
|
2398
|
+
if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), c && (o.format = vo[c] ?? c, o.format === "" && delete o.format, c === "time" && delete o.format), l && (o.contentEncoding = l), u && u.size > 0) {
|
|
2399
|
+
const f = [...u];
|
|
2400
|
+
f.length === 1 ? o.pattern = f[0].source : f.length > 1 && (o.allOf = [
|
|
2401
|
+
...f.map((d) => ({
|
|
2402
|
+
...n.target === "draft-07" || n.target === "draft-04" || n.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2403
|
+
pattern: d.source
|
|
2404
|
+
}))
|
|
2405
|
+
]);
|
|
2406
|
+
}
|
|
2407
|
+
}, yo = (e, n, t, r) => {
|
|
2408
|
+
const o = t, { minimum: i, maximum: s, format: c, multipleOf: u, exclusiveMaximum: l, exclusiveMinimum: f } = e._zod.bag;
|
|
2409
|
+
typeof c == "string" && c.includes("int") ? o.type = "integer" : o.type = "number", typeof f == "number" && (n.target === "draft-04" || n.target === "openapi-3.0" ? (o.minimum = f, o.exclusiveMinimum = !0) : o.exclusiveMinimum = f), typeof i == "number" && (o.minimum = i, typeof f == "number" && n.target !== "draft-04" && (f >= i ? delete o.minimum : delete o.exclusiveMinimum)), typeof l == "number" && (n.target === "draft-04" || n.target === "openapi-3.0" ? (o.maximum = l, o.exclusiveMaximum = !0) : o.exclusiveMaximum = l), typeof s == "number" && (o.maximum = s, typeof l == "number" && n.target !== "draft-04" && (l <= s ? delete o.maximum : delete o.exclusiveMaximum)), typeof u == "number" && (o.multipleOf = u);
|
|
2410
|
+
}, bo = (e, n, t, r) => {
|
|
2411
|
+
t.type = "boolean";
|
|
2412
|
+
}, wo = (e, n, t, r) => {
|
|
2413
|
+
if (n.unrepresentable === "throw")
|
|
2414
|
+
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
2415
|
+
}, ko = (e, n, t, r) => {
|
|
2416
|
+
t.not = {};
|
|
2417
|
+
}, $o = (e, n, t, r) => {
|
|
2418
|
+
}, Zo = (e, n, t, r) => {
|
|
2419
|
+
if (n.unrepresentable === "throw")
|
|
2420
|
+
throw new Error("Date cannot be represented in JSON Schema");
|
|
2421
|
+
}, So = (e, n, t, r) => {
|
|
2422
|
+
const o = e._zod.def, i = Re(o.entries);
|
|
2423
|
+
i.every((s) => typeof s == "number") && (t.type = "number"), i.every((s) => typeof s == "string") && (t.type = "string"), t.enum = i;
|
|
2424
|
+
}, Oo = (e, n, t, r) => {
|
|
2425
|
+
const o = e._zod.def, i = [];
|
|
2426
|
+
for (const s of o.values)
|
|
2427
|
+
if (s === void 0) {
|
|
2428
|
+
if (n.unrepresentable === "throw")
|
|
2429
|
+
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
2430
|
+
} else if (typeof s == "bigint") {
|
|
2431
|
+
if (n.unrepresentable === "throw")
|
|
2432
|
+
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
2433
|
+
i.push(Number(s));
|
|
2434
|
+
} else
|
|
2435
|
+
i.push(s);
|
|
2436
|
+
if (i.length !== 0) if (i.length === 1) {
|
|
2437
|
+
const s = i[0];
|
|
2438
|
+
t.type = s === null ? "null" : typeof s, n.target === "draft-04" || n.target === "openapi-3.0" ? t.enum = [s] : t.const = s;
|
|
2439
|
+
} else
|
|
2440
|
+
i.every((s) => typeof s == "number") && (t.type = "number"), i.every((s) => typeof s == "string") && (t.type = "string"), i.every((s) => typeof s == "boolean") && (t.type = "boolean"), i.every((s) => s === null) && (t.type = "null"), t.enum = i;
|
|
2441
|
+
}, Eo = (e, n, t, r) => {
|
|
2442
|
+
if (n.unrepresentable === "throw")
|
|
2443
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
2444
|
+
}, Io = (e, n, t, r) => {
|
|
2445
|
+
if (n.unrepresentable === "throw")
|
|
2446
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2447
|
+
}, To = (e, n, t, r) => {
|
|
2448
|
+
const o = t, i = e._zod.def, { minimum: s, maximum: c } = e._zod.bag;
|
|
2449
|
+
typeof s == "number" && (o.minItems = s), typeof c == "number" && (o.maxItems = c), o.type = "array", o.items = b(i.element, n, { ...r, path: [...r.path, "items"] });
|
|
2450
|
+
}, Po = (e, n, t, r) => {
|
|
2451
|
+
const o = t, i = e._zod.def;
|
|
2452
|
+
o.type = "object", o.properties = {};
|
|
2453
|
+
const s = i.shape;
|
|
2454
|
+
for (const l in s)
|
|
2455
|
+
o.properties[l] = b(s[l], n, {
|
|
2456
|
+
...r,
|
|
2457
|
+
path: [...r.path, "properties", l]
|
|
2458
|
+
});
|
|
2459
|
+
const c = new Set(Object.keys(s)), u = new Set([...c].filter((l) => {
|
|
2460
|
+
const f = i.shape[l]._zod;
|
|
2461
|
+
return n.io === "input" ? f.optin === void 0 : f.optout === void 0;
|
|
2462
|
+
}));
|
|
2463
|
+
u.size > 0 && (o.required = Array.from(u)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = b(i.catchall, n, {
|
|
2464
|
+
...r,
|
|
2465
|
+
path: [...r.path, "additionalProperties"]
|
|
2466
|
+
})) : n.io === "output" && (o.additionalProperties = !1);
|
|
2467
|
+
}, No = (e, n, t, r) => {
|
|
2468
|
+
const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((c, u) => b(c, n, {
|
|
2469
|
+
...r,
|
|
2470
|
+
path: [...r.path, i ? "oneOf" : "anyOf", u]
|
|
2471
|
+
}));
|
|
2472
|
+
i ? t.oneOf = s : t.anyOf = s;
|
|
2473
|
+
}, jo = (e, n, t, r) => {
|
|
2474
|
+
const o = e._zod.def, i = b(o.left, n, {
|
|
2475
|
+
...r,
|
|
2476
|
+
path: [...r.path, "allOf", 0]
|
|
2477
|
+
}), s = b(o.right, n, {
|
|
2478
|
+
...r,
|
|
2479
|
+
path: [...r.path, "allOf", 1]
|
|
2480
|
+
}), c = (l) => "allOf" in l && Object.keys(l).length === 1, u = [
|
|
2481
|
+
...c(i) ? i.allOf : [i],
|
|
2482
|
+
...c(s) ? s.allOf : [s]
|
|
2483
|
+
];
|
|
2484
|
+
t.allOf = u;
|
|
2485
|
+
}, Ao = (e, n, t, r) => {
|
|
2486
|
+
const o = t, i = e._zod.def;
|
|
2487
|
+
o.type = "object";
|
|
2488
|
+
const s = i.keyType, u = s._zod.bag?.patterns;
|
|
2489
|
+
if (i.mode === "loose" && u && u.size > 0) {
|
|
2490
|
+
const f = b(i.valueType, n, {
|
|
2491
|
+
...r,
|
|
2492
|
+
path: [...r.path, "patternProperties", "*"]
|
|
2493
|
+
});
|
|
2494
|
+
o.patternProperties = {};
|
|
2495
|
+
for (const d of u)
|
|
2496
|
+
o.patternProperties[d.source] = f;
|
|
2497
|
+
} else
|
|
2498
|
+
(n.target === "draft-07" || n.target === "draft-2020-12") && (o.propertyNames = b(i.keyType, n, {
|
|
2499
|
+
...r,
|
|
2500
|
+
path: [...r.path, "propertyNames"]
|
|
2501
|
+
})), o.additionalProperties = b(i.valueType, n, {
|
|
2502
|
+
...r,
|
|
2503
|
+
path: [...r.path, "additionalProperties"]
|
|
2504
|
+
});
|
|
2505
|
+
const l = s._zod.values;
|
|
2506
|
+
if (l) {
|
|
2507
|
+
const f = [...l].filter((d) => typeof d == "string" || typeof d == "number");
|
|
2508
|
+
f.length > 0 && (o.required = f);
|
|
2509
|
+
}
|
|
2510
|
+
}, Do = (e, n, t, r) => {
|
|
2511
|
+
const o = e._zod.def, i = b(o.innerType, n, r), s = n.seen.get(e);
|
|
2512
|
+
n.target === "openapi-3.0" ? (s.ref = o.innerType, t.nullable = !0) : t.anyOf = [i, { type: "null" }];
|
|
2513
|
+
}, Ro = (e, n, t, r) => {
|
|
2514
|
+
const o = e._zod.def;
|
|
2515
|
+
b(o.innerType, n, r);
|
|
2516
|
+
const i = n.seen.get(e);
|
|
2517
|
+
i.ref = o.innerType;
|
|
2518
|
+
}, Co = (e, n, t, r) => {
|
|
2519
|
+
const o = e._zod.def;
|
|
2520
|
+
b(o.innerType, n, r);
|
|
2521
|
+
const i = n.seen.get(e);
|
|
2522
|
+
i.ref = o.innerType, t.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
2523
|
+
}, Uo = (e, n, t, r) => {
|
|
2524
|
+
const o = e._zod.def;
|
|
2525
|
+
b(o.innerType, n, r);
|
|
2526
|
+
const i = n.seen.get(e);
|
|
2527
|
+
i.ref = o.innerType, n.io === "input" && (t._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
2528
|
+
}, xo = (e, n, t, r) => {
|
|
2529
|
+
const o = e._zod.def;
|
|
2530
|
+
b(o.innerType, n, r);
|
|
2531
|
+
const i = n.seen.get(e);
|
|
2532
|
+
i.ref = o.innerType;
|
|
2533
|
+
let s;
|
|
2534
|
+
try {
|
|
2535
|
+
s = o.catchValue(void 0);
|
|
2536
|
+
} catch {
|
|
2537
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
2538
|
+
}
|
|
2539
|
+
t.default = s;
|
|
2540
|
+
}, Fo = (e, n, t, r) => {
|
|
2541
|
+
const o = e._zod.def, i = n.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
2542
|
+
b(i, n, r);
|
|
2543
|
+
const s = n.seen.get(e);
|
|
2544
|
+
s.ref = i;
|
|
2545
|
+
}, Jo = (e, n, t, r) => {
|
|
2546
|
+
const o = e._zod.def;
|
|
2547
|
+
b(o.innerType, n, r);
|
|
2548
|
+
const i = n.seen.get(e);
|
|
2549
|
+
i.ref = o.innerType, t.readOnly = !0;
|
|
2550
|
+
}, sn = (e, n, t, r) => {
|
|
2551
|
+
const o = e._zod.def;
|
|
2552
|
+
b(o.innerType, n, r);
|
|
2553
|
+
const i = n.seen.get(e);
|
|
2554
|
+
i.ref = o.innerType;
|
|
2555
|
+
}, Mo = /* @__PURE__ */ a("ZodISODateTime", (e, n) => {
|
|
2556
|
+
Rt.init(e, n), y.init(e, n);
|
|
2557
|
+
});
|
|
2558
|
+
function Lo(e) {
|
|
2559
|
+
return /* @__PURE__ */ Vr(Mo, e);
|
|
2560
|
+
}
|
|
2561
|
+
const Vo = /* @__PURE__ */ a("ZodISODate", (e, n) => {
|
|
2562
|
+
Ct.init(e, n), y.init(e, n);
|
|
2563
|
+
});
|
|
2564
|
+
function Bo(e) {
|
|
2565
|
+
return /* @__PURE__ */ Br(Vo, e);
|
|
2566
|
+
}
|
|
2567
|
+
const Wo = /* @__PURE__ */ a("ZodISOTime", (e, n) => {
|
|
2568
|
+
Ut.init(e, n), y.init(e, n);
|
|
2569
|
+
});
|
|
2570
|
+
function Ko(e) {
|
|
2571
|
+
return /* @__PURE__ */ Wr(Wo, e);
|
|
2572
|
+
}
|
|
2573
|
+
const Go = /* @__PURE__ */ a("ZodISODuration", (e, n) => {
|
|
2574
|
+
xt.init(e, n), y.init(e, n);
|
|
2575
|
+
});
|
|
2576
|
+
function Yo(e) {
|
|
2577
|
+
return /* @__PURE__ */ Kr(Go, e);
|
|
2578
|
+
}
|
|
2579
|
+
const qo = (e, n) => {
|
|
2580
|
+
Fe.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
|
|
2581
|
+
format: {
|
|
2582
|
+
value: (t) => En(e, t)
|
|
2583
|
+
// enumerable: false,
|
|
2584
|
+
},
|
|
2585
|
+
flatten: {
|
|
2586
|
+
value: (t) => On(e, t)
|
|
2587
|
+
// enumerable: false,
|
|
2588
|
+
},
|
|
2589
|
+
addIssue: {
|
|
2590
|
+
value: (t) => {
|
|
2591
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, te, 2);
|
|
2592
|
+
}
|
|
2593
|
+
// enumerable: false,
|
|
2594
|
+
},
|
|
2595
|
+
addIssues: {
|
|
2596
|
+
value: (t) => {
|
|
2597
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, te, 2);
|
|
2598
|
+
}
|
|
2599
|
+
// enumerable: false,
|
|
2600
|
+
},
|
|
2601
|
+
isEmpty: {
|
|
2602
|
+
get() {
|
|
2603
|
+
return e.issues.length === 0;
|
|
2604
|
+
}
|
|
2605
|
+
// enumerable: false,
|
|
2606
|
+
}
|
|
2607
|
+
});
|
|
2608
|
+
}, O = a("ZodError", qo, {
|
|
2609
|
+
Parent: Error
|
|
2610
|
+
}), Xo = /* @__PURE__ */ ae(O), Ho = /* @__PURE__ */ le(O), Qo = /* @__PURE__ */ Q(O), es = /* @__PURE__ */ ee(O), ns = /* @__PURE__ */ Pn(O), ts = /* @__PURE__ */ Nn(O), rs = /* @__PURE__ */ jn(O), os = /* @__PURE__ */ An(O), ss = /* @__PURE__ */ Dn(O), is = /* @__PURE__ */ Rn(O), cs = /* @__PURE__ */ Cn(O), us = /* @__PURE__ */ Un(O), v = /* @__PURE__ */ a("ZodType", (e, n) => (g.init(e, n), Object.assign(e["~standard"], {
|
|
2611
|
+
jsonSchema: {
|
|
2612
|
+
input: H(e, "input"),
|
|
2613
|
+
output: H(e, "output")
|
|
2614
|
+
}
|
|
2615
|
+
}), e.toJSONSchema = go(e, {}), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(N(n, {
|
|
2616
|
+
checks: [
|
|
2617
|
+
...n.checks ?? [],
|
|
2618
|
+
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2619
|
+
]
|
|
2620
|
+
}), {
|
|
2621
|
+
parent: !0
|
|
2622
|
+
}), e.with = e.check, e.clone = (t, r) => j(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => Xo(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Qo(e, t, r), e.parseAsync = async (t, r) => Ho(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => es(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => ns(e, t, r), e.decode = (t, r) => ts(e, t, r), e.encodeAsync = async (t, r) => rs(e, t, r), e.decodeAsync = async (t, r) => os(e, t, r), e.safeEncode = (t, r) => ss(e, t, r), e.safeDecode = (t, r) => is(e, t, r), e.safeEncodeAsync = async (t, r) => cs(e, t, r), e.safeDecodeAsync = async (t, r) => us(e, t, r), e.refine = (t, r) => e.check(ii(t, r)), e.superRefine = (t) => e.check(ci(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ F(t)), e.optional = () => Pe(e), e.exactOptional = () => Ks(e), e.nullable = () => Ne(e), e.nullish = () => Pe(Ne(e)), e.nonoptional = (t) => Qs(e, t), e.array = () => Ds(e), e.or = (t) => Us([e, t]), e.and = (t) => Fs(e, t), e.transform = (t) => je(e, Bs(t)), e.default = (t) => qs(e, t), e.prefault = (t) => Hs(e, t), e.catch = (t) => ni(e, t), e.pipe = (t) => je(e, t), e.readonly = () => oi(e), e.describe = (t) => {
|
|
2623
|
+
const r = e.clone();
|
|
2624
|
+
return J.add(r, { description: t }), r;
|
|
2625
|
+
}, Object.defineProperty(e, "description", {
|
|
2626
|
+
get() {
|
|
2627
|
+
return J.get(e)?.description;
|
|
2628
|
+
},
|
|
2629
|
+
configurable: !0
|
|
2630
|
+
}), e.meta = (...t) => {
|
|
2631
|
+
if (t.length === 0)
|
|
2632
|
+
return J.get(e);
|
|
2633
|
+
const r = e.clone();
|
|
2634
|
+
return J.add(r, t[0]), r;
|
|
2635
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)), cn = /* @__PURE__ */ a("_ZodString", (e, n) => {
|
|
2636
|
+
fe.init(e, n), v.init(e, n), e._zod.processJSONSchema = (r, o, i) => zo(e, r, o);
|
|
2637
|
+
const t = e._zod.bag;
|
|
2638
|
+
e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ no(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ oo(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ so(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ io(...r)), e.min = (...r) => e.check(/* @__PURE__ */ X(...r)), e.max = (...r) => e.check(/* @__PURE__ */ en(...r)), e.length = (...r) => e.check(/* @__PURE__ */ nn(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ X(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ to(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ ro(r)), e.trim = () => e.check(/* @__PURE__ */ uo()), e.normalize = (...r) => e.check(/* @__PURE__ */ co(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ ao()), e.toUpperCase = () => e.check(/* @__PURE__ */ lo()), e.slugify = () => e.check(/* @__PURE__ */ fo());
|
|
2639
|
+
}), as = /* @__PURE__ */ a("ZodString", (e, n) => {
|
|
2640
|
+
fe.init(e, n), cn.init(e, n), e.email = (t) => e.check(/* @__PURE__ */ kr(ls, t)), e.url = (t) => e.check(/* @__PURE__ */ Er(fs, t)), e.jwt = (t) => e.check(/* @__PURE__ */ Lr(Ss, t)), e.emoji = (t) => e.check(/* @__PURE__ */ Ir(ps, t)), e.guid = (t) => e.check(/* @__PURE__ */ $e(Ee, t)), e.uuid = (t) => e.check(/* @__PURE__ */ $r(W, t)), e.uuidv4 = (t) => e.check(/* @__PURE__ */ Zr(W, t)), e.uuidv6 = (t) => e.check(/* @__PURE__ */ Sr(W, t)), e.uuidv7 = (t) => e.check(/* @__PURE__ */ Or(W, t)), e.nanoid = (t) => e.check(/* @__PURE__ */ Tr(ds, t)), e.guid = (t) => e.check(/* @__PURE__ */ $e(Ee, t)), e.cuid = (t) => e.check(/* @__PURE__ */ Pr(hs, t)), e.cuid2 = (t) => e.check(/* @__PURE__ */ Nr(ms, t)), e.ulid = (t) => e.check(/* @__PURE__ */ jr(_s, t)), e.base64 = (t) => e.check(/* @__PURE__ */ Fr(ks, t)), e.base64url = (t) => e.check(/* @__PURE__ */ Jr($s, t)), e.xid = (t) => e.check(/* @__PURE__ */ Ar(gs, t)), e.ksuid = (t) => e.check(/* @__PURE__ */ Dr(vs, t)), e.ipv4 = (t) => e.check(/* @__PURE__ */ Rr(zs, t)), e.ipv6 = (t) => e.check(/* @__PURE__ */ Cr(ys, t)), e.cidrv4 = (t) => e.check(/* @__PURE__ */ Ur(bs, t)), e.cidrv6 = (t) => e.check(/* @__PURE__ */ xr(ws, t)), e.e164 = (t) => e.check(/* @__PURE__ */ Mr(Zs, t)), e.datetime = (t) => e.check(Lo(t)), e.date = (t) => e.check(Bo(t)), e.time = (t) => e.check(Ko(t)), e.duration = (t) => e.check(Yo(t));
|
|
2641
|
+
});
|
|
2642
|
+
function ai(e) {
|
|
2643
|
+
return /* @__PURE__ */ wr(as, e);
|
|
2644
|
+
}
|
|
2645
|
+
const y = /* @__PURE__ */ a("ZodStringFormat", (e, n) => {
|
|
2646
|
+
z.init(e, n), cn.init(e, n);
|
|
2647
|
+
}), ls = /* @__PURE__ */ a("ZodEmail", (e, n) => {
|
|
2648
|
+
Ot.init(e, n), y.init(e, n);
|
|
2649
|
+
}), Ee = /* @__PURE__ */ a("ZodGUID", (e, n) => {
|
|
2650
|
+
Zt.init(e, n), y.init(e, n);
|
|
2651
|
+
}), W = /* @__PURE__ */ a("ZodUUID", (e, n) => {
|
|
2652
|
+
St.init(e, n), y.init(e, n);
|
|
2653
|
+
}), fs = /* @__PURE__ */ a("ZodURL", (e, n) => {
|
|
2654
|
+
Et.init(e, n), y.init(e, n);
|
|
2655
|
+
}), ps = /* @__PURE__ */ a("ZodEmoji", (e, n) => {
|
|
2656
|
+
It.init(e, n), y.init(e, n);
|
|
2657
|
+
}), ds = /* @__PURE__ */ a("ZodNanoID", (e, n) => {
|
|
2658
|
+
Tt.init(e, n), y.init(e, n);
|
|
2659
|
+
}), hs = /* @__PURE__ */ a("ZodCUID", (e, n) => {
|
|
2660
|
+
Pt.init(e, n), y.init(e, n);
|
|
2661
|
+
}), ms = /* @__PURE__ */ a("ZodCUID2", (e, n) => {
|
|
2662
|
+
Nt.init(e, n), y.init(e, n);
|
|
2663
|
+
}), _s = /* @__PURE__ */ a("ZodULID", (e, n) => {
|
|
2664
|
+
jt.init(e, n), y.init(e, n);
|
|
2665
|
+
}), gs = /* @__PURE__ */ a("ZodXID", (e, n) => {
|
|
2666
|
+
At.init(e, n), y.init(e, n);
|
|
2667
|
+
}), vs = /* @__PURE__ */ a("ZodKSUID", (e, n) => {
|
|
2668
|
+
Dt.init(e, n), y.init(e, n);
|
|
2669
|
+
}), zs = /* @__PURE__ */ a("ZodIPv4", (e, n) => {
|
|
2670
|
+
Ft.init(e, n), y.init(e, n);
|
|
2671
|
+
}), ys = /* @__PURE__ */ a("ZodIPv6", (e, n) => {
|
|
2672
|
+
Jt.init(e, n), y.init(e, n);
|
|
2673
|
+
}), bs = /* @__PURE__ */ a("ZodCIDRv4", (e, n) => {
|
|
2674
|
+
Mt.init(e, n), y.init(e, n);
|
|
2675
|
+
}), ws = /* @__PURE__ */ a("ZodCIDRv6", (e, n) => {
|
|
2676
|
+
Lt.init(e, n), y.init(e, n);
|
|
2677
|
+
}), ks = /* @__PURE__ */ a("ZodBase64", (e, n) => {
|
|
2678
|
+
Vt.init(e, n), y.init(e, n);
|
|
2679
|
+
}), $s = /* @__PURE__ */ a("ZodBase64URL", (e, n) => {
|
|
2680
|
+
Wt.init(e, n), y.init(e, n);
|
|
2681
|
+
}), Zs = /* @__PURE__ */ a("ZodE164", (e, n) => {
|
|
2682
|
+
Kt.init(e, n), y.init(e, n);
|
|
2683
|
+
}), Ss = /* @__PURE__ */ a("ZodJWT", (e, n) => {
|
|
2684
|
+
Yt.init(e, n), y.init(e, n);
|
|
2685
|
+
}), un = /* @__PURE__ */ a("ZodNumber", (e, n) => {
|
|
2686
|
+
qe.init(e, n), v.init(e, n), e._zod.processJSONSchema = (r, o, i) => yo(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ Se(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ G(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ G(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ Ze(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ K(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ K(r, o)), e.int = (r) => e.check(Ie(r)), e.safe = (r) => e.check(Ie(r)), e.positive = (r) => e.check(/* @__PURE__ */ Se(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ G(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ Ze(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ K(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ Oe(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ Oe(r, o)), e.finite = () => e;
|
|
2687
|
+
const t = e._zod.bag;
|
|
2688
|
+
e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
|
|
2689
|
+
});
|
|
2690
|
+
function li(e) {
|
|
2691
|
+
return /* @__PURE__ */ Gr(un, e);
|
|
2692
|
+
}
|
|
2693
|
+
const Os = /* @__PURE__ */ a("ZodNumberFormat", (e, n) => {
|
|
2694
|
+
qt.init(e, n), un.init(e, n);
|
|
2695
|
+
});
|
|
2696
|
+
function Ie(e) {
|
|
2697
|
+
return /* @__PURE__ */ Yr(Os, e);
|
|
2698
|
+
}
|
|
2699
|
+
const Es = /* @__PURE__ */ a("ZodBoolean", (e, n) => {
|
|
2700
|
+
Xt.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => bo(e, t, r);
|
|
2701
|
+
});
|
|
2702
|
+
function fi(e) {
|
|
2703
|
+
return /* @__PURE__ */ qr(Es, e);
|
|
2704
|
+
}
|
|
2705
|
+
const Is = /* @__PURE__ */ a("ZodUndefined", (e, n) => {
|
|
2706
|
+
Ht.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => wo(e, t);
|
|
2707
|
+
});
|
|
2708
|
+
function pi(e) {
|
|
2709
|
+
return /* @__PURE__ */ Xr(Is, e);
|
|
2710
|
+
}
|
|
2711
|
+
const Ts = /* @__PURE__ */ a("ZodUnknown", (e, n) => {
|
|
2712
|
+
Qt.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => $o();
|
|
2713
|
+
});
|
|
2714
|
+
function Te() {
|
|
2715
|
+
return /* @__PURE__ */ Hr(Ts);
|
|
2716
|
+
}
|
|
2717
|
+
const Ps = /* @__PURE__ */ a("ZodNever", (e, n) => {
|
|
2718
|
+
er.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => ko(e, t, r);
|
|
2719
|
+
});
|
|
2720
|
+
function Ns(e) {
|
|
2721
|
+
return /* @__PURE__ */ Qr(Ps, e);
|
|
2722
|
+
}
|
|
2723
|
+
const js = /* @__PURE__ */ a("ZodDate", (e, n) => {
|
|
2724
|
+
nr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (r, o, i) => Zo(e, r), e.min = (r, o) => e.check(/* @__PURE__ */ G(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ K(r, o));
|
|
2725
|
+
const t = e._zod.bag;
|
|
2726
|
+
e.minDate = t.minimum ? new Date(t.minimum) : null, e.maxDate = t.maximum ? new Date(t.maximum) : null;
|
|
2727
|
+
});
|
|
2728
|
+
function di(e) {
|
|
2729
|
+
return /* @__PURE__ */ eo(js, e);
|
|
2730
|
+
}
|
|
2731
|
+
const As = /* @__PURE__ */ a("ZodArray", (e, n) => {
|
|
2732
|
+
tr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => To(e, t, r, o), e.element = n.element, e.min = (t, r) => e.check(/* @__PURE__ */ X(t, r)), e.nonempty = (t) => e.check(/* @__PURE__ */ X(1, t)), e.max = (t, r) => e.check(/* @__PURE__ */ en(t, r)), e.length = (t, r) => e.check(/* @__PURE__ */ nn(t, r)), e.unwrap = () => e.element;
|
|
2733
|
+
});
|
|
2734
|
+
function Ds(e, n) {
|
|
2735
|
+
return /* @__PURE__ */ po(As, e, n);
|
|
2736
|
+
}
|
|
2737
|
+
const Rs = /* @__PURE__ */ a("ZodObject", (e, n) => {
|
|
2738
|
+
or.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Po(e, t, r, o), _(e, "shape", () => n.shape), e.keyof = () => Ms(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Te() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Te() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Ns() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => wn(e, t), e.safeExtend = (t) => kn(e, t), e.merge = (t) => $n(e, t), e.pick = (t) => yn(e, t), e.omit = (t) => bn(e, t), e.partial = (...t) => Zn(an, e, t[0]), e.required = (...t) => Sn(ln, e, t[0]);
|
|
2739
|
+
});
|
|
2740
|
+
function hi(e, n) {
|
|
2741
|
+
const t = {
|
|
2742
|
+
type: "object",
|
|
2743
|
+
shape: e ?? {},
|
|
2744
|
+
...p(n)
|
|
2745
|
+
};
|
|
2746
|
+
return new Rs(t);
|
|
2747
|
+
}
|
|
2748
|
+
const Cs = /* @__PURE__ */ a("ZodUnion", (e, n) => {
|
|
2749
|
+
sr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => No(e, t, r, o), e.options = n.options;
|
|
2750
|
+
});
|
|
2751
|
+
function Us(e, n) {
|
|
2752
|
+
return new Cs({
|
|
2753
|
+
type: "union",
|
|
2754
|
+
options: e,
|
|
2755
|
+
...p(n)
|
|
2756
|
+
});
|
|
2757
|
+
}
|
|
2758
|
+
const xs = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
|
|
2759
|
+
ir.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => jo(e, t, r, o);
|
|
2760
|
+
});
|
|
2761
|
+
function Fs(e, n) {
|
|
2762
|
+
return new xs({
|
|
2763
|
+
type: "intersection",
|
|
2764
|
+
left: e,
|
|
2765
|
+
right: n
|
|
2766
|
+
});
|
|
2767
|
+
}
|
|
2768
|
+
const Js = /* @__PURE__ */ a("ZodRecord", (e, n) => {
|
|
2769
|
+
cr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ao(e, t, r, o), e.keyType = n.keyType, e.valueType = n.valueType;
|
|
2770
|
+
});
|
|
2771
|
+
function mi(e, n, t) {
|
|
2772
|
+
return new Js({
|
|
2773
|
+
type: "record",
|
|
2774
|
+
keyType: e,
|
|
2775
|
+
valueType: n,
|
|
2776
|
+
...p(t)
|
|
2777
|
+
});
|
|
2778
|
+
}
|
|
2779
|
+
const oe = /* @__PURE__ */ a("ZodEnum", (e, n) => {
|
|
2780
|
+
ur.init(e, n), v.init(e, n), e._zod.processJSONSchema = (r, o, i) => So(e, r, o), e.enum = n.entries, e.options = Object.values(n.entries);
|
|
2781
|
+
const t = new Set(Object.keys(n.entries));
|
|
2782
|
+
e.extract = (r, o) => {
|
|
2783
|
+
const i = {};
|
|
2784
|
+
for (const s of r)
|
|
2785
|
+
if (t.has(s))
|
|
2786
|
+
i[s] = n.entries[s];
|
|
2787
|
+
else
|
|
2788
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
2789
|
+
return new oe({
|
|
2790
|
+
...n,
|
|
2791
|
+
checks: [],
|
|
2792
|
+
...p(o),
|
|
2793
|
+
entries: i
|
|
2794
|
+
});
|
|
2795
|
+
}, e.exclude = (r, o) => {
|
|
2796
|
+
const i = { ...n.entries };
|
|
2797
|
+
for (const s of r)
|
|
2798
|
+
if (t.has(s))
|
|
2799
|
+
delete i[s];
|
|
2800
|
+
else
|
|
2801
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
2802
|
+
return new oe({
|
|
2803
|
+
...n,
|
|
2804
|
+
checks: [],
|
|
2805
|
+
...p(o),
|
|
2806
|
+
entries: i
|
|
2807
|
+
});
|
|
2808
|
+
};
|
|
2809
|
+
});
|
|
2810
|
+
function Ms(e, n) {
|
|
2811
|
+
const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2812
|
+
return new oe({
|
|
2813
|
+
type: "enum",
|
|
2814
|
+
entries: t,
|
|
2815
|
+
...p(n)
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
const Ls = /* @__PURE__ */ a("ZodLiteral", (e, n) => {
|
|
2819
|
+
ar.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Oo(e, t, r), e.values = new Set(n.values), Object.defineProperty(e, "value", {
|
|
2820
|
+
get() {
|
|
2821
|
+
if (n.values.length > 1)
|
|
2822
|
+
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
2823
|
+
return n.values[0];
|
|
2824
|
+
}
|
|
2825
|
+
});
|
|
2826
|
+
});
|
|
2827
|
+
function _i(e, n) {
|
|
2828
|
+
return new Ls({
|
|
2829
|
+
type: "literal",
|
|
2830
|
+
values: Array.isArray(e) ? e : [e],
|
|
2831
|
+
...p(n)
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
const Vs = /* @__PURE__ */ a("ZodTransform", (e, n) => {
|
|
2835
|
+
lr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Io(e, t), e._zod.parse = (t, r) => {
|
|
2836
|
+
if (r.direction === "backward")
|
|
2837
|
+
throw new Ae(e.constructor.name);
|
|
2838
|
+
t.addIssue = (i) => {
|
|
2839
|
+
if (typeof i == "string")
|
|
2840
|
+
t.issues.push(M(i, t.value, n));
|
|
2841
|
+
else {
|
|
2842
|
+
const s = i;
|
|
2843
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(M(s));
|
|
2844
|
+
}
|
|
2845
|
+
};
|
|
2846
|
+
const o = n.transform(t.value, t);
|
|
2847
|
+
return o instanceof Promise ? o.then((i) => (t.value = i, t)) : (t.value = o, t);
|
|
2848
|
+
};
|
|
2849
|
+
});
|
|
2850
|
+
function Bs(e) {
|
|
2851
|
+
return new Vs({
|
|
2852
|
+
type: "transform",
|
|
2853
|
+
transform: e
|
|
2854
|
+
});
|
|
2855
|
+
}
|
|
2856
|
+
const an = /* @__PURE__ */ a("ZodOptional", (e, n) => {
|
|
2857
|
+
Qe.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => sn(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2858
|
+
});
|
|
2859
|
+
function Pe(e) {
|
|
2860
|
+
return new an({
|
|
2861
|
+
type: "optional",
|
|
2862
|
+
innerType: e
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2865
|
+
const Ws = /* @__PURE__ */ a("ZodExactOptional", (e, n) => {
|
|
2866
|
+
fr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => sn(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2867
|
+
});
|
|
2868
|
+
function Ks(e) {
|
|
2869
|
+
return new Ws({
|
|
2870
|
+
type: "optional",
|
|
2871
|
+
innerType: e
|
|
2872
|
+
});
|
|
2873
|
+
}
|
|
2874
|
+
const Gs = /* @__PURE__ */ a("ZodNullable", (e, n) => {
|
|
2875
|
+
pr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Do(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2876
|
+
});
|
|
2877
|
+
function Ne(e) {
|
|
2878
|
+
return new Gs({
|
|
2879
|
+
type: "nullable",
|
|
2880
|
+
innerType: e
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
const Ys = /* @__PURE__ */ a("ZodDefault", (e, n) => {
|
|
2884
|
+
dr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Co(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2885
|
+
});
|
|
2886
|
+
function qs(e, n) {
|
|
2887
|
+
return new Ys({
|
|
2888
|
+
type: "default",
|
|
2889
|
+
innerType: e,
|
|
2890
|
+
get defaultValue() {
|
|
2891
|
+
return typeof n == "function" ? n() : Ue(n);
|
|
2892
|
+
}
|
|
2893
|
+
});
|
|
2894
|
+
}
|
|
2895
|
+
const Xs = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
|
|
2896
|
+
hr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Uo(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2897
|
+
});
|
|
2898
|
+
function Hs(e, n) {
|
|
2899
|
+
return new Xs({
|
|
2900
|
+
type: "prefault",
|
|
2901
|
+
innerType: e,
|
|
2902
|
+
get defaultValue() {
|
|
2903
|
+
return typeof n == "function" ? n() : Ue(n);
|
|
2904
|
+
}
|
|
2905
|
+
});
|
|
2906
|
+
}
|
|
2907
|
+
const ln = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
|
|
2908
|
+
mr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ro(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2909
|
+
});
|
|
2910
|
+
function Qs(e, n) {
|
|
2911
|
+
return new ln({
|
|
2912
|
+
type: "nonoptional",
|
|
2913
|
+
innerType: e,
|
|
2914
|
+
...p(n)
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
const ei = /* @__PURE__ */ a("ZodCatch", (e, n) => {
|
|
2918
|
+
_r.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => xo(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2919
|
+
});
|
|
2920
|
+
function ni(e, n) {
|
|
2921
|
+
return new ei({
|
|
2922
|
+
type: "catch",
|
|
2923
|
+
innerType: e,
|
|
2924
|
+
catchValue: typeof n == "function" ? n : () => n
|
|
2925
|
+
});
|
|
2926
|
+
}
|
|
2927
|
+
const ti = /* @__PURE__ */ a("ZodPipe", (e, n) => {
|
|
2928
|
+
gr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Fo(e, t, r, o), e.in = n.in, e.out = n.out;
|
|
2929
|
+
});
|
|
2930
|
+
function je(e, n) {
|
|
2931
|
+
return new ti({
|
|
2932
|
+
type: "pipe",
|
|
2933
|
+
in: e,
|
|
2934
|
+
out: n
|
|
2935
|
+
// ...util.normalizeParams(params),
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
const ri = /* @__PURE__ */ a("ZodReadonly", (e, n) => {
|
|
2939
|
+
vr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Jo(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2940
|
+
});
|
|
2941
|
+
function oi(e) {
|
|
2942
|
+
return new ri({
|
|
2943
|
+
type: "readonly",
|
|
2944
|
+
innerType: e
|
|
2945
|
+
});
|
|
2946
|
+
}
|
|
2947
|
+
const si = /* @__PURE__ */ a("ZodCustom", (e, n) => {
|
|
2948
|
+
zr.init(e, n), v.init(e, n), e._zod.processJSONSchema = (t, r, o) => Eo(e, t);
|
|
2949
|
+
});
|
|
2950
|
+
function ii(e, n = {}) {
|
|
2951
|
+
return /* @__PURE__ */ ho(si, e, n);
|
|
2952
|
+
}
|
|
2953
|
+
function ci(e) {
|
|
2954
|
+
return /* @__PURE__ */ mo(e);
|
|
2955
|
+
}
|
|
2956
|
+
export {
|
|
2957
|
+
Ms as _,
|
|
2958
|
+
pi as a,
|
|
2959
|
+
fi as b,
|
|
2960
|
+
Ds as c,
|
|
2961
|
+
di as d,
|
|
2962
|
+
Te as e,
|
|
2963
|
+
_i as l,
|
|
2964
|
+
li as n,
|
|
2965
|
+
hi as o,
|
|
2966
|
+
mi as r,
|
|
2967
|
+
ai as s,
|
|
2968
|
+
Us as u
|
|
2969
|
+
};
|