@golemui/gui-react 0.0.2 → 0.12.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/Accordion-Btp_b0xA.js +59 -0
- package/{Alert-B71lVm89.js → Alert-CBgIsMKO.js} +1 -1
- package/Button-DN0G-MUb.js +21 -0
- package/{Calendar-BtYEcLJH.js → Calendar-Dxavv2c7.js} +12 -12
- package/Checkbox-ViM9MktI.js +30 -0
- package/Currency-C4QFWO7Y.js +37 -0
- package/{DateInput-B4S5ssKR.js → DateInput-CdkyyAhc.js} +4 -4
- package/DatePicker-TkMCndrw.js +138 -0
- package/Dropdown-jKk4TyOa.js +201 -0
- package/Errors-D7gxq0y6.js +16 -0
- package/Flex-gD893rrB.js +19 -0
- package/Grid-DREMTVQI.js +30 -0
- package/List-BjMIo577.js +103 -0
- package/Markdown-Ck_88HOR.js +47 -0
- package/MarkdownText-kJVkmihW.js +9 -0
- package/Number-CnQ95aLO.js +35 -0
- package/Password-Bg97DYW3.js +36 -0
- package/README.md +17 -4
- package/RadioGroup-Dldom5ja.js +33 -0
- package/RangeCalendar-u2vxIhna.js +49 -0
- package/RangeDateInput-CopLdb6J.js +54 -0
- package/RangeDatePicker-DXpV-B_G.js +146 -0
- package/Renderer-B6WmwKDv.js +9 -0
- package/Repeater-BYgXVfbl.js +111 -0
- package/Select-BLUX_W91.js +55 -0
- package/Tabs-C2qqi8xO.js +129 -0
- package/TextArea-cw3Q2v97.js +35 -0
- package/TextInput-geLoAA0c.js +32 -0
- package/{Toggle-CCzdFjkq.js → Toggle-a7L71GwR.js} +5 -5
- package/index.js +790 -698
- package/index.umd.cjs +2 -2
- package/lib/components/Form.d.ts +7 -13
- package/lib/components/Grid.d.ts +2 -0
- package/lib/components/Markdown.d.ts +2 -0
- package/lib/components/MarkdownText.d.ts +2 -0
- package/lib/components/RangeDateInput.d.ts +2 -0
- package/lib/components/RangeDatePicker.d.ts +2 -0
- package/lib/widget.loaders.d.ts +2 -2
- package/package.json +11 -6
- package/Accordion-F768Nqhg.js +0 -58
- package/Button-BctTVpNg.js +0 -20
- package/CHANGELOG.md +0 -529
- package/Checkbox-CezJrTAx.js +0 -30
- package/Currency-Bj2yx0JY.js +0 -36
- package/DatePicker-C1Qiridi.js +0 -130
- package/Dropdown-Dd50Psea.js +0 -196
- package/Flex-DPIzOItG.js +0 -11
- package/List-CLplkkLa.js +0 -103
- package/Number-DsIN4V1r.js +0 -34
- package/Password-B_QkZ1WU.js +0 -35
- package/RadioGroup-BPhyHxKf.js +0 -32
- package/RangeCalendar-B-FeEowl.js +0 -47
- package/Renderer-CRWbM4oE.js +0 -9
- package/Repeater-D1koXq-v.js +0 -46
- package/Select-DvFmJB1_.js +0 -54
- package/Tabs-CsmJz1Vs.js +0 -115
- package/TextArea-z99jVJ4-.js +0 -35
- package/TextInput-BTkEyMEv.js +0 -31
package/index.js
CHANGED
|
@@ -1,54 +1,42 @@
|
|
|
1
1
|
import "@golemui/gui-components";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { standardValidate as
|
|
5
|
-
import * as
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
2
|
+
import { jsx as Qe } from "react/jsx-runtime";
|
|
3
|
+
import { resolveFormInput as en } from "@golemui/gui-shared";
|
|
4
|
+
import { filterTap as nn, standardValidate as Se, isStandardValidateSuccess as Oe } from "@golemui/core";
|
|
5
|
+
import * as tn from "@golemui/react";
|
|
6
|
+
import { useMemo as rn } from "react";
|
|
7
|
+
const on = {
|
|
8
8
|
// INTERACTIVE
|
|
9
|
-
button: async () => (await import("./Button-
|
|
9
|
+
button: async () => (await import("./Button-DN0G-MUb.js")).Button,
|
|
10
10
|
// CONTROLS
|
|
11
|
-
calendar: async () => (await import("./Calendar-
|
|
12
|
-
currency: async () => (await import("./Currency-
|
|
13
|
-
dateInput: async () => (await import("./DateInput-
|
|
14
|
-
datePicker: async () => (await import("./DatePicker-
|
|
15
|
-
dropdown: async () => (await import("./Dropdown-
|
|
16
|
-
list: async () => (await import("./List-
|
|
17
|
-
password: async () => (await import("./Password-
|
|
18
|
-
textinput: async () => (await import("./TextInput-
|
|
19
|
-
textarea: async () => (await import("./TextArea-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
calendar: async () => (await import("./Calendar-Dxavv2c7.js")).Calendar,
|
|
12
|
+
currency: async () => (await import("./Currency-C4QFWO7Y.js")).Currency,
|
|
13
|
+
dateInput: async () => (await import("./DateInput-CdkyyAhc.js")).DateInput,
|
|
14
|
+
datePicker: async () => (await import("./DatePicker-TkMCndrw.js")).DatePicker,
|
|
15
|
+
dropdown: async () => (await import("./Dropdown-jKk4TyOa.js")).Dropdown,
|
|
16
|
+
list: async () => (await import("./List-BjMIo577.js")).List,
|
|
17
|
+
password: async () => (await import("./Password-Bg97DYW3.js")).Password,
|
|
18
|
+
textinput: async () => (await import("./TextInput-geLoAA0c.js")).TextInput,
|
|
19
|
+
textarea: async () => (await import("./TextArea-cw3Q2v97.js")).TextArea,
|
|
20
|
+
markdown: async () => (await import("./Markdown-Ck_88HOR.js")).Markdown,
|
|
21
|
+
checkbox: async () => (await import("./Checkbox-ViM9MktI.js")).Checkbox,
|
|
22
|
+
toggle: async () => (await import("./Toggle-a7L71GwR.js")).Toggle,
|
|
23
|
+
number: async () => (await import("./Number-CnQ95aLO.js")).NumberInput,
|
|
24
|
+
select: async () => (await import("./Select-BLUX_W91.js")).Select,
|
|
25
|
+
radiogroup: async () => (await import("./RadioGroup-Dldom5ja.js")).RadioGroup,
|
|
26
|
+
rangeCalendar: async () => (await import("./RangeCalendar-u2vxIhna.js")).RangeCalendar,
|
|
27
|
+
rangeDateInput: async () => (await import("./RangeDateInput-CopLdb6J.js")).RangeDateInput,
|
|
28
|
+
rangeDatePicker: async () => (await import("./RangeDatePicker-DXpV-B_G.js")).RangeDatePicker,
|
|
26
29
|
// REPEATER
|
|
27
|
-
repeater: async () => (await import("./Repeater-
|
|
30
|
+
repeater: async () => (await import("./Repeater-BYgXVfbl.js")).Repeater,
|
|
28
31
|
// LAYOUTS
|
|
29
|
-
flex: async () => (await import("./Flex-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
flex: async () => (await import("./Flex-gD893rrB.js")).Flex,
|
|
33
|
+
grid: async () => (await import("./Grid-DREMTVQI.js")).Grid,
|
|
34
|
+
tabs: async () => (await import("./Tabs-C2qqi8xO.js")).Tabs,
|
|
35
|
+
accordion: async () => (await import("./Accordion-Btp_b0xA.js")).Accordion,
|
|
32
36
|
// DISPLAY
|
|
33
|
-
alert: async () => (await import("./Alert-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type: "string",
|
|
37
|
-
...e || {}
|
|
38
|
-
}), He = (e) => ({
|
|
39
|
-
type: "number",
|
|
40
|
-
...e || {}
|
|
41
|
-
}), Qe = (e) => ({
|
|
42
|
-
type: "integer",
|
|
43
|
-
...e || {}
|
|
44
|
-
}), en = (e) => ({
|
|
45
|
-
type: "boolean",
|
|
46
|
-
...e || {}
|
|
47
|
-
}), nn = {
|
|
48
|
-
stringValidator: Xe,
|
|
49
|
-
booleanValidator: en,
|
|
50
|
-
numberValidator: He,
|
|
51
|
-
integerValidator: Qe
|
|
37
|
+
alert: async () => (await import("./Alert-CBgIsMKO.js")).Alert,
|
|
38
|
+
markdownText: async () => (await import("./MarkdownText-kJVkmihW.js")).MarkdownText,
|
|
39
|
+
renderer: async () => (await import("./Renderer-B6WmwKDv.js")).Renderer
|
|
52
40
|
};
|
|
53
41
|
function u(e, n, t) {
|
|
54
42
|
function r(c, a) {
|
|
@@ -62,9 +50,9 @@ function u(e, n, t) {
|
|
|
62
50
|
}), c._zod.traits.has(e))
|
|
63
51
|
return;
|
|
64
52
|
c._zod.traits.add(e), n(c, a);
|
|
65
|
-
const f = i.prototype,
|
|
66
|
-
for (let p = 0; p <
|
|
67
|
-
const h =
|
|
53
|
+
const f = i.prototype, d = Object.keys(f);
|
|
54
|
+
for (let p = 0; p < d.length; p++) {
|
|
55
|
+
const h = d[p];
|
|
68
56
|
h in c || (c[h] = f[h].bind(c));
|
|
69
57
|
}
|
|
70
58
|
}
|
|
@@ -76,45 +64,45 @@ function u(e, n, t) {
|
|
|
76
64
|
var a;
|
|
77
65
|
const f = t?.Parent ? new s() : this;
|
|
78
66
|
r(f, c), (a = f._zod).deferred ?? (a.deferred = []);
|
|
79
|
-
for (const
|
|
80
|
-
|
|
67
|
+
for (const d of f._zod.deferred)
|
|
68
|
+
d();
|
|
81
69
|
return f;
|
|
82
70
|
}
|
|
83
71
|
return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
84
72
|
value: (c) => t?.Parent && c instanceof t.Parent ? !0 : c?._zod?.traits?.has(e)
|
|
85
73
|
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
86
74
|
}
|
|
87
|
-
class
|
|
75
|
+
class A extends Error {
|
|
88
76
|
constructor() {
|
|
89
77
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
90
78
|
}
|
|
91
79
|
}
|
|
92
|
-
class
|
|
80
|
+
class Te extends Error {
|
|
93
81
|
constructor(n) {
|
|
94
82
|
super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
|
|
95
83
|
}
|
|
96
84
|
}
|
|
97
|
-
const
|
|
98
|
-
function
|
|
99
|
-
return
|
|
85
|
+
const sn = {};
|
|
86
|
+
function O(e) {
|
|
87
|
+
return sn;
|
|
100
88
|
}
|
|
101
|
-
function
|
|
89
|
+
function Y(e, n) {
|
|
102
90
|
return typeof n == "bigint" ? n.toString() : n;
|
|
103
91
|
}
|
|
104
|
-
function
|
|
92
|
+
function ne(e) {
|
|
105
93
|
return e == null;
|
|
106
94
|
}
|
|
107
|
-
function
|
|
95
|
+
function te(e) {
|
|
108
96
|
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
|
|
109
97
|
return e.slice(n, t);
|
|
110
98
|
}
|
|
111
|
-
const
|
|
99
|
+
const ce = Symbol("evaluating");
|
|
112
100
|
function m(e, n, t) {
|
|
113
101
|
let r;
|
|
114
102
|
Object.defineProperty(e, n, {
|
|
115
103
|
get() {
|
|
116
|
-
if (r !==
|
|
117
|
-
return r === void 0 && (r =
|
|
104
|
+
if (r !== ce)
|
|
105
|
+
return r === void 0 && (r = ce, r = t()), r;
|
|
118
106
|
},
|
|
119
107
|
set(o) {
|
|
120
108
|
Object.defineProperty(e, n, {
|
|
@@ -125,7 +113,7 @@ function m(e, n, t) {
|
|
|
125
113
|
configurable: !0
|
|
126
114
|
});
|
|
127
115
|
}
|
|
128
|
-
function
|
|
116
|
+
function cn(...e) {
|
|
129
117
|
const n = {};
|
|
130
118
|
for (const t of e) {
|
|
131
119
|
const r = Object.getOwnPropertyDescriptors(t);
|
|
@@ -133,34 +121,34 @@ function rn(...e) {
|
|
|
133
121
|
}
|
|
134
122
|
return Object.defineProperties({}, n);
|
|
135
123
|
}
|
|
136
|
-
function
|
|
124
|
+
function an(e) {
|
|
137
125
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
138
126
|
}
|
|
139
|
-
const
|
|
127
|
+
const Pe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
140
128
|
};
|
|
141
|
-
function
|
|
129
|
+
function ae(e) {
|
|
142
130
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
143
131
|
}
|
|
144
|
-
function
|
|
145
|
-
if (
|
|
132
|
+
function X(e) {
|
|
133
|
+
if (ae(e) === !1)
|
|
146
134
|
return !1;
|
|
147
135
|
const n = e.constructor;
|
|
148
136
|
if (n === void 0 || typeof n != "function")
|
|
149
137
|
return !0;
|
|
150
138
|
const t = n.prototype;
|
|
151
|
-
return !(
|
|
139
|
+
return !(ae(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
152
140
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
141
|
+
function Ee(e) {
|
|
142
|
+
return X(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
155
143
|
}
|
|
156
|
-
function
|
|
144
|
+
function re(e) {
|
|
157
145
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
158
146
|
}
|
|
159
|
-
function
|
|
147
|
+
function Ae(e, n, t) {
|
|
160
148
|
const r = new e._zod.constr(n ?? e._zod.def);
|
|
161
149
|
return (!n || t?.parent) && (r._zod.parent = e), r;
|
|
162
150
|
}
|
|
163
|
-
function
|
|
151
|
+
function l(e) {
|
|
164
152
|
const n = e;
|
|
165
153
|
if (!n)
|
|
166
154
|
return {};
|
|
@@ -173,14 +161,14 @@ function d(e) {
|
|
|
173
161
|
}
|
|
174
162
|
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
|
|
175
163
|
}
|
|
176
|
-
const
|
|
164
|
+
const un = {
|
|
177
165
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
178
166
|
int32: [-2147483648, 2147483647],
|
|
179
167
|
uint32: [0, 4294967295],
|
|
180
168
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
181
169
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
182
170
|
};
|
|
183
|
-
function
|
|
171
|
+
function E(e, n = 0) {
|
|
184
172
|
if (e.aborted === !0)
|
|
185
173
|
return !0;
|
|
186
174
|
for (let t = n; t < e.issues.length; t++)
|
|
@@ -188,27 +176,27 @@ function P(e, n = 0) {
|
|
|
188
176
|
return !0;
|
|
189
177
|
return !1;
|
|
190
178
|
}
|
|
191
|
-
function
|
|
179
|
+
function fn(e, n) {
|
|
192
180
|
return n.map((t) => {
|
|
193
181
|
var r;
|
|
194
182
|
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
|
|
195
183
|
});
|
|
196
184
|
}
|
|
197
|
-
function
|
|
185
|
+
function x(e) {
|
|
198
186
|
return typeof e == "string" ? e : e?.message;
|
|
199
187
|
}
|
|
200
|
-
function
|
|
188
|
+
function T(e, n, t) {
|
|
201
189
|
const r = { ...e, path: e.path ?? [] };
|
|
202
190
|
if (!e.message) {
|
|
203
|
-
const o =
|
|
191
|
+
const o = x(e.inst?._zod.def?.error?.(e)) ?? x(n?.error?.(e)) ?? x(t.customError?.(e)) ?? x(t.localeError?.(e)) ?? "Invalid input";
|
|
204
192
|
r.message = o;
|
|
205
193
|
}
|
|
206
194
|
return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
|
|
207
195
|
}
|
|
208
|
-
function
|
|
196
|
+
function oe(e) {
|
|
209
197
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
210
198
|
}
|
|
211
|
-
function
|
|
199
|
+
function j(...e) {
|
|
212
200
|
const [n, t, r] = e;
|
|
213
201
|
return typeof n == "string" ? {
|
|
214
202
|
message: n,
|
|
@@ -217,25 +205,25 @@ function R(...e) {
|
|
|
217
205
|
inst: r
|
|
218
206
|
} : { ...n };
|
|
219
207
|
}
|
|
220
|
-
const
|
|
208
|
+
const Ie = (e, n) => {
|
|
221
209
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
222
210
|
value: e._zod,
|
|
223
211
|
enumerable: !1
|
|
224
212
|
}), Object.defineProperty(e, "issues", {
|
|
225
213
|
value: n,
|
|
226
214
|
enumerable: !1
|
|
227
|
-
}), e.message = JSON.stringify(n,
|
|
215
|
+
}), e.message = JSON.stringify(n, Y, 2), Object.defineProperty(e, "toString", {
|
|
228
216
|
value: () => e.message,
|
|
229
217
|
enumerable: !1
|
|
230
218
|
});
|
|
231
|
-
},
|
|
232
|
-
function
|
|
219
|
+
}, Ne = u("$ZodError", Ie), J = u("$ZodError", Ie, { Parent: Error });
|
|
220
|
+
function dn(e, n = (t) => t.message) {
|
|
233
221
|
const t = {}, r = [];
|
|
234
222
|
for (const o of e.issues)
|
|
235
223
|
o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
|
|
236
224
|
return { formErrors: r, fieldErrors: t };
|
|
237
225
|
}
|
|
238
|
-
function
|
|
226
|
+
function ln(e, n = (t) => t.message) {
|
|
239
227
|
const t = { _errors: [] }, r = (o) => {
|
|
240
228
|
for (const s of o.issues)
|
|
241
229
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -256,77 +244,77 @@ function an(e, n = (t) => t.message) {
|
|
|
256
244
|
};
|
|
257
245
|
return r(e), t;
|
|
258
246
|
}
|
|
259
|
-
const
|
|
247
|
+
const U = (e) => (n, t, r, o) => {
|
|
260
248
|
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, s);
|
|
261
249
|
if (i instanceof Promise)
|
|
262
|
-
throw new
|
|
250
|
+
throw new A();
|
|
263
251
|
if (i.issues.length) {
|
|
264
|
-
const c = new (o?.Err ?? e)(i.issues.map((a) =>
|
|
265
|
-
throw
|
|
252
|
+
const c = new (o?.Err ?? e)(i.issues.map((a) => T(a, s, O())));
|
|
253
|
+
throw Pe(c, o?.callee), c;
|
|
266
254
|
}
|
|
267
255
|
return i.value;
|
|
268
|
-
},
|
|
256
|
+
}, mn = /* @__PURE__ */ U(J), V = (e) => async (n, t, r, o) => {
|
|
269
257
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
270
258
|
let i = n._zod.run({ value: t, issues: [] }, s);
|
|
271
259
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
272
|
-
const c = new (o?.Err ?? e)(i.issues.map((a) =>
|
|
273
|
-
throw
|
|
260
|
+
const c = new (o?.Err ?? e)(i.issues.map((a) => T(a, s, O())));
|
|
261
|
+
throw Pe(c, o?.callee), c;
|
|
274
262
|
}
|
|
275
263
|
return i.value;
|
|
276
|
-
},
|
|
264
|
+
}, pn = /* @__PURE__ */ V(J), W = (e) => (n, t, r) => {
|
|
277
265
|
const o = r ? { ...r, async: !1 } : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
|
|
278
266
|
if (s instanceof Promise)
|
|
279
|
-
throw new
|
|
267
|
+
throw new A();
|
|
280
268
|
return s.issues.length ? {
|
|
281
269
|
success: !1,
|
|
282
|
-
error: new (e ??
|
|
270
|
+
error: new (e ?? Ne)(s.issues.map((i) => T(i, o, O())))
|
|
283
271
|
} : { success: !0, data: s.value };
|
|
284
|
-
},
|
|
272
|
+
}, Me = /* @__PURE__ */ W(J), G = (e) => async (n, t, r) => {
|
|
285
273
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
286
274
|
let s = n._zod.run({ value: t, issues: [] }, o);
|
|
287
275
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
288
276
|
success: !1,
|
|
289
|
-
error: new e(s.issues.map((i) =>
|
|
277
|
+
error: new e(s.issues.map((i) => T(i, o, O())))
|
|
290
278
|
} : { success: !0, data: s.value };
|
|
291
|
-
},
|
|
292
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
293
|
-
return x(e)(n, t, o);
|
|
294
|
-
}, pn = (e) => (n, t, r) => x(e)(n, t, r), mn = (e) => async (n, t, r) => {
|
|
295
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
296
|
-
return J(e)(n, t, o);
|
|
297
|
-
}, hn = (e) => async (n, t, r) => J(e)(n, t, r), _n = (e) => (n, t, r) => {
|
|
279
|
+
}, Ce = /* @__PURE__ */ G(J), hn = (e) => (n, t, r) => {
|
|
298
280
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
299
281
|
return U(e)(n, t, o);
|
|
300
|
-
}, gn = (e) => (n, t, r) => U(e)(n, t, r),
|
|
282
|
+
}, gn = (e) => (n, t, r) => U(e)(n, t, r), _n = (e) => async (n, t, r) => {
|
|
301
283
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
302
284
|
return V(e)(n, t, o);
|
|
303
|
-
}, yn = (e) => async (n, t, r) => V(e)(n, t, r),
|
|
304
|
-
|
|
285
|
+
}, yn = (e) => async (n, t, r) => V(e)(n, t, r), vn = (e) => (n, t, r) => {
|
|
286
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
287
|
+
return W(e)(n, t, o);
|
|
288
|
+
}, zn = (e) => (n, t, r) => W(e)(n, t, r), bn = (e) => async (n, t, r) => {
|
|
289
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
290
|
+
return G(e)(n, t, o);
|
|
291
|
+
}, wn = (e) => async (n, t, r) => G(e)(n, t, r), $n = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, ue = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, kn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Zn = /^(?:(?: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])$/, Sn = /^(([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}|:))$/, On = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Re = "(?:(?:\\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])))", Tn = /* @__PURE__ */ new RegExp(`^${Re}$`);
|
|
292
|
+
function je(e) {
|
|
305
293
|
const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
306
294
|
return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
307
295
|
}
|
|
308
|
-
function
|
|
309
|
-
return new RegExp(`^${
|
|
296
|
+
function Pn(e) {
|
|
297
|
+
return new RegExp(`^${je(e)}$`);
|
|
310
298
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
299
|
+
function En(e) {
|
|
300
|
+
const n = je({ precision: e.precision }), t = ["Z"];
|
|
313
301
|
e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
314
302
|
const r = `${n}(?:${t.join("|")})`;
|
|
315
|
-
return new RegExp(`^${
|
|
303
|
+
return new RegExp(`^${Re}T(?:${r})$`);
|
|
316
304
|
}
|
|
317
|
-
const
|
|
305
|
+
const An = (e) => {
|
|
318
306
|
const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
319
307
|
return new RegExp(`^${n}$`);
|
|
320
|
-
},
|
|
308
|
+
}, In = /^-?\d+$/, Nn = /^-?\d+(?:\.\d+)?$/, Mn = /^(?:true|false)$/i, Cn = /^[^A-Z]*$/, Rn = /^[^a-z]*$/, $ = /* @__PURE__ */ u("$ZodCheck", (e, n) => {
|
|
321
309
|
var t;
|
|
322
310
|
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
323
|
-
}),
|
|
311
|
+
}), Fe = {
|
|
324
312
|
number: "number",
|
|
325
313
|
bigint: "bigint",
|
|
326
314
|
object: "date"
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
const t =
|
|
315
|
+
}, jn = /* @__PURE__ */ u("$ZodCheckLessThan", (e, n) => {
|
|
316
|
+
$.init(e, n);
|
|
317
|
+
const t = Fe[typeof n.value];
|
|
330
318
|
e._zod.onattach.push((r) => {
|
|
331
319
|
const o = r._zod.bag, s = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
332
320
|
n.value < s && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
|
|
@@ -341,9 +329,9 @@ const Tn = (e) => {
|
|
|
341
329
|
continue: !n.abort
|
|
342
330
|
});
|
|
343
331
|
};
|
|
344
|
-
}),
|
|
345
|
-
|
|
346
|
-
const t =
|
|
332
|
+
}), Fn = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, n) => {
|
|
333
|
+
$.init(e, n);
|
|
334
|
+
const t = Fe[typeof n.value];
|
|
347
335
|
e._zod.onattach.push((r) => {
|
|
348
336
|
const o = r._zod.bag, s = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
349
337
|
n.value > s && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
|
|
@@ -358,12 +346,12 @@ const Tn = (e) => {
|
|
|
358
346
|
continue: !n.abort
|
|
359
347
|
});
|
|
360
348
|
};
|
|
361
|
-
}),
|
|
362
|
-
|
|
363
|
-
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] =
|
|
349
|
+
}), xn = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, n) => {
|
|
350
|
+
$.init(e, n), n.format = n.format || "float64";
|
|
351
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] = un[n.format];
|
|
364
352
|
e._zod.onattach.push((i) => {
|
|
365
353
|
const c = i._zod.bag;
|
|
366
|
-
c.format = n.format, c.minimum = o, c.maximum = s, t && (c.pattern =
|
|
354
|
+
c.format = n.format, c.minimum = o, c.maximum = s, t && (c.pattern = In);
|
|
367
355
|
}), e._zod.check = (i) => {
|
|
368
356
|
const c = i.value;
|
|
369
357
|
if (t) {
|
|
@@ -419,11 +407,11 @@ const Tn = (e) => {
|
|
|
419
407
|
continue: !n.abort
|
|
420
408
|
});
|
|
421
409
|
};
|
|
422
|
-
}),
|
|
410
|
+
}), Dn = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, n) => {
|
|
423
411
|
var t;
|
|
424
|
-
|
|
412
|
+
$.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
425
413
|
const o = r.value;
|
|
426
|
-
return !
|
|
414
|
+
return !ne(o) && o.length !== void 0;
|
|
427
415
|
}), e._zod.onattach.push((r) => {
|
|
428
416
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
429
417
|
n.maximum < o && (r._zod.bag.maximum = n.maximum);
|
|
@@ -431,7 +419,7 @@ const Tn = (e) => {
|
|
|
431
419
|
const o = r.value;
|
|
432
420
|
if (o.length <= n.maximum)
|
|
433
421
|
return;
|
|
434
|
-
const i =
|
|
422
|
+
const i = oe(o);
|
|
435
423
|
r.issues.push({
|
|
436
424
|
origin: i,
|
|
437
425
|
code: "too_big",
|
|
@@ -442,11 +430,11 @@ const Tn = (e) => {
|
|
|
442
430
|
continue: !n.abort
|
|
443
431
|
});
|
|
444
432
|
};
|
|
445
|
-
}),
|
|
433
|
+
}), Ln = /* @__PURE__ */ u("$ZodCheckMinLength", (e, n) => {
|
|
446
434
|
var t;
|
|
447
|
-
|
|
435
|
+
$.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
448
436
|
const o = r.value;
|
|
449
|
-
return !
|
|
437
|
+
return !ne(o) && o.length !== void 0;
|
|
450
438
|
}), e._zod.onattach.push((r) => {
|
|
451
439
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
452
440
|
n.minimum > o && (r._zod.bag.minimum = n.minimum);
|
|
@@ -454,7 +442,7 @@ const Tn = (e) => {
|
|
|
454
442
|
const o = r.value;
|
|
455
443
|
if (o.length >= n.minimum)
|
|
456
444
|
return;
|
|
457
|
-
const i =
|
|
445
|
+
const i = oe(o);
|
|
458
446
|
r.issues.push({
|
|
459
447
|
origin: i,
|
|
460
448
|
code: "too_small",
|
|
@@ -465,11 +453,11 @@ const Tn = (e) => {
|
|
|
465
453
|
continue: !n.abort
|
|
466
454
|
});
|
|
467
455
|
};
|
|
468
|
-
}),
|
|
456
|
+
}), Jn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, n) => {
|
|
469
457
|
var t;
|
|
470
|
-
|
|
458
|
+
$.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
471
459
|
const o = r.value;
|
|
472
|
-
return !
|
|
460
|
+
return !ne(o) && o.length !== void 0;
|
|
473
461
|
}), e._zod.onattach.push((r) => {
|
|
474
462
|
const o = r._zod.bag;
|
|
475
463
|
o.minimum = n.length, o.maximum = n.length, o.length = n.length;
|
|
@@ -477,7 +465,7 @@ const Tn = (e) => {
|
|
|
477
465
|
const o = r.value, s = o.length;
|
|
478
466
|
if (s === n.length)
|
|
479
467
|
return;
|
|
480
|
-
const i =
|
|
468
|
+
const i = oe(o), c = s > n.length;
|
|
481
469
|
r.issues.push({
|
|
482
470
|
origin: i,
|
|
483
471
|
...c ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
|
|
@@ -488,9 +476,9 @@ const Tn = (e) => {
|
|
|
488
476
|
continue: !n.abort
|
|
489
477
|
});
|
|
490
478
|
};
|
|
491
|
-
}),
|
|
479
|
+
}), q = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, n) => {
|
|
492
480
|
var t, r;
|
|
493
|
-
|
|
481
|
+
$.init(e, n), e._zod.onattach.push((o) => {
|
|
494
482
|
const s = o._zod.bag;
|
|
495
483
|
s.format = n.format, n.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(n.pattern));
|
|
496
484
|
}), n.pattern ? (t = e._zod).check ?? (t.check = (o) => {
|
|
@@ -505,8 +493,8 @@ const Tn = (e) => {
|
|
|
505
493
|
});
|
|
506
494
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
507
495
|
});
|
|
508
|
-
}),
|
|
509
|
-
|
|
496
|
+
}), Un = /* @__PURE__ */ u("$ZodCheckRegex", (e, n) => {
|
|
497
|
+
q.init(e, n), e._zod.check = (t) => {
|
|
510
498
|
n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
|
|
511
499
|
origin: "string",
|
|
512
500
|
code: "invalid_format",
|
|
@@ -517,13 +505,13 @@ const Tn = (e) => {
|
|
|
517
505
|
continue: !n.abort
|
|
518
506
|
});
|
|
519
507
|
};
|
|
520
|
-
}),
|
|
521
|
-
n.pattern ?? (n.pattern =
|
|
522
|
-
}),
|
|
523
|
-
n.pattern ?? (n.pattern =
|
|
524
|
-
}),
|
|
525
|
-
|
|
526
|
-
const t =
|
|
508
|
+
}), Vn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, n) => {
|
|
509
|
+
n.pattern ?? (n.pattern = Cn), q.init(e, n);
|
|
510
|
+
}), Wn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, n) => {
|
|
511
|
+
n.pattern ?? (n.pattern = Rn), q.init(e, n);
|
|
512
|
+
}), Gn = /* @__PURE__ */ u("$ZodCheckIncludes", (e, n) => {
|
|
513
|
+
$.init(e, n);
|
|
514
|
+
const t = re(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
|
|
527
515
|
n.pattern = r, e._zod.onattach.push((o) => {
|
|
528
516
|
const s = o._zod.bag;
|
|
529
517
|
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
@@ -538,9 +526,9 @@ const Tn = (e) => {
|
|
|
538
526
|
continue: !n.abort
|
|
539
527
|
});
|
|
540
528
|
};
|
|
541
|
-
}),
|
|
542
|
-
|
|
543
|
-
const t = new RegExp(`^${
|
|
529
|
+
}), qn = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, n) => {
|
|
530
|
+
$.init(e, n);
|
|
531
|
+
const t = new RegExp(`^${re(n.prefix)}.*`);
|
|
544
532
|
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
|
|
545
533
|
const o = r._zod.bag;
|
|
546
534
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
|
|
@@ -555,9 +543,9 @@ const Tn = (e) => {
|
|
|
555
543
|
continue: !n.abort
|
|
556
544
|
});
|
|
557
545
|
};
|
|
558
|
-
}),
|
|
559
|
-
|
|
560
|
-
const t = new RegExp(`.*${
|
|
546
|
+
}), Bn = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, n) => {
|
|
547
|
+
$.init(e, n);
|
|
548
|
+
const t = new RegExp(`.*${re(n.suffix)}$`);
|
|
561
549
|
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
|
|
562
550
|
const o = r._zod.bag;
|
|
563
551
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
|
|
@@ -572,17 +560,17 @@ const Tn = (e) => {
|
|
|
572
560
|
continue: !n.abort
|
|
573
561
|
});
|
|
574
562
|
};
|
|
575
|
-
}),
|
|
576
|
-
|
|
563
|
+
}), Kn = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, n) => {
|
|
564
|
+
$.init(e, n), e._zod.check = (t) => {
|
|
577
565
|
t.value = n.tx(t.value);
|
|
578
566
|
};
|
|
579
|
-
}),
|
|
567
|
+
}), Yn = {
|
|
580
568
|
major: 4,
|
|
581
569
|
minor: 3,
|
|
582
570
|
patch: 6
|
|
583
|
-
},
|
|
571
|
+
}, y = /* @__PURE__ */ u("$ZodType", (e, n) => {
|
|
584
572
|
var t;
|
|
585
|
-
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
573
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Yn;
|
|
586
574
|
const r = [...e._zod.def.checks ?? []];
|
|
587
575
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
588
576
|
for (const o of r)
|
|
@@ -594,35 +582,35 @@ const Tn = (e) => {
|
|
|
594
582
|
});
|
|
595
583
|
else {
|
|
596
584
|
const o = (i, c, a) => {
|
|
597
|
-
let f =
|
|
585
|
+
let f = E(i), d;
|
|
598
586
|
for (const p of c) {
|
|
599
587
|
if (p._zod.def.when) {
|
|
600
588
|
if (!p._zod.def.when(i))
|
|
601
589
|
continue;
|
|
602
590
|
} else if (f)
|
|
603
591
|
continue;
|
|
604
|
-
const h = i.issues.length,
|
|
605
|
-
if (
|
|
606
|
-
throw new
|
|
607
|
-
if (
|
|
608
|
-
|
|
609
|
-
await
|
|
592
|
+
const h = i.issues.length, g = p._zod.check(i);
|
|
593
|
+
if (g instanceof Promise && a?.async === !1)
|
|
594
|
+
throw new A();
|
|
595
|
+
if (d || g instanceof Promise)
|
|
596
|
+
d = (d ?? Promise.resolve()).then(async () => {
|
|
597
|
+
await g, i.issues.length !== h && (f || (f = E(i, h)));
|
|
610
598
|
});
|
|
611
599
|
else {
|
|
612
600
|
if (i.issues.length === h)
|
|
613
601
|
continue;
|
|
614
|
-
f || (f =
|
|
602
|
+
f || (f = E(i, h));
|
|
615
603
|
}
|
|
616
604
|
}
|
|
617
|
-
return
|
|
605
|
+
return d ? d.then(() => i) : i;
|
|
618
606
|
}, s = (i, c, a) => {
|
|
619
|
-
if (
|
|
607
|
+
if (E(i))
|
|
620
608
|
return i.aborted = !0, i;
|
|
621
609
|
const f = o(c, r, a);
|
|
622
610
|
if (f instanceof Promise) {
|
|
623
611
|
if (a.async === !1)
|
|
624
|
-
throw new
|
|
625
|
-
return f.then((
|
|
612
|
+
throw new A();
|
|
613
|
+
return f.then((d) => e._zod.parse(d, a));
|
|
626
614
|
}
|
|
627
615
|
return e._zod.parse(f, a);
|
|
628
616
|
};
|
|
@@ -631,12 +619,12 @@ const Tn = (e) => {
|
|
|
631
619
|
return e._zod.parse(i, c);
|
|
632
620
|
if (c.direction === "backward") {
|
|
633
621
|
const f = e._zod.parse({ value: i.value, issues: [] }, { ...c, skipChecks: !0 });
|
|
634
|
-
return f instanceof Promise ? f.then((
|
|
622
|
+
return f instanceof Promise ? f.then((d) => s(d, i, c)) : s(f, i, c);
|
|
635
623
|
}
|
|
636
624
|
const a = e._zod.parse(i, c);
|
|
637
625
|
if (a instanceof Promise) {
|
|
638
626
|
if (c.async === !1)
|
|
639
|
-
throw new
|
|
627
|
+
throw new A();
|
|
640
628
|
return a.then((f) => o(f, r, c));
|
|
641
629
|
}
|
|
642
630
|
return o(a, r, c);
|
|
@@ -645,17 +633,17 @@ const Tn = (e) => {
|
|
|
645
633
|
m(e, "~standard", () => ({
|
|
646
634
|
validate: (o) => {
|
|
647
635
|
try {
|
|
648
|
-
const s =
|
|
636
|
+
const s = Me(e, o);
|
|
649
637
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
650
638
|
} catch {
|
|
651
|
-
return
|
|
639
|
+
return Ce(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
652
640
|
}
|
|
653
641
|
},
|
|
654
642
|
vendor: "zod",
|
|
655
643
|
version: 1
|
|
656
644
|
}));
|
|
657
|
-
}),
|
|
658
|
-
|
|
645
|
+
}), ie = /* @__PURE__ */ u("$ZodString", (e, n) => {
|
|
646
|
+
y.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? An(e._zod.bag), e._zod.parse = (t, r) => {
|
|
659
647
|
if (n.coerce)
|
|
660
648
|
try {
|
|
661
649
|
t.value = String(t.value);
|
|
@@ -668,9 +656,9 @@ const Tn = (e) => {
|
|
|
668
656
|
inst: e
|
|
669
657
|
}), t;
|
|
670
658
|
};
|
|
671
|
-
}),
|
|
672
|
-
|
|
673
|
-
}),
|
|
659
|
+
}), k = /* @__PURE__ */ u("$ZodStringFormat", (e, n) => {
|
|
660
|
+
q.init(e, n), ie.init(e, n);
|
|
661
|
+
}), Xn = /* @__PURE__ */ u("$ZodUUID", (e, n) => {
|
|
674
662
|
if (n.version) {
|
|
675
663
|
const r = {
|
|
676
664
|
v1: 1,
|
|
@@ -684,14 +672,14 @@ const Tn = (e) => {
|
|
|
684
672
|
}[n.version];
|
|
685
673
|
if (r === void 0)
|
|
686
674
|
throw new Error(`Invalid UUID version: "${n.version}"`);
|
|
687
|
-
n.pattern ?? (n.pattern =
|
|
675
|
+
n.pattern ?? (n.pattern = ue(r));
|
|
688
676
|
} else
|
|
689
|
-
n.pattern ?? (n.pattern =
|
|
690
|
-
|
|
691
|
-
}),
|
|
692
|
-
n.pattern ?? (n.pattern =
|
|
693
|
-
}),
|
|
694
|
-
|
|
677
|
+
n.pattern ?? (n.pattern = ue());
|
|
678
|
+
k.init(e, n);
|
|
679
|
+
}), Hn = /* @__PURE__ */ u("$ZodEmail", (e, n) => {
|
|
680
|
+
n.pattern ?? (n.pattern = kn), k.init(e, n);
|
|
681
|
+
}), Qn = /* @__PURE__ */ u("$ZodURL", (e, n) => {
|
|
682
|
+
k.init(e, n), e._zod.check = (t) => {
|
|
695
683
|
try {
|
|
696
684
|
const r = t.value.trim(), o = new URL(r);
|
|
697
685
|
n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(o.hostname) || t.issues.push({
|
|
@@ -722,18 +710,18 @@ const Tn = (e) => {
|
|
|
722
710
|
});
|
|
723
711
|
}
|
|
724
712
|
};
|
|
725
|
-
}),
|
|
726
|
-
n.pattern ?? (n.pattern =
|
|
727
|
-
}),
|
|
728
|
-
n.pattern ?? (n.pattern =
|
|
729
|
-
}),
|
|
730
|
-
n.pattern ?? (n.pattern =
|
|
731
|
-
}),
|
|
732
|
-
n.pattern ?? (n.pattern =
|
|
733
|
-
}),
|
|
734
|
-
n.pattern ?? (n.pattern =
|
|
735
|
-
}),
|
|
736
|
-
n.pattern ?? (n.pattern =
|
|
713
|
+
}), et = /* @__PURE__ */ u("$ZodISODateTime", (e, n) => {
|
|
714
|
+
n.pattern ?? (n.pattern = En(n)), k.init(e, n);
|
|
715
|
+
}), nt = /* @__PURE__ */ u("$ZodISODate", (e, n) => {
|
|
716
|
+
n.pattern ?? (n.pattern = Tn), k.init(e, n);
|
|
717
|
+
}), tt = /* @__PURE__ */ u("$ZodISOTime", (e, n) => {
|
|
718
|
+
n.pattern ?? (n.pattern = Pn(n)), k.init(e, n);
|
|
719
|
+
}), rt = /* @__PURE__ */ u("$ZodISODuration", (e, n) => {
|
|
720
|
+
n.pattern ?? (n.pattern = $n), k.init(e, n);
|
|
721
|
+
}), ot = /* @__PURE__ */ u("$ZodIPv4", (e, n) => {
|
|
722
|
+
n.pattern ?? (n.pattern = Zn), k.init(e, n), e._zod.bag.format = "ipv4";
|
|
723
|
+
}), it = /* @__PURE__ */ u("$ZodIPv6", (e, n) => {
|
|
724
|
+
n.pattern ?? (n.pattern = Sn), k.init(e, n), e._zod.bag.format = "ipv6", e._zod.check = (t) => {
|
|
737
725
|
try {
|
|
738
726
|
new URL(`http://[${t.value}]`);
|
|
739
727
|
} catch {
|
|
@@ -746,8 +734,8 @@ const Tn = (e) => {
|
|
|
746
734
|
});
|
|
747
735
|
}
|
|
748
736
|
};
|
|
749
|
-
}),
|
|
750
|
-
|
|
737
|
+
}), st = /* @__PURE__ */ u("$ZodCustomStringFormat", (e, n) => {
|
|
738
|
+
k.init(e, n), e._zod.check = (t) => {
|
|
751
739
|
n.fn(t.value) || t.issues.push({
|
|
752
740
|
code: "invalid_format",
|
|
753
741
|
format: n.format,
|
|
@@ -756,8 +744,8 @@ const Tn = (e) => {
|
|
|
756
744
|
continue: !n.abort
|
|
757
745
|
});
|
|
758
746
|
};
|
|
759
|
-
}),
|
|
760
|
-
|
|
747
|
+
}), xe = /* @__PURE__ */ u("$ZodNumber", (e, n) => {
|
|
748
|
+
y.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? Nn, e._zod.parse = (t, r) => {
|
|
761
749
|
if (n.coerce)
|
|
762
750
|
try {
|
|
763
751
|
t.value = Number(t.value);
|
|
@@ -775,10 +763,10 @@ const Tn = (e) => {
|
|
|
775
763
|
...s ? { received: s } : {}
|
|
776
764
|
}), t;
|
|
777
765
|
};
|
|
778
|
-
}),
|
|
779
|
-
|
|
780
|
-
}),
|
|
781
|
-
|
|
766
|
+
}), ct = /* @__PURE__ */ u("$ZodNumberFormat", (e, n) => {
|
|
767
|
+
xn.init(e, n), xe.init(e, n);
|
|
768
|
+
}), at = /* @__PURE__ */ u("$ZodBoolean", (e, n) => {
|
|
769
|
+
y.init(e, n), e._zod.pattern = Mn, e._zod.parse = (t, r) => {
|
|
782
770
|
if (n.coerce)
|
|
783
771
|
try {
|
|
784
772
|
t.value = !!t.value;
|
|
@@ -792,14 +780,14 @@ const Tn = (e) => {
|
|
|
792
780
|
inst: e
|
|
793
781
|
}), t;
|
|
794
782
|
};
|
|
795
|
-
}),
|
|
796
|
-
|
|
783
|
+
}), ut = /* @__PURE__ */ u("$ZodAny", (e, n) => {
|
|
784
|
+
y.init(e, n), e._zod.parse = (t) => t;
|
|
797
785
|
});
|
|
798
|
-
function
|
|
799
|
-
e.issues.length && n.issues.push(...
|
|
786
|
+
function fe(e, n, t) {
|
|
787
|
+
e.issues.length && n.issues.push(...fn(t, e.issues)), n.value[t] = e.value;
|
|
800
788
|
}
|
|
801
|
-
const
|
|
802
|
-
|
|
789
|
+
const De = /* @__PURE__ */ u("$ZodArray", (e, n) => {
|
|
790
|
+
y.init(e, n), e._zod.parse = (t, r) => {
|
|
803
791
|
const o = t.value;
|
|
804
792
|
if (!Array.isArray(o))
|
|
805
793
|
return t.issues.push({
|
|
@@ -815,31 +803,31 @@ const ct = /* @__PURE__ */ u("$ZodArray", (e, n) => {
|
|
|
815
803
|
value: c,
|
|
816
804
|
issues: []
|
|
817
805
|
}, r);
|
|
818
|
-
a instanceof Promise ? s.push(a.then((f) =>
|
|
806
|
+
a instanceof Promise ? s.push(a.then((f) => fe(f, t, i))) : fe(a, t, i);
|
|
819
807
|
}
|
|
820
808
|
return s.length ? Promise.all(s).then(() => t) : t;
|
|
821
809
|
};
|
|
822
810
|
});
|
|
823
|
-
function
|
|
811
|
+
function de(e, n, t, r) {
|
|
824
812
|
for (const s of e)
|
|
825
813
|
if (s.issues.length === 0)
|
|
826
814
|
return n.value = s.value, n;
|
|
827
|
-
const o = e.filter((s) => !
|
|
815
|
+
const o = e.filter((s) => !E(s));
|
|
828
816
|
return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
|
|
829
817
|
code: "invalid_union",
|
|
830
818
|
input: n.value,
|
|
831
819
|
inst: t,
|
|
832
|
-
errors: e.map((s) => s.issues.map((i) =>
|
|
820
|
+
errors: e.map((s) => s.issues.map((i) => T(i, r, O())))
|
|
833
821
|
}), n);
|
|
834
822
|
}
|
|
835
|
-
const
|
|
836
|
-
|
|
823
|
+
const ft = /* @__PURE__ */ u("$ZodUnion", (e, n) => {
|
|
824
|
+
y.init(e, n), m(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), m(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), m(e._zod, "values", () => {
|
|
837
825
|
if (n.options.every((o) => o._zod.values))
|
|
838
826
|
return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
|
|
839
827
|
}), m(e._zod, "pattern", () => {
|
|
840
828
|
if (n.options.every((o) => o._zod.pattern)) {
|
|
841
829
|
const o = n.options.map((s) => s._zod.pattern);
|
|
842
|
-
return new RegExp(`^(${o.map((s) =>
|
|
830
|
+
return new RegExp(`^(${o.map((s) => te(s.source)).join("|")})$`);
|
|
843
831
|
}
|
|
844
832
|
});
|
|
845
833
|
const t = n.options.length === 1, r = n.options[0]._zod.run;
|
|
@@ -861,23 +849,23 @@ const ut = /* @__PURE__ */ u("$ZodUnion", (e, n) => {
|
|
|
861
849
|
c.push(f);
|
|
862
850
|
}
|
|
863
851
|
}
|
|
864
|
-
return i ? Promise.all(c).then((a) =>
|
|
852
|
+
return i ? Promise.all(c).then((a) => de(a, o, e, s)) : de(c, o, e, s);
|
|
865
853
|
};
|
|
866
|
-
}),
|
|
867
|
-
|
|
854
|
+
}), dt = /* @__PURE__ */ u("$ZodIntersection", (e, n) => {
|
|
855
|
+
y.init(e, n), e._zod.parse = (t, r) => {
|
|
868
856
|
const o = t.value, s = n.left._zod.run({ value: o, issues: [] }, r), i = n.right._zod.run({ value: o, issues: [] }, r);
|
|
869
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([a, f]) =>
|
|
857
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([a, f]) => le(t, a, f)) : le(t, s, i);
|
|
870
858
|
};
|
|
871
859
|
});
|
|
872
|
-
function
|
|
860
|
+
function H(e, n) {
|
|
873
861
|
if (e === n)
|
|
874
862
|
return { valid: !0, data: e };
|
|
875
863
|
if (e instanceof Date && n instanceof Date && +e == +n)
|
|
876
864
|
return { valid: !0, data: e };
|
|
877
|
-
if (
|
|
865
|
+
if (X(e) && X(n)) {
|
|
878
866
|
const t = Object.keys(n), r = Object.keys(e).filter((s) => t.indexOf(s) !== -1), o = { ...e, ...n };
|
|
879
867
|
for (const s of r) {
|
|
880
|
-
const i =
|
|
868
|
+
const i = H(e[s], n[s]);
|
|
881
869
|
if (!i.valid)
|
|
882
870
|
return {
|
|
883
871
|
valid: !1,
|
|
@@ -892,7 +880,7 @@ function Y(e, n) {
|
|
|
892
880
|
return { valid: !1, mergeErrorPath: [] };
|
|
893
881
|
const t = [];
|
|
894
882
|
for (let r = 0; r < e.length; r++) {
|
|
895
|
-
const o = e[r], s = n[r], i =
|
|
883
|
+
const o = e[r], s = n[r], i = H(o, s);
|
|
896
884
|
if (!i.valid)
|
|
897
885
|
return {
|
|
898
886
|
valid: !1,
|
|
@@ -904,7 +892,7 @@ function Y(e, n) {
|
|
|
904
892
|
}
|
|
905
893
|
return { valid: !1, mergeErrorPath: [] };
|
|
906
894
|
}
|
|
907
|
-
function
|
|
895
|
+
function le(e, n, t) {
|
|
908
896
|
const r = /* @__PURE__ */ new Map();
|
|
909
897
|
let o;
|
|
910
898
|
for (const c of n.issues)
|
|
@@ -921,71 +909,71 @@ function fe(e, n, t) {
|
|
|
921
909
|
else
|
|
922
910
|
e.issues.push(c);
|
|
923
911
|
const s = [...r].filter(([, c]) => c.l && c.r).map(([c]) => c);
|
|
924
|
-
if (s.length && o && e.issues.push({ ...o, keys: s }),
|
|
912
|
+
if (s.length && o && e.issues.push({ ...o, keys: s }), E(e))
|
|
925
913
|
return e;
|
|
926
|
-
const i =
|
|
914
|
+
const i = H(n.value, t.value);
|
|
927
915
|
if (!i.valid)
|
|
928
916
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
929
917
|
return e.value = i.data, e;
|
|
930
918
|
}
|
|
931
|
-
const
|
|
932
|
-
|
|
919
|
+
const lt = /* @__PURE__ */ u("$ZodTransform", (e, n) => {
|
|
920
|
+
y.init(e, n), e._zod.parse = (t, r) => {
|
|
933
921
|
if (r.direction === "backward")
|
|
934
|
-
throw new
|
|
922
|
+
throw new Te(e.constructor.name);
|
|
935
923
|
const o = n.transform(t.value, t);
|
|
936
924
|
if (r.async)
|
|
937
925
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (t.value = i, t));
|
|
938
926
|
if (o instanceof Promise)
|
|
939
|
-
throw new
|
|
927
|
+
throw new A();
|
|
940
928
|
return t.value = o, t;
|
|
941
929
|
};
|
|
942
930
|
});
|
|
943
|
-
function
|
|
931
|
+
function me(e, n) {
|
|
944
932
|
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
945
933
|
}
|
|
946
|
-
const
|
|
947
|
-
|
|
934
|
+
const se = /* @__PURE__ */ u("$ZodOptional", (e, n) => {
|
|
935
|
+
y.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", m(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), m(e._zod, "pattern", () => {
|
|
948
936
|
const t = n.innerType._zod.pattern;
|
|
949
|
-
return t ? new RegExp(`^(${
|
|
937
|
+
return t ? new RegExp(`^(${te(t.source)})?$`) : void 0;
|
|
950
938
|
}), e._zod.parse = (t, r) => {
|
|
951
939
|
if (n.innerType._zod.optin === "optional") {
|
|
952
940
|
const o = n.innerType._zod.run(t, r);
|
|
953
|
-
return o instanceof Promise ? o.then((s) =>
|
|
941
|
+
return o instanceof Promise ? o.then((s) => me(s, t.value)) : me(o, t.value);
|
|
954
942
|
}
|
|
955
943
|
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
956
944
|
};
|
|
957
|
-
}),
|
|
958
|
-
|
|
959
|
-
}),
|
|
960
|
-
|
|
945
|
+
}), mt = /* @__PURE__ */ u("$ZodExactOptional", (e, n) => {
|
|
946
|
+
se.init(e, n), m(e._zod, "values", () => n.innerType._zod.values), m(e._zod, "pattern", () => n.innerType._zod.pattern), e._zod.parse = (t, r) => n.innerType._zod.run(t, r);
|
|
947
|
+
}), pt = /* @__PURE__ */ u("$ZodNullable", (e, n) => {
|
|
948
|
+
y.init(e, n), m(e._zod, "optin", () => n.innerType._zod.optin), m(e._zod, "optout", () => n.innerType._zod.optout), m(e._zod, "pattern", () => {
|
|
961
949
|
const t = n.innerType._zod.pattern;
|
|
962
|
-
return t ? new RegExp(`^(${
|
|
950
|
+
return t ? new RegExp(`^(${te(t.source)}|null)$`) : void 0;
|
|
963
951
|
}), m(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
|
|
964
|
-
}),
|
|
965
|
-
|
|
952
|
+
}), ht = /* @__PURE__ */ u("$ZodDefault", (e, n) => {
|
|
953
|
+
y.init(e, n), e._zod.optin = "optional", m(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
966
954
|
if (r.direction === "backward")
|
|
967
955
|
return n.innerType._zod.run(t, r);
|
|
968
956
|
if (t.value === void 0)
|
|
969
957
|
return t.value = n.defaultValue, t;
|
|
970
958
|
const o = n.innerType._zod.run(t, r);
|
|
971
|
-
return o instanceof Promise ? o.then((s) =>
|
|
959
|
+
return o instanceof Promise ? o.then((s) => pe(s, n)) : pe(o, n);
|
|
972
960
|
};
|
|
973
961
|
});
|
|
974
|
-
function
|
|
962
|
+
function pe(e, n) {
|
|
975
963
|
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
976
964
|
}
|
|
977
|
-
const
|
|
978
|
-
|
|
979
|
-
}),
|
|
980
|
-
|
|
965
|
+
const gt = /* @__PURE__ */ u("$ZodPrefault", (e, n) => {
|
|
966
|
+
y.init(e, n), e._zod.optin = "optional", m(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
|
|
967
|
+
}), _t = /* @__PURE__ */ u("$ZodNonOptional", (e, n) => {
|
|
968
|
+
y.init(e, n), m(e._zod, "values", () => {
|
|
981
969
|
const t = n.innerType._zod.values;
|
|
982
970
|
return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
|
|
983
971
|
}), e._zod.parse = (t, r) => {
|
|
984
972
|
const o = n.innerType._zod.run(t, r);
|
|
985
|
-
return o instanceof Promise ? o.then((s) =>
|
|
973
|
+
return o instanceof Promise ? o.then((s) => he(s, e)) : he(o, e);
|
|
986
974
|
};
|
|
987
975
|
});
|
|
988
|
-
function
|
|
976
|
+
function he(e, n) {
|
|
989
977
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
990
978
|
code: "invalid_type",
|
|
991
979
|
expected: "nonoptional",
|
|
@@ -993,65 +981,58 @@ function pe(e, n) {
|
|
|
993
981
|
inst: n
|
|
994
982
|
}), e;
|
|
995
983
|
}
|
|
996
|
-
const
|
|
997
|
-
|
|
998
|
-
if (r.direction === "backward")
|
|
999
|
-
throw new X("ZodSuccess");
|
|
1000
|
-
const o = n.innerType._zod.run(t, r);
|
|
1001
|
-
return o instanceof Promise ? o.then((s) => (t.value = s.issues.length === 0, t)) : (t.value = o.issues.length === 0, t);
|
|
1002
|
-
};
|
|
1003
|
-
}), gt = /* @__PURE__ */ u("$ZodCatch", (e, n) => {
|
|
1004
|
-
g.init(e, n), m(e._zod, "optin", () => n.innerType._zod.optin), m(e._zod, "optout", () => n.innerType._zod.optout), m(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
984
|
+
const yt = /* @__PURE__ */ u("$ZodCatch", (e, n) => {
|
|
985
|
+
y.init(e, n), m(e._zod, "optin", () => n.innerType._zod.optin), m(e._zod, "optout", () => n.innerType._zod.optout), m(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1005
986
|
if (r.direction === "backward")
|
|
1006
987
|
return n.innerType._zod.run(t, r);
|
|
1007
988
|
const o = n.innerType._zod.run(t, r);
|
|
1008
989
|
return o instanceof Promise ? o.then((s) => (t.value = s.value, s.issues.length && (t.value = n.catchValue({
|
|
1009
990
|
...t,
|
|
1010
991
|
error: {
|
|
1011
|
-
issues: s.issues.map((i) =>
|
|
992
|
+
issues: s.issues.map((i) => T(i, r, O()))
|
|
1012
993
|
},
|
|
1013
994
|
input: t.value
|
|
1014
995
|
}), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
|
|
1015
996
|
...t,
|
|
1016
997
|
error: {
|
|
1017
|
-
issues: o.issues.map((s) =>
|
|
998
|
+
issues: o.issues.map((s) => T(s, r, O()))
|
|
1018
999
|
},
|
|
1019
1000
|
input: t.value
|
|
1020
1001
|
}), t.issues = []), t);
|
|
1021
1002
|
};
|
|
1022
1003
|
}), vt = /* @__PURE__ */ u("$ZodPipe", (e, n) => {
|
|
1023
|
-
|
|
1004
|
+
y.init(e, n), m(e._zod, "values", () => n.in._zod.values), m(e._zod, "optin", () => n.in._zod.optin), m(e._zod, "optout", () => n.out._zod.optout), m(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
|
|
1024
1005
|
if (r.direction === "backward") {
|
|
1025
1006
|
const s = n.out._zod.run(t, r);
|
|
1026
|
-
return s instanceof Promise ? s.then((i) =>
|
|
1007
|
+
return s instanceof Promise ? s.then((i) => D(i, n.in, r)) : D(s, n.in, r);
|
|
1027
1008
|
}
|
|
1028
1009
|
const o = n.in._zod.run(t, r);
|
|
1029
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1010
|
+
return o instanceof Promise ? o.then((s) => D(s, n.out, r)) : D(o, n.out, r);
|
|
1030
1011
|
};
|
|
1031
1012
|
});
|
|
1032
|
-
function
|
|
1013
|
+
function D(e, n, t) {
|
|
1033
1014
|
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1034
1015
|
}
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1016
|
+
const zt = /* @__PURE__ */ u("$ZodReadonly", (e, n) => {
|
|
1017
|
+
y.init(e, n), m(e._zod, "propValues", () => n.innerType._zod.propValues), m(e._zod, "values", () => n.innerType._zod.values), m(e._zod, "optin", () => n.innerType?._zod?.optin), m(e._zod, "optout", () => n.innerType?._zod?.optout), e._zod.parse = (t, r) => {
|
|
1037
1018
|
if (r.direction === "backward")
|
|
1038
1019
|
return n.innerType._zod.run(t, r);
|
|
1039
1020
|
const o = n.innerType._zod.run(t, r);
|
|
1040
|
-
return o instanceof Promise ? o.then(
|
|
1021
|
+
return o instanceof Promise ? o.then(ge) : ge(o);
|
|
1041
1022
|
};
|
|
1042
1023
|
});
|
|
1043
|
-
function
|
|
1024
|
+
function ge(e) {
|
|
1044
1025
|
return e.value = Object.freeze(e.value), e;
|
|
1045
1026
|
}
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1027
|
+
const Le = /* @__PURE__ */ u("$ZodCustom", (e, n) => {
|
|
1028
|
+
$.init(e, n), y.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
|
|
1048
1029
|
const r = t.value, o = n.fn(r);
|
|
1049
1030
|
if (o instanceof Promise)
|
|
1050
|
-
return o.then((s) =>
|
|
1051
|
-
|
|
1031
|
+
return o.then((s) => _e(s, t, r, e));
|
|
1032
|
+
_e(o, t, r, e);
|
|
1052
1033
|
};
|
|
1053
1034
|
});
|
|
1054
|
-
function
|
|
1035
|
+
function _e(e, n, t, r) {
|
|
1055
1036
|
if (!e) {
|
|
1056
1037
|
const o = {
|
|
1057
1038
|
code: "custom",
|
|
@@ -1063,11 +1044,11 @@ function he(e, n, t, r) {
|
|
|
1063
1044
|
continue: !r._zod.def.abort
|
|
1064
1045
|
// params: inst._zod.def.params,
|
|
1065
1046
|
};
|
|
1066
|
-
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(
|
|
1047
|
+
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(j(o));
|
|
1067
1048
|
}
|
|
1068
1049
|
}
|
|
1069
|
-
var
|
|
1070
|
-
class
|
|
1050
|
+
var ye;
|
|
1051
|
+
class bt {
|
|
1071
1052
|
constructor() {
|
|
1072
1053
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1073
1054
|
}
|
|
@@ -1096,26 +1077,26 @@ class zt {
|
|
|
1096
1077
|
return this._map.has(n);
|
|
1097
1078
|
}
|
|
1098
1079
|
}
|
|
1099
|
-
function
|
|
1100
|
-
return new
|
|
1080
|
+
function wt() {
|
|
1081
|
+
return new bt();
|
|
1101
1082
|
}
|
|
1102
|
-
(
|
|
1103
|
-
const
|
|
1083
|
+
(ye = globalThis).__zod_globalRegistry ?? (ye.__zod_globalRegistry = wt());
|
|
1084
|
+
const R = globalThis.__zod_globalRegistry;
|
|
1104
1085
|
// @__NO_SIDE_EFFECTS__
|
|
1105
|
-
function
|
|
1086
|
+
function $t(e, n) {
|
|
1106
1087
|
return new e({
|
|
1107
1088
|
type: "string",
|
|
1108
|
-
...
|
|
1089
|
+
...l(n)
|
|
1109
1090
|
});
|
|
1110
1091
|
}
|
|
1111
1092
|
// @__NO_SIDE_EFFECTS__
|
|
1112
|
-
function
|
|
1093
|
+
function kt(e, n) {
|
|
1113
1094
|
return new e({
|
|
1114
1095
|
type: "string",
|
|
1115
1096
|
format: "email",
|
|
1116
1097
|
check: "string_format",
|
|
1117
1098
|
abort: !1,
|
|
1118
|
-
...
|
|
1099
|
+
...l(n)
|
|
1119
1100
|
});
|
|
1120
1101
|
}
|
|
1121
1102
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1125,41 +1106,41 @@ function Zt(e, n) {
|
|
|
1125
1106
|
format: "uuid",
|
|
1126
1107
|
check: "string_format",
|
|
1127
1108
|
abort: !1,
|
|
1128
|
-
...
|
|
1109
|
+
...l(n)
|
|
1129
1110
|
});
|
|
1130
1111
|
}
|
|
1131
1112
|
// @__NO_SIDE_EFFECTS__
|
|
1132
|
-
function
|
|
1113
|
+
function St(e, n) {
|
|
1133
1114
|
return new e({
|
|
1134
1115
|
type: "string",
|
|
1135
1116
|
format: "url",
|
|
1136
1117
|
check: "string_format",
|
|
1137
1118
|
abort: !1,
|
|
1138
|
-
...
|
|
1119
|
+
...l(n)
|
|
1139
1120
|
});
|
|
1140
1121
|
}
|
|
1141
1122
|
// @__NO_SIDE_EFFECTS__
|
|
1142
|
-
function
|
|
1123
|
+
function Ot(e, n) {
|
|
1143
1124
|
return new e({
|
|
1144
1125
|
type: "string",
|
|
1145
1126
|
format: "ipv4",
|
|
1146
1127
|
check: "string_format",
|
|
1147
1128
|
abort: !1,
|
|
1148
|
-
...
|
|
1129
|
+
...l(n)
|
|
1149
1130
|
});
|
|
1150
1131
|
}
|
|
1151
1132
|
// @__NO_SIDE_EFFECTS__
|
|
1152
|
-
function
|
|
1133
|
+
function Tt(e, n) {
|
|
1153
1134
|
return new e({
|
|
1154
1135
|
type: "string",
|
|
1155
1136
|
format: "ipv6",
|
|
1156
1137
|
check: "string_format",
|
|
1157
1138
|
abort: !1,
|
|
1158
|
-
...
|
|
1139
|
+
...l(n)
|
|
1159
1140
|
});
|
|
1160
1141
|
}
|
|
1161
1142
|
// @__NO_SIDE_EFFECTS__
|
|
1162
|
-
function
|
|
1143
|
+
function Pt(e, n) {
|
|
1163
1144
|
return new e({
|
|
1164
1145
|
type: "string",
|
|
1165
1146
|
format: "datetime",
|
|
@@ -1167,35 +1148,35 @@ function Tt(e, n) {
|
|
|
1167
1148
|
offset: !1,
|
|
1168
1149
|
local: !1,
|
|
1169
1150
|
precision: null,
|
|
1170
|
-
...
|
|
1151
|
+
...l(n)
|
|
1171
1152
|
});
|
|
1172
1153
|
}
|
|
1173
1154
|
// @__NO_SIDE_EFFECTS__
|
|
1174
|
-
function
|
|
1155
|
+
function Et(e, n) {
|
|
1175
1156
|
return new e({
|
|
1176
1157
|
type: "string",
|
|
1177
1158
|
format: "date",
|
|
1178
1159
|
check: "string_format",
|
|
1179
|
-
...
|
|
1160
|
+
...l(n)
|
|
1180
1161
|
});
|
|
1181
1162
|
}
|
|
1182
1163
|
// @__NO_SIDE_EFFECTS__
|
|
1183
|
-
function
|
|
1164
|
+
function At(e, n) {
|
|
1184
1165
|
return new e({
|
|
1185
1166
|
type: "string",
|
|
1186
1167
|
format: "time",
|
|
1187
1168
|
check: "string_format",
|
|
1188
1169
|
precision: null,
|
|
1189
|
-
...
|
|
1170
|
+
...l(n)
|
|
1190
1171
|
});
|
|
1191
1172
|
}
|
|
1192
1173
|
// @__NO_SIDE_EFFECTS__
|
|
1193
|
-
function
|
|
1174
|
+
function It(e, n) {
|
|
1194
1175
|
return new e({
|
|
1195
1176
|
type: "string",
|
|
1196
1177
|
format: "duration",
|
|
1197
1178
|
check: "string_format",
|
|
1198
|
-
...
|
|
1179
|
+
...l(n)
|
|
1199
1180
|
});
|
|
1200
1181
|
}
|
|
1201
1182
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1203,24 +1184,24 @@ function Nt(e, n) {
|
|
|
1203
1184
|
return new e({
|
|
1204
1185
|
type: "number",
|
|
1205
1186
|
checks: [],
|
|
1206
|
-
...
|
|
1187
|
+
...l(n)
|
|
1207
1188
|
});
|
|
1208
1189
|
}
|
|
1209
1190
|
// @__NO_SIDE_EFFECTS__
|
|
1210
|
-
function
|
|
1191
|
+
function Mt(e, n) {
|
|
1211
1192
|
return new e({
|
|
1212
1193
|
type: "number",
|
|
1213
1194
|
check: "number_format",
|
|
1214
1195
|
abort: !1,
|
|
1215
1196
|
format: "safeint",
|
|
1216
|
-
...
|
|
1197
|
+
...l(n)
|
|
1217
1198
|
});
|
|
1218
1199
|
}
|
|
1219
1200
|
// @__NO_SIDE_EFFECTS__
|
|
1220
1201
|
function Ct(e, n) {
|
|
1221
1202
|
return new e({
|
|
1222
1203
|
type: "boolean",
|
|
1223
|
-
...
|
|
1204
|
+
...l(n)
|
|
1224
1205
|
});
|
|
1225
1206
|
}
|
|
1226
1207
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1231,169 +1212,169 @@ function Rt(e) {
|
|
|
1231
1212
|
}
|
|
1232
1213
|
// @__NO_SIDE_EFFECTS__
|
|
1233
1214
|
function jt(e, n) {
|
|
1234
|
-
return new
|
|
1215
|
+
return new jn({
|
|
1235
1216
|
check: "less_than",
|
|
1236
|
-
...
|
|
1217
|
+
...l(n),
|
|
1237
1218
|
value: e,
|
|
1238
1219
|
inclusive: !0
|
|
1239
1220
|
});
|
|
1240
1221
|
}
|
|
1241
1222
|
// @__NO_SIDE_EFFECTS__
|
|
1242
|
-
function
|
|
1243
|
-
return new
|
|
1223
|
+
function Ft(e, n) {
|
|
1224
|
+
return new Fn({
|
|
1244
1225
|
check: "greater_than",
|
|
1245
|
-
...
|
|
1226
|
+
...l(n),
|
|
1246
1227
|
value: e,
|
|
1247
1228
|
inclusive: !0
|
|
1248
1229
|
});
|
|
1249
1230
|
}
|
|
1250
1231
|
// @__NO_SIDE_EFFECTS__
|
|
1251
|
-
function
|
|
1252
|
-
return new
|
|
1232
|
+
function B(e, n) {
|
|
1233
|
+
return new Dn({
|
|
1253
1234
|
check: "max_length",
|
|
1254
|
-
...
|
|
1235
|
+
...l(n),
|
|
1255
1236
|
maximum: e
|
|
1256
1237
|
});
|
|
1257
1238
|
}
|
|
1258
1239
|
// @__NO_SIDE_EFFECTS__
|
|
1259
|
-
function
|
|
1260
|
-
return new
|
|
1240
|
+
function I(e, n) {
|
|
1241
|
+
return new Ln({
|
|
1261
1242
|
check: "min_length",
|
|
1262
|
-
...
|
|
1243
|
+
...l(n),
|
|
1263
1244
|
minimum: e
|
|
1264
1245
|
});
|
|
1265
1246
|
}
|
|
1266
1247
|
// @__NO_SIDE_EFFECTS__
|
|
1267
|
-
function
|
|
1268
|
-
return new
|
|
1248
|
+
function Je(e, n) {
|
|
1249
|
+
return new Jn({
|
|
1269
1250
|
check: "length_equals",
|
|
1270
|
-
...
|
|
1251
|
+
...l(n),
|
|
1271
1252
|
length: e
|
|
1272
1253
|
});
|
|
1273
1254
|
}
|
|
1274
1255
|
// @__NO_SIDE_EFFECTS__
|
|
1275
|
-
function
|
|
1276
|
-
return new
|
|
1256
|
+
function Ue(e, n) {
|
|
1257
|
+
return new Un({
|
|
1277
1258
|
check: "string_format",
|
|
1278
1259
|
format: "regex",
|
|
1279
|
-
...
|
|
1260
|
+
...l(n),
|
|
1280
1261
|
pattern: e
|
|
1281
1262
|
});
|
|
1282
1263
|
}
|
|
1283
1264
|
// @__NO_SIDE_EFFECTS__
|
|
1284
|
-
function
|
|
1285
|
-
return new
|
|
1265
|
+
function xt(e) {
|
|
1266
|
+
return new Vn({
|
|
1286
1267
|
check: "string_format",
|
|
1287
1268
|
format: "lowercase",
|
|
1288
|
-
...
|
|
1269
|
+
...l(e)
|
|
1289
1270
|
});
|
|
1290
1271
|
}
|
|
1291
1272
|
// @__NO_SIDE_EFFECTS__
|
|
1292
1273
|
function Dt(e) {
|
|
1293
|
-
return new
|
|
1274
|
+
return new Wn({
|
|
1294
1275
|
check: "string_format",
|
|
1295
1276
|
format: "uppercase",
|
|
1296
|
-
...
|
|
1277
|
+
...l(e)
|
|
1297
1278
|
});
|
|
1298
1279
|
}
|
|
1299
1280
|
// @__NO_SIDE_EFFECTS__
|
|
1300
1281
|
function Lt(e, n) {
|
|
1301
|
-
return new
|
|
1282
|
+
return new Gn({
|
|
1302
1283
|
check: "string_format",
|
|
1303
1284
|
format: "includes",
|
|
1304
|
-
...
|
|
1285
|
+
...l(n),
|
|
1305
1286
|
includes: e
|
|
1306
1287
|
});
|
|
1307
1288
|
}
|
|
1308
1289
|
// @__NO_SIDE_EFFECTS__
|
|
1309
|
-
function
|
|
1310
|
-
return new
|
|
1290
|
+
function Jt(e, n) {
|
|
1291
|
+
return new qn({
|
|
1311
1292
|
check: "string_format",
|
|
1312
1293
|
format: "starts_with",
|
|
1313
|
-
...
|
|
1294
|
+
...l(n),
|
|
1314
1295
|
prefix: e
|
|
1315
1296
|
});
|
|
1316
1297
|
}
|
|
1317
1298
|
// @__NO_SIDE_EFFECTS__
|
|
1318
|
-
function
|
|
1319
|
-
return new
|
|
1299
|
+
function Ut(e, n) {
|
|
1300
|
+
return new Bn({
|
|
1320
1301
|
check: "string_format",
|
|
1321
1302
|
format: "ends_with",
|
|
1322
|
-
...
|
|
1303
|
+
...l(n),
|
|
1323
1304
|
suffix: e
|
|
1324
1305
|
});
|
|
1325
1306
|
}
|
|
1326
1307
|
// @__NO_SIDE_EFFECTS__
|
|
1327
|
-
function
|
|
1328
|
-
return new
|
|
1308
|
+
function N(e) {
|
|
1309
|
+
return new Kn({
|
|
1329
1310
|
check: "overwrite",
|
|
1330
1311
|
tx: e
|
|
1331
1312
|
});
|
|
1332
1313
|
}
|
|
1333
1314
|
// @__NO_SIDE_EFFECTS__
|
|
1334
|
-
function
|
|
1335
|
-
return /* @__PURE__ */
|
|
1315
|
+
function Vt(e) {
|
|
1316
|
+
return /* @__PURE__ */ N((n) => n.normalize(e));
|
|
1336
1317
|
}
|
|
1337
1318
|
// @__NO_SIDE_EFFECTS__
|
|
1338
|
-
function
|
|
1339
|
-
return /* @__PURE__ */
|
|
1319
|
+
function Wt() {
|
|
1320
|
+
return /* @__PURE__ */ N((e) => e.trim());
|
|
1340
1321
|
}
|
|
1341
1322
|
// @__NO_SIDE_EFFECTS__
|
|
1342
|
-
function
|
|
1343
|
-
return /* @__PURE__ */
|
|
1323
|
+
function Gt() {
|
|
1324
|
+
return /* @__PURE__ */ N((e) => e.toLowerCase());
|
|
1344
1325
|
}
|
|
1345
1326
|
// @__NO_SIDE_EFFECTS__
|
|
1346
|
-
function
|
|
1347
|
-
return /* @__PURE__ */
|
|
1327
|
+
function qt() {
|
|
1328
|
+
return /* @__PURE__ */ N((e) => e.toUpperCase());
|
|
1348
1329
|
}
|
|
1349
1330
|
// @__NO_SIDE_EFFECTS__
|
|
1350
|
-
function
|
|
1351
|
-
return /* @__PURE__ */
|
|
1331
|
+
function Bt() {
|
|
1332
|
+
return /* @__PURE__ */ N((e) => an(e));
|
|
1352
1333
|
}
|
|
1353
1334
|
// @__NO_SIDE_EFFECTS__
|
|
1354
|
-
function
|
|
1335
|
+
function Kt(e, n, t) {
|
|
1355
1336
|
return new e({
|
|
1356
1337
|
type: "array",
|
|
1357
1338
|
element: n,
|
|
1358
1339
|
// get element() {
|
|
1359
1340
|
// return element;
|
|
1360
1341
|
// },
|
|
1361
|
-
...
|
|
1342
|
+
...l(t)
|
|
1362
1343
|
});
|
|
1363
1344
|
}
|
|
1364
1345
|
// @__NO_SIDE_EFFECTS__
|
|
1365
|
-
function
|
|
1346
|
+
function Ve(e, n, t) {
|
|
1366
1347
|
return new e({
|
|
1367
1348
|
type: "custom",
|
|
1368
1349
|
check: "custom",
|
|
1369
1350
|
fn: n,
|
|
1370
|
-
...
|
|
1351
|
+
...l(t)
|
|
1371
1352
|
});
|
|
1372
1353
|
}
|
|
1373
1354
|
// @__NO_SIDE_EFFECTS__
|
|
1374
|
-
function
|
|
1375
|
-
const n = /* @__PURE__ */
|
|
1355
|
+
function We(e) {
|
|
1356
|
+
const n = /* @__PURE__ */ Yt((t) => (t.addIssue = (r) => {
|
|
1376
1357
|
if (typeof r == "string")
|
|
1377
|
-
t.issues.push(
|
|
1358
|
+
t.issues.push(j(r, t.value, n._zod.def));
|
|
1378
1359
|
else {
|
|
1379
1360
|
const o = r;
|
|
1380
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(
|
|
1361
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(j(o));
|
|
1381
1362
|
}
|
|
1382
1363
|
}, e(t.value, t)));
|
|
1383
1364
|
return n;
|
|
1384
1365
|
}
|
|
1385
1366
|
// @__NO_SIDE_EFFECTS__
|
|
1386
|
-
function
|
|
1387
|
-
const t = new
|
|
1367
|
+
function Yt(e, n) {
|
|
1368
|
+
const t = new $({
|
|
1388
1369
|
check: "custom",
|
|
1389
|
-
...
|
|
1370
|
+
...l(n)
|
|
1390
1371
|
});
|
|
1391
1372
|
return t._zod.check = e, t;
|
|
1392
1373
|
}
|
|
1393
1374
|
// @__NO_SIDE_EFFECTS__
|
|
1394
|
-
function
|
|
1395
|
-
const o =
|
|
1396
|
-
...
|
|
1375
|
+
function Xt(e, n, t, r = {}) {
|
|
1376
|
+
const o = l(r), s = {
|
|
1377
|
+
...l(r),
|
|
1397
1378
|
check: "string_format",
|
|
1398
1379
|
type: "string",
|
|
1399
1380
|
format: n,
|
|
@@ -1402,11 +1383,11 @@ function Yt(e, n, t, r = {}) {
|
|
|
1402
1383
|
};
|
|
1403
1384
|
return t instanceof RegExp && (s.pattern = t), new e(s);
|
|
1404
1385
|
}
|
|
1405
|
-
function
|
|
1386
|
+
function Ge(e) {
|
|
1406
1387
|
let n = e?.target ?? "draft-2020-12";
|
|
1407
1388
|
return n === "draft-4" && (n = "draft-04"), n === "draft-7" && (n = "draft-07"), {
|
|
1408
1389
|
processors: e.processors ?? {},
|
|
1409
|
-
metadataRegistry: e?.metadata ??
|
|
1390
|
+
metadataRegistry: e?.metadata ?? R,
|
|
1410
1391
|
target: n,
|
|
1411
1392
|
unrepresentable: e?.unrepresentable ?? "throw",
|
|
1412
1393
|
override: e?.override ?? (() => {
|
|
@@ -1419,7 +1400,7 @@ function je(e) {
|
|
|
1419
1400
|
external: e?.external ?? void 0
|
|
1420
1401
|
};
|
|
1421
1402
|
}
|
|
1422
|
-
function
|
|
1403
|
+
function b(e, n, t = { path: [], schemaPath: [] }) {
|
|
1423
1404
|
var r;
|
|
1424
1405
|
const o = e._zod.def, s = n.seen.get(e);
|
|
1425
1406
|
if (s)
|
|
@@ -1430,26 +1411,26 @@ function y(e, n, t = { path: [], schemaPath: [] }) {
|
|
|
1430
1411
|
if (c)
|
|
1431
1412
|
i.schema = c;
|
|
1432
1413
|
else {
|
|
1433
|
-
const
|
|
1414
|
+
const d = {
|
|
1434
1415
|
...t,
|
|
1435
1416
|
schemaPath: [...t.schemaPath, e],
|
|
1436
1417
|
path: t.path
|
|
1437
1418
|
};
|
|
1438
1419
|
if (e._zod.processJSONSchema)
|
|
1439
|
-
e._zod.processJSONSchema(n, i.schema,
|
|
1420
|
+
e._zod.processJSONSchema(n, i.schema, d);
|
|
1440
1421
|
else {
|
|
1441
|
-
const h = i.schema,
|
|
1442
|
-
if (!
|
|
1422
|
+
const h = i.schema, g = n.processors[o.type];
|
|
1423
|
+
if (!g)
|
|
1443
1424
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
1444
|
-
|
|
1425
|
+
g(e, n, h, d);
|
|
1445
1426
|
}
|
|
1446
1427
|
const p = e._zod.parent;
|
|
1447
|
-
p && (i.ref || (i.ref = p),
|
|
1428
|
+
p && (i.ref || (i.ref = p), b(p, n, d), n.seen.get(p).isParent = !0);
|
|
1448
1429
|
}
|
|
1449
1430
|
const a = n.metadataRegistry.get(e);
|
|
1450
|
-
return a && Object.assign(i.schema, a), n.io === "input" &&
|
|
1431
|
+
return a && Object.assign(i.schema, a), n.io === "input" && z(e) && (delete i.schema.examples, delete i.schema.default), n.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, n.seen.get(e).schema;
|
|
1451
1432
|
}
|
|
1452
|
-
function
|
|
1433
|
+
function qe(e, n) {
|
|
1453
1434
|
const t = e.seen.get(n);
|
|
1454
1435
|
if (!t)
|
|
1455
1436
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -1466,25 +1447,25 @@ function Me(e, n) {
|
|
|
1466
1447
|
const o = (i) => {
|
|
1467
1448
|
const c = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
1468
1449
|
if (e.external) {
|
|
1469
|
-
const p = e.external.registry.get(i[0])?.id, h = e.external.uri ?? ((
|
|
1450
|
+
const p = e.external.registry.get(i[0])?.id, h = e.external.uri ?? ((C) => C);
|
|
1470
1451
|
if (p)
|
|
1471
1452
|
return { ref: h(p) };
|
|
1472
|
-
const
|
|
1473
|
-
return i[1].defId =
|
|
1453
|
+
const g = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
1454
|
+
return i[1].defId = g, { defId: g, ref: `${h("__shared")}#/${c}/${g}` };
|
|
1474
1455
|
}
|
|
1475
1456
|
if (i[1] === t)
|
|
1476
1457
|
return { ref: "#" };
|
|
1477
|
-
const f = `#/${c}/`,
|
|
1478
|
-
return { defId:
|
|
1458
|
+
const f = `#/${c}/`, d = i[1].schema.id ?? `__schema${e.counter++}`;
|
|
1459
|
+
return { defId: d, ref: f + d };
|
|
1479
1460
|
}, s = (i) => {
|
|
1480
1461
|
if (i[1].schema.$ref)
|
|
1481
1462
|
return;
|
|
1482
1463
|
const c = i[1], { ref: a, defId: f } = o(i);
|
|
1483
1464
|
c.def = { ...c.schema }, f && (c.defId = f);
|
|
1484
|
-
const
|
|
1485
|
-
for (const p in
|
|
1486
|
-
delete
|
|
1487
|
-
|
|
1465
|
+
const d = c.schema;
|
|
1466
|
+
for (const p in d)
|
|
1467
|
+
delete d[p];
|
|
1468
|
+
d.$ref = a;
|
|
1488
1469
|
};
|
|
1489
1470
|
if (e.cycles === "throw")
|
|
1490
1471
|
for (const i of e.seen.entries()) {
|
|
@@ -1521,7 +1502,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1521
1502
|
}
|
|
1522
1503
|
}
|
|
1523
1504
|
}
|
|
1524
|
-
function
|
|
1505
|
+
function Be(e, n) {
|
|
1525
1506
|
const t = e.seen.get(n);
|
|
1526
1507
|
if (!t)
|
|
1527
1508
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
@@ -1529,24 +1510,24 @@ function Fe(e, n) {
|
|
|
1529
1510
|
const c = e.seen.get(i);
|
|
1530
1511
|
if (c.ref === null)
|
|
1531
1512
|
return;
|
|
1532
|
-
const a = c.def ?? c.schema, f = { ...a },
|
|
1533
|
-
if (c.ref = null,
|
|
1534
|
-
r(
|
|
1535
|
-
const h = e.seen.get(
|
|
1536
|
-
if (
|
|
1537
|
-
for (const
|
|
1538
|
-
|
|
1539
|
-
if (
|
|
1540
|
-
for (const
|
|
1541
|
-
|
|
1513
|
+
const a = c.def ?? c.schema, f = { ...a }, d = c.ref;
|
|
1514
|
+
if (c.ref = null, d) {
|
|
1515
|
+
r(d);
|
|
1516
|
+
const h = e.seen.get(d), g = h.schema;
|
|
1517
|
+
if (g.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (a.allOf = a.allOf ?? [], a.allOf.push(g)) : Object.assign(a, g), Object.assign(a, f), i._zod.parent === d)
|
|
1518
|
+
for (const S in a)
|
|
1519
|
+
S === "$ref" || S === "allOf" || S in f || delete a[S];
|
|
1520
|
+
if (g.$ref && h.def)
|
|
1521
|
+
for (const S in a)
|
|
1522
|
+
S === "$ref" || S === "allOf" || S in h.def && JSON.stringify(a[S]) === JSON.stringify(h.def[S]) && delete a[S];
|
|
1542
1523
|
}
|
|
1543
1524
|
const p = i._zod.parent;
|
|
1544
|
-
if (p && p !==
|
|
1525
|
+
if (p && p !== d) {
|
|
1545
1526
|
r(p);
|
|
1546
1527
|
const h = e.seen.get(p);
|
|
1547
1528
|
if (h?.schema.$ref && (a.$ref = h.schema.$ref, h.def))
|
|
1548
|
-
for (const
|
|
1549
|
-
|
|
1529
|
+
for (const g in a)
|
|
1530
|
+
g === "$ref" || g === "allOf" || g in h.def && JSON.stringify(a[g]) === JSON.stringify(h.def[g]) && delete a[g];
|
|
1550
1531
|
}
|
|
1551
1532
|
e.override({
|
|
1552
1533
|
zodSchema: i,
|
|
@@ -1576,8 +1557,8 @@ function Fe(e, n) {
|
|
|
1576
1557
|
value: {
|
|
1577
1558
|
...n["~standard"],
|
|
1578
1559
|
jsonSchema: {
|
|
1579
|
-
input:
|
|
1580
|
-
output:
|
|
1560
|
+
input: L(n, "input", e.processors),
|
|
1561
|
+
output: L(n, "output", e.processors)
|
|
1581
1562
|
}
|
|
1582
1563
|
},
|
|
1583
1564
|
enumerable: !1,
|
|
@@ -1587,7 +1568,7 @@ function Fe(e, n) {
|
|
|
1587
1568
|
throw new Error("Error converting schema to JSON.");
|
|
1588
1569
|
}
|
|
1589
1570
|
}
|
|
1590
|
-
function
|
|
1571
|
+
function z(e, n) {
|
|
1591
1572
|
const t = n ?? { seen: /* @__PURE__ */ new Set() };
|
|
1592
1573
|
if (t.seen.has(e))
|
|
1593
1574
|
return !1;
|
|
@@ -1596,85 +1577,85 @@ function v(e, n) {
|
|
|
1596
1577
|
if (r.type === "transform")
|
|
1597
1578
|
return !0;
|
|
1598
1579
|
if (r.type === "array")
|
|
1599
|
-
return
|
|
1580
|
+
return z(r.element, t);
|
|
1600
1581
|
if (r.type === "set")
|
|
1601
|
-
return
|
|
1582
|
+
return z(r.valueType, t);
|
|
1602
1583
|
if (r.type === "lazy")
|
|
1603
|
-
return
|
|
1584
|
+
return z(r.getter(), t);
|
|
1604
1585
|
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
1605
|
-
return
|
|
1586
|
+
return z(r.innerType, t);
|
|
1606
1587
|
if (r.type === "intersection")
|
|
1607
|
-
return
|
|
1588
|
+
return z(r.left, t) || z(r.right, t);
|
|
1608
1589
|
if (r.type === "record" || r.type === "map")
|
|
1609
|
-
return
|
|
1590
|
+
return z(r.keyType, t) || z(r.valueType, t);
|
|
1610
1591
|
if (r.type === "pipe")
|
|
1611
|
-
return
|
|
1592
|
+
return z(r.in, t) || z(r.out, t);
|
|
1612
1593
|
if (r.type === "object") {
|
|
1613
1594
|
for (const o in r.shape)
|
|
1614
|
-
if (
|
|
1595
|
+
if (z(r.shape[o], t))
|
|
1615
1596
|
return !0;
|
|
1616
1597
|
return !1;
|
|
1617
1598
|
}
|
|
1618
1599
|
if (r.type === "union") {
|
|
1619
1600
|
for (const o of r.options)
|
|
1620
|
-
if (
|
|
1601
|
+
if (z(o, t))
|
|
1621
1602
|
return !0;
|
|
1622
1603
|
return !1;
|
|
1623
1604
|
}
|
|
1624
1605
|
if (r.type === "tuple") {
|
|
1625
1606
|
for (const o of r.items)
|
|
1626
|
-
if (
|
|
1607
|
+
if (z(o, t))
|
|
1627
1608
|
return !0;
|
|
1628
|
-
return !!(r.rest &&
|
|
1609
|
+
return !!(r.rest && z(r.rest, t));
|
|
1629
1610
|
}
|
|
1630
1611
|
return !1;
|
|
1631
1612
|
}
|
|
1632
|
-
const
|
|
1633
|
-
const r =
|
|
1634
|
-
return
|
|
1635
|
-
},
|
|
1636
|
-
const { libraryOptions: o, target: s } = r ?? {}, i =
|
|
1637
|
-
return
|
|
1638
|
-
},
|
|
1613
|
+
const Ht = (e, n = {}) => (t) => {
|
|
1614
|
+
const r = Ge({ ...t, processors: n });
|
|
1615
|
+
return b(e, r), qe(r, e), Be(r, e);
|
|
1616
|
+
}, L = (e, n, t = {}) => (r) => {
|
|
1617
|
+
const { libraryOptions: o, target: s } = r ?? {}, i = Ge({ ...o ?? {}, target: s, io: n, processors: t });
|
|
1618
|
+
return b(e, i), qe(i, e), Be(i, e);
|
|
1619
|
+
}, Qt = {
|
|
1639
1620
|
guid: "uuid",
|
|
1640
1621
|
url: "uri",
|
|
1641
1622
|
datetime: "date-time",
|
|
1642
1623
|
json_string: "json-string",
|
|
1643
1624
|
regex: ""
|
|
1644
1625
|
// do not set
|
|
1645
|
-
},
|
|
1626
|
+
}, er = (e, n, t, r) => {
|
|
1646
1627
|
const o = t;
|
|
1647
1628
|
o.type = "string";
|
|
1648
1629
|
const { minimum: s, maximum: i, format: c, patterns: a, contentEncoding: f } = e._zod.bag;
|
|
1649
|
-
if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), c && (o.format =
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1652
|
-
...
|
|
1630
|
+
if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), c && (o.format = Qt[c] ?? c, o.format === "" && delete o.format, c === "time" && delete o.format), f && (o.contentEncoding = f), a && a.size > 0) {
|
|
1631
|
+
const d = [...a];
|
|
1632
|
+
d.length === 1 ? o.pattern = d[0].source : d.length > 1 && (o.allOf = [
|
|
1633
|
+
...d.map((p) => ({
|
|
1653
1634
|
...n.target === "draft-07" || n.target === "draft-04" || n.target === "openapi-3.0" ? { type: "string" } : {},
|
|
1654
1635
|
pattern: p.source
|
|
1655
1636
|
}))
|
|
1656
1637
|
]);
|
|
1657
1638
|
}
|
|
1658
|
-
},
|
|
1639
|
+
}, nr = (e, n, t, r) => {
|
|
1659
1640
|
if (n.unrepresentable === "throw")
|
|
1660
1641
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
1661
|
-
},
|
|
1642
|
+
}, tr = (e, n, t, r) => {
|
|
1662
1643
|
if (n.unrepresentable === "throw")
|
|
1663
1644
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
1664
|
-
}, tr = (e, n, t, r) => {
|
|
1665
|
-
const o = t, s = e._zod.def, { minimum: i, maximum: c } = e._zod.bag;
|
|
1666
|
-
typeof i == "number" && (o.minItems = i), typeof c == "number" && (o.maxItems = c), o.type = "array", o.items = y(s.element, n, { ...r, path: [...r.path, "items"] });
|
|
1667
1645
|
}, rr = (e, n, t, r) => {
|
|
1668
|
-
const o = e._zod.def,
|
|
1646
|
+
const o = t, s = e._zod.def, { minimum: i, maximum: c } = e._zod.bag;
|
|
1647
|
+
typeof i == "number" && (o.minItems = i), typeof c == "number" && (o.maxItems = c), o.type = "array", o.items = b(s.element, n, { ...r, path: [...r.path, "items"] });
|
|
1648
|
+
}, or = (e, n, t, r) => {
|
|
1649
|
+
const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((c, a) => b(c, n, {
|
|
1669
1650
|
...r,
|
|
1670
1651
|
path: [...r.path, s ? "oneOf" : "anyOf", a]
|
|
1671
1652
|
}));
|
|
1672
1653
|
s ? t.oneOf = i : t.anyOf = i;
|
|
1673
|
-
},
|
|
1674
|
-
const o = e._zod.def, s =
|
|
1654
|
+
}, ir = (e, n, t, r) => {
|
|
1655
|
+
const o = e._zod.def, s = b(o.left, n, {
|
|
1675
1656
|
...r,
|
|
1676
1657
|
path: [...r.path, "allOf", 0]
|
|
1677
|
-
}), i =
|
|
1658
|
+
}), i = b(o.right, n, {
|
|
1678
1659
|
...r,
|
|
1679
1660
|
path: [...r.path, "allOf", 1]
|
|
1680
1661
|
}), c = (f) => "allOf" in f && Object.keys(f).length === 1, a = [
|
|
@@ -1682,27 +1663,27 @@ const Xt = (e, n = {}) => (t) => {
|
|
|
1682
1663
|
...c(i) ? i.allOf : [i]
|
|
1683
1664
|
];
|
|
1684
1665
|
t.allOf = a;
|
|
1685
|
-
}, ir = (e, n, t, r) => {
|
|
1686
|
-
const o = e._zod.def, s = y(o.innerType, n, r), i = n.seen.get(e);
|
|
1687
|
-
n.target === "openapi-3.0" ? (i.ref = o.innerType, t.nullable = !0) : t.anyOf = [s, { type: "null" }];
|
|
1688
1666
|
}, sr = (e, n, t, r) => {
|
|
1667
|
+
const o = e._zod.def, s = b(o.innerType, n, r), i = n.seen.get(e);
|
|
1668
|
+
n.target === "openapi-3.0" ? (i.ref = o.innerType, t.nullable = !0) : t.anyOf = [s, { type: "null" }];
|
|
1669
|
+
}, cr = (e, n, t, r) => {
|
|
1689
1670
|
const o = e._zod.def;
|
|
1690
|
-
|
|
1671
|
+
b(o.innerType, n, r);
|
|
1691
1672
|
const s = n.seen.get(e);
|
|
1692
1673
|
s.ref = o.innerType;
|
|
1693
|
-
},
|
|
1674
|
+
}, ar = (e, n, t, r) => {
|
|
1694
1675
|
const o = e._zod.def;
|
|
1695
|
-
|
|
1676
|
+
b(o.innerType, n, r);
|
|
1696
1677
|
const s = n.seen.get(e);
|
|
1697
1678
|
s.ref = o.innerType, t.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
1698
1679
|
}, ur = (e, n, t, r) => {
|
|
1699
1680
|
const o = e._zod.def;
|
|
1700
|
-
|
|
1681
|
+
b(o.innerType, n, r);
|
|
1701
1682
|
const s = n.seen.get(e);
|
|
1702
1683
|
s.ref = o.innerType, n.io === "input" && (t._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
1703
|
-
},
|
|
1684
|
+
}, fr = (e, n, t, r) => {
|
|
1704
1685
|
const o = e._zod.def;
|
|
1705
|
-
|
|
1686
|
+
b(o.innerType, n, r);
|
|
1706
1687
|
const s = n.seen.get(e);
|
|
1707
1688
|
s.ref = o.innerType;
|
|
1708
1689
|
let i;
|
|
@@ -1712,64 +1693,64 @@ const Xt = (e, n = {}) => (t) => {
|
|
|
1712
1693
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
1713
1694
|
}
|
|
1714
1695
|
t.default = i;
|
|
1715
|
-
},
|
|
1696
|
+
}, dr = (e, n, t, r) => {
|
|
1716
1697
|
const o = e._zod.def, s = n.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
1717
|
-
|
|
1698
|
+
b(s, n, r);
|
|
1718
1699
|
const i = n.seen.get(e);
|
|
1719
1700
|
i.ref = s;
|
|
1720
1701
|
}, lr = (e, n, t, r) => {
|
|
1721
1702
|
const o = e._zod.def;
|
|
1722
|
-
|
|
1703
|
+
b(o.innerType, n, r);
|
|
1723
1704
|
const s = n.seen.get(e);
|
|
1724
1705
|
s.ref = o.innerType, t.readOnly = !0;
|
|
1725
|
-
},
|
|
1706
|
+
}, Ke = (e, n, t, r) => {
|
|
1726
1707
|
const o = e._zod.def;
|
|
1727
|
-
|
|
1708
|
+
b(o.innerType, n, r);
|
|
1728
1709
|
const s = n.seen.get(e);
|
|
1729
1710
|
s.ref = o.innerType;
|
|
1730
|
-
},
|
|
1731
|
-
|
|
1711
|
+
}, mr = /* @__PURE__ */ u("ZodISODateTime", (e, n) => {
|
|
1712
|
+
et.init(e, n), K.init(e, n);
|
|
1732
1713
|
});
|
|
1733
1714
|
function pr(e) {
|
|
1734
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ Pt(mr, e);
|
|
1735
1716
|
}
|
|
1736
|
-
const
|
|
1737
|
-
|
|
1717
|
+
const hr = /* @__PURE__ */ u("ZodISODate", (e, n) => {
|
|
1718
|
+
nt.init(e, n), K.init(e, n);
|
|
1738
1719
|
});
|
|
1739
|
-
function
|
|
1740
|
-
return /* @__PURE__ */
|
|
1720
|
+
function gr(e) {
|
|
1721
|
+
return /* @__PURE__ */ Et(hr, e);
|
|
1741
1722
|
}
|
|
1742
1723
|
const _r = /* @__PURE__ */ u("ZodISOTime", (e, n) => {
|
|
1743
|
-
|
|
1724
|
+
tt.init(e, n), K.init(e, n);
|
|
1744
1725
|
});
|
|
1745
|
-
function
|
|
1746
|
-
return /* @__PURE__ */
|
|
1726
|
+
function yr(e) {
|
|
1727
|
+
return /* @__PURE__ */ At(_r, e);
|
|
1747
1728
|
}
|
|
1748
1729
|
const vr = /* @__PURE__ */ u("ZodISODuration", (e, n) => {
|
|
1749
|
-
|
|
1730
|
+
rt.init(e, n), K.init(e, n);
|
|
1750
1731
|
});
|
|
1751
|
-
function
|
|
1752
|
-
return /* @__PURE__ */
|
|
1732
|
+
function zr(e) {
|
|
1733
|
+
return /* @__PURE__ */ It(vr, e);
|
|
1753
1734
|
}
|
|
1754
|
-
const
|
|
1755
|
-
|
|
1735
|
+
const br = (e, n) => {
|
|
1736
|
+
Ne.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
|
|
1756
1737
|
format: {
|
|
1757
|
-
value: (t) =>
|
|
1738
|
+
value: (t) => ln(e, t)
|
|
1758
1739
|
// enumerable: false,
|
|
1759
1740
|
},
|
|
1760
1741
|
flatten: {
|
|
1761
|
-
value: (t) =>
|
|
1742
|
+
value: (t) => dn(e, t)
|
|
1762
1743
|
// enumerable: false,
|
|
1763
1744
|
},
|
|
1764
1745
|
addIssue: {
|
|
1765
1746
|
value: (t) => {
|
|
1766
|
-
e.issues.push(t), e.message = JSON.stringify(e.issues,
|
|
1747
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, Y, 2);
|
|
1767
1748
|
}
|
|
1768
1749
|
// enumerable: false,
|
|
1769
1750
|
},
|
|
1770
1751
|
addIssues: {
|
|
1771
1752
|
value: (t) => {
|
|
1772
|
-
e.issues.push(...t), e.message = JSON.stringify(e.issues,
|
|
1753
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, Y, 2);
|
|
1773
1754
|
}
|
|
1774
1755
|
// enumerable: false,
|
|
1775
1756
|
},
|
|
@@ -1780,437 +1761,548 @@ const zr = (e, n) => {
|
|
|
1780
1761
|
// enumerable: false,
|
|
1781
1762
|
}
|
|
1782
1763
|
});
|
|
1783
|
-
},
|
|
1764
|
+
}, Z = u("ZodError", br, {
|
|
1784
1765
|
Parent: Error
|
|
1785
|
-
}),
|
|
1766
|
+
}), wr = /* @__PURE__ */ U(Z), $r = /* @__PURE__ */ V(Z), kr = /* @__PURE__ */ W(Z), Zr = /* @__PURE__ */ G(Z), Sr = /* @__PURE__ */ hn(Z), Or = /* @__PURE__ */ gn(Z), Tr = /* @__PURE__ */ _n(Z), Pr = /* @__PURE__ */ yn(Z), Er = /* @__PURE__ */ vn(Z), Ar = /* @__PURE__ */ zn(Z), Ir = /* @__PURE__ */ bn(Z), Nr = /* @__PURE__ */ wn(Z), w = /* @__PURE__ */ u("ZodType", (e, n) => (y.init(e, n), Object.assign(e["~standard"], {
|
|
1786
1767
|
jsonSchema: {
|
|
1787
|
-
input:
|
|
1788
|
-
output:
|
|
1768
|
+
input: L(e, "input"),
|
|
1769
|
+
output: L(e, "output")
|
|
1789
1770
|
}
|
|
1790
|
-
}), e.toJSONSchema =
|
|
1771
|
+
}), e.toJSONSchema = Ht(e, {}), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(cn(n, {
|
|
1791
1772
|
checks: [
|
|
1792
1773
|
...n.checks ?? [],
|
|
1793
1774
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1794
1775
|
]
|
|
1795
1776
|
}), {
|
|
1796
1777
|
parent: !0
|
|
1797
|
-
}), e.with = e.check, e.clone = (t, r) =>
|
|
1778
|
+
}), e.with = e.check, e.clone = (t, r) => Ae(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => wr(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => kr(e, t, r), e.parseAsync = async (t, r) => $r(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Zr(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Sr(e, t, r), e.decode = (t, r) => Or(e, t, r), e.encodeAsync = async (t, r) => Tr(e, t, r), e.decodeAsync = async (t, r) => Pr(e, t, r), e.safeEncode = (t, r) => Er(e, t, r), e.safeDecode = (t, r) => Ar(e, t, r), e.safeEncodeAsync = async (t, r) => Ir(e, t, r), e.safeDecodeAsync = async (t, r) => Nr(e, t, r), e.refine = (t, r) => e.check(io(t, r)), e.superRefine = (t) => e.check(so(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ N(t)), e.optional = () => ve(e), e.exactOptional = () => Wr(e), e.nullable = () => ze(e), e.nullish = () => ve(ze(e)), e.nonoptional = (t) => Hr(e, t), e.array = () => Rr(e), e.or = (t) => Fr([e, t]), e.and = (t) => Dr(e, t), e.transform = (t) => be(e, Jr(t)), e.default = (t) => Br(e, t), e.prefault = (t) => Yr(e, t), e.catch = (t) => eo(e, t), e.pipe = (t) => be(e, t), e.readonly = () => ro(e), e.describe = (t) => {
|
|
1798
1779
|
const r = e.clone();
|
|
1799
|
-
return
|
|
1780
|
+
return R.add(r, { description: t }), r;
|
|
1800
1781
|
}, Object.defineProperty(e, "description", {
|
|
1801
1782
|
get() {
|
|
1802
|
-
return
|
|
1783
|
+
return R.get(e)?.description;
|
|
1803
1784
|
},
|
|
1804
1785
|
configurable: !0
|
|
1805
1786
|
}), e.meta = (...t) => {
|
|
1806
1787
|
if (t.length === 0)
|
|
1807
|
-
return
|
|
1788
|
+
return R.get(e);
|
|
1808
1789
|
const r = e.clone();
|
|
1809
|
-
return
|
|
1810
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)),
|
|
1811
|
-
|
|
1790
|
+
return R.add(r, t[0]), r;
|
|
1791
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)), Mr = /* @__PURE__ */ u("_ZodString", (e, n) => {
|
|
1792
|
+
ie.init(e, n), w.init(e, n), e._zod.processJSONSchema = (r, o, s) => er(e, r, o);
|
|
1812
1793
|
const t = e._zod.bag;
|
|
1813
|
-
e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */
|
|
1814
|
-
}),
|
|
1815
|
-
|
|
1794
|
+
e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ Ue(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Lt(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ Jt(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Ut(...r)), e.min = (...r) => e.check(/* @__PURE__ */ I(...r)), e.max = (...r) => e.check(/* @__PURE__ */ B(...r)), e.length = (...r) => e.check(/* @__PURE__ */ Je(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ I(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ xt(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Dt(r)), e.trim = () => e.check(/* @__PURE__ */ Wt()), e.normalize = (...r) => e.check(/* @__PURE__ */ Vt(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Gt()), e.toUpperCase = () => e.check(/* @__PURE__ */ qt()), e.slugify = () => e.check(/* @__PURE__ */ Bt());
|
|
1795
|
+
}), K = /* @__PURE__ */ u("ZodStringFormat", (e, n) => {
|
|
1796
|
+
k.init(e, n), Mr.init(e, n);
|
|
1816
1797
|
}), Cr = /* @__PURE__ */ u("ZodArray", (e, n) => {
|
|
1817
|
-
|
|
1798
|
+
De.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => rr(e, t, r, o), e.element = n.element, e.min = (t, r) => e.check(/* @__PURE__ */ I(t, r)), e.nonempty = (t) => e.check(/* @__PURE__ */ I(1, t)), e.max = (t, r) => e.check(/* @__PURE__ */ B(t, r)), e.length = (t, r) => e.check(/* @__PURE__ */ Je(t, r)), e.unwrap = () => e.element;
|
|
1818
1799
|
});
|
|
1819
1800
|
function Rr(e, n) {
|
|
1820
|
-
return /* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ Kt(Cr, e, n);
|
|
1821
1802
|
}
|
|
1822
1803
|
const jr = /* @__PURE__ */ u("ZodUnion", (e, n) => {
|
|
1823
|
-
|
|
1804
|
+
ft.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => or(e, t, r, o), e.options = n.options;
|
|
1824
1805
|
});
|
|
1825
|
-
function
|
|
1806
|
+
function Fr(e, n) {
|
|
1826
1807
|
return new jr({
|
|
1827
1808
|
type: "union",
|
|
1828
1809
|
options: e,
|
|
1829
|
-
...
|
|
1810
|
+
...l(n)
|
|
1830
1811
|
});
|
|
1831
1812
|
}
|
|
1832
|
-
const
|
|
1833
|
-
|
|
1813
|
+
const xr = /* @__PURE__ */ u("ZodIntersection", (e, n) => {
|
|
1814
|
+
dt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => ir(e, t, r, o);
|
|
1834
1815
|
});
|
|
1835
1816
|
function Dr(e, n) {
|
|
1836
|
-
return new
|
|
1817
|
+
return new xr({
|
|
1837
1818
|
type: "intersection",
|
|
1838
1819
|
left: e,
|
|
1839
1820
|
right: n
|
|
1840
1821
|
});
|
|
1841
1822
|
}
|
|
1842
1823
|
const Lr = /* @__PURE__ */ u("ZodTransform", (e, n) => {
|
|
1843
|
-
|
|
1824
|
+
lt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => tr(e, t), e._zod.parse = (t, r) => {
|
|
1844
1825
|
if (r.direction === "backward")
|
|
1845
|
-
throw new
|
|
1826
|
+
throw new Te(e.constructor.name);
|
|
1846
1827
|
t.addIssue = (s) => {
|
|
1847
1828
|
if (typeof s == "string")
|
|
1848
|
-
t.issues.push(
|
|
1829
|
+
t.issues.push(j(s, t.value, n));
|
|
1849
1830
|
else {
|
|
1850
1831
|
const i = s;
|
|
1851
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = t.value), i.inst ?? (i.inst = e), t.issues.push(
|
|
1832
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = t.value), i.inst ?? (i.inst = e), t.issues.push(j(i));
|
|
1852
1833
|
}
|
|
1853
1834
|
};
|
|
1854
1835
|
const o = n.transform(t.value, t);
|
|
1855
1836
|
return o instanceof Promise ? o.then((s) => (t.value = s, t)) : (t.value = o, t);
|
|
1856
1837
|
};
|
|
1857
1838
|
});
|
|
1858
|
-
function
|
|
1839
|
+
function Jr(e) {
|
|
1859
1840
|
return new Lr({
|
|
1860
1841
|
type: "transform",
|
|
1861
1842
|
transform: e
|
|
1862
1843
|
});
|
|
1863
1844
|
}
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1845
|
+
const Ur = /* @__PURE__ */ u("ZodOptional", (e, n) => {
|
|
1846
|
+
se.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ke(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1866
1847
|
});
|
|
1867
|
-
function
|
|
1868
|
-
return new
|
|
1848
|
+
function ve(e) {
|
|
1849
|
+
return new Ur({
|
|
1869
1850
|
type: "optional",
|
|
1870
1851
|
innerType: e
|
|
1871
1852
|
});
|
|
1872
1853
|
}
|
|
1873
|
-
const
|
|
1874
|
-
|
|
1854
|
+
const Vr = /* @__PURE__ */ u("ZodExactOptional", (e, n) => {
|
|
1855
|
+
mt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => Ke(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1875
1856
|
});
|
|
1876
|
-
function
|
|
1877
|
-
return new
|
|
1857
|
+
function Wr(e) {
|
|
1858
|
+
return new Vr({
|
|
1878
1859
|
type: "optional",
|
|
1879
1860
|
innerType: e
|
|
1880
1861
|
});
|
|
1881
1862
|
}
|
|
1882
|
-
const
|
|
1883
|
-
|
|
1863
|
+
const Gr = /* @__PURE__ */ u("ZodNullable", (e, n) => {
|
|
1864
|
+
pt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => sr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1884
1865
|
});
|
|
1885
|
-
function
|
|
1886
|
-
return new
|
|
1866
|
+
function ze(e) {
|
|
1867
|
+
return new Gr({
|
|
1887
1868
|
type: "nullable",
|
|
1888
1869
|
innerType: e
|
|
1889
1870
|
});
|
|
1890
1871
|
}
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1872
|
+
const qr = /* @__PURE__ */ u("ZodDefault", (e, n) => {
|
|
1873
|
+
ht.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => ar(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1893
1874
|
});
|
|
1894
|
-
function
|
|
1895
|
-
return new
|
|
1875
|
+
function Br(e, n) {
|
|
1876
|
+
return new qr({
|
|
1896
1877
|
type: "default",
|
|
1897
1878
|
innerType: e,
|
|
1898
1879
|
get defaultValue() {
|
|
1899
|
-
return typeof n == "function" ? n() :
|
|
1880
|
+
return typeof n == "function" ? n() : Ee(n);
|
|
1900
1881
|
}
|
|
1901
1882
|
});
|
|
1902
1883
|
}
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1884
|
+
const Kr = /* @__PURE__ */ u("ZodPrefault", (e, n) => {
|
|
1885
|
+
gt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => ur(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1905
1886
|
});
|
|
1906
|
-
function
|
|
1907
|
-
return new
|
|
1887
|
+
function Yr(e, n) {
|
|
1888
|
+
return new Kr({
|
|
1908
1889
|
type: "prefault",
|
|
1909
1890
|
innerType: e,
|
|
1910
1891
|
get defaultValue() {
|
|
1911
|
-
return typeof n == "function" ? n() :
|
|
1892
|
+
return typeof n == "function" ? n() : Ee(n);
|
|
1912
1893
|
}
|
|
1913
1894
|
});
|
|
1914
1895
|
}
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1896
|
+
const Xr = /* @__PURE__ */ u("ZodNonOptional", (e, n) => {
|
|
1897
|
+
_t.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => cr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1917
1898
|
});
|
|
1918
|
-
function
|
|
1919
|
-
return new
|
|
1899
|
+
function Hr(e, n) {
|
|
1900
|
+
return new Xr({
|
|
1920
1901
|
type: "nonoptional",
|
|
1921
1902
|
innerType: e,
|
|
1922
|
-
...
|
|
1903
|
+
...l(n)
|
|
1923
1904
|
});
|
|
1924
1905
|
}
|
|
1925
|
-
const
|
|
1926
|
-
|
|
1906
|
+
const Qr = /* @__PURE__ */ u("ZodCatch", (e, n) => {
|
|
1907
|
+
yt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => fr(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1927
1908
|
});
|
|
1928
|
-
function
|
|
1929
|
-
return new
|
|
1909
|
+
function eo(e, n) {
|
|
1910
|
+
return new Qr({
|
|
1930
1911
|
type: "catch",
|
|
1931
1912
|
innerType: e,
|
|
1932
1913
|
catchValue: typeof n == "function" ? n : () => n
|
|
1933
1914
|
});
|
|
1934
1915
|
}
|
|
1935
|
-
const
|
|
1936
|
-
vt.init(e, n),
|
|
1916
|
+
const no = /* @__PURE__ */ u("ZodPipe", (e, n) => {
|
|
1917
|
+
vt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => dr(e, t, r, o), e.in = n.in, e.out = n.out;
|
|
1937
1918
|
});
|
|
1938
|
-
function
|
|
1939
|
-
return new
|
|
1919
|
+
function be(e, n) {
|
|
1920
|
+
return new no({
|
|
1940
1921
|
type: "pipe",
|
|
1941
1922
|
in: e,
|
|
1942
1923
|
out: n
|
|
1943
1924
|
// ...util.normalizeParams(params),
|
|
1944
1925
|
});
|
|
1945
1926
|
}
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1927
|
+
const to = /* @__PURE__ */ u("ZodReadonly", (e, n) => {
|
|
1928
|
+
zt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => lr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
1948
1929
|
});
|
|
1949
|
-
function
|
|
1950
|
-
return new
|
|
1930
|
+
function ro(e) {
|
|
1931
|
+
return new to({
|
|
1951
1932
|
type: "readonly",
|
|
1952
1933
|
innerType: e
|
|
1953
1934
|
});
|
|
1954
1935
|
}
|
|
1955
|
-
const
|
|
1956
|
-
|
|
1936
|
+
const oo = /* @__PURE__ */ u("ZodCustom", (e, n) => {
|
|
1937
|
+
Le.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => nr(e, t);
|
|
1957
1938
|
});
|
|
1958
|
-
function
|
|
1959
|
-
return /* @__PURE__ */
|
|
1939
|
+
function io(e, n = {}) {
|
|
1940
|
+
return /* @__PURE__ */ Ve(oo, e, n);
|
|
1960
1941
|
}
|
|
1961
|
-
function
|
|
1962
|
-
return /* @__PURE__ */
|
|
1942
|
+
function so(e) {
|
|
1943
|
+
return /* @__PURE__ */ We(e);
|
|
1963
1944
|
}
|
|
1964
|
-
const
|
|
1945
|
+
const P = /* @__PURE__ */ u("ZodMiniType", (e, n) => {
|
|
1965
1946
|
if (!e._zod)
|
|
1966
1947
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1967
|
-
|
|
1948
|
+
y.init(e, n), e.def = n, e.type = n.type, e.parse = (t, r) => mn(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Me(e, t, r), e.parseAsync = async (t, r) => pn(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Ce(e, t, r), e.check = (...t) => e.clone({
|
|
1968
1949
|
...n,
|
|
1969
1950
|
checks: [
|
|
1970
1951
|
...n.checks ?? [],
|
|
1971
1952
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1972
1953
|
]
|
|
1973
|
-
}, { parent: !0 }), e.with = e.check, e.clone = (t, r) =>
|
|
1974
|
-
}),
|
|
1975
|
-
|
|
1954
|
+
}, { parent: !0 }), e.with = e.check, e.clone = (t, r) => Ae(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.apply = (t) => t(e);
|
|
1955
|
+
}), Ye = /* @__PURE__ */ u("ZodMiniString", (e, n) => {
|
|
1956
|
+
ie.init(e, n), P.init(e, n);
|
|
1976
1957
|
});
|
|
1977
1958
|
// @__NO_SIDE_EFFECTS__
|
|
1978
|
-
function
|
|
1979
|
-
return /* @__PURE__ */
|
|
1959
|
+
function we(e) {
|
|
1960
|
+
return /* @__PURE__ */ $t(Ye, e);
|
|
1980
1961
|
}
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1962
|
+
const M = /* @__PURE__ */ u("ZodMiniStringFormat", (e, n) => {
|
|
1963
|
+
k.init(e, n), Ye.init(e, n);
|
|
1983
1964
|
}), co = /* @__PURE__ */ u("ZodMiniEmail", (e, n) => {
|
|
1984
|
-
|
|
1965
|
+
Hn.init(e, n), M.init(e, n);
|
|
1985
1966
|
});
|
|
1986
1967
|
// @__NO_SIDE_EFFECTS__
|
|
1987
|
-
function
|
|
1988
|
-
return /* @__PURE__ */
|
|
1968
|
+
function ao(e) {
|
|
1969
|
+
return /* @__PURE__ */ kt(co, e);
|
|
1989
1970
|
}
|
|
1990
|
-
const
|
|
1991
|
-
|
|
1971
|
+
const uo = /* @__PURE__ */ u("ZodMiniUUID", (e, n) => {
|
|
1972
|
+
Xn.init(e, n), M.init(e, n);
|
|
1992
1973
|
});
|
|
1993
1974
|
// @__NO_SIDE_EFFECTS__
|
|
1994
1975
|
function fo(e) {
|
|
1995
|
-
return /* @__PURE__ */ Zt(
|
|
1976
|
+
return /* @__PURE__ */ Zt(uo, e);
|
|
1996
1977
|
}
|
|
1997
1978
|
const lo = /* @__PURE__ */ u("ZodMiniURL", (e, n) => {
|
|
1998
|
-
|
|
1979
|
+
Qn.init(e, n), M.init(e, n);
|
|
1999
1980
|
});
|
|
2000
1981
|
// @__NO_SIDE_EFFECTS__
|
|
2001
|
-
function
|
|
2002
|
-
return /* @__PURE__ */
|
|
1982
|
+
function mo(e) {
|
|
1983
|
+
return /* @__PURE__ */ St(lo, e);
|
|
2003
1984
|
}
|
|
2004
|
-
const
|
|
2005
|
-
|
|
1985
|
+
const po = /* @__PURE__ */ u("ZodMiniIPv4", (e, n) => {
|
|
1986
|
+
ot.init(e, n), M.init(e, n);
|
|
2006
1987
|
});
|
|
2007
1988
|
// @__NO_SIDE_EFFECTS__
|
|
2008
1989
|
function ho(e) {
|
|
2009
|
-
return /* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ Ot(po, e);
|
|
2010
1991
|
}
|
|
2011
|
-
const
|
|
2012
|
-
|
|
1992
|
+
const go = /* @__PURE__ */ u("ZodMiniIPv6", (e, n) => {
|
|
1993
|
+
it.init(e, n), M.init(e, n);
|
|
2013
1994
|
});
|
|
2014
1995
|
// @__NO_SIDE_EFFECTS__
|
|
2015
|
-
function
|
|
2016
|
-
return /* @__PURE__ */
|
|
1996
|
+
function _o(e) {
|
|
1997
|
+
return /* @__PURE__ */ Tt(go, e);
|
|
2017
1998
|
}
|
|
2018
|
-
const
|
|
2019
|
-
|
|
1999
|
+
const yo = /* @__PURE__ */ u("ZodMiniCustomStringFormat", (e, n) => {
|
|
2000
|
+
st.init(e, n), M.init(e, n);
|
|
2020
2001
|
});
|
|
2021
2002
|
// @__NO_SIDE_EFFECTS__
|
|
2022
|
-
function
|
|
2023
|
-
return /* @__PURE__ */
|
|
2003
|
+
function vo(e) {
|
|
2004
|
+
return /* @__PURE__ */ Xt(yo, "hostname", On, e);
|
|
2024
2005
|
}
|
|
2025
|
-
const
|
|
2026
|
-
|
|
2006
|
+
const Xe = /* @__PURE__ */ u("ZodMiniNumber", (e, n) => {
|
|
2007
|
+
xe.init(e, n), P.init(e, n);
|
|
2027
2008
|
});
|
|
2028
2009
|
// @__NO_SIDE_EFFECTS__
|
|
2029
|
-
function
|
|
2030
|
-
return /* @__PURE__ */ Nt(
|
|
2010
|
+
function $e(e) {
|
|
2011
|
+
return /* @__PURE__ */ Nt(Xe, e);
|
|
2031
2012
|
}
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2013
|
+
const zo = /* @__PURE__ */ u("ZodMiniNumberFormat", (e, n) => {
|
|
2014
|
+
ct.init(e, n), Xe.init(e, n);
|
|
2034
2015
|
});
|
|
2035
2016
|
// @__NO_SIDE_EFFECTS__
|
|
2036
|
-
function
|
|
2037
|
-
return /* @__PURE__ */
|
|
2017
|
+
function bo(e) {
|
|
2018
|
+
return /* @__PURE__ */ Mt(zo, e);
|
|
2038
2019
|
}
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2020
|
+
const wo = /* @__PURE__ */ u("ZodMiniBoolean", (e, n) => {
|
|
2021
|
+
at.init(e, n), P.init(e, n);
|
|
2041
2022
|
});
|
|
2042
2023
|
// @__NO_SIDE_EFFECTS__
|
|
2043
|
-
function
|
|
2044
|
-
return /* @__PURE__ */ Ct(
|
|
2024
|
+
function ke(e) {
|
|
2025
|
+
return /* @__PURE__ */ Ct(wo, e);
|
|
2045
2026
|
}
|
|
2046
|
-
const
|
|
2047
|
-
|
|
2027
|
+
const $o = /* @__PURE__ */ u("ZodMiniAny", (e, n) => {
|
|
2028
|
+
ut.init(e, n), P.init(e, n);
|
|
2048
2029
|
});
|
|
2049
2030
|
// @__NO_SIDE_EFFECTS__
|
|
2050
|
-
function
|
|
2051
|
-
return /* @__PURE__ */ Rt(
|
|
2031
|
+
function Q() {
|
|
2032
|
+
return /* @__PURE__ */ Rt($o);
|
|
2052
2033
|
}
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2034
|
+
const ko = /* @__PURE__ */ u("ZodMiniArray", (e, n) => {
|
|
2035
|
+
De.init(e, n), P.init(e, n);
|
|
2055
2036
|
});
|
|
2056
2037
|
// @__NO_SIDE_EFFECTS__
|
|
2057
|
-
function
|
|
2058
|
-
return new
|
|
2059
|
-
type: "
|
|
2060
|
-
|
|
2038
|
+
function Ze(e, n) {
|
|
2039
|
+
return new ko({
|
|
2040
|
+
type: "array",
|
|
2041
|
+
element: e,
|
|
2042
|
+
...l(n)
|
|
2061
2043
|
});
|
|
2062
2044
|
}
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2045
|
+
const Zo = /* @__PURE__ */ u("ZodMiniOptional", (e, n) => {
|
|
2046
|
+
se.init(e, n), P.init(e, n);
|
|
2065
2047
|
});
|
|
2066
2048
|
// @__NO_SIDE_EFFECTS__
|
|
2067
|
-
function
|
|
2068
|
-
return new
|
|
2069
|
-
type: "
|
|
2049
|
+
function So(e) {
|
|
2050
|
+
return new Zo({
|
|
2051
|
+
type: "optional",
|
|
2070
2052
|
innerType: e
|
|
2071
2053
|
});
|
|
2072
2054
|
}
|
|
2073
|
-
const
|
|
2074
|
-
|
|
2055
|
+
const Oo = /* @__PURE__ */ u("ZodMiniCustom", (e, n) => {
|
|
2056
|
+
Le.init(e, n), P.init(e, n);
|
|
2075
2057
|
});
|
|
2076
2058
|
// @__NO_SIDE_EFFECTS__
|
|
2077
|
-
function
|
|
2078
|
-
return /* @__PURE__ */
|
|
2059
|
+
function v(e, n = {}) {
|
|
2060
|
+
return /* @__PURE__ */ Ve(Oo, e, n);
|
|
2079
2061
|
}
|
|
2080
2062
|
// @__NO_SIDE_EFFECTS__
|
|
2081
|
-
function
|
|
2082
|
-
return /* @__PURE__ */
|
|
2063
|
+
function He(e) {
|
|
2064
|
+
return /* @__PURE__ */ We(e);
|
|
2083
2065
|
}
|
|
2084
|
-
const
|
|
2085
|
-
email: { schema: /* @__PURE__ */
|
|
2086
|
-
hostname: { schema: /* @__PURE__ */
|
|
2066
|
+
const ee = {
|
|
2067
|
+
email: { schema: /* @__PURE__ */ ao() },
|
|
2068
|
+
hostname: { schema: /* @__PURE__ */ vo() },
|
|
2087
2069
|
ipv4: { schema: /* @__PURE__ */ ho() },
|
|
2088
|
-
ipv6: { schema: /* @__PURE__ */
|
|
2089
|
-
url: { schema: /* @__PURE__ */
|
|
2070
|
+
ipv6: { schema: /* @__PURE__ */ _o() },
|
|
2071
|
+
url: { schema: /* @__PURE__ */ mo() },
|
|
2090
2072
|
uuid: { schema: /* @__PURE__ */ fo() },
|
|
2091
|
-
date: { schema:
|
|
2092
|
-
time: { schema:
|
|
2073
|
+
date: { schema: gr() },
|
|
2074
|
+
time: { schema: yr() },
|
|
2093
2075
|
"date-time": { schema: pr() },
|
|
2094
|
-
duration: { schema:
|
|
2095
|
-
},
|
|
2076
|
+
duration: { schema: zr() }
|
|
2077
|
+
}, To = Object.keys(ee), Po = (e) => (n, t) => {
|
|
2096
2078
|
switch (n.type) {
|
|
2097
2079
|
case "string":
|
|
2098
|
-
return
|
|
2080
|
+
return Eo(n, t);
|
|
2099
2081
|
case "integer":
|
|
2100
2082
|
case "number":
|
|
2101
|
-
return
|
|
2083
|
+
return Io(n, t);
|
|
2102
2084
|
case "boolean":
|
|
2103
|
-
return
|
|
2085
|
+
return No(n, t);
|
|
2104
2086
|
case "array":
|
|
2105
|
-
return
|
|
2087
|
+
return Mo(n, t);
|
|
2106
2088
|
case "custom": {
|
|
2107
2089
|
if (!e)
|
|
2108
2090
|
throw new Error(
|
|
2109
2091
|
'Validator type "custom" requires a customValidators object, but it was not supplied.'
|
|
2110
2092
|
);
|
|
2111
|
-
return
|
|
2093
|
+
return Co(n, e);
|
|
2112
2094
|
}
|
|
2113
2095
|
}
|
|
2114
2096
|
};
|
|
2115
|
-
function
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2097
|
+
function _(e, n) {
|
|
2098
|
+
if (e !== void 0)
|
|
2099
|
+
return typeof e == "string" ? e : n?.translate(e.key, e.params, e.default) ?? e.default;
|
|
2100
|
+
}
|
|
2101
|
+
function Eo(e, n) {
|
|
2102
|
+
return F(e, (t) => {
|
|
2103
|
+
const r = _(t.messages?.invalid, n);
|
|
2104
|
+
let o = r ? /* @__PURE__ */ we(r) : /* @__PURE__ */ we();
|
|
2105
|
+
if (t.required === !0) {
|
|
2106
|
+
const s = _(t.messages?.required, n) ?? "This field is required";
|
|
2107
|
+
o = o.check(/* @__PURE__ */ v((i) => i.length > 0, { error: s }));
|
|
2121
2108
|
}
|
|
2122
|
-
|
|
2109
|
+
if (typeof t.minLength == "number") {
|
|
2110
|
+
const s = _(t.messages?.minLength, n), i = t.minLength;
|
|
2111
|
+
o = o.check(
|
|
2112
|
+
s ? /* @__PURE__ */ v((c) => c.length >= i, { error: s }) : /* @__PURE__ */ I(i)
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
if (typeof t.maxLength == "number") {
|
|
2116
|
+
const s = _(t.messages?.maxLength, n), i = t.maxLength;
|
|
2117
|
+
o = o.check(
|
|
2118
|
+
s ? /* @__PURE__ */ v((c) => c.length <= i, { error: s }) : /* @__PURE__ */ B(i)
|
|
2119
|
+
);
|
|
2120
|
+
}
|
|
2121
|
+
if (typeof t.pattern == "string") {
|
|
2122
|
+
const s = _(t.messages?.pattern, n), i = new RegExp(t.pattern);
|
|
2123
|
+
o = o.check(
|
|
2124
|
+
s ? /* @__PURE__ */ v((c) => i.test(c), { error: s }) : /* @__PURE__ */ Ue(i)
|
|
2125
|
+
);
|
|
2126
|
+
}
|
|
2127
|
+
if (t.enum) {
|
|
2128
|
+
const s = t.enum, i = _(t.messages?.enum, n);
|
|
2129
|
+
o = o.check(/* @__PURE__ */ v((c) => s.includes(c), i ? { error: i } : void 0));
|
|
2130
|
+
}
|
|
2131
|
+
if (t.const !== void 0) {
|
|
2132
|
+
const s = _(t.messages?.const, n);
|
|
2133
|
+
o = o.check(/* @__PURE__ */ v((i) => i === t.const, s ? { error: s } : void 0));
|
|
2134
|
+
}
|
|
2135
|
+
if (t.format !== void 0)
|
|
2136
|
+
if (To.includes(t.format)) {
|
|
2137
|
+
const s = _(t.messages?.format, n);
|
|
2138
|
+
o = o.check(
|
|
2139
|
+
s ? /* @__PURE__ */ He((i, c) => {
|
|
2140
|
+
const a = Se(
|
|
2141
|
+
ee[t.format].schema,
|
|
2142
|
+
i
|
|
2143
|
+
);
|
|
2144
|
+
Oe(a) || c.addIssue({ code: "custom", path: [], message: s });
|
|
2145
|
+
}) : ee[t.format].schema
|
|
2146
|
+
);
|
|
2147
|
+
} else
|
|
2148
|
+
console.error(`The string validation format "${t.format}" is not supported`);
|
|
2149
|
+
return o;
|
|
2123
2150
|
});
|
|
2124
2151
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2152
|
+
const Ao = (e, n) => {
|
|
2153
|
+
if (n === 0)
|
|
2154
|
+
return !1;
|
|
2155
|
+
const t = e / n;
|
|
2156
|
+
return Math.abs(t - Math.round(t)) < 1e-10;
|
|
2157
|
+
};
|
|
2158
|
+
function Io(e, n) {
|
|
2159
|
+
return F(e, (t) => {
|
|
2160
|
+
const r = _(t.messages?.invalid, n);
|
|
2161
|
+
let o = r ? /* @__PURE__ */ $e(r) : /* @__PURE__ */ $e();
|
|
2162
|
+
if (t.type === "integer" && (o = o.check(/* @__PURE__ */ bo())), t.minimum !== void 0) {
|
|
2163
|
+
const s = _(t.messages?.minimum, n), i = t.minimum;
|
|
2164
|
+
o = o.check(s ? /* @__PURE__ */ v((c) => c >= i, { error: s }) : /* @__PURE__ */ Ft(i));
|
|
2131
2165
|
}
|
|
2132
|
-
if (
|
|
2133
|
-
const
|
|
2134
|
-
|
|
2166
|
+
if (t.maximum !== void 0) {
|
|
2167
|
+
const s = _(t.messages?.maximum, n), i = t.maximum;
|
|
2168
|
+
o = o.check(s ? /* @__PURE__ */ v((c) => c <= i, { error: s }) : /* @__PURE__ */ jt(i));
|
|
2135
2169
|
}
|
|
2136
|
-
if (
|
|
2137
|
-
const
|
|
2138
|
-
|
|
2170
|
+
if (t.exclusiveMinimum !== void 0) {
|
|
2171
|
+
const s = _(t.messages?.exclusiveMinimum, n), i = t.exclusiveMinimum;
|
|
2172
|
+
o = o.check(/* @__PURE__ */ v((c) => c > i, s ? { error: s } : void 0));
|
|
2139
2173
|
}
|
|
2140
|
-
if (
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2174
|
+
if (t.exclusiveMaximum !== void 0) {
|
|
2175
|
+
const s = _(t.messages?.exclusiveMaximum, n), i = t.exclusiveMaximum;
|
|
2176
|
+
o = o.check(/* @__PURE__ */ v((c) => c < i, s ? { error: s } : void 0));
|
|
2177
|
+
}
|
|
2178
|
+
if (t.multipleOf !== void 0) {
|
|
2179
|
+
const s = _(t.messages?.multipleOf, n), i = t.multipleOf;
|
|
2180
|
+
o = o.check(
|
|
2181
|
+
/* @__PURE__ */ v((c) => Ao(c, i), s ? { error: s } : void 0)
|
|
2182
|
+
);
|
|
2143
2183
|
}
|
|
2144
|
-
|
|
2184
|
+
if (t.enum) {
|
|
2185
|
+
const s = t.enum, i = _(t.messages?.enum, n);
|
|
2186
|
+
o = o.check(/* @__PURE__ */ v((c) => s.includes(c), i ? { error: i } : void 0));
|
|
2187
|
+
}
|
|
2188
|
+
if (t.const !== void 0) {
|
|
2189
|
+
const s = _(t.messages?.const, n);
|
|
2190
|
+
o = o.check(/* @__PURE__ */ v((i) => i === t.const, s ? { error: s } : void 0));
|
|
2191
|
+
}
|
|
2192
|
+
return o;
|
|
2145
2193
|
});
|
|
2146
2194
|
}
|
|
2147
|
-
function
|
|
2148
|
-
return
|
|
2149
|
-
|
|
2150
|
-
|
|
2195
|
+
function No(e, n) {
|
|
2196
|
+
return F(e, (t) => {
|
|
2197
|
+
const r = _(t.messages?.invalid, n);
|
|
2198
|
+
let o = r ? /* @__PURE__ */ ke(r) : /* @__PURE__ */ ke();
|
|
2199
|
+
if (t.const !== void 0) {
|
|
2200
|
+
const s = _(t.messages?.const, n);
|
|
2201
|
+
o = o.check(/* @__PURE__ */ v((i) => i === t.const, s ? { error: s } : void 0));
|
|
2202
|
+
}
|
|
2203
|
+
return o;
|
|
2151
2204
|
});
|
|
2152
2205
|
}
|
|
2153
2206
|
function Mo(e, n) {
|
|
2154
|
-
return
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
const p = l.issues[0];
|
|
2166
|
-
f.addIssue({
|
|
2167
|
-
code: "custom",
|
|
2168
|
-
path: [],
|
|
2169
|
-
message: p?.message || `Validation failed for ${o}`
|
|
2170
|
-
});
|
|
2171
|
-
}
|
|
2172
|
-
})
|
|
2207
|
+
return F(e, (t) => {
|
|
2208
|
+
const r = _(t.messages?.invalid, n);
|
|
2209
|
+
let o = r ? /* @__PURE__ */ Ze(/* @__PURE__ */ Q(), r) : /* @__PURE__ */ Ze(/* @__PURE__ */ Q());
|
|
2210
|
+
if (t.required === !0) {
|
|
2211
|
+
const s = _(t.messages?.required, n) ?? "This field is required";
|
|
2212
|
+
o = o.check(/* @__PURE__ */ v((i) => i.length > 0, { error: s }));
|
|
2213
|
+
}
|
|
2214
|
+
if (typeof t.minItems == "number") {
|
|
2215
|
+
const s = _(t.messages?.minItems, n), i = t.minItems;
|
|
2216
|
+
o = o.check(
|
|
2217
|
+
s ? /* @__PURE__ */ v((c) => c.length >= i, { error: s }) : /* @__PURE__ */ I(i)
|
|
2173
2218
|
);
|
|
2174
|
-
}
|
|
2219
|
+
}
|
|
2220
|
+
if (typeof t.maxItems == "number") {
|
|
2221
|
+
const s = _(t.messages?.maxItems, n), i = t.maxItems;
|
|
2222
|
+
o = o.check(
|
|
2223
|
+
s ? /* @__PURE__ */ v((c) => c.length <= i, { error: s }) : /* @__PURE__ */ B(i)
|
|
2224
|
+
);
|
|
2225
|
+
}
|
|
2226
|
+
return o;
|
|
2227
|
+
});
|
|
2228
|
+
}
|
|
2229
|
+
function Co(e, n) {
|
|
2230
|
+
return F(e, (t) => {
|
|
2231
|
+
let r = /* @__PURE__ */ Q();
|
|
2232
|
+
return nn(
|
|
2233
|
+
Object.keys(t),
|
|
2234
|
+
// filter non-custom validator keys
|
|
2235
|
+
(o) => o !== "type" && o !== "required",
|
|
2236
|
+
(o) => {
|
|
2237
|
+
const s = t[o], i = n[o], c = i(s);
|
|
2238
|
+
r = r.check(
|
|
2239
|
+
/* @__PURE__ */ He((a, f) => {
|
|
2240
|
+
const d = Se(
|
|
2241
|
+
c,
|
|
2242
|
+
a
|
|
2243
|
+
);
|
|
2244
|
+
if (!Oe(d)) {
|
|
2245
|
+
const p = d.issues[0];
|
|
2246
|
+
f.addIssue({
|
|
2247
|
+
code: "custom",
|
|
2248
|
+
path: [],
|
|
2249
|
+
message: p?.message || `Validation failed for ${o}`
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
})
|
|
2253
|
+
);
|
|
2254
|
+
}
|
|
2255
|
+
), r;
|
|
2175
2256
|
});
|
|
2176
2257
|
}
|
|
2177
|
-
function
|
|
2258
|
+
function F(e, n) {
|
|
2178
2259
|
const t = n(e);
|
|
2179
|
-
return e.required ? t : /* @__PURE__ */
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2260
|
+
return e.required ? t : /* @__PURE__ */ So(t);
|
|
2261
|
+
}
|
|
2262
|
+
function Lo({
|
|
2263
|
+
config: e,
|
|
2264
|
+
formHealth: n = void 0,
|
|
2265
|
+
formEvent: t = void 0,
|
|
2266
|
+
autocomplete: r,
|
|
2267
|
+
ref: o
|
|
2268
|
+
}) {
|
|
2269
|
+
const s = rn(
|
|
2270
|
+
() => en(e.formDef, e.formSelectors, e.formConfig),
|
|
2271
|
+
[e]
|
|
2272
|
+
), i = {
|
|
2273
|
+
formDef: s.formDef,
|
|
2274
|
+
widgetLoaders: {
|
|
2275
|
+
...on,
|
|
2276
|
+
...s.widgetLoaders,
|
|
2277
|
+
...e.customWidgetLoaders ?? {}
|
|
2278
|
+
},
|
|
2279
|
+
dependencies: { ...s.dependencies ?? {}, ...e.dependencies ?? {} },
|
|
2280
|
+
validateOn: e.validateOn ?? s.validateOn ?? "eager",
|
|
2281
|
+
itemRenderers: {
|
|
2282
|
+
...s.itemRenderers ?? {},
|
|
2283
|
+
...e.itemRenderers ?? {}
|
|
2284
|
+
},
|
|
2285
|
+
localization: e.localization,
|
|
2286
|
+
middlewares: e.middlewares ?? [],
|
|
2287
|
+
data: e.data,
|
|
2288
|
+
meta: e.meta,
|
|
2289
|
+
formName: e.formName
|
|
2290
|
+
}, c = Po({ ...e.customValidators ?? {} }), a = s.formEvent && t ? (f) => {
|
|
2291
|
+
s.formEvent?.(f), t(f);
|
|
2292
|
+
} : t ?? s.formEvent;
|
|
2293
|
+
return /* @__PURE__ */ Qe(
|
|
2294
|
+
tn.FormComponent,
|
|
2199
2295
|
{
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
validators: h,
|
|
2207
|
-
validateOn: c,
|
|
2208
|
-
formHealth: a,
|
|
2209
|
-
formEvent: f
|
|
2296
|
+
ref: o,
|
|
2297
|
+
config: i,
|
|
2298
|
+
validators: c,
|
|
2299
|
+
autocomplete: r,
|
|
2300
|
+
formHealth: n,
|
|
2301
|
+
formEvent: a
|
|
2210
2302
|
}
|
|
2211
2303
|
);
|
|
2212
|
-
}
|
|
2304
|
+
}
|
|
2213
2305
|
export {
|
|
2214
|
-
|
|
2215
|
-
|
|
2306
|
+
Lo as GuiForm,
|
|
2307
|
+
on as widgetLoaders
|
|
2216
2308
|
};
|