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