@golemui/gui-lit 1.0.0-rc.1 → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/index.js +902 -1299
- package/index.umd.cjs +185 -187
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { filterTap as
|
|
1
|
+
import { filterTap as At, standardValidate as Ye, isStandardValidateSuccess as Ge } from "@golemui/core";
|
|
2
2
|
import "@golemui/gui-shared";
|
|
3
3
|
import "@golemui/lit";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { property as
|
|
6
|
-
const
|
|
4
|
+
import { LitElement as St, html as zt } from "lit";
|
|
5
|
+
import { property as Ke, query as Et, customElement as $t } from "lit/decorators.js";
|
|
6
|
+
const qe = {
|
|
7
7
|
LAYOUTS: "LAYOUTS",
|
|
8
8
|
DISPLAYS: "DISPLAYS"
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function Ot(e) {
|
|
11
11
|
return function(t, n = () => !0) {
|
|
12
12
|
return {
|
|
13
13
|
kind: "leaf",
|
|
@@ -17,41 +17,41 @@ function Lt(e) {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function w(e, t) {
|
|
21
21
|
return typeof e == "function" ? e : { type: t, ...e ?? {} };
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const Zt = (e, t) => ({
|
|
24
24
|
type: "ITEMS",
|
|
25
|
-
itemType:
|
|
25
|
+
itemType: qe.DISPLAYS,
|
|
26
26
|
items: [{ render: e }],
|
|
27
27
|
tags: t ?? []
|
|
28
|
-
}),
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
28
|
+
}), K = /* @__PURE__ */ new Map();
|
|
29
|
+
function Xe(e, t) {
|
|
30
|
+
if (K.has(e))
|
|
31
31
|
throw new Error(`Item type "${e}" is already registered.`);
|
|
32
|
-
|
|
32
|
+
K.set(e, t);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const t =
|
|
34
|
+
function q(e) {
|
|
35
|
+
const t = K.get(e);
|
|
36
36
|
if (!t)
|
|
37
37
|
throw new Error(
|
|
38
38
|
`No handler registered for item type "${e}". Did you forget to import the registration module?`
|
|
39
39
|
);
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
42
|
+
function He(e) {
|
|
43
|
+
return K.has(e);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function h(e) {
|
|
46
46
|
const t = (a) => {
|
|
47
47
|
if (!e.sensibleDefaults)
|
|
48
48
|
return {};
|
|
49
49
|
let u = { ...e.sensibleDefaults.base };
|
|
50
50
|
for (const c of a) {
|
|
51
51
|
const p = c.config;
|
|
52
|
-
for (const
|
|
53
|
-
const
|
|
54
|
-
p[
|
|
52
|
+
for (const m of e.sensibleDefaults.fields) {
|
|
53
|
+
const f = m;
|
|
54
|
+
p[f] != null && (u = { ...u, [f]: p[f] });
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
return u;
|
|
@@ -77,11 +77,11 @@ function y(e) {
|
|
|
77
77
|
...e.buildCustomWidget ? { buildCustomWidget: e.buildCustomWidget } : {},
|
|
78
78
|
...e.getChildren ? { getChildren: e.getChildren } : {}
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
const s =
|
|
80
|
+
Xe(e.itemType, o);
|
|
81
|
+
const s = Ot(e.itemType);
|
|
82
82
|
return { gsl: s, gslByUid: (a, u) => s(u, ((c) => c.uid === a)) };
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function y(e) {
|
|
85
85
|
const {
|
|
86
86
|
uid: t,
|
|
87
87
|
path: n,
|
|
@@ -93,40 +93,40 @@ function _(e) {
|
|
|
93
93
|
type: u,
|
|
94
94
|
size: c,
|
|
95
95
|
onLoad: p,
|
|
96
|
-
onChange:
|
|
97
|
-
onFilter:
|
|
98
|
-
on:
|
|
96
|
+
onChange: m,
|
|
97
|
+
onFilter: f,
|
|
98
|
+
on: z,
|
|
99
99
|
states: P,
|
|
100
|
-
include:
|
|
101
|
-
exclude:
|
|
102
|
-
validator:
|
|
103
|
-
...
|
|
100
|
+
include: V,
|
|
101
|
+
exclude: _e,
|
|
102
|
+
validator: ve,
|
|
103
|
+
...C
|
|
104
104
|
} = e;
|
|
105
|
-
return
|
|
105
|
+
return C;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Pt(e) {
|
|
108
108
|
return e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (t) => t.toUpperCase()) : "";
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label:
|
|
110
|
+
function v(e, t) {
|
|
111
|
+
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label: Pt(e.path) };
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function Z(e, t) {
|
|
114
114
|
return e.placeholder != null || t.suppressAutomaticPlaceholders || !e.path ? e : { ...e, placeholder: e.path };
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Ct(e) {
|
|
117
117
|
switch (e.type) {
|
|
118
118
|
case "text":
|
|
119
|
-
return
|
|
119
|
+
return Lt(e);
|
|
120
120
|
case "number":
|
|
121
|
-
return
|
|
121
|
+
return Dt(e);
|
|
122
122
|
case "boolean":
|
|
123
|
-
return
|
|
123
|
+
return It(e);
|
|
124
124
|
default:
|
|
125
125
|
throw new Error(`Unsupported field type "${e.type}"`);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const t =
|
|
128
|
+
function It(e) {
|
|
129
|
+
const t = y(e);
|
|
130
130
|
return {
|
|
131
131
|
uid: e.uid ?? "",
|
|
132
132
|
kind: "input",
|
|
@@ -135,12 +135,12 @@ function Ft(e) {
|
|
|
135
135
|
...e.label != null ? { label: e.label } : {},
|
|
136
136
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
137
137
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
138
|
-
...e.validator != null ? { validator:
|
|
138
|
+
...e.validator != null ? { validator: w(e.validator, "boolean") } : {},
|
|
139
139
|
props: t
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
const t =
|
|
142
|
+
function Lt(e) {
|
|
143
|
+
const t = y(e);
|
|
144
144
|
return {
|
|
145
145
|
uid: e.uid ?? "",
|
|
146
146
|
kind: "input",
|
|
@@ -153,11 +153,11 @@ function jt(e) {
|
|
|
153
153
|
placeholder: t.placeholder ?? "",
|
|
154
154
|
...t
|
|
155
155
|
},
|
|
156
|
-
validator:
|
|
156
|
+
validator: w(e.validator, "string")
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
159
|
+
function Dt(e) {
|
|
160
|
+
const t = y(e);
|
|
161
161
|
return {
|
|
162
162
|
uid: e.uid ?? "",
|
|
163
163
|
kind: "input",
|
|
@@ -170,10 +170,10 @@ function Wt(e) {
|
|
|
170
170
|
placeholder: t.placeholder ?? "",
|
|
171
171
|
...t
|
|
172
172
|
},
|
|
173
|
-
validator:
|
|
173
|
+
validator: w(e.validator, "number")
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
h({
|
|
177
177
|
itemType: "INPUTS",
|
|
178
178
|
entryShape: "keyed",
|
|
179
179
|
sensibleDefaults: {
|
|
@@ -183,19 +183,19 @@ y({
|
|
|
183
183
|
},
|
|
184
184
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
185
185
|
apply: (e, t) => {
|
|
186
|
-
let n =
|
|
187
|
-
return n =
|
|
186
|
+
let n = v(e, t);
|
|
187
|
+
return n = Z(n, t), n;
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
|
-
mapToWidget:
|
|
190
|
+
mapToWidget: Ct
|
|
191
191
|
});
|
|
192
|
-
|
|
192
|
+
h({
|
|
193
193
|
itemType: "SELECT",
|
|
194
194
|
entryShape: "keyed",
|
|
195
195
|
sensibleDefaults: {
|
|
196
196
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
197
197
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
198
|
-
apply: (e, t) =>
|
|
198
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
199
199
|
},
|
|
200
200
|
mapToWidget: (e) => ({
|
|
201
201
|
uid: e.uid ?? "",
|
|
@@ -206,10 +206,10 @@ y({
|
|
|
206
206
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
207
207
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
208
208
|
...e.validator != null ? { validator: e.validator } : {},
|
|
209
|
-
props:
|
|
209
|
+
props: y(e)
|
|
210
210
|
})
|
|
211
211
|
});
|
|
212
|
-
|
|
212
|
+
h({
|
|
213
213
|
itemType: "DROPDOWN",
|
|
214
214
|
entryShape: "keyed",
|
|
215
215
|
sensibleDefaults: {
|
|
@@ -218,7 +218,7 @@ y({
|
|
|
218
218
|
suppressAutomaticPlaceholders: !1
|
|
219
219
|
},
|
|
220
220
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
221
|
-
apply: (e, t) =>
|
|
221
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
222
222
|
},
|
|
223
223
|
mapToWidget: (e) => ({
|
|
224
224
|
uid: e.uid ?? "",
|
|
@@ -229,16 +229,16 @@ y({
|
|
|
229
229
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
230
230
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
231
231
|
...e.validator != null ? { validator: e.validator } : {},
|
|
232
|
-
props:
|
|
232
|
+
props: y(e)
|
|
233
233
|
})
|
|
234
234
|
});
|
|
235
|
-
|
|
235
|
+
h({
|
|
236
236
|
itemType: "RADIOGROUP",
|
|
237
237
|
entryShape: "keyed",
|
|
238
238
|
sensibleDefaults: {
|
|
239
239
|
base: { suppressAutomaticLabels: !1 },
|
|
240
240
|
fields: ["suppressAutomaticLabels"],
|
|
241
|
-
apply: (e, t) =>
|
|
241
|
+
apply: (e, t) => v(e, t)
|
|
242
242
|
},
|
|
243
243
|
mapToWidget: (e) => ({
|
|
244
244
|
uid: e.uid ?? "",
|
|
@@ -249,16 +249,16 @@ y({
|
|
|
249
249
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
250
250
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
251
251
|
...e.validator != null ? { validator: e.validator } : {},
|
|
252
|
-
props:
|
|
252
|
+
props: y(e)
|
|
253
253
|
})
|
|
254
254
|
});
|
|
255
|
-
|
|
255
|
+
h({
|
|
256
256
|
itemType: "CHECKBOX",
|
|
257
257
|
entryShape: "keyed",
|
|
258
258
|
sensibleDefaults: {
|
|
259
259
|
base: { suppressAutomaticLabels: !1 },
|
|
260
260
|
fields: ["suppressAutomaticLabels"],
|
|
261
|
-
apply: (e, t) =>
|
|
261
|
+
apply: (e, t) => v(e, t)
|
|
262
262
|
},
|
|
263
263
|
mapToWidget: (e) => ({
|
|
264
264
|
uid: e.uid ?? "",
|
|
@@ -268,17 +268,17 @@ y({
|
|
|
268
268
|
...e.label != null ? { label: e.label } : {},
|
|
269
269
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
270
270
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
271
|
-
...e.validator != null ? { validator:
|
|
272
|
-
props:
|
|
271
|
+
...e.validator != null ? { validator: w(e.validator, "boolean") } : {},
|
|
272
|
+
props: y(e)
|
|
273
273
|
})
|
|
274
274
|
});
|
|
275
|
-
|
|
275
|
+
h({
|
|
276
276
|
itemType: "TEXTAREA",
|
|
277
277
|
entryShape: "keyed",
|
|
278
278
|
sensibleDefaults: {
|
|
279
279
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
280
280
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
281
|
-
apply: (e, t) =>
|
|
281
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
282
282
|
},
|
|
283
283
|
mapToWidget: (e) => ({
|
|
284
284
|
uid: e.uid ?? "",
|
|
@@ -288,17 +288,17 @@ y({
|
|
|
288
288
|
...e.label != null ? { label: e.label } : {},
|
|
289
289
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
290
290
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
291
|
-
...e.validator != null ? { validator:
|
|
292
|
-
props:
|
|
291
|
+
...e.validator != null ? { validator: w(e.validator, "string") } : {},
|
|
292
|
+
props: y(e)
|
|
293
293
|
})
|
|
294
294
|
});
|
|
295
|
-
|
|
295
|
+
h({
|
|
296
296
|
itemType: "PASSWORD",
|
|
297
297
|
entryShape: "keyed",
|
|
298
298
|
sensibleDefaults: {
|
|
299
299
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
300
300
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
301
|
-
apply: (e, t) =>
|
|
301
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
302
302
|
},
|
|
303
303
|
mapToWidget: (e) => ({
|
|
304
304
|
uid: e.uid ?? "",
|
|
@@ -308,17 +308,17 @@ y({
|
|
|
308
308
|
...e.label != null ? { label: e.label } : {},
|
|
309
309
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
310
310
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
311
|
-
...e.validator != null ? { validator:
|
|
312
|
-
props:
|
|
311
|
+
...e.validator != null ? { validator: w(e.validator, "string") } : {},
|
|
312
|
+
props: y(e)
|
|
313
313
|
})
|
|
314
314
|
});
|
|
315
|
-
|
|
315
|
+
h({
|
|
316
316
|
itemType: "CURRENCY",
|
|
317
317
|
entryShape: "keyed",
|
|
318
318
|
sensibleDefaults: {
|
|
319
319
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
320
320
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
321
|
-
apply: (e, t) =>
|
|
321
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
322
322
|
},
|
|
323
323
|
mapToWidget: (e) => ({
|
|
324
324
|
uid: e.uid ?? "",
|
|
@@ -328,17 +328,17 @@ y({
|
|
|
328
328
|
...e.label != null ? { label: e.label } : {},
|
|
329
329
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
330
330
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
331
|
-
...e.validator != null ? { validator:
|
|
332
|
-
props:
|
|
331
|
+
...e.validator != null ? { validator: w(e.validator, "number") } : {},
|
|
332
|
+
props: y(e)
|
|
333
333
|
})
|
|
334
334
|
});
|
|
335
|
-
|
|
335
|
+
h({
|
|
336
336
|
itemType: "MARKDOWN",
|
|
337
337
|
entryShape: "keyed",
|
|
338
338
|
sensibleDefaults: {
|
|
339
339
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
340
340
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
341
|
-
apply: (e, t) =>
|
|
341
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
342
342
|
},
|
|
343
343
|
mapToWidget: (e) => ({
|
|
344
344
|
uid: e.uid ?? "",
|
|
@@ -348,17 +348,17 @@ y({
|
|
|
348
348
|
...e.label != null ? { label: e.label } : {},
|
|
349
349
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
350
350
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
351
|
-
...e.validator != null ? { validator:
|
|
352
|
-
props:
|
|
351
|
+
...e.validator != null ? { validator: w(e.validator, "string") } : {},
|
|
352
|
+
props: y(e)
|
|
353
353
|
})
|
|
354
354
|
});
|
|
355
|
-
|
|
355
|
+
h({
|
|
356
356
|
itemType: "LIST",
|
|
357
357
|
entryShape: "keyed",
|
|
358
358
|
sensibleDefaults: {
|
|
359
359
|
base: { suppressAutomaticLabels: !1 },
|
|
360
360
|
fields: ["suppressAutomaticLabels"],
|
|
361
|
-
apply: (e, t) =>
|
|
361
|
+
apply: (e, t) => v(e, t)
|
|
362
362
|
},
|
|
363
363
|
mapToWidget: (e) => ({
|
|
364
364
|
uid: e.uid ?? "",
|
|
@@ -369,16 +369,16 @@ y({
|
|
|
369
369
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
370
370
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
371
371
|
...e.validator != null ? { validator: e.validator } : {},
|
|
372
|
-
props:
|
|
372
|
+
props: y(e)
|
|
373
373
|
})
|
|
374
374
|
});
|
|
375
|
-
|
|
375
|
+
h({
|
|
376
376
|
itemType: "CALENDAR",
|
|
377
377
|
entryShape: "bare",
|
|
378
378
|
sensibleDefaults: {
|
|
379
379
|
base: { suppressAutomaticLabels: !1 },
|
|
380
380
|
fields: ["suppressAutomaticLabels"],
|
|
381
|
-
apply: (e, t) =>
|
|
381
|
+
apply: (e, t) => v(e, t)
|
|
382
382
|
},
|
|
383
383
|
mapToWidget: (e) => ({
|
|
384
384
|
uid: e.uid ?? "",
|
|
@@ -388,17 +388,17 @@ y({
|
|
|
388
388
|
...e.label != null ? { label: e.label } : {},
|
|
389
389
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
390
390
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
391
|
-
...e.validator != null ? { validator:
|
|
392
|
-
props:
|
|
391
|
+
...e.validator != null ? { validator: w(e.validator, "string") } : {},
|
|
392
|
+
props: y(e)
|
|
393
393
|
})
|
|
394
394
|
});
|
|
395
|
-
|
|
395
|
+
h({
|
|
396
396
|
itemType: "DATE_INPUT",
|
|
397
397
|
entryShape: "keyed",
|
|
398
398
|
sensibleDefaults: {
|
|
399
399
|
base: { suppressAutomaticLabels: !1 },
|
|
400
400
|
fields: ["suppressAutomaticLabels"],
|
|
401
|
-
apply: (e, t) =>
|
|
401
|
+
apply: (e, t) => v(e, t)
|
|
402
402
|
},
|
|
403
403
|
mapToWidget: (e) => ({
|
|
404
404
|
uid: e.uid ?? "",
|
|
@@ -408,11 +408,11 @@ y({
|
|
|
408
408
|
...e.label != null ? { label: e.label } : {},
|
|
409
409
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
410
410
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
411
|
-
...e.validator != null ? { validator:
|
|
412
|
-
props:
|
|
411
|
+
...e.validator != null ? { validator: w(e.validator, "string") } : {},
|
|
412
|
+
props: y(e)
|
|
413
413
|
})
|
|
414
414
|
});
|
|
415
|
-
|
|
415
|
+
h({
|
|
416
416
|
itemType: "DATE_PICKER",
|
|
417
417
|
entryShape: "keyed",
|
|
418
418
|
sensibleDefaults: {
|
|
@@ -421,7 +421,7 @@ y({
|
|
|
421
421
|
suppressAutomaticPlaceholders: !1
|
|
422
422
|
},
|
|
423
423
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
424
|
-
apply: (e, t) =>
|
|
424
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
425
425
|
},
|
|
426
426
|
mapToWidget: (e) => ({
|
|
427
427
|
uid: e.uid ?? "",
|
|
@@ -431,17 +431,17 @@ y({
|
|
|
431
431
|
...e.label != null ? { label: e.label } : {},
|
|
432
432
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
433
433
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
434
|
-
...e.validator != null ? { validator:
|
|
435
|
-
props:
|
|
434
|
+
...e.validator != null ? { validator: w(e.validator, "string") } : {},
|
|
435
|
+
props: y(e)
|
|
436
436
|
})
|
|
437
437
|
});
|
|
438
|
-
|
|
438
|
+
h({
|
|
439
439
|
itemType: "RANGE_CALENDAR",
|
|
440
440
|
entryShape: "keyed",
|
|
441
441
|
sensibleDefaults: {
|
|
442
442
|
base: { suppressAutomaticLabels: !1 },
|
|
443
443
|
fields: ["suppressAutomaticLabels"],
|
|
444
|
-
apply: (e, t) =>
|
|
444
|
+
apply: (e, t) => v(e, t)
|
|
445
445
|
},
|
|
446
446
|
mapToWidget: (e) => ({
|
|
447
447
|
uid: e.uid ?? "",
|
|
@@ -451,17 +451,17 @@ y({
|
|
|
451
451
|
...e.label != null ? { label: e.label } : {},
|
|
452
452
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
453
453
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
454
|
-
...e.validator != null ? { validator:
|
|
455
|
-
props:
|
|
454
|
+
...e.validator != null ? { validator: w(e.validator, "array") } : {},
|
|
455
|
+
props: y(e)
|
|
456
456
|
})
|
|
457
457
|
});
|
|
458
|
-
|
|
458
|
+
h({
|
|
459
459
|
itemType: "RANGE_DATE_INPUT",
|
|
460
460
|
entryShape: "keyed",
|
|
461
461
|
sensibleDefaults: {
|
|
462
462
|
base: { suppressAutomaticLabels: !1 },
|
|
463
463
|
fields: ["suppressAutomaticLabels"],
|
|
464
|
-
apply: (e, t) =>
|
|
464
|
+
apply: (e, t) => v(e, t)
|
|
465
465
|
},
|
|
466
466
|
mapToWidget: (e) => ({
|
|
467
467
|
uid: e.uid ?? "",
|
|
@@ -471,11 +471,11 @@ y({
|
|
|
471
471
|
...e.label != null ? { label: e.label } : {},
|
|
472
472
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
473
473
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
474
|
-
...e.validator != null ? { validator:
|
|
475
|
-
props:
|
|
474
|
+
...e.validator != null ? { validator: w(e.validator, "array") } : {},
|
|
475
|
+
props: y(e)
|
|
476
476
|
})
|
|
477
477
|
});
|
|
478
|
-
|
|
478
|
+
h({
|
|
479
479
|
itemType: "RANGE_DATE_PICKER",
|
|
480
480
|
entryShape: "keyed",
|
|
481
481
|
sensibleDefaults: {
|
|
@@ -484,7 +484,7 @@ y({
|
|
|
484
484
|
suppressAutomaticPlaceholders: !1
|
|
485
485
|
},
|
|
486
486
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
487
|
-
apply: (e, t) =>
|
|
487
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
488
488
|
},
|
|
489
489
|
mapToWidget: (e) => ({
|
|
490
490
|
uid: e.uid ?? "",
|
|
@@ -494,15 +494,15 @@ y({
|
|
|
494
494
|
...e.label != null ? { label: e.label } : {},
|
|
495
495
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
496
496
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
497
|
-
...e.validator != null ? { validator:
|
|
498
|
-
props:
|
|
497
|
+
...e.validator != null ? { validator: w(e.validator, "array") } : {},
|
|
498
|
+
props: y(e)
|
|
499
499
|
})
|
|
500
500
|
});
|
|
501
|
-
function
|
|
501
|
+
function Mt(e) {
|
|
502
502
|
const t = {};
|
|
503
503
|
return e.addLabel != null && (t.addLabel = e.addLabel), e.removeLabel != null && (t.removeLabel = e.removeLabel), e.limit != null && (t.limit = e.limit), e.title != null && (t.title = e.title), e.addButtonIcon != null && (t.addButtonIcon = e.addButtonIcon), e.removeButtonIcon != null && (t.removeButtonIcon = e.removeButtonIcon), t;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function Nt(e) {
|
|
506
506
|
return {
|
|
507
507
|
uid: e.uid ?? "",
|
|
508
508
|
kind: "input",
|
|
@@ -511,25 +511,25 @@ function Ut(e) {
|
|
|
511
511
|
...e.label != null ? { label: e.label } : {},
|
|
512
512
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
513
513
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
514
|
-
...e.validator != null ? { validator:
|
|
514
|
+
...e.validator != null ? { validator: w(e.validator, "array") } : {},
|
|
515
515
|
props: {
|
|
516
|
-
...
|
|
516
|
+
...Mt(e),
|
|
517
517
|
template: { kind: "layout", type: "flex", children: [], props: { direction: "column" } }
|
|
518
518
|
}
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function ae(e, t) {
|
|
522
522
|
for (const n of e) {
|
|
523
523
|
if (typeof n == "function") continue;
|
|
524
524
|
const r = n;
|
|
525
|
-
typeof r.path == "string" && r.path && (r.path = t + r.path), "children" in r && Array.isArray(r.children) &&
|
|
525
|
+
typeof r.path == "string" && r.path && !r.path.startsWith(t) && (r.path = t + r.path), "children" in r && Array.isArray(r.children) && ae(r.children, t);
|
|
526
526
|
const o = r.props;
|
|
527
|
-
o?.template?.children && Array.isArray(o.template.children) &&
|
|
527
|
+
o?.template?.children && Array.isArray(o.template.children) && ae(o.template.children, t);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function Rt(e, t) {
|
|
531
531
|
const n = t.walkChildren(t.children ?? []), r = e.kind === "static" ? e.def.path ?? "" : e.fn({})?.path ?? "";
|
|
532
|
-
r &&
|
|
532
|
+
r && ae(n, r + ".items.");
|
|
533
533
|
const o = {
|
|
534
534
|
kind: "layout",
|
|
535
535
|
type: "flex",
|
|
@@ -553,32 +553,32 @@ function Vt(e, t) {
|
|
|
553
553
|
};
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function xt(e) {
|
|
557
557
|
return {
|
|
558
558
|
baseDef: e.def,
|
|
559
559
|
path: e.key,
|
|
560
560
|
children: e.children
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Ft(e) {
|
|
564
564
|
return e.children;
|
|
565
565
|
}
|
|
566
|
-
const
|
|
567
|
-
parseEntry:
|
|
566
|
+
const Wt = {
|
|
567
|
+
parseEntry: xt,
|
|
568
568
|
rollUpSensibleDefaults: () => ({}),
|
|
569
569
|
applySensibleDefaults: (e) => e,
|
|
570
|
-
mapToWidget:
|
|
571
|
-
buildCustomWidget:
|
|
572
|
-
getChildren:
|
|
570
|
+
mapToWidget: Nt,
|
|
571
|
+
buildCustomWidget: Rt,
|
|
572
|
+
getChildren: Ft
|
|
573
573
|
};
|
|
574
|
-
|
|
575
|
-
const
|
|
574
|
+
Xe("REPEATER", Wt);
|
|
575
|
+
const Je = {
|
|
576
576
|
onLoad: "load",
|
|
577
577
|
onChange: "change",
|
|
578
578
|
onFilter: "filter",
|
|
579
579
|
onBlur: "blur"
|
|
580
|
-
},
|
|
581
|
-
class
|
|
580
|
+
}, Ut = Object.keys(Je);
|
|
581
|
+
class jt {
|
|
582
582
|
// ── Action-specific: onClick ───────────────────────────────────
|
|
583
583
|
extractOnClickFromMergeResult(t, n, r) {
|
|
584
584
|
if (t.kind === "dynamic") {
|
|
@@ -614,10 +614,10 @@ class Kt {
|
|
|
614
614
|
const o = { ...t.on || {} };
|
|
615
615
|
let s = !1;
|
|
616
616
|
const i = { ...t };
|
|
617
|
-
for (const a of
|
|
617
|
+
for (const a of Ut) {
|
|
618
618
|
const u = t[a];
|
|
619
619
|
if (u == null) continue;
|
|
620
|
-
const c =
|
|
620
|
+
const c = Je[a];
|
|
621
621
|
if (typeof u == "function") {
|
|
622
622
|
const p = r.next();
|
|
623
623
|
n.set(p, u), o[c] = p, s = !0;
|
|
@@ -627,8 +627,8 @@ class Kt {
|
|
|
627
627
|
return s && (i.on = o), i;
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
const
|
|
631
|
-
function
|
|
630
|
+
const me = new jt();
|
|
631
|
+
function Vt(e) {
|
|
632
632
|
const {
|
|
633
633
|
uid: t,
|
|
634
634
|
label: n,
|
|
@@ -640,9 +640,9 @@ function qt(e) {
|
|
|
640
640
|
type: u,
|
|
641
641
|
tags: c,
|
|
642
642
|
size: p,
|
|
643
|
-
include:
|
|
644
|
-
exclude:
|
|
645
|
-
states:
|
|
643
|
+
include: m,
|
|
644
|
+
exclude: f,
|
|
645
|
+
states: z,
|
|
646
646
|
...P
|
|
647
647
|
} = e;
|
|
648
648
|
return {
|
|
@@ -656,17 +656,17 @@ function qt(e) {
|
|
|
656
656
|
props: P
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
|
-
|
|
659
|
+
h({
|
|
660
660
|
itemType: "ACTIONS",
|
|
661
661
|
entryShape: "bare",
|
|
662
|
-
mapToWidget:
|
|
663
|
-
afterMerge: (e, t) =>
|
|
662
|
+
mapToWidget: Vt,
|
|
663
|
+
afterMerge: (e, t) => me.extractOnClickFromMergeResult(
|
|
664
664
|
e,
|
|
665
665
|
t.eventRegistry,
|
|
666
666
|
t.eventIdGenerator
|
|
667
667
|
)
|
|
668
668
|
});
|
|
669
|
-
function
|
|
669
|
+
function Bt(e) {
|
|
670
670
|
const {
|
|
671
671
|
uid: t,
|
|
672
672
|
widgetName: n,
|
|
@@ -688,7 +688,7 @@ function Xt(e) {
|
|
|
688
688
|
children: []
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function Yt(e, t) {
|
|
692
692
|
const n = t.walkChildren(t.children ?? []);
|
|
693
693
|
if (e.kind === "static")
|
|
694
694
|
return { ...t.mapStaticDef(e.def, "LAYOUTS"), children: n };
|
|
@@ -698,17 +698,26 @@ function Ht(e, t) {
|
|
|
698
698
|
return { ...t.mapStaticDef(s, "LAYOUTS"), children: n };
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Gt(e) {
|
|
702
702
|
return e.children;
|
|
703
703
|
}
|
|
704
|
-
|
|
704
|
+
h({
|
|
705
705
|
itemType: "LAYOUTS",
|
|
706
706
|
entryShape: "compound",
|
|
707
|
-
mapToWidget:
|
|
708
|
-
buildCustomWidget:
|
|
709
|
-
getChildren:
|
|
707
|
+
mapToWidget: Bt,
|
|
708
|
+
buildCustomWidget: Yt,
|
|
709
|
+
getChildren: Gt
|
|
710
710
|
});
|
|
711
|
-
function
|
|
711
|
+
function we(e) {
|
|
712
|
+
return {
|
|
713
|
+
errors: void 0,
|
|
714
|
+
touched: void 0,
|
|
715
|
+
translate: void 0,
|
|
716
|
+
...e ?? {},
|
|
717
|
+
$form: e?.$form ?? {}
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function Kt(e) {
|
|
712
721
|
return {
|
|
713
722
|
uid: "",
|
|
714
723
|
kind: "display",
|
|
@@ -716,7 +725,7 @@ function en(e) {
|
|
|
716
725
|
props: { render: e.render }
|
|
717
726
|
};
|
|
718
727
|
}
|
|
719
|
-
function
|
|
728
|
+
function qt(e, t) {
|
|
720
729
|
if (e.kind === "static") {
|
|
721
730
|
const r = e.def;
|
|
722
731
|
return ((o) => ({
|
|
@@ -725,7 +734,7 @@ function tn(e, t) {
|
|
|
725
734
|
type: "renderer",
|
|
726
735
|
...r.include != null ? { include: r.include } : {},
|
|
727
736
|
...r.exclude != null ? { exclude: r.exclude } : {},
|
|
728
|
-
props: { render: r.render(o
|
|
737
|
+
props: { render: r.render(we(o)) }
|
|
729
738
|
}));
|
|
730
739
|
}
|
|
731
740
|
const n = e.fn;
|
|
@@ -737,17 +746,17 @@ function tn(e, t) {
|
|
|
737
746
|
type: "renderer",
|
|
738
747
|
...o.include != null ? { include: o.include } : {},
|
|
739
748
|
...o.exclude != null ? { exclude: o.exclude } : {},
|
|
740
|
-
props: { render: o.render(r
|
|
749
|
+
props: { render: o.render(we(r)) }
|
|
741
750
|
};
|
|
742
751
|
});
|
|
743
752
|
}
|
|
744
|
-
|
|
753
|
+
h({
|
|
745
754
|
itemType: "DISPLAYS",
|
|
746
755
|
entryShape: "bare",
|
|
747
|
-
mapToWidget:
|
|
748
|
-
buildCustomWidget:
|
|
756
|
+
mapToWidget: Kt,
|
|
757
|
+
buildCustomWidget: qt
|
|
749
758
|
});
|
|
750
|
-
|
|
759
|
+
h({
|
|
751
760
|
itemType: "ALERTS",
|
|
752
761
|
entryShape: "bare",
|
|
753
762
|
mapToWidget: (e) => ({
|
|
@@ -760,7 +769,7 @@ y({
|
|
|
760
769
|
}
|
|
761
770
|
})
|
|
762
771
|
});
|
|
763
|
-
|
|
772
|
+
h({
|
|
764
773
|
itemType: "MARKDOWN_TEXTS",
|
|
765
774
|
entryShape: "bare",
|
|
766
775
|
mapToWidget: (e) => ({
|
|
@@ -772,7 +781,7 @@ y({
|
|
|
772
781
|
}
|
|
773
782
|
})
|
|
774
783
|
});
|
|
775
|
-
function
|
|
784
|
+
function Xt(e) {
|
|
776
785
|
return {
|
|
777
786
|
uid: e.uid ?? "",
|
|
778
787
|
kind: "layout",
|
|
@@ -785,7 +794,7 @@ function nn(e) {
|
|
|
785
794
|
children: []
|
|
786
795
|
};
|
|
787
796
|
}
|
|
788
|
-
function
|
|
797
|
+
function Ht(e, t) {
|
|
789
798
|
const n = t.walkChildren(t.children ?? []);
|
|
790
799
|
if (e.kind === "static")
|
|
791
800
|
return { ...t.mapStaticDef(e.def, "TABS"), children: n };
|
|
@@ -795,17 +804,17 @@ function rn(e, t) {
|
|
|
795
804
|
return { ...t.mapStaticDef(s, "TABS"), children: n };
|
|
796
805
|
});
|
|
797
806
|
}
|
|
798
|
-
function
|
|
807
|
+
function Jt(e) {
|
|
799
808
|
return e.children;
|
|
800
809
|
}
|
|
801
|
-
|
|
810
|
+
h({
|
|
802
811
|
itemType: "TABS",
|
|
803
812
|
entryShape: "compound",
|
|
804
|
-
mapToWidget:
|
|
805
|
-
buildCustomWidget:
|
|
806
|
-
getChildren:
|
|
813
|
+
mapToWidget: Xt,
|
|
814
|
+
buildCustomWidget: Ht,
|
|
815
|
+
getChildren: Jt
|
|
807
816
|
});
|
|
808
|
-
function
|
|
817
|
+
function Qt(e) {
|
|
809
818
|
return {
|
|
810
819
|
uid: e.uid ?? "",
|
|
811
820
|
kind: "layout",
|
|
@@ -819,7 +828,7 @@ function sn(e) {
|
|
|
819
828
|
children: []
|
|
820
829
|
};
|
|
821
830
|
}
|
|
822
|
-
function
|
|
831
|
+
function en(e, t) {
|
|
823
832
|
const n = t.walkChildren(t.children ?? []);
|
|
824
833
|
if (e.kind === "static")
|
|
825
834
|
return { ...t.mapStaticDef(e.def, "ACCORDION"), children: n };
|
|
@@ -829,17 +838,17 @@ function an(e, t) {
|
|
|
829
838
|
return { ...t.mapStaticDef(s, "ACCORDION"), children: n };
|
|
830
839
|
});
|
|
831
840
|
}
|
|
832
|
-
function
|
|
841
|
+
function tn(e) {
|
|
833
842
|
return e.children;
|
|
834
843
|
}
|
|
835
|
-
|
|
844
|
+
h({
|
|
836
845
|
itemType: "ACCORDION",
|
|
837
846
|
entryShape: "compound",
|
|
838
|
-
mapToWidget:
|
|
839
|
-
buildCustomWidget:
|
|
840
|
-
getChildren:
|
|
847
|
+
mapToWidget: Qt,
|
|
848
|
+
buildCustomWidget: en,
|
|
849
|
+
getChildren: tn
|
|
841
850
|
});
|
|
842
|
-
|
|
851
|
+
h({
|
|
843
852
|
itemType: "CUSTOM_INPUT",
|
|
844
853
|
entryShape: "keyed",
|
|
845
854
|
sensibleDefaults: {
|
|
@@ -847,7 +856,7 @@ y({
|
|
|
847
856
|
suppressAutomaticLabels: !1
|
|
848
857
|
},
|
|
849
858
|
fields: ["suppressAutomaticLabels"],
|
|
850
|
-
apply: (e, t) =>
|
|
859
|
+
apply: (e, t) => v(e, t)
|
|
851
860
|
},
|
|
852
861
|
mapToWidget: (e) => ({
|
|
853
862
|
uid: e.uid ?? "",
|
|
@@ -862,7 +871,7 @@ y({
|
|
|
862
871
|
props: e.props ?? {}
|
|
863
872
|
})
|
|
864
873
|
});
|
|
865
|
-
|
|
874
|
+
h({
|
|
866
875
|
itemType: "CUSTOM_ACTION",
|
|
867
876
|
entryShape: "bare",
|
|
868
877
|
mapToWidget: (e) => {
|
|
@@ -877,9 +886,9 @@ y({
|
|
|
877
886
|
tags: u,
|
|
878
887
|
size: c,
|
|
879
888
|
include: p,
|
|
880
|
-
exclude:
|
|
881
|
-
states:
|
|
882
|
-
props:
|
|
889
|
+
exclude: m,
|
|
890
|
+
states: f,
|
|
891
|
+
props: z,
|
|
883
892
|
...P
|
|
884
893
|
} = e;
|
|
885
894
|
return {
|
|
@@ -889,16 +898,16 @@ y({
|
|
|
889
898
|
label: n,
|
|
890
899
|
disabled: r,
|
|
891
900
|
...o != null ? { on: o } : {},
|
|
892
|
-
props: { ...
|
|
901
|
+
props: { ...z, ...P }
|
|
893
902
|
};
|
|
894
903
|
},
|
|
895
|
-
afterMerge: (e, t) =>
|
|
904
|
+
afterMerge: (e, t) => me.extractOnClickFromMergeResult(
|
|
896
905
|
e,
|
|
897
906
|
t.eventRegistry,
|
|
898
907
|
t.eventIdGenerator
|
|
899
908
|
)
|
|
900
909
|
});
|
|
901
|
-
|
|
910
|
+
h({
|
|
902
911
|
itemType: "CUSTOM_DISPLAY",
|
|
903
912
|
entryShape: "bare",
|
|
904
913
|
mapToWidget: (e) => ({
|
|
@@ -908,7 +917,7 @@ y({
|
|
|
908
917
|
props: e.props ?? {}
|
|
909
918
|
})
|
|
910
919
|
});
|
|
911
|
-
function
|
|
920
|
+
function nn(e) {
|
|
912
921
|
return {
|
|
913
922
|
uid: e.uid ?? "",
|
|
914
923
|
kind: "layout",
|
|
@@ -917,7 +926,7 @@ function cn(e) {
|
|
|
917
926
|
children: []
|
|
918
927
|
};
|
|
919
928
|
}
|
|
920
|
-
function
|
|
929
|
+
function rn(e, t) {
|
|
921
930
|
const n = t.walkChildren(t.children ?? []);
|
|
922
931
|
if (e.kind === "static")
|
|
923
932
|
return { ...t.mapStaticDef(e.def, "CUSTOM_LAYOUT"), children: n };
|
|
@@ -927,23 +936,23 @@ function ln(e, t) {
|
|
|
927
936
|
return { ...t.mapStaticDef(s, "CUSTOM_LAYOUT"), children: n };
|
|
928
937
|
});
|
|
929
938
|
}
|
|
930
|
-
function
|
|
939
|
+
function on(e) {
|
|
931
940
|
return e.children;
|
|
932
941
|
}
|
|
933
|
-
|
|
942
|
+
h({
|
|
934
943
|
itemType: "CUSTOM_LAYOUT",
|
|
935
944
|
entryShape: "compound",
|
|
936
|
-
mapToWidget:
|
|
937
|
-
buildCustomWidget:
|
|
938
|
-
getChildren:
|
|
945
|
+
mapToWidget: nn,
|
|
946
|
+
buildCustomWidget: rn,
|
|
947
|
+
getChildren: on
|
|
939
948
|
});
|
|
940
|
-
|
|
949
|
+
h({
|
|
941
950
|
itemType: "TAGS",
|
|
942
951
|
entryShape: "keyed",
|
|
943
952
|
sensibleDefaults: {
|
|
944
953
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
945
954
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
946
|
-
apply: (e, t) =>
|
|
955
|
+
apply: (e, t) => Z(v(e, t), t)
|
|
947
956
|
},
|
|
948
957
|
mapToWidget: (e) => ({
|
|
949
958
|
uid: e.uid ?? "",
|
|
@@ -953,11 +962,11 @@ y({
|
|
|
953
962
|
...e.label != null ? { label: e.label } : {},
|
|
954
963
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
955
964
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
956
|
-
...e.validator != null ? { validator:
|
|
957
|
-
props:
|
|
965
|
+
...e.validator != null ? { validator: w(e.validator, "array") } : {},
|
|
966
|
+
props: y(e)
|
|
958
967
|
})
|
|
959
968
|
});
|
|
960
|
-
const
|
|
969
|
+
const Qe = {
|
|
961
970
|
INPUTS: /* @__PURE__ */ new Set([
|
|
962
971
|
"INPUTS",
|
|
963
972
|
"TEXTAREA",
|
|
@@ -983,11 +992,11 @@ const nt = {
|
|
|
983
992
|
DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "MARKDOWN_TEXTS", "CUSTOM_DISPLAY"]),
|
|
984
993
|
LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
|
|
985
994
|
};
|
|
986
|
-
function
|
|
987
|
-
const n =
|
|
995
|
+
function sn(e, t) {
|
|
996
|
+
const n = Qe[e];
|
|
988
997
|
return n ? n.has(t) : e === t;
|
|
989
998
|
}
|
|
990
|
-
class
|
|
999
|
+
class an {
|
|
991
1000
|
resolve(t, n) {
|
|
992
1001
|
const r = [];
|
|
993
1002
|
for (const s of n)
|
|
@@ -1004,7 +1013,7 @@ class mn {
|
|
|
1004
1013
|
this.collectFromLeaf(o, n, r);
|
|
1005
1014
|
}
|
|
1006
1015
|
collectFromLeaf(t, n, r) {
|
|
1007
|
-
|
|
1016
|
+
sn(t.selectorType, n.itemType ?? "") && t.matcher(n) && r.push(t);
|
|
1008
1017
|
}
|
|
1009
1018
|
rollUpSensibleDefaults(t) {
|
|
1010
1019
|
const n = /* @__PURE__ */ new Map(), r = (s, i) => {
|
|
@@ -1012,7 +1021,7 @@ class mn {
|
|
|
1012
1021
|
a.push(i), n.set(s, a);
|
|
1013
1022
|
};
|
|
1014
1023
|
for (const s of t) {
|
|
1015
|
-
const i =
|
|
1024
|
+
const i = Qe[s.selectorType];
|
|
1016
1025
|
if (i)
|
|
1017
1026
|
for (const a of i) r(a, s);
|
|
1018
1027
|
else
|
|
@@ -1020,12 +1029,12 @@ class mn {
|
|
|
1020
1029
|
}
|
|
1021
1030
|
const o = {};
|
|
1022
1031
|
for (const [s, i] of n)
|
|
1023
|
-
|
|
1032
|
+
He(s) && (o[s] = q(s).rollUpSensibleDefaults(i));
|
|
1024
1033
|
return o;
|
|
1025
1034
|
}
|
|
1026
1035
|
}
|
|
1027
|
-
const
|
|
1028
|
-
class
|
|
1036
|
+
const un = new an();
|
|
1037
|
+
class cn {
|
|
1029
1038
|
/**
|
|
1030
1039
|
* Deep merges two objects, with right taking precedence over left when properties conflict.
|
|
1031
1040
|
* Arrays are replaced, not merged.
|
|
@@ -1044,8 +1053,8 @@ class hn {
|
|
|
1044
1053
|
return r;
|
|
1045
1054
|
}
|
|
1046
1055
|
}
|
|
1047
|
-
const
|
|
1048
|
-
class
|
|
1056
|
+
const ln = new cn();
|
|
1057
|
+
class pn {
|
|
1049
1058
|
constructor(t) {
|
|
1050
1059
|
this.objectUtils = t;
|
|
1051
1060
|
}
|
|
@@ -1096,9 +1105,9 @@ class gn {
|
|
|
1096
1105
|
}
|
|
1097
1106
|
// ── Apply sensible defaults via registry ──
|
|
1098
1107
|
applySensibleDefaults(t, n, r) {
|
|
1099
|
-
if (!
|
|
1108
|
+
if (!He(n)) return t;
|
|
1100
1109
|
const o = r.sensibleDefaults[n] ?? {};
|
|
1101
|
-
return
|
|
1110
|
+
return q(n).applySensibleDefaults(t, o);
|
|
1102
1111
|
}
|
|
1103
1112
|
// ── Create promoted FunctionWidget ──
|
|
1104
1113
|
createPromotedFunction(t, n, r, o, s) {
|
|
@@ -1126,8 +1135,8 @@ class gn {
|
|
|
1126
1135
|
};
|
|
1127
1136
|
}
|
|
1128
1137
|
}
|
|
1129
|
-
const
|
|
1130
|
-
class
|
|
1138
|
+
const dn = new pn(ln);
|
|
1139
|
+
class mn {
|
|
1131
1140
|
mapToWidget(t, n) {
|
|
1132
1141
|
if (t.kind === "dynamic") {
|
|
1133
1142
|
const r = t.fn;
|
|
@@ -1139,7 +1148,7 @@ class _n {
|
|
|
1139
1148
|
return this.mapStaticDef(t.def, n);
|
|
1140
1149
|
}
|
|
1141
1150
|
mapStaticDef(t, n) {
|
|
1142
|
-
const r =
|
|
1151
|
+
const r = q(n).mapToWidget(t);
|
|
1143
1152
|
return this.applyBaseWidgetFields(r, t);
|
|
1144
1153
|
}
|
|
1145
1154
|
/**
|
|
@@ -1150,8 +1159,8 @@ class _n {
|
|
|
1150
1159
|
return n.size != null && (t.size = n.size), n.defaultValue != null && t.kind === "input" && (t.defaultValue = n.defaultValue), n.on != null && (t.on = n.on), n.include != null && (t.include = n.include), n.exclude != null && (t.exclude = n.exclude), t;
|
|
1151
1160
|
}
|
|
1152
1161
|
}
|
|
1153
|
-
const
|
|
1154
|
-
class
|
|
1162
|
+
const hn = new mn();
|
|
1163
|
+
class fn {
|
|
1155
1164
|
/**
|
|
1156
1165
|
* Ensures the output is always a uniform GslSelector[] of aggregated selectors.
|
|
1157
1166
|
*
|
|
@@ -1176,18 +1185,18 @@ class wn {
|
|
|
1176
1185
|
};
|
|
1177
1186
|
}
|
|
1178
1187
|
}
|
|
1179
|
-
const
|
|
1188
|
+
const bn = new fn(), gn = {
|
|
1180
1189
|
input: /* @__PURE__ */ new Set(["disabled", "readonly", "label", "validator", "size"]),
|
|
1181
1190
|
action: /* @__PURE__ */ new Set(["disabled", "label", "size"]),
|
|
1182
1191
|
layout: /* @__PURE__ */ new Set(["size"]),
|
|
1183
1192
|
display: /* @__PURE__ */ new Set([])
|
|
1184
|
-
},
|
|
1193
|
+
}, Te = {
|
|
1185
1194
|
onChange: "change",
|
|
1186
1195
|
onLoad: "load",
|
|
1187
1196
|
onFilter: "filter",
|
|
1188
1197
|
onClick: "click"
|
|
1189
1198
|
};
|
|
1190
|
-
class
|
|
1199
|
+
class yn {
|
|
1191
1200
|
/**
|
|
1192
1201
|
* Extracts `states` from a merge result, combining with state-targeted
|
|
1193
1202
|
* GSL leaf selectors from `_gslStates`.
|
|
@@ -1207,8 +1216,8 @@ class Tn {
|
|
|
1207
1216
|
const a = t.fn;
|
|
1208
1217
|
return {
|
|
1209
1218
|
cleanedResult: { kind: "dynamic", fn: (c) => {
|
|
1210
|
-
const p = a(c), { states:
|
|
1211
|
-
return
|
|
1219
|
+
const p = a(c), { states: m, ...f } = p;
|
|
1220
|
+
return f;
|
|
1212
1221
|
} },
|
|
1213
1222
|
stateData: { stateOverrides: r }
|
|
1214
1223
|
};
|
|
@@ -1237,11 +1246,11 @@ class Tn {
|
|
|
1237
1246
|
const { stateOverrides: s } = n;
|
|
1238
1247
|
if (Object.keys(s).length === 0)
|
|
1239
1248
|
return t;
|
|
1240
|
-
const i = { ...t }, a = t.kind, u =
|
|
1249
|
+
const i = { ...t }, a = t.kind, u = gn[a] || /* @__PURE__ */ new Set();
|
|
1241
1250
|
t.props && (i.props = { ...t.props }), t.on && (i.on = { ...t.on });
|
|
1242
1251
|
for (const [c, p] of Object.entries(s))
|
|
1243
|
-
for (const [
|
|
1244
|
-
|
|
1252
|
+
for (const [m, f] of Object.entries(p))
|
|
1253
|
+
m === "visible" ? this.applyVisibility(i, c, f) : Te[m] ? this.applyStateEvent(i, c, m, f, r, o) : u.has(m) ? i[`${m}.${c}`] = f : (i.props || (i.props = {}), i.props[`${m}.${c}`] = f);
|
|
1245
1254
|
return i;
|
|
1246
1255
|
}
|
|
1247
1256
|
hasStateData(t) {
|
|
@@ -1259,24 +1268,24 @@ class Tn {
|
|
|
1259
1268
|
}
|
|
1260
1269
|
// ── State-suffixed event helpers ──
|
|
1261
1270
|
applyStateEvent(t, n, r, o, s, i) {
|
|
1262
|
-
const a =
|
|
1271
|
+
const a = Te[r];
|
|
1263
1272
|
if (t.on || (t.on = {}), typeof o == "function") {
|
|
1264
1273
|
const u = i.next();
|
|
1265
1274
|
s.set(u, o), t.on[`${a}.${n}`] = u;
|
|
1266
1275
|
} else typeof o == "string" && (t.on[`${a}.${n}`] = o);
|
|
1267
1276
|
}
|
|
1268
1277
|
}
|
|
1269
|
-
const
|
|
1270
|
-
function
|
|
1278
|
+
const _n = new yn();
|
|
1279
|
+
function vn() {
|
|
1271
1280
|
let e = 0;
|
|
1272
1281
|
return { next: () => `event_${e++}` };
|
|
1273
1282
|
}
|
|
1274
|
-
class
|
|
1283
|
+
class kn {
|
|
1275
1284
|
constructor(t, n, r, o, s) {
|
|
1276
1285
|
this.resolver = t, this.merger = n, this.mapper = r, this.eventWiring = o, this.stateExpansion = s;
|
|
1277
1286
|
}
|
|
1278
1287
|
walkAndMap(t, n, r) {
|
|
1279
|
-
const o = /* @__PURE__ */ new Map(), s =
|
|
1288
|
+
const o = /* @__PURE__ */ new Map(), s = vn(), i = { value: 0 }, a = /* @__PURE__ */ new Set();
|
|
1280
1289
|
return { widgets: this.walkItems(
|
|
1281
1290
|
t,
|
|
1282
1291
|
n,
|
|
@@ -1305,28 +1314,28 @@ class On {
|
|
|
1305
1314
|
});
|
|
1306
1315
|
}
|
|
1307
1316
|
processItem(t, n, r, o, s, i, a, u, c) {
|
|
1308
|
-
const p = n,
|
|
1309
|
-
leafSelectors:
|
|
1310
|
-
sensibleDefaults:
|
|
1317
|
+
const p = n, m = q(n), f = m.parseEntry(t), z = this.buildBaseDef(f), P = this.buildDecoratorForMatching(z, p, r), V = this.resolver.resolve(P, o), _e = V.leafSelectors.filter((T) => T.targetState != null), ve = {
|
|
1318
|
+
leafSelectors: V.leafSelectors.filter((T) => T.targetState == null),
|
|
1319
|
+
sensibleDefaults: V.sensibleDefaults
|
|
1311
1320
|
};
|
|
1312
|
-
let
|
|
1313
|
-
|
|
1321
|
+
let C = this.merger.merge(z, p, ve);
|
|
1322
|
+
m.afterMerge && (C = m.afterMerge(C, {
|
|
1314
1323
|
eventRegistry: s,
|
|
1315
1324
|
formConfig: i,
|
|
1316
1325
|
eventIdGenerator: a
|
|
1317
|
-
})),
|
|
1318
|
-
|
|
1326
|
+
})), C = this.eventWiring.wireInputLayoutEvents(
|
|
1327
|
+
C,
|
|
1319
1328
|
s,
|
|
1320
1329
|
a
|
|
1321
1330
|
);
|
|
1322
|
-
const { cleanedResult:
|
|
1323
|
-
|
|
1324
|
-
|
|
1331
|
+
const { cleanedResult: ke, stateData: se } = this.stateExpansion.extractFromMergeResult(
|
|
1332
|
+
C,
|
|
1333
|
+
_e
|
|
1325
1334
|
);
|
|
1326
|
-
let
|
|
1327
|
-
if (
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1335
|
+
let O;
|
|
1336
|
+
if (m.buildCustomWidget) {
|
|
1337
|
+
const T = this.buildCustomWidgetContext(
|
|
1338
|
+
f.children,
|
|
1330
1339
|
o,
|
|
1331
1340
|
s,
|
|
1332
1341
|
i,
|
|
@@ -1334,33 +1343,33 @@ class On {
|
|
|
1334
1343
|
u,
|
|
1335
1344
|
c
|
|
1336
1345
|
);
|
|
1337
|
-
|
|
1346
|
+
O = this.buildCustomWidget(m, ke, T);
|
|
1338
1347
|
} else
|
|
1339
|
-
|
|
1340
|
-
if (typeof
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1343
|
-
}
|
|
1344
|
-
if (this.stateExpansion.hasStateData(
|
|
1345
|
-
if (typeof
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1348
|
-
const
|
|
1348
|
+
O = this.mapper.mapToWidget(ke, p);
|
|
1349
|
+
if (typeof O != "function") {
|
|
1350
|
+
const T = O;
|
|
1351
|
+
T.uid || (T.path && !c.has(T.path) ? (T.uid = T.path, c.add(T.path)) : T.uid = `dx_${u.value++}`);
|
|
1352
|
+
}
|
|
1353
|
+
if (this.stateExpansion.hasStateData(se))
|
|
1354
|
+
if (typeof O == "function") {
|
|
1355
|
+
const T = O;
|
|
1356
|
+
O = ((wt) => {
|
|
1357
|
+
const Tt = T(wt);
|
|
1349
1358
|
return this.stateExpansion.applyToWidget(
|
|
1350
|
-
|
|
1351
|
-
|
|
1359
|
+
Tt,
|
|
1360
|
+
se,
|
|
1352
1361
|
s,
|
|
1353
1362
|
a
|
|
1354
1363
|
);
|
|
1355
1364
|
});
|
|
1356
1365
|
} else
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1366
|
+
O = this.stateExpansion.applyToWidget(
|
|
1367
|
+
O,
|
|
1368
|
+
se,
|
|
1360
1369
|
s,
|
|
1361
1370
|
a
|
|
1362
1371
|
);
|
|
1363
|
-
return
|
|
1372
|
+
return O;
|
|
1364
1373
|
}
|
|
1365
1374
|
buildCustomWidgetContext(t, n, r, o, s, i, a) {
|
|
1366
1375
|
return {
|
|
@@ -1398,7 +1407,7 @@ class On {
|
|
|
1398
1407
|
return { itemType: n, tags: o, uid: s, type: i };
|
|
1399
1408
|
}
|
|
1400
1409
|
}
|
|
1401
|
-
class
|
|
1410
|
+
class wn {
|
|
1402
1411
|
constructor(t, n) {
|
|
1403
1412
|
this.selectorNormalizer = t, this.walker = n;
|
|
1404
1413
|
}
|
|
@@ -1426,7 +1435,7 @@ class En {
|
|
|
1426
1435
|
*/
|
|
1427
1436
|
prepareForm(t, n, r) {
|
|
1428
1437
|
const s = (Array.isArray(t) ? [...t] : [t]).map(
|
|
1429
|
-
(u) => typeof u == "function" ?
|
|
1438
|
+
(u) => typeof u == "function" ? Zt(u) : u
|
|
1430
1439
|
), i = this.selectorNormalizer.normalizeSelectors(n), a = {
|
|
1431
1440
|
...this.selectorNormalizer.extractFormConfig(),
|
|
1432
1441
|
...r
|
|
@@ -1437,7 +1446,7 @@ class En {
|
|
|
1437
1446
|
children: s
|
|
1438
1447
|
};
|
|
1439
1448
|
return {
|
|
1440
|
-
defs: [{ type: "ITEMS", itemType:
|
|
1449
|
+
defs: [{ type: "ITEMS", itemType: qe.LAYOUTS, items: [u], tags: [] }],
|
|
1441
1450
|
gslSelectors: i,
|
|
1442
1451
|
formConfig: a
|
|
1443
1452
|
};
|
|
@@ -1465,11 +1474,11 @@ class En {
|
|
|
1465
1474
|
if (i) {
|
|
1466
1475
|
const a = (c) => {
|
|
1467
1476
|
if (c && typeof c == "object" && "path" in c && !("type" in c)) {
|
|
1468
|
-
const { path: p, ...
|
|
1469
|
-
for (const [
|
|
1477
|
+
const { path: p, ...m } = c;
|
|
1478
|
+
for (const [f, z] of Object.entries(m))
|
|
1470
1479
|
s.callback({
|
|
1471
1480
|
type: "OVERRIDE_WIDGET_PROP",
|
|
1472
|
-
payload: { path: p, prop:
|
|
1481
|
+
payload: { path: p, prop: f, value: z }
|
|
1473
1482
|
});
|
|
1474
1483
|
} else
|
|
1475
1484
|
s.callback(c);
|
|
@@ -1483,37 +1492,37 @@ class En {
|
|
|
1483
1492
|
}), r.dependencies && (o.dependencies = r.dependencies), r.widgetLoaders && (o.widgetLoaders = r.widgetLoaders), r.validateOn && (o.validateOn = r.validateOn), r.itemRenderers && (o.itemRenderers = r.itemRenderers), o;
|
|
1484
1493
|
}
|
|
1485
1494
|
}
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
),
|
|
1493
|
-
function
|
|
1494
|
-
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(
|
|
1495
|
+
const Tn = new kn(
|
|
1496
|
+
un,
|
|
1497
|
+
dn,
|
|
1498
|
+
hn,
|
|
1499
|
+
me,
|
|
1500
|
+
_n
|
|
1501
|
+
), An = new wn(bn, Tn);
|
|
1502
|
+
function Sn(e) {
|
|
1503
|
+
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(Ae) : Ae(e);
|
|
1495
1504
|
}
|
|
1496
|
-
function
|
|
1505
|
+
function Ae(e) {
|
|
1497
1506
|
if (typeof e == "function") return !0;
|
|
1498
1507
|
if (e === null || typeof e != "object") return !1;
|
|
1499
1508
|
const t = e;
|
|
1500
1509
|
return t.type === "ITEMS" && typeof t.itemType == "string";
|
|
1501
1510
|
}
|
|
1502
|
-
const
|
|
1503
|
-
function
|
|
1511
|
+
const Se = Object.freeze({}), zn = Object.freeze({}), ze = /* @__PURE__ */ new WeakMap();
|
|
1512
|
+
function ie(e, t) {
|
|
1504
1513
|
return e == null ? t : typeof e == "object" ? e : {};
|
|
1505
1514
|
}
|
|
1506
|
-
function
|
|
1507
|
-
if (!
|
|
1515
|
+
function En(e, t, n) {
|
|
1516
|
+
if (!Sn(e))
|
|
1508
1517
|
return { formDef: e };
|
|
1509
|
-
const r =
|
|
1510
|
-
let i =
|
|
1511
|
-
i || (i = /* @__PURE__ */ new WeakMap(),
|
|
1518
|
+
const r = ie(e, Se), o = ie(t, Se), s = ie(n, zn);
|
|
1519
|
+
let i = ze.get(r);
|
|
1520
|
+
i || (i = /* @__PURE__ */ new WeakMap(), ze.set(r, i));
|
|
1512
1521
|
let a = i.get(o);
|
|
1513
1522
|
a || (a = /* @__PURE__ */ new WeakMap(), i.set(o, a));
|
|
1514
1523
|
const u = a.get(s);
|
|
1515
1524
|
if (u) return u;
|
|
1516
|
-
const c =
|
|
1525
|
+
const c = An.processDxFacade(
|
|
1517
1526
|
e,
|
|
1518
1527
|
t,
|
|
1519
1528
|
n
|
|
@@ -1540,9 +1549,9 @@ function l(e, t, n) {
|
|
|
1540
1549
|
return;
|
|
1541
1550
|
a._zod.traits.add(e), t(a, u);
|
|
1542
1551
|
const c = i.prototype, p = Object.keys(c);
|
|
1543
|
-
for (let
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1552
|
+
for (let m = 0; m < p.length; m++) {
|
|
1553
|
+
const f = p[m];
|
|
1554
|
+
f in a || (a[f] = c[f].bind(a));
|
|
1546
1555
|
}
|
|
1547
1556
|
}
|
|
1548
1557
|
const o = n?.Parent ?? Object;
|
|
@@ -1561,37 +1570,37 @@ function l(e, t, n) {
|
|
|
1561
1570
|
value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
|
|
1562
1571
|
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
1563
1572
|
}
|
|
1564
|
-
class
|
|
1573
|
+
class N extends Error {
|
|
1565
1574
|
constructor() {
|
|
1566
1575
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1567
1576
|
}
|
|
1568
1577
|
}
|
|
1569
|
-
class
|
|
1578
|
+
class et extends Error {
|
|
1570
1579
|
constructor(t) {
|
|
1571
1580
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
1572
1581
|
}
|
|
1573
1582
|
}
|
|
1574
|
-
const
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1583
|
+
const $n = {};
|
|
1584
|
+
function I(e) {
|
|
1585
|
+
return $n;
|
|
1577
1586
|
}
|
|
1578
|
-
function
|
|
1587
|
+
function ue(e, t) {
|
|
1579
1588
|
return typeof t == "bigint" ? t.toString() : t;
|
|
1580
1589
|
}
|
|
1581
|
-
function
|
|
1590
|
+
function he(e) {
|
|
1582
1591
|
return e == null;
|
|
1583
1592
|
}
|
|
1584
|
-
function
|
|
1593
|
+
function fe(e) {
|
|
1585
1594
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
1586
1595
|
return e.slice(t, n);
|
|
1587
1596
|
}
|
|
1588
|
-
const
|
|
1589
|
-
function
|
|
1597
|
+
const Ee = /* @__PURE__ */ Symbol("evaluating");
|
|
1598
|
+
function b(e, t, n) {
|
|
1590
1599
|
let r;
|
|
1591
1600
|
Object.defineProperty(e, t, {
|
|
1592
1601
|
get() {
|
|
1593
|
-
if (r !==
|
|
1594
|
-
return r === void 0 && (r =
|
|
1602
|
+
if (r !== Ee)
|
|
1603
|
+
return r === void 0 && (r = Ee, r = n()), r;
|
|
1595
1604
|
},
|
|
1596
1605
|
set(o) {
|
|
1597
1606
|
Object.defineProperty(e, t, {
|
|
@@ -1602,7 +1611,7 @@ function g(e, t, n) {
|
|
|
1602
1611
|
configurable: !0
|
|
1603
1612
|
});
|
|
1604
1613
|
}
|
|
1605
|
-
function
|
|
1614
|
+
function On(...e) {
|
|
1606
1615
|
const t = {};
|
|
1607
1616
|
for (const n of e) {
|
|
1608
1617
|
const r = Object.getOwnPropertyDescriptors(n);
|
|
@@ -1610,34 +1619,34 @@ function Ln(...e) {
|
|
|
1610
1619
|
}
|
|
1611
1620
|
return Object.defineProperties({}, t);
|
|
1612
1621
|
}
|
|
1613
|
-
function
|
|
1622
|
+
function Zn(e) {
|
|
1614
1623
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1615
1624
|
}
|
|
1616
|
-
const
|
|
1625
|
+
const tt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
1617
1626
|
};
|
|
1618
|
-
function
|
|
1627
|
+
function $e(e) {
|
|
1619
1628
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1620
1629
|
}
|
|
1621
|
-
function
|
|
1622
|
-
if (
|
|
1630
|
+
function ce(e) {
|
|
1631
|
+
if ($e(e) === !1)
|
|
1623
1632
|
return !1;
|
|
1624
1633
|
const t = e.constructor;
|
|
1625
1634
|
if (t === void 0 || typeof t != "function")
|
|
1626
1635
|
return !0;
|
|
1627
1636
|
const n = t.prototype;
|
|
1628
|
-
return !(
|
|
1637
|
+
return !($e(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
1629
1638
|
}
|
|
1630
|
-
function
|
|
1631
|
-
return
|
|
1639
|
+
function nt(e) {
|
|
1640
|
+
return ce(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
1632
1641
|
}
|
|
1633
|
-
function
|
|
1642
|
+
function be(e) {
|
|
1634
1643
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1635
1644
|
}
|
|
1636
|
-
function
|
|
1645
|
+
function rt(e, t, n) {
|
|
1637
1646
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
1638
1647
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
1639
1648
|
}
|
|
1640
|
-
function
|
|
1649
|
+
function d(e) {
|
|
1641
1650
|
const t = e;
|
|
1642
1651
|
if (!t)
|
|
1643
1652
|
return {};
|
|
@@ -1650,14 +1659,14 @@ function f(e) {
|
|
|
1650
1659
|
}
|
|
1651
1660
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
1652
1661
|
}
|
|
1653
|
-
const
|
|
1662
|
+
const Pn = {
|
|
1654
1663
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
1655
1664
|
int32: [-2147483648, 2147483647],
|
|
1656
1665
|
uint32: [0, 4294967295],
|
|
1657
1666
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
1658
1667
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
1659
1668
|
};
|
|
1660
|
-
function
|
|
1669
|
+
function M(e, t = 0) {
|
|
1661
1670
|
if (e.aborted === !0)
|
|
1662
1671
|
return !0;
|
|
1663
1672
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -1665,27 +1674,27 @@ function F(e, t = 0) {
|
|
|
1665
1674
|
return !0;
|
|
1666
1675
|
return !1;
|
|
1667
1676
|
}
|
|
1668
|
-
function
|
|
1677
|
+
function Cn(e, t) {
|
|
1669
1678
|
return t.map((n) => {
|
|
1670
1679
|
var r;
|
|
1671
1680
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
1672
1681
|
});
|
|
1673
1682
|
}
|
|
1674
|
-
function
|
|
1683
|
+
function B(e) {
|
|
1675
1684
|
return typeof e == "string" ? e : e?.message;
|
|
1676
1685
|
}
|
|
1677
|
-
function
|
|
1686
|
+
function L(e, t, n) {
|
|
1678
1687
|
const r = { ...e, path: e.path ?? [] };
|
|
1679
1688
|
if (!e.message) {
|
|
1680
|
-
const o =
|
|
1689
|
+
const o = B(e.inst?._zod.def?.error?.(e)) ?? B(t?.error?.(e)) ?? B(n.customError?.(e)) ?? B(n.localeError?.(e)) ?? "Invalid input";
|
|
1681
1690
|
r.message = o;
|
|
1682
1691
|
}
|
|
1683
1692
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
1684
1693
|
}
|
|
1685
|
-
function
|
|
1694
|
+
function ge(e) {
|
|
1686
1695
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
1687
1696
|
}
|
|
1688
|
-
function
|
|
1697
|
+
function W(...e) {
|
|
1689
1698
|
const [t, n, r] = e;
|
|
1690
1699
|
return typeof t == "string" ? {
|
|
1691
1700
|
message: t,
|
|
@@ -1694,25 +1703,25 @@ function J(...e) {
|
|
|
1694
1703
|
inst: r
|
|
1695
1704
|
} : { ...t };
|
|
1696
1705
|
}
|
|
1697
|
-
const
|
|
1706
|
+
const ot = (e, t) => {
|
|
1698
1707
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
1699
1708
|
value: e._zod,
|
|
1700
1709
|
enumerable: !1
|
|
1701
1710
|
}), Object.defineProperty(e, "issues", {
|
|
1702
1711
|
value: t,
|
|
1703
1712
|
enumerable: !1
|
|
1704
|
-
}), e.message = JSON.stringify(t,
|
|
1713
|
+
}), e.message = JSON.stringify(t, ue, 2), Object.defineProperty(e, "toString", {
|
|
1705
1714
|
value: () => e.message,
|
|
1706
1715
|
enumerable: !1
|
|
1707
1716
|
});
|
|
1708
|
-
},
|
|
1709
|
-
function
|
|
1717
|
+
}, st = l("$ZodError", ot), X = l("$ZodError", ot, { Parent: Error });
|
|
1718
|
+
function In(e, t = (n) => n.message) {
|
|
1710
1719
|
const n = {}, r = [];
|
|
1711
1720
|
for (const o of e.issues)
|
|
1712
1721
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
1713
1722
|
return { formErrors: r, fieldErrors: n };
|
|
1714
1723
|
}
|
|
1715
|
-
function
|
|
1724
|
+
function Ln(e, t = (n) => n.message) {
|
|
1716
1725
|
const n = { _errors: [] }, r = (o) => {
|
|
1717
1726
|
for (const s of o.issues)
|
|
1718
1727
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -1733,77 +1742,77 @@ function jn(e, t = (n) => n.message) {
|
|
|
1733
1742
|
};
|
|
1734
1743
|
return r(e), n;
|
|
1735
1744
|
}
|
|
1736
|
-
const
|
|
1745
|
+
const H = (e) => (t, n, r, o) => {
|
|
1737
1746
|
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
|
|
1738
1747
|
if (i instanceof Promise)
|
|
1739
|
-
throw new
|
|
1748
|
+
throw new N();
|
|
1740
1749
|
if (i.issues.length) {
|
|
1741
|
-
const a = new (o?.Err ?? e)(i.issues.map((u) =>
|
|
1742
|
-
throw
|
|
1750
|
+
const a = new (o?.Err ?? e)(i.issues.map((u) => L(u, s, I())));
|
|
1751
|
+
throw tt(a, o?.callee), a;
|
|
1743
1752
|
}
|
|
1744
1753
|
return i.value;
|
|
1745
|
-
},
|
|
1754
|
+
}, Dn = /* @__PURE__ */ H(X), J = (e) => async (t, n, r, o) => {
|
|
1746
1755
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1747
1756
|
let i = t._zod.run({ value: n, issues: [] }, s);
|
|
1748
1757
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
1749
|
-
const a = new (o?.Err ?? e)(i.issues.map((u) =>
|
|
1750
|
-
throw
|
|
1758
|
+
const a = new (o?.Err ?? e)(i.issues.map((u) => L(u, s, I())));
|
|
1759
|
+
throw tt(a, o?.callee), a;
|
|
1751
1760
|
}
|
|
1752
1761
|
return i.value;
|
|
1753
|
-
},
|
|
1762
|
+
}, Mn = /* @__PURE__ */ J(X), Q = (e) => (t, n, r) => {
|
|
1754
1763
|
const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
|
|
1755
1764
|
if (s instanceof Promise)
|
|
1756
|
-
throw new
|
|
1765
|
+
throw new N();
|
|
1757
1766
|
return s.issues.length ? {
|
|
1758
1767
|
success: !1,
|
|
1759
|
-
error: new (e ??
|
|
1768
|
+
error: new (e ?? st)(s.issues.map((i) => L(i, o, I())))
|
|
1760
1769
|
} : { success: !0, data: s.value };
|
|
1761
|
-
},
|
|
1770
|
+
}, it = /* @__PURE__ */ Q(X), ee = (e) => async (t, n, r) => {
|
|
1762
1771
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1763
1772
|
let s = t._zod.run({ value: n, issues: [] }, o);
|
|
1764
1773
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
1765
1774
|
success: !1,
|
|
1766
|
-
error: new e(s.issues.map((i) =>
|
|
1775
|
+
error: new e(s.issues.map((i) => L(i, o, I())))
|
|
1767
1776
|
} : { success: !0, data: s.value };
|
|
1768
|
-
},
|
|
1777
|
+
}, at = /* @__PURE__ */ ee(X), Nn = (e) => (t, n, r) => {
|
|
1769
1778
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1770
|
-
return
|
|
1771
|
-
},
|
|
1779
|
+
return H(e)(t, n, o);
|
|
1780
|
+
}, Rn = (e) => (t, n, r) => H(e)(t, n, r), xn = (e) => async (t, n, r) => {
|
|
1772
1781
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1773
|
-
return
|
|
1774
|
-
},
|
|
1782
|
+
return J(e)(t, n, o);
|
|
1783
|
+
}, Fn = (e) => async (t, n, r) => J(e)(t, n, r), Wn = (e) => (t, n, r) => {
|
|
1775
1784
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1776
|
-
return
|
|
1777
|
-
},
|
|
1785
|
+
return Q(e)(t, n, o);
|
|
1786
|
+
}, Un = (e) => (t, n, r) => Q(e)(t, n, r), jn = (e) => async (t, n, r) => {
|
|
1778
1787
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1779
|
-
return
|
|
1780
|
-
},
|
|
1781
|
-
function
|
|
1788
|
+
return ee(e)(t, n, o);
|
|
1789
|
+
}, Vn = (e) => async (t, n, r) => ee(e)(t, n, r), Bn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Oe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Yn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Gn = /^(?:(?: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])$/, Kn = /^(([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}|:))$/, qn = /^(?=.{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])?)*\.?$/, ut = "(?:(?:\\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])))", Xn = /* @__PURE__ */ new RegExp(`^${ut}$`);
|
|
1790
|
+
function ct(e) {
|
|
1782
1791
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
1783
1792
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
1784
1793
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return new RegExp(`^${
|
|
1794
|
+
function Hn(e) {
|
|
1795
|
+
return new RegExp(`^${ct(e)}$`);
|
|
1787
1796
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const t =
|
|
1797
|
+
function Jn(e) {
|
|
1798
|
+
const t = ct({ precision: e.precision }), n = ["Z"];
|
|
1790
1799
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
1791
1800
|
const r = `${t}(?:${n.join("|")})`;
|
|
1792
|
-
return new RegExp(`^${
|
|
1801
|
+
return new RegExp(`^${ut}T(?:${r})$`);
|
|
1793
1802
|
}
|
|
1794
|
-
const
|
|
1803
|
+
const Qn = (e) => {
|
|
1795
1804
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
1796
1805
|
return new RegExp(`^${t}$`);
|
|
1797
|
-
},
|
|
1806
|
+
}, er = /^-?\d+$/, tr = /^-?\d+(?:\.\d+)?/, nr = /^(?:true|false)$/i, rr = /^[^A-Z]*$/, or = /^[^a-z]*$/, S = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
|
|
1798
1807
|
var n;
|
|
1799
1808
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
1800
|
-
}),
|
|
1809
|
+
}), lt = {
|
|
1801
1810
|
number: "number",
|
|
1802
1811
|
bigint: "bigint",
|
|
1803
1812
|
object: "date"
|
|
1804
|
-
},
|
|
1805
|
-
|
|
1806
|
-
const n =
|
|
1813
|
+
}, sr = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
|
|
1814
|
+
S.init(e, t);
|
|
1815
|
+
const n = lt[typeof t.value];
|
|
1807
1816
|
e._zod.onattach.push((r) => {
|
|
1808
1817
|
const o = r._zod.bag, s = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
1809
1818
|
t.value < s && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
|
|
@@ -1811,16 +1820,16 @@ const sr = (e) => {
|
|
|
1811
1820
|
(t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
|
|
1812
1821
|
origin: n,
|
|
1813
1822
|
code: "too_big",
|
|
1814
|
-
maximum:
|
|
1823
|
+
maximum: t.value,
|
|
1815
1824
|
input: r.value,
|
|
1816
1825
|
inclusive: t.inclusive,
|
|
1817
1826
|
inst: e,
|
|
1818
1827
|
continue: !t.abort
|
|
1819
1828
|
});
|
|
1820
1829
|
};
|
|
1821
|
-
}),
|
|
1822
|
-
|
|
1823
|
-
const n =
|
|
1830
|
+
}), ir = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
|
|
1831
|
+
S.init(e, t);
|
|
1832
|
+
const n = lt[typeof t.value];
|
|
1824
1833
|
e._zod.onattach.push((r) => {
|
|
1825
1834
|
const o = r._zod.bag, s = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
1826
1835
|
t.value > s && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
|
|
@@ -1828,19 +1837,19 @@ const sr = (e) => {
|
|
|
1828
1837
|
(t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
|
|
1829
1838
|
origin: n,
|
|
1830
1839
|
code: "too_small",
|
|
1831
|
-
minimum:
|
|
1840
|
+
minimum: t.value,
|
|
1832
1841
|
input: r.value,
|
|
1833
1842
|
inclusive: t.inclusive,
|
|
1834
1843
|
inst: e,
|
|
1835
1844
|
continue: !t.abort
|
|
1836
1845
|
});
|
|
1837
1846
|
};
|
|
1838
|
-
}),
|
|
1839
|
-
|
|
1840
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] =
|
|
1847
|
+
}), ar = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
|
|
1848
|
+
S.init(e, t), t.format = t.format || "float64";
|
|
1849
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] = Pn[t.format];
|
|
1841
1850
|
e._zod.onattach.push((i) => {
|
|
1842
1851
|
const a = i._zod.bag;
|
|
1843
|
-
a.format = t.format, a.minimum = o, a.maximum = s, n && (a.pattern =
|
|
1852
|
+
a.format = t.format, a.minimum = o, a.maximum = s, n && (a.pattern = er);
|
|
1844
1853
|
}), e._zod.check = (i) => {
|
|
1845
1854
|
const a = i.value;
|
|
1846
1855
|
if (n) {
|
|
@@ -1863,7 +1872,6 @@ const sr = (e) => {
|
|
|
1863
1872
|
note: "Integers must be within the safe integer range.",
|
|
1864
1873
|
inst: e,
|
|
1865
1874
|
origin: r,
|
|
1866
|
-
inclusive: !0,
|
|
1867
1875
|
continue: !t.abort
|
|
1868
1876
|
}) : i.issues.push({
|
|
1869
1877
|
input: a,
|
|
@@ -1872,7 +1880,6 @@ const sr = (e) => {
|
|
|
1872
1880
|
note: "Integers must be within the safe integer range.",
|
|
1873
1881
|
inst: e,
|
|
1874
1882
|
origin: r,
|
|
1875
|
-
inclusive: !0,
|
|
1876
1883
|
continue: !t.abort
|
|
1877
1884
|
});
|
|
1878
1885
|
return;
|
|
@@ -1891,16 +1898,14 @@ const sr = (e) => {
|
|
|
1891
1898
|
input: a,
|
|
1892
1899
|
code: "too_big",
|
|
1893
1900
|
maximum: s,
|
|
1894
|
-
|
|
1895
|
-
inst: e,
|
|
1896
|
-
continue: !t.abort
|
|
1901
|
+
inst: e
|
|
1897
1902
|
});
|
|
1898
1903
|
};
|
|
1899
|
-
}),
|
|
1904
|
+
}), ur = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
|
|
1900
1905
|
var n;
|
|
1901
|
-
|
|
1906
|
+
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1902
1907
|
const o = r.value;
|
|
1903
|
-
return !
|
|
1908
|
+
return !he(o) && o.length !== void 0;
|
|
1904
1909
|
}), e._zod.onattach.push((r) => {
|
|
1905
1910
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1906
1911
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -1908,7 +1913,7 @@ const sr = (e) => {
|
|
|
1908
1913
|
const o = r.value;
|
|
1909
1914
|
if (o.length <= t.maximum)
|
|
1910
1915
|
return;
|
|
1911
|
-
const i =
|
|
1916
|
+
const i = ge(o);
|
|
1912
1917
|
r.issues.push({
|
|
1913
1918
|
origin: i,
|
|
1914
1919
|
code: "too_big",
|
|
@@ -1919,11 +1924,11 @@ const sr = (e) => {
|
|
|
1919
1924
|
continue: !t.abort
|
|
1920
1925
|
});
|
|
1921
1926
|
};
|
|
1922
|
-
}),
|
|
1927
|
+
}), cr = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
|
|
1923
1928
|
var n;
|
|
1924
|
-
|
|
1929
|
+
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1925
1930
|
const o = r.value;
|
|
1926
|
-
return !
|
|
1931
|
+
return !he(o) && o.length !== void 0;
|
|
1927
1932
|
}), e._zod.onattach.push((r) => {
|
|
1928
1933
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1929
1934
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -1931,7 +1936,7 @@ const sr = (e) => {
|
|
|
1931
1936
|
const o = r.value;
|
|
1932
1937
|
if (o.length >= t.minimum)
|
|
1933
1938
|
return;
|
|
1934
|
-
const i =
|
|
1939
|
+
const i = ge(o);
|
|
1935
1940
|
r.issues.push({
|
|
1936
1941
|
origin: i,
|
|
1937
1942
|
code: "too_small",
|
|
@@ -1942,11 +1947,11 @@ const sr = (e) => {
|
|
|
1942
1947
|
continue: !t.abort
|
|
1943
1948
|
});
|
|
1944
1949
|
};
|
|
1945
|
-
}),
|
|
1950
|
+
}), lr = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
|
|
1946
1951
|
var n;
|
|
1947
|
-
|
|
1952
|
+
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1948
1953
|
const o = r.value;
|
|
1949
|
-
return !
|
|
1954
|
+
return !he(o) && o.length !== void 0;
|
|
1950
1955
|
}), e._zod.onattach.push((r) => {
|
|
1951
1956
|
const o = r._zod.bag;
|
|
1952
1957
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -1954,7 +1959,7 @@ const sr = (e) => {
|
|
|
1954
1959
|
const o = r.value, s = o.length;
|
|
1955
1960
|
if (s === t.length)
|
|
1956
1961
|
return;
|
|
1957
|
-
const i =
|
|
1962
|
+
const i = ge(o), a = s > t.length;
|
|
1958
1963
|
r.issues.push({
|
|
1959
1964
|
origin: i,
|
|
1960
1965
|
...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -1965,9 +1970,9 @@ const sr = (e) => {
|
|
|
1965
1970
|
continue: !t.abort
|
|
1966
1971
|
});
|
|
1967
1972
|
};
|
|
1968
|
-
}),
|
|
1973
|
+
}), te = /* @__PURE__ */ l("$ZodCheckStringFormat", (e, t) => {
|
|
1969
1974
|
var n, r;
|
|
1970
|
-
|
|
1975
|
+
S.init(e, t), e._zod.onattach.push((o) => {
|
|
1971
1976
|
const s = o._zod.bag;
|
|
1972
1977
|
s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
|
|
1973
1978
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
|
|
@@ -1982,8 +1987,8 @@ const sr = (e) => {
|
|
|
1982
1987
|
});
|
|
1983
1988
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
1984
1989
|
});
|
|
1985
|
-
}),
|
|
1986
|
-
|
|
1990
|
+
}), pr = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
|
|
1991
|
+
te.init(e, t), e._zod.check = (n) => {
|
|
1987
1992
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
1988
1993
|
origin: "string",
|
|
1989
1994
|
code: "invalid_format",
|
|
@@ -1994,13 +1999,13 @@ const sr = (e) => {
|
|
|
1994
1999
|
continue: !t.abort
|
|
1995
2000
|
});
|
|
1996
2001
|
};
|
|
1997
|
-
}),
|
|
1998
|
-
t.pattern ?? (t.pattern =
|
|
1999
|
-
}),
|
|
2000
|
-
t.pattern ?? (t.pattern =
|
|
2001
|
-
}),
|
|
2002
|
-
|
|
2003
|
-
const n =
|
|
2002
|
+
}), dr = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
|
|
2003
|
+
t.pattern ?? (t.pattern = rr), te.init(e, t);
|
|
2004
|
+
}), mr = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
|
|
2005
|
+
t.pattern ?? (t.pattern = or), te.init(e, t);
|
|
2006
|
+
}), hr = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
|
|
2007
|
+
S.init(e, t);
|
|
2008
|
+
const n = be(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2004
2009
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
2005
2010
|
const s = o._zod.bag;
|
|
2006
2011
|
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
@@ -2015,9 +2020,9 @@ const sr = (e) => {
|
|
|
2015
2020
|
continue: !t.abort
|
|
2016
2021
|
});
|
|
2017
2022
|
};
|
|
2018
|
-
}),
|
|
2019
|
-
|
|
2020
|
-
const n = new RegExp(`^${
|
|
2023
|
+
}), fr = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
|
|
2024
|
+
S.init(e, t);
|
|
2025
|
+
const n = new RegExp(`^${be(t.prefix)}.*`);
|
|
2021
2026
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2022
2027
|
const o = r._zod.bag;
|
|
2023
2028
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2032,9 +2037,9 @@ const sr = (e) => {
|
|
|
2032
2037
|
continue: !t.abort
|
|
2033
2038
|
});
|
|
2034
2039
|
};
|
|
2035
|
-
}),
|
|
2036
|
-
|
|
2037
|
-
const n = new RegExp(`.*${
|
|
2040
|
+
}), br = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
|
|
2041
|
+
S.init(e, t);
|
|
2042
|
+
const n = new RegExp(`.*${be(t.suffix)}$`);
|
|
2038
2043
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2039
2044
|
const o = r._zod.bag;
|
|
2040
2045
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2049,17 +2054,17 @@ const sr = (e) => {
|
|
|
2049
2054
|
continue: !t.abort
|
|
2050
2055
|
});
|
|
2051
2056
|
};
|
|
2052
|
-
}),
|
|
2053
|
-
|
|
2057
|
+
}), gr = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
|
|
2058
|
+
S.init(e, t), e._zod.check = (n) => {
|
|
2054
2059
|
n.value = t.tx(n.value);
|
|
2055
2060
|
};
|
|
2056
|
-
}),
|
|
2061
|
+
}), yr = {
|
|
2057
2062
|
major: 4,
|
|
2058
|
-
minor:
|
|
2059
|
-
patch:
|
|
2060
|
-
},
|
|
2063
|
+
minor: 1,
|
|
2064
|
+
patch: 13
|
|
2065
|
+
}, _ = /* @__PURE__ */ l("$ZodType", (e, t) => {
|
|
2061
2066
|
var n;
|
|
2062
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
2067
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = yr;
|
|
2063
2068
|
const r = [...e._zod.def.checks ?? []];
|
|
2064
2069
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
2065
2070
|
for (const o of r)
|
|
@@ -2071,34 +2076,34 @@ const sr = (e) => {
|
|
|
2071
2076
|
});
|
|
2072
2077
|
else {
|
|
2073
2078
|
const o = (i, a, u) => {
|
|
2074
|
-
let c =
|
|
2075
|
-
for (const
|
|
2076
|
-
if (
|
|
2077
|
-
if (!
|
|
2079
|
+
let c = M(i), p;
|
|
2080
|
+
for (const m of a) {
|
|
2081
|
+
if (m._zod.def.when) {
|
|
2082
|
+
if (!m._zod.def.when(i))
|
|
2078
2083
|
continue;
|
|
2079
2084
|
} else if (c)
|
|
2080
2085
|
continue;
|
|
2081
|
-
const
|
|
2082
|
-
if (
|
|
2083
|
-
throw new
|
|
2084
|
-
if (p ||
|
|
2086
|
+
const f = i.issues.length, z = m._zod.check(i);
|
|
2087
|
+
if (z instanceof Promise && u?.async === !1)
|
|
2088
|
+
throw new N();
|
|
2089
|
+
if (p || z instanceof Promise)
|
|
2085
2090
|
p = (p ?? Promise.resolve()).then(async () => {
|
|
2086
|
-
await
|
|
2091
|
+
await z, i.issues.length !== f && (c || (c = M(i, f)));
|
|
2087
2092
|
});
|
|
2088
2093
|
else {
|
|
2089
|
-
if (i.issues.length ===
|
|
2094
|
+
if (i.issues.length === f)
|
|
2090
2095
|
continue;
|
|
2091
|
-
c || (c =
|
|
2096
|
+
c || (c = M(i, f));
|
|
2092
2097
|
}
|
|
2093
2098
|
}
|
|
2094
2099
|
return p ? p.then(() => i) : i;
|
|
2095
2100
|
}, s = (i, a, u) => {
|
|
2096
|
-
if (
|
|
2101
|
+
if (M(i))
|
|
2097
2102
|
return i.aborted = !0, i;
|
|
2098
2103
|
const c = o(a, r, u);
|
|
2099
2104
|
if (c instanceof Promise) {
|
|
2100
2105
|
if (u.async === !1)
|
|
2101
|
-
throw new
|
|
2106
|
+
throw new N();
|
|
2102
2107
|
return c.then((p) => e._zod.parse(p, u));
|
|
2103
2108
|
}
|
|
2104
2109
|
return e._zod.parse(c, u);
|
|
@@ -2113,26 +2118,26 @@ const sr = (e) => {
|
|
|
2113
2118
|
const u = e._zod.parse(i, a);
|
|
2114
2119
|
if (u instanceof Promise) {
|
|
2115
2120
|
if (a.async === !1)
|
|
2116
|
-
throw new
|
|
2121
|
+
throw new N();
|
|
2117
2122
|
return u.then((c) => o(c, r, a));
|
|
2118
2123
|
}
|
|
2119
2124
|
return o(u, r, a);
|
|
2120
2125
|
};
|
|
2121
2126
|
}
|
|
2122
|
-
|
|
2127
|
+
e["~standard"] = {
|
|
2123
2128
|
validate: (o) => {
|
|
2124
2129
|
try {
|
|
2125
|
-
const s =
|
|
2130
|
+
const s = it(e, o);
|
|
2126
2131
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
2127
2132
|
} catch {
|
|
2128
|
-
return
|
|
2133
|
+
return at(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
2129
2134
|
}
|
|
2130
2135
|
},
|
|
2131
2136
|
vendor: "zod",
|
|
2132
2137
|
version: 1
|
|
2133
|
-
}
|
|
2134
|
-
}),
|
|
2135
|
-
|
|
2138
|
+
};
|
|
2139
|
+
}), ye = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
2140
|
+
_.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Qn(e._zod.bag), e._zod.parse = (n, r) => {
|
|
2136
2141
|
if (t.coerce)
|
|
2137
2142
|
try {
|
|
2138
2143
|
n.value = String(n.value);
|
|
@@ -2145,9 +2150,9 @@ const sr = (e) => {
|
|
|
2145
2150
|
inst: e
|
|
2146
2151
|
}), n;
|
|
2147
2152
|
};
|
|
2148
|
-
}),
|
|
2149
|
-
|
|
2150
|
-
}),
|
|
2153
|
+
}), E = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
|
|
2154
|
+
te.init(e, t), ye.init(e, t);
|
|
2155
|
+
}), _r = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
|
|
2151
2156
|
if (t.version) {
|
|
2152
2157
|
const r = {
|
|
2153
2158
|
v1: 1,
|
|
@@ -2161,14 +2166,14 @@ const sr = (e) => {
|
|
|
2161
2166
|
}[t.version];
|
|
2162
2167
|
if (r === void 0)
|
|
2163
2168
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
2164
|
-
t.pattern ?? (t.pattern =
|
|
2169
|
+
t.pattern ?? (t.pattern = Oe(r));
|
|
2165
2170
|
} else
|
|
2166
|
-
t.pattern ?? (t.pattern =
|
|
2167
|
-
|
|
2168
|
-
}),
|
|
2169
|
-
t.pattern ?? (t.pattern =
|
|
2170
|
-
}),
|
|
2171
|
-
|
|
2171
|
+
t.pattern ?? (t.pattern = Oe());
|
|
2172
|
+
E.init(e, t);
|
|
2173
|
+
}), vr = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
|
|
2174
|
+
t.pattern ?? (t.pattern = Yn), E.init(e, t);
|
|
2175
|
+
}), kr = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
2176
|
+
E.init(e, t), e._zod.check = (n) => {
|
|
2172
2177
|
try {
|
|
2173
2178
|
const r = n.value.trim(), o = new URL(r);
|
|
2174
2179
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
|
|
@@ -2199,18 +2204,18 @@ const sr = (e) => {
|
|
|
2199
2204
|
});
|
|
2200
2205
|
}
|
|
2201
2206
|
};
|
|
2202
|
-
}),
|
|
2203
|
-
t.pattern ?? (t.pattern =
|
|
2204
|
-
}),
|
|
2205
|
-
t.pattern ?? (t.pattern =
|
|
2206
|
-
}),
|
|
2207
|
-
t.pattern ?? (t.pattern =
|
|
2208
|
-
}),
|
|
2209
|
-
t.pattern ?? (t.pattern =
|
|
2210
|
-
}),
|
|
2211
|
-
t.pattern ?? (t.pattern =
|
|
2212
|
-
}),
|
|
2213
|
-
t.pattern ?? (t.pattern =
|
|
2207
|
+
}), wr = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
|
|
2208
|
+
t.pattern ?? (t.pattern = Jn(t)), E.init(e, t);
|
|
2209
|
+
}), Tr = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
|
|
2210
|
+
t.pattern ?? (t.pattern = Xn), E.init(e, t);
|
|
2211
|
+
}), Ar = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
|
|
2212
|
+
t.pattern ?? (t.pattern = Hn(t)), E.init(e, t);
|
|
2213
|
+
}), Sr = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
|
|
2214
|
+
t.pattern ?? (t.pattern = Bn), E.init(e, t);
|
|
2215
|
+
}), zr = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
|
|
2216
|
+
t.pattern ?? (t.pattern = Gn), E.init(e, t), e._zod.bag.format = "ipv4";
|
|
2217
|
+
}), Er = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
|
|
2218
|
+
t.pattern ?? (t.pattern = Kn), E.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
2214
2219
|
try {
|
|
2215
2220
|
new URL(`http://[${n.value}]`);
|
|
2216
2221
|
} catch {
|
|
@@ -2223,8 +2228,8 @@ const sr = (e) => {
|
|
|
2223
2228
|
});
|
|
2224
2229
|
}
|
|
2225
2230
|
};
|
|
2226
|
-
}),
|
|
2227
|
-
|
|
2231
|
+
}), $r = /* @__PURE__ */ l("$ZodCustomStringFormat", (e, t) => {
|
|
2232
|
+
E.init(e, t), e._zod.check = (n) => {
|
|
2228
2233
|
t.fn(n.value) || n.issues.push({
|
|
2229
2234
|
code: "invalid_format",
|
|
2230
2235
|
format: t.format,
|
|
@@ -2233,8 +2238,8 @@ const sr = (e) => {
|
|
|
2233
2238
|
continue: !t.abort
|
|
2234
2239
|
});
|
|
2235
2240
|
};
|
|
2236
|
-
}),
|
|
2237
|
-
|
|
2241
|
+
}), pt = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
|
|
2242
|
+
_.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? tr, e._zod.parse = (n, r) => {
|
|
2238
2243
|
if (t.coerce)
|
|
2239
2244
|
try {
|
|
2240
2245
|
n.value = Number(n.value);
|
|
@@ -2252,10 +2257,10 @@ const sr = (e) => {
|
|
|
2252
2257
|
...s ? { received: s } : {}
|
|
2253
2258
|
}), n;
|
|
2254
2259
|
};
|
|
2255
|
-
}),
|
|
2256
|
-
|
|
2257
|
-
}),
|
|
2258
|
-
|
|
2260
|
+
}), Or = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
|
|
2261
|
+
ar.init(e, t), pt.init(e, t);
|
|
2262
|
+
}), Zr = /* @__PURE__ */ l("$ZodBoolean", (e, t) => {
|
|
2263
|
+
_.init(e, t), e._zod.pattern = nr, e._zod.parse = (n, r) => {
|
|
2259
2264
|
if (t.coerce)
|
|
2260
2265
|
try {
|
|
2261
2266
|
n.value = !!n.value;
|
|
@@ -2269,14 +2274,14 @@ const sr = (e) => {
|
|
|
2269
2274
|
inst: e
|
|
2270
2275
|
}), n;
|
|
2271
2276
|
};
|
|
2272
|
-
}),
|
|
2273
|
-
|
|
2277
|
+
}), Pr = /* @__PURE__ */ l("$ZodAny", (e, t) => {
|
|
2278
|
+
_.init(e, t), e._zod.parse = (n) => n;
|
|
2274
2279
|
});
|
|
2275
|
-
function
|
|
2276
|
-
e.issues.length && t.issues.push(...
|
|
2280
|
+
function Ze(e, t, n) {
|
|
2281
|
+
e.issues.length && t.issues.push(...Cn(n, e.issues)), t.value[n] = e.value;
|
|
2277
2282
|
}
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2283
|
+
const dt = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
2284
|
+
_.init(e, t), e._zod.parse = (n, r) => {
|
|
2280
2285
|
const o = n.value;
|
|
2281
2286
|
if (!Array.isArray(o))
|
|
2282
2287
|
return n.issues.push({
|
|
@@ -2292,31 +2297,31 @@ const ht = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
|
2292
2297
|
value: a,
|
|
2293
2298
|
issues: []
|
|
2294
2299
|
}, r);
|
|
2295
|
-
u instanceof Promise ? s.push(u.then((c) =>
|
|
2300
|
+
u instanceof Promise ? s.push(u.then((c) => Ze(c, n, i))) : Ze(u, n, i);
|
|
2296
2301
|
}
|
|
2297
2302
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
2298
2303
|
};
|
|
2299
2304
|
});
|
|
2300
|
-
function
|
|
2305
|
+
function Pe(e, t, n, r) {
|
|
2301
2306
|
for (const s of e)
|
|
2302
2307
|
if (s.issues.length === 0)
|
|
2303
2308
|
return t.value = s.value, t;
|
|
2304
|
-
const o = e.filter((s) => !
|
|
2309
|
+
const o = e.filter((s) => !M(s));
|
|
2305
2310
|
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
2306
2311
|
code: "invalid_union",
|
|
2307
2312
|
input: t.value,
|
|
2308
2313
|
inst: n,
|
|
2309
|
-
errors: e.map((s) => s.issues.map((i) =>
|
|
2314
|
+
errors: e.map((s) => s.issues.map((i) => L(i, r, I())))
|
|
2310
2315
|
}), t);
|
|
2311
2316
|
}
|
|
2312
|
-
const
|
|
2313
|
-
|
|
2317
|
+
const Cr = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
2318
|
+
_.init(e, t), b(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), b(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), b(e._zod, "values", () => {
|
|
2314
2319
|
if (t.options.every((o) => o._zod.values))
|
|
2315
2320
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
2316
|
-
}),
|
|
2321
|
+
}), b(e._zod, "pattern", () => {
|
|
2317
2322
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
2318
2323
|
const o = t.options.map((s) => s._zod.pattern);
|
|
2319
|
-
return new RegExp(`^(${o.map((s) =>
|
|
2324
|
+
return new RegExp(`^(${o.map((s) => fe(s.source)).join("|")})$`);
|
|
2320
2325
|
}
|
|
2321
2326
|
});
|
|
2322
2327
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
@@ -2338,23 +2343,23 @@ const Rr = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
2338
2343
|
a.push(c);
|
|
2339
2344
|
}
|
|
2340
2345
|
}
|
|
2341
|
-
return i ? Promise.all(a).then((u) =>
|
|
2346
|
+
return i ? Promise.all(a).then((u) => Pe(u, o, e, s)) : Pe(a, o, e, s);
|
|
2342
2347
|
};
|
|
2343
|
-
}),
|
|
2344
|
-
|
|
2348
|
+
}), Ir = /* @__PURE__ */ l("$ZodIntersection", (e, t) => {
|
|
2349
|
+
_.init(e, t), e._zod.parse = (n, r) => {
|
|
2345
2350
|
const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
|
|
2346
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, c]) =>
|
|
2351
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, c]) => Ce(n, u, c)) : Ce(n, s, i);
|
|
2347
2352
|
};
|
|
2348
2353
|
});
|
|
2349
|
-
function
|
|
2354
|
+
function le(e, t) {
|
|
2350
2355
|
if (e === t)
|
|
2351
2356
|
return { valid: !0, data: e };
|
|
2352
2357
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
2353
2358
|
return { valid: !0, data: e };
|
|
2354
|
-
if (
|
|
2359
|
+
if (ce(e) && ce(t)) {
|
|
2355
2360
|
const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
|
|
2356
2361
|
for (const s of r) {
|
|
2357
|
-
const i =
|
|
2362
|
+
const i = le(e[s], t[s]);
|
|
2358
2363
|
if (!i.valid)
|
|
2359
2364
|
return {
|
|
2360
2365
|
valid: !1,
|
|
@@ -2369,7 +2374,7 @@ function me(e, t) {
|
|
|
2369
2374
|
return { valid: !1, mergeErrorPath: [] };
|
|
2370
2375
|
const n = [];
|
|
2371
2376
|
for (let r = 0; r < e.length; r++) {
|
|
2372
|
-
const o = e[r], s = t[r], i =
|
|
2377
|
+
const o = e[r], s = t[r], i = le(o, s);
|
|
2373
2378
|
if (!i.valid)
|
|
2374
2379
|
return {
|
|
2375
2380
|
valid: !1,
|
|
@@ -2381,88 +2386,70 @@ function me(e, t) {
|
|
|
2381
2386
|
}
|
|
2382
2387
|
return { valid: !1, mergeErrorPath: [] };
|
|
2383
2388
|
}
|
|
2384
|
-
function
|
|
2385
|
-
|
|
2386
|
-
let o;
|
|
2387
|
-
for (const a of t.issues)
|
|
2388
|
-
if (a.code === "unrecognized_keys") {
|
|
2389
|
-
o ?? (o = a);
|
|
2390
|
-
for (const u of a.keys)
|
|
2391
|
-
r.has(u) || r.set(u, {}), r.get(u).l = !0;
|
|
2392
|
-
} else
|
|
2393
|
-
e.issues.push(a);
|
|
2394
|
-
for (const a of n.issues)
|
|
2395
|
-
if (a.code === "unrecognized_keys")
|
|
2396
|
-
for (const u of a.keys)
|
|
2397
|
-
r.has(u) || r.set(u, {}), r.get(u).r = !0;
|
|
2398
|
-
else
|
|
2399
|
-
e.issues.push(a);
|
|
2400
|
-
const s = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
|
|
2401
|
-
if (s.length && o && e.issues.push({ ...o, keys: s }), F(e))
|
|
2389
|
+
function Ce(e, t, n) {
|
|
2390
|
+
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), M(e))
|
|
2402
2391
|
return e;
|
|
2403
|
-
const
|
|
2404
|
-
if (!
|
|
2405
|
-
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(
|
|
2406
|
-
return e.value =
|
|
2392
|
+
const r = le(t.value, n.value);
|
|
2393
|
+
if (!r.valid)
|
|
2394
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
2395
|
+
return e.value = r.data, e;
|
|
2407
2396
|
}
|
|
2408
|
-
const
|
|
2409
|
-
|
|
2397
|
+
const Lr = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
|
|
2398
|
+
_.init(e, t), e._zod.parse = (n, r) => {
|
|
2410
2399
|
if (r.direction === "backward")
|
|
2411
|
-
throw new
|
|
2400
|
+
throw new et(e.constructor.name);
|
|
2412
2401
|
const o = t.transform(n.value, n);
|
|
2413
2402
|
if (r.async)
|
|
2414
2403
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
|
|
2415
2404
|
if (o instanceof Promise)
|
|
2416
|
-
throw new
|
|
2405
|
+
throw new N();
|
|
2417
2406
|
return n.value = o, n;
|
|
2418
2407
|
};
|
|
2419
2408
|
});
|
|
2420
|
-
function
|
|
2409
|
+
function Ie(e, t) {
|
|
2421
2410
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
2422
2411
|
}
|
|
2423
|
-
const
|
|
2424
|
-
|
|
2412
|
+
const mt = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
2413
|
+
_.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", b(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), b(e._zod, "pattern", () => {
|
|
2425
2414
|
const n = t.innerType._zod.pattern;
|
|
2426
|
-
return n ? new RegExp(`^(${
|
|
2415
|
+
return n ? new RegExp(`^(${fe(n.source)})?$`) : void 0;
|
|
2427
2416
|
}), e._zod.parse = (n, r) => {
|
|
2428
2417
|
if (t.innerType._zod.optin === "optional") {
|
|
2429
2418
|
const o = t.innerType._zod.run(n, r);
|
|
2430
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2419
|
+
return o instanceof Promise ? o.then((s) => Ie(s, n.value)) : Ie(o, n.value);
|
|
2431
2420
|
}
|
|
2432
2421
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
2433
2422
|
};
|
|
2434
|
-
}),
|
|
2435
|
-
|
|
2436
|
-
}), xr = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
|
|
2437
|
-
v.init(e, t), g(e._zod, "optin", () => t.innerType._zod.optin), g(e._zod, "optout", () => t.innerType._zod.optout), g(e._zod, "pattern", () => {
|
|
2423
|
+
}), Dr = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
|
|
2424
|
+
_.init(e, t), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), b(e._zod, "pattern", () => {
|
|
2438
2425
|
const n = t.innerType._zod.pattern;
|
|
2439
|
-
return n ? new RegExp(`^(${
|
|
2440
|
-
}),
|
|
2441
|
-
}),
|
|
2442
|
-
|
|
2426
|
+
return n ? new RegExp(`^(${fe(n.source)}|null)$`) : void 0;
|
|
2427
|
+
}), b(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
2428
|
+
}), Mr = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
|
|
2429
|
+
_.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
2443
2430
|
if (r.direction === "backward")
|
|
2444
2431
|
return t.innerType._zod.run(n, r);
|
|
2445
2432
|
if (n.value === void 0)
|
|
2446
2433
|
return n.value = t.defaultValue, n;
|
|
2447
2434
|
const o = t.innerType._zod.run(n, r);
|
|
2448
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2435
|
+
return o instanceof Promise ? o.then((s) => Le(s, t)) : Le(o, t);
|
|
2449
2436
|
};
|
|
2450
2437
|
});
|
|
2451
|
-
function
|
|
2438
|
+
function Le(e, t) {
|
|
2452
2439
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
2453
2440
|
}
|
|
2454
|
-
const
|
|
2455
|
-
|
|
2456
|
-
}),
|
|
2457
|
-
|
|
2441
|
+
const Nr = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
|
|
2442
|
+
_.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
2443
|
+
}), Rr = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
|
|
2444
|
+
_.init(e, t), b(e._zod, "values", () => {
|
|
2458
2445
|
const n = t.innerType._zod.values;
|
|
2459
2446
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
2460
2447
|
}), e._zod.parse = (n, r) => {
|
|
2461
2448
|
const o = t.innerType._zod.run(n, r);
|
|
2462
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2449
|
+
return o instanceof Promise ? o.then((s) => De(s, e)) : De(o, e);
|
|
2463
2450
|
};
|
|
2464
2451
|
});
|
|
2465
|
-
function
|
|
2452
|
+
function De(e, t) {
|
|
2466
2453
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
2467
2454
|
code: "invalid_type",
|
|
2468
2455
|
expected: "nonoptional",
|
|
@@ -2470,58 +2457,58 @@ function Re(e, t) {
|
|
|
2470
2457
|
inst: t
|
|
2471
2458
|
}), e;
|
|
2472
2459
|
}
|
|
2473
|
-
const
|
|
2474
|
-
|
|
2460
|
+
const xr = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
|
|
2461
|
+
_.init(e, t), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
2475
2462
|
if (r.direction === "backward")
|
|
2476
2463
|
return t.innerType._zod.run(n, r);
|
|
2477
2464
|
const o = t.innerType._zod.run(n, r);
|
|
2478
2465
|
return o instanceof Promise ? o.then((s) => (n.value = s.value, s.issues.length && (n.value = t.catchValue({
|
|
2479
2466
|
...n,
|
|
2480
2467
|
error: {
|
|
2481
|
-
issues: s.issues.map((i) =>
|
|
2468
|
+
issues: s.issues.map((i) => L(i, r, I()))
|
|
2482
2469
|
},
|
|
2483
2470
|
input: n.value
|
|
2484
2471
|
}), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
|
|
2485
2472
|
...n,
|
|
2486
2473
|
error: {
|
|
2487
|
-
issues: o.issues.map((s) =>
|
|
2474
|
+
issues: o.issues.map((s) => L(s, r, I()))
|
|
2488
2475
|
},
|
|
2489
2476
|
input: n.value
|
|
2490
2477
|
}), n.issues = []), n);
|
|
2491
2478
|
};
|
|
2492
|
-
}),
|
|
2493
|
-
|
|
2479
|
+
}), Fr = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
|
|
2480
|
+
_.init(e, t), b(e._zod, "values", () => t.in._zod.values), b(e._zod, "optin", () => t.in._zod.optin), b(e._zod, "optout", () => t.out._zod.optout), b(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
2494
2481
|
if (r.direction === "backward") {
|
|
2495
2482
|
const s = t.out._zod.run(n, r);
|
|
2496
|
-
return s instanceof Promise ? s.then((i) =>
|
|
2483
|
+
return s instanceof Promise ? s.then((i) => Y(i, t.in, r)) : Y(s, t.in, r);
|
|
2497
2484
|
}
|
|
2498
2485
|
const o = t.in._zod.run(n, r);
|
|
2499
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2486
|
+
return o instanceof Promise ? o.then((s) => Y(s, t.out, r)) : Y(o, t.out, r);
|
|
2500
2487
|
};
|
|
2501
2488
|
});
|
|
2502
|
-
function
|
|
2489
|
+
function Y(e, t, n) {
|
|
2503
2490
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
2504
2491
|
}
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2492
|
+
const Wr = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
|
|
2493
|
+
_.init(e, t), b(e._zod, "propValues", () => t.innerType._zod.propValues), b(e._zod, "values", () => t.innerType._zod.values), b(e._zod, "optin", () => t.innerType?._zod?.optin), b(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
2507
2494
|
if (r.direction === "backward")
|
|
2508
2495
|
return t.innerType._zod.run(n, r);
|
|
2509
2496
|
const o = t.innerType._zod.run(n, r);
|
|
2510
|
-
return o instanceof Promise ? o.then(
|
|
2497
|
+
return o instanceof Promise ? o.then(Me) : Me(o);
|
|
2511
2498
|
};
|
|
2512
2499
|
});
|
|
2513
|
-
function
|
|
2500
|
+
function Me(e) {
|
|
2514
2501
|
return e.value = Object.freeze(e.value), e;
|
|
2515
2502
|
}
|
|
2516
|
-
const
|
|
2517
|
-
|
|
2503
|
+
const ht = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
|
|
2504
|
+
S.init(e, t), _.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
2518
2505
|
const r = n.value, o = t.fn(r);
|
|
2519
2506
|
if (o instanceof Promise)
|
|
2520
|
-
return o.then((s) =>
|
|
2521
|
-
|
|
2507
|
+
return o.then((s) => Ne(s, n, r, e));
|
|
2508
|
+
Ne(o, n, r, e);
|
|
2522
2509
|
};
|
|
2523
2510
|
});
|
|
2524
|
-
function
|
|
2511
|
+
function Ne(e, t, n, r) {
|
|
2525
2512
|
if (!e) {
|
|
2526
2513
|
const o = {
|
|
2527
2514
|
code: "custom",
|
|
@@ -2533,17 +2520,22 @@ function je(e, t, n, r) {
|
|
|
2533
2520
|
continue: !r._zod.def.abort
|
|
2534
2521
|
// params: inst._zod.def.params,
|
|
2535
2522
|
};
|
|
2536
|
-
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(
|
|
2523
|
+
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(W(o));
|
|
2537
2524
|
}
|
|
2538
2525
|
}
|
|
2539
|
-
var
|
|
2540
|
-
class
|
|
2526
|
+
var Re;
|
|
2527
|
+
class Ur {
|
|
2541
2528
|
constructor() {
|
|
2542
2529
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
2543
2530
|
}
|
|
2544
2531
|
add(t, ...n) {
|
|
2545
2532
|
const r = n[0];
|
|
2546
|
-
|
|
2533
|
+
if (this._map.set(t, r), r && typeof r == "object" && "id" in r) {
|
|
2534
|
+
if (this._idmap.has(r.id))
|
|
2535
|
+
throw new Error(`ID ${r.id} already exists in the registry`);
|
|
2536
|
+
this._idmap.set(r.id, t);
|
|
2537
|
+
}
|
|
2538
|
+
return this;
|
|
2547
2539
|
}
|
|
2548
2540
|
clear() {
|
|
2549
2541
|
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
@@ -2566,70 +2558,63 @@ class Kr {
|
|
|
2566
2558
|
return this._map.has(t);
|
|
2567
2559
|
}
|
|
2568
2560
|
}
|
|
2569
|
-
function
|
|
2570
|
-
return new
|
|
2561
|
+
function jr() {
|
|
2562
|
+
return new Ur();
|
|
2571
2563
|
}
|
|
2572
|
-
(
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2575
|
-
function Xr(e, t) {
|
|
2564
|
+
(Re = globalThis).__zod_globalRegistry ?? (Re.__zod_globalRegistry = jr());
|
|
2565
|
+
const G = globalThis.__zod_globalRegistry;
|
|
2566
|
+
function Vr(e, t) {
|
|
2576
2567
|
return new e({
|
|
2577
2568
|
type: "string",
|
|
2578
|
-
...
|
|
2569
|
+
...d(t)
|
|
2579
2570
|
});
|
|
2580
2571
|
}
|
|
2581
|
-
|
|
2582
|
-
function Hr(e, t) {
|
|
2572
|
+
function Br(e, t) {
|
|
2583
2573
|
return new e({
|
|
2584
2574
|
type: "string",
|
|
2585
2575
|
format: "email",
|
|
2586
2576
|
check: "string_format",
|
|
2587
2577
|
abort: !1,
|
|
2588
|
-
...
|
|
2578
|
+
...d(t)
|
|
2589
2579
|
});
|
|
2590
2580
|
}
|
|
2591
|
-
|
|
2592
|
-
function Qr(e, t) {
|
|
2581
|
+
function Yr(e, t) {
|
|
2593
2582
|
return new e({
|
|
2594
2583
|
type: "string",
|
|
2595
2584
|
format: "uuid",
|
|
2596
2585
|
check: "string_format",
|
|
2597
2586
|
abort: !1,
|
|
2598
|
-
...
|
|
2587
|
+
...d(t)
|
|
2599
2588
|
});
|
|
2600
2589
|
}
|
|
2601
|
-
|
|
2602
|
-
function eo(e, t) {
|
|
2590
|
+
function Gr(e, t) {
|
|
2603
2591
|
return new e({
|
|
2604
2592
|
type: "string",
|
|
2605
2593
|
format: "url",
|
|
2606
2594
|
check: "string_format",
|
|
2607
2595
|
abort: !1,
|
|
2608
|
-
...
|
|
2596
|
+
...d(t)
|
|
2609
2597
|
});
|
|
2610
2598
|
}
|
|
2611
|
-
|
|
2612
|
-
function to(e, t) {
|
|
2599
|
+
function Kr(e, t) {
|
|
2613
2600
|
return new e({
|
|
2614
2601
|
type: "string",
|
|
2615
2602
|
format: "ipv4",
|
|
2616
2603
|
check: "string_format",
|
|
2617
2604
|
abort: !1,
|
|
2618
|
-
...
|
|
2605
|
+
...d(t)
|
|
2619
2606
|
});
|
|
2620
2607
|
}
|
|
2621
|
-
|
|
2622
|
-
function no(e, t) {
|
|
2608
|
+
function qr(e, t) {
|
|
2623
2609
|
return new e({
|
|
2624
2610
|
type: "string",
|
|
2625
2611
|
format: "ipv6",
|
|
2626
2612
|
check: "string_format",
|
|
2627
2613
|
abort: !1,
|
|
2628
|
-
...
|
|
2614
|
+
...d(t)
|
|
2629
2615
|
});
|
|
2630
2616
|
}
|
|
2631
|
-
|
|
2632
|
-
function ro(e, t) {
|
|
2617
|
+
function Xr(e, t) {
|
|
2633
2618
|
return new e({
|
|
2634
2619
|
type: "string",
|
|
2635
2620
|
format: "datetime",
|
|
@@ -2637,233 +2622,204 @@ function ro(e, t) {
|
|
|
2637
2622
|
offset: !1,
|
|
2638
2623
|
local: !1,
|
|
2639
2624
|
precision: null,
|
|
2640
|
-
...
|
|
2625
|
+
...d(t)
|
|
2641
2626
|
});
|
|
2642
2627
|
}
|
|
2643
|
-
|
|
2644
|
-
function oo(e, t) {
|
|
2628
|
+
function Hr(e, t) {
|
|
2645
2629
|
return new e({
|
|
2646
2630
|
type: "string",
|
|
2647
2631
|
format: "date",
|
|
2648
2632
|
check: "string_format",
|
|
2649
|
-
...
|
|
2633
|
+
...d(t)
|
|
2650
2634
|
});
|
|
2651
2635
|
}
|
|
2652
|
-
|
|
2653
|
-
function so(e, t) {
|
|
2636
|
+
function Jr(e, t) {
|
|
2654
2637
|
return new e({
|
|
2655
2638
|
type: "string",
|
|
2656
2639
|
format: "time",
|
|
2657
2640
|
check: "string_format",
|
|
2658
2641
|
precision: null,
|
|
2659
|
-
...
|
|
2642
|
+
...d(t)
|
|
2660
2643
|
});
|
|
2661
2644
|
}
|
|
2662
|
-
|
|
2663
|
-
function io(e, t) {
|
|
2645
|
+
function Qr(e, t) {
|
|
2664
2646
|
return new e({
|
|
2665
2647
|
type: "string",
|
|
2666
2648
|
format: "duration",
|
|
2667
2649
|
check: "string_format",
|
|
2668
|
-
...
|
|
2650
|
+
...d(t)
|
|
2669
2651
|
});
|
|
2670
2652
|
}
|
|
2671
|
-
|
|
2672
|
-
function ao(e, t) {
|
|
2653
|
+
function eo(e, t) {
|
|
2673
2654
|
return new e({
|
|
2674
2655
|
type: "number",
|
|
2675
2656
|
checks: [],
|
|
2676
|
-
...
|
|
2657
|
+
...d(t)
|
|
2677
2658
|
});
|
|
2678
2659
|
}
|
|
2679
|
-
|
|
2680
|
-
function uo(e, t) {
|
|
2660
|
+
function to(e, t) {
|
|
2681
2661
|
return new e({
|
|
2682
2662
|
type: "number",
|
|
2683
2663
|
check: "number_format",
|
|
2684
2664
|
abort: !1,
|
|
2685
2665
|
format: "safeint",
|
|
2686
|
-
...
|
|
2666
|
+
...d(t)
|
|
2687
2667
|
});
|
|
2688
2668
|
}
|
|
2689
|
-
|
|
2690
|
-
function co(e, t) {
|
|
2669
|
+
function no(e, t) {
|
|
2691
2670
|
return new e({
|
|
2692
2671
|
type: "boolean",
|
|
2693
|
-
...
|
|
2672
|
+
...d(t)
|
|
2694
2673
|
});
|
|
2695
2674
|
}
|
|
2696
|
-
|
|
2697
|
-
function lo(e) {
|
|
2675
|
+
function ro(e) {
|
|
2698
2676
|
return new e({
|
|
2699
2677
|
type: "any"
|
|
2700
2678
|
});
|
|
2701
2679
|
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
return new pr({
|
|
2680
|
+
function oo(e, t) {
|
|
2681
|
+
return new sr({
|
|
2705
2682
|
check: "less_than",
|
|
2706
|
-
...
|
|
2683
|
+
...d(t),
|
|
2707
2684
|
value: e,
|
|
2708
2685
|
inclusive: !0
|
|
2709
2686
|
});
|
|
2710
2687
|
}
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
return new dr({
|
|
2688
|
+
function so(e, t) {
|
|
2689
|
+
return new ir({
|
|
2714
2690
|
check: "greater_than",
|
|
2715
|
-
...
|
|
2691
|
+
...d(t),
|
|
2716
2692
|
value: e,
|
|
2717
2693
|
inclusive: !0
|
|
2718
2694
|
});
|
|
2719
2695
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
return new fr({
|
|
2696
|
+
function ne(e, t) {
|
|
2697
|
+
return new ur({
|
|
2723
2698
|
check: "max_length",
|
|
2724
|
-
...
|
|
2699
|
+
...d(t),
|
|
2725
2700
|
maximum: e
|
|
2726
2701
|
});
|
|
2727
2702
|
}
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
return new hr({
|
|
2703
|
+
function R(e, t) {
|
|
2704
|
+
return new cr({
|
|
2731
2705
|
check: "min_length",
|
|
2732
|
-
...
|
|
2706
|
+
...d(t),
|
|
2733
2707
|
minimum: e
|
|
2734
2708
|
});
|
|
2735
2709
|
}
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
return new yr({
|
|
2710
|
+
function ft(e, t) {
|
|
2711
|
+
return new lr({
|
|
2739
2712
|
check: "length_equals",
|
|
2740
|
-
...
|
|
2713
|
+
...d(t),
|
|
2741
2714
|
length: e
|
|
2742
2715
|
});
|
|
2743
2716
|
}
|
|
2744
|
-
// @__NO_SIDE_EFFECTS__
|
|
2745
2717
|
function bt(e, t) {
|
|
2746
|
-
return new
|
|
2718
|
+
return new pr({
|
|
2747
2719
|
check: "string_format",
|
|
2748
2720
|
format: "regex",
|
|
2749
|
-
...
|
|
2721
|
+
...d(t),
|
|
2750
2722
|
pattern: e
|
|
2751
2723
|
});
|
|
2752
2724
|
}
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
return new br({
|
|
2725
|
+
function io(e) {
|
|
2726
|
+
return new dr({
|
|
2756
2727
|
check: "string_format",
|
|
2757
2728
|
format: "lowercase",
|
|
2758
|
-
...
|
|
2729
|
+
...d(e)
|
|
2759
2730
|
});
|
|
2760
2731
|
}
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
return new _r({
|
|
2732
|
+
function ao(e) {
|
|
2733
|
+
return new mr({
|
|
2764
2734
|
check: "string_format",
|
|
2765
2735
|
format: "uppercase",
|
|
2766
|
-
...
|
|
2736
|
+
...d(e)
|
|
2767
2737
|
});
|
|
2768
2738
|
}
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
return new vr({
|
|
2739
|
+
function uo(e, t) {
|
|
2740
|
+
return new hr({
|
|
2772
2741
|
check: "string_format",
|
|
2773
2742
|
format: "includes",
|
|
2774
|
-
...
|
|
2743
|
+
...d(t),
|
|
2775
2744
|
includes: e
|
|
2776
2745
|
});
|
|
2777
2746
|
}
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
return new wr({
|
|
2747
|
+
function co(e, t) {
|
|
2748
|
+
return new fr({
|
|
2781
2749
|
check: "string_format",
|
|
2782
2750
|
format: "starts_with",
|
|
2783
|
-
...
|
|
2751
|
+
...d(t),
|
|
2784
2752
|
prefix: e
|
|
2785
2753
|
});
|
|
2786
2754
|
}
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
return new Sr({
|
|
2755
|
+
function lo(e, t) {
|
|
2756
|
+
return new br({
|
|
2790
2757
|
check: "string_format",
|
|
2791
2758
|
format: "ends_with",
|
|
2792
|
-
...
|
|
2759
|
+
...d(t),
|
|
2793
2760
|
suffix: e
|
|
2794
2761
|
});
|
|
2795
2762
|
}
|
|
2796
|
-
// @__NO_SIDE_EFFECTS__
|
|
2797
2763
|
function x(e) {
|
|
2798
|
-
return new
|
|
2764
|
+
return new gr({
|
|
2799
2765
|
check: "overwrite",
|
|
2800
2766
|
tx: e
|
|
2801
2767
|
});
|
|
2802
2768
|
}
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
return /* @__PURE__ */ x((t) => t.normalize(e));
|
|
2769
|
+
function po(e) {
|
|
2770
|
+
return x((t) => t.normalize(e));
|
|
2806
2771
|
}
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
return /* @__PURE__ */ x((e) => e.trim());
|
|
2772
|
+
function mo() {
|
|
2773
|
+
return x((e) => e.trim());
|
|
2810
2774
|
}
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
return /* @__PURE__ */ x((e) => e.toLowerCase());
|
|
2775
|
+
function ho() {
|
|
2776
|
+
return x((e) => e.toLowerCase());
|
|
2814
2777
|
}
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
return /* @__PURE__ */ x((e) => e.toUpperCase());
|
|
2778
|
+
function fo() {
|
|
2779
|
+
return x((e) => e.toUpperCase());
|
|
2818
2780
|
}
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
return /* @__PURE__ */ x((e) => Mn(e));
|
|
2781
|
+
function bo() {
|
|
2782
|
+
return x((e) => Zn(e));
|
|
2822
2783
|
}
|
|
2823
|
-
|
|
2824
|
-
function To(e, t, n) {
|
|
2784
|
+
function go(e, t, n) {
|
|
2825
2785
|
return new e({
|
|
2826
2786
|
type: "array",
|
|
2827
2787
|
element: t,
|
|
2828
2788
|
// get element() {
|
|
2829
2789
|
// return element;
|
|
2830
2790
|
// },
|
|
2831
|
-
...
|
|
2791
|
+
...d(n)
|
|
2832
2792
|
});
|
|
2833
2793
|
}
|
|
2834
|
-
|
|
2835
|
-
function _t(e, t, n) {
|
|
2794
|
+
function gt(e, t, n) {
|
|
2836
2795
|
return new e({
|
|
2837
2796
|
type: "custom",
|
|
2838
2797
|
check: "custom",
|
|
2839
2798
|
fn: t,
|
|
2840
|
-
...
|
|
2799
|
+
...d(n)
|
|
2841
2800
|
});
|
|
2842
2801
|
}
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
const t = /* @__PURE__ */ zo((n) => (n.addIssue = (r) => {
|
|
2802
|
+
function yt(e) {
|
|
2803
|
+
const t = yo((n) => (n.addIssue = (r) => {
|
|
2846
2804
|
if (typeof r == "string")
|
|
2847
|
-
n.issues.push(
|
|
2805
|
+
n.issues.push(W(r, n.value, t._zod.def));
|
|
2848
2806
|
else {
|
|
2849
2807
|
const o = r;
|
|
2850
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(
|
|
2808
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(W(o));
|
|
2851
2809
|
}
|
|
2852
2810
|
}, e(n.value, n)));
|
|
2853
2811
|
return t;
|
|
2854
2812
|
}
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
const n = new $({
|
|
2813
|
+
function yo(e, t) {
|
|
2814
|
+
const n = new S({
|
|
2858
2815
|
check: "custom",
|
|
2859
|
-
...
|
|
2816
|
+
...d(t)
|
|
2860
2817
|
});
|
|
2861
2818
|
return n._zod.check = e, n;
|
|
2862
2819
|
}
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
...f(r),
|
|
2820
|
+
function _o(e, t, n, r = {}) {
|
|
2821
|
+
const o = d(r), s = {
|
|
2822
|
+
...d(r),
|
|
2867
2823
|
check: "string_format",
|
|
2868
2824
|
type: "string",
|
|
2869
2825
|
format: t,
|
|
@@ -2872,374 +2828,49 @@ function Ao(e, t, n, r = {}) {
|
|
|
2872
2828
|
};
|
|
2873
2829
|
return n instanceof RegExp && (s.pattern = n), new e(s);
|
|
2874
2830
|
}
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
target: t,
|
|
2881
|
-
unrepresentable: e?.unrepresentable ?? "throw",
|
|
2882
|
-
override: e?.override ?? (() => {
|
|
2883
|
-
}),
|
|
2884
|
-
io: e?.io ?? "output",
|
|
2885
|
-
counter: 0,
|
|
2886
|
-
seen: /* @__PURE__ */ new Map(),
|
|
2887
|
-
cycles: e?.cycles ?? "ref",
|
|
2888
|
-
reused: e?.reused ?? "inline",
|
|
2889
|
-
external: e?.external ?? void 0
|
|
2890
|
-
};
|
|
2831
|
+
const vo = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
|
|
2832
|
+
wr.init(e, t), re.init(e, t);
|
|
2833
|
+
});
|
|
2834
|
+
function ko(e) {
|
|
2835
|
+
return Xr(vo, e);
|
|
2891
2836
|
}
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
const i = { schema: {}, count: 1, cycle: void 0, path: n.path };
|
|
2898
|
-
t.seen.set(e, i);
|
|
2899
|
-
const a = e._zod.toJSONSchema?.();
|
|
2900
|
-
if (a)
|
|
2901
|
-
i.schema = a;
|
|
2902
|
-
else {
|
|
2903
|
-
const p = {
|
|
2904
|
-
...n,
|
|
2905
|
-
schemaPath: [...n.schemaPath, e],
|
|
2906
|
-
path: n.path
|
|
2907
|
-
};
|
|
2908
|
-
if (e._zod.processJSONSchema)
|
|
2909
|
-
e._zod.processJSONSchema(t, i.schema, p);
|
|
2910
|
-
else {
|
|
2911
|
-
const m = i.schema, h = t.processors[o.type];
|
|
2912
|
-
if (!h)
|
|
2913
|
-
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
2914
|
-
h(e, t, m, p);
|
|
2915
|
-
}
|
|
2916
|
-
const d = e._zod.parent;
|
|
2917
|
-
d && (i.ref || (i.ref = d), O(d, t, p), t.seen.get(d).isParent = !0);
|
|
2918
|
-
}
|
|
2919
|
-
const u = t.metadataRegistry.get(e);
|
|
2920
|
-
return u && Object.assign(i.schema, u), t.io === "input" && A(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
2921
|
-
}
|
|
2922
|
-
function St(e, t) {
|
|
2923
|
-
const n = e.seen.get(t);
|
|
2924
|
-
if (!n)
|
|
2925
|
-
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
2926
|
-
const r = /* @__PURE__ */ new Map();
|
|
2927
|
-
for (const i of e.seen.entries()) {
|
|
2928
|
-
const a = e.metadataRegistry.get(i[0])?.id;
|
|
2929
|
-
if (a) {
|
|
2930
|
-
const u = r.get(a);
|
|
2931
|
-
if (u && u !== i[0])
|
|
2932
|
-
throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2933
|
-
r.set(a, i[0]);
|
|
2934
|
-
}
|
|
2935
|
-
}
|
|
2936
|
-
const o = (i) => {
|
|
2937
|
-
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2938
|
-
if (e.external) {
|
|
2939
|
-
const d = e.external.registry.get(i[0])?.id, m = e.external.uri ?? ((P) => P);
|
|
2940
|
-
if (d)
|
|
2941
|
-
return { ref: m(d) };
|
|
2942
|
-
const h = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
2943
|
-
return i[1].defId = h, { defId: h, ref: `${m("__shared")}#/${a}/${h}` };
|
|
2944
|
-
}
|
|
2945
|
-
if (i[1] === n)
|
|
2946
|
-
return { ref: "#" };
|
|
2947
|
-
const c = `#/${a}/`, p = i[1].schema.id ?? `__schema${e.counter++}`;
|
|
2948
|
-
return { defId: p, ref: c + p };
|
|
2949
|
-
}, s = (i) => {
|
|
2950
|
-
if (i[1].schema.$ref)
|
|
2951
|
-
return;
|
|
2952
|
-
const a = i[1], { ref: u, defId: c } = o(i);
|
|
2953
|
-
a.def = { ...a.schema }, c && (a.defId = c);
|
|
2954
|
-
const p = a.schema;
|
|
2955
|
-
for (const d in p)
|
|
2956
|
-
delete p[d];
|
|
2957
|
-
p.$ref = u;
|
|
2958
|
-
};
|
|
2959
|
-
if (e.cycles === "throw")
|
|
2960
|
-
for (const i of e.seen.entries()) {
|
|
2961
|
-
const a = i[1];
|
|
2962
|
-
if (a.cycle)
|
|
2963
|
-
throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
2964
|
-
|
|
2965
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
2966
|
-
}
|
|
2967
|
-
for (const i of e.seen.entries()) {
|
|
2968
|
-
const a = i[1];
|
|
2969
|
-
if (t === i[0]) {
|
|
2970
|
-
s(i);
|
|
2971
|
-
continue;
|
|
2972
|
-
}
|
|
2973
|
-
if (e.external) {
|
|
2974
|
-
const c = e.external.registry.get(i[0])?.id;
|
|
2975
|
-
if (t !== i[0] && c) {
|
|
2976
|
-
s(i);
|
|
2977
|
-
continue;
|
|
2978
|
-
}
|
|
2979
|
-
}
|
|
2980
|
-
if (e.metadataRegistry.get(i[0])?.id) {
|
|
2981
|
-
s(i);
|
|
2982
|
-
continue;
|
|
2983
|
-
}
|
|
2984
|
-
if (a.cycle) {
|
|
2985
|
-
s(i);
|
|
2986
|
-
continue;
|
|
2987
|
-
}
|
|
2988
|
-
if (a.count > 1 && e.reused === "ref") {
|
|
2989
|
-
s(i);
|
|
2990
|
-
continue;
|
|
2991
|
-
}
|
|
2992
|
-
}
|
|
2837
|
+
const wo = /* @__PURE__ */ l("ZodISODate", (e, t) => {
|
|
2838
|
+
Tr.init(e, t), re.init(e, t);
|
|
2839
|
+
});
|
|
2840
|
+
function To(e) {
|
|
2841
|
+
return Hr(wo, e);
|
|
2993
2842
|
}
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
const a = e.seen.get(i);
|
|
3000
|
-
if (a.ref === null)
|
|
3001
|
-
return;
|
|
3002
|
-
const u = a.def ?? a.schema, c = { ...u }, p = a.ref;
|
|
3003
|
-
if (a.ref = null, p) {
|
|
3004
|
-
r(p);
|
|
3005
|
-
const m = e.seen.get(p), h = m.schema;
|
|
3006
|
-
if (h.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (u.allOf = u.allOf ?? [], u.allOf.push(h)) : Object.assign(u, h), Object.assign(u, c), i._zod.parent === p)
|
|
3007
|
-
for (const k in u)
|
|
3008
|
-
k === "$ref" || k === "allOf" || k in c || delete u[k];
|
|
3009
|
-
if (h.$ref && m.def)
|
|
3010
|
-
for (const k in u)
|
|
3011
|
-
k === "$ref" || k === "allOf" || k in m.def && JSON.stringify(u[k]) === JSON.stringify(m.def[k]) && delete u[k];
|
|
3012
|
-
}
|
|
3013
|
-
const d = i._zod.parent;
|
|
3014
|
-
if (d && d !== p) {
|
|
3015
|
-
r(d);
|
|
3016
|
-
const m = e.seen.get(d);
|
|
3017
|
-
if (m?.schema.$ref && (u.$ref = m.schema.$ref, m.def))
|
|
3018
|
-
for (const h in u)
|
|
3019
|
-
h === "$ref" || h === "allOf" || h in m.def && JSON.stringify(u[h]) === JSON.stringify(m.def[h]) && delete u[h];
|
|
3020
|
-
}
|
|
3021
|
-
e.override({
|
|
3022
|
-
zodSchema: i,
|
|
3023
|
-
jsonSchema: u,
|
|
3024
|
-
path: a.path ?? []
|
|
3025
|
-
});
|
|
3026
|
-
};
|
|
3027
|
-
for (const i of [...e.seen.entries()].reverse())
|
|
3028
|
-
r(i[0]);
|
|
3029
|
-
const o = {};
|
|
3030
|
-
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) {
|
|
3031
|
-
const i = e.external.registry.get(t)?.id;
|
|
3032
|
-
if (!i)
|
|
3033
|
-
throw new Error("Schema is missing an `id` property");
|
|
3034
|
-
o.$id = e.external.uri(i);
|
|
3035
|
-
}
|
|
3036
|
-
Object.assign(o, n.def ?? n.schema);
|
|
3037
|
-
const s = e.external?.defs ?? {};
|
|
3038
|
-
for (const i of e.seen.entries()) {
|
|
3039
|
-
const a = i[1];
|
|
3040
|
-
a.def && a.defId && (s[a.defId] = a.def);
|
|
3041
|
-
}
|
|
3042
|
-
e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? o.$defs = s : o.definitions = s);
|
|
3043
|
-
try {
|
|
3044
|
-
const i = JSON.parse(JSON.stringify(o));
|
|
3045
|
-
return Object.defineProperty(i, "~standard", {
|
|
3046
|
-
value: {
|
|
3047
|
-
...t["~standard"],
|
|
3048
|
-
jsonSchema: {
|
|
3049
|
-
input: X(t, "input", e.processors),
|
|
3050
|
-
output: X(t, "output", e.processors)
|
|
3051
|
-
}
|
|
3052
|
-
},
|
|
3053
|
-
enumerable: !1,
|
|
3054
|
-
writable: !1
|
|
3055
|
-
}), i;
|
|
3056
|
-
} catch {
|
|
3057
|
-
throw new Error("Error converting schema to JSON.");
|
|
3058
|
-
}
|
|
2843
|
+
const Ao = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
|
|
2844
|
+
Ar.init(e, t), re.init(e, t);
|
|
2845
|
+
});
|
|
2846
|
+
function So(e) {
|
|
2847
|
+
return Jr(Ao, e);
|
|
3059
2848
|
}
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
const r = e._zod.def;
|
|
3066
|
-
if (r.type === "transform")
|
|
3067
|
-
return !0;
|
|
3068
|
-
if (r.type === "array")
|
|
3069
|
-
return A(r.element, n);
|
|
3070
|
-
if (r.type === "set")
|
|
3071
|
-
return A(r.valueType, n);
|
|
3072
|
-
if (r.type === "lazy")
|
|
3073
|
-
return A(r.getter(), n);
|
|
3074
|
-
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
3075
|
-
return A(r.innerType, n);
|
|
3076
|
-
if (r.type === "intersection")
|
|
3077
|
-
return A(r.left, n) || A(r.right, n);
|
|
3078
|
-
if (r.type === "record" || r.type === "map")
|
|
3079
|
-
return A(r.keyType, n) || A(r.valueType, n);
|
|
3080
|
-
if (r.type === "pipe")
|
|
3081
|
-
return A(r.in, n) || A(r.out, n);
|
|
3082
|
-
if (r.type === "object") {
|
|
3083
|
-
for (const o in r.shape)
|
|
3084
|
-
if (A(r.shape[o], n))
|
|
3085
|
-
return !0;
|
|
3086
|
-
return !1;
|
|
3087
|
-
}
|
|
3088
|
-
if (r.type === "union") {
|
|
3089
|
-
for (const o of r.options)
|
|
3090
|
-
if (A(o, n))
|
|
3091
|
-
return !0;
|
|
3092
|
-
return !1;
|
|
3093
|
-
}
|
|
3094
|
-
if (r.type === "tuple") {
|
|
3095
|
-
for (const o of r.items)
|
|
3096
|
-
if (A(o, n))
|
|
3097
|
-
return !0;
|
|
3098
|
-
return !!(r.rest && A(r.rest, n));
|
|
3099
|
-
}
|
|
3100
|
-
return !1;
|
|
2849
|
+
const zo = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
|
|
2850
|
+
Sr.init(e, t), re.init(e, t);
|
|
2851
|
+
});
|
|
2852
|
+
function Eo(e) {
|
|
2853
|
+
return Qr(zo, e);
|
|
3101
2854
|
}
|
|
3102
|
-
const
|
|
3103
|
-
|
|
3104
|
-
return O(e, r), St(r, e), kt(r, e);
|
|
3105
|
-
}, X = (e, t, n = {}) => (r) => {
|
|
3106
|
-
const { libraryOptions: o, target: s } = r ?? {}, i = wt({ ...o ?? {}, target: s, io: t, processors: n });
|
|
3107
|
-
return O(e, i), St(i, e), kt(i, e);
|
|
3108
|
-
}, Eo = {
|
|
3109
|
-
guid: "uuid",
|
|
3110
|
-
url: "uri",
|
|
3111
|
-
datetime: "date-time",
|
|
3112
|
-
json_string: "json-string",
|
|
3113
|
-
regex: ""
|
|
3114
|
-
// do not set
|
|
3115
|
-
}, $o = (e, t, n, r) => {
|
|
3116
|
-
const o = n;
|
|
3117
|
-
o.type = "string";
|
|
3118
|
-
const { minimum: s, maximum: i, format: a, patterns: u, contentEncoding: c } = e._zod.bag;
|
|
3119
|
-
if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), a && (o.format = Eo[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), c && (o.contentEncoding = c), u && u.size > 0) {
|
|
3120
|
-
const p = [...u];
|
|
3121
|
-
p.length === 1 ? o.pattern = p[0].source : p.length > 1 && (o.allOf = [
|
|
3122
|
-
...p.map((d) => ({
|
|
3123
|
-
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
3124
|
-
pattern: d.source
|
|
3125
|
-
}))
|
|
3126
|
-
]);
|
|
3127
|
-
}
|
|
3128
|
-
}, Po = (e, t, n, r) => {
|
|
3129
|
-
if (t.unrepresentable === "throw")
|
|
3130
|
-
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
3131
|
-
}, Zo = (e, t, n, r) => {
|
|
3132
|
-
if (t.unrepresentable === "throw")
|
|
3133
|
-
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
3134
|
-
}, Io = (e, t, n, r) => {
|
|
3135
|
-
const o = n, s = e._zod.def, { minimum: i, maximum: a } = e._zod.bag;
|
|
3136
|
-
typeof i == "number" && (o.minItems = i), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = O(s.element, t, { ...r, path: [...r.path, "items"] });
|
|
3137
|
-
}, Co = (e, t, n, r) => {
|
|
3138
|
-
const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((a, u) => O(a, t, {
|
|
3139
|
-
...r,
|
|
3140
|
-
path: [...r.path, s ? "oneOf" : "anyOf", u]
|
|
3141
|
-
}));
|
|
3142
|
-
s ? n.oneOf = i : n.anyOf = i;
|
|
3143
|
-
}, No = (e, t, n, r) => {
|
|
3144
|
-
const o = e._zod.def, s = O(o.left, t, {
|
|
3145
|
-
...r,
|
|
3146
|
-
path: [...r.path, "allOf", 0]
|
|
3147
|
-
}), i = O(o.right, t, {
|
|
3148
|
-
...r,
|
|
3149
|
-
path: [...r.path, "allOf", 1]
|
|
3150
|
-
}), a = (c) => "allOf" in c && Object.keys(c).length === 1, u = [
|
|
3151
|
-
...a(s) ? s.allOf : [s],
|
|
3152
|
-
...a(i) ? i.allOf : [i]
|
|
3153
|
-
];
|
|
3154
|
-
n.allOf = u;
|
|
3155
|
-
}, Lo = (e, t, n, r) => {
|
|
3156
|
-
const o = e._zod.def, s = O(o.innerType, t, r), i = t.seen.get(e);
|
|
3157
|
-
t.target === "openapi-3.0" ? (i.ref = o.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
|
|
3158
|
-
}, Mo = (e, t, n, r) => {
|
|
3159
|
-
const o = e._zod.def;
|
|
3160
|
-
O(o.innerType, t, r);
|
|
3161
|
-
const s = t.seen.get(e);
|
|
3162
|
-
s.ref = o.innerType;
|
|
3163
|
-
}, Do = (e, t, n, r) => {
|
|
3164
|
-
const o = e._zod.def;
|
|
3165
|
-
O(o.innerType, t, r);
|
|
3166
|
-
const s = t.seen.get(e);
|
|
3167
|
-
s.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
3168
|
-
}, Ro = (e, t, n, r) => {
|
|
3169
|
-
const o = e._zod.def;
|
|
3170
|
-
O(o.innerType, t, r);
|
|
3171
|
-
const s = t.seen.get(e);
|
|
3172
|
-
s.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
3173
|
-
}, Fo = (e, t, n, r) => {
|
|
3174
|
-
const o = e._zod.def;
|
|
3175
|
-
O(o.innerType, t, r);
|
|
3176
|
-
const s = t.seen.get(e);
|
|
3177
|
-
s.ref = o.innerType;
|
|
3178
|
-
let i;
|
|
3179
|
-
try {
|
|
3180
|
-
i = o.catchValue(void 0);
|
|
3181
|
-
} catch {
|
|
3182
|
-
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
3183
|
-
}
|
|
3184
|
-
n.default = i;
|
|
3185
|
-
}, jo = (e, t, n, r) => {
|
|
3186
|
-
const o = e._zod.def, s = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
3187
|
-
O(s, t, r);
|
|
3188
|
-
const i = t.seen.get(e);
|
|
3189
|
-
i.ref = s;
|
|
3190
|
-
}, Wo = (e, t, n, r) => {
|
|
3191
|
-
const o = e._zod.def;
|
|
3192
|
-
O(o.innerType, t, r);
|
|
3193
|
-
const s = t.seen.get(e);
|
|
3194
|
-
s.ref = o.innerType, n.readOnly = !0;
|
|
3195
|
-
}, Tt = (e, t, n, r) => {
|
|
3196
|
-
const o = e._zod.def;
|
|
3197
|
-
O(o.innerType, t, r);
|
|
3198
|
-
const s = t.seen.get(e);
|
|
3199
|
-
s.ref = o.innerType;
|
|
3200
|
-
}, xo = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
|
|
3201
|
-
Er.init(e, t), ie.init(e, t);
|
|
3202
|
-
});
|
|
3203
|
-
function Uo(e) {
|
|
3204
|
-
return /* @__PURE__ */ ro(xo, e);
|
|
3205
|
-
}
|
|
3206
|
-
const Vo = /* @__PURE__ */ l("ZodISODate", (e, t) => {
|
|
3207
|
-
$r.init(e, t), ie.init(e, t);
|
|
3208
|
-
});
|
|
3209
|
-
function Jo(e) {
|
|
3210
|
-
return /* @__PURE__ */ oo(Vo, e);
|
|
3211
|
-
}
|
|
3212
|
-
const Bo = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
|
|
3213
|
-
Pr.init(e, t), ie.init(e, t);
|
|
3214
|
-
});
|
|
3215
|
-
function Yo(e) {
|
|
3216
|
-
return /* @__PURE__ */ so(Bo, e);
|
|
3217
|
-
}
|
|
3218
|
-
const Go = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
|
|
3219
|
-
Zr.init(e, t), ie.init(e, t);
|
|
3220
|
-
});
|
|
3221
|
-
function Ko(e) {
|
|
3222
|
-
return /* @__PURE__ */ io(Go, e);
|
|
3223
|
-
}
|
|
3224
|
-
const qo = (e, t) => {
|
|
3225
|
-
ut.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2855
|
+
const $o = (e, t) => {
|
|
2856
|
+
st.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
3226
2857
|
format: {
|
|
3227
|
-
value: (n) =>
|
|
2858
|
+
value: (n) => Ln(e, n)
|
|
3228
2859
|
// enumerable: false,
|
|
3229
2860
|
},
|
|
3230
2861
|
flatten: {
|
|
3231
|
-
value: (n) =>
|
|
2862
|
+
value: (n) => In(e, n)
|
|
3232
2863
|
// enumerable: false,
|
|
3233
2864
|
},
|
|
3234
2865
|
addIssue: {
|
|
3235
2866
|
value: (n) => {
|
|
3236
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2867
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, ue, 2);
|
|
3237
2868
|
}
|
|
3238
2869
|
// enumerable: false,
|
|
3239
2870
|
},
|
|
3240
2871
|
addIssues: {
|
|
3241
2872
|
value: (n) => {
|
|
3242
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2873
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, ue, 2);
|
|
3243
2874
|
}
|
|
3244
2875
|
// enumerable: false,
|
|
3245
2876
|
},
|
|
@@ -3250,492 +2881,464 @@ const qo = (e, t) => {
|
|
|
3250
2881
|
// enumerable: false,
|
|
3251
2882
|
}
|
|
3252
2883
|
});
|
|
3253
|
-
},
|
|
2884
|
+
}, $ = l("ZodError", $o, {
|
|
3254
2885
|
Parent: Error
|
|
3255
|
-
}),
|
|
3256
|
-
jsonSchema: {
|
|
3257
|
-
input: X(e, "input"),
|
|
3258
|
-
output: X(e, "output")
|
|
3259
|
-
}
|
|
3260
|
-
}), e.toJSONSchema = Oo(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(Ln(t, {
|
|
2886
|
+
}), Oo = /* @__PURE__ */ H($), Zo = /* @__PURE__ */ J($), Po = /* @__PURE__ */ Q($), Co = /* @__PURE__ */ ee($), Io = /* @__PURE__ */ Nn($), Lo = /* @__PURE__ */ Rn($), Do = /* @__PURE__ */ xn($), Mo = /* @__PURE__ */ Fn($), No = /* @__PURE__ */ Wn($), Ro = /* @__PURE__ */ Un($), xo = /* @__PURE__ */ jn($), Fo = /* @__PURE__ */ Vn($), A = /* @__PURE__ */ l("ZodType", (e, t) => (_.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(On(t, {
|
|
3261
2887
|
checks: [
|
|
3262
2888
|
...t.checks ?? [],
|
|
3263
2889
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
3264
2890
|
]
|
|
3265
|
-
}), {
|
|
3266
|
-
parent: !0
|
|
3267
|
-
}), e.with = e.check, e.clone = (n, r) => it(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Xo(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Qo(e, n, r), e.parseAsync = async (n, r) => Ho(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => es(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => ts(e, n, r), e.decode = (n, r) => ns(e, n, r), e.encodeAsync = async (n, r) => rs(e, n, r), e.decodeAsync = async (n, r) => os(e, n, r), e.safeEncode = (n, r) => ss(e, n, r), e.safeDecode = (n, r) => is(e, n, r), e.safeEncodeAsync = async (n, r) => as(e, n, r), e.safeDecodeAsync = async (n, r) => us(e, n, r), e.refine = (n, r) => e.check(Ns(n, r)), e.superRefine = (n) => e.check(Ls(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ x(n)), e.optional = () => xe(e), e.exactOptional = () => vs(e), e.nullable = () => Ue(e), e.nullish = () => xe(Ue(e)), e.nonoptional = (n) => Os(e, n), e.array = () => ps(e), e.or = (n) => ms([e, n]), e.and = (n) => hs(e, n), e.transform = (n) => Ve(e, gs(n)), e.default = (n) => ks(e, n), e.prefault = (n) => zs(e, n), e.catch = (n) => $s(e, n), e.pipe = (n) => Ve(e, n), e.readonly = () => Is(e), e.describe = (n) => {
|
|
2891
|
+
})), e.clone = (n, r) => rt(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Oo(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Po(e, n, r), e.parseAsync = async (n, r) => Zo(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Co(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Io(e, n, r), e.decode = (n, r) => Lo(e, n, r), e.encodeAsync = async (n, r) => Do(e, n, r), e.decodeAsync = async (n, r) => Mo(e, n, r), e.safeEncode = (n, r) => No(e, n, r), e.safeDecode = (n, r) => Ro(e, n, r), e.safeEncodeAsync = async (n, r) => xo(e, n, r), e.safeDecodeAsync = async (n, r) => Fo(e, n, r), e.refine = (n, r) => e.check(ls(n, r)), e.superRefine = (n) => e.check(ps(n)), e.overwrite = (n) => e.check(x(n)), e.optional = () => xe(e), e.nullable = () => Fe(e), e.nullish = () => xe(Fe(e)), e.nonoptional = (n) => rs(e, n), e.array = () => jo(e), e.or = (n) => Bo([e, n]), e.and = (n) => Go(e, n), e.transform = (n) => We(e, qo(n)), e.default = (n) => Qo(e, n), e.prefault = (n) => ts(e, n), e.catch = (n) => ss(e, n), e.pipe = (n) => We(e, n), e.readonly = () => us(e), e.describe = (n) => {
|
|
3268
2892
|
const r = e.clone();
|
|
3269
|
-
return
|
|
2893
|
+
return G.add(r, { description: n }), r;
|
|
3270
2894
|
}, Object.defineProperty(e, "description", {
|
|
3271
2895
|
get() {
|
|
3272
|
-
return
|
|
2896
|
+
return G.get(e)?.description;
|
|
3273
2897
|
},
|
|
3274
2898
|
configurable: !0
|
|
3275
2899
|
}), e.meta = (...n) => {
|
|
3276
2900
|
if (n.length === 0)
|
|
3277
|
-
return
|
|
2901
|
+
return G.get(e);
|
|
3278
2902
|
const r = e.clone();
|
|
3279
|
-
return
|
|
3280
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e
|
|
3281
|
-
|
|
2903
|
+
return G.add(r, n[0]), r;
|
|
2904
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Wo = /* @__PURE__ */ l("_ZodString", (e, t) => {
|
|
2905
|
+
ye.init(e, t), A.init(e, t);
|
|
3282
2906
|
const n = e._zod.bag;
|
|
3283
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(
|
|
3284
|
-
}),
|
|
3285
|
-
|
|
3286
|
-
}),
|
|
3287
|
-
|
|
2907
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(bt(...r)), e.includes = (...r) => e.check(uo(...r)), e.startsWith = (...r) => e.check(co(...r)), e.endsWith = (...r) => e.check(lo(...r)), e.min = (...r) => e.check(R(...r)), e.max = (...r) => e.check(ne(...r)), e.length = (...r) => e.check(ft(...r)), e.nonempty = (...r) => e.check(R(1, ...r)), e.lowercase = (r) => e.check(io(r)), e.uppercase = (r) => e.check(ao(r)), e.trim = () => e.check(mo()), e.normalize = (...r) => e.check(po(...r)), e.toLowerCase = () => e.check(ho()), e.toUpperCase = () => e.check(fo()), e.slugify = () => e.check(bo());
|
|
2908
|
+
}), re = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
2909
|
+
E.init(e, t), Wo.init(e, t);
|
|
2910
|
+
}), Uo = /* @__PURE__ */ l("ZodArray", (e, t) => {
|
|
2911
|
+
dt.init(e, t), A.init(e, t), e.element = t.element, e.min = (n, r) => e.check(R(n, r)), e.nonempty = (n) => e.check(R(1, n)), e.max = (n, r) => e.check(ne(n, r)), e.length = (n, r) => e.check(ft(n, r)), e.unwrap = () => e.element;
|
|
3288
2912
|
});
|
|
3289
|
-
function
|
|
3290
|
-
return
|
|
2913
|
+
function jo(e, t) {
|
|
2914
|
+
return go(Uo, e, t);
|
|
3291
2915
|
}
|
|
3292
|
-
const
|
|
3293
|
-
|
|
2916
|
+
const Vo = /* @__PURE__ */ l("ZodUnion", (e, t) => {
|
|
2917
|
+
Cr.init(e, t), A.init(e, t), e.options = t.options;
|
|
3294
2918
|
});
|
|
3295
|
-
function
|
|
3296
|
-
return new
|
|
2919
|
+
function Bo(e, t) {
|
|
2920
|
+
return new Vo({
|
|
3297
2921
|
type: "union",
|
|
3298
2922
|
options: e,
|
|
3299
|
-
...
|
|
2923
|
+
...d(t)
|
|
3300
2924
|
});
|
|
3301
2925
|
}
|
|
3302
|
-
const
|
|
3303
|
-
|
|
2926
|
+
const Yo = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
|
|
2927
|
+
Ir.init(e, t), A.init(e, t);
|
|
3304
2928
|
});
|
|
3305
|
-
function
|
|
3306
|
-
return new
|
|
2929
|
+
function Go(e, t) {
|
|
2930
|
+
return new Yo({
|
|
3307
2931
|
type: "intersection",
|
|
3308
2932
|
left: e,
|
|
3309
2933
|
right: t
|
|
3310
2934
|
});
|
|
3311
2935
|
}
|
|
3312
|
-
const
|
|
3313
|
-
|
|
2936
|
+
const Ko = /* @__PURE__ */ l("ZodTransform", (e, t) => {
|
|
2937
|
+
Lr.init(e, t), A.init(e, t), e._zod.parse = (n, r) => {
|
|
3314
2938
|
if (r.direction === "backward")
|
|
3315
|
-
throw new
|
|
2939
|
+
throw new et(e.constructor.name);
|
|
3316
2940
|
n.addIssue = (s) => {
|
|
3317
2941
|
if (typeof s == "string")
|
|
3318
|
-
n.issues.push(
|
|
2942
|
+
n.issues.push(W(s, n.value, t));
|
|
3319
2943
|
else {
|
|
3320
2944
|
const i = s;
|
|
3321
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(
|
|
2945
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(W(i));
|
|
3322
2946
|
}
|
|
3323
2947
|
};
|
|
3324
2948
|
const o = t.transform(n.value, n);
|
|
3325
2949
|
return o instanceof Promise ? o.then((s) => (n.value = s, n)) : (n.value = o, n);
|
|
3326
2950
|
};
|
|
3327
2951
|
});
|
|
3328
|
-
function
|
|
3329
|
-
return new
|
|
2952
|
+
function qo(e) {
|
|
2953
|
+
return new Ko({
|
|
3330
2954
|
type: "transform",
|
|
3331
2955
|
transform: e
|
|
3332
2956
|
});
|
|
3333
2957
|
}
|
|
3334
|
-
const
|
|
3335
|
-
|
|
2958
|
+
const Xo = /* @__PURE__ */ l("ZodOptional", (e, t) => {
|
|
2959
|
+
mt.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3336
2960
|
});
|
|
3337
2961
|
function xe(e) {
|
|
3338
|
-
return new
|
|
3339
|
-
type: "optional",
|
|
3340
|
-
innerType: e
|
|
3341
|
-
});
|
|
3342
|
-
}
|
|
3343
|
-
const _s = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
|
|
3344
|
-
Wr.init(e, t), E.init(e, t), e._zod.processJSONSchema = (n, r, o) => Tt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3345
|
-
});
|
|
3346
|
-
function vs(e) {
|
|
3347
|
-
return new _s({
|
|
2962
|
+
return new Xo({
|
|
3348
2963
|
type: "optional",
|
|
3349
2964
|
innerType: e
|
|
3350
2965
|
});
|
|
3351
2966
|
}
|
|
3352
|
-
const
|
|
3353
|
-
|
|
2967
|
+
const Ho = /* @__PURE__ */ l("ZodNullable", (e, t) => {
|
|
2968
|
+
Dr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3354
2969
|
});
|
|
3355
|
-
function
|
|
3356
|
-
return new
|
|
2970
|
+
function Fe(e) {
|
|
2971
|
+
return new Ho({
|
|
3357
2972
|
type: "nullable",
|
|
3358
2973
|
innerType: e
|
|
3359
2974
|
});
|
|
3360
2975
|
}
|
|
3361
|
-
const
|
|
3362
|
-
|
|
2976
|
+
const Jo = /* @__PURE__ */ l("ZodDefault", (e, t) => {
|
|
2977
|
+
Mr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
3363
2978
|
});
|
|
3364
|
-
function
|
|
3365
|
-
return new
|
|
2979
|
+
function Qo(e, t) {
|
|
2980
|
+
return new Jo({
|
|
3366
2981
|
type: "default",
|
|
3367
2982
|
innerType: e,
|
|
3368
2983
|
get defaultValue() {
|
|
3369
|
-
return typeof t == "function" ? t() :
|
|
2984
|
+
return typeof t == "function" ? t() : nt(t);
|
|
3370
2985
|
}
|
|
3371
2986
|
});
|
|
3372
2987
|
}
|
|
3373
|
-
const
|
|
3374
|
-
|
|
2988
|
+
const es = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
|
|
2989
|
+
Nr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3375
2990
|
});
|
|
3376
|
-
function
|
|
3377
|
-
return new
|
|
2991
|
+
function ts(e, t) {
|
|
2992
|
+
return new es({
|
|
3378
2993
|
type: "prefault",
|
|
3379
2994
|
innerType: e,
|
|
3380
2995
|
get defaultValue() {
|
|
3381
|
-
return typeof t == "function" ? t() :
|
|
2996
|
+
return typeof t == "function" ? t() : nt(t);
|
|
3382
2997
|
}
|
|
3383
2998
|
});
|
|
3384
2999
|
}
|
|
3385
|
-
const
|
|
3386
|
-
|
|
3000
|
+
const ns = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
|
|
3001
|
+
Rr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3387
3002
|
});
|
|
3388
|
-
function
|
|
3389
|
-
return new
|
|
3003
|
+
function rs(e, t) {
|
|
3004
|
+
return new ns({
|
|
3390
3005
|
type: "nonoptional",
|
|
3391
3006
|
innerType: e,
|
|
3392
|
-
...
|
|
3007
|
+
...d(t)
|
|
3393
3008
|
});
|
|
3394
3009
|
}
|
|
3395
|
-
const
|
|
3396
|
-
|
|
3010
|
+
const os = /* @__PURE__ */ l("ZodCatch", (e, t) => {
|
|
3011
|
+
xr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3397
3012
|
});
|
|
3398
|
-
function
|
|
3399
|
-
return new
|
|
3013
|
+
function ss(e, t) {
|
|
3014
|
+
return new os({
|
|
3400
3015
|
type: "catch",
|
|
3401
3016
|
innerType: e,
|
|
3402
3017
|
catchValue: typeof t == "function" ? t : () => t
|
|
3403
3018
|
});
|
|
3404
3019
|
}
|
|
3405
|
-
const
|
|
3406
|
-
|
|
3020
|
+
const is = /* @__PURE__ */ l("ZodPipe", (e, t) => {
|
|
3021
|
+
Fr.init(e, t), A.init(e, t), e.in = t.in, e.out = t.out;
|
|
3407
3022
|
});
|
|
3408
|
-
function
|
|
3409
|
-
return new
|
|
3023
|
+
function We(e, t) {
|
|
3024
|
+
return new is({
|
|
3410
3025
|
type: "pipe",
|
|
3411
3026
|
in: e,
|
|
3412
3027
|
out: t
|
|
3413
3028
|
// ...util.normalizeParams(params),
|
|
3414
3029
|
});
|
|
3415
3030
|
}
|
|
3416
|
-
const
|
|
3417
|
-
|
|
3031
|
+
const as = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
|
|
3032
|
+
Wr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3418
3033
|
});
|
|
3419
|
-
function
|
|
3420
|
-
return new
|
|
3034
|
+
function us(e) {
|
|
3035
|
+
return new as({
|
|
3421
3036
|
type: "readonly",
|
|
3422
3037
|
innerType: e
|
|
3423
3038
|
});
|
|
3424
3039
|
}
|
|
3425
|
-
const
|
|
3426
|
-
|
|
3040
|
+
const cs = /* @__PURE__ */ l("ZodCustom", (e, t) => {
|
|
3041
|
+
ht.init(e, t), A.init(e, t);
|
|
3427
3042
|
});
|
|
3428
|
-
function
|
|
3429
|
-
return
|
|
3043
|
+
function ls(e, t = {}) {
|
|
3044
|
+
return gt(cs, e, t);
|
|
3430
3045
|
}
|
|
3431
|
-
function
|
|
3432
|
-
return
|
|
3046
|
+
function ps(e) {
|
|
3047
|
+
return yt(e);
|
|
3433
3048
|
}
|
|
3434
|
-
const
|
|
3049
|
+
const D = /* @__PURE__ */ l("ZodMiniType", (e, t) => {
|
|
3435
3050
|
if (!e._zod)
|
|
3436
3051
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
}
|
|
3445
|
-
|
|
3052
|
+
_.init(e, t), e.def = t, e.type = t.type, e.parse = (n, r) => Dn(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => it(e, n, r), e.parseAsync = async (n, r) => Mn(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => at(e, n, r), e.check = (...n) => e.clone(
|
|
3053
|
+
{
|
|
3054
|
+
...t,
|
|
3055
|
+
checks: [
|
|
3056
|
+
...t.checks ?? [],
|
|
3057
|
+
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
3058
|
+
]
|
|
3059
|
+
}
|
|
3060
|
+
// { parent: true }
|
|
3061
|
+
), e.clone = (n, r) => rt(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e));
|
|
3062
|
+
}), _t = /* @__PURE__ */ l("ZodMiniString", (e, t) => {
|
|
3063
|
+
ye.init(e, t), D.init(e, t);
|
|
3446
3064
|
});
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
return /* @__PURE__ */ Xr(zt, e);
|
|
3065
|
+
function Ue(e) {
|
|
3066
|
+
return Vr(_t, e);
|
|
3450
3067
|
}
|
|
3451
|
-
const
|
|
3452
|
-
|
|
3453
|
-
}),
|
|
3454
|
-
|
|
3068
|
+
const F = /* @__PURE__ */ l("ZodMiniStringFormat", (e, t) => {
|
|
3069
|
+
E.init(e, t), _t.init(e, t);
|
|
3070
|
+
}), ds = /* @__PURE__ */ l("ZodMiniEmail", (e, t) => {
|
|
3071
|
+
vr.init(e, t), F.init(e, t);
|
|
3455
3072
|
});
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
return /* @__PURE__ */ Hr(Ms, e);
|
|
3073
|
+
function ms(e) {
|
|
3074
|
+
return Br(ds, e);
|
|
3459
3075
|
}
|
|
3460
|
-
const
|
|
3461
|
-
|
|
3076
|
+
const hs = /* @__PURE__ */ l("ZodMiniUUID", (e, t) => {
|
|
3077
|
+
_r.init(e, t), F.init(e, t);
|
|
3462
3078
|
});
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
return /* @__PURE__ */ Qr(Rs, e);
|
|
3079
|
+
function fs(e) {
|
|
3080
|
+
return Yr(hs, e);
|
|
3466
3081
|
}
|
|
3467
|
-
const
|
|
3468
|
-
|
|
3082
|
+
const bs = /* @__PURE__ */ l("ZodMiniURL", (e, t) => {
|
|
3083
|
+
kr.init(e, t), F.init(e, t);
|
|
3469
3084
|
});
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
return /* @__PURE__ */ eo(js, e);
|
|
3085
|
+
function gs(e) {
|
|
3086
|
+
return Gr(bs, e);
|
|
3473
3087
|
}
|
|
3474
|
-
const
|
|
3475
|
-
|
|
3088
|
+
const ys = /* @__PURE__ */ l("ZodMiniIPv4", (e, t) => {
|
|
3089
|
+
zr.init(e, t), F.init(e, t);
|
|
3476
3090
|
});
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
return /* @__PURE__ */ to(xs, e);
|
|
3091
|
+
function _s(e) {
|
|
3092
|
+
return Kr(ys, e);
|
|
3480
3093
|
}
|
|
3481
|
-
const
|
|
3482
|
-
|
|
3094
|
+
const vs = /* @__PURE__ */ l("ZodMiniIPv6", (e, t) => {
|
|
3095
|
+
Er.init(e, t), F.init(e, t);
|
|
3483
3096
|
});
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
return /* @__PURE__ */ no(Vs, e);
|
|
3097
|
+
function ks(e) {
|
|
3098
|
+
return qr(vs, e);
|
|
3487
3099
|
}
|
|
3488
|
-
const
|
|
3489
|
-
|
|
3100
|
+
const ws = /* @__PURE__ */ l("ZodMiniCustomStringFormat", (e, t) => {
|
|
3101
|
+
$r.init(e, t), F.init(e, t);
|
|
3490
3102
|
});
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
return /* @__PURE__ */ Ao(Bs, "hostname", tr, e);
|
|
3103
|
+
function Ts(e) {
|
|
3104
|
+
return _o(ws, "hostname", qn, e);
|
|
3494
3105
|
}
|
|
3495
|
-
const
|
|
3496
|
-
|
|
3106
|
+
const vt = /* @__PURE__ */ l("ZodMiniNumber", (e, t) => {
|
|
3107
|
+
pt.init(e, t), D.init(e, t);
|
|
3497
3108
|
});
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
return /* @__PURE__ */ ao(At, e);
|
|
3109
|
+
function je(e) {
|
|
3110
|
+
return eo(vt, e);
|
|
3501
3111
|
}
|
|
3502
|
-
const
|
|
3503
|
-
|
|
3112
|
+
const As = /* @__PURE__ */ l("ZodMiniNumberFormat", (e, t) => {
|
|
3113
|
+
Or.init(e, t), vt.init(e, t);
|
|
3504
3114
|
});
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
return /* @__PURE__ */ uo(Gs, e);
|
|
3115
|
+
function Ss(e) {
|
|
3116
|
+
return to(As, e);
|
|
3508
3117
|
}
|
|
3509
|
-
const
|
|
3510
|
-
|
|
3118
|
+
const zs = /* @__PURE__ */ l("ZodMiniBoolean", (e, t) => {
|
|
3119
|
+
Zr.init(e, t), D.init(e, t);
|
|
3511
3120
|
});
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
return /* @__PURE__ */ co(qs, e);
|
|
3121
|
+
function Ve(e) {
|
|
3122
|
+
return no(zs, e);
|
|
3515
3123
|
}
|
|
3516
|
-
const
|
|
3517
|
-
|
|
3124
|
+
const Es = /* @__PURE__ */ l("ZodMiniAny", (e, t) => {
|
|
3125
|
+
Pr.init(e, t), D.init(e, t);
|
|
3518
3126
|
});
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
return /* @__PURE__ */ lo(Xs);
|
|
3127
|
+
function pe() {
|
|
3128
|
+
return ro(Es);
|
|
3522
3129
|
}
|
|
3523
|
-
const
|
|
3524
|
-
|
|
3130
|
+
const $s = /* @__PURE__ */ l("ZodMiniArray", (e, t) => {
|
|
3131
|
+
dt.init(e, t), D.init(e, t);
|
|
3525
3132
|
});
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
return new Hs({
|
|
3133
|
+
function Be(e, t) {
|
|
3134
|
+
return new $s({
|
|
3529
3135
|
type: "array",
|
|
3530
3136
|
element: e,
|
|
3531
|
-
...
|
|
3137
|
+
...d(t)
|
|
3532
3138
|
});
|
|
3533
3139
|
}
|
|
3534
|
-
const
|
|
3535
|
-
|
|
3140
|
+
const Os = /* @__PURE__ */ l("ZodMiniOptional", (e, t) => {
|
|
3141
|
+
mt.init(e, t), D.init(e, t);
|
|
3536
3142
|
});
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
return new Qs({
|
|
3143
|
+
function Zs(e) {
|
|
3144
|
+
return new Os({
|
|
3540
3145
|
type: "optional",
|
|
3541
3146
|
innerType: e
|
|
3542
3147
|
});
|
|
3543
3148
|
}
|
|
3544
|
-
const
|
|
3545
|
-
|
|
3546
|
-
});
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
}
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
date: { schema:
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
duration: { schema: Ko() }
|
|
3566
|
-
}, ni = Object.keys(he), ri = (e) => (t, n) => {
|
|
3149
|
+
const Ps = /* @__PURE__ */ l("ZodMiniCustom", (e, t) => {
|
|
3150
|
+
ht.init(e, t), D.init(e, t);
|
|
3151
|
+
});
|
|
3152
|
+
function k(e, t = {}) {
|
|
3153
|
+
return gt(Ps, e, t);
|
|
3154
|
+
}
|
|
3155
|
+
function kt(e) {
|
|
3156
|
+
return yt(e);
|
|
3157
|
+
}
|
|
3158
|
+
const de = {
|
|
3159
|
+
email: { schema: ms() },
|
|
3160
|
+
hostname: { schema: Ts() },
|
|
3161
|
+
ipv4: { schema: _s() },
|
|
3162
|
+
ipv6: { schema: ks() },
|
|
3163
|
+
url: { schema: gs() },
|
|
3164
|
+
uuid: { schema: fs() },
|
|
3165
|
+
date: { schema: To() },
|
|
3166
|
+
time: { schema: So() },
|
|
3167
|
+
"date-time": { schema: ko() },
|
|
3168
|
+
duration: { schema: Eo() }
|
|
3169
|
+
}, Cs = Object.keys(de), Is = (e) => (t, n) => {
|
|
3567
3170
|
switch (t.type) {
|
|
3568
3171
|
case "string":
|
|
3569
|
-
return
|
|
3172
|
+
return Ls(t, n);
|
|
3570
3173
|
case "integer":
|
|
3571
3174
|
case "number":
|
|
3572
|
-
return
|
|
3175
|
+
return Ms(t, n);
|
|
3573
3176
|
case "boolean":
|
|
3574
|
-
return
|
|
3177
|
+
return Ns(t, n);
|
|
3575
3178
|
case "array":
|
|
3576
|
-
return
|
|
3179
|
+
return Rs(t, n);
|
|
3577
3180
|
case "custom": {
|
|
3578
3181
|
if (!e)
|
|
3579
3182
|
throw new Error(
|
|
3580
3183
|
'Validator type "custom" requires a customValidators object, but it was not supplied.'
|
|
3581
3184
|
);
|
|
3582
|
-
return
|
|
3185
|
+
return xs(t, e);
|
|
3583
3186
|
}
|
|
3584
3187
|
}
|
|
3585
3188
|
};
|
|
3586
|
-
function
|
|
3189
|
+
function g(e, t) {
|
|
3587
3190
|
if (e !== void 0)
|
|
3588
3191
|
return typeof e == "string" ? e : t?.translate(e.key, e.params, e.default) ?? e.default;
|
|
3589
3192
|
}
|
|
3590
|
-
function
|
|
3591
|
-
return
|
|
3592
|
-
const r =
|
|
3593
|
-
let o = r ?
|
|
3193
|
+
function Ls(e, t) {
|
|
3194
|
+
return j(e, (n) => {
|
|
3195
|
+
const r = g(n.messages?.invalid, t);
|
|
3196
|
+
let o = r ? Ue(r) : Ue();
|
|
3594
3197
|
if (n.required === !0) {
|
|
3595
|
-
const s =
|
|
3596
|
-
o = o.check(
|
|
3198
|
+
const s = g(n.messages?.required, t) ?? "This field is required";
|
|
3199
|
+
o = o.check(k((i) => i.length > 0, { error: s }));
|
|
3597
3200
|
}
|
|
3598
3201
|
if (typeof n.minLength == "number") {
|
|
3599
|
-
const s =
|
|
3202
|
+
const s = g(n.messages?.minLength, t), i = n.minLength;
|
|
3600
3203
|
o = o.check(
|
|
3601
|
-
s ?
|
|
3204
|
+
s ? k((a) => a.length >= i, { error: s }) : R(i)
|
|
3602
3205
|
);
|
|
3603
3206
|
}
|
|
3604
3207
|
if (typeof n.maxLength == "number") {
|
|
3605
|
-
const s =
|
|
3208
|
+
const s = g(n.messages?.maxLength, t), i = n.maxLength;
|
|
3606
3209
|
o = o.check(
|
|
3607
|
-
s ?
|
|
3210
|
+
s ? k((a) => a.length <= i, { error: s }) : ne(i)
|
|
3608
3211
|
);
|
|
3609
3212
|
}
|
|
3610
3213
|
if (typeof n.pattern == "string") {
|
|
3611
|
-
const s =
|
|
3214
|
+
const s = g(n.messages?.pattern, t), i = new RegExp(n.pattern);
|
|
3612
3215
|
o = o.check(
|
|
3613
|
-
s ?
|
|
3216
|
+
s ? k((a) => i.test(a), { error: s }) : bt(i)
|
|
3614
3217
|
);
|
|
3615
3218
|
}
|
|
3616
3219
|
if (n.enum) {
|
|
3617
|
-
const s = n.enum, i =
|
|
3618
|
-
o = o.check(
|
|
3220
|
+
const s = n.enum, i = g(n.messages?.enum, t);
|
|
3221
|
+
o = o.check(k((a) => s.includes(a), i ? { error: i } : void 0));
|
|
3619
3222
|
}
|
|
3620
3223
|
if (n.const !== void 0) {
|
|
3621
|
-
const s =
|
|
3622
|
-
o = o.check(
|
|
3224
|
+
const s = g(n.messages?.const, t);
|
|
3225
|
+
o = o.check(k((i) => i === n.const, s ? { error: s } : void 0));
|
|
3623
3226
|
}
|
|
3624
3227
|
if (n.format !== void 0)
|
|
3625
|
-
if (
|
|
3626
|
-
const s =
|
|
3228
|
+
if (Cs.includes(n.format)) {
|
|
3229
|
+
const s = g(n.messages?.format, t);
|
|
3627
3230
|
o = o.check(
|
|
3628
|
-
s ?
|
|
3629
|
-
const u =
|
|
3630
|
-
|
|
3231
|
+
s ? kt((i, a) => {
|
|
3232
|
+
const u = Ye(
|
|
3233
|
+
de[n.format].schema,
|
|
3631
3234
|
i
|
|
3632
3235
|
);
|
|
3633
|
-
|
|
3634
|
-
}) :
|
|
3236
|
+
Ge(u) || a.addIssue({ code: "custom", path: [], message: s });
|
|
3237
|
+
}) : de[n.format].schema
|
|
3635
3238
|
);
|
|
3636
3239
|
} else
|
|
3637
3240
|
console.error(`The string validation format "${n.format}" is not supported`);
|
|
3638
3241
|
return o;
|
|
3639
3242
|
});
|
|
3640
3243
|
}
|
|
3641
|
-
const
|
|
3244
|
+
const Ds = (e, t) => {
|
|
3642
3245
|
if (t === 0)
|
|
3643
3246
|
return !1;
|
|
3644
3247
|
const n = e / t;
|
|
3645
3248
|
return Math.abs(n - Math.round(n)) < 1e-10;
|
|
3646
3249
|
};
|
|
3647
|
-
function
|
|
3648
|
-
return
|
|
3649
|
-
const r =
|
|
3650
|
-
let o = r ?
|
|
3651
|
-
if (n.type === "integer" && (o = o.check(
|
|
3652
|
-
const s =
|
|
3653
|
-
o = o.check(s ?
|
|
3250
|
+
function Ms(e, t) {
|
|
3251
|
+
return j(e, (n) => {
|
|
3252
|
+
const r = g(n.messages?.invalid, t);
|
|
3253
|
+
let o = r ? je(r) : je();
|
|
3254
|
+
if (n.type === "integer" && (o = o.check(Ss())), n.minimum !== void 0) {
|
|
3255
|
+
const s = g(n.messages?.minimum, t), i = n.minimum;
|
|
3256
|
+
o = o.check(s ? k((a) => a >= i, { error: s }) : so(i));
|
|
3654
3257
|
}
|
|
3655
3258
|
if (n.maximum !== void 0) {
|
|
3656
|
-
const s =
|
|
3657
|
-
o = o.check(s ?
|
|
3259
|
+
const s = g(n.messages?.maximum, t), i = n.maximum;
|
|
3260
|
+
o = o.check(s ? k((a) => a <= i, { error: s }) : oo(i));
|
|
3658
3261
|
}
|
|
3659
3262
|
if (n.exclusiveMinimum !== void 0) {
|
|
3660
|
-
const s =
|
|
3661
|
-
o = o.check(
|
|
3263
|
+
const s = g(n.messages?.exclusiveMinimum, t), i = n.exclusiveMinimum;
|
|
3264
|
+
o = o.check(k((a) => a > i, s ? { error: s } : void 0));
|
|
3662
3265
|
}
|
|
3663
3266
|
if (n.exclusiveMaximum !== void 0) {
|
|
3664
|
-
const s =
|
|
3665
|
-
o = o.check(
|
|
3267
|
+
const s = g(n.messages?.exclusiveMaximum, t), i = n.exclusiveMaximum;
|
|
3268
|
+
o = o.check(k((a) => a < i, s ? { error: s } : void 0));
|
|
3666
3269
|
}
|
|
3667
3270
|
if (n.multipleOf !== void 0) {
|
|
3668
|
-
const s =
|
|
3271
|
+
const s = g(n.messages?.multipleOf, t), i = n.multipleOf;
|
|
3669
3272
|
o = o.check(
|
|
3670
|
-
|
|
3273
|
+
k((a) => Ds(a, i), s ? { error: s } : void 0)
|
|
3671
3274
|
);
|
|
3672
3275
|
}
|
|
3673
3276
|
if (n.enum) {
|
|
3674
|
-
const s = n.enum, i =
|
|
3675
|
-
o = o.check(
|
|
3277
|
+
const s = n.enum, i = g(n.messages?.enum, t);
|
|
3278
|
+
o = o.check(k((a) => s.includes(a), i ? { error: i } : void 0));
|
|
3676
3279
|
}
|
|
3677
3280
|
if (n.const !== void 0) {
|
|
3678
|
-
const s =
|
|
3679
|
-
o = o.check(
|
|
3281
|
+
const s = g(n.messages?.const, t);
|
|
3282
|
+
o = o.check(k((i) => i === n.const, s ? { error: s } : void 0));
|
|
3680
3283
|
}
|
|
3681
3284
|
return o;
|
|
3682
3285
|
});
|
|
3683
3286
|
}
|
|
3684
|
-
function
|
|
3685
|
-
return
|
|
3686
|
-
const r =
|
|
3687
|
-
let o = r ?
|
|
3287
|
+
function Ns(e, t) {
|
|
3288
|
+
return j(e, (n) => {
|
|
3289
|
+
const r = g(n.messages?.invalid, t);
|
|
3290
|
+
let o = r ? Ve(r) : Ve();
|
|
3688
3291
|
if (n.const !== void 0) {
|
|
3689
|
-
const s =
|
|
3690
|
-
o = o.check(
|
|
3292
|
+
const s = g(n.messages?.const, t);
|
|
3293
|
+
o = o.check(k((i) => i === n.const, s ? { error: s } : void 0));
|
|
3691
3294
|
}
|
|
3692
3295
|
return o;
|
|
3693
3296
|
});
|
|
3694
3297
|
}
|
|
3695
|
-
function
|
|
3696
|
-
return
|
|
3697
|
-
const r =
|
|
3698
|
-
let o = r ?
|
|
3298
|
+
function Rs(e, t) {
|
|
3299
|
+
return j(e, (n) => {
|
|
3300
|
+
const r = g(n.messages?.invalid, t);
|
|
3301
|
+
let o = r ? Be(pe(), r) : Be(pe());
|
|
3699
3302
|
if (n.required === !0) {
|
|
3700
|
-
const s =
|
|
3701
|
-
o = o.check(
|
|
3303
|
+
const s = g(n.messages?.required, t) ?? "This field is required";
|
|
3304
|
+
o = o.check(k((i) => i.length > 0, { error: s }));
|
|
3702
3305
|
}
|
|
3703
3306
|
if (typeof n.minItems == "number") {
|
|
3704
|
-
const s =
|
|
3307
|
+
const s = g(n.messages?.minItems, t), i = n.minItems;
|
|
3705
3308
|
o = o.check(
|
|
3706
|
-
s ?
|
|
3309
|
+
s ? k((a) => a.length >= i, { error: s }) : R(i)
|
|
3707
3310
|
);
|
|
3708
3311
|
}
|
|
3709
3312
|
if (typeof n.maxItems == "number") {
|
|
3710
|
-
const s =
|
|
3313
|
+
const s = g(n.messages?.maxItems, t), i = n.maxItems;
|
|
3711
3314
|
o = o.check(
|
|
3712
|
-
s ?
|
|
3315
|
+
s ? k((a) => a.length <= i, { error: s }) : ne(i)
|
|
3713
3316
|
);
|
|
3714
3317
|
}
|
|
3715
3318
|
return o;
|
|
3716
3319
|
});
|
|
3717
3320
|
}
|
|
3718
|
-
function
|
|
3719
|
-
return
|
|
3720
|
-
let r =
|
|
3721
|
-
return
|
|
3321
|
+
function xs(e, t) {
|
|
3322
|
+
return j(e, (n) => {
|
|
3323
|
+
let r = pe();
|
|
3324
|
+
return At(
|
|
3722
3325
|
Object.keys(n),
|
|
3723
3326
|
// filter non-custom validator keys
|
|
3724
3327
|
(o) => o !== "type" && o !== "required",
|
|
3725
3328
|
(o) => {
|
|
3726
3329
|
const s = n[o], i = t[o], a = i(s);
|
|
3727
3330
|
r = r.check(
|
|
3728
|
-
|
|
3729
|
-
const p =
|
|
3331
|
+
kt((u, c) => {
|
|
3332
|
+
const p = Ye(
|
|
3730
3333
|
a,
|
|
3731
3334
|
u
|
|
3732
3335
|
);
|
|
3733
|
-
if (!
|
|
3734
|
-
const
|
|
3336
|
+
if (!Ge(p)) {
|
|
3337
|
+
const m = p.issues[0];
|
|
3735
3338
|
c.addIssue({
|
|
3736
3339
|
code: "custom",
|
|
3737
3340
|
path: [],
|
|
3738
|
-
message:
|
|
3341
|
+
message: m?.message || `Validation failed for ${o}`
|
|
3739
3342
|
});
|
|
3740
3343
|
}
|
|
3741
3344
|
})
|
|
@@ -3744,11 +3347,11 @@ function ci(e, t) {
|
|
|
3744
3347
|
), r;
|
|
3745
3348
|
});
|
|
3746
3349
|
}
|
|
3747
|
-
function
|
|
3350
|
+
function j(e, t) {
|
|
3748
3351
|
const n = t(e);
|
|
3749
|
-
return e.required ? n :
|
|
3352
|
+
return e.required ? n : Zs(n);
|
|
3750
3353
|
}
|
|
3751
|
-
const
|
|
3354
|
+
const Fs = {
|
|
3752
3355
|
// ACTION
|
|
3753
3356
|
button: async () => (await import("./button.element-3a7rRHbA.js")).ButtonElement,
|
|
3754
3357
|
// INPUTS
|
|
@@ -3783,12 +3386,12 @@ const li = {
|
|
|
3783
3386
|
markdownText: async () => (await import("./markdown-text.element-B8TfVLIO.js")).MarkdownTextElement,
|
|
3784
3387
|
renderer: async () => (await import("./renderer.element-CNyMn2Lu.js")).RendererElement
|
|
3785
3388
|
};
|
|
3786
|
-
var
|
|
3787
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
3389
|
+
var Ws = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, oe = (e, t, n, r) => {
|
|
3390
|
+
for (var o = r > 1 ? void 0 : r ? Us(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
3788
3391
|
(i = e[s]) && (o = (r ? i(t, n, o) : i(o)) || o);
|
|
3789
|
-
return r && o &&
|
|
3392
|
+
return r && o && Ws(t, n, o), o;
|
|
3790
3393
|
};
|
|
3791
|
-
let
|
|
3394
|
+
let U = class extends St {
|
|
3792
3395
|
constructor() {
|
|
3793
3396
|
super(...arguments), this.autocomplete = void 0;
|
|
3794
3397
|
}
|
|
@@ -3802,10 +3405,10 @@ let B = class extends Zt {
|
|
|
3802
3405
|
return this;
|
|
3803
3406
|
}
|
|
3804
3407
|
render() {
|
|
3805
|
-
const e = this.config, t =
|
|
3408
|
+
const e = this.config, t = En(e.formDef, e.formSelectors, e.formConfig), n = {
|
|
3806
3409
|
formDef: t.formDef,
|
|
3807
3410
|
widgetLoaders: {
|
|
3808
|
-
...
|
|
3411
|
+
...Fs,
|
|
3809
3412
|
...t.widgetLoaders,
|
|
3810
3413
|
...e.customWidgetLoaders ?? {}
|
|
3811
3414
|
},
|
|
@@ -3820,10 +3423,10 @@ let B = class extends Zt {
|
|
|
3820
3423
|
data: e.data,
|
|
3821
3424
|
meta: e.meta,
|
|
3822
3425
|
formName: e.formName
|
|
3823
|
-
}, r =
|
|
3426
|
+
}, r = Is({
|
|
3824
3427
|
...e.customValidators ?? {}
|
|
3825
3428
|
}), o = t.formEvent, s = o ? (i) => o(i.detail) : void 0;
|
|
3826
|
-
return
|
|
3429
|
+
return zt`
|
|
3827
3430
|
<gui-core-form
|
|
3828
3431
|
.config=${n}
|
|
3829
3432
|
.validators=${r}
|
|
@@ -3833,19 +3436,19 @@ let B = class extends Zt {
|
|
|
3833
3436
|
`;
|
|
3834
3437
|
}
|
|
3835
3438
|
};
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
],
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
],
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
],
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
],
|
|
3439
|
+
oe([
|
|
3440
|
+
Ke({ attribute: !1 })
|
|
3441
|
+
], U.prototype, "config", 2);
|
|
3442
|
+
oe([
|
|
3443
|
+
Ke({ type: String })
|
|
3444
|
+
], U.prototype, "autocomplete", 2);
|
|
3445
|
+
oe([
|
|
3446
|
+
Et("gui-core-form")
|
|
3447
|
+
], U.prototype, "coreForm", 2);
|
|
3448
|
+
U = oe([
|
|
3449
|
+
$t("gui-form")
|
|
3450
|
+
], U);
|
|
3848
3451
|
export {
|
|
3849
|
-
|
|
3850
|
-
|
|
3452
|
+
U as FormElement,
|
|
3453
|
+
Fs as widgetLoaders
|
|
3851
3454
|
};
|