@cloudflare/kumo 1.2.0 → 1.4.0
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/CHANGELOG.md +16 -0
- package/ai/USAGE.md +193 -0
- package/ai/component-registry.json +1492 -215
- package/ai/component-registry.md +524 -66
- package/ai/schemas.ts +366 -107
- package/dist/.build-complete +1 -1
- package/dist/badge-Dc99vsfo.js.map +1 -1
- package/dist/banner-4fkH6Sbt.js.map +1 -1
- package/dist/breadcrumbs-DyKi7BcP.js.map +1 -1
- package/dist/button-Bh96oxRL.js.map +1 -1
- package/dist/catalog.js +1 -1
- package/dist/checkbox-C1LPq8eL.js.map +1 -1
- package/dist/clipboard-text-CJSI9X2m.js.map +1 -1
- package/dist/cloudflare-logo-Dqd1VD9z.js +166 -0
- package/dist/cloudflare-logo-Dqd1VD9z.js.map +1 -0
- package/dist/code-T2wPDiM0.js.map +1 -1
- package/dist/collapsible-OBNkTO48.js.map +1 -1
- package/dist/combobox-CWxn5aHA.js.map +1 -1
- package/dist/command-line/cli.js +43 -18
- package/dist/command-line/commands/ai.js +23 -0
- package/dist/command-line/commands/blocks.js +2 -2
- package/dist/command-line/commands/ls.js +2 -2
- package/dist/{command-palette-BxmGYxBv.js → command-palette-J50WKjS7.js} +14 -8
- package/dist/command-palette-J50WKjS7.js.map +1 -0
- package/dist/components/cloudflare-logo.js +10 -0
- package/dist/components/cloudflare-logo.js.map +1 -0
- package/dist/components/command-palette.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/date-range-picker-CbKEQ9pi.js.map +1 -1
- package/dist/{dialog-BxXPA2vI.js → dialog-x9n9wI13.js} +18 -18
- package/dist/dialog-x9n9wI13.js.map +1 -0
- package/dist/dropdown-BAyk1knz.js.map +1 -1
- package/dist/empty-D03cbzRS.js.map +1 -1
- package/dist/field-B7ORz5ej.js.map +1 -1
- package/dist/grid-DKajRHh8.js.map +1 -1
- package/dist/index.js +274 -122
- package/dist/index.js.map +1 -1
- package/dist/input-D6YgDfDG.js.map +1 -1
- package/dist/label-B4FY8MX_.js.map +1 -1
- package/dist/layer-card-C8j5Hkkj.js.map +1 -1
- package/dist/link-CcuZKqob.js.map +1 -1
- package/dist/loader-DHGMYlC6.js.map +1 -1
- package/dist/menubar-CzimiryS.js.map +1 -1
- package/dist/meter-BrJnHJ3Q.js.map +1 -1
- package/dist/pagination-D0x9KQSk.js.map +1 -1
- package/dist/{popover-BfGLC2s6.js → popover-CtKDH8Yc.js} +8 -8
- package/dist/popover-CtKDH8Yc.js.map +1 -0
- package/dist/radio-CYejLANA.js.map +1 -1
- package/dist/schemas-DCw6TIy0.js +3859 -0
- package/dist/{schemas-C2YJKpDC.js.map → schemas-DCw6TIy0.js.map} +1 -1
- package/dist/select-D4rKQAax.js.map +1 -1
- package/dist/sensitive-input-DYvAmxkN.js.map +1 -1
- package/dist/src/blocks/delete-resource/delete-resource.d.ts +46 -0
- package/dist/src/blocks/delete-resource/delete-resource.d.ts.map +1 -0
- package/dist/src/blocks/delete-resource/index.d.ts +2 -0
- package/dist/src/blocks/delete-resource/index.d.ts.map +1 -0
- package/dist/src/command-line/commands/ai.d.ts +10 -0
- package/dist/src/command-line/commands/ai.d.ts.map +1 -0
- package/dist/src/components/badge/badge.d.ts +31 -4
- package/dist/src/components/badge/badge.d.ts.map +1 -1
- package/dist/src/components/banner/banner.d.ts +39 -4
- package/dist/src/components/banner/banner.d.ts.map +1 -1
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +35 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/src/components/button/button.d.ts +86 -0
- package/dist/src/components/button/button.d.ts.map +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +7 -0
- package/dist/src/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/src/components/clipboard-text/clipboard-text.d.ts +28 -3
- package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -1
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts +133 -0
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts.map +1 -0
- package/dist/src/components/cloudflare-logo/index.d.ts +2 -0
- package/dist/src/components/cloudflare-logo/index.d.ts.map +1 -0
- package/dist/src/components/code/code.d.ts +38 -6
- package/dist/src/components/code/code.d.ts.map +1 -1
- package/dist/src/components/collapsible/collapsible.d.ts +10 -0
- package/dist/src/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/src/components/combobox/combobox.d.ts +61 -0
- package/dist/src/components/combobox/combobox.d.ts.map +1 -1
- package/dist/src/components/command-palette/command-palette.d.ts +41 -6
- package/dist/src/components/command-palette/command-palette.d.ts.map +1 -1
- package/dist/src/components/date-range-picker/date-range-picker.d.ts +57 -4
- package/dist/src/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/src/components/dialog/dialog.d.ts +28 -1
- package/dist/src/components/dialog/dialog.d.ts.map +1 -1
- package/dist/src/components/dropdown/dropdown.d.ts +33 -0
- package/dist/src/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/src/components/empty/empty.d.ts +35 -0
- package/dist/src/components/empty/empty.d.ts.map +1 -1
- package/dist/src/components/field/field.d.ts +34 -4
- package/dist/src/components/field/field.d.ts.map +1 -1
- package/dist/src/components/grid/grid.d.ts +45 -17
- package/dist/src/components/grid/grid.d.ts.map +1 -1
- package/dist/src/components/input/input.d.ts +15 -0
- package/dist/src/components/input/input.d.ts.map +1 -1
- package/dist/src/components/label/label.d.ts +16 -5
- package/dist/src/components/label/label.d.ts.map +1 -1
- package/dist/src/components/layer-card/layer-card.d.ts +13 -0
- package/dist/src/components/layer-card/layer-card.d.ts.map +1 -1
- package/dist/src/components/link/link.d.ts +20 -0
- package/dist/src/components/link/link.d.ts.map +1 -1
- package/dist/src/components/loader/loader.d.ts +34 -0
- package/dist/src/components/loader/loader.d.ts.map +1 -1
- package/dist/src/components/menubar/menubar.d.ts +44 -0
- package/dist/src/components/menubar/menubar.d.ts.map +1 -1
- package/dist/src/components/meter/meter.d.ts +26 -0
- package/dist/src/components/meter/meter.d.ts.map +1 -1
- package/dist/src/components/pagination/pagination.d.ts +25 -0
- package/dist/src/components/pagination/pagination.d.ts.map +1 -1
- package/dist/src/components/popover/popover.d.ts +33 -5
- package/dist/src/components/popover/popover.d.ts.map +1 -1
- package/dist/src/components/radio/radio.d.ts +22 -0
- package/dist/src/components/radio/radio.d.ts.map +1 -1
- package/dist/src/components/select/select.d.ts +42 -20
- package/dist/src/components/select/select.d.ts.map +1 -1
- package/dist/src/components/sensitive-input/sensitive-input.d.ts +30 -6
- package/dist/src/components/sensitive-input/sensitive-input.d.ts.map +1 -1
- package/dist/src/components/surface/surface.d.ts +18 -6
- package/dist/src/components/surface/surface.d.ts.map +1 -1
- package/dist/src/components/switch/switch.d.ts +14 -0
- package/dist/src/components/switch/switch.d.ts.map +1 -1
- package/dist/src/components/table/table.d.ts +33 -0
- package/dist/src/components/table/table.d.ts.map +1 -1
- package/dist/src/components/tabs/tabs.d.ts +48 -9
- package/dist/src/components/tabs/tabs.d.ts.map +1 -1
- package/dist/src/components/text/text.d.ts +35 -7
- package/dist/src/components/text/text.d.ts.map +1 -1
- package/dist/src/components/toast/toast.d.ts +34 -0
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/src/components/tooltip/tooltip.d.ts +41 -0
- package/dist/src/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/src/index.d.ts +31 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/surface-BIC6CXiz.js.map +1 -1
- package/dist/switch-z7FE1nQE.js.map +1 -1
- package/dist/table-Sd2Etb1N.js.map +1 -1
- package/dist/tabs-DAEeuQLd.js.map +1 -1
- package/dist/text-BEhqwMfe.js.map +1 -1
- package/dist/toast-B8ebpHaU.js.map +1 -1
- package/dist/tooltip-C4DRhJi1.js.map +1 -1
- package/package.json +6 -2
- package/dist/command-palette-BxmGYxBv.js.map +0 -1
- package/dist/dialog-BxXPA2vI.js.map +0 -1
- package/dist/popover-BfGLC2s6.js.map +0 -1
- package/dist/schemas-C2YJKpDC.js +0 -3543
package/dist/schemas-C2YJKpDC.js
DELETED
|
@@ -1,3543 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
function p(e, t, n) {
|
|
3
|
-
function o(a, u) {
|
|
4
|
-
if (a._zod || Object.defineProperty(a, "_zod", {
|
|
5
|
-
value: {
|
|
6
|
-
def: u,
|
|
7
|
-
constr: i,
|
|
8
|
-
traits: /* @__PURE__ */ new Set()
|
|
9
|
-
},
|
|
10
|
-
enumerable: !1
|
|
11
|
-
}), a._zod.traits.has(e))
|
|
12
|
-
return;
|
|
13
|
-
a._zod.traits.add(e), t(a, u);
|
|
14
|
-
const l = i.prototype, f = Object.keys(l);
|
|
15
|
-
for (let h = 0; h < f.length; h++) {
|
|
16
|
-
const b = f[h];
|
|
17
|
-
b in a || (a[b] = l[b].bind(a));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const r = n?.Parent ?? Object;
|
|
21
|
-
class s extends r {
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(s, "name", { value: e });
|
|
24
|
-
function i(a) {
|
|
25
|
-
var u;
|
|
26
|
-
const l = n?.Parent ? new s() : this;
|
|
27
|
-
o(l, a), (u = l._zod).deferred ?? (u.deferred = []);
|
|
28
|
-
for (const f of l._zod.deferred)
|
|
29
|
-
f();
|
|
30
|
-
return l;
|
|
31
|
-
}
|
|
32
|
-
return Object.defineProperty(i, "init", { value: o }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
33
|
-
value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
|
|
34
|
-
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
35
|
-
}
|
|
36
|
-
class G extends Error {
|
|
37
|
-
constructor() {
|
|
38
|
-
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
class We extends Error {
|
|
42
|
-
constructor(t) {
|
|
43
|
-
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const Ge = {};
|
|
47
|
-
function F(e) {
|
|
48
|
-
return Ge;
|
|
49
|
-
}
|
|
50
|
-
function qe(e) {
|
|
51
|
-
const t = Object.values(e).filter((o) => typeof o == "number");
|
|
52
|
-
return Object.entries(e).filter(([o, r]) => t.indexOf(+o) === -1).map(([o, r]) => r);
|
|
53
|
-
}
|
|
54
|
-
function ge(e, t) {
|
|
55
|
-
return typeof t == "bigint" ? t.toString() : t;
|
|
56
|
-
}
|
|
57
|
-
function be(e) {
|
|
58
|
-
return {
|
|
59
|
-
get value() {
|
|
60
|
-
{
|
|
61
|
-
const t = e();
|
|
62
|
-
return Object.defineProperty(this, "value", { value: t }), t;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function ye(e) {
|
|
68
|
-
return e == null;
|
|
69
|
-
}
|
|
70
|
-
function ze(e) {
|
|
71
|
-
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
72
|
-
return e.slice(t, n);
|
|
73
|
-
}
|
|
74
|
-
function Pt(e, t) {
|
|
75
|
-
const n = (e.toString().split(".")[1] || "").length, o = t.toString();
|
|
76
|
-
let r = (o.split(".")[1] || "").length;
|
|
77
|
-
if (r === 0 && /\d?e-\d?/.test(o)) {
|
|
78
|
-
const u = o.match(/\d?e-(\d?)/);
|
|
79
|
-
u?.[1] && (r = Number.parseInt(u[1]));
|
|
80
|
-
}
|
|
81
|
-
const s = n > r ? n : r, i = Number.parseInt(e.toFixed(s).replace(".", "")), a = Number.parseInt(t.toFixed(s).replace(".", ""));
|
|
82
|
-
return i % a / 10 ** s;
|
|
83
|
-
}
|
|
84
|
-
const Se = Symbol("evaluating");
|
|
85
|
-
function $(e, t, n) {
|
|
86
|
-
let o;
|
|
87
|
-
Object.defineProperty(e, t, {
|
|
88
|
-
get() {
|
|
89
|
-
if (o !== Se)
|
|
90
|
-
return o === void 0 && (o = Se, o = n()), o;
|
|
91
|
-
},
|
|
92
|
-
set(r) {
|
|
93
|
-
Object.defineProperty(e, t, {
|
|
94
|
-
value: r
|
|
95
|
-
// configurable: true,
|
|
96
|
-
});
|
|
97
|
-
},
|
|
98
|
-
configurable: !0
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function B(e, t, n) {
|
|
102
|
-
Object.defineProperty(e, t, {
|
|
103
|
-
value: n,
|
|
104
|
-
writable: !0,
|
|
105
|
-
enumerable: !0,
|
|
106
|
-
configurable: !0
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function M(...e) {
|
|
110
|
-
const t = {};
|
|
111
|
-
for (const n of e) {
|
|
112
|
-
const o = Object.getOwnPropertyDescriptors(n);
|
|
113
|
-
Object.assign(t, o);
|
|
114
|
-
}
|
|
115
|
-
return Object.defineProperties({}, t);
|
|
116
|
-
}
|
|
117
|
-
function Pe(e) {
|
|
118
|
-
return JSON.stringify(e);
|
|
119
|
-
}
|
|
120
|
-
function Ot(e) {
|
|
121
|
-
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
122
|
-
}
|
|
123
|
-
const Ye = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
124
|
-
};
|
|
125
|
-
function se(e) {
|
|
126
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
127
|
-
}
|
|
128
|
-
const Tt = be(() => {
|
|
129
|
-
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
130
|
-
return !1;
|
|
131
|
-
try {
|
|
132
|
-
const e = Function;
|
|
133
|
-
return new e(""), !0;
|
|
134
|
-
} catch {
|
|
135
|
-
return !1;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
function q(e) {
|
|
139
|
-
if (se(e) === !1)
|
|
140
|
-
return !1;
|
|
141
|
-
const t = e.constructor;
|
|
142
|
-
if (t === void 0 || typeof t != "function")
|
|
143
|
-
return !0;
|
|
144
|
-
const n = t.prototype;
|
|
145
|
-
return !(se(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
146
|
-
}
|
|
147
|
-
function Xe(e) {
|
|
148
|
-
return q(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
149
|
-
}
|
|
150
|
-
const It = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
151
|
-
function le(e) {
|
|
152
|
-
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
153
|
-
}
|
|
154
|
-
function J(e, t, n) {
|
|
155
|
-
const o = new e._zod.constr(t ?? e._zod.def);
|
|
156
|
-
return (!t || n?.parent) && (o._zod.parent = e), o;
|
|
157
|
-
}
|
|
158
|
-
function g(e) {
|
|
159
|
-
const t = e;
|
|
160
|
-
if (!t)
|
|
161
|
-
return {};
|
|
162
|
-
if (typeof t == "string")
|
|
163
|
-
return { error: () => t };
|
|
164
|
-
if (t?.message !== void 0) {
|
|
165
|
-
if (t?.error !== void 0)
|
|
166
|
-
throw new Error("Cannot specify both `message` and `error` params");
|
|
167
|
-
t.error = t.message;
|
|
168
|
-
}
|
|
169
|
-
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
170
|
-
}
|
|
171
|
-
function Nt(e) {
|
|
172
|
-
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
173
|
-
}
|
|
174
|
-
const Et = {
|
|
175
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
176
|
-
int32: [-2147483648, 2147483647],
|
|
177
|
-
uint32: [0, 4294967295],
|
|
178
|
-
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
179
|
-
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
180
|
-
};
|
|
181
|
-
function Ct(e, t) {
|
|
182
|
-
const n = e._zod.def, o = n.checks;
|
|
183
|
-
if (o && o.length > 0)
|
|
184
|
-
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
185
|
-
const s = M(e._zod.def, {
|
|
186
|
-
get shape() {
|
|
187
|
-
const i = {};
|
|
188
|
-
for (const a in t) {
|
|
189
|
-
if (!(a in n.shape))
|
|
190
|
-
throw new Error(`Unrecognized key: "${a}"`);
|
|
191
|
-
t[a] && (i[a] = n.shape[a]);
|
|
192
|
-
}
|
|
193
|
-
return B(this, "shape", i), i;
|
|
194
|
-
},
|
|
195
|
-
checks: []
|
|
196
|
-
});
|
|
197
|
-
return J(e, s);
|
|
198
|
-
}
|
|
199
|
-
function jt(e, t) {
|
|
200
|
-
const n = e._zod.def, o = n.checks;
|
|
201
|
-
if (o && o.length > 0)
|
|
202
|
-
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
203
|
-
const s = M(e._zod.def, {
|
|
204
|
-
get shape() {
|
|
205
|
-
const i = { ...e._zod.def.shape };
|
|
206
|
-
for (const a in t) {
|
|
207
|
-
if (!(a in n.shape))
|
|
208
|
-
throw new Error(`Unrecognized key: "${a}"`);
|
|
209
|
-
t[a] && delete i[a];
|
|
210
|
-
}
|
|
211
|
-
return B(this, "shape", i), i;
|
|
212
|
-
},
|
|
213
|
-
checks: []
|
|
214
|
-
});
|
|
215
|
-
return J(e, s);
|
|
216
|
-
}
|
|
217
|
-
function At(e, t) {
|
|
218
|
-
if (!q(t))
|
|
219
|
-
throw new Error("Invalid input to extend: expected a plain object");
|
|
220
|
-
const n = e._zod.def.checks;
|
|
221
|
-
if (n && n.length > 0) {
|
|
222
|
-
const s = e._zod.def.shape;
|
|
223
|
-
for (const i in t)
|
|
224
|
-
if (Object.getOwnPropertyDescriptor(s, i) !== void 0)
|
|
225
|
-
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
226
|
-
}
|
|
227
|
-
const r = M(e._zod.def, {
|
|
228
|
-
get shape() {
|
|
229
|
-
const s = { ...e._zod.def.shape, ...t };
|
|
230
|
-
return B(this, "shape", s), s;
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
return J(e, r);
|
|
234
|
-
}
|
|
235
|
-
function Rt(e, t) {
|
|
236
|
-
if (!q(t))
|
|
237
|
-
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
238
|
-
const n = M(e._zod.def, {
|
|
239
|
-
get shape() {
|
|
240
|
-
const o = { ...e._zod.def.shape, ...t };
|
|
241
|
-
return B(this, "shape", o), o;
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
return J(e, n);
|
|
245
|
-
}
|
|
246
|
-
function Dt(e, t) {
|
|
247
|
-
const n = M(e._zod.def, {
|
|
248
|
-
get shape() {
|
|
249
|
-
const o = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
250
|
-
return B(this, "shape", o), o;
|
|
251
|
-
},
|
|
252
|
-
get catchall() {
|
|
253
|
-
return t._zod.def.catchall;
|
|
254
|
-
},
|
|
255
|
-
checks: []
|
|
256
|
-
// delete existing checks
|
|
257
|
-
});
|
|
258
|
-
return J(e, n);
|
|
259
|
-
}
|
|
260
|
-
function xt(e, t, n) {
|
|
261
|
-
const r = t._zod.def.checks;
|
|
262
|
-
if (r && r.length > 0)
|
|
263
|
-
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
264
|
-
const i = M(t._zod.def, {
|
|
265
|
-
get shape() {
|
|
266
|
-
const a = t._zod.def.shape, u = { ...a };
|
|
267
|
-
if (n)
|
|
268
|
-
for (const l in n) {
|
|
269
|
-
if (!(l in a))
|
|
270
|
-
throw new Error(`Unrecognized key: "${l}"`);
|
|
271
|
-
n[l] && (u[l] = e ? new e({
|
|
272
|
-
type: "optional",
|
|
273
|
-
innerType: a[l]
|
|
274
|
-
}) : a[l]);
|
|
275
|
-
}
|
|
276
|
-
else
|
|
277
|
-
for (const l in a)
|
|
278
|
-
u[l] = e ? new e({
|
|
279
|
-
type: "optional",
|
|
280
|
-
innerType: a[l]
|
|
281
|
-
}) : a[l];
|
|
282
|
-
return B(this, "shape", u), u;
|
|
283
|
-
},
|
|
284
|
-
checks: []
|
|
285
|
-
});
|
|
286
|
-
return J(t, i);
|
|
287
|
-
}
|
|
288
|
-
function Ft(e, t, n) {
|
|
289
|
-
const o = M(t._zod.def, {
|
|
290
|
-
get shape() {
|
|
291
|
-
const r = t._zod.def.shape, s = { ...r };
|
|
292
|
-
if (n)
|
|
293
|
-
for (const i in n) {
|
|
294
|
-
if (!(i in s))
|
|
295
|
-
throw new Error(`Unrecognized key: "${i}"`);
|
|
296
|
-
n[i] && (s[i] = new e({
|
|
297
|
-
type: "nonoptional",
|
|
298
|
-
innerType: r[i]
|
|
299
|
-
}));
|
|
300
|
-
}
|
|
301
|
-
else
|
|
302
|
-
for (const i in r)
|
|
303
|
-
s[i] = new e({
|
|
304
|
-
type: "nonoptional",
|
|
305
|
-
innerType: r[i]
|
|
306
|
-
});
|
|
307
|
-
return B(this, "shape", s), s;
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
return J(t, o);
|
|
311
|
-
}
|
|
312
|
-
function W(e, t = 0) {
|
|
313
|
-
if (e.aborted === !0)
|
|
314
|
-
return !0;
|
|
315
|
-
for (let n = t; n < e.issues.length; n++)
|
|
316
|
-
if (e.issues[n]?.continue !== !0)
|
|
317
|
-
return !0;
|
|
318
|
-
return !1;
|
|
319
|
-
}
|
|
320
|
-
function V(e, t) {
|
|
321
|
-
return t.map((n) => {
|
|
322
|
-
var o;
|
|
323
|
-
return (o = n).path ?? (o.path = []), n.path.unshift(e), n;
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
function te(e) {
|
|
327
|
-
return typeof e == "string" ? e : e?.message;
|
|
328
|
-
}
|
|
329
|
-
function U(e, t, n) {
|
|
330
|
-
const o = { ...e, path: e.path ?? [] };
|
|
331
|
-
if (!e.message) {
|
|
332
|
-
const r = te(e.inst?._zod.def?.error?.(e)) ?? te(t?.error?.(e)) ?? te(n.customError?.(e)) ?? te(n.localeError?.(e)) ?? "Invalid input";
|
|
333
|
-
o.message = r;
|
|
334
|
-
}
|
|
335
|
-
return delete o.inst, delete o.continue, t?.reportInput || delete o.input, o;
|
|
336
|
-
}
|
|
337
|
-
function we(e) {
|
|
338
|
-
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
339
|
-
}
|
|
340
|
-
function Q(...e) {
|
|
341
|
-
const [t, n, o] = e;
|
|
342
|
-
return typeof t == "string" ? {
|
|
343
|
-
message: t,
|
|
344
|
-
code: "custom",
|
|
345
|
-
input: n,
|
|
346
|
-
inst: o
|
|
347
|
-
} : { ...t };
|
|
348
|
-
}
|
|
349
|
-
const He = (e, t) => {
|
|
350
|
-
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
351
|
-
value: e._zod,
|
|
352
|
-
enumerable: !1
|
|
353
|
-
}), Object.defineProperty(e, "issues", {
|
|
354
|
-
value: t,
|
|
355
|
-
enumerable: !1
|
|
356
|
-
}), e.message = JSON.stringify(t, ge, 2), Object.defineProperty(e, "toString", {
|
|
357
|
-
value: () => e.message,
|
|
358
|
-
enumerable: !1
|
|
359
|
-
});
|
|
360
|
-
}, Qe = p("$ZodError", He), et = p("$ZodError", He, { Parent: Error });
|
|
361
|
-
function Ut(e, t = (n) => n.message) {
|
|
362
|
-
const n = {}, o = [];
|
|
363
|
-
for (const r of e.issues)
|
|
364
|
-
r.path.length > 0 ? (n[r.path[0]] = n[r.path[0]] || [], n[r.path[0]].push(t(r))) : o.push(t(r));
|
|
365
|
-
return { formErrors: o, fieldErrors: n };
|
|
366
|
-
}
|
|
367
|
-
function Lt(e, t = (n) => n.message) {
|
|
368
|
-
const n = { _errors: [] }, o = (r) => {
|
|
369
|
-
for (const s of r.issues)
|
|
370
|
-
if (s.code === "invalid_union" && s.errors.length)
|
|
371
|
-
s.errors.map((i) => o({ issues: i }));
|
|
372
|
-
else if (s.code === "invalid_key")
|
|
373
|
-
o({ issues: s.issues });
|
|
374
|
-
else if (s.code === "invalid_element")
|
|
375
|
-
o({ issues: s.issues });
|
|
376
|
-
else if (s.path.length === 0)
|
|
377
|
-
n._errors.push(t(s));
|
|
378
|
-
else {
|
|
379
|
-
let i = n, a = 0;
|
|
380
|
-
for (; a < s.path.length; ) {
|
|
381
|
-
const u = s.path[a];
|
|
382
|
-
a === s.path.length - 1 ? (i[u] = i[u] || { _errors: [] }, i[u]._errors.push(t(s))) : i[u] = i[u] || { _errors: [] }, i = i[u], a++;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
return o(e), n;
|
|
387
|
-
}
|
|
388
|
-
const ke = (e) => (t, n, o, r) => {
|
|
389
|
-
const s = o ? Object.assign(o, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
|
|
390
|
-
if (i instanceof Promise)
|
|
391
|
-
throw new G();
|
|
392
|
-
if (i.issues.length) {
|
|
393
|
-
const a = new (r?.Err ?? e)(i.issues.map((u) => U(u, s, F())));
|
|
394
|
-
throw Ye(a, r?.callee), a;
|
|
395
|
-
}
|
|
396
|
-
return i.value;
|
|
397
|
-
}, $e = (e) => async (t, n, o, r) => {
|
|
398
|
-
const s = o ? Object.assign(o, { async: !0 }) : { async: !0 };
|
|
399
|
-
let i = t._zod.run({ value: n, issues: [] }, s);
|
|
400
|
-
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
401
|
-
const a = new (r?.Err ?? e)(i.issues.map((u) => U(u, s, F())));
|
|
402
|
-
throw Ye(a, r?.callee), a;
|
|
403
|
-
}
|
|
404
|
-
return i.value;
|
|
405
|
-
}, pe = (e) => (t, n, o) => {
|
|
406
|
-
const r = o ? { ...o, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, r);
|
|
407
|
-
if (s instanceof Promise)
|
|
408
|
-
throw new G();
|
|
409
|
-
return s.issues.length ? {
|
|
410
|
-
success: !1,
|
|
411
|
-
error: new (e ?? Qe)(s.issues.map((i) => U(i, r, F())))
|
|
412
|
-
} : { success: !0, data: s.value };
|
|
413
|
-
}, Mt = /* @__PURE__ */ pe(et), fe = (e) => async (t, n, o) => {
|
|
414
|
-
const r = o ? Object.assign(o, { async: !0 }) : { async: !0 };
|
|
415
|
-
let s = t._zod.run({ value: n, issues: [] }, r);
|
|
416
|
-
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
417
|
-
success: !1,
|
|
418
|
-
error: new e(s.issues.map((i) => U(i, r, F())))
|
|
419
|
-
} : { success: !0, data: s.value };
|
|
420
|
-
}, Jt = /* @__PURE__ */ fe(et), Vt = (e) => (t, n, o) => {
|
|
421
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
422
|
-
return ke(e)(t, n, r);
|
|
423
|
-
}, Bt = (e) => (t, n, o) => ke(e)(t, n, o), Kt = (e) => async (t, n, o) => {
|
|
424
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
425
|
-
return $e(e)(t, n, r);
|
|
426
|
-
}, Wt = (e) => async (t, n, o) => $e(e)(t, n, o), Gt = (e) => (t, n, o) => {
|
|
427
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
428
|
-
return pe(e)(t, n, r);
|
|
429
|
-
}, qt = (e) => (t, n, o) => pe(e)(t, n, o), Yt = (e) => async (t, n, o) => {
|
|
430
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
431
|
-
return fe(e)(t, n, r);
|
|
432
|
-
}, Xt = (e) => async (t, n, o) => fe(e)(t, n, o), Ht = /^[cC][^\s-]{8,}$/, Qt = /^[0-9a-z]+$/, en = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, tn = /^[0-9a-vA-V]{20}$/, nn = /^[A-Za-z0-9]{27}$/, on = /^[a-zA-Z0-9_-]{21}$/, rn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, sn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Oe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, an = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, cn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
433
|
-
function un() {
|
|
434
|
-
return new RegExp(cn, "u");
|
|
435
|
-
}
|
|
436
|
-
const ln = /^(?:(?: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])$/, pn = /^(([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}|:))$/, fn = /^((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])$/, dn = /^(([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])$/, hn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, tt = /^[A-Za-z0-9_-]*$/, mn = /^\+[1-9]\d{6,14}$/, nt = "(?:(?:\\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])))", gn = /* @__PURE__ */ new RegExp(`^${nt}$`);
|
|
437
|
-
function ot(e) {
|
|
438
|
-
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
439
|
-
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
440
|
-
}
|
|
441
|
-
function _n(e) {
|
|
442
|
-
return new RegExp(`^${ot(e)}$`);
|
|
443
|
-
}
|
|
444
|
-
function vn(e) {
|
|
445
|
-
const t = ot({ precision: e.precision }), n = ["Z"];
|
|
446
|
-
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
447
|
-
const o = `${t}(?:${n.join("|")})`;
|
|
448
|
-
return new RegExp(`^${nt}T(?:${o})$`);
|
|
449
|
-
}
|
|
450
|
-
const bn = (e) => {
|
|
451
|
-
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
452
|
-
return new RegExp(`^${t}$`);
|
|
453
|
-
}, yn = /^-?\d+$/, rt = /^-?\d+(?:\.\d+)?$/, zn = /^(?:true|false)$/i, wn = /^null$/i, kn = /^[^A-Z]*$/, $n = /^[^a-z]*$/, A = /* @__PURE__ */ p("$ZodCheck", (e, t) => {
|
|
454
|
-
var n;
|
|
455
|
-
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
456
|
-
}), it = {
|
|
457
|
-
number: "number",
|
|
458
|
-
bigint: "bigint",
|
|
459
|
-
object: "date"
|
|
460
|
-
}, st = /* @__PURE__ */ p("$ZodCheckLessThan", (e, t) => {
|
|
461
|
-
A.init(e, t);
|
|
462
|
-
const n = it[typeof t.value];
|
|
463
|
-
e._zod.onattach.push((o) => {
|
|
464
|
-
const r = o._zod.bag, s = (t.inclusive ? r.maximum : r.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
465
|
-
t.value < s && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value);
|
|
466
|
-
}), e._zod.check = (o) => {
|
|
467
|
-
(t.inclusive ? o.value <= t.value : o.value < t.value) || o.issues.push({
|
|
468
|
-
origin: n,
|
|
469
|
-
code: "too_big",
|
|
470
|
-
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
471
|
-
input: o.value,
|
|
472
|
-
inclusive: t.inclusive,
|
|
473
|
-
inst: e,
|
|
474
|
-
continue: !t.abort
|
|
475
|
-
});
|
|
476
|
-
};
|
|
477
|
-
}), at = /* @__PURE__ */ p("$ZodCheckGreaterThan", (e, t) => {
|
|
478
|
-
A.init(e, t);
|
|
479
|
-
const n = it[typeof t.value];
|
|
480
|
-
e._zod.onattach.push((o) => {
|
|
481
|
-
const r = o._zod.bag, s = (t.inclusive ? r.minimum : r.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
482
|
-
t.value > s && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value);
|
|
483
|
-
}), e._zod.check = (o) => {
|
|
484
|
-
(t.inclusive ? o.value >= t.value : o.value > t.value) || o.issues.push({
|
|
485
|
-
origin: n,
|
|
486
|
-
code: "too_small",
|
|
487
|
-
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
488
|
-
input: o.value,
|
|
489
|
-
inclusive: t.inclusive,
|
|
490
|
-
inst: e,
|
|
491
|
-
continue: !t.abort
|
|
492
|
-
});
|
|
493
|
-
};
|
|
494
|
-
}), Zn = /* @__PURE__ */ p("$ZodCheckMultipleOf", (e, t) => {
|
|
495
|
-
A.init(e, t), e._zod.onattach.push((n) => {
|
|
496
|
-
var o;
|
|
497
|
-
(o = n._zod.bag).multipleOf ?? (o.multipleOf = t.value);
|
|
498
|
-
}), e._zod.check = (n) => {
|
|
499
|
-
if (typeof n.value != typeof t.value)
|
|
500
|
-
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
501
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : Pt(n.value, t.value) === 0) || n.issues.push({
|
|
502
|
-
origin: typeof n.value,
|
|
503
|
-
code: "not_multiple_of",
|
|
504
|
-
divisor: t.value,
|
|
505
|
-
input: n.value,
|
|
506
|
-
inst: e,
|
|
507
|
-
continue: !t.abort
|
|
508
|
-
});
|
|
509
|
-
};
|
|
510
|
-
}), Sn = /* @__PURE__ */ p("$ZodCheckNumberFormat", (e, t) => {
|
|
511
|
-
A.init(e, t), t.format = t.format || "float64";
|
|
512
|
-
const n = t.format?.includes("int"), o = n ? "int" : "number", [r, s] = Et[t.format];
|
|
513
|
-
e._zod.onattach.push((i) => {
|
|
514
|
-
const a = i._zod.bag;
|
|
515
|
-
a.format = t.format, a.minimum = r, a.maximum = s, n && (a.pattern = yn);
|
|
516
|
-
}), e._zod.check = (i) => {
|
|
517
|
-
const a = i.value;
|
|
518
|
-
if (n) {
|
|
519
|
-
if (!Number.isInteger(a)) {
|
|
520
|
-
i.issues.push({
|
|
521
|
-
expected: o,
|
|
522
|
-
format: t.format,
|
|
523
|
-
code: "invalid_type",
|
|
524
|
-
continue: !1,
|
|
525
|
-
input: a,
|
|
526
|
-
inst: e
|
|
527
|
-
});
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
if (!Number.isSafeInteger(a)) {
|
|
531
|
-
a > 0 ? i.issues.push({
|
|
532
|
-
input: a,
|
|
533
|
-
code: "too_big",
|
|
534
|
-
maximum: Number.MAX_SAFE_INTEGER,
|
|
535
|
-
note: "Integers must be within the safe integer range.",
|
|
536
|
-
inst: e,
|
|
537
|
-
origin: o,
|
|
538
|
-
inclusive: !0,
|
|
539
|
-
continue: !t.abort
|
|
540
|
-
}) : i.issues.push({
|
|
541
|
-
input: a,
|
|
542
|
-
code: "too_small",
|
|
543
|
-
minimum: Number.MIN_SAFE_INTEGER,
|
|
544
|
-
note: "Integers must be within the safe integer range.",
|
|
545
|
-
inst: e,
|
|
546
|
-
origin: o,
|
|
547
|
-
inclusive: !0,
|
|
548
|
-
continue: !t.abort
|
|
549
|
-
});
|
|
550
|
-
return;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
a < r && i.issues.push({
|
|
554
|
-
origin: "number",
|
|
555
|
-
input: a,
|
|
556
|
-
code: "too_small",
|
|
557
|
-
minimum: r,
|
|
558
|
-
inclusive: !0,
|
|
559
|
-
inst: e,
|
|
560
|
-
continue: !t.abort
|
|
561
|
-
}), a > s && i.issues.push({
|
|
562
|
-
origin: "number",
|
|
563
|
-
input: a,
|
|
564
|
-
code: "too_big",
|
|
565
|
-
maximum: s,
|
|
566
|
-
inclusive: !0,
|
|
567
|
-
inst: e,
|
|
568
|
-
continue: !t.abort
|
|
569
|
-
});
|
|
570
|
-
};
|
|
571
|
-
}), Pn = /* @__PURE__ */ p("$ZodCheckMaxLength", (e, t) => {
|
|
572
|
-
var n;
|
|
573
|
-
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
574
|
-
const r = o.value;
|
|
575
|
-
return !ye(r) && r.length !== void 0;
|
|
576
|
-
}), e._zod.onattach.push((o) => {
|
|
577
|
-
const r = o._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
578
|
-
t.maximum < r && (o._zod.bag.maximum = t.maximum);
|
|
579
|
-
}), e._zod.check = (o) => {
|
|
580
|
-
const r = o.value;
|
|
581
|
-
if (r.length <= t.maximum)
|
|
582
|
-
return;
|
|
583
|
-
const i = we(r);
|
|
584
|
-
o.issues.push({
|
|
585
|
-
origin: i,
|
|
586
|
-
code: "too_big",
|
|
587
|
-
maximum: t.maximum,
|
|
588
|
-
inclusive: !0,
|
|
589
|
-
input: r,
|
|
590
|
-
inst: e,
|
|
591
|
-
continue: !t.abort
|
|
592
|
-
});
|
|
593
|
-
};
|
|
594
|
-
}), On = /* @__PURE__ */ p("$ZodCheckMinLength", (e, t) => {
|
|
595
|
-
var n;
|
|
596
|
-
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
597
|
-
const r = o.value;
|
|
598
|
-
return !ye(r) && r.length !== void 0;
|
|
599
|
-
}), e._zod.onattach.push((o) => {
|
|
600
|
-
const r = o._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
601
|
-
t.minimum > r && (o._zod.bag.minimum = t.minimum);
|
|
602
|
-
}), e._zod.check = (o) => {
|
|
603
|
-
const r = o.value;
|
|
604
|
-
if (r.length >= t.minimum)
|
|
605
|
-
return;
|
|
606
|
-
const i = we(r);
|
|
607
|
-
o.issues.push({
|
|
608
|
-
origin: i,
|
|
609
|
-
code: "too_small",
|
|
610
|
-
minimum: t.minimum,
|
|
611
|
-
inclusive: !0,
|
|
612
|
-
input: r,
|
|
613
|
-
inst: e,
|
|
614
|
-
continue: !t.abort
|
|
615
|
-
});
|
|
616
|
-
};
|
|
617
|
-
}), Tn = /* @__PURE__ */ p("$ZodCheckLengthEquals", (e, t) => {
|
|
618
|
-
var n;
|
|
619
|
-
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
620
|
-
const r = o.value;
|
|
621
|
-
return !ye(r) && r.length !== void 0;
|
|
622
|
-
}), e._zod.onattach.push((o) => {
|
|
623
|
-
const r = o._zod.bag;
|
|
624
|
-
r.minimum = t.length, r.maximum = t.length, r.length = t.length;
|
|
625
|
-
}), e._zod.check = (o) => {
|
|
626
|
-
const r = o.value, s = r.length;
|
|
627
|
-
if (s === t.length)
|
|
628
|
-
return;
|
|
629
|
-
const i = we(r), a = s > t.length;
|
|
630
|
-
o.issues.push({
|
|
631
|
-
origin: i,
|
|
632
|
-
...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
633
|
-
inclusive: !0,
|
|
634
|
-
exact: !0,
|
|
635
|
-
input: o.value,
|
|
636
|
-
inst: e,
|
|
637
|
-
continue: !t.abort
|
|
638
|
-
});
|
|
639
|
-
};
|
|
640
|
-
}), de = /* @__PURE__ */ p("$ZodCheckStringFormat", (e, t) => {
|
|
641
|
-
var n, o;
|
|
642
|
-
A.init(e, t), e._zod.onattach.push((r) => {
|
|
643
|
-
const s = r._zod.bag;
|
|
644
|
-
s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
|
|
645
|
-
}), t.pattern ? (n = e._zod).check ?? (n.check = (r) => {
|
|
646
|
-
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
647
|
-
origin: "string",
|
|
648
|
-
code: "invalid_format",
|
|
649
|
-
format: t.format,
|
|
650
|
-
input: r.value,
|
|
651
|
-
...t.pattern ? { pattern: t.pattern.toString() } : {},
|
|
652
|
-
inst: e,
|
|
653
|
-
continue: !t.abort
|
|
654
|
-
});
|
|
655
|
-
}) : (o = e._zod).check ?? (o.check = () => {
|
|
656
|
-
});
|
|
657
|
-
}), In = /* @__PURE__ */ p("$ZodCheckRegex", (e, t) => {
|
|
658
|
-
de.init(e, t), e._zod.check = (n) => {
|
|
659
|
-
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
660
|
-
origin: "string",
|
|
661
|
-
code: "invalid_format",
|
|
662
|
-
format: "regex",
|
|
663
|
-
input: n.value,
|
|
664
|
-
pattern: t.pattern.toString(),
|
|
665
|
-
inst: e,
|
|
666
|
-
continue: !t.abort
|
|
667
|
-
});
|
|
668
|
-
};
|
|
669
|
-
}), Nn = /* @__PURE__ */ p("$ZodCheckLowerCase", (e, t) => {
|
|
670
|
-
t.pattern ?? (t.pattern = kn), de.init(e, t);
|
|
671
|
-
}), En = /* @__PURE__ */ p("$ZodCheckUpperCase", (e, t) => {
|
|
672
|
-
t.pattern ?? (t.pattern = $n), de.init(e, t);
|
|
673
|
-
}), Cn = /* @__PURE__ */ p("$ZodCheckIncludes", (e, t) => {
|
|
674
|
-
A.init(e, t);
|
|
675
|
-
const n = le(t.includes), o = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
676
|
-
t.pattern = o, e._zod.onattach.push((r) => {
|
|
677
|
-
const s = r._zod.bag;
|
|
678
|
-
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(o);
|
|
679
|
-
}), e._zod.check = (r) => {
|
|
680
|
-
r.value.includes(t.includes, t.position) || r.issues.push({
|
|
681
|
-
origin: "string",
|
|
682
|
-
code: "invalid_format",
|
|
683
|
-
format: "includes",
|
|
684
|
-
includes: t.includes,
|
|
685
|
-
input: r.value,
|
|
686
|
-
inst: e,
|
|
687
|
-
continue: !t.abort
|
|
688
|
-
});
|
|
689
|
-
};
|
|
690
|
-
}), jn = /* @__PURE__ */ p("$ZodCheckStartsWith", (e, t) => {
|
|
691
|
-
A.init(e, t);
|
|
692
|
-
const n = new RegExp(`^${le(t.prefix)}.*`);
|
|
693
|
-
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
694
|
-
const r = o._zod.bag;
|
|
695
|
-
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
|
|
696
|
-
}), e._zod.check = (o) => {
|
|
697
|
-
o.value.startsWith(t.prefix) || o.issues.push({
|
|
698
|
-
origin: "string",
|
|
699
|
-
code: "invalid_format",
|
|
700
|
-
format: "starts_with",
|
|
701
|
-
prefix: t.prefix,
|
|
702
|
-
input: o.value,
|
|
703
|
-
inst: e,
|
|
704
|
-
continue: !t.abort
|
|
705
|
-
});
|
|
706
|
-
};
|
|
707
|
-
}), An = /* @__PURE__ */ p("$ZodCheckEndsWith", (e, t) => {
|
|
708
|
-
A.init(e, t);
|
|
709
|
-
const n = new RegExp(`.*${le(t.suffix)}$`);
|
|
710
|
-
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
711
|
-
const r = o._zod.bag;
|
|
712
|
-
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
|
|
713
|
-
}), e._zod.check = (o) => {
|
|
714
|
-
o.value.endsWith(t.suffix) || o.issues.push({
|
|
715
|
-
origin: "string",
|
|
716
|
-
code: "invalid_format",
|
|
717
|
-
format: "ends_with",
|
|
718
|
-
suffix: t.suffix,
|
|
719
|
-
input: o.value,
|
|
720
|
-
inst: e,
|
|
721
|
-
continue: !t.abort
|
|
722
|
-
});
|
|
723
|
-
};
|
|
724
|
-
}), Rn = /* @__PURE__ */ p("$ZodCheckOverwrite", (e, t) => {
|
|
725
|
-
A.init(e, t), e._zod.check = (n) => {
|
|
726
|
-
n.value = t.tx(n.value);
|
|
727
|
-
};
|
|
728
|
-
});
|
|
729
|
-
class Dn {
|
|
730
|
-
constructor(t = []) {
|
|
731
|
-
this.content = [], this.indent = 0, this && (this.args = t);
|
|
732
|
-
}
|
|
733
|
-
indented(t) {
|
|
734
|
-
this.indent += 1, t(this), this.indent -= 1;
|
|
735
|
-
}
|
|
736
|
-
write(t) {
|
|
737
|
-
if (typeof t == "function") {
|
|
738
|
-
t(this, { execution: "sync" }), t(this, { execution: "async" });
|
|
739
|
-
return;
|
|
740
|
-
}
|
|
741
|
-
const o = t.split(`
|
|
742
|
-
`).filter((i) => i), r = Math.min(...o.map((i) => i.length - i.trimStart().length)), s = o.map((i) => i.slice(r)).map((i) => " ".repeat(this.indent * 2) + i);
|
|
743
|
-
for (const i of s)
|
|
744
|
-
this.content.push(i);
|
|
745
|
-
}
|
|
746
|
-
compile() {
|
|
747
|
-
const t = Function, n = this?.args, r = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
|
|
748
|
-
return new t(...n, r.join(`
|
|
749
|
-
`));
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
const xn = {
|
|
753
|
-
major: 4,
|
|
754
|
-
minor: 3,
|
|
755
|
-
patch: 6
|
|
756
|
-
}, S = /* @__PURE__ */ p("$ZodType", (e, t) => {
|
|
757
|
-
var n;
|
|
758
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = xn;
|
|
759
|
-
const o = [...e._zod.def.checks ?? []];
|
|
760
|
-
e._zod.traits.has("$ZodCheck") && o.unshift(e);
|
|
761
|
-
for (const r of o)
|
|
762
|
-
for (const s of r._zod.onattach)
|
|
763
|
-
s(e);
|
|
764
|
-
if (o.length === 0)
|
|
765
|
-
(n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
|
|
766
|
-
e._zod.run = e._zod.parse;
|
|
767
|
-
});
|
|
768
|
-
else {
|
|
769
|
-
const r = (i, a, u) => {
|
|
770
|
-
let l = W(i), f;
|
|
771
|
-
for (const h of a) {
|
|
772
|
-
if (h._zod.def.when) {
|
|
773
|
-
if (!h._zod.def.when(i))
|
|
774
|
-
continue;
|
|
775
|
-
} else if (l)
|
|
776
|
-
continue;
|
|
777
|
-
const b = i.issues.length, w = h._zod.check(i);
|
|
778
|
-
if (w instanceof Promise && u?.async === !1)
|
|
779
|
-
throw new G();
|
|
780
|
-
if (f || w instanceof Promise)
|
|
781
|
-
f = (f ?? Promise.resolve()).then(async () => {
|
|
782
|
-
await w, i.issues.length !== b && (l || (l = W(i, b)));
|
|
783
|
-
});
|
|
784
|
-
else {
|
|
785
|
-
if (i.issues.length === b)
|
|
786
|
-
continue;
|
|
787
|
-
l || (l = W(i, b));
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
return f ? f.then(() => i) : i;
|
|
791
|
-
}, s = (i, a, u) => {
|
|
792
|
-
if (W(i))
|
|
793
|
-
return i.aborted = !0, i;
|
|
794
|
-
const l = r(a, o, u);
|
|
795
|
-
if (l instanceof Promise) {
|
|
796
|
-
if (u.async === !1)
|
|
797
|
-
throw new G();
|
|
798
|
-
return l.then((f) => e._zod.parse(f, u));
|
|
799
|
-
}
|
|
800
|
-
return e._zod.parse(l, u);
|
|
801
|
-
};
|
|
802
|
-
e._zod.run = (i, a) => {
|
|
803
|
-
if (a.skipChecks)
|
|
804
|
-
return e._zod.parse(i, a);
|
|
805
|
-
if (a.direction === "backward") {
|
|
806
|
-
const l = e._zod.parse({ value: i.value, issues: [] }, { ...a, skipChecks: !0 });
|
|
807
|
-
return l instanceof Promise ? l.then((f) => s(f, i, a)) : s(l, i, a);
|
|
808
|
-
}
|
|
809
|
-
const u = e._zod.parse(i, a);
|
|
810
|
-
if (u instanceof Promise) {
|
|
811
|
-
if (a.async === !1)
|
|
812
|
-
throw new G();
|
|
813
|
-
return u.then((l) => r(l, o, a));
|
|
814
|
-
}
|
|
815
|
-
return r(u, o, a);
|
|
816
|
-
};
|
|
817
|
-
}
|
|
818
|
-
$(e, "~standard", () => ({
|
|
819
|
-
validate: (r) => {
|
|
820
|
-
try {
|
|
821
|
-
const s = Mt(e, r);
|
|
822
|
-
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
823
|
-
} catch {
|
|
824
|
-
return Jt(e, r).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
825
|
-
}
|
|
826
|
-
},
|
|
827
|
-
vendor: "zod",
|
|
828
|
-
version: 1
|
|
829
|
-
}));
|
|
830
|
-
}), Ze = /* @__PURE__ */ p("$ZodString", (e, t) => {
|
|
831
|
-
S.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? bn(e._zod.bag), e._zod.parse = (n, o) => {
|
|
832
|
-
if (t.coerce)
|
|
833
|
-
try {
|
|
834
|
-
n.value = String(n.value);
|
|
835
|
-
} catch {
|
|
836
|
-
}
|
|
837
|
-
return typeof n.value == "string" || n.issues.push({
|
|
838
|
-
expected: "string",
|
|
839
|
-
code: "invalid_type",
|
|
840
|
-
input: n.value,
|
|
841
|
-
inst: e
|
|
842
|
-
}), n;
|
|
843
|
-
};
|
|
844
|
-
}), O = /* @__PURE__ */ p("$ZodStringFormat", (e, t) => {
|
|
845
|
-
de.init(e, t), Ze.init(e, t);
|
|
846
|
-
}), Fn = /* @__PURE__ */ p("$ZodGUID", (e, t) => {
|
|
847
|
-
t.pattern ?? (t.pattern = sn), O.init(e, t);
|
|
848
|
-
}), Un = /* @__PURE__ */ p("$ZodUUID", (e, t) => {
|
|
849
|
-
if (t.version) {
|
|
850
|
-
const o = {
|
|
851
|
-
v1: 1,
|
|
852
|
-
v2: 2,
|
|
853
|
-
v3: 3,
|
|
854
|
-
v4: 4,
|
|
855
|
-
v5: 5,
|
|
856
|
-
v6: 6,
|
|
857
|
-
v7: 7,
|
|
858
|
-
v8: 8
|
|
859
|
-
}[t.version];
|
|
860
|
-
if (o === void 0)
|
|
861
|
-
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
862
|
-
t.pattern ?? (t.pattern = Oe(o));
|
|
863
|
-
} else
|
|
864
|
-
t.pattern ?? (t.pattern = Oe());
|
|
865
|
-
O.init(e, t);
|
|
866
|
-
}), Ln = /* @__PURE__ */ p("$ZodEmail", (e, t) => {
|
|
867
|
-
t.pattern ?? (t.pattern = an), O.init(e, t);
|
|
868
|
-
}), Mn = /* @__PURE__ */ p("$ZodURL", (e, t) => {
|
|
869
|
-
O.init(e, t), e._zod.check = (n) => {
|
|
870
|
-
try {
|
|
871
|
-
const o = n.value.trim(), r = new URL(o);
|
|
872
|
-
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(r.hostname) || n.issues.push({
|
|
873
|
-
code: "invalid_format",
|
|
874
|
-
format: "url",
|
|
875
|
-
note: "Invalid hostname",
|
|
876
|
-
pattern: t.hostname.source,
|
|
877
|
-
input: n.value,
|
|
878
|
-
inst: e,
|
|
879
|
-
continue: !t.abort
|
|
880
|
-
})), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(r.protocol.endsWith(":") ? r.protocol.slice(0, -1) : r.protocol) || n.issues.push({
|
|
881
|
-
code: "invalid_format",
|
|
882
|
-
format: "url",
|
|
883
|
-
note: "Invalid protocol",
|
|
884
|
-
pattern: t.protocol.source,
|
|
885
|
-
input: n.value,
|
|
886
|
-
inst: e,
|
|
887
|
-
continue: !t.abort
|
|
888
|
-
})), t.normalize ? n.value = r.href : n.value = o;
|
|
889
|
-
return;
|
|
890
|
-
} catch {
|
|
891
|
-
n.issues.push({
|
|
892
|
-
code: "invalid_format",
|
|
893
|
-
format: "url",
|
|
894
|
-
input: n.value,
|
|
895
|
-
inst: e,
|
|
896
|
-
continue: !t.abort
|
|
897
|
-
});
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
}), Jn = /* @__PURE__ */ p("$ZodEmoji", (e, t) => {
|
|
901
|
-
t.pattern ?? (t.pattern = un()), O.init(e, t);
|
|
902
|
-
}), Vn = /* @__PURE__ */ p("$ZodNanoID", (e, t) => {
|
|
903
|
-
t.pattern ?? (t.pattern = on), O.init(e, t);
|
|
904
|
-
}), Bn = /* @__PURE__ */ p("$ZodCUID", (e, t) => {
|
|
905
|
-
t.pattern ?? (t.pattern = Ht), O.init(e, t);
|
|
906
|
-
}), Kn = /* @__PURE__ */ p("$ZodCUID2", (e, t) => {
|
|
907
|
-
t.pattern ?? (t.pattern = Qt), O.init(e, t);
|
|
908
|
-
}), Wn = /* @__PURE__ */ p("$ZodULID", (e, t) => {
|
|
909
|
-
t.pattern ?? (t.pattern = en), O.init(e, t);
|
|
910
|
-
}), Gn = /* @__PURE__ */ p("$ZodXID", (e, t) => {
|
|
911
|
-
t.pattern ?? (t.pattern = tn), O.init(e, t);
|
|
912
|
-
}), qn = /* @__PURE__ */ p("$ZodKSUID", (e, t) => {
|
|
913
|
-
t.pattern ?? (t.pattern = nn), O.init(e, t);
|
|
914
|
-
}), Yn = /* @__PURE__ */ p("$ZodISODateTime", (e, t) => {
|
|
915
|
-
t.pattern ?? (t.pattern = vn(t)), O.init(e, t);
|
|
916
|
-
}), Xn = /* @__PURE__ */ p("$ZodISODate", (e, t) => {
|
|
917
|
-
t.pattern ?? (t.pattern = gn), O.init(e, t);
|
|
918
|
-
}), Hn = /* @__PURE__ */ p("$ZodISOTime", (e, t) => {
|
|
919
|
-
t.pattern ?? (t.pattern = _n(t)), O.init(e, t);
|
|
920
|
-
}), Qn = /* @__PURE__ */ p("$ZodISODuration", (e, t) => {
|
|
921
|
-
t.pattern ?? (t.pattern = rn), O.init(e, t);
|
|
922
|
-
}), eo = /* @__PURE__ */ p("$ZodIPv4", (e, t) => {
|
|
923
|
-
t.pattern ?? (t.pattern = ln), O.init(e, t), e._zod.bag.format = "ipv4";
|
|
924
|
-
}), to = /* @__PURE__ */ p("$ZodIPv6", (e, t) => {
|
|
925
|
-
t.pattern ?? (t.pattern = pn), O.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
926
|
-
try {
|
|
927
|
-
new URL(`http://[${n.value}]`);
|
|
928
|
-
} catch {
|
|
929
|
-
n.issues.push({
|
|
930
|
-
code: "invalid_format",
|
|
931
|
-
format: "ipv6",
|
|
932
|
-
input: n.value,
|
|
933
|
-
inst: e,
|
|
934
|
-
continue: !t.abort
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
};
|
|
938
|
-
}), no = /* @__PURE__ */ p("$ZodCIDRv4", (e, t) => {
|
|
939
|
-
t.pattern ?? (t.pattern = fn), O.init(e, t);
|
|
940
|
-
}), oo = /* @__PURE__ */ p("$ZodCIDRv6", (e, t) => {
|
|
941
|
-
t.pattern ?? (t.pattern = dn), O.init(e, t), e._zod.check = (n) => {
|
|
942
|
-
const o = n.value.split("/");
|
|
943
|
-
try {
|
|
944
|
-
if (o.length !== 2)
|
|
945
|
-
throw new Error();
|
|
946
|
-
const [r, s] = o;
|
|
947
|
-
if (!s)
|
|
948
|
-
throw new Error();
|
|
949
|
-
const i = Number(s);
|
|
950
|
-
if (`${i}` !== s)
|
|
951
|
-
throw new Error();
|
|
952
|
-
if (i < 0 || i > 128)
|
|
953
|
-
throw new Error();
|
|
954
|
-
new URL(`http://[${r}]`);
|
|
955
|
-
} catch {
|
|
956
|
-
n.issues.push({
|
|
957
|
-
code: "invalid_format",
|
|
958
|
-
format: "cidrv6",
|
|
959
|
-
input: n.value,
|
|
960
|
-
inst: e,
|
|
961
|
-
continue: !t.abort
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
};
|
|
965
|
-
});
|
|
966
|
-
function ct(e) {
|
|
967
|
-
if (e === "")
|
|
968
|
-
return !0;
|
|
969
|
-
if (e.length % 4 !== 0)
|
|
970
|
-
return !1;
|
|
971
|
-
try {
|
|
972
|
-
return atob(e), !0;
|
|
973
|
-
} catch {
|
|
974
|
-
return !1;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
const ro = /* @__PURE__ */ p("$ZodBase64", (e, t) => {
|
|
978
|
-
t.pattern ?? (t.pattern = hn), O.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
979
|
-
ct(n.value) || n.issues.push({
|
|
980
|
-
code: "invalid_format",
|
|
981
|
-
format: "base64",
|
|
982
|
-
input: n.value,
|
|
983
|
-
inst: e,
|
|
984
|
-
continue: !t.abort
|
|
985
|
-
});
|
|
986
|
-
};
|
|
987
|
-
});
|
|
988
|
-
function io(e) {
|
|
989
|
-
if (!tt.test(e))
|
|
990
|
-
return !1;
|
|
991
|
-
const t = e.replace(/[-_]/g, (o) => o === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
992
|
-
return ct(n);
|
|
993
|
-
}
|
|
994
|
-
const so = /* @__PURE__ */ p("$ZodBase64URL", (e, t) => {
|
|
995
|
-
t.pattern ?? (t.pattern = tt), O.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
996
|
-
io(n.value) || n.issues.push({
|
|
997
|
-
code: "invalid_format",
|
|
998
|
-
format: "base64url",
|
|
999
|
-
input: n.value,
|
|
1000
|
-
inst: e,
|
|
1001
|
-
continue: !t.abort
|
|
1002
|
-
});
|
|
1003
|
-
};
|
|
1004
|
-
}), ao = /* @__PURE__ */ p("$ZodE164", (e, t) => {
|
|
1005
|
-
t.pattern ?? (t.pattern = mn), O.init(e, t);
|
|
1006
|
-
});
|
|
1007
|
-
function co(e, t = null) {
|
|
1008
|
-
try {
|
|
1009
|
-
const n = e.split(".");
|
|
1010
|
-
if (n.length !== 3)
|
|
1011
|
-
return !1;
|
|
1012
|
-
const [o] = n;
|
|
1013
|
-
if (!o)
|
|
1014
|
-
return !1;
|
|
1015
|
-
const r = JSON.parse(atob(o));
|
|
1016
|
-
return !("typ" in r && r?.typ !== "JWT" || !r.alg || t && (!("alg" in r) || r.alg !== t));
|
|
1017
|
-
} catch {
|
|
1018
|
-
return !1;
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
const uo = /* @__PURE__ */ p("$ZodJWT", (e, t) => {
|
|
1022
|
-
O.init(e, t), e._zod.check = (n) => {
|
|
1023
|
-
co(n.value, t.alg) || n.issues.push({
|
|
1024
|
-
code: "invalid_format",
|
|
1025
|
-
format: "jwt",
|
|
1026
|
-
input: n.value,
|
|
1027
|
-
inst: e,
|
|
1028
|
-
continue: !t.abort
|
|
1029
|
-
});
|
|
1030
|
-
};
|
|
1031
|
-
}), ut = /* @__PURE__ */ p("$ZodNumber", (e, t) => {
|
|
1032
|
-
S.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? rt, e._zod.parse = (n, o) => {
|
|
1033
|
-
if (t.coerce)
|
|
1034
|
-
try {
|
|
1035
|
-
n.value = Number(n.value);
|
|
1036
|
-
} catch {
|
|
1037
|
-
}
|
|
1038
|
-
const r = n.value;
|
|
1039
|
-
if (typeof r == "number" && !Number.isNaN(r) && Number.isFinite(r))
|
|
1040
|
-
return n;
|
|
1041
|
-
const s = typeof r == "number" ? Number.isNaN(r) ? "NaN" : Number.isFinite(r) ? void 0 : "Infinity" : void 0;
|
|
1042
|
-
return n.issues.push({
|
|
1043
|
-
expected: "number",
|
|
1044
|
-
code: "invalid_type",
|
|
1045
|
-
input: r,
|
|
1046
|
-
inst: e,
|
|
1047
|
-
...s ? { received: s } : {}
|
|
1048
|
-
}), n;
|
|
1049
|
-
};
|
|
1050
|
-
}), lo = /* @__PURE__ */ p("$ZodNumberFormat", (e, t) => {
|
|
1051
|
-
Sn.init(e, t), ut.init(e, t);
|
|
1052
|
-
}), po = /* @__PURE__ */ p("$ZodBoolean", (e, t) => {
|
|
1053
|
-
S.init(e, t), e._zod.pattern = zn, e._zod.parse = (n, o) => {
|
|
1054
|
-
if (t.coerce)
|
|
1055
|
-
try {
|
|
1056
|
-
n.value = !!n.value;
|
|
1057
|
-
} catch {
|
|
1058
|
-
}
|
|
1059
|
-
const r = n.value;
|
|
1060
|
-
return typeof r == "boolean" || n.issues.push({
|
|
1061
|
-
expected: "boolean",
|
|
1062
|
-
code: "invalid_type",
|
|
1063
|
-
input: r,
|
|
1064
|
-
inst: e
|
|
1065
|
-
}), n;
|
|
1066
|
-
};
|
|
1067
|
-
}), fo = /* @__PURE__ */ p("$ZodNull", (e, t) => {
|
|
1068
|
-
S.init(e, t), e._zod.pattern = wn, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (n, o) => {
|
|
1069
|
-
const r = n.value;
|
|
1070
|
-
return r === null || n.issues.push({
|
|
1071
|
-
expected: "null",
|
|
1072
|
-
code: "invalid_type",
|
|
1073
|
-
input: r,
|
|
1074
|
-
inst: e
|
|
1075
|
-
}), n;
|
|
1076
|
-
};
|
|
1077
|
-
}), ho = /* @__PURE__ */ p("$ZodUnknown", (e, t) => {
|
|
1078
|
-
S.init(e, t), e._zod.parse = (n) => n;
|
|
1079
|
-
}), mo = /* @__PURE__ */ p("$ZodNever", (e, t) => {
|
|
1080
|
-
S.init(e, t), e._zod.parse = (n, o) => (n.issues.push({
|
|
1081
|
-
expected: "never",
|
|
1082
|
-
code: "invalid_type",
|
|
1083
|
-
input: n.value,
|
|
1084
|
-
inst: e
|
|
1085
|
-
}), n);
|
|
1086
|
-
});
|
|
1087
|
-
function Te(e, t, n) {
|
|
1088
|
-
e.issues.length && t.issues.push(...V(n, e.issues)), t.value[n] = e.value;
|
|
1089
|
-
}
|
|
1090
|
-
const go = /* @__PURE__ */ p("$ZodArray", (e, t) => {
|
|
1091
|
-
S.init(e, t), e._zod.parse = (n, o) => {
|
|
1092
|
-
const r = n.value;
|
|
1093
|
-
if (!Array.isArray(r))
|
|
1094
|
-
return n.issues.push({
|
|
1095
|
-
expected: "array",
|
|
1096
|
-
code: "invalid_type",
|
|
1097
|
-
input: r,
|
|
1098
|
-
inst: e
|
|
1099
|
-
}), n;
|
|
1100
|
-
n.value = Array(r.length);
|
|
1101
|
-
const s = [];
|
|
1102
|
-
for (let i = 0; i < r.length; i++) {
|
|
1103
|
-
const a = r[i], u = t.element._zod.run({
|
|
1104
|
-
value: a,
|
|
1105
|
-
issues: []
|
|
1106
|
-
}, o);
|
|
1107
|
-
u instanceof Promise ? s.push(u.then((l) => Te(l, n, i))) : Te(u, n, i);
|
|
1108
|
-
}
|
|
1109
|
-
return s.length ? Promise.all(s).then(() => n) : n;
|
|
1110
|
-
};
|
|
1111
|
-
});
|
|
1112
|
-
function ae(e, t, n, o, r) {
|
|
1113
|
-
if (e.issues.length) {
|
|
1114
|
-
if (r && !(n in o))
|
|
1115
|
-
return;
|
|
1116
|
-
t.issues.push(...V(n, e.issues));
|
|
1117
|
-
}
|
|
1118
|
-
e.value === void 0 ? n in o && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1119
|
-
}
|
|
1120
|
-
function lt(e) {
|
|
1121
|
-
const t = Object.keys(e.shape);
|
|
1122
|
-
for (const o of t)
|
|
1123
|
-
if (!e.shape?.[o]?._zod?.traits?.has("$ZodType"))
|
|
1124
|
-
throw new Error(`Invalid element at key "${o}": expected a Zod schema`);
|
|
1125
|
-
const n = Nt(e.shape);
|
|
1126
|
-
return {
|
|
1127
|
-
...e,
|
|
1128
|
-
keys: t,
|
|
1129
|
-
keySet: new Set(t),
|
|
1130
|
-
numKeys: t.length,
|
|
1131
|
-
optionalKeys: new Set(n)
|
|
1132
|
-
};
|
|
1133
|
-
}
|
|
1134
|
-
function pt(e, t, n, o, r, s) {
|
|
1135
|
-
const i = [], a = r.keySet, u = r.catchall._zod, l = u.def.type, f = u.optout === "optional";
|
|
1136
|
-
for (const h in t) {
|
|
1137
|
-
if (a.has(h))
|
|
1138
|
-
continue;
|
|
1139
|
-
if (l === "never") {
|
|
1140
|
-
i.push(h);
|
|
1141
|
-
continue;
|
|
1142
|
-
}
|
|
1143
|
-
const b = u.run({ value: t[h], issues: [] }, o);
|
|
1144
|
-
b instanceof Promise ? e.push(b.then((w) => ae(w, n, h, t, f))) : ae(b, n, h, t, f);
|
|
1145
|
-
}
|
|
1146
|
-
return i.length && n.issues.push({
|
|
1147
|
-
code: "unrecognized_keys",
|
|
1148
|
-
keys: i,
|
|
1149
|
-
input: t,
|
|
1150
|
-
inst: s
|
|
1151
|
-
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1152
|
-
}
|
|
1153
|
-
const _o = /* @__PURE__ */ p("$ZodObject", (e, t) => {
|
|
1154
|
-
if (S.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1155
|
-
const a = t.shape;
|
|
1156
|
-
Object.defineProperty(t, "shape", {
|
|
1157
|
-
get: () => {
|
|
1158
|
-
const u = { ...a };
|
|
1159
|
-
return Object.defineProperty(t, "shape", {
|
|
1160
|
-
value: u
|
|
1161
|
-
}), u;
|
|
1162
|
-
}
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
const o = be(() => lt(t));
|
|
1166
|
-
$(e._zod, "propValues", () => {
|
|
1167
|
-
const a = t.shape, u = {};
|
|
1168
|
-
for (const l in a) {
|
|
1169
|
-
const f = a[l]._zod;
|
|
1170
|
-
if (f.values) {
|
|
1171
|
-
u[l] ?? (u[l] = /* @__PURE__ */ new Set());
|
|
1172
|
-
for (const h of f.values)
|
|
1173
|
-
u[l].add(h);
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
return u;
|
|
1177
|
-
});
|
|
1178
|
-
const r = se, s = t.catchall;
|
|
1179
|
-
let i;
|
|
1180
|
-
e._zod.parse = (a, u) => {
|
|
1181
|
-
i ?? (i = o.value);
|
|
1182
|
-
const l = a.value;
|
|
1183
|
-
if (!r(l))
|
|
1184
|
-
return a.issues.push({
|
|
1185
|
-
expected: "object",
|
|
1186
|
-
code: "invalid_type",
|
|
1187
|
-
input: l,
|
|
1188
|
-
inst: e
|
|
1189
|
-
}), a;
|
|
1190
|
-
a.value = {};
|
|
1191
|
-
const f = [], h = i.shape;
|
|
1192
|
-
for (const b of i.keys) {
|
|
1193
|
-
const w = h[b], E = w._zod.optout === "optional", N = w._zod.run({ value: l[b], issues: [] }, u);
|
|
1194
|
-
N instanceof Promise ? f.push(N.then((ee) => ae(ee, a, b, l, E))) : ae(N, a, b, l, E);
|
|
1195
|
-
}
|
|
1196
|
-
return s ? pt(f, l, a, u, o.value, e) : f.length ? Promise.all(f).then(() => a) : a;
|
|
1197
|
-
};
|
|
1198
|
-
}), vo = /* @__PURE__ */ p("$ZodObjectJIT", (e, t) => {
|
|
1199
|
-
_o.init(e, t);
|
|
1200
|
-
const n = e._zod.parse, o = be(() => lt(t)), r = (b) => {
|
|
1201
|
-
const w = new Dn(["shape", "payload", "ctx"]), E = o.value, N = (x) => {
|
|
1202
|
-
const j = Pe(x);
|
|
1203
|
-
return `shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`;
|
|
1204
|
-
};
|
|
1205
|
-
w.write("const input = payload.value;");
|
|
1206
|
-
const ee = /* @__PURE__ */ Object.create(null);
|
|
1207
|
-
let $t = 0;
|
|
1208
|
-
for (const x of E.keys)
|
|
1209
|
-
ee[x] = `key_${$t++}`;
|
|
1210
|
-
w.write("const newResult = {};");
|
|
1211
|
-
for (const x of E.keys) {
|
|
1212
|
-
const j = ee[x], D = Pe(x), St = b[x]?._zod?.optout === "optional";
|
|
1213
|
-
w.write(`const ${j} = ${N(x)};`), St ? w.write(`
|
|
1214
|
-
if (${j}.issues.length) {
|
|
1215
|
-
if (${D} in input) {
|
|
1216
|
-
payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
|
|
1217
|
-
...iss,
|
|
1218
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
1219
|
-
})));
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
if (${j}.value === undefined) {
|
|
1224
|
-
if (${D} in input) {
|
|
1225
|
-
newResult[${D}] = undefined;
|
|
1226
|
-
}
|
|
1227
|
-
} else {
|
|
1228
|
-
newResult[${D}] = ${j}.value;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
`) : w.write(`
|
|
1232
|
-
if (${j}.issues.length) {
|
|
1233
|
-
payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
|
|
1234
|
-
...iss,
|
|
1235
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
1236
|
-
})));
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
if (${j}.value === undefined) {
|
|
1240
|
-
if (${D} in input) {
|
|
1241
|
-
newResult[${D}] = undefined;
|
|
1242
|
-
}
|
|
1243
|
-
} else {
|
|
1244
|
-
newResult[${D}] = ${j}.value;
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
`);
|
|
1248
|
-
}
|
|
1249
|
-
w.write("payload.value = newResult;"), w.write("return payload;");
|
|
1250
|
-
const Zt = w.compile();
|
|
1251
|
-
return (x, j) => Zt(b, x, j);
|
|
1252
|
-
};
|
|
1253
|
-
let s;
|
|
1254
|
-
const i = se, a = !Ge.jitless, l = a && Tt.value, f = t.catchall;
|
|
1255
|
-
let h;
|
|
1256
|
-
e._zod.parse = (b, w) => {
|
|
1257
|
-
h ?? (h = o.value);
|
|
1258
|
-
const E = b.value;
|
|
1259
|
-
return i(E) ? a && l && w?.async === !1 && w.jitless !== !0 ? (s || (s = r(t.shape)), b = s(b, w), f ? pt([], E, b, w, h, e) : b) : n(b, w) : (b.issues.push({
|
|
1260
|
-
expected: "object",
|
|
1261
|
-
code: "invalid_type",
|
|
1262
|
-
input: E,
|
|
1263
|
-
inst: e
|
|
1264
|
-
}), b);
|
|
1265
|
-
};
|
|
1266
|
-
});
|
|
1267
|
-
function Ie(e, t, n, o) {
|
|
1268
|
-
for (const s of e)
|
|
1269
|
-
if (s.issues.length === 0)
|
|
1270
|
-
return t.value = s.value, t;
|
|
1271
|
-
const r = e.filter((s) => !W(s));
|
|
1272
|
-
return r.length === 1 ? (t.value = r[0].value, r[0]) : (t.issues.push({
|
|
1273
|
-
code: "invalid_union",
|
|
1274
|
-
input: t.value,
|
|
1275
|
-
inst: n,
|
|
1276
|
-
errors: e.map((s) => s.issues.map((i) => U(i, o, F())))
|
|
1277
|
-
}), t);
|
|
1278
|
-
}
|
|
1279
|
-
const bo = /* @__PURE__ */ p("$ZodUnion", (e, t) => {
|
|
1280
|
-
S.init(e, t), $(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), $(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), $(e._zod, "values", () => {
|
|
1281
|
-
if (t.options.every((r) => r._zod.values))
|
|
1282
|
-
return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
|
|
1283
|
-
}), $(e._zod, "pattern", () => {
|
|
1284
|
-
if (t.options.every((r) => r._zod.pattern)) {
|
|
1285
|
-
const r = t.options.map((s) => s._zod.pattern);
|
|
1286
|
-
return new RegExp(`^(${r.map((s) => ze(s.source)).join("|")})$`);
|
|
1287
|
-
}
|
|
1288
|
-
});
|
|
1289
|
-
const n = t.options.length === 1, o = t.options[0]._zod.run;
|
|
1290
|
-
e._zod.parse = (r, s) => {
|
|
1291
|
-
if (n)
|
|
1292
|
-
return o(r, s);
|
|
1293
|
-
let i = !1;
|
|
1294
|
-
const a = [];
|
|
1295
|
-
for (const u of t.options) {
|
|
1296
|
-
const l = u._zod.run({
|
|
1297
|
-
value: r.value,
|
|
1298
|
-
issues: []
|
|
1299
|
-
}, s);
|
|
1300
|
-
if (l instanceof Promise)
|
|
1301
|
-
a.push(l), i = !0;
|
|
1302
|
-
else {
|
|
1303
|
-
if (l.issues.length === 0)
|
|
1304
|
-
return l;
|
|
1305
|
-
a.push(l);
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
return i ? Promise.all(a).then((u) => Ie(u, r, e, s)) : Ie(a, r, e, s);
|
|
1309
|
-
};
|
|
1310
|
-
}), yo = /* @__PURE__ */ p("$ZodIntersection", (e, t) => {
|
|
1311
|
-
S.init(e, t), e._zod.parse = (n, o) => {
|
|
1312
|
-
const r = n.value, s = t.left._zod.run({ value: r, issues: [] }, o), i = t.right._zod.run({ value: r, issues: [] }, o);
|
|
1313
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, l]) => Ne(n, u, l)) : Ne(n, s, i);
|
|
1314
|
-
};
|
|
1315
|
-
});
|
|
1316
|
-
function _e(e, t) {
|
|
1317
|
-
if (e === t)
|
|
1318
|
-
return { valid: !0, data: e };
|
|
1319
|
-
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
1320
|
-
return { valid: !0, data: e };
|
|
1321
|
-
if (q(e) && q(t)) {
|
|
1322
|
-
const n = Object.keys(t), o = Object.keys(e).filter((s) => n.indexOf(s) !== -1), r = { ...e, ...t };
|
|
1323
|
-
for (const s of o) {
|
|
1324
|
-
const i = _e(e[s], t[s]);
|
|
1325
|
-
if (!i.valid)
|
|
1326
|
-
return {
|
|
1327
|
-
valid: !1,
|
|
1328
|
-
mergeErrorPath: [s, ...i.mergeErrorPath]
|
|
1329
|
-
};
|
|
1330
|
-
r[s] = i.data;
|
|
1331
|
-
}
|
|
1332
|
-
return { valid: !0, data: r };
|
|
1333
|
-
}
|
|
1334
|
-
if (Array.isArray(e) && Array.isArray(t)) {
|
|
1335
|
-
if (e.length !== t.length)
|
|
1336
|
-
return { valid: !1, mergeErrorPath: [] };
|
|
1337
|
-
const n = [];
|
|
1338
|
-
for (let o = 0; o < e.length; o++) {
|
|
1339
|
-
const r = e[o], s = t[o], i = _e(r, s);
|
|
1340
|
-
if (!i.valid)
|
|
1341
|
-
return {
|
|
1342
|
-
valid: !1,
|
|
1343
|
-
mergeErrorPath: [o, ...i.mergeErrorPath]
|
|
1344
|
-
};
|
|
1345
|
-
n.push(i.data);
|
|
1346
|
-
}
|
|
1347
|
-
return { valid: !0, data: n };
|
|
1348
|
-
}
|
|
1349
|
-
return { valid: !1, mergeErrorPath: [] };
|
|
1350
|
-
}
|
|
1351
|
-
function Ne(e, t, n) {
|
|
1352
|
-
const o = /* @__PURE__ */ new Map();
|
|
1353
|
-
let r;
|
|
1354
|
-
for (const a of t.issues)
|
|
1355
|
-
if (a.code === "unrecognized_keys") {
|
|
1356
|
-
r ?? (r = a);
|
|
1357
|
-
for (const u of a.keys)
|
|
1358
|
-
o.has(u) || o.set(u, {}), o.get(u).l = !0;
|
|
1359
|
-
} else
|
|
1360
|
-
e.issues.push(a);
|
|
1361
|
-
for (const a of n.issues)
|
|
1362
|
-
if (a.code === "unrecognized_keys")
|
|
1363
|
-
for (const u of a.keys)
|
|
1364
|
-
o.has(u) || o.set(u, {}), o.get(u).r = !0;
|
|
1365
|
-
else
|
|
1366
|
-
e.issues.push(a);
|
|
1367
|
-
const s = [...o].filter(([, a]) => a.l && a.r).map(([a]) => a);
|
|
1368
|
-
if (s.length && r && e.issues.push({ ...r, keys: s }), W(e))
|
|
1369
|
-
return e;
|
|
1370
|
-
const i = _e(t.value, n.value);
|
|
1371
|
-
if (!i.valid)
|
|
1372
|
-
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
1373
|
-
return e.value = i.data, e;
|
|
1374
|
-
}
|
|
1375
|
-
const zo = /* @__PURE__ */ p("$ZodTuple", (e, t) => {
|
|
1376
|
-
S.init(e, t);
|
|
1377
|
-
const n = t.items;
|
|
1378
|
-
e._zod.parse = (o, r) => {
|
|
1379
|
-
const s = o.value;
|
|
1380
|
-
if (!Array.isArray(s))
|
|
1381
|
-
return o.issues.push({
|
|
1382
|
-
input: s,
|
|
1383
|
-
inst: e,
|
|
1384
|
-
expected: "tuple",
|
|
1385
|
-
code: "invalid_type"
|
|
1386
|
-
}), o;
|
|
1387
|
-
o.value = [];
|
|
1388
|
-
const i = [], a = [...n].reverse().findIndex((f) => f._zod.optin !== "optional"), u = a === -1 ? 0 : n.length - a;
|
|
1389
|
-
if (!t.rest) {
|
|
1390
|
-
const f = s.length > n.length, h = s.length < u - 1;
|
|
1391
|
-
if (f || h)
|
|
1392
|
-
return o.issues.push({
|
|
1393
|
-
...f ? { code: "too_big", maximum: n.length, inclusive: !0 } : { code: "too_small", minimum: n.length },
|
|
1394
|
-
input: s,
|
|
1395
|
-
inst: e,
|
|
1396
|
-
origin: "array"
|
|
1397
|
-
}), o;
|
|
1398
|
-
}
|
|
1399
|
-
let l = -1;
|
|
1400
|
-
for (const f of n) {
|
|
1401
|
-
if (l++, l >= s.length && l >= u)
|
|
1402
|
-
continue;
|
|
1403
|
-
const h = f._zod.run({
|
|
1404
|
-
value: s[l],
|
|
1405
|
-
issues: []
|
|
1406
|
-
}, r);
|
|
1407
|
-
h instanceof Promise ? i.push(h.then((b) => ne(b, o, l))) : ne(h, o, l);
|
|
1408
|
-
}
|
|
1409
|
-
if (t.rest) {
|
|
1410
|
-
const f = s.slice(n.length);
|
|
1411
|
-
for (const h of f) {
|
|
1412
|
-
l++;
|
|
1413
|
-
const b = t.rest._zod.run({
|
|
1414
|
-
value: h,
|
|
1415
|
-
issues: []
|
|
1416
|
-
}, r);
|
|
1417
|
-
b instanceof Promise ? i.push(b.then((w) => ne(w, o, l))) : ne(b, o, l);
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
return i.length ? Promise.all(i).then(() => o) : o;
|
|
1421
|
-
};
|
|
1422
|
-
});
|
|
1423
|
-
function ne(e, t, n) {
|
|
1424
|
-
e.issues.length && t.issues.push(...V(n, e.issues)), t.value[n] = e.value;
|
|
1425
|
-
}
|
|
1426
|
-
const wo = /* @__PURE__ */ p("$ZodRecord", (e, t) => {
|
|
1427
|
-
S.init(e, t), e._zod.parse = (n, o) => {
|
|
1428
|
-
const r = n.value;
|
|
1429
|
-
if (!q(r))
|
|
1430
|
-
return n.issues.push({
|
|
1431
|
-
expected: "record",
|
|
1432
|
-
code: "invalid_type",
|
|
1433
|
-
input: r,
|
|
1434
|
-
inst: e
|
|
1435
|
-
}), n;
|
|
1436
|
-
const s = [], i = t.keyType._zod.values;
|
|
1437
|
-
if (i) {
|
|
1438
|
-
n.value = {};
|
|
1439
|
-
const a = /* @__PURE__ */ new Set();
|
|
1440
|
-
for (const l of i)
|
|
1441
|
-
if (typeof l == "string" || typeof l == "number" || typeof l == "symbol") {
|
|
1442
|
-
a.add(typeof l == "number" ? l.toString() : l);
|
|
1443
|
-
const f = t.valueType._zod.run({ value: r[l], issues: [] }, o);
|
|
1444
|
-
f instanceof Promise ? s.push(f.then((h) => {
|
|
1445
|
-
h.issues.length && n.issues.push(...V(l, h.issues)), n.value[l] = h.value;
|
|
1446
|
-
})) : (f.issues.length && n.issues.push(...V(l, f.issues)), n.value[l] = f.value);
|
|
1447
|
-
}
|
|
1448
|
-
let u;
|
|
1449
|
-
for (const l in r)
|
|
1450
|
-
a.has(l) || (u = u ?? [], u.push(l));
|
|
1451
|
-
u && u.length > 0 && n.issues.push({
|
|
1452
|
-
code: "unrecognized_keys",
|
|
1453
|
-
input: r,
|
|
1454
|
-
inst: e,
|
|
1455
|
-
keys: u
|
|
1456
|
-
});
|
|
1457
|
-
} else {
|
|
1458
|
-
n.value = {};
|
|
1459
|
-
for (const a of Reflect.ownKeys(r)) {
|
|
1460
|
-
if (a === "__proto__")
|
|
1461
|
-
continue;
|
|
1462
|
-
let u = t.keyType._zod.run({ value: a, issues: [] }, o);
|
|
1463
|
-
if (u instanceof Promise)
|
|
1464
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1465
|
-
if (typeof a == "string" && rt.test(a) && u.issues.length) {
|
|
1466
|
-
const h = t.keyType._zod.run({ value: Number(a), issues: [] }, o);
|
|
1467
|
-
if (h instanceof Promise)
|
|
1468
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1469
|
-
h.issues.length === 0 && (u = h);
|
|
1470
|
-
}
|
|
1471
|
-
if (u.issues.length) {
|
|
1472
|
-
t.mode === "loose" ? n.value[a] = r[a] : n.issues.push({
|
|
1473
|
-
code: "invalid_key",
|
|
1474
|
-
origin: "record",
|
|
1475
|
-
issues: u.issues.map((h) => U(h, o, F())),
|
|
1476
|
-
input: a,
|
|
1477
|
-
path: [a],
|
|
1478
|
-
inst: e
|
|
1479
|
-
});
|
|
1480
|
-
continue;
|
|
1481
|
-
}
|
|
1482
|
-
const f = t.valueType._zod.run({ value: r[a], issues: [] }, o);
|
|
1483
|
-
f instanceof Promise ? s.push(f.then((h) => {
|
|
1484
|
-
h.issues.length && n.issues.push(...V(a, h.issues)), n.value[u.value] = h.value;
|
|
1485
|
-
})) : (f.issues.length && n.issues.push(...V(a, f.issues)), n.value[u.value] = f.value);
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
return s.length ? Promise.all(s).then(() => n) : n;
|
|
1489
|
-
};
|
|
1490
|
-
}), ko = /* @__PURE__ */ p("$ZodEnum", (e, t) => {
|
|
1491
|
-
S.init(e, t);
|
|
1492
|
-
const n = qe(t.entries), o = new Set(n);
|
|
1493
|
-
e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) => It.has(typeof r)).map((r) => typeof r == "string" ? le(r) : r.toString()).join("|")})$`), e._zod.parse = (r, s) => {
|
|
1494
|
-
const i = r.value;
|
|
1495
|
-
return o.has(i) || r.issues.push({
|
|
1496
|
-
code: "invalid_value",
|
|
1497
|
-
values: n,
|
|
1498
|
-
input: i,
|
|
1499
|
-
inst: e
|
|
1500
|
-
}), r;
|
|
1501
|
-
};
|
|
1502
|
-
}), $o = /* @__PURE__ */ p("$ZodTransform", (e, t) => {
|
|
1503
|
-
S.init(e, t), e._zod.parse = (n, o) => {
|
|
1504
|
-
if (o.direction === "backward")
|
|
1505
|
-
throw new We(e.constructor.name);
|
|
1506
|
-
const r = t.transform(n.value, n);
|
|
1507
|
-
if (o.async)
|
|
1508
|
-
return (r instanceof Promise ? r : Promise.resolve(r)).then((i) => (n.value = i, n));
|
|
1509
|
-
if (r instanceof Promise)
|
|
1510
|
-
throw new G();
|
|
1511
|
-
return n.value = r, n;
|
|
1512
|
-
};
|
|
1513
|
-
});
|
|
1514
|
-
function Ee(e, t) {
|
|
1515
|
-
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1516
|
-
}
|
|
1517
|
-
const ft = /* @__PURE__ */ p("$ZodOptional", (e, t) => {
|
|
1518
|
-
S.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", $(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), $(e._zod, "pattern", () => {
|
|
1519
|
-
const n = t.innerType._zod.pattern;
|
|
1520
|
-
return n ? new RegExp(`^(${ze(n.source)})?$`) : void 0;
|
|
1521
|
-
}), e._zod.parse = (n, o) => {
|
|
1522
|
-
if (t.innerType._zod.optin === "optional") {
|
|
1523
|
-
const r = t.innerType._zod.run(n, o);
|
|
1524
|
-
return r instanceof Promise ? r.then((s) => Ee(s, n.value)) : Ee(r, n.value);
|
|
1525
|
-
}
|
|
1526
|
-
return n.value === void 0 ? n : t.innerType._zod.run(n, o);
|
|
1527
|
-
};
|
|
1528
|
-
}), Zo = /* @__PURE__ */ p("$ZodExactOptional", (e, t) => {
|
|
1529
|
-
ft.init(e, t), $(e._zod, "values", () => t.innerType._zod.values), $(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, o) => t.innerType._zod.run(n, o);
|
|
1530
|
-
}), So = /* @__PURE__ */ p("$ZodNullable", (e, t) => {
|
|
1531
|
-
S.init(e, t), $(e._zod, "optin", () => t.innerType._zod.optin), $(e._zod, "optout", () => t.innerType._zod.optout), $(e._zod, "pattern", () => {
|
|
1532
|
-
const n = t.innerType._zod.pattern;
|
|
1533
|
-
return n ? new RegExp(`^(${ze(n.source)}|null)$`) : void 0;
|
|
1534
|
-
}), $(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, o) => n.value === null ? n : t.innerType._zod.run(n, o);
|
|
1535
|
-
}), Po = /* @__PURE__ */ p("$ZodDefault", (e, t) => {
|
|
1536
|
-
S.init(e, t), e._zod.optin = "optional", $(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1537
|
-
if (o.direction === "backward")
|
|
1538
|
-
return t.innerType._zod.run(n, o);
|
|
1539
|
-
if (n.value === void 0)
|
|
1540
|
-
return n.value = t.defaultValue, n;
|
|
1541
|
-
const r = t.innerType._zod.run(n, o);
|
|
1542
|
-
return r instanceof Promise ? r.then((s) => Ce(s, t)) : Ce(r, t);
|
|
1543
|
-
};
|
|
1544
|
-
});
|
|
1545
|
-
function Ce(e, t) {
|
|
1546
|
-
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1547
|
-
}
|
|
1548
|
-
const Oo = /* @__PURE__ */ p("$ZodPrefault", (e, t) => {
|
|
1549
|
-
S.init(e, t), e._zod.optin = "optional", $(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => (o.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, o));
|
|
1550
|
-
}), To = /* @__PURE__ */ p("$ZodNonOptional", (e, t) => {
|
|
1551
|
-
S.init(e, t), $(e._zod, "values", () => {
|
|
1552
|
-
const n = t.innerType._zod.values;
|
|
1553
|
-
return n ? new Set([...n].filter((o) => o !== void 0)) : void 0;
|
|
1554
|
-
}), e._zod.parse = (n, o) => {
|
|
1555
|
-
const r = t.innerType._zod.run(n, o);
|
|
1556
|
-
return r instanceof Promise ? r.then((s) => je(s, e)) : je(r, e);
|
|
1557
|
-
};
|
|
1558
|
-
});
|
|
1559
|
-
function je(e, t) {
|
|
1560
|
-
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1561
|
-
code: "invalid_type",
|
|
1562
|
-
expected: "nonoptional",
|
|
1563
|
-
input: e.value,
|
|
1564
|
-
inst: t
|
|
1565
|
-
}), e;
|
|
1566
|
-
}
|
|
1567
|
-
const Io = /* @__PURE__ */ p("$ZodCatch", (e, t) => {
|
|
1568
|
-
S.init(e, t), $(e._zod, "optin", () => t.innerType._zod.optin), $(e._zod, "optout", () => t.innerType._zod.optout), $(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1569
|
-
if (o.direction === "backward")
|
|
1570
|
-
return t.innerType._zod.run(n, o);
|
|
1571
|
-
const r = t.innerType._zod.run(n, o);
|
|
1572
|
-
return r instanceof Promise ? r.then((s) => (n.value = s.value, s.issues.length && (n.value = t.catchValue({
|
|
1573
|
-
...n,
|
|
1574
|
-
error: {
|
|
1575
|
-
issues: s.issues.map((i) => U(i, o, F()))
|
|
1576
|
-
},
|
|
1577
|
-
input: n.value
|
|
1578
|
-
}), n.issues = []), n)) : (n.value = r.value, r.issues.length && (n.value = t.catchValue({
|
|
1579
|
-
...n,
|
|
1580
|
-
error: {
|
|
1581
|
-
issues: r.issues.map((s) => U(s, o, F()))
|
|
1582
|
-
},
|
|
1583
|
-
input: n.value
|
|
1584
|
-
}), n.issues = []), n);
|
|
1585
|
-
};
|
|
1586
|
-
}), No = /* @__PURE__ */ p("$ZodPipe", (e, t) => {
|
|
1587
|
-
S.init(e, t), $(e._zod, "values", () => t.in._zod.values), $(e._zod, "optin", () => t.in._zod.optin), $(e._zod, "optout", () => t.out._zod.optout), $(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, o) => {
|
|
1588
|
-
if (o.direction === "backward") {
|
|
1589
|
-
const s = t.out._zod.run(n, o);
|
|
1590
|
-
return s instanceof Promise ? s.then((i) => oe(i, t.in, o)) : oe(s, t.in, o);
|
|
1591
|
-
}
|
|
1592
|
-
const r = t.in._zod.run(n, o);
|
|
1593
|
-
return r instanceof Promise ? r.then((s) => oe(s, t.out, o)) : oe(r, t.out, o);
|
|
1594
|
-
};
|
|
1595
|
-
});
|
|
1596
|
-
function oe(e, t, n) {
|
|
1597
|
-
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1598
|
-
}
|
|
1599
|
-
const Eo = /* @__PURE__ */ p("$ZodReadonly", (e, t) => {
|
|
1600
|
-
S.init(e, t), $(e._zod, "propValues", () => t.innerType._zod.propValues), $(e._zod, "values", () => t.innerType._zod.values), $(e._zod, "optin", () => t.innerType?._zod?.optin), $(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, o) => {
|
|
1601
|
-
if (o.direction === "backward")
|
|
1602
|
-
return t.innerType._zod.run(n, o);
|
|
1603
|
-
const r = t.innerType._zod.run(n, o);
|
|
1604
|
-
return r instanceof Promise ? r.then(Ae) : Ae(r);
|
|
1605
|
-
};
|
|
1606
|
-
});
|
|
1607
|
-
function Ae(e) {
|
|
1608
|
-
return e.value = Object.freeze(e.value), e;
|
|
1609
|
-
}
|
|
1610
|
-
const Co = /* @__PURE__ */ p("$ZodLazy", (e, t) => {
|
|
1611
|
-
S.init(e, t), $(e._zod, "innerType", () => t.getter()), $(e._zod, "pattern", () => e._zod.innerType?._zod?.pattern), $(e._zod, "propValues", () => e._zod.innerType?._zod?.propValues), $(e._zod, "optin", () => e._zod.innerType?._zod?.optin ?? void 0), $(e._zod, "optout", () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (n, o) => e._zod.innerType._zod.run(n, o);
|
|
1612
|
-
}), jo = /* @__PURE__ */ p("$ZodCustom", (e, t) => {
|
|
1613
|
-
A.init(e, t), S.init(e, t), e._zod.parse = (n, o) => n, e._zod.check = (n) => {
|
|
1614
|
-
const o = n.value, r = t.fn(o);
|
|
1615
|
-
if (r instanceof Promise)
|
|
1616
|
-
return r.then((s) => Re(s, n, o, e));
|
|
1617
|
-
Re(r, n, o, e);
|
|
1618
|
-
};
|
|
1619
|
-
});
|
|
1620
|
-
function Re(e, t, n, o) {
|
|
1621
|
-
if (!e) {
|
|
1622
|
-
const r = {
|
|
1623
|
-
code: "custom",
|
|
1624
|
-
input: n,
|
|
1625
|
-
inst: o,
|
|
1626
|
-
// incorporates params.error into issue reporting
|
|
1627
|
-
path: [...o._zod.def.path ?? []],
|
|
1628
|
-
// incorporates params.error into issue reporting
|
|
1629
|
-
continue: !o._zod.def.abort
|
|
1630
|
-
// params: inst._zod.def.params,
|
|
1631
|
-
};
|
|
1632
|
-
o._zod.def.params && (r.params = o._zod.def.params), t.issues.push(Q(r));
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
var De;
|
|
1636
|
-
class Ao {
|
|
1637
|
-
constructor() {
|
|
1638
|
-
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1639
|
-
}
|
|
1640
|
-
add(t, ...n) {
|
|
1641
|
-
const o = n[0];
|
|
1642
|
-
return this._map.set(t, o), o && typeof o == "object" && "id" in o && this._idmap.set(o.id, t), this;
|
|
1643
|
-
}
|
|
1644
|
-
clear() {
|
|
1645
|
-
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1646
|
-
}
|
|
1647
|
-
remove(t) {
|
|
1648
|
-
const n = this._map.get(t);
|
|
1649
|
-
return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
|
|
1650
|
-
}
|
|
1651
|
-
get(t) {
|
|
1652
|
-
const n = t._zod.parent;
|
|
1653
|
-
if (n) {
|
|
1654
|
-
const o = { ...this.get(n) ?? {} };
|
|
1655
|
-
delete o.id;
|
|
1656
|
-
const r = { ...o, ...this._map.get(t) };
|
|
1657
|
-
return Object.keys(r).length ? r : void 0;
|
|
1658
|
-
}
|
|
1659
|
-
return this._map.get(t);
|
|
1660
|
-
}
|
|
1661
|
-
has(t) {
|
|
1662
|
-
return this._map.has(t);
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
function Ro() {
|
|
1666
|
-
return new Ao();
|
|
1667
|
-
}
|
|
1668
|
-
(De = globalThis).__zod_globalRegistry ?? (De.__zod_globalRegistry = Ro());
|
|
1669
|
-
const X = globalThis.__zod_globalRegistry;
|
|
1670
|
-
// @__NO_SIDE_EFFECTS__
|
|
1671
|
-
function Do(e, t) {
|
|
1672
|
-
return new e({
|
|
1673
|
-
type: "string",
|
|
1674
|
-
...g(t)
|
|
1675
|
-
});
|
|
1676
|
-
}
|
|
1677
|
-
// @__NO_SIDE_EFFECTS__
|
|
1678
|
-
function xo(e, t) {
|
|
1679
|
-
return new e({
|
|
1680
|
-
type: "string",
|
|
1681
|
-
format: "email",
|
|
1682
|
-
check: "string_format",
|
|
1683
|
-
abort: !1,
|
|
1684
|
-
...g(t)
|
|
1685
|
-
});
|
|
1686
|
-
}
|
|
1687
|
-
// @__NO_SIDE_EFFECTS__
|
|
1688
|
-
function xe(e, t) {
|
|
1689
|
-
return new e({
|
|
1690
|
-
type: "string",
|
|
1691
|
-
format: "guid",
|
|
1692
|
-
check: "string_format",
|
|
1693
|
-
abort: !1,
|
|
1694
|
-
...g(t)
|
|
1695
|
-
});
|
|
1696
|
-
}
|
|
1697
|
-
// @__NO_SIDE_EFFECTS__
|
|
1698
|
-
function Fo(e, t) {
|
|
1699
|
-
return new e({
|
|
1700
|
-
type: "string",
|
|
1701
|
-
format: "uuid",
|
|
1702
|
-
check: "string_format",
|
|
1703
|
-
abort: !1,
|
|
1704
|
-
...g(t)
|
|
1705
|
-
});
|
|
1706
|
-
}
|
|
1707
|
-
// @__NO_SIDE_EFFECTS__
|
|
1708
|
-
function Uo(e, t) {
|
|
1709
|
-
return new e({
|
|
1710
|
-
type: "string",
|
|
1711
|
-
format: "uuid",
|
|
1712
|
-
check: "string_format",
|
|
1713
|
-
abort: !1,
|
|
1714
|
-
version: "v4",
|
|
1715
|
-
...g(t)
|
|
1716
|
-
});
|
|
1717
|
-
}
|
|
1718
|
-
// @__NO_SIDE_EFFECTS__
|
|
1719
|
-
function Lo(e, t) {
|
|
1720
|
-
return new e({
|
|
1721
|
-
type: "string",
|
|
1722
|
-
format: "uuid",
|
|
1723
|
-
check: "string_format",
|
|
1724
|
-
abort: !1,
|
|
1725
|
-
version: "v6",
|
|
1726
|
-
...g(t)
|
|
1727
|
-
});
|
|
1728
|
-
}
|
|
1729
|
-
// @__NO_SIDE_EFFECTS__
|
|
1730
|
-
function Mo(e, t) {
|
|
1731
|
-
return new e({
|
|
1732
|
-
type: "string",
|
|
1733
|
-
format: "uuid",
|
|
1734
|
-
check: "string_format",
|
|
1735
|
-
abort: !1,
|
|
1736
|
-
version: "v7",
|
|
1737
|
-
...g(t)
|
|
1738
|
-
});
|
|
1739
|
-
}
|
|
1740
|
-
// @__NO_SIDE_EFFECTS__
|
|
1741
|
-
function Jo(e, t) {
|
|
1742
|
-
return new e({
|
|
1743
|
-
type: "string",
|
|
1744
|
-
format: "url",
|
|
1745
|
-
check: "string_format",
|
|
1746
|
-
abort: !1,
|
|
1747
|
-
...g(t)
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
// @__NO_SIDE_EFFECTS__
|
|
1751
|
-
function Vo(e, t) {
|
|
1752
|
-
return new e({
|
|
1753
|
-
type: "string",
|
|
1754
|
-
format: "emoji",
|
|
1755
|
-
check: "string_format",
|
|
1756
|
-
abort: !1,
|
|
1757
|
-
...g(t)
|
|
1758
|
-
});
|
|
1759
|
-
}
|
|
1760
|
-
// @__NO_SIDE_EFFECTS__
|
|
1761
|
-
function Bo(e, t) {
|
|
1762
|
-
return new e({
|
|
1763
|
-
type: "string",
|
|
1764
|
-
format: "nanoid",
|
|
1765
|
-
check: "string_format",
|
|
1766
|
-
abort: !1,
|
|
1767
|
-
...g(t)
|
|
1768
|
-
});
|
|
1769
|
-
}
|
|
1770
|
-
// @__NO_SIDE_EFFECTS__
|
|
1771
|
-
function Ko(e, t) {
|
|
1772
|
-
return new e({
|
|
1773
|
-
type: "string",
|
|
1774
|
-
format: "cuid",
|
|
1775
|
-
check: "string_format",
|
|
1776
|
-
abort: !1,
|
|
1777
|
-
...g(t)
|
|
1778
|
-
});
|
|
1779
|
-
}
|
|
1780
|
-
// @__NO_SIDE_EFFECTS__
|
|
1781
|
-
function Wo(e, t) {
|
|
1782
|
-
return new e({
|
|
1783
|
-
type: "string",
|
|
1784
|
-
format: "cuid2",
|
|
1785
|
-
check: "string_format",
|
|
1786
|
-
abort: !1,
|
|
1787
|
-
...g(t)
|
|
1788
|
-
});
|
|
1789
|
-
}
|
|
1790
|
-
// @__NO_SIDE_EFFECTS__
|
|
1791
|
-
function Go(e, t) {
|
|
1792
|
-
return new e({
|
|
1793
|
-
type: "string",
|
|
1794
|
-
format: "ulid",
|
|
1795
|
-
check: "string_format",
|
|
1796
|
-
abort: !1,
|
|
1797
|
-
...g(t)
|
|
1798
|
-
});
|
|
1799
|
-
}
|
|
1800
|
-
// @__NO_SIDE_EFFECTS__
|
|
1801
|
-
function qo(e, t) {
|
|
1802
|
-
return new e({
|
|
1803
|
-
type: "string",
|
|
1804
|
-
format: "xid",
|
|
1805
|
-
check: "string_format",
|
|
1806
|
-
abort: !1,
|
|
1807
|
-
...g(t)
|
|
1808
|
-
});
|
|
1809
|
-
}
|
|
1810
|
-
// @__NO_SIDE_EFFECTS__
|
|
1811
|
-
function Yo(e, t) {
|
|
1812
|
-
return new e({
|
|
1813
|
-
type: "string",
|
|
1814
|
-
format: "ksuid",
|
|
1815
|
-
check: "string_format",
|
|
1816
|
-
abort: !1,
|
|
1817
|
-
...g(t)
|
|
1818
|
-
});
|
|
1819
|
-
}
|
|
1820
|
-
// @__NO_SIDE_EFFECTS__
|
|
1821
|
-
function Xo(e, t) {
|
|
1822
|
-
return new e({
|
|
1823
|
-
type: "string",
|
|
1824
|
-
format: "ipv4",
|
|
1825
|
-
check: "string_format",
|
|
1826
|
-
abort: !1,
|
|
1827
|
-
...g(t)
|
|
1828
|
-
});
|
|
1829
|
-
}
|
|
1830
|
-
// @__NO_SIDE_EFFECTS__
|
|
1831
|
-
function Ho(e, t) {
|
|
1832
|
-
return new e({
|
|
1833
|
-
type: "string",
|
|
1834
|
-
format: "ipv6",
|
|
1835
|
-
check: "string_format",
|
|
1836
|
-
abort: !1,
|
|
1837
|
-
...g(t)
|
|
1838
|
-
});
|
|
1839
|
-
}
|
|
1840
|
-
// @__NO_SIDE_EFFECTS__
|
|
1841
|
-
function Qo(e, t) {
|
|
1842
|
-
return new e({
|
|
1843
|
-
type: "string",
|
|
1844
|
-
format: "cidrv4",
|
|
1845
|
-
check: "string_format",
|
|
1846
|
-
abort: !1,
|
|
1847
|
-
...g(t)
|
|
1848
|
-
});
|
|
1849
|
-
}
|
|
1850
|
-
// @__NO_SIDE_EFFECTS__
|
|
1851
|
-
function er(e, t) {
|
|
1852
|
-
return new e({
|
|
1853
|
-
type: "string",
|
|
1854
|
-
format: "cidrv6",
|
|
1855
|
-
check: "string_format",
|
|
1856
|
-
abort: !1,
|
|
1857
|
-
...g(t)
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1860
|
-
// @__NO_SIDE_EFFECTS__
|
|
1861
|
-
function tr(e, t) {
|
|
1862
|
-
return new e({
|
|
1863
|
-
type: "string",
|
|
1864
|
-
format: "base64",
|
|
1865
|
-
check: "string_format",
|
|
1866
|
-
abort: !1,
|
|
1867
|
-
...g(t)
|
|
1868
|
-
});
|
|
1869
|
-
}
|
|
1870
|
-
// @__NO_SIDE_EFFECTS__
|
|
1871
|
-
function nr(e, t) {
|
|
1872
|
-
return new e({
|
|
1873
|
-
type: "string",
|
|
1874
|
-
format: "base64url",
|
|
1875
|
-
check: "string_format",
|
|
1876
|
-
abort: !1,
|
|
1877
|
-
...g(t)
|
|
1878
|
-
});
|
|
1879
|
-
}
|
|
1880
|
-
// @__NO_SIDE_EFFECTS__
|
|
1881
|
-
function or(e, t) {
|
|
1882
|
-
return new e({
|
|
1883
|
-
type: "string",
|
|
1884
|
-
format: "e164",
|
|
1885
|
-
check: "string_format",
|
|
1886
|
-
abort: !1,
|
|
1887
|
-
...g(t)
|
|
1888
|
-
});
|
|
1889
|
-
}
|
|
1890
|
-
// @__NO_SIDE_EFFECTS__
|
|
1891
|
-
function rr(e, t) {
|
|
1892
|
-
return new e({
|
|
1893
|
-
type: "string",
|
|
1894
|
-
format: "jwt",
|
|
1895
|
-
check: "string_format",
|
|
1896
|
-
abort: !1,
|
|
1897
|
-
...g(t)
|
|
1898
|
-
});
|
|
1899
|
-
}
|
|
1900
|
-
// @__NO_SIDE_EFFECTS__
|
|
1901
|
-
function ir(e, t) {
|
|
1902
|
-
return new e({
|
|
1903
|
-
type: "string",
|
|
1904
|
-
format: "datetime",
|
|
1905
|
-
check: "string_format",
|
|
1906
|
-
offset: !1,
|
|
1907
|
-
local: !1,
|
|
1908
|
-
precision: null,
|
|
1909
|
-
...g(t)
|
|
1910
|
-
});
|
|
1911
|
-
}
|
|
1912
|
-
// @__NO_SIDE_EFFECTS__
|
|
1913
|
-
function sr(e, t) {
|
|
1914
|
-
return new e({
|
|
1915
|
-
type: "string",
|
|
1916
|
-
format: "date",
|
|
1917
|
-
check: "string_format",
|
|
1918
|
-
...g(t)
|
|
1919
|
-
});
|
|
1920
|
-
}
|
|
1921
|
-
// @__NO_SIDE_EFFECTS__
|
|
1922
|
-
function ar(e, t) {
|
|
1923
|
-
return new e({
|
|
1924
|
-
type: "string",
|
|
1925
|
-
format: "time",
|
|
1926
|
-
check: "string_format",
|
|
1927
|
-
precision: null,
|
|
1928
|
-
...g(t)
|
|
1929
|
-
});
|
|
1930
|
-
}
|
|
1931
|
-
// @__NO_SIDE_EFFECTS__
|
|
1932
|
-
function cr(e, t) {
|
|
1933
|
-
return new e({
|
|
1934
|
-
type: "string",
|
|
1935
|
-
format: "duration",
|
|
1936
|
-
check: "string_format",
|
|
1937
|
-
...g(t)
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
// @__NO_SIDE_EFFECTS__
|
|
1941
|
-
function ur(e, t) {
|
|
1942
|
-
return new e({
|
|
1943
|
-
type: "number",
|
|
1944
|
-
checks: [],
|
|
1945
|
-
...g(t)
|
|
1946
|
-
});
|
|
1947
|
-
}
|
|
1948
|
-
// @__NO_SIDE_EFFECTS__
|
|
1949
|
-
function lr(e, t) {
|
|
1950
|
-
return new e({
|
|
1951
|
-
type: "number",
|
|
1952
|
-
check: "number_format",
|
|
1953
|
-
abort: !1,
|
|
1954
|
-
format: "safeint",
|
|
1955
|
-
...g(t)
|
|
1956
|
-
});
|
|
1957
|
-
}
|
|
1958
|
-
// @__NO_SIDE_EFFECTS__
|
|
1959
|
-
function pr(e, t) {
|
|
1960
|
-
return new e({
|
|
1961
|
-
type: "boolean",
|
|
1962
|
-
...g(t)
|
|
1963
|
-
});
|
|
1964
|
-
}
|
|
1965
|
-
// @__NO_SIDE_EFFECTS__
|
|
1966
|
-
function fr(e, t) {
|
|
1967
|
-
return new e({
|
|
1968
|
-
type: "null",
|
|
1969
|
-
...g(t)
|
|
1970
|
-
});
|
|
1971
|
-
}
|
|
1972
|
-
// @__NO_SIDE_EFFECTS__
|
|
1973
|
-
function dr(e) {
|
|
1974
|
-
return new e({
|
|
1975
|
-
type: "unknown"
|
|
1976
|
-
});
|
|
1977
|
-
}
|
|
1978
|
-
// @__NO_SIDE_EFFECTS__
|
|
1979
|
-
function hr(e, t) {
|
|
1980
|
-
return new e({
|
|
1981
|
-
type: "never",
|
|
1982
|
-
...g(t)
|
|
1983
|
-
});
|
|
1984
|
-
}
|
|
1985
|
-
// @__NO_SIDE_EFFECTS__
|
|
1986
|
-
function Fe(e, t) {
|
|
1987
|
-
return new st({
|
|
1988
|
-
check: "less_than",
|
|
1989
|
-
...g(t),
|
|
1990
|
-
value: e,
|
|
1991
|
-
inclusive: !1
|
|
1992
|
-
});
|
|
1993
|
-
}
|
|
1994
|
-
// @__NO_SIDE_EFFECTS__
|
|
1995
|
-
function he(e, t) {
|
|
1996
|
-
return new st({
|
|
1997
|
-
check: "less_than",
|
|
1998
|
-
...g(t),
|
|
1999
|
-
value: e,
|
|
2000
|
-
inclusive: !0
|
|
2001
|
-
});
|
|
2002
|
-
}
|
|
2003
|
-
// @__NO_SIDE_EFFECTS__
|
|
2004
|
-
function Ue(e, t) {
|
|
2005
|
-
return new at({
|
|
2006
|
-
check: "greater_than",
|
|
2007
|
-
...g(t),
|
|
2008
|
-
value: e,
|
|
2009
|
-
inclusive: !1
|
|
2010
|
-
});
|
|
2011
|
-
}
|
|
2012
|
-
// @__NO_SIDE_EFFECTS__
|
|
2013
|
-
function me(e, t) {
|
|
2014
|
-
return new at({
|
|
2015
|
-
check: "greater_than",
|
|
2016
|
-
...g(t),
|
|
2017
|
-
value: e,
|
|
2018
|
-
inclusive: !0
|
|
2019
|
-
});
|
|
2020
|
-
}
|
|
2021
|
-
// @__NO_SIDE_EFFECTS__
|
|
2022
|
-
function Le(e, t) {
|
|
2023
|
-
return new Zn({
|
|
2024
|
-
check: "multiple_of",
|
|
2025
|
-
...g(t),
|
|
2026
|
-
value: e
|
|
2027
|
-
});
|
|
2028
|
-
}
|
|
2029
|
-
// @__NO_SIDE_EFFECTS__
|
|
2030
|
-
function dt(e, t) {
|
|
2031
|
-
return new Pn({
|
|
2032
|
-
check: "max_length",
|
|
2033
|
-
...g(t),
|
|
2034
|
-
maximum: e
|
|
2035
|
-
});
|
|
2036
|
-
}
|
|
2037
|
-
// @__NO_SIDE_EFFECTS__
|
|
2038
|
-
function ce(e, t) {
|
|
2039
|
-
return new On({
|
|
2040
|
-
check: "min_length",
|
|
2041
|
-
...g(t),
|
|
2042
|
-
minimum: e
|
|
2043
|
-
});
|
|
2044
|
-
}
|
|
2045
|
-
// @__NO_SIDE_EFFECTS__
|
|
2046
|
-
function ht(e, t) {
|
|
2047
|
-
return new Tn({
|
|
2048
|
-
check: "length_equals",
|
|
2049
|
-
...g(t),
|
|
2050
|
-
length: e
|
|
2051
|
-
});
|
|
2052
|
-
}
|
|
2053
|
-
// @__NO_SIDE_EFFECTS__
|
|
2054
|
-
function mr(e, t) {
|
|
2055
|
-
return new In({
|
|
2056
|
-
check: "string_format",
|
|
2057
|
-
format: "regex",
|
|
2058
|
-
...g(t),
|
|
2059
|
-
pattern: e
|
|
2060
|
-
});
|
|
2061
|
-
}
|
|
2062
|
-
// @__NO_SIDE_EFFECTS__
|
|
2063
|
-
function gr(e) {
|
|
2064
|
-
return new Nn({
|
|
2065
|
-
check: "string_format",
|
|
2066
|
-
format: "lowercase",
|
|
2067
|
-
...g(e)
|
|
2068
|
-
});
|
|
2069
|
-
}
|
|
2070
|
-
// @__NO_SIDE_EFFECTS__
|
|
2071
|
-
function _r(e) {
|
|
2072
|
-
return new En({
|
|
2073
|
-
check: "string_format",
|
|
2074
|
-
format: "uppercase",
|
|
2075
|
-
...g(e)
|
|
2076
|
-
});
|
|
2077
|
-
}
|
|
2078
|
-
// @__NO_SIDE_EFFECTS__
|
|
2079
|
-
function vr(e, t) {
|
|
2080
|
-
return new Cn({
|
|
2081
|
-
check: "string_format",
|
|
2082
|
-
format: "includes",
|
|
2083
|
-
...g(t),
|
|
2084
|
-
includes: e
|
|
2085
|
-
});
|
|
2086
|
-
}
|
|
2087
|
-
// @__NO_SIDE_EFFECTS__
|
|
2088
|
-
function br(e, t) {
|
|
2089
|
-
return new jn({
|
|
2090
|
-
check: "string_format",
|
|
2091
|
-
format: "starts_with",
|
|
2092
|
-
...g(t),
|
|
2093
|
-
prefix: e
|
|
2094
|
-
});
|
|
2095
|
-
}
|
|
2096
|
-
// @__NO_SIDE_EFFECTS__
|
|
2097
|
-
function yr(e, t) {
|
|
2098
|
-
return new An({
|
|
2099
|
-
check: "string_format",
|
|
2100
|
-
format: "ends_with",
|
|
2101
|
-
...g(t),
|
|
2102
|
-
suffix: e
|
|
2103
|
-
});
|
|
2104
|
-
}
|
|
2105
|
-
// @__NO_SIDE_EFFECTS__
|
|
2106
|
-
function Y(e) {
|
|
2107
|
-
return new Rn({
|
|
2108
|
-
check: "overwrite",
|
|
2109
|
-
tx: e
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
// @__NO_SIDE_EFFECTS__
|
|
2113
|
-
function zr(e) {
|
|
2114
|
-
return /* @__PURE__ */ Y((t) => t.normalize(e));
|
|
2115
|
-
}
|
|
2116
|
-
// @__NO_SIDE_EFFECTS__
|
|
2117
|
-
function wr() {
|
|
2118
|
-
return /* @__PURE__ */ Y((e) => e.trim());
|
|
2119
|
-
}
|
|
2120
|
-
// @__NO_SIDE_EFFECTS__
|
|
2121
|
-
function kr() {
|
|
2122
|
-
return /* @__PURE__ */ Y((e) => e.toLowerCase());
|
|
2123
|
-
}
|
|
2124
|
-
// @__NO_SIDE_EFFECTS__
|
|
2125
|
-
function $r() {
|
|
2126
|
-
return /* @__PURE__ */ Y((e) => e.toUpperCase());
|
|
2127
|
-
}
|
|
2128
|
-
// @__NO_SIDE_EFFECTS__
|
|
2129
|
-
function Zr() {
|
|
2130
|
-
return /* @__PURE__ */ Y((e) => Ot(e));
|
|
2131
|
-
}
|
|
2132
|
-
// @__NO_SIDE_EFFECTS__
|
|
2133
|
-
function Sr(e, t, n) {
|
|
2134
|
-
return new e({
|
|
2135
|
-
type: "array",
|
|
2136
|
-
element: t,
|
|
2137
|
-
// get element() {
|
|
2138
|
-
// return element;
|
|
2139
|
-
// },
|
|
2140
|
-
...g(n)
|
|
2141
|
-
});
|
|
2142
|
-
}
|
|
2143
|
-
// @__NO_SIDE_EFFECTS__
|
|
2144
|
-
function Pr(e, t, n) {
|
|
2145
|
-
return new e({
|
|
2146
|
-
type: "custom",
|
|
2147
|
-
check: "custom",
|
|
2148
|
-
fn: t,
|
|
2149
|
-
...g(n)
|
|
2150
|
-
});
|
|
2151
|
-
}
|
|
2152
|
-
// @__NO_SIDE_EFFECTS__
|
|
2153
|
-
function Or(e) {
|
|
2154
|
-
const t = /* @__PURE__ */ Tr((n) => (n.addIssue = (o) => {
|
|
2155
|
-
if (typeof o == "string")
|
|
2156
|
-
n.issues.push(Q(o, n.value, t._zod.def));
|
|
2157
|
-
else {
|
|
2158
|
-
const r = o;
|
|
2159
|
-
r.fatal && (r.continue = !1), r.code ?? (r.code = "custom"), r.input ?? (r.input = n.value), r.inst ?? (r.inst = t), r.continue ?? (r.continue = !t._zod.def.abort), n.issues.push(Q(r));
|
|
2160
|
-
}
|
|
2161
|
-
}, e(n.value, n)));
|
|
2162
|
-
return t;
|
|
2163
|
-
}
|
|
2164
|
-
// @__NO_SIDE_EFFECTS__
|
|
2165
|
-
function Tr(e, t) {
|
|
2166
|
-
const n = new A({
|
|
2167
|
-
check: "custom",
|
|
2168
|
-
...g(t)
|
|
2169
|
-
});
|
|
2170
|
-
return n._zod.check = e, n;
|
|
2171
|
-
}
|
|
2172
|
-
function mt(e) {
|
|
2173
|
-
let t = e?.target ?? "draft-2020-12";
|
|
2174
|
-
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
2175
|
-
processors: e.processors ?? {},
|
|
2176
|
-
metadataRegistry: e?.metadata ?? X,
|
|
2177
|
-
target: t,
|
|
2178
|
-
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2179
|
-
override: e?.override ?? (() => {
|
|
2180
|
-
}),
|
|
2181
|
-
io: e?.io ?? "output",
|
|
2182
|
-
counter: 0,
|
|
2183
|
-
seen: /* @__PURE__ */ new Map(),
|
|
2184
|
-
cycles: e?.cycles ?? "ref",
|
|
2185
|
-
reused: e?.reused ?? "inline",
|
|
2186
|
-
external: e?.external ?? void 0
|
|
2187
|
-
};
|
|
2188
|
-
}
|
|
2189
|
-
function T(e, t, n = { path: [], schemaPath: [] }) {
|
|
2190
|
-
var o;
|
|
2191
|
-
const r = e._zod.def, s = t.seen.get(e);
|
|
2192
|
-
if (s)
|
|
2193
|
-
return s.count++, n.schemaPath.includes(e) && (s.cycle = n.path), s.schema;
|
|
2194
|
-
const i = { schema: {}, count: 1, cycle: void 0, path: n.path };
|
|
2195
|
-
t.seen.set(e, i);
|
|
2196
|
-
const a = e._zod.toJSONSchema?.();
|
|
2197
|
-
if (a)
|
|
2198
|
-
i.schema = a;
|
|
2199
|
-
else {
|
|
2200
|
-
const f = {
|
|
2201
|
-
...n,
|
|
2202
|
-
schemaPath: [...n.schemaPath, e],
|
|
2203
|
-
path: n.path
|
|
2204
|
-
};
|
|
2205
|
-
if (e._zod.processJSONSchema)
|
|
2206
|
-
e._zod.processJSONSchema(t, i.schema, f);
|
|
2207
|
-
else {
|
|
2208
|
-
const b = i.schema, w = t.processors[r.type];
|
|
2209
|
-
if (!w)
|
|
2210
|
-
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);
|
|
2211
|
-
w(e, t, b, f);
|
|
2212
|
-
}
|
|
2213
|
-
const h = e._zod.parent;
|
|
2214
|
-
h && (i.ref || (i.ref = h), T(h, t, f), t.seen.get(h).isParent = !0);
|
|
2215
|
-
}
|
|
2216
|
-
const u = t.metadataRegistry.get(e);
|
|
2217
|
-
return u && Object.assign(i.schema, u), t.io === "input" && C(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((o = i.schema).default ?? (o.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
2218
|
-
}
|
|
2219
|
-
function gt(e, t) {
|
|
2220
|
-
const n = e.seen.get(t);
|
|
2221
|
-
if (!n)
|
|
2222
|
-
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2223
|
-
const o = /* @__PURE__ */ new Map();
|
|
2224
|
-
for (const i of e.seen.entries()) {
|
|
2225
|
-
const a = e.metadataRegistry.get(i[0])?.id;
|
|
2226
|
-
if (a) {
|
|
2227
|
-
const u = o.get(a);
|
|
2228
|
-
if (u && u !== i[0])
|
|
2229
|
-
throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2230
|
-
o.set(a, i[0]);
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
const r = (i) => {
|
|
2234
|
-
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2235
|
-
if (e.external) {
|
|
2236
|
-
const h = e.external.registry.get(i[0])?.id, b = e.external.uri ?? ((E) => E);
|
|
2237
|
-
if (h)
|
|
2238
|
-
return { ref: b(h) };
|
|
2239
|
-
const w = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
2240
|
-
return i[1].defId = w, { defId: w, ref: `${b("__shared")}#/${a}/${w}` };
|
|
2241
|
-
}
|
|
2242
|
-
if (i[1] === n)
|
|
2243
|
-
return { ref: "#" };
|
|
2244
|
-
const l = `#/${a}/`, f = i[1].schema.id ?? `__schema${e.counter++}`;
|
|
2245
|
-
return { defId: f, ref: l + f };
|
|
2246
|
-
}, s = (i) => {
|
|
2247
|
-
if (i[1].schema.$ref)
|
|
2248
|
-
return;
|
|
2249
|
-
const a = i[1], { ref: u, defId: l } = r(i);
|
|
2250
|
-
a.def = { ...a.schema }, l && (a.defId = l);
|
|
2251
|
-
const f = a.schema;
|
|
2252
|
-
for (const h in f)
|
|
2253
|
-
delete f[h];
|
|
2254
|
-
f.$ref = u;
|
|
2255
|
-
};
|
|
2256
|
-
if (e.cycles === "throw")
|
|
2257
|
-
for (const i of e.seen.entries()) {
|
|
2258
|
-
const a = i[1];
|
|
2259
|
-
if (a.cycle)
|
|
2260
|
-
throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
2261
|
-
|
|
2262
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
2263
|
-
}
|
|
2264
|
-
for (const i of e.seen.entries()) {
|
|
2265
|
-
const a = i[1];
|
|
2266
|
-
if (t === i[0]) {
|
|
2267
|
-
s(i);
|
|
2268
|
-
continue;
|
|
2269
|
-
}
|
|
2270
|
-
if (e.external) {
|
|
2271
|
-
const l = e.external.registry.get(i[0])?.id;
|
|
2272
|
-
if (t !== i[0] && l) {
|
|
2273
|
-
s(i);
|
|
2274
|
-
continue;
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2277
|
-
if (e.metadataRegistry.get(i[0])?.id) {
|
|
2278
|
-
s(i);
|
|
2279
|
-
continue;
|
|
2280
|
-
}
|
|
2281
|
-
if (a.cycle) {
|
|
2282
|
-
s(i);
|
|
2283
|
-
continue;
|
|
2284
|
-
}
|
|
2285
|
-
if (a.count > 1 && e.reused === "ref") {
|
|
2286
|
-
s(i);
|
|
2287
|
-
continue;
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
function _t(e, t) {
|
|
2292
|
-
const n = e.seen.get(t);
|
|
2293
|
-
if (!n)
|
|
2294
|
-
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2295
|
-
const o = (i) => {
|
|
2296
|
-
const a = e.seen.get(i);
|
|
2297
|
-
if (a.ref === null)
|
|
2298
|
-
return;
|
|
2299
|
-
const u = a.def ?? a.schema, l = { ...u }, f = a.ref;
|
|
2300
|
-
if (a.ref = null, f) {
|
|
2301
|
-
o(f);
|
|
2302
|
-
const b = e.seen.get(f), w = b.schema;
|
|
2303
|
-
if (w.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (u.allOf = u.allOf ?? [], u.allOf.push(w)) : Object.assign(u, w), Object.assign(u, l), i._zod.parent === f)
|
|
2304
|
-
for (const N in u)
|
|
2305
|
-
N === "$ref" || N === "allOf" || N in l || delete u[N];
|
|
2306
|
-
if (w.$ref && b.def)
|
|
2307
|
-
for (const N in u)
|
|
2308
|
-
N === "$ref" || N === "allOf" || N in b.def && JSON.stringify(u[N]) === JSON.stringify(b.def[N]) && delete u[N];
|
|
2309
|
-
}
|
|
2310
|
-
const h = i._zod.parent;
|
|
2311
|
-
if (h && h !== f) {
|
|
2312
|
-
o(h);
|
|
2313
|
-
const b = e.seen.get(h);
|
|
2314
|
-
if (b?.schema.$ref && (u.$ref = b.schema.$ref, b.def))
|
|
2315
|
-
for (const w in u)
|
|
2316
|
-
w === "$ref" || w === "allOf" || w in b.def && JSON.stringify(u[w]) === JSON.stringify(b.def[w]) && delete u[w];
|
|
2317
|
-
}
|
|
2318
|
-
e.override({
|
|
2319
|
-
zodSchema: i,
|
|
2320
|
-
jsonSchema: u,
|
|
2321
|
-
path: a.path ?? []
|
|
2322
|
-
});
|
|
2323
|
-
};
|
|
2324
|
-
for (const i of [...e.seen.entries()].reverse())
|
|
2325
|
-
o(i[0]);
|
|
2326
|
-
const r = {};
|
|
2327
|
-
if (e.target === "draft-2020-12" ? r.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? r.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? r.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
|
|
2328
|
-
const i = e.external.registry.get(t)?.id;
|
|
2329
|
-
if (!i)
|
|
2330
|
-
throw new Error("Schema is missing an `id` property");
|
|
2331
|
-
r.$id = e.external.uri(i);
|
|
2332
|
-
}
|
|
2333
|
-
Object.assign(r, n.def ?? n.schema);
|
|
2334
|
-
const s = e.external?.defs ?? {};
|
|
2335
|
-
for (const i of e.seen.entries()) {
|
|
2336
|
-
const a = i[1];
|
|
2337
|
-
a.def && a.defId && (s[a.defId] = a.def);
|
|
2338
|
-
}
|
|
2339
|
-
e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? r.$defs = s : r.definitions = s);
|
|
2340
|
-
try {
|
|
2341
|
-
const i = JSON.parse(JSON.stringify(r));
|
|
2342
|
-
return Object.defineProperty(i, "~standard", {
|
|
2343
|
-
value: {
|
|
2344
|
-
...t["~standard"],
|
|
2345
|
-
jsonSchema: {
|
|
2346
|
-
input: ue(t, "input", e.processors),
|
|
2347
|
-
output: ue(t, "output", e.processors)
|
|
2348
|
-
}
|
|
2349
|
-
},
|
|
2350
|
-
enumerable: !1,
|
|
2351
|
-
writable: !1
|
|
2352
|
-
}), i;
|
|
2353
|
-
} catch {
|
|
2354
|
-
throw new Error("Error converting schema to JSON.");
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
function C(e, t) {
|
|
2358
|
-
const n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
2359
|
-
if (n.seen.has(e))
|
|
2360
|
-
return !1;
|
|
2361
|
-
n.seen.add(e);
|
|
2362
|
-
const o = e._zod.def;
|
|
2363
|
-
if (o.type === "transform")
|
|
2364
|
-
return !0;
|
|
2365
|
-
if (o.type === "array")
|
|
2366
|
-
return C(o.element, n);
|
|
2367
|
-
if (o.type === "set")
|
|
2368
|
-
return C(o.valueType, n);
|
|
2369
|
-
if (o.type === "lazy")
|
|
2370
|
-
return C(o.getter(), n);
|
|
2371
|
-
if (o.type === "promise" || o.type === "optional" || o.type === "nonoptional" || o.type === "nullable" || o.type === "readonly" || o.type === "default" || o.type === "prefault")
|
|
2372
|
-
return C(o.innerType, n);
|
|
2373
|
-
if (o.type === "intersection")
|
|
2374
|
-
return C(o.left, n) || C(o.right, n);
|
|
2375
|
-
if (o.type === "record" || o.type === "map")
|
|
2376
|
-
return C(o.keyType, n) || C(o.valueType, n);
|
|
2377
|
-
if (o.type === "pipe")
|
|
2378
|
-
return C(o.in, n) || C(o.out, n);
|
|
2379
|
-
if (o.type === "object") {
|
|
2380
|
-
for (const r in o.shape)
|
|
2381
|
-
if (C(o.shape[r], n))
|
|
2382
|
-
return !0;
|
|
2383
|
-
return !1;
|
|
2384
|
-
}
|
|
2385
|
-
if (o.type === "union") {
|
|
2386
|
-
for (const r of o.options)
|
|
2387
|
-
if (C(r, n))
|
|
2388
|
-
return !0;
|
|
2389
|
-
return !1;
|
|
2390
|
-
}
|
|
2391
|
-
if (o.type === "tuple") {
|
|
2392
|
-
for (const r of o.items)
|
|
2393
|
-
if (C(r, n))
|
|
2394
|
-
return !0;
|
|
2395
|
-
return !!(o.rest && C(o.rest, n));
|
|
2396
|
-
}
|
|
2397
|
-
return !1;
|
|
2398
|
-
}
|
|
2399
|
-
const Ir = (e, t = {}) => (n) => {
|
|
2400
|
-
const o = mt({ ...n, processors: t });
|
|
2401
|
-
return T(e, o), gt(o, e), _t(o, e);
|
|
2402
|
-
}, ue = (e, t, n = {}) => (o) => {
|
|
2403
|
-
const { libraryOptions: r, target: s } = o ?? {}, i = mt({ ...r ?? {}, target: s, io: t, processors: n });
|
|
2404
|
-
return T(e, i), gt(i, e), _t(i, e);
|
|
2405
|
-
}, Nr = {
|
|
2406
|
-
guid: "uuid",
|
|
2407
|
-
url: "uri",
|
|
2408
|
-
datetime: "date-time",
|
|
2409
|
-
json_string: "json-string",
|
|
2410
|
-
regex: ""
|
|
2411
|
-
// do not set
|
|
2412
|
-
}, Er = (e, t, n, o) => {
|
|
2413
|
-
const r = n;
|
|
2414
|
-
r.type = "string";
|
|
2415
|
-
const { minimum: s, maximum: i, format: a, patterns: u, contentEncoding: l } = e._zod.bag;
|
|
2416
|
-
if (typeof s == "number" && (r.minLength = s), typeof i == "number" && (r.maxLength = i), a && (r.format = Nr[a] ?? a, r.format === "" && delete r.format, a === "time" && delete r.format), l && (r.contentEncoding = l), u && u.size > 0) {
|
|
2417
|
-
const f = [...u];
|
|
2418
|
-
f.length === 1 ? r.pattern = f[0].source : f.length > 1 && (r.allOf = [
|
|
2419
|
-
...f.map((h) => ({
|
|
2420
|
-
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
2421
|
-
pattern: h.source
|
|
2422
|
-
}))
|
|
2423
|
-
]);
|
|
2424
|
-
}
|
|
2425
|
-
}, Cr = (e, t, n, o) => {
|
|
2426
|
-
const r = n, { minimum: s, maximum: i, format: a, multipleOf: u, exclusiveMaximum: l, exclusiveMinimum: f } = e._zod.bag;
|
|
2427
|
-
typeof a == "string" && a.includes("int") ? r.type = "integer" : r.type = "number", typeof f == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (r.minimum = f, r.exclusiveMinimum = !0) : r.exclusiveMinimum = f), typeof s == "number" && (r.minimum = s, typeof f == "number" && t.target !== "draft-04" && (f >= s ? delete r.minimum : delete r.exclusiveMinimum)), typeof l == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (r.maximum = l, r.exclusiveMaximum = !0) : r.exclusiveMaximum = l), typeof i == "number" && (r.maximum = i, typeof l == "number" && t.target !== "draft-04" && (l <= i ? delete r.maximum : delete r.exclusiveMaximum)), typeof u == "number" && (r.multipleOf = u);
|
|
2428
|
-
}, jr = (e, t, n, o) => {
|
|
2429
|
-
n.type = "boolean";
|
|
2430
|
-
}, Ar = (e, t, n, o) => {
|
|
2431
|
-
t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
|
|
2432
|
-
}, Rr = (e, t, n, o) => {
|
|
2433
|
-
n.not = {};
|
|
2434
|
-
}, Dr = (e, t, n, o) => {
|
|
2435
|
-
}, xr = (e, t, n, o) => {
|
|
2436
|
-
const r = e._zod.def, s = qe(r.entries);
|
|
2437
|
-
s.every((i) => typeof i == "number") && (n.type = "number"), s.every((i) => typeof i == "string") && (n.type = "string"), n.enum = s;
|
|
2438
|
-
}, Fr = (e, t, n, o) => {
|
|
2439
|
-
if (t.unrepresentable === "throw")
|
|
2440
|
-
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
2441
|
-
}, Ur = (e, t, n, o) => {
|
|
2442
|
-
if (t.unrepresentable === "throw")
|
|
2443
|
-
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2444
|
-
}, Lr = (e, t, n, o) => {
|
|
2445
|
-
const r = n, s = e._zod.def, { minimum: i, maximum: a } = e._zod.bag;
|
|
2446
|
-
typeof i == "number" && (r.minItems = i), typeof a == "number" && (r.maxItems = a), r.type = "array", r.items = T(s.element, t, { ...o, path: [...o.path, "items"] });
|
|
2447
|
-
}, Mr = (e, t, n, o) => {
|
|
2448
|
-
const r = n, s = e._zod.def;
|
|
2449
|
-
r.type = "object", r.properties = {};
|
|
2450
|
-
const i = s.shape;
|
|
2451
|
-
for (const l in i)
|
|
2452
|
-
r.properties[l] = T(i[l], t, {
|
|
2453
|
-
...o,
|
|
2454
|
-
path: [...o.path, "properties", l]
|
|
2455
|
-
});
|
|
2456
|
-
const a = new Set(Object.keys(i)), u = new Set([...a].filter((l) => {
|
|
2457
|
-
const f = s.shape[l]._zod;
|
|
2458
|
-
return t.io === "input" ? f.optin === void 0 : f.optout === void 0;
|
|
2459
|
-
}));
|
|
2460
|
-
u.size > 0 && (r.required = Array.from(u)), s.catchall?._zod.def.type === "never" ? r.additionalProperties = !1 : s.catchall ? s.catchall && (r.additionalProperties = T(s.catchall, t, {
|
|
2461
|
-
...o,
|
|
2462
|
-
path: [...o.path, "additionalProperties"]
|
|
2463
|
-
})) : t.io === "output" && (r.additionalProperties = !1);
|
|
2464
|
-
}, Jr = (e, t, n, o) => {
|
|
2465
|
-
const r = e._zod.def, s = r.inclusive === !1, i = r.options.map((a, u) => T(a, t, {
|
|
2466
|
-
...o,
|
|
2467
|
-
path: [...o.path, s ? "oneOf" : "anyOf", u]
|
|
2468
|
-
}));
|
|
2469
|
-
s ? n.oneOf = i : n.anyOf = i;
|
|
2470
|
-
}, Vr = (e, t, n, o) => {
|
|
2471
|
-
const r = e._zod.def, s = T(r.left, t, {
|
|
2472
|
-
...o,
|
|
2473
|
-
path: [...o.path, "allOf", 0]
|
|
2474
|
-
}), i = T(r.right, t, {
|
|
2475
|
-
...o,
|
|
2476
|
-
path: [...o.path, "allOf", 1]
|
|
2477
|
-
}), a = (l) => "allOf" in l && Object.keys(l).length === 1, u = [
|
|
2478
|
-
...a(s) ? s.allOf : [s],
|
|
2479
|
-
...a(i) ? i.allOf : [i]
|
|
2480
|
-
];
|
|
2481
|
-
n.allOf = u;
|
|
2482
|
-
}, Br = (e, t, n, o) => {
|
|
2483
|
-
const r = n, s = e._zod.def;
|
|
2484
|
-
r.type = "array";
|
|
2485
|
-
const i = t.target === "draft-2020-12" ? "prefixItems" : "items", a = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", u = s.items.map((b, w) => T(b, t, {
|
|
2486
|
-
...o,
|
|
2487
|
-
path: [...o.path, i, w]
|
|
2488
|
-
})), l = s.rest ? T(s.rest, t, {
|
|
2489
|
-
...o,
|
|
2490
|
-
path: [...o.path, a, ...t.target === "openapi-3.0" ? [s.items.length] : []]
|
|
2491
|
-
}) : null;
|
|
2492
|
-
t.target === "draft-2020-12" ? (r.prefixItems = u, l && (r.items = l)) : t.target === "openapi-3.0" ? (r.items = {
|
|
2493
|
-
anyOf: u
|
|
2494
|
-
}, l && r.items.anyOf.push(l), r.minItems = u.length, l || (r.maxItems = u.length)) : (r.items = u, l && (r.additionalItems = l));
|
|
2495
|
-
const { minimum: f, maximum: h } = e._zod.bag;
|
|
2496
|
-
typeof f == "number" && (r.minItems = f), typeof h == "number" && (r.maxItems = h);
|
|
2497
|
-
}, Kr = (e, t, n, o) => {
|
|
2498
|
-
const r = n, s = e._zod.def;
|
|
2499
|
-
r.type = "object";
|
|
2500
|
-
const i = s.keyType, u = i._zod.bag?.patterns;
|
|
2501
|
-
if (s.mode === "loose" && u && u.size > 0) {
|
|
2502
|
-
const f = T(s.valueType, t, {
|
|
2503
|
-
...o,
|
|
2504
|
-
path: [...o.path, "patternProperties", "*"]
|
|
2505
|
-
});
|
|
2506
|
-
r.patternProperties = {};
|
|
2507
|
-
for (const h of u)
|
|
2508
|
-
r.patternProperties[h.source] = f;
|
|
2509
|
-
} else
|
|
2510
|
-
(t.target === "draft-07" || t.target === "draft-2020-12") && (r.propertyNames = T(s.keyType, t, {
|
|
2511
|
-
...o,
|
|
2512
|
-
path: [...o.path, "propertyNames"]
|
|
2513
|
-
})), r.additionalProperties = T(s.valueType, t, {
|
|
2514
|
-
...o,
|
|
2515
|
-
path: [...o.path, "additionalProperties"]
|
|
2516
|
-
});
|
|
2517
|
-
const l = i._zod.values;
|
|
2518
|
-
if (l) {
|
|
2519
|
-
const f = [...l].filter((h) => typeof h == "string" || typeof h == "number");
|
|
2520
|
-
f.length > 0 && (r.required = f);
|
|
2521
|
-
}
|
|
2522
|
-
}, Wr = (e, t, n, o) => {
|
|
2523
|
-
const r = e._zod.def, s = T(r.innerType, t, o), i = t.seen.get(e);
|
|
2524
|
-
t.target === "openapi-3.0" ? (i.ref = r.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
|
|
2525
|
-
}, Gr = (e, t, n, o) => {
|
|
2526
|
-
const r = e._zod.def;
|
|
2527
|
-
T(r.innerType, t, o);
|
|
2528
|
-
const s = t.seen.get(e);
|
|
2529
|
-
s.ref = r.innerType;
|
|
2530
|
-
}, qr = (e, t, n, o) => {
|
|
2531
|
-
const r = e._zod.def;
|
|
2532
|
-
T(r.innerType, t, o);
|
|
2533
|
-
const s = t.seen.get(e);
|
|
2534
|
-
s.ref = r.innerType, n.default = JSON.parse(JSON.stringify(r.defaultValue));
|
|
2535
|
-
}, Yr = (e, t, n, o) => {
|
|
2536
|
-
const r = e._zod.def;
|
|
2537
|
-
T(r.innerType, t, o);
|
|
2538
|
-
const s = t.seen.get(e);
|
|
2539
|
-
s.ref = r.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(r.defaultValue)));
|
|
2540
|
-
}, Xr = (e, t, n, o) => {
|
|
2541
|
-
const r = e._zod.def;
|
|
2542
|
-
T(r.innerType, t, o);
|
|
2543
|
-
const s = t.seen.get(e);
|
|
2544
|
-
s.ref = r.innerType;
|
|
2545
|
-
let i;
|
|
2546
|
-
try {
|
|
2547
|
-
i = r.catchValue(void 0);
|
|
2548
|
-
} catch {
|
|
2549
|
-
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
2550
|
-
}
|
|
2551
|
-
n.default = i;
|
|
2552
|
-
}, Hr = (e, t, n, o) => {
|
|
2553
|
-
const r = e._zod.def, s = t.io === "input" ? r.in._zod.def.type === "transform" ? r.out : r.in : r.out;
|
|
2554
|
-
T(s, t, o);
|
|
2555
|
-
const i = t.seen.get(e);
|
|
2556
|
-
i.ref = s;
|
|
2557
|
-
}, Qr = (e, t, n, o) => {
|
|
2558
|
-
const r = e._zod.def;
|
|
2559
|
-
T(r.innerType, t, o);
|
|
2560
|
-
const s = t.seen.get(e);
|
|
2561
|
-
s.ref = r.innerType, n.readOnly = !0;
|
|
2562
|
-
}, vt = (e, t, n, o) => {
|
|
2563
|
-
const r = e._zod.def;
|
|
2564
|
-
T(r.innerType, t, o);
|
|
2565
|
-
const s = t.seen.get(e);
|
|
2566
|
-
s.ref = r.innerType;
|
|
2567
|
-
}, ei = (e, t, n, o) => {
|
|
2568
|
-
const r = e._zod.innerType;
|
|
2569
|
-
T(r, t, o);
|
|
2570
|
-
const s = t.seen.get(e);
|
|
2571
|
-
s.ref = r;
|
|
2572
|
-
}, ti = /* @__PURE__ */ p("ZodISODateTime", (e, t) => {
|
|
2573
|
-
Yn.init(e, t), I.init(e, t);
|
|
2574
|
-
});
|
|
2575
|
-
function ni(e) {
|
|
2576
|
-
return /* @__PURE__ */ ir(ti, e);
|
|
2577
|
-
}
|
|
2578
|
-
const oi = /* @__PURE__ */ p("ZodISODate", (e, t) => {
|
|
2579
|
-
Xn.init(e, t), I.init(e, t);
|
|
2580
|
-
});
|
|
2581
|
-
function ri(e) {
|
|
2582
|
-
return /* @__PURE__ */ sr(oi, e);
|
|
2583
|
-
}
|
|
2584
|
-
const ii = /* @__PURE__ */ p("ZodISOTime", (e, t) => {
|
|
2585
|
-
Hn.init(e, t), I.init(e, t);
|
|
2586
|
-
});
|
|
2587
|
-
function si(e) {
|
|
2588
|
-
return /* @__PURE__ */ ar(ii, e);
|
|
2589
|
-
}
|
|
2590
|
-
const ai = /* @__PURE__ */ p("ZodISODuration", (e, t) => {
|
|
2591
|
-
Qn.init(e, t), I.init(e, t);
|
|
2592
|
-
});
|
|
2593
|
-
function ci(e) {
|
|
2594
|
-
return /* @__PURE__ */ cr(ai, e);
|
|
2595
|
-
}
|
|
2596
|
-
const bt = (e, t) => {
|
|
2597
|
-
Qe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2598
|
-
format: {
|
|
2599
|
-
value: (n) => Lt(e, n)
|
|
2600
|
-
// enumerable: false,
|
|
2601
|
-
},
|
|
2602
|
-
flatten: {
|
|
2603
|
-
value: (n) => Ut(e, n)
|
|
2604
|
-
// enumerable: false,
|
|
2605
|
-
},
|
|
2606
|
-
addIssue: {
|
|
2607
|
-
value: (n) => {
|
|
2608
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues, ge, 2);
|
|
2609
|
-
}
|
|
2610
|
-
// enumerable: false,
|
|
2611
|
-
},
|
|
2612
|
-
addIssues: {
|
|
2613
|
-
value: (n) => {
|
|
2614
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues, ge, 2);
|
|
2615
|
-
}
|
|
2616
|
-
// enumerable: false,
|
|
2617
|
-
},
|
|
2618
|
-
isEmpty: {
|
|
2619
|
-
get() {
|
|
2620
|
-
return e.issues.length === 0;
|
|
2621
|
-
}
|
|
2622
|
-
// enumerable: false,
|
|
2623
|
-
}
|
|
2624
|
-
});
|
|
2625
|
-
}, ui = p("ZodError", bt), R = p("ZodError", bt, {
|
|
2626
|
-
Parent: Error
|
|
2627
|
-
}), li = /* @__PURE__ */ ke(R), pi = /* @__PURE__ */ $e(R), fi = /* @__PURE__ */ pe(R), di = /* @__PURE__ */ fe(R), hi = /* @__PURE__ */ Vt(R), mi = /* @__PURE__ */ Bt(R), gi = /* @__PURE__ */ Kt(R), _i = /* @__PURE__ */ Wt(R), vi = /* @__PURE__ */ Gt(R), bi = /* @__PURE__ */ qt(R), yi = /* @__PURE__ */ Yt(R), zi = /* @__PURE__ */ Xt(R), P = /* @__PURE__ */ p("ZodType", (e, t) => (S.init(e, t), Object.assign(e["~standard"], {
|
|
2628
|
-
jsonSchema: {
|
|
2629
|
-
input: ue(e, "input"),
|
|
2630
|
-
output: ue(e, "output")
|
|
2631
|
-
}
|
|
2632
|
-
}), e.toJSONSchema = Ir(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(M(t, {
|
|
2633
|
-
checks: [
|
|
2634
|
-
...t.checks ?? [],
|
|
2635
|
-
...n.map((o) => typeof o == "function" ? { _zod: { check: o, def: { check: "custom" }, onattach: [] } } : o)
|
|
2636
|
-
]
|
|
2637
|
-
}), {
|
|
2638
|
-
parent: !0
|
|
2639
|
-
}), e.with = e.check, e.clone = (n, o) => J(e, n, o), e.brand = () => e, e.register = ((n, o) => (n.add(e, o), e)), e.parse = (n, o) => li(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => fi(e, n, o), e.parseAsync = async (n, o) => pi(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => di(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => hi(e, n, o), e.decode = (n, o) => mi(e, n, o), e.encodeAsync = async (n, o) => gi(e, n, o), e.decodeAsync = async (n, o) => _i(e, n, o), e.safeEncode = (n, o) => vi(e, n, o), e.safeDecode = (n, o) => bi(e, n, o), e.safeEncodeAsync = async (n, o) => yi(e, n, o), e.safeDecodeAsync = async (n, o) => zi(e, n, o), e.refine = (n, o) => e.check(_s(n, o)), e.superRefine = (n) => e.check(vs(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ Y(n)), e.optional = () => Ve(e), e.exactOptional = () => ns(e), e.nullable = () => Be(e), e.nullish = () => Ve(Be(e)), e.nonoptional = (n) => cs(e, n), e.array = () => L(e), e.or = (n) => y([e, n]), e.and = (n) => Yi(e, n), e.transform = (n) => Ke(e, es(n)), e.default = (n) => is(e, n), e.prefault = (n) => as(e, n), e.catch = (n) => ls(e, n), e.pipe = (n) => Ke(e, n), e.readonly = () => ds(e), e.describe = (n) => {
|
|
2640
|
-
const o = e.clone();
|
|
2641
|
-
return X.add(o, { description: n }), o;
|
|
2642
|
-
}, Object.defineProperty(e, "description", {
|
|
2643
|
-
get() {
|
|
2644
|
-
return X.get(e)?.description;
|
|
2645
|
-
},
|
|
2646
|
-
configurable: !0
|
|
2647
|
-
}), e.meta = (...n) => {
|
|
2648
|
-
if (n.length === 0)
|
|
2649
|
-
return X.get(e);
|
|
2650
|
-
const o = e.clone();
|
|
2651
|
-
return X.add(o, n[0]), o;
|
|
2652
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), yt = /* @__PURE__ */ p("_ZodString", (e, t) => {
|
|
2653
|
-
Ze.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, r, s) => Er(e, o, r);
|
|
2654
|
-
const n = e._zod.bag;
|
|
2655
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...o) => e.check(/* @__PURE__ */ mr(...o)), e.includes = (...o) => e.check(/* @__PURE__ */ vr(...o)), e.startsWith = (...o) => e.check(/* @__PURE__ */ br(...o)), e.endsWith = (...o) => e.check(/* @__PURE__ */ yr(...o)), e.min = (...o) => e.check(/* @__PURE__ */ ce(...o)), e.max = (...o) => e.check(/* @__PURE__ */ dt(...o)), e.length = (...o) => e.check(/* @__PURE__ */ ht(...o)), e.nonempty = (...o) => e.check(/* @__PURE__ */ ce(1, ...o)), e.lowercase = (o) => e.check(/* @__PURE__ */ gr(o)), e.uppercase = (o) => e.check(/* @__PURE__ */ _r(o)), e.trim = () => e.check(/* @__PURE__ */ wr()), e.normalize = (...o) => e.check(/* @__PURE__ */ zr(...o)), e.toLowerCase = () => e.check(/* @__PURE__ */ kr()), e.toUpperCase = () => e.check(/* @__PURE__ */ $r()), e.slugify = () => e.check(/* @__PURE__ */ Zr());
|
|
2656
|
-
}), wi = /* @__PURE__ */ p("ZodString", (e, t) => {
|
|
2657
|
-
Ze.init(e, t), yt.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ xo(ki, n)), e.url = (n) => e.check(/* @__PURE__ */ Jo($i, n)), e.jwt = (n) => e.check(/* @__PURE__ */ rr(Fi, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Vo(Zi, n)), e.guid = (n) => e.check(/* @__PURE__ */ xe(Me, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Fo(re, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Uo(re, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Lo(re, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Mo(re, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Bo(Si, n)), e.guid = (n) => e.check(/* @__PURE__ */ xe(Me, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Ko(Pi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Wo(Oi, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Go(Ti, n)), e.base64 = (n) => e.check(/* @__PURE__ */ tr(Ri, n)), e.base64url = (n) => e.check(/* @__PURE__ */ nr(Di, n)), e.xid = (n) => e.check(/* @__PURE__ */ qo(Ii, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Yo(Ni, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Xo(Ei, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ Ho(Ci, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ Qo(ji, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ er(Ai, n)), e.e164 = (n) => e.check(/* @__PURE__ */ or(xi, n)), e.datetime = (n) => e.check(ni(n)), e.date = (n) => e.check(ri(n)), e.time = (n) => e.check(si(n)), e.duration = (n) => e.check(ci(n));
|
|
2658
|
-
});
|
|
2659
|
-
function c(e) {
|
|
2660
|
-
return /* @__PURE__ */ Do(wi, e);
|
|
2661
|
-
}
|
|
2662
|
-
const I = /* @__PURE__ */ p("ZodStringFormat", (e, t) => {
|
|
2663
|
-
O.init(e, t), yt.init(e, t);
|
|
2664
|
-
}), ki = /* @__PURE__ */ p("ZodEmail", (e, t) => {
|
|
2665
|
-
Ln.init(e, t), I.init(e, t);
|
|
2666
|
-
}), Me = /* @__PURE__ */ p("ZodGUID", (e, t) => {
|
|
2667
|
-
Fn.init(e, t), I.init(e, t);
|
|
2668
|
-
}), re = /* @__PURE__ */ p("ZodUUID", (e, t) => {
|
|
2669
|
-
Un.init(e, t), I.init(e, t);
|
|
2670
|
-
}), $i = /* @__PURE__ */ p("ZodURL", (e, t) => {
|
|
2671
|
-
Mn.init(e, t), I.init(e, t);
|
|
2672
|
-
}), Zi = /* @__PURE__ */ p("ZodEmoji", (e, t) => {
|
|
2673
|
-
Jn.init(e, t), I.init(e, t);
|
|
2674
|
-
}), Si = /* @__PURE__ */ p("ZodNanoID", (e, t) => {
|
|
2675
|
-
Vn.init(e, t), I.init(e, t);
|
|
2676
|
-
}), Pi = /* @__PURE__ */ p("ZodCUID", (e, t) => {
|
|
2677
|
-
Bn.init(e, t), I.init(e, t);
|
|
2678
|
-
}), Oi = /* @__PURE__ */ p("ZodCUID2", (e, t) => {
|
|
2679
|
-
Kn.init(e, t), I.init(e, t);
|
|
2680
|
-
}), Ti = /* @__PURE__ */ p("ZodULID", (e, t) => {
|
|
2681
|
-
Wn.init(e, t), I.init(e, t);
|
|
2682
|
-
}), Ii = /* @__PURE__ */ p("ZodXID", (e, t) => {
|
|
2683
|
-
Gn.init(e, t), I.init(e, t);
|
|
2684
|
-
}), Ni = /* @__PURE__ */ p("ZodKSUID", (e, t) => {
|
|
2685
|
-
qn.init(e, t), I.init(e, t);
|
|
2686
|
-
}), Ei = /* @__PURE__ */ p("ZodIPv4", (e, t) => {
|
|
2687
|
-
eo.init(e, t), I.init(e, t);
|
|
2688
|
-
}), Ci = /* @__PURE__ */ p("ZodIPv6", (e, t) => {
|
|
2689
|
-
to.init(e, t), I.init(e, t);
|
|
2690
|
-
}), ji = /* @__PURE__ */ p("ZodCIDRv4", (e, t) => {
|
|
2691
|
-
no.init(e, t), I.init(e, t);
|
|
2692
|
-
}), Ai = /* @__PURE__ */ p("ZodCIDRv6", (e, t) => {
|
|
2693
|
-
oo.init(e, t), I.init(e, t);
|
|
2694
|
-
}), Ri = /* @__PURE__ */ p("ZodBase64", (e, t) => {
|
|
2695
|
-
ro.init(e, t), I.init(e, t);
|
|
2696
|
-
}), Di = /* @__PURE__ */ p("ZodBase64URL", (e, t) => {
|
|
2697
|
-
so.init(e, t), I.init(e, t);
|
|
2698
|
-
}), xi = /* @__PURE__ */ p("ZodE164", (e, t) => {
|
|
2699
|
-
ao.init(e, t), I.init(e, t);
|
|
2700
|
-
}), Fi = /* @__PURE__ */ p("ZodJWT", (e, t) => {
|
|
2701
|
-
uo.init(e, t), I.init(e, t);
|
|
2702
|
-
}), zt = /* @__PURE__ */ p("ZodNumber", (e, t) => {
|
|
2703
|
-
ut.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, r, s) => Cr(e, o, r), e.gt = (o, r) => e.check(/* @__PURE__ */ Ue(o, r)), e.gte = (o, r) => e.check(/* @__PURE__ */ me(o, r)), e.min = (o, r) => e.check(/* @__PURE__ */ me(o, r)), e.lt = (o, r) => e.check(/* @__PURE__ */ Fe(o, r)), e.lte = (o, r) => e.check(/* @__PURE__ */ he(o, r)), e.max = (o, r) => e.check(/* @__PURE__ */ he(o, r)), e.int = (o) => e.check(Je(o)), e.safe = (o) => e.check(Je(o)), e.positive = (o) => e.check(/* @__PURE__ */ Ue(0, o)), e.nonnegative = (o) => e.check(/* @__PURE__ */ me(0, o)), e.negative = (o) => e.check(/* @__PURE__ */ Fe(0, o)), e.nonpositive = (o) => e.check(/* @__PURE__ */ he(0, o)), e.multipleOf = (o, r) => e.check(/* @__PURE__ */ Le(o, r)), e.step = (o, r) => e.check(/* @__PURE__ */ Le(o, r)), e.finite = () => e;
|
|
2704
|
-
const n = e._zod.bag;
|
|
2705
|
-
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2706
|
-
});
|
|
2707
|
-
function v(e) {
|
|
2708
|
-
return /* @__PURE__ */ ur(zt, e);
|
|
2709
|
-
}
|
|
2710
|
-
const Ui = /* @__PURE__ */ p("ZodNumberFormat", (e, t) => {
|
|
2711
|
-
lo.init(e, t), zt.init(e, t);
|
|
2712
|
-
});
|
|
2713
|
-
function Je(e) {
|
|
2714
|
-
return /* @__PURE__ */ lr(Ui, e);
|
|
2715
|
-
}
|
|
2716
|
-
const Li = /* @__PURE__ */ p("ZodBoolean", (e, t) => {
|
|
2717
|
-
po.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => jr(e, n, o);
|
|
2718
|
-
});
|
|
2719
|
-
function d(e) {
|
|
2720
|
-
return /* @__PURE__ */ pr(Li, e);
|
|
2721
|
-
}
|
|
2722
|
-
const Mi = /* @__PURE__ */ p("ZodNull", (e, t) => {
|
|
2723
|
-
fo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Ar(e, n, o);
|
|
2724
|
-
});
|
|
2725
|
-
function z(e) {
|
|
2726
|
-
return /* @__PURE__ */ fr(Mi, e);
|
|
2727
|
-
}
|
|
2728
|
-
const Ji = /* @__PURE__ */ p("ZodUnknown", (e, t) => {
|
|
2729
|
-
ho.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Dr();
|
|
2730
|
-
});
|
|
2731
|
-
function Z() {
|
|
2732
|
-
return /* @__PURE__ */ dr(Ji);
|
|
2733
|
-
}
|
|
2734
|
-
const Vi = /* @__PURE__ */ p("ZodNever", (e, t) => {
|
|
2735
|
-
mo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Rr(e, n, o);
|
|
2736
|
-
});
|
|
2737
|
-
function Bi(e) {
|
|
2738
|
-
return /* @__PURE__ */ hr(Vi, e);
|
|
2739
|
-
}
|
|
2740
|
-
const Ki = /* @__PURE__ */ p("ZodArray", (e, t) => {
|
|
2741
|
-
go.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Lr(e, n, o, r), e.element = t.element, e.min = (n, o) => e.check(/* @__PURE__ */ ce(n, o)), e.nonempty = (n) => e.check(/* @__PURE__ */ ce(1, n)), e.max = (n, o) => e.check(/* @__PURE__ */ dt(n, o)), e.length = (n, o) => e.check(/* @__PURE__ */ ht(n, o)), e.unwrap = () => e.element;
|
|
2742
|
-
});
|
|
2743
|
-
function L(e, t) {
|
|
2744
|
-
return /* @__PURE__ */ Sr(Ki, e, t);
|
|
2745
|
-
}
|
|
2746
|
-
const Wi = /* @__PURE__ */ p("ZodObject", (e, t) => {
|
|
2747
|
-
vo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Mr(e, n, o, r), $(e, "shape", () => t.shape), e.keyof = () => k(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Z() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Z() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Bi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => At(e, n), e.safeExtend = (n) => Rt(e, n), e.merge = (n) => Dt(e, n), e.pick = (n) => Ct(e, n), e.omit = (n) => jt(e, n), e.partial = (...n) => xt(wt, e, n[0]), e.required = (...n) => Ft(kt, e, n[0]);
|
|
2748
|
-
});
|
|
2749
|
-
function _(e, t) {
|
|
2750
|
-
const n = {
|
|
2751
|
-
type: "object",
|
|
2752
|
-
shape: e ?? {},
|
|
2753
|
-
...g(t)
|
|
2754
|
-
};
|
|
2755
|
-
return new Wi(n);
|
|
2756
|
-
}
|
|
2757
|
-
const Gi = /* @__PURE__ */ p("ZodUnion", (e, t) => {
|
|
2758
|
-
bo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Jr(e, n, o, r), e.options = t.options;
|
|
2759
|
-
});
|
|
2760
|
-
function y(e, t) {
|
|
2761
|
-
return new Gi({
|
|
2762
|
-
type: "union",
|
|
2763
|
-
options: e,
|
|
2764
|
-
...g(t)
|
|
2765
|
-
});
|
|
2766
|
-
}
|
|
2767
|
-
const qi = /* @__PURE__ */ p("ZodIntersection", (e, t) => {
|
|
2768
|
-
yo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Vr(e, n, o, r);
|
|
2769
|
-
});
|
|
2770
|
-
function Yi(e, t) {
|
|
2771
|
-
return new qi({
|
|
2772
|
-
type: "intersection",
|
|
2773
|
-
left: e,
|
|
2774
|
-
right: t
|
|
2775
|
-
});
|
|
2776
|
-
}
|
|
2777
|
-
const Xi = /* @__PURE__ */ p("ZodTuple", (e, t) => {
|
|
2778
|
-
zo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Br(e, n, o, r), e.rest = (n) => e.clone({
|
|
2779
|
-
...e._zod.def,
|
|
2780
|
-
rest: n
|
|
2781
|
-
});
|
|
2782
|
-
});
|
|
2783
|
-
function K(e, t, n) {
|
|
2784
|
-
const o = t instanceof S, r = o ? n : t, s = o ? t : null;
|
|
2785
|
-
return new Xi({
|
|
2786
|
-
type: "tuple",
|
|
2787
|
-
items: e,
|
|
2788
|
-
rest: s,
|
|
2789
|
-
...g(r)
|
|
2790
|
-
});
|
|
2791
|
-
}
|
|
2792
|
-
const Hi = /* @__PURE__ */ p("ZodRecord", (e, t) => {
|
|
2793
|
-
wo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Kr(e, n, o, r), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
2794
|
-
});
|
|
2795
|
-
function H(e, t, n) {
|
|
2796
|
-
return new Hi({
|
|
2797
|
-
type: "record",
|
|
2798
|
-
keyType: e,
|
|
2799
|
-
valueType: t,
|
|
2800
|
-
...g(n)
|
|
2801
|
-
});
|
|
2802
|
-
}
|
|
2803
|
-
const ve = /* @__PURE__ */ p("ZodEnum", (e, t) => {
|
|
2804
|
-
ko.init(e, t), P.init(e, t), e._zod.processJSONSchema = (o, r, s) => xr(e, o, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2805
|
-
const n = new Set(Object.keys(t.entries));
|
|
2806
|
-
e.extract = (o, r) => {
|
|
2807
|
-
const s = {};
|
|
2808
|
-
for (const i of o)
|
|
2809
|
-
if (n.has(i))
|
|
2810
|
-
s[i] = t.entries[i];
|
|
2811
|
-
else
|
|
2812
|
-
throw new Error(`Key ${i} not found in enum`);
|
|
2813
|
-
return new ve({
|
|
2814
|
-
...t,
|
|
2815
|
-
checks: [],
|
|
2816
|
-
...g(r),
|
|
2817
|
-
entries: s
|
|
2818
|
-
});
|
|
2819
|
-
}, e.exclude = (o, r) => {
|
|
2820
|
-
const s = { ...t.entries };
|
|
2821
|
-
for (const i of o)
|
|
2822
|
-
if (n.has(i))
|
|
2823
|
-
delete s[i];
|
|
2824
|
-
else
|
|
2825
|
-
throw new Error(`Key ${i} not found in enum`);
|
|
2826
|
-
return new ve({
|
|
2827
|
-
...t,
|
|
2828
|
-
checks: [],
|
|
2829
|
-
...g(r),
|
|
2830
|
-
entries: s
|
|
2831
|
-
});
|
|
2832
|
-
};
|
|
2833
|
-
});
|
|
2834
|
-
function k(e, t) {
|
|
2835
|
-
const n = Array.isArray(e) ? Object.fromEntries(e.map((o) => [o, o])) : e;
|
|
2836
|
-
return new ve({
|
|
2837
|
-
type: "enum",
|
|
2838
|
-
entries: n,
|
|
2839
|
-
...g(t)
|
|
2840
|
-
});
|
|
2841
|
-
}
|
|
2842
|
-
const Qi = /* @__PURE__ */ p("ZodTransform", (e, t) => {
|
|
2843
|
-
$o.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Ur(e, n), e._zod.parse = (n, o) => {
|
|
2844
|
-
if (o.direction === "backward")
|
|
2845
|
-
throw new We(e.constructor.name);
|
|
2846
|
-
n.addIssue = (s) => {
|
|
2847
|
-
if (typeof s == "string")
|
|
2848
|
-
n.issues.push(Q(s, n.value, t));
|
|
2849
|
-
else {
|
|
2850
|
-
const i = s;
|
|
2851
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(Q(i));
|
|
2852
|
-
}
|
|
2853
|
-
};
|
|
2854
|
-
const r = t.transform(n.value, n);
|
|
2855
|
-
return r instanceof Promise ? r.then((s) => (n.value = s, n)) : (n.value = r, n);
|
|
2856
|
-
};
|
|
2857
|
-
});
|
|
2858
|
-
function es(e) {
|
|
2859
|
-
return new Qi({
|
|
2860
|
-
type: "transform",
|
|
2861
|
-
transform: e
|
|
2862
|
-
});
|
|
2863
|
-
}
|
|
2864
|
-
const wt = /* @__PURE__ */ p("ZodOptional", (e, t) => {
|
|
2865
|
-
ft.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => vt(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
2866
|
-
});
|
|
2867
|
-
function Ve(e) {
|
|
2868
|
-
return new wt({
|
|
2869
|
-
type: "optional",
|
|
2870
|
-
innerType: e
|
|
2871
|
-
});
|
|
2872
|
-
}
|
|
2873
|
-
const ts = /* @__PURE__ */ p("ZodExactOptional", (e, t) => {
|
|
2874
|
-
Zo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => vt(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
2875
|
-
});
|
|
2876
|
-
function ns(e) {
|
|
2877
|
-
return new ts({
|
|
2878
|
-
type: "optional",
|
|
2879
|
-
innerType: e
|
|
2880
|
-
});
|
|
2881
|
-
}
|
|
2882
|
-
const os = /* @__PURE__ */ p("ZodNullable", (e, t) => {
|
|
2883
|
-
So.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Wr(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
2884
|
-
});
|
|
2885
|
-
function Be(e) {
|
|
2886
|
-
return new os({
|
|
2887
|
-
type: "nullable",
|
|
2888
|
-
innerType: e
|
|
2889
|
-
});
|
|
2890
|
-
}
|
|
2891
|
-
const rs = /* @__PURE__ */ p("ZodDefault", (e, t) => {
|
|
2892
|
-
Po.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => qr(e, n, o, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2893
|
-
});
|
|
2894
|
-
function is(e, t) {
|
|
2895
|
-
return new rs({
|
|
2896
|
-
type: "default",
|
|
2897
|
-
innerType: e,
|
|
2898
|
-
get defaultValue() {
|
|
2899
|
-
return typeof t == "function" ? t() : Xe(t);
|
|
2900
|
-
}
|
|
2901
|
-
});
|
|
2902
|
-
}
|
|
2903
|
-
const ss = /* @__PURE__ */ p("ZodPrefault", (e, t) => {
|
|
2904
|
-
Oo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Yr(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
2905
|
-
});
|
|
2906
|
-
function as(e, t) {
|
|
2907
|
-
return new ss({
|
|
2908
|
-
type: "prefault",
|
|
2909
|
-
innerType: e,
|
|
2910
|
-
get defaultValue() {
|
|
2911
|
-
return typeof t == "function" ? t() : Xe(t);
|
|
2912
|
-
}
|
|
2913
|
-
});
|
|
2914
|
-
}
|
|
2915
|
-
const kt = /* @__PURE__ */ p("ZodNonOptional", (e, t) => {
|
|
2916
|
-
To.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Gr(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
2917
|
-
});
|
|
2918
|
-
function cs(e, t) {
|
|
2919
|
-
return new kt({
|
|
2920
|
-
type: "nonoptional",
|
|
2921
|
-
innerType: e,
|
|
2922
|
-
...g(t)
|
|
2923
|
-
});
|
|
2924
|
-
}
|
|
2925
|
-
const us = /* @__PURE__ */ p("ZodCatch", (e, t) => {
|
|
2926
|
-
Io.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Xr(e, n, o, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2927
|
-
});
|
|
2928
|
-
function ls(e, t) {
|
|
2929
|
-
return new us({
|
|
2930
|
-
type: "catch",
|
|
2931
|
-
innerType: e,
|
|
2932
|
-
catchValue: typeof t == "function" ? t : () => t
|
|
2933
|
-
});
|
|
2934
|
-
}
|
|
2935
|
-
const ps = /* @__PURE__ */ p("ZodPipe", (e, t) => {
|
|
2936
|
-
No.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Hr(e, n, o, r), e.in = t.in, e.out = t.out;
|
|
2937
|
-
});
|
|
2938
|
-
function Ke(e, t) {
|
|
2939
|
-
return new ps({
|
|
2940
|
-
type: "pipe",
|
|
2941
|
-
in: e,
|
|
2942
|
-
out: t
|
|
2943
|
-
// ...util.normalizeParams(params),
|
|
2944
|
-
});
|
|
2945
|
-
}
|
|
2946
|
-
const fs = /* @__PURE__ */ p("ZodReadonly", (e, t) => {
|
|
2947
|
-
Eo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Qr(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
|
|
2948
|
-
});
|
|
2949
|
-
function ds(e) {
|
|
2950
|
-
return new fs({
|
|
2951
|
-
type: "readonly",
|
|
2952
|
-
innerType: e
|
|
2953
|
-
});
|
|
2954
|
-
}
|
|
2955
|
-
const hs = /* @__PURE__ */ p("ZodLazy", (e, t) => {
|
|
2956
|
-
Co.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => ei(e, n, o, r), e.unwrap = () => e._zod.def.getter();
|
|
2957
|
-
});
|
|
2958
|
-
function ms(e) {
|
|
2959
|
-
return new hs({
|
|
2960
|
-
type: "lazy",
|
|
2961
|
-
getter: e
|
|
2962
|
-
});
|
|
2963
|
-
}
|
|
2964
|
-
const gs = /* @__PURE__ */ p("ZodCustom", (e, t) => {
|
|
2965
|
-
jo.init(e, t), P.init(e, t), e._zod.processJSONSchema = (n, o, r) => Fr(e, n);
|
|
2966
|
-
});
|
|
2967
|
-
function _s(e, t = {}) {
|
|
2968
|
-
return /* @__PURE__ */ Pr(gs, e, t);
|
|
2969
|
-
}
|
|
2970
|
-
function vs(e) {
|
|
2971
|
-
return /* @__PURE__ */ Or(e);
|
|
2972
|
-
}
|
|
2973
|
-
const m = y([
|
|
2974
|
-
c(),
|
|
2975
|
-
v(),
|
|
2976
|
-
d(),
|
|
2977
|
-
z(),
|
|
2978
|
-
_({ path: c() })
|
|
2979
|
-
]), ie = ms(
|
|
2980
|
-
() => y([
|
|
2981
|
-
_({ and: L(ie) }),
|
|
2982
|
-
_({ or: L(ie) }),
|
|
2983
|
-
_({ not: ie }),
|
|
2984
|
-
_({ path: c() }),
|
|
2985
|
-
_({ eq: K([m, m]) }),
|
|
2986
|
-
_({ neq: K([m, m]) }),
|
|
2987
|
-
_({ gt: K([m, m]) }),
|
|
2988
|
-
_({ gte: K([m, m]) }),
|
|
2989
|
-
_({ lt: K([m, m]) }),
|
|
2990
|
-
_({ lte: K([m, m]) })
|
|
2991
|
-
])
|
|
2992
|
-
), bs = y([
|
|
2993
|
-
d(),
|
|
2994
|
-
_({ path: c() }),
|
|
2995
|
-
_({ auth: k(["signedIn", "signedOut"]) }),
|
|
2996
|
-
ie
|
|
2997
|
-
]), ys = _({
|
|
2998
|
-
title: c(),
|
|
2999
|
-
message: c(),
|
|
3000
|
-
variant: k(["default", "danger"]).optional(),
|
|
3001
|
-
confirmLabel: c().optional(),
|
|
3002
|
-
cancelLabel: c().optional()
|
|
3003
|
-
}), zs = _({
|
|
3004
|
-
name: c(),
|
|
3005
|
-
params: H(c(), m).optional(),
|
|
3006
|
-
confirm: ys.optional(),
|
|
3007
|
-
onSuccess: _({ set: H(c(), m) }).optional(),
|
|
3008
|
-
onError: _({ set: H(c(), m) }).optional()
|
|
3009
|
-
}), ws = _({
|
|
3010
|
-
variant: k(["primary", "secondary", "destructive", "outline", "beta"]).optional(),
|
|
3011
|
-
className: c().optional(),
|
|
3012
|
-
children: y([c(), v(), d(), z(), m]).optional()
|
|
3013
|
-
}), ks = _({
|
|
3014
|
-
icon: y([c(), v(), d(), z(), m]).optional(),
|
|
3015
|
-
text: c().optional(),
|
|
3016
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3017
|
-
variant: k(["default", "alert", "error"]).optional(),
|
|
3018
|
-
className: c().optional()
|
|
3019
|
-
}), $s = _({
|
|
3020
|
-
size: k(["sm", "base"]).optional(),
|
|
3021
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3022
|
-
className: c().optional()
|
|
3023
|
-
}), Zs = _({
|
|
3024
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3025
|
-
className: c().optional(),
|
|
3026
|
-
icon: y([c(), v(), d(), z(), m]).optional(),
|
|
3027
|
-
loading: d().optional(),
|
|
3028
|
-
shape: k(["base", "square", "circle"]).optional(),
|
|
3029
|
-
size: k(["xs", "sm", "base", "lg"]).optional(),
|
|
3030
|
-
variant: k(["primary", "secondary", "ghost", "destructive", "secondary-destructive", "outline"]).optional(),
|
|
3031
|
-
id: c().optional(),
|
|
3032
|
-
lang: c().optional(),
|
|
3033
|
-
title: c().optional(),
|
|
3034
|
-
disabled: d().optional(),
|
|
3035
|
-
name: c().optional(),
|
|
3036
|
-
type: k(["submit", "reset", "button"]).optional(),
|
|
3037
|
-
value: Z().optional()
|
|
3038
|
-
}), Ss = _({
|
|
3039
|
-
variant: k(["default", "error"]).optional(),
|
|
3040
|
-
// Visual variant: "default" or "error" for validation failures (visual only, no error text)
|
|
3041
|
-
label: y([c(), v(), d(), z(), m]).optional(),
|
|
3042
|
-
// Label content for the checkbox (enables built-in Field wrapper) - can be a string or any React node
|
|
3043
|
-
labelTooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3044
|
-
// Tooltip content to display next to the label via an info icon
|
|
3045
|
-
controlFirst: d().optional(),
|
|
3046
|
-
// When true (default), checkbox appears before label. When false, label appears before checkbox.
|
|
3047
|
-
checked: d().optional(),
|
|
3048
|
-
// Whether the checkbox is checked (controlled)
|
|
3049
|
-
indeterminate: d().optional(),
|
|
3050
|
-
// Whether the checkbox is in indeterminate state
|
|
3051
|
-
disabled: d().optional(),
|
|
3052
|
-
// Whether the checkbox is disabled
|
|
3053
|
-
name: c().optional(),
|
|
3054
|
-
// Name for form submission
|
|
3055
|
-
required: d().optional(),
|
|
3056
|
-
// Whether the field is required
|
|
3057
|
-
className: c().optional(),
|
|
3058
|
-
// Additional class name
|
|
3059
|
-
onValueChange: Z().optional()
|
|
3060
|
-
// Callback when checkbox value changes
|
|
3061
|
-
}), Ps = _({
|
|
3062
|
-
size: k(["sm", "base", "lg"]).optional(),
|
|
3063
|
-
text: c(),
|
|
3064
|
-
// The text to display and copy to clipboard
|
|
3065
|
-
className: c().optional()
|
|
3066
|
-
// Additional CSS classes
|
|
3067
|
-
}), Os = _({
|
|
3068
|
-
lang: k(["ts", "tsx", "jsonc", "bash", "css"]).optional(),
|
|
3069
|
-
code: c(),
|
|
3070
|
-
// The code content to display
|
|
3071
|
-
values: Z().optional(),
|
|
3072
|
-
// Template values for interpolation
|
|
3073
|
-
className: c().optional()
|
|
3074
|
-
// Additional CSS classes
|
|
3075
|
-
}), Ts = _({
|
|
3076
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3077
|
-
label: c(),
|
|
3078
|
-
// Text label displayed in the trigger button
|
|
3079
|
-
open: d().optional(),
|
|
3080
|
-
// Whether the collapsible content is visible
|
|
3081
|
-
className: c().optional(),
|
|
3082
|
-
// Additional CSS classes for the content panel
|
|
3083
|
-
onOpenChange: Z().optional()
|
|
3084
|
-
// Callback when collapsed state changes
|
|
3085
|
-
}), Is = _({
|
|
3086
|
-
inputSide: k(["right", "top"]).optional(),
|
|
3087
|
-
items: L(Z()),
|
|
3088
|
-
// Array of items to display in the dropdown
|
|
3089
|
-
value: L(Z()).optional(),
|
|
3090
|
-
// Currently selected value(s)
|
|
3091
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3092
|
-
// Combobox content (trigger, content, items)
|
|
3093
|
-
className: c().optional(),
|
|
3094
|
-
// Additional CSS classes
|
|
3095
|
-
label: y([c(), v(), d(), z(), m]).optional(),
|
|
3096
|
-
// Label content for the combobox (enables Field wrapper) - can be a string or any React node
|
|
3097
|
-
required: d().optional(),
|
|
3098
|
-
// Whether the combobox is required
|
|
3099
|
-
labelTooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3100
|
-
// Tooltip content to display next to the label via an info icon
|
|
3101
|
-
description: y([c(), v(), d(), z(), m]).optional(),
|
|
3102
|
-
// Helper text displayed below the combobox
|
|
3103
|
-
error: Z().optional(),
|
|
3104
|
-
// Error message or validation error object
|
|
3105
|
-
onValueChange: Z().optional(),
|
|
3106
|
-
// Callback when selection changes
|
|
3107
|
-
multiple: d().optional(),
|
|
3108
|
-
// Allow multiple selections
|
|
3109
|
-
isItemEqualToValue: Z().optional()
|
|
3110
|
-
// Custom equality function for comparing items
|
|
3111
|
-
}), Ns = _({
|
|
3112
|
-
open: d(),
|
|
3113
|
-
// Whether the dialog is open
|
|
3114
|
-
children: y([c(), v(), d(), z(), m]).optional()
|
|
3115
|
-
// Child content - typically one or more Panel components
|
|
3116
|
-
}), Es = _({
|
|
3117
|
-
size: k(["sm", "base", "lg"]).optional(),
|
|
3118
|
-
variant: k(["default", "subtle"]).optional(),
|
|
3119
|
-
timezone: c().optional(),
|
|
3120
|
-
// Display timezone (display only)
|
|
3121
|
-
className: c().optional(),
|
|
3122
|
-
// Additional CSS classes
|
|
3123
|
-
onStartDateChange: Z().optional(),
|
|
3124
|
-
// Callback when start date changes
|
|
3125
|
-
onEndDateChange: Z().optional()
|
|
3126
|
-
// Callback when end date changes
|
|
3127
|
-
}), Cs = _({
|
|
3128
|
-
className: c().optional(),
|
|
3129
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3130
|
-
size: k(["base", "sm", "lg", "xl"]).optional()
|
|
3131
|
-
}), js = _({
|
|
3132
|
-
variant: k(["default", "danger"]).optional()
|
|
3133
|
-
}), As = _({
|
|
3134
|
-
size: k(["sm", "base", "lg"]).optional(),
|
|
3135
|
-
icon: y([c(), v(), d(), z(), m]).optional(),
|
|
3136
|
-
title: c(),
|
|
3137
|
-
description: c().optional(),
|
|
3138
|
-
commandLine: c().optional(),
|
|
3139
|
-
contents: y([c(), v(), d(), z(), m]).optional(),
|
|
3140
|
-
className: c().optional()
|
|
3141
|
-
}), Rs = _({
|
|
3142
|
-
controlFirst: d().optional(),
|
|
3143
|
-
// When true, places the control (checkbox/switch) before the label visually. When false (default), places the label before the control. Used to support different layout patterns (e.g., iOS-style toggles on the right).
|
|
3144
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3145
|
-
label: y([c(), v(), d(), z(), m]).optional(),
|
|
3146
|
-
// The label content - can be a string or any React node
|
|
3147
|
-
required: d().optional(),
|
|
3148
|
-
// When explicitly false, shows gray "(optional)" text after the label. When true or undefined, no indicator is shown.
|
|
3149
|
-
labelTooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3150
|
-
// Tooltip content to display next to the label via an info icon
|
|
3151
|
-
error: Z().optional(),
|
|
3152
|
-
description: y([c(), v(), d(), z(), m]).optional()
|
|
3153
|
-
}), Ds = _({
|
|
3154
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3155
|
-
// Child node(s) that can be nested inside component
|
|
3156
|
-
className: c().optional(),
|
|
3157
|
-
// CSS class names that can be appended to the component
|
|
3158
|
-
id: c().optional(),
|
|
3159
|
-
lang: c().optional(),
|
|
3160
|
-
title: c().optional(),
|
|
3161
|
-
mobileDivider: d().optional(),
|
|
3162
|
-
// Show dividers between grid items on mobile (only works with 4up variant)
|
|
3163
|
-
gap: k(["none", "sm", "base", "lg"]).optional(),
|
|
3164
|
-
// Gap size between grid items
|
|
3165
|
-
variant: k(["2up", "side-by-side", "2-1", "1-2", "1-3up", "3up", "4up", "6up", "1-2-4up"]).optional()
|
|
3166
|
-
// Stylistic variations of the Grid layout
|
|
3167
|
-
}), xs = _({
|
|
3168
|
-
label: y([c(), v(), d(), z(), m]).optional(),
|
|
3169
|
-
// Label content for the input (enables Field wrapper) - can be a string or any React node
|
|
3170
|
-
labelTooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3171
|
-
// Tooltip content to display next to the label via an info icon
|
|
3172
|
-
description: y([c(), v(), d(), z(), m]).optional(),
|
|
3173
|
-
// Helper text displayed below the input
|
|
3174
|
-
error: Z().optional(),
|
|
3175
|
-
// Error message or validation error object
|
|
3176
|
-
size: k(["xs", "sm", "base", "lg"]).optional(),
|
|
3177
|
-
variant: k(["default", "error"]).optional()
|
|
3178
|
-
}), Fs = _({}), Us = _({
|
|
3179
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3180
|
-
// The label content - can be a string or any React node
|
|
3181
|
-
showOptional: d().optional(),
|
|
3182
|
-
// When true (and required is false), shows gray "(optional)" text after the label
|
|
3183
|
-
tooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3184
|
-
// Tooltip content to display next to the label via an info icon
|
|
3185
|
-
className: c().optional(),
|
|
3186
|
-
// Additional CSS classes
|
|
3187
|
-
asContent: d().optional()
|
|
3188
|
-
// When true, only renders the inline content (indicators, tooltip) without the outer span with font styling. Useful when composed inside another label element that already provides the text styling.
|
|
3189
|
-
}), Ls = _({
|
|
3190
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3191
|
-
className: c().optional()
|
|
3192
|
-
}), Ms = _({
|
|
3193
|
-
variant: k(["inline", "current", "plain"]).optional(),
|
|
3194
|
-
to: c().optional(),
|
|
3195
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3196
|
-
className: c().optional(),
|
|
3197
|
-
id: c().optional(),
|
|
3198
|
-
lang: c().optional(),
|
|
3199
|
-
title: c().optional(),
|
|
3200
|
-
download: Z().optional(),
|
|
3201
|
-
href: c().optional(),
|
|
3202
|
-
hrefLang: c().optional(),
|
|
3203
|
-
media: c().optional(),
|
|
3204
|
-
ping: c().optional(),
|
|
3205
|
-
target: Z().optional(),
|
|
3206
|
-
type: c().optional(),
|
|
3207
|
-
referrerPolicy: k(["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin", "unsafe-url"]).optional(),
|
|
3208
|
-
render: y([c(), v(), d(), z(), m]).optional()
|
|
3209
|
-
// Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
|
|
3210
|
-
}), Js = _({
|
|
3211
|
-
className: c().optional(),
|
|
3212
|
-
size: k(["sm", "base", "lg"]).optional()
|
|
3213
|
-
}), Vs = _({
|
|
3214
|
-
className: c().optional(),
|
|
3215
|
-
isActive: Z().optional(),
|
|
3216
|
-
options: L(Z()),
|
|
3217
|
-
optionIds: d().optional()
|
|
3218
|
-
}), Bs = _({
|
|
3219
|
-
customValue: c().optional(),
|
|
3220
|
-
label: c(),
|
|
3221
|
-
showValue: d().optional(),
|
|
3222
|
-
trackClassName: c().optional(),
|
|
3223
|
-
indicatorClassName: c().optional(),
|
|
3224
|
-
value: v().optional(),
|
|
3225
|
-
// Current value of the meter
|
|
3226
|
-
max: v().optional(),
|
|
3227
|
-
// Maximum value of the meter (default: 100)
|
|
3228
|
-
min: v().optional()
|
|
3229
|
-
// Minimum value of the meter (default: 0)
|
|
3230
|
-
}), Ks = _({
|
|
3231
|
-
controls: k(["full", "simple"]).optional(),
|
|
3232
|
-
setPage: Z(),
|
|
3233
|
-
// Callback when page changes
|
|
3234
|
-
page: v().optional(),
|
|
3235
|
-
perPage: v().optional(),
|
|
3236
|
-
totalCount: v().optional()
|
|
3237
|
-
}), Ws = _({
|
|
3238
|
-
side: k(["top", "bottom", "left", "right"]).optional()
|
|
3239
|
-
}), Gs = _({
|
|
3240
|
-
legend: c(),
|
|
3241
|
-
// Legend text for the group (required for accessibility)
|
|
3242
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3243
|
-
// Child Radio.Item components
|
|
3244
|
-
orientation: k(["vertical", "horizontal"]).optional(),
|
|
3245
|
-
// Layout direction of the radio items
|
|
3246
|
-
error: c().optional(),
|
|
3247
|
-
// Error message for the group
|
|
3248
|
-
description: y([c(), v(), d(), z(), m]).optional(),
|
|
3249
|
-
// Helper text for the group
|
|
3250
|
-
value: c().optional(),
|
|
3251
|
-
// Value of the radio that should be selected (controlled)
|
|
3252
|
-
disabled: d().optional(),
|
|
3253
|
-
// Whether all radios in the group are disabled
|
|
3254
|
-
controlPosition: k(["start", "end"]).optional(),
|
|
3255
|
-
// Position of radio control relative to label: "start" (default) puts radio before label, "end" puts label before radio
|
|
3256
|
-
name: c().optional(),
|
|
3257
|
-
// Form submission name for the radio group
|
|
3258
|
-
className: c().optional()
|
|
3259
|
-
// Additional CSS classes
|
|
3260
|
-
}), qs = _({
|
|
3261
|
-
className: c().optional(),
|
|
3262
|
-
// Additional CSS classes
|
|
3263
|
-
label: y([c(), v(), d(), z(), m]).optional(),
|
|
3264
|
-
// Label content for the select (enables Field wrapper) - can be a string or any React node
|
|
3265
|
-
hideLabel: d().optional(),
|
|
3266
|
-
// Whether to visually hide the label (still accessible to screen readers)
|
|
3267
|
-
placeholder: c().optional(),
|
|
3268
|
-
// Placeholder text when no value is selected
|
|
3269
|
-
loading: d().optional(),
|
|
3270
|
-
// Whether the select is in a loading state
|
|
3271
|
-
disabled: d().optional(),
|
|
3272
|
-
// Whether the select is disabled
|
|
3273
|
-
required: d().optional(),
|
|
3274
|
-
// Whether the select is required
|
|
3275
|
-
labelTooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3276
|
-
// Tooltip content to display next to the label via an info icon
|
|
3277
|
-
value: c().optional(),
|
|
3278
|
-
// The currently selected value
|
|
3279
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3280
|
-
// Child elements (Select.Option components)
|
|
3281
|
-
description: y([c(), v(), d(), z(), m]).optional(),
|
|
3282
|
-
// Helper text displayed below the select
|
|
3283
|
-
error: Z().optional(),
|
|
3284
|
-
// Error message or validation error object
|
|
3285
|
-
onValueChange: Z().optional(),
|
|
3286
|
-
// Callback when selection changes
|
|
3287
|
-
defaultValue: c().optional()
|
|
3288
|
-
// Initial value for uncontrolled mode
|
|
3289
|
-
}), Ys = _({
|
|
3290
|
-
alt: c().optional(),
|
|
3291
|
-
autoComplete: Z().optional(),
|
|
3292
|
-
checked: d().optional(),
|
|
3293
|
-
disabled: d().optional(),
|
|
3294
|
-
height: Z().optional(),
|
|
3295
|
-
list: c().optional(),
|
|
3296
|
-
name: c().optional(),
|
|
3297
|
-
placeholder: c().optional(),
|
|
3298
|
-
readOnly: d().optional(),
|
|
3299
|
-
required: d().optional(),
|
|
3300
|
-
width: Z().optional(),
|
|
3301
|
-
className: c().optional(),
|
|
3302
|
-
id: c().optional(),
|
|
3303
|
-
lang: c().optional(),
|
|
3304
|
-
title: c().optional(),
|
|
3305
|
-
children: y([c(), v(), d(), z(), m]).optional(),
|
|
3306
|
-
value: c().optional(),
|
|
3307
|
-
// Controlled value
|
|
3308
|
-
size: k(["xs", "sm", "base", "lg"]).optional(),
|
|
3309
|
-
// Size variant
|
|
3310
|
-
variant: k(["default", "error"]).optional(),
|
|
3311
|
-
// Style variant
|
|
3312
|
-
label: y([c(), v(), d(), z(), m]).optional(),
|
|
3313
|
-
// Label content for the input (enables Field wrapper and sets masked state label) - can be a string or any React node
|
|
3314
|
-
labelTooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3315
|
-
// Tooltip content to display next to the label via an info icon
|
|
3316
|
-
description: y([c(), v(), d(), z(), m]).optional(),
|
|
3317
|
-
// Helper text displayed below the input
|
|
3318
|
-
error: Z().optional()
|
|
3319
|
-
// Error message or validation error object
|
|
3320
|
-
}), Xs = _({
|
|
3321
|
-
as: Z().optional(),
|
|
3322
|
-
// The element type to render as (default: "div")
|
|
3323
|
-
className: c().optional(),
|
|
3324
|
-
// Additional CSS classes
|
|
3325
|
-
children: y([c(), v(), d(), z(), m]).optional()
|
|
3326
|
-
// Child elements
|
|
3327
|
-
}), Hs = _({
|
|
3328
|
-
variant: k(["default", "error"]).optional(),
|
|
3329
|
-
// Visual variant: "default" or "error" for validation failures (visual only, no error text)
|
|
3330
|
-
label: y([c(), v(), d(), z(), m]).optional(),
|
|
3331
|
-
// Label content for the switch (Field wrapper is built-in) - can be a string or any React node. Optional when used standalone for visual-only purposes.
|
|
3332
|
-
labelTooltip: y([c(), v(), d(), z(), m]).optional(),
|
|
3333
|
-
// Tooltip content to display next to the label via an info icon
|
|
3334
|
-
required: d().optional(),
|
|
3335
|
-
// Whether the switch is required. When explicitly false, shows "(optional)" text after the label.
|
|
3336
|
-
controlFirst: d().optional(),
|
|
3337
|
-
// When true (default), switch appears before label. When false, label appears before switch.
|
|
3338
|
-
size: k(["sm", "base", "lg"]).optional(),
|
|
3339
|
-
checked: d().optional(),
|
|
3340
|
-
disabled: d().optional(),
|
|
3341
|
-
transitioning: d().optional(),
|
|
3342
|
-
name: c().optional(),
|
|
3343
|
-
type: k(["submit", "reset", "button"]).optional(),
|
|
3344
|
-
value: Z().optional(),
|
|
3345
|
-
className: c().optional(),
|
|
3346
|
-
id: c().optional(),
|
|
3347
|
-
lang: c().optional(),
|
|
3348
|
-
title: c().optional(),
|
|
3349
|
-
onClick: Z()
|
|
3350
|
-
// Callback when switch is clicked
|
|
3351
|
-
}), Qs = _({
|
|
3352
|
-
layout: k(["auto", "fixed"]).optional(),
|
|
3353
|
-
variant: k(["default", "selected"]).optional(),
|
|
3354
|
-
className: c().optional(),
|
|
3355
|
-
// Additional CSS classes
|
|
3356
|
-
children: y([c(), v(), d(), z(), m]).optional()
|
|
3357
|
-
// Child elements
|
|
3358
|
-
}), ea = _({
|
|
3359
|
-
tabs: L(Z()).optional(),
|
|
3360
|
-
// Array of tab items to render
|
|
3361
|
-
value: c().optional(),
|
|
3362
|
-
// Controlled value. When set, component becomes controlled.
|
|
3363
|
-
selectedValue: c().optional(),
|
|
3364
|
-
// Default selected value for uncontrolled mode. Ignored when `value` is set.
|
|
3365
|
-
activateOnFocus: d().optional(),
|
|
3366
|
-
// When true, tabs are activated immediately upon receiving focus via arrow keys. When false (default), tabs receive focus but require Enter/Space to activate. Set to true for better keyboard UX in most cases.
|
|
3367
|
-
className: c().optional(),
|
|
3368
|
-
// Additional class name for the root element
|
|
3369
|
-
listClassName: c().optional(),
|
|
3370
|
-
// Additional class name for the tab list element
|
|
3371
|
-
indicatorClassName: c().optional(),
|
|
3372
|
-
// Additional class name for the indicator element
|
|
3373
|
-
variant: k(["segmented", "underline"]).optional(),
|
|
3374
|
-
onValueChange: Z().optional()
|
|
3375
|
-
// Callback when active tab changes
|
|
3376
|
-
}), ta = _({
|
|
3377
|
-
variant: k(["heading1", "heading2", "heading3", "body", "secondary", "success", "error", "mono", "mono-secondary"]).optional(),
|
|
3378
|
-
// Text style variant
|
|
3379
|
-
size: k(["xs", "sm", "base", "lg"]).optional(),
|
|
3380
|
-
// Text size (only applies to body/secondary/success/error variants)
|
|
3381
|
-
bold: d().optional(),
|
|
3382
|
-
// Whether to use bold font weight (only applies to body variants)
|
|
3383
|
-
as: Z().optional(),
|
|
3384
|
-
// The element type to render as
|
|
3385
|
-
children: y([c(), v(), d(), z(), m]).optional()
|
|
3386
|
-
// Child text content
|
|
3387
|
-
}), na = _({
|
|
3388
|
-
variant: k(["default", "error", "warning"]).optional(),
|
|
3389
|
-
className: c().optional(),
|
|
3390
|
-
// Additional CSS classes
|
|
3391
|
-
children: y([c(), v(), d(), z(), m]).optional()
|
|
3392
|
-
// Child elements
|
|
3393
|
-
}), oa = _({
|
|
3394
|
-
align: k(["start", "center", "end"]).optional(),
|
|
3395
|
-
asChild: d().optional(),
|
|
3396
|
-
className: c().optional(),
|
|
3397
|
-
side: k(["top", "bottom", "left", "right"]).optional(),
|
|
3398
|
-
content: y([c(), v(), d(), z(), m])
|
|
3399
|
-
// Content to display in the tooltip
|
|
3400
|
-
}), ra = k([
|
|
3401
|
-
"Badge",
|
|
3402
|
-
"Banner",
|
|
3403
|
-
"Breadcrumbs",
|
|
3404
|
-
"Button",
|
|
3405
|
-
"Checkbox",
|
|
3406
|
-
"ClipboardText",
|
|
3407
|
-
"Code",
|
|
3408
|
-
"Collapsible",
|
|
3409
|
-
"Combobox",
|
|
3410
|
-
"CommandPalette",
|
|
3411
|
-
"DateRangePicker",
|
|
3412
|
-
"Dialog",
|
|
3413
|
-
"DropdownMenu",
|
|
3414
|
-
"Empty",
|
|
3415
|
-
"Field",
|
|
3416
|
-
"Grid",
|
|
3417
|
-
"Input",
|
|
3418
|
-
"InputArea",
|
|
3419
|
-
"Label",
|
|
3420
|
-
"LayerCard",
|
|
3421
|
-
"Link",
|
|
3422
|
-
"Loader",
|
|
3423
|
-
"MenuBar",
|
|
3424
|
-
"Meter",
|
|
3425
|
-
"Pagination",
|
|
3426
|
-
"Popover",
|
|
3427
|
-
"Radio",
|
|
3428
|
-
"Select",
|
|
3429
|
-
"SensitiveInput",
|
|
3430
|
-
"Surface",
|
|
3431
|
-
"Switch",
|
|
3432
|
-
"Table",
|
|
3433
|
-
"Tabs",
|
|
3434
|
-
"Text",
|
|
3435
|
-
"Toasty",
|
|
3436
|
-
"Tooltip"
|
|
3437
|
-
]), ia = {
|
|
3438
|
-
Badge: ws,
|
|
3439
|
-
Banner: ks,
|
|
3440
|
-
Breadcrumbs: $s,
|
|
3441
|
-
Button: Zs,
|
|
3442
|
-
Checkbox: Ss,
|
|
3443
|
-
ClipboardText: Ps,
|
|
3444
|
-
Code: Os,
|
|
3445
|
-
Collapsible: Ts,
|
|
3446
|
-
Combobox: Is,
|
|
3447
|
-
CommandPalette: Ns,
|
|
3448
|
-
DateRangePicker: Es,
|
|
3449
|
-
Dialog: Cs,
|
|
3450
|
-
DropdownMenu: js,
|
|
3451
|
-
Empty: As,
|
|
3452
|
-
Field: Rs,
|
|
3453
|
-
Grid: Ds,
|
|
3454
|
-
Input: xs,
|
|
3455
|
-
InputArea: Fs,
|
|
3456
|
-
Label: Us,
|
|
3457
|
-
LayerCard: Ls,
|
|
3458
|
-
Link: Ms,
|
|
3459
|
-
Loader: Js,
|
|
3460
|
-
MenuBar: Vs,
|
|
3461
|
-
Meter: Bs,
|
|
3462
|
-
Pagination: Ks,
|
|
3463
|
-
Popover: Ws,
|
|
3464
|
-
Radio: Gs,
|
|
3465
|
-
Select: qs,
|
|
3466
|
-
SensitiveInput: Ys,
|
|
3467
|
-
Surface: Xs,
|
|
3468
|
-
Switch: Hs,
|
|
3469
|
-
Table: Qs,
|
|
3470
|
-
Tabs: ea,
|
|
3471
|
-
Text: ta,
|
|
3472
|
-
Toasty: na,
|
|
3473
|
-
Tooltip: oa
|
|
3474
|
-
}, sa = _({
|
|
3475
|
-
key: c(),
|
|
3476
|
-
type: ra,
|
|
3477
|
-
props: H(c(), Z()),
|
|
3478
|
-
children: L(c()).optional(),
|
|
3479
|
-
parentKey: c().nullable().optional(),
|
|
3480
|
-
visible: bs.optional(),
|
|
3481
|
-
action: zs.optional()
|
|
3482
|
-
}), aa = _({
|
|
3483
|
-
root: c(),
|
|
3484
|
-
elements: H(c(), sa)
|
|
3485
|
-
});
|
|
3486
|
-
function ua(e) {
|
|
3487
|
-
const t = ia[e.type];
|
|
3488
|
-
return t ? t.safeParse(e.props) : { success: !1, error: new ui([{ code: "custom", message: `Unknown component type: ${e.type}`, path: ["type"] }]) };
|
|
3489
|
-
}
|
|
3490
|
-
function la(e) {
|
|
3491
|
-
return aa.safeParse(e);
|
|
3492
|
-
}
|
|
3493
|
-
const pa = ["Badge", "Banner", "Breadcrumbs", "Button", "Checkbox", "ClipboardText", "Code", "Collapsible", "Combobox", "CommandPalette", "DateRangePicker", "Dialog", "DropdownMenu", "Empty", "Field", "Grid", "Input", "InputArea", "Label", "LayerCard", "Link", "Loader", "MenuBar", "Meter", "Pagination", "Popover", "Radio", "Select", "SensitiveInput", "Surface", "Switch", "Table", "Tabs", "Text", "Toasty", "Tooltip"];
|
|
3494
|
-
export {
|
|
3495
|
-
ys as ActionConfirmSchema,
|
|
3496
|
-
zs as ActionSchema,
|
|
3497
|
-
ws as BadgePropsSchema,
|
|
3498
|
-
ks as BannerPropsSchema,
|
|
3499
|
-
$s as BreadcrumbsPropsSchema,
|
|
3500
|
-
Zs as ButtonPropsSchema,
|
|
3501
|
-
Ss as CheckboxPropsSchema,
|
|
3502
|
-
Ps as ClipboardTextPropsSchema,
|
|
3503
|
-
Os as CodePropsSchema,
|
|
3504
|
-
Ts as CollapsiblePropsSchema,
|
|
3505
|
-
Is as ComboboxPropsSchema,
|
|
3506
|
-
Ns as CommandPalettePropsSchema,
|
|
3507
|
-
ia as ComponentPropsSchemas,
|
|
3508
|
-
Es as DateRangePickerPropsSchema,
|
|
3509
|
-
Cs as DialogPropsSchema,
|
|
3510
|
-
js as DropdownMenuPropsSchema,
|
|
3511
|
-
m as DynamicValueSchema,
|
|
3512
|
-
As as EmptyPropsSchema,
|
|
3513
|
-
Rs as FieldPropsSchema,
|
|
3514
|
-
Ds as GridPropsSchema,
|
|
3515
|
-
Fs as InputAreaPropsSchema,
|
|
3516
|
-
xs as InputPropsSchema,
|
|
3517
|
-
pa as KUMO_COMPONENT_NAMES,
|
|
3518
|
-
ra as KumoComponentTypeSchema,
|
|
3519
|
-
Us as LabelPropsSchema,
|
|
3520
|
-
Ls as LayerCardPropsSchema,
|
|
3521
|
-
Ms as LinkPropsSchema,
|
|
3522
|
-
Js as LoaderPropsSchema,
|
|
3523
|
-
Vs as MenuBarPropsSchema,
|
|
3524
|
-
Bs as MeterPropsSchema,
|
|
3525
|
-
Ks as PaginationPropsSchema,
|
|
3526
|
-
Ws as PopoverPropsSchema,
|
|
3527
|
-
Gs as RadioPropsSchema,
|
|
3528
|
-
qs as SelectPropsSchema,
|
|
3529
|
-
Ys as SensitiveInputPropsSchema,
|
|
3530
|
-
Xs as SurfacePropsSchema,
|
|
3531
|
-
Hs as SwitchPropsSchema,
|
|
3532
|
-
Qs as TablePropsSchema,
|
|
3533
|
-
ea as TabsPropsSchema,
|
|
3534
|
-
ta as TextPropsSchema,
|
|
3535
|
-
na as ToastyPropsSchema,
|
|
3536
|
-
oa as TooltipPropsSchema,
|
|
3537
|
-
sa as UIElementBaseSchema,
|
|
3538
|
-
aa as UITreeSchema,
|
|
3539
|
-
bs as VisibilityConditionSchema,
|
|
3540
|
-
ua as validateElementProps,
|
|
3541
|
-
la as validateUITree
|
|
3542
|
-
};
|
|
3543
|
-
//# sourceMappingURL=schemas-C2YJKpDC.js.map
|