dsh-run2skill 0.5.0-alpha.4 → 0.5.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +6 -12
- package/README.md +6 -12
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/lib/client.js +643 -410
- package/lib/index.d.ts +3 -1
- package/lib/index.js +98 -17
- package/package.json +31 -28
package/lib/client.js
CHANGED
|
@@ -6,7 +6,7 @@ window.__ModuleLoader__.load({
|
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
9
|
-
//#region node_modules/.pnpm/zod@4.
|
|
9
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.js
|
|
10
10
|
function getEnumValues(entries) {
|
|
11
11
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
12
12
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -18,14 +18,22 @@ window.__ModuleLoader__.load({
|
|
|
18
18
|
if (typeof value === "bigint") return value.toString();
|
|
19
19
|
return value;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
var Cached = class {
|
|
22
|
+
constructor(getter) {
|
|
23
|
+
this._getter = getter;
|
|
24
|
+
this._value = void 0;
|
|
25
|
+
}
|
|
26
|
+
get value() {
|
|
27
|
+
const getter = this._getter;
|
|
28
|
+
if (getter !== void 0) {
|
|
29
|
+
this._value = getter();
|
|
30
|
+
this._getter = void 0;
|
|
27
31
|
}
|
|
28
|
-
|
|
32
|
+
return this._value;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function cached(getter) {
|
|
36
|
+
return new Cached(getter);
|
|
29
37
|
}
|
|
30
38
|
function nullish(input) {
|
|
31
39
|
return input === null || input === void 0;
|
|
@@ -68,6 +76,58 @@ window.__ModuleLoader__.load({
|
|
|
68
76
|
configurable: true
|
|
69
77
|
});
|
|
70
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
|
|
81
|
+
*
|
|
82
|
+
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
|
|
83
|
+
*/
|
|
84
|
+
function rawShape(def) {
|
|
85
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
86
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
87
|
+
}
|
|
88
|
+
function sourceShape(schema) {
|
|
89
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
90
|
+
}
|
|
91
|
+
function deferProp(target, key, getter) {
|
|
92
|
+
Object.defineProperty(target, key, {
|
|
93
|
+
get() {
|
|
94
|
+
const value = getter();
|
|
95
|
+
assignProp(this, key, value);
|
|
96
|
+
return value;
|
|
97
|
+
},
|
|
98
|
+
enumerable: true,
|
|
99
|
+
configurable: true
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function putProp(target, key, value) {
|
|
103
|
+
if (key in target) assignProp(target, key, value);
|
|
104
|
+
else target[key] = value;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
|
|
108
|
+
*
|
|
109
|
+
* A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
|
|
110
|
+
*/
|
|
111
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
112
|
+
const raw = sourceShape(source);
|
|
113
|
+
for (const key of keys) {
|
|
114
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
115
|
+
if (!desc.enumerable) continue;
|
|
116
|
+
if (desc.get) deferProp(target, key, () => {
|
|
117
|
+
const value = source._zod.def.shape[key];
|
|
118
|
+
return wrap ? wrap(value, key) : value;
|
|
119
|
+
});
|
|
120
|
+
else putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function mirrorProps(target, source) {
|
|
124
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
125
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
126
|
+
if (!desc.enumerable) continue;
|
|
127
|
+
if (desc.get) deferProp(target, key, () => source[key]);
|
|
128
|
+
else putProp(target, key, desc.value);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
71
131
|
function mergeDefs(...defs) {
|
|
72
132
|
const mergedDescriptors = {};
|
|
73
133
|
for (const def of defs) {
|
|
@@ -158,39 +218,39 @@ window.__ModuleLoader__.load({
|
|
|
158
218
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
159
219
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
160
220
|
}))();
|
|
221
|
+
const BIGINT_FORMAT_RANGES = {
|
|
222
|
+
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
|
|
223
|
+
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
|
|
224
|
+
};
|
|
161
225
|
function pick(schema, mask) {
|
|
162
226
|
const currDef = schema._zod.def;
|
|
163
227
|
const checks = currDef.checks;
|
|
164
228
|
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
170
|
-
if (!mask[key]) continue;
|
|
171
|
-
assignProp(newShape, key, currDef.shape[key]);
|
|
172
|
-
}
|
|
173
|
-
assignProp(this, "shape", newShape);
|
|
174
|
-
return newShape;
|
|
175
|
-
},
|
|
229
|
+
const newShape = {};
|
|
230
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
231
|
+
return clone(schema, mergeDefs(currDef, {
|
|
232
|
+
shape: newShape,
|
|
176
233
|
checks: []
|
|
177
234
|
}));
|
|
178
235
|
}
|
|
236
|
+
function maskedKeys(schema, mask) {
|
|
237
|
+
const raw = sourceShape(schema);
|
|
238
|
+
const keys = [];
|
|
239
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
240
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
241
|
+
if (mask[key]) keys.push(key);
|
|
242
|
+
}
|
|
243
|
+
return keys;
|
|
244
|
+
}
|
|
179
245
|
function omit(schema, mask) {
|
|
180
246
|
const currDef = schema._zod.def;
|
|
181
247
|
const checks = currDef.checks;
|
|
182
248
|
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (!mask[key]) continue;
|
|
189
|
-
delete newShape[key];
|
|
190
|
-
}
|
|
191
|
-
assignProp(this, "shape", newShape);
|
|
192
|
-
return newShape;
|
|
193
|
-
},
|
|
249
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
250
|
+
const newShape = {};
|
|
251
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
252
|
+
return clone(schema, mergeDefs(currDef, {
|
|
253
|
+
shape: newShape,
|
|
194
254
|
checks: []
|
|
195
255
|
}));
|
|
196
256
|
}
|
|
@@ -198,41 +258,29 @@ window.__ModuleLoader__.load({
|
|
|
198
258
|
if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
199
259
|
const checks = schema._zod.def.checks;
|
|
200
260
|
if (checks && checks.length > 0) {
|
|
201
|
-
const existingShape = schema
|
|
261
|
+
const existingShape = sourceShape(schema);
|
|
202
262
|
for (const key of Reflect.ownKeys(shape)) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
203
263
|
}
|
|
204
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
} }));
|
|
264
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
265
|
+
}
|
|
266
|
+
function extended(schema, shape) {
|
|
267
|
+
const newShape = {};
|
|
268
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
269
|
+
mirrorProps(newShape, shape);
|
|
270
|
+
return newShape;
|
|
212
271
|
}
|
|
213
272
|
function safeExtend(schema, shape) {
|
|
214
273
|
if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
215
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
216
|
-
const _shape = {
|
|
217
|
-
...schema._zod.def.shape,
|
|
218
|
-
...shape
|
|
219
|
-
};
|
|
220
|
-
assignProp(this, "shape", _shape);
|
|
221
|
-
return _shape;
|
|
222
|
-
} }));
|
|
274
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
223
275
|
}
|
|
224
276
|
function merge(a, b) {
|
|
225
277
|
if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
226
278
|
if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
279
|
+
const newShape = {};
|
|
280
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
281
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
227
282
|
return clone(a, mergeDefs(a._zod.def, {
|
|
228
|
-
|
|
229
|
-
const _shape = {
|
|
230
|
-
...a._zod.def.shape,
|
|
231
|
-
...b._zod.def.shape
|
|
232
|
-
};
|
|
233
|
-
assignProp(this, "shape", _shape);
|
|
234
|
-
return _shape;
|
|
235
|
-
},
|
|
283
|
+
shape: newShape,
|
|
236
284
|
get catchall() {
|
|
237
285
|
return b._zod.def.catchall;
|
|
238
286
|
},
|
|
@@ -242,47 +290,25 @@ window.__ModuleLoader__.load({
|
|
|
242
290
|
function partial(Class, schema, mask, name = "partial") {
|
|
243
291
|
const checks = schema._zod.def.checks;
|
|
244
292
|
if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
293
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
294
|
+
const newShape = {};
|
|
295
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({
|
|
296
|
+
type: "optional",
|
|
297
|
+
innerType: value
|
|
298
|
+
})));
|
|
245
299
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
246
|
-
|
|
247
|
-
const oldShape = schema._zod.def.shape;
|
|
248
|
-
const shape = { ...oldShape };
|
|
249
|
-
if (mask) for (const key of Reflect.ownKeys(mask)) {
|
|
250
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
251
|
-
if (!mask[key]) continue;
|
|
252
|
-
shape[key] = Class ? new Class({
|
|
253
|
-
type: "optional",
|
|
254
|
-
innerType: oldShape[key]
|
|
255
|
-
}) : oldShape[key];
|
|
256
|
-
}
|
|
257
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = Class ? new Class({
|
|
258
|
-
type: "optional",
|
|
259
|
-
innerType: oldShape[key]
|
|
260
|
-
}) : oldShape[key];
|
|
261
|
-
assignProp(this, "shape", shape);
|
|
262
|
-
return shape;
|
|
263
|
-
},
|
|
300
|
+
shape: newShape,
|
|
264
301
|
checks: []
|
|
265
302
|
}));
|
|
266
303
|
}
|
|
267
304
|
function required(Class, schema, mask) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
type: "nonoptional",
|
|
276
|
-
innerType: oldShape[key]
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = new Class({
|
|
280
|
-
type: "nonoptional",
|
|
281
|
-
innerType: oldShape[key]
|
|
282
|
-
});
|
|
283
|
-
assignProp(this, "shape", shape);
|
|
284
|
-
return shape;
|
|
285
|
-
} }));
|
|
305
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
306
|
+
const newShape = {};
|
|
307
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({
|
|
308
|
+
type: "nonoptional",
|
|
309
|
+
innerType: value
|
|
310
|
+
}));
|
|
311
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
286
312
|
}
|
|
287
313
|
function aborted(x, startIndex = 0) {
|
|
288
314
|
if (x.aborted === true) return true;
|
|
@@ -305,6 +331,17 @@ window.__ModuleLoader__.load({
|
|
|
305
331
|
function unwrapMessage(message) {
|
|
306
332
|
return typeof message === "string" ? message : message?.message;
|
|
307
333
|
}
|
|
334
|
+
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
|
|
335
|
+
function sizeCaps(defChecks) {
|
|
336
|
+
const caps = [];
|
|
337
|
+
for (const ch of defChecks ?? []) {
|
|
338
|
+
const d = ch._zod.def;
|
|
339
|
+
if (!/_(length|size)$|_equals$/.test(d.check)) break;
|
|
340
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
341
|
+
if (max >= 0) caps.push([max, ch]);
|
|
342
|
+
}
|
|
343
|
+
return caps;
|
|
344
|
+
}
|
|
308
345
|
function attachSchema(issues, start, inst) {
|
|
309
346
|
var _a;
|
|
310
347
|
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
@@ -318,11 +355,15 @@ window.__ModuleLoader__.load({
|
|
|
318
355
|
}
|
|
319
356
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
320
357
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
358
|
+
const full = {};
|
|
359
|
+
for (const k of Object.keys(iss)) {
|
|
360
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
361
|
+
full[k] = iss[k];
|
|
362
|
+
}
|
|
363
|
+
full.path ?? (full.path = []);
|
|
364
|
+
full.message = message;
|
|
365
|
+
if (ctx?.reportInput) full.input = iss.input;
|
|
366
|
+
return full;
|
|
326
367
|
}
|
|
327
368
|
const highSurrogate = /[\uD800-\uDBFF]/;
|
|
328
369
|
function codePointLength(str) {
|
|
@@ -392,6 +433,23 @@ window.__ModuleLoader__.load({
|
|
|
392
433
|
function hide(inst, key, value) {
|
|
393
434
|
return own(inst, key, value, false);
|
|
394
435
|
}
|
|
436
|
+
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
437
|
+
function derived(computes, table) {
|
|
438
|
+
for (const key in computes) {
|
|
439
|
+
const compute = computes[key];
|
|
440
|
+
Object.defineProperty(table, key, {
|
|
441
|
+
configurable: true,
|
|
442
|
+
enumerable: true,
|
|
443
|
+
get() {
|
|
444
|
+
return own(this, key, compute(this));
|
|
445
|
+
},
|
|
446
|
+
set(value) {
|
|
447
|
+
own(this, key, value);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
return table;
|
|
452
|
+
}
|
|
395
453
|
function defineBound(proto, key, fn) {
|
|
396
454
|
Object.defineProperty(proto, key, {
|
|
397
455
|
configurable: true,
|
|
@@ -500,9 +558,9 @@ window.__ModuleLoader__.load({
|
|
|
500
558
|
return fn;
|
|
501
559
|
}
|
|
502
560
|
//#endregion
|
|
503
|
-
//#region node_modules/.pnpm/zod@4.
|
|
561
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.js
|
|
504
562
|
var _a$1;
|
|
505
|
-
const _zodDesc
|
|
563
|
+
const _zodDesc = {
|
|
506
564
|
value: void 0,
|
|
507
565
|
enumerable: false
|
|
508
566
|
};
|
|
@@ -539,14 +597,13 @@ window.__ModuleLoader__.load({
|
|
|
539
597
|
const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
|
|
540
598
|
function init(inst, def) {
|
|
541
599
|
if (!inst._zod) {
|
|
542
|
-
_zodDesc
|
|
600
|
+
_zodDesc.value = new Internals(def);
|
|
543
601
|
try {
|
|
544
|
-
Object.defineProperty(inst, "_zod", _zodDesc
|
|
602
|
+
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
545
603
|
} finally {
|
|
546
|
-
_zodDesc
|
|
604
|
+
_zodDesc.value = void 0;
|
|
547
605
|
}
|
|
548
|
-
}
|
|
549
|
-
if (inst._zod.traits.has(name)) return;
|
|
606
|
+
} else if (inst._zod.traits.has(name)) return;
|
|
550
607
|
inst._zod.traits.add(name);
|
|
551
608
|
initializer(inst, def);
|
|
552
609
|
if (initialized) {
|
|
@@ -607,7 +664,7 @@ window.__ModuleLoader__.load({
|
|
|
607
664
|
return globalConfig;
|
|
608
665
|
}
|
|
609
666
|
//#endregion
|
|
610
|
-
//#region node_modules/.pnpm/zod@4.
|
|
667
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.js
|
|
611
668
|
function _getMessage() {
|
|
612
669
|
const internals = this._zod;
|
|
613
670
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -622,10 +679,6 @@ window.__ModuleLoader__.load({
|
|
|
622
679
|
enumerable: true,
|
|
623
680
|
configurable: true
|
|
624
681
|
};
|
|
625
|
-
const _zodDesc = {
|
|
626
|
-
value: void 0,
|
|
627
|
-
enumerable: false
|
|
628
|
-
};
|
|
629
682
|
const _issuesDesc = {
|
|
630
683
|
value: void 0,
|
|
631
684
|
enumerable: false
|
|
@@ -633,11 +686,8 @@ window.__ModuleLoader__.load({
|
|
|
633
686
|
const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
634
687
|
const initializer$1 = (inst, def) => {
|
|
635
688
|
inst.name = "$ZodError";
|
|
636
|
-
_zodDesc.value = inst._zod;
|
|
637
|
-
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
638
689
|
_issuesDesc.value = def;
|
|
639
690
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
640
|
-
_zodDesc.value = void 0;
|
|
641
691
|
_issuesDesc.value = void 0;
|
|
642
692
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
643
693
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -666,7 +716,7 @@ window.__ModuleLoader__.load({
|
|
|
666
716
|
}
|
|
667
717
|
};
|
|
668
718
|
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
669
|
-
|
|
719
|
+
$constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
670
720
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
671
721
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
672
722
|
* "__proto__" would hit the setter instead of creating a key. */
|
|
@@ -730,7 +780,7 @@ window.__ModuleLoader__.load({
|
|
|
730
780
|
return fieldErrors;
|
|
731
781
|
}
|
|
732
782
|
//#endregion
|
|
733
|
-
//#region node_modules/.pnpm/zod@4.
|
|
783
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/parse.js
|
|
734
784
|
function finalizeParams(callee, params) {
|
|
735
785
|
return {
|
|
736
786
|
callee: params?.callee ?? callee,
|
|
@@ -787,15 +837,30 @@ window.__ModuleLoader__.load({
|
|
|
787
837
|
issues: []
|
|
788
838
|
}, ctx);
|
|
789
839
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
790
|
-
return result.issues.length ? {
|
|
791
|
-
success: false,
|
|
792
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
793
|
-
} : {
|
|
840
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
794
841
|
success: true,
|
|
795
842
|
data: result.value
|
|
796
843
|
};
|
|
797
844
|
};
|
|
798
|
-
|
|
845
|
+
function failure(Err, issues, ctx) {
|
|
846
|
+
let error;
|
|
847
|
+
return {
|
|
848
|
+
success: false,
|
|
849
|
+
get error() {
|
|
850
|
+
if (!error) {
|
|
851
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
852
|
+
issues = void 0;
|
|
853
|
+
ctx = void 0;
|
|
854
|
+
}
|
|
855
|
+
return error;
|
|
856
|
+
},
|
|
857
|
+
set error(e) {
|
|
858
|
+
error = e;
|
|
859
|
+
issues = void 0;
|
|
860
|
+
ctx = void 0;
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
}
|
|
799
864
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
800
865
|
const ctx = _ctx ? {
|
|
801
866
|
..._ctx,
|
|
@@ -806,15 +871,61 @@ window.__ModuleLoader__.load({
|
|
|
806
871
|
issues: []
|
|
807
872
|
}, ctx);
|
|
808
873
|
if (result instanceof Promise) result = await result;
|
|
809
|
-
return result.issues.length ? {
|
|
810
|
-
success: false,
|
|
811
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
812
|
-
} : {
|
|
874
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
813
875
|
success: true,
|
|
814
876
|
data: result.value
|
|
815
877
|
};
|
|
816
878
|
};
|
|
817
|
-
const
|
|
879
|
+
const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
880
|
+
const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
881
|
+
const validate = ((schema, value, _ctx) => {
|
|
882
|
+
const validator = schema._zod.bag.validator;
|
|
883
|
+
if (validator !== void 0) {
|
|
884
|
+
if (validator(value) !== COMPILE_INVALID) return true;
|
|
885
|
+
if (validator.definite === true && _ctx === void 0) return false;
|
|
886
|
+
}
|
|
887
|
+
return validateFallback(schema, value, _ctx);
|
|
888
|
+
});
|
|
889
|
+
function validateFallback(schema, value, _ctx) {
|
|
890
|
+
const ctx = _ctx ? {
|
|
891
|
+
..._ctx,
|
|
892
|
+
async: false,
|
|
893
|
+
abortEarly: true
|
|
894
|
+
} : {
|
|
895
|
+
async: false,
|
|
896
|
+
abortEarly: true
|
|
897
|
+
};
|
|
898
|
+
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
899
|
+
let result;
|
|
900
|
+
if (fallbackRun) {
|
|
901
|
+
ctx[COMPILE_FALLBACK] = true;
|
|
902
|
+
result = fallbackRun({
|
|
903
|
+
value,
|
|
904
|
+
issues: []
|
|
905
|
+
}, ctx);
|
|
906
|
+
} else result = schema._zod.run({
|
|
907
|
+
value,
|
|
908
|
+
issues: []
|
|
909
|
+
}, ctx);
|
|
910
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
911
|
+
return result.issues.length === 0;
|
|
912
|
+
}
|
|
913
|
+
const validateAsync$1 = async (schema, value, _ctx) => {
|
|
914
|
+
const ctx = _ctx ? {
|
|
915
|
+
..._ctx,
|
|
916
|
+
async: true,
|
|
917
|
+
abortEarly: true
|
|
918
|
+
} : {
|
|
919
|
+
async: true,
|
|
920
|
+
abortEarly: true
|
|
921
|
+
};
|
|
922
|
+
let result = schema._zod.run({
|
|
923
|
+
value,
|
|
924
|
+
issues: []
|
|
925
|
+
}, ctx);
|
|
926
|
+
if (result instanceof Promise) result = await result;
|
|
927
|
+
return result.issues.length === 0;
|
|
928
|
+
};
|
|
818
929
|
const _encode = (_Err) => {
|
|
819
930
|
const parse = _parse(_Err);
|
|
820
931
|
const fn = (schema, value, _ctx, _params) => {
|
|
@@ -872,7 +983,7 @@ window.__ModuleLoader__.load({
|
|
|
872
983
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
873
984
|
};
|
|
874
985
|
//#endregion
|
|
875
|
-
//#region node_modules/.pnpm/zod@4.
|
|
986
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/regexes.js
|
|
876
987
|
/**
|
|
877
988
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
878
989
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -899,8 +1010,8 @@ window.__ModuleLoader__.load({
|
|
|
899
1010
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
900
1011
|
};
|
|
901
1012
|
/** Practical email validation */
|
|
902
|
-
const email = /^(
|
|
903
|
-
const _emoji$1 = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1013
|
+
const email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1014
|
+
const _emoji$1 = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
904
1015
|
function emoji() {
|
|
905
1016
|
return new RegExp(_emoji$1, "u");
|
|
906
1017
|
}
|
|
@@ -909,7 +1020,7 @@ window.__ModuleLoader__.load({
|
|
|
909
1020
|
const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
910
1021
|
const cidrv6 = /^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
911
1022
|
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
912
|
-
const base64url = /^[A-Za-z0-9_-]
|
|
1023
|
+
const base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
913
1024
|
const httpProtocol = /^https?$/;
|
|
914
1025
|
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
915
1026
|
const dateSource = `(?:(?:\\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])))`;
|
|
@@ -937,10 +1048,7 @@ window.__ModuleLoader__.load({
|
|
|
937
1048
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
938
1049
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
939
1050
|
}
|
|
940
|
-
const
|
|
941
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
942
|
-
return new RegExp(`^${regex}$`);
|
|
943
|
-
};
|
|
1051
|
+
const anyString = /^[\s\S]{0,}$/;
|
|
944
1052
|
const integer = /^-?\d+$/;
|
|
945
1053
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
946
1054
|
const boolean$1 = /^(?:true|false)$/i;
|
|
@@ -948,7 +1056,7 @@ window.__ModuleLoader__.load({
|
|
|
948
1056
|
const lowercase = /^[^A-Z]*$/;
|
|
949
1057
|
const uppercase = /^[^a-z]*$/;
|
|
950
1058
|
//#endregion
|
|
951
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1059
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.js
|
|
952
1060
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
953
1061
|
var _a;
|
|
954
1062
|
inst._zod ?? (inst._zod = {});
|
|
@@ -968,14 +1076,6 @@ window.__ModuleLoader__.load({
|
|
|
968
1076
|
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
969
1077
|
$ZodCheck.init(inst, def);
|
|
970
1078
|
const origin = numericOriginMap[typeof def.value];
|
|
971
|
-
inst._zod.onattach.push((inst) => {
|
|
972
|
-
const bag = inst._zod.bag;
|
|
973
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
974
|
-
if (def.value < curr) {
|
|
975
|
-
if (def.inclusive) bag.maximum = def.value;
|
|
976
|
-
else bag.exclusiveMaximum = def.value;
|
|
977
|
-
}
|
|
978
|
-
});
|
|
979
1079
|
inst._zod.check = (payload) => {
|
|
980
1080
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
981
1081
|
payload.issues.push({
|
|
@@ -992,14 +1092,6 @@ window.__ModuleLoader__.load({
|
|
|
992
1092
|
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
993
1093
|
$ZodCheck.init(inst, def);
|
|
994
1094
|
const origin = numericOriginMap[typeof def.value];
|
|
995
|
-
inst._zod.onattach.push((inst) => {
|
|
996
|
-
const bag = inst._zod.bag;
|
|
997
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
998
|
-
if (def.value > curr) {
|
|
999
|
-
if (def.inclusive) bag.minimum = def.value;
|
|
1000
|
-
else bag.exclusiveMinimum = def.value;
|
|
1001
|
-
}
|
|
1002
|
-
});
|
|
1003
1095
|
inst._zod.check = (payload) => {
|
|
1004
1096
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
1005
1097
|
payload.issues.push({
|
|
@@ -1015,10 +1107,6 @@ window.__ModuleLoader__.load({
|
|
|
1015
1107
|
});
|
|
1016
1108
|
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1017
1109
|
$ZodCheck.init(inst, def);
|
|
1018
|
-
inst._zod.onattach.push((inst) => {
|
|
1019
|
-
var _a;
|
|
1020
|
-
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
1021
|
-
});
|
|
1022
1110
|
inst._zod.check = (payload) => {
|
|
1023
1111
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1024
1112
|
if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
@@ -1038,13 +1126,6 @@ window.__ModuleLoader__.load({
|
|
|
1038
1126
|
const isInt = def.format?.includes("int");
|
|
1039
1127
|
const origin = isInt ? "int" : "number";
|
|
1040
1128
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
1041
|
-
inst._zod.onattach.push((inst) => {
|
|
1042
|
-
const bag = inst._zod.bag;
|
|
1043
|
-
bag.format = def.format;
|
|
1044
|
-
bag.minimum = minimum;
|
|
1045
|
-
bag.maximum = maximum;
|
|
1046
|
-
if (isInt) bag.pattern = integer;
|
|
1047
|
-
});
|
|
1048
1129
|
inst._zod.check = (payload) => {
|
|
1049
1130
|
const input = payload.value;
|
|
1050
1131
|
if (isInt) {
|
|
@@ -1107,10 +1188,6 @@ window.__ModuleLoader__.load({
|
|
|
1107
1188
|
var _a;
|
|
1108
1189
|
$ZodCheck.init(inst, def);
|
|
1109
1190
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1110
|
-
inst._zod.onattach.push((inst) => {
|
|
1111
|
-
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1112
|
-
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
1113
|
-
});
|
|
1114
1191
|
inst._zod.check = (payload) => {
|
|
1115
1192
|
const input = payload.value;
|
|
1116
1193
|
const units = input.length;
|
|
@@ -1131,10 +1208,6 @@ window.__ModuleLoader__.load({
|
|
|
1131
1208
|
var _a;
|
|
1132
1209
|
$ZodCheck.init(inst, def);
|
|
1133
1210
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1134
|
-
inst._zod.onattach.push((inst) => {
|
|
1135
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1136
|
-
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
1137
|
-
});
|
|
1138
1211
|
inst._zod.check = (payload) => {
|
|
1139
1212
|
const input = payload.value;
|
|
1140
1213
|
const units = input.length;
|
|
@@ -1155,12 +1228,6 @@ window.__ModuleLoader__.load({
|
|
|
1155
1228
|
var _a;
|
|
1156
1229
|
$ZodCheck.init(inst, def);
|
|
1157
1230
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1158
|
-
inst._zod.onattach.push((inst) => {
|
|
1159
|
-
const bag = inst._zod.bag;
|
|
1160
|
-
bag.minimum = def.length;
|
|
1161
|
-
bag.maximum = def.length;
|
|
1162
|
-
bag.length = def.length;
|
|
1163
|
-
});
|
|
1164
1231
|
inst._zod.check = (payload) => {
|
|
1165
1232
|
const input = payload.value;
|
|
1166
1233
|
const units = input.length;
|
|
@@ -1188,14 +1255,6 @@ window.__ModuleLoader__.load({
|
|
|
1188
1255
|
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1189
1256
|
var _a, _b;
|
|
1190
1257
|
$ZodCheck.init(inst, def);
|
|
1191
|
-
inst._zod.onattach.push((inst) => {
|
|
1192
|
-
const bag = inst._zod.bag;
|
|
1193
|
-
bag.format = def.format;
|
|
1194
|
-
if (def.pattern) {
|
|
1195
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1196
|
-
bag.patterns.add(def.pattern);
|
|
1197
|
-
}
|
|
1198
|
-
});
|
|
1199
1258
|
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1200
1259
|
def.pattern.lastIndex = 0;
|
|
1201
1260
|
if (def.pattern.test(payload.value)) return;
|
|
@@ -1238,13 +1297,7 @@ window.__ModuleLoader__.load({
|
|
|
1238
1297
|
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
1239
1298
|
$ZodCheck.init(inst, def);
|
|
1240
1299
|
const escapedRegex = escapeRegex(def.includes);
|
|
1241
|
-
|
|
1242
|
-
def.pattern = pattern;
|
|
1243
|
-
inst._zod.onattach.push((inst) => {
|
|
1244
|
-
const bag = inst._zod.bag;
|
|
1245
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1246
|
-
bag.patterns.add(pattern);
|
|
1247
|
-
});
|
|
1300
|
+
def.pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
1248
1301
|
inst._zod.check = (payload) => {
|
|
1249
1302
|
if (payload.value.includes(def.includes, def.position)) return;
|
|
1250
1303
|
payload.issues.push({
|
|
@@ -1262,11 +1315,6 @@ window.__ModuleLoader__.load({
|
|
|
1262
1315
|
$ZodCheck.init(inst, def);
|
|
1263
1316
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1264
1317
|
def.pattern ?? (def.pattern = pattern);
|
|
1265
|
-
inst._zod.onattach.push((inst) => {
|
|
1266
|
-
const bag = inst._zod.bag;
|
|
1267
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1268
|
-
bag.patterns.add(pattern);
|
|
1269
|
-
});
|
|
1270
1318
|
inst._zod.check = (payload) => {
|
|
1271
1319
|
if (payload.value.startsWith(def.prefix)) return;
|
|
1272
1320
|
payload.issues.push({
|
|
@@ -1284,11 +1332,6 @@ window.__ModuleLoader__.load({
|
|
|
1284
1332
|
$ZodCheck.init(inst, def);
|
|
1285
1333
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1286
1334
|
def.pattern ?? (def.pattern = pattern);
|
|
1287
|
-
inst._zod.onattach.push((inst) => {
|
|
1288
|
-
const bag = inst._zod.bag;
|
|
1289
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1290
|
-
bag.patterns.add(pattern);
|
|
1291
|
-
});
|
|
1292
1335
|
inst._zod.check = (payload) => {
|
|
1293
1336
|
if (payload.value.endsWith(def.suffix)) return;
|
|
1294
1337
|
payload.issues.push({
|
|
@@ -1309,7 +1352,7 @@ window.__ModuleLoader__.load({
|
|
|
1309
1352
|
};
|
|
1310
1353
|
});
|
|
1311
1354
|
//#endregion
|
|
1312
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1355
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/doc.js
|
|
1313
1356
|
var Doc = class {
|
|
1314
1357
|
constructor(args = [], closed = {}) {
|
|
1315
1358
|
this.content = [];
|
|
@@ -1319,8 +1362,11 @@ window.__ModuleLoader__.load({
|
|
|
1319
1362
|
}
|
|
1320
1363
|
indented(fn) {
|
|
1321
1364
|
this.indent += 1;
|
|
1322
|
-
|
|
1323
|
-
|
|
1365
|
+
try {
|
|
1366
|
+
fn(this);
|
|
1367
|
+
} finally {
|
|
1368
|
+
this.indent -= 1;
|
|
1369
|
+
}
|
|
1324
1370
|
}
|
|
1325
1371
|
write(arg) {
|
|
1326
1372
|
if (typeof arg === "function") {
|
|
@@ -1340,14 +1386,14 @@ window.__ModuleLoader__.load({
|
|
|
1340
1386
|
}
|
|
1341
1387
|
};
|
|
1342
1388
|
//#endregion
|
|
1343
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1389
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.js
|
|
1344
1390
|
const version = {
|
|
1345
1391
|
major: 4,
|
|
1346
|
-
minor:
|
|
1347
|
-
patch:
|
|
1392
|
+
minor: 6,
|
|
1393
|
+
patch: 6
|
|
1348
1394
|
};
|
|
1349
1395
|
//#endregion
|
|
1350
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1396
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.js
|
|
1351
1397
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1352
1398
|
var _a;
|
|
1353
1399
|
inst ?? (inst = {});
|
|
@@ -1436,15 +1482,26 @@ window.__ModuleLoader__.load({
|
|
|
1436
1482
|
}
|
|
1437
1483
|
});
|
|
1438
1484
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
1439
|
-
const toStandardResult = (r) => r.
|
|
1485
|
+
const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
1486
|
+
async function validateAsync(inst, value) {
|
|
1487
|
+
const ctx = { async: true };
|
|
1488
|
+
return toStandardResult(await inst._zod.run({
|
|
1489
|
+
value,
|
|
1490
|
+
issues: []
|
|
1491
|
+
}, ctx), ctx);
|
|
1492
|
+
}
|
|
1440
1493
|
function standardProps(inst) {
|
|
1441
1494
|
return {
|
|
1442
1495
|
validate: (value) => {
|
|
1496
|
+
const ctx = { async: false };
|
|
1443
1497
|
try {
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1498
|
+
const r = inst._zod.run({
|
|
1499
|
+
value,
|
|
1500
|
+
issues: []
|
|
1501
|
+
}, ctx);
|
|
1502
|
+
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
1503
|
+
} catch (_) {}
|
|
1504
|
+
return validateAsync(inst, value);
|
|
1448
1505
|
},
|
|
1449
1506
|
vendor: "zod",
|
|
1450
1507
|
version: 1
|
|
@@ -1452,7 +1509,7 @@ window.__ModuleLoader__.load({
|
|
|
1452
1509
|
}
|
|
1453
1510
|
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
1454
1511
|
$ZodType.init(inst, def);
|
|
1455
|
-
inst._zod.pattern =
|
|
1512
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
1456
1513
|
inst._zod.parse = (payload, _) => {
|
|
1457
1514
|
if (def.coerce) try {
|
|
1458
1515
|
payload.value = String(payload.value);
|
|
@@ -1496,10 +1553,27 @@ window.__ModuleLoader__.load({
|
|
|
1496
1553
|
def.pattern ?? (def.pattern = email);
|
|
1497
1554
|
$ZodStringFormat.init(inst, def);
|
|
1498
1555
|
});
|
|
1499
|
-
|
|
1556
|
+
function canParseURL(input) {
|
|
1557
|
+
try {
|
|
1558
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
|
|
1559
|
+
new URL(input);
|
|
1560
|
+
return true;
|
|
1561
|
+
} catch {
|
|
1562
|
+
return false;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
function validateURL(trimmed, def) {
|
|
1566
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
|
|
1567
|
+
return parseURLObject(trimmed, def);
|
|
1568
|
+
}
|
|
1569
|
+
/** Parses a URL while preserving the non-normalizing HTTP guard. */
|
|
1500
1570
|
function parseURLObject(trimmed, def) {
|
|
1501
1571
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
|
|
1502
1572
|
try {
|
|
1573
|
+
if (typeof URL !== "undefined") {
|
|
1574
|
+
const URLStatic = URL;
|
|
1575
|
+
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
|
|
1576
|
+
}
|
|
1503
1577
|
return new URL(trimmed);
|
|
1504
1578
|
} catch {
|
|
1505
1579
|
return 2;
|
|
@@ -1523,7 +1597,7 @@ window.__ModuleLoader__.load({
|
|
|
1523
1597
|
inst._zod.check = (payload) => {
|
|
1524
1598
|
try {
|
|
1525
1599
|
const trimmed = payload.value.trim();
|
|
1526
|
-
const url =
|
|
1600
|
+
const url = validateURL(trimmed, def);
|
|
1527
1601
|
if (url === 1) {
|
|
1528
1602
|
payload.issues.push({
|
|
1529
1603
|
code: "invalid_format",
|
|
@@ -1545,6 +1619,10 @@ window.__ModuleLoader__.load({
|
|
|
1545
1619
|
});
|
|
1546
1620
|
return;
|
|
1547
1621
|
}
|
|
1622
|
+
if (url === true) {
|
|
1623
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
1624
|
+
return;
|
|
1625
|
+
}
|
|
1548
1626
|
if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
|
|
1549
1627
|
code: "invalid_format",
|
|
1550
1628
|
format: "url",
|
|
@@ -1613,12 +1691,6 @@ window.__ModuleLoader__.load({
|
|
|
1613
1691
|
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1614
1692
|
def.pattern ?? (def.pattern = datetime(def));
|
|
1615
1693
|
$ZodStringFormat.init(inst, def);
|
|
1616
|
-
if (def.local || def.precision === -1) {
|
|
1617
|
-
inst._zod.bag.laxFormat = true;
|
|
1618
|
-
inst._zod.onattach.push((s) => {
|
|
1619
|
-
s._zod.bag.laxFormat = true;
|
|
1620
|
-
});
|
|
1621
|
-
}
|
|
1622
1694
|
});
|
|
1623
1695
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1624
1696
|
def.pattern ?? (def.pattern = date);
|
|
@@ -1635,23 +1707,16 @@ window.__ModuleLoader__.load({
|
|
|
1635
1707
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
1636
1708
|
def.pattern ?? (def.pattern = ipv4);
|
|
1637
1709
|
$ZodStringFormat.init(inst, def);
|
|
1638
|
-
inst._zod.bag.format = `ipv4`;
|
|
1639
1710
|
});
|
|
1640
1711
|
/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
|
|
1641
1712
|
const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
1642
1713
|
function isValidIPv6(value) {
|
|
1643
1714
|
if (!ipv6Alphabet.test(value)) return false;
|
|
1644
|
-
|
|
1645
|
-
new URL(`http://[${value}]`);
|
|
1646
|
-
return true;
|
|
1647
|
-
} catch {
|
|
1648
|
-
return false;
|
|
1649
|
-
}
|
|
1715
|
+
return canParseURL(`http://[${value}]`);
|
|
1650
1716
|
}
|
|
1651
1717
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
1652
1718
|
def.pattern ?? (def.pattern = ipv6);
|
|
1653
1719
|
$ZodStringFormat.init(inst, def);
|
|
1654
|
-
inst._zod.bag.format = `ipv6`;
|
|
1655
1720
|
inst._zod.check = (payload) => {
|
|
1656
1721
|
if (!isValidIPv6(payload.value)) payload.issues.push({
|
|
1657
1722
|
code: "invalid_format",
|
|
@@ -1700,10 +1765,10 @@ window.__ModuleLoader__.load({
|
|
|
1700
1765
|
return false;
|
|
1701
1766
|
}
|
|
1702
1767
|
}
|
|
1768
|
+
const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
1703
1769
|
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
1704
|
-
def.pattern ?? (def.pattern =
|
|
1770
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
1705
1771
|
$ZodStringFormat.init(inst, def);
|
|
1706
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
1707
1772
|
inst._zod.check = (payload) => {
|
|
1708
1773
|
if (isValidBase64(payload.value)) return;
|
|
1709
1774
|
payload.issues.push({
|
|
@@ -1715,15 +1780,15 @@ window.__ModuleLoader__.load({
|
|
|
1715
1780
|
});
|
|
1716
1781
|
};
|
|
1717
1782
|
});
|
|
1783
|
+
const base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
1718
1784
|
function isValidBase64URL(data) {
|
|
1719
|
-
if (!
|
|
1785
|
+
if (!base64urlCharset.test(data)) return false;
|
|
1720
1786
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1721
1787
|
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
1722
1788
|
}
|
|
1723
1789
|
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1724
|
-
def.pattern ?? (def.pattern =
|
|
1790
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
1725
1791
|
$ZodStringFormat.init(inst, def);
|
|
1726
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
1727
1792
|
inst._zod.check = (payload) => {
|
|
1728
1793
|
if (isValidBase64URL(payload.value)) return;
|
|
1729
1794
|
payload.issues.push({
|
|
@@ -1769,7 +1834,7 @@ window.__ModuleLoader__.load({
|
|
|
1769
1834
|
});
|
|
1770
1835
|
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
1771
1836
|
$ZodType.init(inst, def);
|
|
1772
|
-
inst._zod.pattern =
|
|
1837
|
+
inst._zod.pattern = number$1;
|
|
1773
1838
|
inst._zod.parse = (payload, _ctx) => {
|
|
1774
1839
|
if (def.coerce) try {
|
|
1775
1840
|
payload.value = Number(payload.value);
|
|
@@ -1841,6 +1906,26 @@ window.__ModuleLoader__.load({
|
|
|
1841
1906
|
return payload;
|
|
1842
1907
|
};
|
|
1843
1908
|
});
|
|
1909
|
+
function capSize(inst, size) {
|
|
1910
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
1911
|
+
if (!caps.length) return;
|
|
1912
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
1913
|
+
const parse = inst._zod.parse;
|
|
1914
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1915
|
+
const n = size(payload.value);
|
|
1916
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
1917
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
|
|
1918
|
+
const start = payload.issues.length;
|
|
1919
|
+
ch._zod.check(payload);
|
|
1920
|
+
payload.issues[start].continue = false;
|
|
1921
|
+
attachSchema(payload.issues, start, inst);
|
|
1922
|
+
return payload;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
return parse(payload, ctx);
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
const arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
1844
1929
|
function handleArrayResult(result, final, index) {
|
|
1845
1930
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1846
1931
|
final.value[index] = result.value;
|
|
@@ -1862,6 +1947,7 @@ window.__ModuleLoader__.load({
|
|
|
1862
1947
|
}
|
|
1863
1948
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
1864
1949
|
const proms = [];
|
|
1950
|
+
const abortEarly = ctx?.abortEarly;
|
|
1865
1951
|
for (let i = 0; i < input.length; i++) {
|
|
1866
1952
|
const item = input[i];
|
|
1867
1953
|
const result = def.element._zod.run({
|
|
@@ -1869,11 +1955,15 @@ window.__ModuleLoader__.load({
|
|
|
1869
1955
|
issues: []
|
|
1870
1956
|
}, ctx);
|
|
1871
1957
|
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
1872
|
-
else
|
|
1958
|
+
else {
|
|
1959
|
+
handleArrayResult(result, payload, i);
|
|
1960
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
|
|
1961
|
+
}
|
|
1873
1962
|
}
|
|
1874
1963
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1875
1964
|
return payload;
|
|
1876
1965
|
};
|
|
1966
|
+
capSize(inst, arraySize);
|
|
1877
1967
|
});
|
|
1878
1968
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
1879
1969
|
const isPresent = key in input;
|
|
@@ -1893,7 +1983,7 @@ window.__ModuleLoader__.load({
|
|
|
1893
1983
|
return;
|
|
1894
1984
|
}
|
|
1895
1985
|
if (result.value === void 0) {
|
|
1896
|
-
if (isPresent) final.value[key] = void 0;
|
|
1986
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) final.value[key] = void 0;
|
|
1897
1987
|
} else final.value[key] = result.value;
|
|
1898
1988
|
}
|
|
1899
1989
|
const NO_SYMBOL_KEYS = [];
|
|
@@ -1913,14 +2003,19 @@ window.__ModuleLoader__.load({
|
|
|
1913
2003
|
optionalKeys: new Set(okeys)
|
|
1914
2004
|
};
|
|
1915
2005
|
}
|
|
1916
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
2006
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
1917
2007
|
const unrecognized = [];
|
|
1918
2008
|
const keySet = def.keySet;
|
|
1919
2009
|
const _catchall = def.catchall._zod;
|
|
1920
2010
|
const t = _catchall.def.type;
|
|
1921
2011
|
const optin = _catchall.optin;
|
|
1922
2012
|
const optout = _catchall.optout;
|
|
2013
|
+
let seen = 0;
|
|
1923
2014
|
for (const key in input) {
|
|
2015
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2016
|
+
if (aborted(payload, seen)) break;
|
|
2017
|
+
seen = payload.issues.length;
|
|
2018
|
+
}
|
|
1924
2019
|
if (keySet.has(key)) continue;
|
|
1925
2020
|
if (key === "__proto__") {
|
|
1926
2021
|
if (t === "never") unrecognized.push(key);
|
|
@@ -1949,18 +2044,19 @@ window.__ModuleLoader__.load({
|
|
|
1949
2044
|
return payload;
|
|
1950
2045
|
});
|
|
1951
2046
|
}
|
|
1952
|
-
const propShapes = /* @__PURE__ */ new WeakMap();
|
|
1953
2047
|
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
1954
2048
|
$ZodType.init(inst, def);
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2049
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2050
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
2051
|
+
if (sh) {
|
|
2052
|
+
const get = () => {
|
|
1959
2053
|
const newSh = { ...sh };
|
|
1960
2054
|
Object.defineProperty(def, "shape", { value: newSh });
|
|
1961
|
-
|
|
2055
|
+
get.raw = newSh;
|
|
1962
2056
|
return newSh;
|
|
1963
|
-
}
|
|
2057
|
+
};
|
|
2058
|
+
get.raw = sh;
|
|
2059
|
+
Object.defineProperty(def, "shape", { get });
|
|
1964
2060
|
}
|
|
1965
2061
|
const _normalized = cached(() => normalizeDef(def));
|
|
1966
2062
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -1996,7 +2092,13 @@ window.__ModuleLoader__.load({
|
|
|
1996
2092
|
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1997
2093
|
const proms = [];
|
|
1998
2094
|
const shape = value.shape;
|
|
2095
|
+
const abortEarly = ctx?.abortEarly;
|
|
2096
|
+
let seen = payload.issues.length;
|
|
1999
2097
|
for (const key of value.allKeys) {
|
|
2098
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2099
|
+
if (aborted(payload, seen)) break;
|
|
2100
|
+
seen = payload.issues.length;
|
|
2101
|
+
}
|
|
2000
2102
|
if (key === "__proto__") continue;
|
|
2001
2103
|
const el = shape[key];
|
|
2002
2104
|
const optin = el._zod.optin;
|
|
@@ -2009,7 +2111,7 @@ window.__ModuleLoader__.load({
|
|
|
2009
2111
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
2010
2112
|
}
|
|
2011
2113
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2012
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
2114
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
2013
2115
|
};
|
|
2014
2116
|
});
|
|
2015
2117
|
const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -2028,10 +2130,16 @@ window.__ModuleLoader__.load({
|
|
|
2028
2130
|
});
|
|
2029
2131
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
2030
2132
|
const prefixStr = (id, k) => `
|
|
2133
|
+
let ${id}_ab = false;
|
|
2031
2134
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
2032
2135
|
const iss = ${id}.issues[i];
|
|
2033
2136
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
2034
2137
|
payload.issues.push(iss);
|
|
2138
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
2139
|
+
}
|
|
2140
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
2141
|
+
payload.value = newResult;
|
|
2142
|
+
return payload;
|
|
2035
2143
|
}`;
|
|
2036
2144
|
doc.write(`const input = payload.value;`);
|
|
2037
2145
|
const ids = Object.create(null);
|
|
@@ -2073,6 +2181,10 @@ window.__ModuleLoader__.load({
|
|
|
2073
2181
|
input: undefined,
|
|
2074
2182
|
path: [${k}]
|
|
2075
2183
|
});
|
|
2184
|
+
if (ctx && ctx.abortEarly) {
|
|
2185
|
+
payload.value = newResult;
|
|
2186
|
+
return payload;
|
|
2187
|
+
}
|
|
2076
2188
|
}
|
|
2077
2189
|
|
|
2078
2190
|
if (${id}_present) {
|
|
@@ -2080,19 +2192,18 @@ window.__ModuleLoader__.load({
|
|
|
2080
2192
|
}
|
|
2081
2193
|
|
|
2082
2194
|
`);
|
|
2083
|
-
else
|
|
2195
|
+
else {
|
|
2196
|
+
doc.write(`
|
|
2084
2197
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
2085
2198
|
}
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
}
|
|
2091
|
-
} else {
|
|
2199
|
+
`);
|
|
2200
|
+
if (optin === "defaulted") doc.write(`newResult[${k}] = ${id}.value;`);
|
|
2201
|
+
else doc.write(`
|
|
2202
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
2092
2203
|
newResult[${k}] = ${id}.value;
|
|
2093
2204
|
}
|
|
2094
|
-
|
|
2095
2205
|
`);
|
|
2206
|
+
}
|
|
2096
2207
|
}
|
|
2097
2208
|
doc.write(`payload.value = newResult;`);
|
|
2098
2209
|
doc.write(`return payload;`);
|
|
@@ -2120,7 +2231,7 @@ window.__ModuleLoader__.load({
|
|
|
2120
2231
|
if (!fastpass) fastpass = generateFastpass(def.shape);
|
|
2121
2232
|
payload = fastpass(payload, ctx);
|
|
2122
2233
|
if (!catchall) return payload;
|
|
2123
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
2234
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
2124
2235
|
}
|
|
2125
2236
|
return superParse(payload, ctx);
|
|
2126
2237
|
};
|
|
@@ -2180,39 +2291,42 @@ window.__ModuleLoader__.load({
|
|
|
2180
2291
|
});
|
|
2181
2292
|
};
|
|
2182
2293
|
});
|
|
2294
|
+
function discriminatorMap(def) {
|
|
2295
|
+
const map = /* @__PURE__ */ new Map();
|
|
2296
|
+
for (const option of def.options) {
|
|
2297
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
2298
|
+
if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
2299
|
+
for (const value of values) if (map.has(value)) {
|
|
2300
|
+
if (value !== void 0) throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
2301
|
+
map.set(value, null);
|
|
2302
|
+
} else map.set(value, option);
|
|
2303
|
+
}
|
|
2304
|
+
return map;
|
|
2305
|
+
}
|
|
2183
2306
|
const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
2184
2307
|
def.inclusive = false;
|
|
2185
2308
|
$ZodUnion.init(inst, def);
|
|
2186
2309
|
const _super = inst._zod.parse;
|
|
2187
2310
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
2188
2311
|
const propValues = {};
|
|
2312
|
+
let undefinedCount = 0;
|
|
2189
2313
|
for (const option of zod.def.options) {
|
|
2190
2314
|
const pv = option._zod.propValues;
|
|
2191
2315
|
if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
2316
|
+
if (pv[zod.def.discriminator]?.has(void 0)) undefinedCount++;
|
|
2192
2317
|
for (const [k, v] of Object.entries(pv)) {
|
|
2193
2318
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
2194
2319
|
for (const val of v) propValues[k].add(val);
|
|
2195
2320
|
}
|
|
2196
2321
|
}
|
|
2322
|
+
if (!zod.def.unionFallback && undefinedCount > 1) propValues[zod.def.discriminator]?.delete(void 0);
|
|
2197
2323
|
return propValues;
|
|
2198
2324
|
});
|
|
2199
2325
|
def.options.forEach((option, i) => {
|
|
2200
|
-
const propShape =
|
|
2326
|
+
const propShape = rawShape(option._zod.def);
|
|
2201
2327
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
2202
2328
|
});
|
|
2203
|
-
const disc = cached(() =>
|
|
2204
|
-
const opts = def.options;
|
|
2205
|
-
const map = /* @__PURE__ */ new Map();
|
|
2206
|
-
for (const o of opts) {
|
|
2207
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
2208
|
-
if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
2209
|
-
for (const v of values) {
|
|
2210
|
-
if (map.has(v)) throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
2211
|
-
map.set(v, o);
|
|
2212
|
-
}
|
|
2213
|
-
}
|
|
2214
|
-
return map;
|
|
2215
|
-
});
|
|
2329
|
+
const disc = cached(() => discriminatorMap(def));
|
|
2216
2330
|
inst._zod.parse = (payload, ctx) => {
|
|
2217
2331
|
const input = payload.value;
|
|
2218
2332
|
if (!isObject(input)) {
|
|
@@ -2224,15 +2338,16 @@ window.__ModuleLoader__.load({
|
|
|
2224
2338
|
});
|
|
2225
2339
|
return payload;
|
|
2226
2340
|
}
|
|
2227
|
-
const
|
|
2228
|
-
|
|
2341
|
+
const value = input?.[def.discriminator];
|
|
2342
|
+
const opt = disc.value.get(value);
|
|
2343
|
+
if (opt && (value !== void 0 || ctx.direction !== "backward")) return opt._zod.run(payload, ctx);
|
|
2229
2344
|
if (def.unionFallback || ctx.direction === "backward") return _super(payload, ctx);
|
|
2230
2345
|
payload.issues.push({
|
|
2231
2346
|
code: "invalid_union",
|
|
2232
2347
|
errors: [],
|
|
2233
2348
|
note: "No matching discriminator",
|
|
2234
2349
|
discriminator: def.discriminator,
|
|
2235
|
-
options: Array.from(disc.value.keys()),
|
|
2350
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
2236
2351
|
input,
|
|
2237
2352
|
path: [def.discriminator],
|
|
2238
2353
|
inst
|
|
@@ -2491,8 +2606,10 @@ window.__ModuleLoader__.load({
|
|
|
2491
2606
|
const values = getEnumValues(def.entries);
|
|
2492
2607
|
const valuesSet = new Set(values);
|
|
2493
2608
|
inst._zod.values = valuesSet;
|
|
2494
|
-
|
|
2495
|
-
|
|
2609
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2610
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
2611
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
2612
|
+
});
|
|
2496
2613
|
inst._zod.parse = (payload, _ctx) => {
|
|
2497
2614
|
const input = payload.value;
|
|
2498
2615
|
if (valuesSet.has(input)) return payload;
|
|
@@ -2509,7 +2626,10 @@ window.__ModuleLoader__.load({
|
|
|
2509
2626
|
$ZodType.init(inst, def);
|
|
2510
2627
|
const values = new Set(def.values);
|
|
2511
2628
|
inst._zod.values = values;
|
|
2512
|
-
inst
|
|
2629
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2630
|
+
const vals = zod.def.values;
|
|
2631
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
2632
|
+
});
|
|
2513
2633
|
inst._zod.parse = (payload, _ctx) => {
|
|
2514
2634
|
const input = payload.value;
|
|
2515
2635
|
if (values.has(input)) return payload;
|
|
@@ -2759,7 +2879,7 @@ window.__ModuleLoader__.load({
|
|
|
2759
2879
|
}
|
|
2760
2880
|
}
|
|
2761
2881
|
//#endregion
|
|
2762
|
-
//#region node_modules/.pnpm/zod@4.
|
|
2882
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/memoizer.js
|
|
2763
2883
|
var $ZodCyclicError = class extends Error {
|
|
2764
2884
|
constructor() {
|
|
2765
2885
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -2769,6 +2889,9 @@ window.__ModuleLoader__.load({
|
|
|
2769
2889
|
/** Keyed off the context object every schema in one parse call already shares. */
|
|
2770
2890
|
const STATE = "~memo";
|
|
2771
2891
|
const NO_ISSUES = [];
|
|
2892
|
+
function isRef(value) {
|
|
2893
|
+
return value !== null && typeof value === "object";
|
|
2894
|
+
}
|
|
2772
2895
|
function cloneIssues(issues) {
|
|
2773
2896
|
return issues.map((iss) => iss.path ? {
|
|
2774
2897
|
...iss,
|
|
@@ -2776,22 +2899,44 @@ window.__ModuleLoader__.load({
|
|
|
2776
2899
|
} : { ...iss });
|
|
2777
2900
|
}
|
|
2778
2901
|
const recursive = /*@__PURE__*/ new WeakMap();
|
|
2902
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
2903
|
+
const NONE = 0;
|
|
2904
|
+
const ASSUMED = 1;
|
|
2905
|
+
const PROVEN = 2;
|
|
2779
2906
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
2780
|
-
function isRecursive(inst, stack) {
|
|
2907
|
+
function isRecursive(inst, stack, resolve) {
|
|
2781
2908
|
const cached = recursive.get(inst);
|
|
2782
|
-
if (cached !== void 0) return cached;
|
|
2783
|
-
if (stack.has(inst)) return
|
|
2909
|
+
if (cached !== void 0) return cached ? PROVEN : NONE;
|
|
2910
|
+
if (stack.has(inst)) return PROVEN;
|
|
2784
2911
|
stack.add(inst);
|
|
2785
|
-
let result =
|
|
2912
|
+
let result = NONE;
|
|
2786
2913
|
const check = (child) => {
|
|
2787
|
-
if (
|
|
2914
|
+
if (result !== PROVEN && child?._zod) {
|
|
2915
|
+
const answer = isRecursive(child, stack, resolve);
|
|
2916
|
+
if (answer > result) result = answer;
|
|
2917
|
+
}
|
|
2918
|
+
};
|
|
2919
|
+
const shape = (sh, spread) => {
|
|
2920
|
+
let answer = NONE;
|
|
2921
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
2922
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
2923
|
+
if (spread && !desc.enumerable) continue;
|
|
2924
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
2925
|
+
if (child > answer) answer = child;
|
|
2926
|
+
}
|
|
2927
|
+
return answer;
|
|
2928
|
+
};
|
|
2929
|
+
const merge = (answer) => {
|
|
2930
|
+
if (answer > result) result = answer;
|
|
2788
2931
|
};
|
|
2789
2932
|
const def = inst._zod.def;
|
|
2790
2933
|
switch (def.type) {
|
|
2791
|
-
case "object":
|
|
2792
|
-
|
|
2934
|
+
case "object": {
|
|
2935
|
+
const raw = rawShape(def);
|
|
2936
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
2793
2937
|
check(def.catchall);
|
|
2794
2938
|
break;
|
|
2939
|
+
}
|
|
2795
2940
|
case "array":
|
|
2796
2941
|
check(def.element);
|
|
2797
2942
|
break;
|
|
@@ -2833,9 +2978,11 @@ window.__ModuleLoader__.load({
|
|
|
2833
2978
|
check(def.input);
|
|
2834
2979
|
check(def.output);
|
|
2835
2980
|
break;
|
|
2836
|
-
case "lazy":
|
|
2837
|
-
|
|
2981
|
+
case "lazy": {
|
|
2982
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
2983
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
2838
2984
|
break;
|
|
2985
|
+
}
|
|
2839
2986
|
case "template_literal":
|
|
2840
2987
|
case "string":
|
|
2841
2988
|
case "number":
|
|
@@ -2866,13 +3013,17 @@ window.__ModuleLoader__.load({
|
|
|
2866
3013
|
}
|
|
2867
3014
|
}
|
|
2868
3015
|
stack.delete(inst);
|
|
2869
|
-
|
|
2870
|
-
|
|
3016
|
+
return settle(inst, result);
|
|
3017
|
+
}
|
|
3018
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
3019
|
+
function settle(inst, answer) {
|
|
3020
|
+
if (answer !== ASSUMED) recursive.set(inst, answer === PROVEN);
|
|
3021
|
+
return answer;
|
|
2871
3022
|
}
|
|
2872
3023
|
function bucketFor(state, inst) {
|
|
2873
3024
|
let bucket = state.buckets.get(inst);
|
|
2874
3025
|
if (!bucket) {
|
|
2875
|
-
bucket = /* @__PURE__ */ new
|
|
3026
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
2876
3027
|
state.buckets.set(inst, bucket);
|
|
2877
3028
|
}
|
|
2878
3029
|
return bucket;
|
|
@@ -2908,6 +3059,7 @@ window.__ModuleLoader__.load({
|
|
|
2908
3059
|
attach(inst) {
|
|
2909
3060
|
var _a;
|
|
2910
3061
|
let isRecursiveInst;
|
|
3062
|
+
let rechecked = false;
|
|
2911
3063
|
let lastCtx;
|
|
2912
3064
|
let lastBucket;
|
|
2913
3065
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -2915,19 +3067,21 @@ window.__ModuleLoader__.load({
|
|
|
2915
3067
|
const base = inst._zod.parse;
|
|
2916
3068
|
const wrapped = (payload, ctx) => {
|
|
2917
3069
|
if (isRecursiveInst === void 0) {
|
|
2918
|
-
|
|
2919
|
-
if (
|
|
3070
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
3071
|
+
if (walked === NONE) {
|
|
2920
3072
|
inst._zod.parse = base;
|
|
2921
3073
|
if (inst._zod.run === wrapped) inst._zod.run = base;
|
|
2922
3074
|
return base(payload, ctx);
|
|
2923
3075
|
}
|
|
3076
|
+
if (walked === PROVEN || rechecked) isRecursiveInst = true;
|
|
3077
|
+
else rechecked = true;
|
|
2924
3078
|
}
|
|
2925
3079
|
const input = payload.value;
|
|
2926
|
-
if (input
|
|
3080
|
+
if (!isRef(input)) return base(payload, ctx);
|
|
2927
3081
|
let state = ctx[STATE];
|
|
2928
3082
|
if (!state) {
|
|
2929
3083
|
state = {
|
|
2930
|
-
buckets: /* @__PURE__ */ new
|
|
3084
|
+
buckets: /* @__PURE__ */ new WeakMap(),
|
|
2931
3085
|
backEdges: void 0
|
|
2932
3086
|
};
|
|
2933
3087
|
ctx[STATE] = state;
|
|
@@ -2946,7 +3100,7 @@ window.__ModuleLoader__.load({
|
|
|
2946
3100
|
if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
|
|
2947
3101
|
} else {
|
|
2948
3102
|
payload.memo = true;
|
|
2949
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
3103
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
2950
3104
|
state.backEdges.add(hit.value);
|
|
2951
3105
|
}
|
|
2952
3106
|
return payload;
|
|
@@ -2975,10 +3129,10 @@ window.__ModuleLoader__.load({
|
|
|
2975
3129
|
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
2976
3130
|
function isBackEdge(ctx, value) {
|
|
2977
3131
|
const backEdges = ctx[STATE]?.backEdges;
|
|
2978
|
-
return backEdges !== void 0 && value
|
|
3132
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
2979
3133
|
}
|
|
2980
3134
|
//#endregion
|
|
2981
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3135
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/en.js
|
|
2982
3136
|
const error = () => {
|
|
2983
3137
|
const Sizable = {
|
|
2984
3138
|
string: {
|
|
@@ -3033,7 +3187,9 @@ window.__ModuleLoader__.load({
|
|
|
3033
3187
|
base64url: "base64url-encoded string",
|
|
3034
3188
|
json_string: "JSON string",
|
|
3035
3189
|
e164: "E.164 number",
|
|
3190
|
+
currency_code: "currency code",
|
|
3036
3191
|
credit_card: "credit card number",
|
|
3192
|
+
iban: "IBAN",
|
|
3037
3193
|
jwt: "JWT",
|
|
3038
3194
|
template_literal: "input"
|
|
3039
3195
|
};
|
|
@@ -3084,7 +3240,7 @@ window.__ModuleLoader__.load({
|
|
|
3084
3240
|
return { localeError: error() };
|
|
3085
3241
|
}
|
|
3086
3242
|
//#endregion
|
|
3087
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3243
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.js
|
|
3088
3244
|
var _a;
|
|
3089
3245
|
var $ZodRegistry = class {
|
|
3090
3246
|
constructor() {
|
|
@@ -3131,13 +3287,17 @@ window.__ModuleLoader__.load({
|
|
|
3131
3287
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3132
3288
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3133
3289
|
//#endregion
|
|
3134
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3290
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.js
|
|
3291
|
+
function snapshotChecks(def) {
|
|
3292
|
+
if (def.checks) def.checks = [...def.checks];
|
|
3293
|
+
return def;
|
|
3294
|
+
}
|
|
3135
3295
|
// @__NO_SIDE_EFFECTS__
|
|
3136
3296
|
function _string(Class, params) {
|
|
3137
|
-
return new Class({
|
|
3297
|
+
return new Class(snapshotChecks({
|
|
3138
3298
|
type: "string",
|
|
3139
3299
|
...normalizeParams(params)
|
|
3140
|
-
});
|
|
3300
|
+
}));
|
|
3141
3301
|
}
|
|
3142
3302
|
// @__NO_SIDE_EFFECTS__
|
|
3143
3303
|
function _email(Class, params) {
|
|
@@ -3409,11 +3569,11 @@ window.__ModuleLoader__.load({
|
|
|
3409
3569
|
}
|
|
3410
3570
|
// @__NO_SIDE_EFFECTS__
|
|
3411
3571
|
function _number(Class, params) {
|
|
3412
|
-
return new Class({
|
|
3572
|
+
return new Class(snapshotChecks({
|
|
3413
3573
|
type: "number",
|
|
3414
3574
|
checks: [],
|
|
3415
3575
|
...normalizeParams(params)
|
|
3416
|
-
});
|
|
3576
|
+
}));
|
|
3417
3577
|
}
|
|
3418
3578
|
// @__NO_SIDE_EFFECTS__
|
|
3419
3579
|
function _int(Class, params) {
|
|
@@ -3643,7 +3803,7 @@ window.__ModuleLoader__.load({
|
|
|
3643
3803
|
return ch;
|
|
3644
3804
|
}
|
|
3645
3805
|
//#endregion
|
|
3646
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3806
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.js
|
|
3647
3807
|
function assignProps(target, ...sources) {
|
|
3648
3808
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
3649
3809
|
return target;
|
|
@@ -3686,7 +3846,7 @@ window.__ModuleLoader__.load({
|
|
|
3686
3846
|
Object.assign(json, result);
|
|
3687
3847
|
return true;
|
|
3688
3848
|
}
|
|
3689
|
-
function
|
|
3849
|
+
function processSchema(schema, ctx, _params = {
|
|
3690
3850
|
path: [],
|
|
3691
3851
|
schemaPath: []
|
|
3692
3852
|
}) {
|
|
@@ -3725,7 +3885,7 @@ window.__ModuleLoader__.load({
|
|
|
3725
3885
|
const parent = schema._zod.parent;
|
|
3726
3886
|
if (parent) {
|
|
3727
3887
|
if (!result.ref) result.ref = parent;
|
|
3728
|
-
|
|
3888
|
+
processSchema(parent, ctx, params);
|
|
3729
3889
|
ctx.seen.get(parent).isParent = true;
|
|
3730
3890
|
}
|
|
3731
3891
|
}
|
|
@@ -3815,10 +3975,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3815
3975
|
continue;
|
|
3816
3976
|
}
|
|
3817
3977
|
if (seen.count > 1) {
|
|
3818
|
-
if (ctx.reused === "ref")
|
|
3819
|
-
extractToDef(entry);
|
|
3820
|
-
continue;
|
|
3821
|
-
}
|
|
3978
|
+
if (ctx.reused === "ref") extractToDef(entry);
|
|
3822
3979
|
}
|
|
3823
3980
|
}
|
|
3824
3981
|
if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
|
|
@@ -4073,7 +4230,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4073
4230
|
...params,
|
|
4074
4231
|
processors
|
|
4075
4232
|
});
|
|
4076
|
-
|
|
4233
|
+
processSchema(schema, ctx);
|
|
4077
4234
|
extractDefs(ctx, schema);
|
|
4078
4235
|
return finalize(ctx, schema);
|
|
4079
4236
|
};
|
|
@@ -4085,12 +4242,84 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4085
4242
|
io,
|
|
4086
4243
|
processors
|
|
4087
4244
|
});
|
|
4088
|
-
|
|
4245
|
+
processSchema(schema, ctx);
|
|
4089
4246
|
extractDefs(ctx, schema);
|
|
4090
4247
|
return finalize(ctx, schema);
|
|
4091
4248
|
};
|
|
4092
4249
|
//#endregion
|
|
4093
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4250
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema-processors.js
|
|
4251
|
+
const narrowMin = (agg, key, value) => {
|
|
4252
|
+
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4253
|
+
};
|
|
4254
|
+
const narrowMax = (agg, key, value) => {
|
|
4255
|
+
if (agg[key] === void 0 || value < agg[key]) agg[key] = value;
|
|
4256
|
+
};
|
|
4257
|
+
const narrowBoth = (agg, value) => {
|
|
4258
|
+
narrowMin(agg, "minimum", value);
|
|
4259
|
+
narrowMax(agg, "maximum", value);
|
|
4260
|
+
};
|
|
4261
|
+
const addDivisor = (agg, value) => {
|
|
4262
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
4263
|
+
if (!agg.multipleOf.includes(value)) agg.multipleOf.push(value);
|
|
4264
|
+
};
|
|
4265
|
+
const addPattern = (agg, pattern) => {
|
|
4266
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
4267
|
+
agg.patterns.add(pattern);
|
|
4268
|
+
};
|
|
4269
|
+
const intersectMime = (agg, mime) => {
|
|
4270
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
4271
|
+
};
|
|
4272
|
+
const setFormat = (agg, format) => {
|
|
4273
|
+
agg.format = format;
|
|
4274
|
+
if (format.includes("int")) agg.isInt = true;
|
|
4275
|
+
};
|
|
4276
|
+
const minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
4277
|
+
const maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
4278
|
+
const formatContributor = (ranges) => (agg, def) => {
|
|
4279
|
+
setFormat(agg, def.format);
|
|
4280
|
+
const [minimum, maximum] = ranges[def.format];
|
|
4281
|
+
narrowMin(agg, "minimum", minimum);
|
|
4282
|
+
narrowMax(agg, "maximum", maximum);
|
|
4283
|
+
};
|
|
4284
|
+
const contributors = {
|
|
4285
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
4286
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
4287
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
4288
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
4289
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
4290
|
+
min_length: minContributor,
|
|
4291
|
+
max_length: maxContributor,
|
|
4292
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
4293
|
+
min_size: minContributor,
|
|
4294
|
+
max_size: maxContributor,
|
|
4295
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
4296
|
+
string_format: (agg, def) => {
|
|
4297
|
+
setFormat(agg, def.format);
|
|
4298
|
+
if (def.pattern) addPattern(agg, def.pattern);
|
|
4299
|
+
if (def.format === "base64" || def.format === "base64url") agg.contentEncoding = def.format;
|
|
4300
|
+
if (def.local || def.precision === -1) agg.laxFormat = true;
|
|
4301
|
+
},
|
|
4302
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
4303
|
+
};
|
|
4304
|
+
function aggregateChecks(schema) {
|
|
4305
|
+
const agg = {};
|
|
4306
|
+
const def = schema._zod.def;
|
|
4307
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
4308
|
+
for (const ch of list) contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
4309
|
+
const bag = schema._zod.bag;
|
|
4310
|
+
if (bag.minimum !== void 0) narrowMin(agg, "minimum", bag.minimum);
|
|
4311
|
+
if (bag.exclusiveMinimum !== void 0) narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
4312
|
+
if (bag.maximum !== void 0) narrowMax(agg, "maximum", bag.maximum);
|
|
4313
|
+
if (bag.exclusiveMaximum !== void 0) narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
4314
|
+
if (bag.multipleOf !== void 0) addDivisor(agg, bag.multipleOf);
|
|
4315
|
+
if (bag.format !== void 0) {
|
|
4316
|
+
agg.format ?? (agg.format = bag.format);
|
|
4317
|
+
if (bag.format.includes("int")) agg.isInt = true;
|
|
4318
|
+
}
|
|
4319
|
+
if (bag.mime) intersectMime(agg, bag.mime);
|
|
4320
|
+
for (const pattern of bag.patterns ?? []) addPattern(agg, pattern);
|
|
4321
|
+
return agg;
|
|
4322
|
+
}
|
|
4094
4323
|
const formatMap = {
|
|
4095
4324
|
guid: "uuid",
|
|
4096
4325
|
url: "uri",
|
|
@@ -4098,10 +4327,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4098
4327
|
json_string: "json-string",
|
|
4099
4328
|
regex: ""
|
|
4100
4329
|
};
|
|
4330
|
+
const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
|
|
4331
|
+
const exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
4101
4332
|
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
4102
4333
|
const json = _json;
|
|
4103
4334
|
json.type = "string";
|
|
4104
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
4335
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
4105
4336
|
if (typeof minimum === "number") json.minLength = minimum;
|
|
4106
4337
|
if (typeof maximum === "number") json.maxLength = maximum;
|
|
4107
4338
|
if (format) {
|
|
@@ -4111,7 +4342,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4111
4342
|
}
|
|
4112
4343
|
if (contentEncoding) json.contentEncoding = contentEncoding;
|
|
4113
4344
|
if (patterns && patterns.size > 0) {
|
|
4114
|
-
const patternList = [...patterns];
|
|
4345
|
+
const patternList = [...patterns].map(exactPattern);
|
|
4115
4346
|
if (patternList.length === 1) json.pattern = patternList[0].source;
|
|
4116
4347
|
else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
|
|
4117
4348
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
@@ -4121,9 +4352,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4121
4352
|
};
|
|
4122
4353
|
const numberProcessor = (schema, ctx, _json, params) => {
|
|
4123
4354
|
const json = _json;
|
|
4124
|
-
const { minimum, maximum,
|
|
4125
|
-
|
|
4126
|
-
else json.type = "number";
|
|
4355
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
4356
|
+
json.type = isInt ? "integer" : "number";
|
|
4127
4357
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
4128
4358
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
4129
4359
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -4139,9 +4369,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4139
4369
|
json.exclusiveMaximum = true;
|
|
4140
4370
|
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
4141
4371
|
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
4142
|
-
if (
|
|
4143
|
-
|
|
4144
|
-
|
|
4372
|
+
if (multipleOf) {
|
|
4373
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
4374
|
+
for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
|
|
4375
|
+
else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
4376
|
+
const [first, ...rest] = divisors;
|
|
4377
|
+
if (first !== void 0) json.multipleOf = first;
|
|
4378
|
+
if (rest.length) json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
4145
4379
|
}
|
|
4146
4380
|
};
|
|
4147
4381
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
@@ -4203,11 +4437,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4203
4437
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
4204
4438
|
const json = _json;
|
|
4205
4439
|
const def = schema._zod.def;
|
|
4206
|
-
const { minimum, maximum } = schema
|
|
4440
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
4207
4441
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
4208
4442
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
4209
4443
|
json.type = "array";
|
|
4210
|
-
json.items =
|
|
4444
|
+
json.items = processSchema(def.element, ctx, {
|
|
4211
4445
|
...params,
|
|
4212
4446
|
path: [...params.path, "items"]
|
|
4213
4447
|
});
|
|
@@ -4225,7 +4459,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4225
4459
|
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
4226
4460
|
json.type = "object";
|
|
4227
4461
|
json.properties = {};
|
|
4228
|
-
for (const key in shape) assignProp(json.properties, key,
|
|
4462
|
+
for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
4229
4463
|
...params,
|
|
4230
4464
|
path: [
|
|
4231
4465
|
...params.path,
|
|
@@ -4233,17 +4467,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4233
4467
|
key
|
|
4234
4468
|
]
|
|
4235
4469
|
}));
|
|
4236
|
-
const
|
|
4237
|
-
const
|
|
4470
|
+
const requiredKeys = [];
|
|
4471
|
+
for (const key of Object.keys(shape)) {
|
|
4238
4472
|
const field = def.shape[key];
|
|
4239
|
-
if (ctx.io === "input"
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
|
|
4473
|
+
if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) requiredKeys.push(key);
|
|
4474
|
+
}
|
|
4475
|
+
if (requiredKeys.length > 0) json.required = requiredKeys;
|
|
4243
4476
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
4244
4477
|
else if (!def.catchall) {
|
|
4245
4478
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
4246
|
-
} else if (def.catchall) json.additionalProperties =
|
|
4479
|
+
} else if (def.catchall) json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
4247
4480
|
...params,
|
|
4248
4481
|
path: [...params.path, "additionalProperties"]
|
|
4249
4482
|
});
|
|
@@ -4251,7 +4484,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4251
4484
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
4252
4485
|
const def = schema._zod.def;
|
|
4253
4486
|
const isExclusive = def.inclusive === false;
|
|
4254
|
-
const options = def.options.map((x, i) =>
|
|
4487
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
4255
4488
|
...params,
|
|
4256
4489
|
path: [
|
|
4257
4490
|
...params.path,
|
|
@@ -4264,7 +4497,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4264
4497
|
};
|
|
4265
4498
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
4266
4499
|
const def = schema._zod.def;
|
|
4267
|
-
const a =
|
|
4500
|
+
const a = processSchema(def.left, ctx, {
|
|
4268
4501
|
...params,
|
|
4269
4502
|
path: [
|
|
4270
4503
|
...params.path,
|
|
@@ -4272,7 +4505,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4272
4505
|
0
|
|
4273
4506
|
]
|
|
4274
4507
|
});
|
|
4275
|
-
const b =
|
|
4508
|
+
const b = processSchema(def.right, ctx, {
|
|
4276
4509
|
...params,
|
|
4277
4510
|
path: [
|
|
4278
4511
|
...params.path,
|
|
@@ -4348,9 +4581,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4348
4581
|
const def = schema._zod.def;
|
|
4349
4582
|
json.type = "object";
|
|
4350
4583
|
const keyType = def.keyType;
|
|
4351
|
-
const patterns = keyType.
|
|
4584
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
4352
4585
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
4353
|
-
const valueSchema =
|
|
4586
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
4354
4587
|
...params,
|
|
4355
4588
|
path: [
|
|
4356
4589
|
...params.path,
|
|
@@ -4359,10 +4592,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4359
4592
|
]
|
|
4360
4593
|
});
|
|
4361
4594
|
json.patternProperties = {};
|
|
4362
|
-
for (const pattern of patterns) assignProp(json.patternProperties, pattern.source, valueSchema);
|
|
4595
|
+
for (const pattern of patterns) assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
4363
4596
|
} else {
|
|
4364
4597
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
4365
|
-
json.propertyNames =
|
|
4598
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
4366
4599
|
...params,
|
|
4367
4600
|
path: [...params.path, "propertyNames"]
|
|
4368
4601
|
});
|
|
@@ -4374,7 +4607,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4374
4607
|
}
|
|
4375
4608
|
pending.push(schema);
|
|
4376
4609
|
}
|
|
4377
|
-
json.additionalProperties =
|
|
4610
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
4378
4611
|
...params,
|
|
4379
4612
|
path: [...params.path, "additionalProperties"]
|
|
4380
4613
|
});
|
|
@@ -4388,7 +4621,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4388
4621
|
};
|
|
4389
4622
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
4390
4623
|
const def = schema._zod.def;
|
|
4391
|
-
const inner =
|
|
4624
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
4392
4625
|
const seen = ctx.seen.get(schema);
|
|
4393
4626
|
if (ctx.target === "openapi-3.0") {
|
|
4394
4627
|
seen.ref = def.innerType;
|
|
@@ -4397,7 +4630,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4397
4630
|
};
|
|
4398
4631
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
4399
4632
|
const def = schema._zod.def;
|
|
4400
|
-
|
|
4633
|
+
processSchema(def.innerType, ctx, params);
|
|
4401
4634
|
const seen = ctx.seen.get(schema);
|
|
4402
4635
|
seen.ref = def.innerType;
|
|
4403
4636
|
};
|
|
@@ -4418,7 +4651,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4418
4651
|
}
|
|
4419
4652
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
4420
4653
|
const def = schema._zod.def;
|
|
4421
|
-
|
|
4654
|
+
processSchema(def.innerType, ctx, params);
|
|
4422
4655
|
const seen = ctx.seen.get(schema);
|
|
4423
4656
|
seen.ref = def.innerType;
|
|
4424
4657
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -4426,7 +4659,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4426
4659
|
};
|
|
4427
4660
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
4428
4661
|
const def = schema._zod.def;
|
|
4429
|
-
|
|
4662
|
+
processSchema(def.innerType, ctx, params);
|
|
4430
4663
|
const seen = ctx.seen.get(schema);
|
|
4431
4664
|
seen.ref = def.innerType;
|
|
4432
4665
|
if (ctx.io !== "input") return;
|
|
@@ -4435,7 +4668,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4435
4668
|
};
|
|
4436
4669
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
4437
4670
|
const def = schema._zod.def;
|
|
4438
|
-
|
|
4671
|
+
processSchema(def.innerType, ctx, params);
|
|
4439
4672
|
const seen = ctx.seen.get(schema);
|
|
4440
4673
|
seen.ref = def.innerType;
|
|
4441
4674
|
let catchValue;
|
|
@@ -4451,31 +4684,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4451
4684
|
const def = schema._zod.def;
|
|
4452
4685
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
4453
4686
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
4454
|
-
|
|
4687
|
+
processSchema(innerType, ctx, params);
|
|
4455
4688
|
const seen = ctx.seen.get(schema);
|
|
4456
4689
|
seen.ref = innerType;
|
|
4457
4690
|
};
|
|
4458
4691
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
4459
4692
|
const def = schema._zod.def;
|
|
4460
|
-
|
|
4693
|
+
processSchema(def.innerType, ctx, params);
|
|
4461
4694
|
const seen = ctx.seen.get(schema);
|
|
4462
4695
|
seen.ref = def.innerType;
|
|
4463
4696
|
json.readOnly = true;
|
|
4464
4697
|
};
|
|
4465
4698
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
4466
4699
|
const def = schema._zod.def;
|
|
4467
|
-
|
|
4700
|
+
processSchema(def.innerType, ctx, params);
|
|
4468
4701
|
const seen = ctx.seen.get(schema);
|
|
4469
4702
|
seen.ref = def.innerType;
|
|
4470
4703
|
};
|
|
4471
4704
|
const lazyProcessor = (schema, ctx, _json, params) => {
|
|
4472
4705
|
const innerType = schema._zod.innerType;
|
|
4473
|
-
|
|
4706
|
+
processSchema(innerType, ctx, params);
|
|
4474
4707
|
const seen = ctx.seen.get(schema);
|
|
4475
4708
|
seen.ref = innerType;
|
|
4476
4709
|
};
|
|
4477
4710
|
//#endregion
|
|
4478
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4711
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.js
|
|
4479
4712
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4480
4713
|
function _lazyMethod(proto, key, make) {
|
|
4481
4714
|
Object.defineProperty(proto, key, {
|
|
@@ -4525,7 +4758,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4525
4758
|
};
|
|
4526
4759
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4527
4760
|
//#endregion
|
|
4528
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4761
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.js
|
|
4529
4762
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
4530
4763
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
4531
4764
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -4539,7 +4772,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4539
4772
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4540
4773
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4541
4774
|
//#endregion
|
|
4542
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4775
|
+
//#region node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.js
|
|
4543
4776
|
function _ensureDefaultLocale() {
|
|
4544
4777
|
if (!globalConfig.localeError) config(en_default());
|
|
4545
4778
|
}
|
|
@@ -4675,6 +4908,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4675
4908
|
set spa(value) {
|
|
4676
4909
|
own(this, "spa", value);
|
|
4677
4910
|
},
|
|
4911
|
+
validate(data, params) {
|
|
4912
|
+
return validate(this, data, params);
|
|
4913
|
+
},
|
|
4914
|
+
validateAsync(data, params) {
|
|
4915
|
+
return validateAsync$1(this, data, params);
|
|
4916
|
+
},
|
|
4678
4917
|
encode: function _encode(data, params) {
|
|
4679
4918
|
return encode(this, data, params, { callee: _encode });
|
|
4680
4919
|
},
|
|
@@ -4714,10 +4953,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4714
4953
|
$ZodString.init(inst, def);
|
|
4715
4954
|
ZodType.init(inst, def);
|
|
4716
4955
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4956
|
+
}, /*@__PURE__*/ derived({
|
|
4957
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
4958
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
4959
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
4721
4960
|
}, {
|
|
4722
4961
|
regex(...args) {
|
|
4723
4962
|
return this.check(/* @__PURE__ */ _regex(...args));
|
|
@@ -4764,7 +5003,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4764
5003
|
slugify() {
|
|
4765
5004
|
return this.check(/* @__PURE__ */ _slugify());
|
|
4766
5005
|
}
|
|
4767
|
-
});
|
|
5006
|
+
}));
|
|
4768
5007
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
4769
5008
|
$ZodString.init(inst, def);
|
|
4770
5009
|
_ZodString.init(inst, def);
|
|
@@ -4956,12 +5195,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4956
5195
|
$ZodNumber.init(inst, def);
|
|
4957
5196
|
ZodType.init(inst, def);
|
|
4958
5197
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
4959
|
-
const bag = inst._zod.bag;
|
|
4960
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
4961
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
4962
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
4963
5198
|
inst.isFinite = true;
|
|
4964
|
-
|
|
5199
|
+
}, /*@__PURE__*/ derived({
|
|
5200
|
+
minValue: (inst) => {
|
|
5201
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
5202
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
5203
|
+
},
|
|
5204
|
+
maxValue: (inst) => {
|
|
5205
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
5206
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
5207
|
+
},
|
|
5208
|
+
isInt: (inst) => {
|
|
5209
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
5210
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
5211
|
+
},
|
|
5212
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
4965
5213
|
}, {
|
|
4966
5214
|
gt(value, params) {
|
|
4967
5215
|
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
@@ -5008,7 +5256,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5008
5256
|
finite() {
|
|
5009
5257
|
return this;
|
|
5010
5258
|
}
|
|
5011
|
-
});
|
|
5259
|
+
}));
|
|
5012
5260
|
function number(params) {
|
|
5013
5261
|
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
5014
5262
|
}
|
|
@@ -5088,34 +5336,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5088
5336
|
return _enum(Object.keys(this._zod.def.shape));
|
|
5089
5337
|
},
|
|
5090
5338
|
catchall(catchall) {
|
|
5091
|
-
return this.clone({
|
|
5092
|
-
...this._zod.def,
|
|
5093
|
-
catchall
|
|
5094
|
-
});
|
|
5339
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
5095
5340
|
},
|
|
5096
5341
|
passthrough() {
|
|
5097
|
-
return this.clone({
|
|
5098
|
-
...this._zod.def,
|
|
5099
|
-
catchall: unknown()
|
|
5100
|
-
});
|
|
5342
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5101
5343
|
},
|
|
5102
5344
|
loose() {
|
|
5103
|
-
return this.clone({
|
|
5104
|
-
...this._zod.def,
|
|
5105
|
-
catchall: unknown()
|
|
5106
|
-
});
|
|
5345
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5107
5346
|
},
|
|
5108
5347
|
strict() {
|
|
5109
|
-
return this.clone({
|
|
5110
|
-
...this._zod.def,
|
|
5111
|
-
catchall: never()
|
|
5112
|
-
});
|
|
5348
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
5113
5349
|
},
|
|
5114
5350
|
strip() {
|
|
5115
|
-
return this.clone({
|
|
5116
|
-
...this._zod.def,
|
|
5117
|
-
catchall: void 0
|
|
5118
|
-
});
|
|
5351
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
5119
5352
|
},
|
|
5120
5353
|
extend(incoming) {
|
|
5121
5354
|
return extend(this, incoming);
|
|
@@ -5214,7 +5447,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5214
5447
|
ZodType.init(inst, def);
|
|
5215
5448
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
5216
5449
|
inst.enum = def.entries;
|
|
5217
|
-
inst.options =
|
|
5450
|
+
inst.options = [...inst._zod.values];
|
|
5218
5451
|
const keys = new Set(Object.keys(def.entries));
|
|
5219
5452
|
inst.extract = (values, params) => {
|
|
5220
5453
|
const newEntries = {};
|
|
@@ -5583,7 +5816,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5583
5816
|
//#region src/client/dialog-focus.ts
|
|
5584
5817
|
const focusableSelector = [
|
|
5585
5818
|
"button:not([disabled])",
|
|
5586
|
-
"[href]",
|
|
5819
|
+
"a[href]",
|
|
5587
5820
|
"input:not([disabled])",
|
|
5588
5821
|
"select:not([disabled])",
|
|
5589
5822
|
"textarea:not([disabled])",
|
|
@@ -5646,47 +5879,47 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5646
5879
|
const css = ".run2skill_page_OghXMq{width:min(100%,960px);min-width:0;color:var(--dsw-alias-label-primary);gap:14px;padding:8px 0 32px;font-size:14px;line-height:1.6;display:grid}.run2skill_muted_OghXMq{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.6}.run2skill_section_OghXMq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:12px;overflow:hidden}.run2skill_sectionHeader_OghXMq{box-sizing:border-box;height:auto;min-height:52px;padding:12px 16px}.run2skill_sectionTitle_OghXMq{font-size:14px;font-weight:600}.run2skill_sectionBody_OghXMq{gap:14px;min-width:0;padding:4px 18px 18px;display:grid;container-type:inline-size}.run2skill_sectionBody_OghXMq h3{margin:0 0 8px;font-size:14px;line-height:1.5}.run2skill_sectionBody_OghXMq p{line-height:1.6}.run2skill_publicationFeedback_OghXMq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;gap:8px;padding:14px 16px;font-size:13px;display:grid}.run2skill_publicationFeedback_OghXMq p{margin:0}.run2skill_publicationFeedback_OghXMq>:last-child{justify-self:start}.run2skill_attentionGroup_OghXMq{gap:16px;min-width:0;display:grid}.run2skill_empty_OghXMq{min-height:56px;color:var(--dsw-alias-label-secondary);place-items:center;margin:0;font-size:13px;display:grid}.run2skill_toolbar_OghXMq,.run2skill_actions_OghXMq,.run2skill_modeGroup_OghXMq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_learningStatusRow_OghXMq{justify-content:space-between;align-items:center;gap:16px;min-width:0;display:flex}.run2skill_learningStatusRow_OghXMq>:first-child{overflow-wrap:anywhere;min-width:0}@container (width<=30rem){.run2skill_learningStatusRow_OghXMq{flex-direction:column;align-items:stretch}.run2skill_learningStatusRow_OghXMq .run2skill_actions_OghXMq{flex-direction:column;align-items:stretch;width:100%}.run2skill_learningStatusRow_OghXMq .run2skill_actions_OghXMq>*{box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;flex:none;width:100%;min-width:0;max-width:100%;height:auto;min-height:36px}}.run2skill_attentionList_OghXMq,.run2skill_proposalList_OghXMq,.run2skill_activityList_OghXMq{gap:8px;margin:0;padding:0;list-style:none;display:grid}.run2skill_activityItem_OghXMq{background:var(--dsw-alias-bg-layer-2);border-radius:8px;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;display:flex}.run2skill_activitySummary_OghXMq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_proposalToolbar_OghXMq{grid-template-columns:minmax(12rem,1fr) auto;align-items:center;gap:8px;display:grid}.run2skill_proposalToolbar_OghXMq>:first-child{width:100%}.run2skill_proposalToolbarCompact_OghXMq{justify-content:flex-end;display:flex}.run2skill_proposalToolbarCompact_OghXMq>:first-child{width:auto}.run2skill_proposalLayout_OghXMq{grid-template-columns:1fr;gap:16px;display:grid}.run2skill_proposalListButton_OghXMq{text-align:start;white-space:normal;overflow-wrap:anywhere;border-radius:8px;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:4px;width:100%;height:auto;min-height:48px;padding:12px 14px}.run2skill_proposalListButton_OghXMq[aria-current=true]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);box-shadow:inset 2px 0 var(--dsw-alias-brand-primary)}.run2skill_proposalName_OghXMq{max-width:100%;font-size:14px;font-weight:600;line-height:20px}.run2skill_proposalMeta_OghXMq{max-width:100%;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.run2skill_detail_OghXMq{border-top:1px solid var(--dsw-alias-border-l2);min-width:0;padding:16px 0 0}.run2skill_detail_OghXMq>:first-child{margin-top:0}.run2skill_detail_OghXMq h3,.run2skill_legacyDetail_OghXMq h3{overflow-wrap:anywhere;margin:0 0 16px;font-size:16px;font-weight:600;line-height:1.5}.run2skill_detail_OghXMq h4,.run2skill_legacyDetail_OghXMq h4{margin:22px 0 8px;font-size:13px;font-weight:600;line-height:1.5}.run2skill_detail_OghXMq p{margin:8px 0}.run2skill_detail_OghXMq>article{border-left:2px solid var(--dsw-alias-border-l2);margin:12px 0;padding-left:12px}.run2skill_detail_OghXMq>article strong{font-size:13px;font-weight:500}.run2skill_detailFacts_OghXMq{grid-template-columns:minmax(6rem,max-content) minmax(0,1fr);gap:8px 14px;margin:0 0 16px;display:grid}.run2skill_detailFacts_OghXMq dt{color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_detailFacts_OghXMq dd{overflow-wrap:anywhere;min-width:0;margin:0;font-size:14px}.run2skill_detail_OghXMq pre{white-space:pre-wrap;unicode-bidi:isolate;overflow:auto}.run2skill_technicalDetails_OghXMq{background:var(--dsw-alias-bg-layer-2);border-radius:8px;margin:16px 0;padding:10px 12px}.run2skill_technicalDetails_OghXMq summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_technicalDetails_OghXMq[open] summary{margin-bottom:12px}.run2skill_status_OghXMq{min-height:20px;margin:0;font-size:13px}.run2skill_revisionBox_OghXMq{background:var(--dsw-alias-bg-layer-2);border-radius:10px;gap:8px;margin:18px 0;padding:14px;display:grid}.run2skill_revisionBox_OghXMq label{font-size:14px;font-weight:600}.run2skill_revisionBox_OghXMq textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;min-height:84px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:10px;padding:10px 12px;line-height:1.5}.run2skill_revisionBox_OghXMq textarea:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.run2skill_revisionBox_OghXMq textarea:disabled{cursor:not-allowed;opacity:.65}.run2skill_revisionBox_OghXMq>:last-child{justify-self:start}.run2skill_danger_OghXMq{color:var(--dsw-alias-state-error-primary)}.run2skill_backdrop_OghXMq,.run2skill_rejectOverlay_OghXMq{background:var(--dsw-alias-bg-mask-1);position:fixed;inset:0}.run2skill_backdrop_OghXMq{z-index:999}.run2skill_rejectOverlay_OghXMq{z-index:1001;place-items:center;padding:16px;display:grid}.run2skill_legacyDialog_OghXMq{z-index:1000;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-shadow:0 16px 48px var(--dsw-alias-bg-mask-1);border-radius:16px;grid-template-columns:minmax(16rem,24rem) minmax(0,1fr);gap:16px;padding:16px;display:grid;position:fixed;inset:5vh 5vw;overflow:hidden}.run2skill_blocked_OghXMq{pointer-events:none;display:contents}.run2skill_queue_OghXMq,.run2skill_legacyDetail_OghXMq{min-width:0;overflow:auto}.run2skill_legacyHeader_OghXMq{justify-content:space-between;align-items:center;gap:8px;display:flex}.run2skill_legacyList_OghXMq{margin:0;padding:0;list-style:none}.run2skill_rejectCard_OghXMq{background:var(--dsw-alias-bg-layer-1);border-radius:16px;max-width:32rem;padding:16px}.run2skill_textBlock_OghXMq{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);max-width:100%;font-family:var(--ds-font-family-code);white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate;border-radius:8px;padding:14px;font-size:12px;line-height:1.75;overflow:auto}.run2skill_previewFacts_OghXMq{grid-template-columns:max-content 1fr;gap:6px 12px;display:grid}.run2skill_previewFacts_OghXMq dt,.run2skill_previewFacts_OghXMq dd{margin:0}@container (width>=760px){.run2skill_proposalLayout_OghXMq{grid-template-columns:minmax(200px,.8fr) minmax(0,1.8fr);gap:20px}.run2skill_proposalLayout_OghXMq .run2skill_detail_OghXMq{border-top:0;border-left:1px solid var(--dsw-alias-border-l2);padding:0 0 0 20px}}@container (width<=420px){.run2skill_proposalToolbar_OghXMq,.run2skill_detailFacts_OghXMq{grid-template-columns:1fr}.run2skill_proposalToolbar_OghXMq>:last-child{justify-self:start}.run2skill_detailFacts_OghXMq dt:not(:first-child){margin-top:8px}}@media (width<=720px){.run2skill_sectionBody_OghXMq{padding:8px 18px 20px}.run2skill_activityItem_OghXMq{flex-direction:column;align-items:flex-start}}";
|
|
5647
5880
|
if (typeof document !== "undefined") upsertRun2skillStyle(css);
|
|
5648
5881
|
var _run2skill_css_run2skill_settings_page_module_css_default = {
|
|
5649
|
-
"publicationFeedback": "run2skill_publicationFeedback_OghXMq",
|
|
5650
|
-
"sectionHeader": "run2skill_sectionHeader_OghXMq",
|
|
5651
|
-
"muted": "run2skill_muted_OghXMq",
|
|
5652
|
-
"backdrop": "run2skill_backdrop_OghXMq",
|
|
5653
|
-
"activitySummary": "run2skill_activitySummary_OghXMq",
|
|
5654
|
-
"proposalMeta": "run2skill_proposalMeta_OghXMq",
|
|
5655
|
-
"proposalName": "run2skill_proposalName_OghXMq",
|
|
5656
|
-
"previewFacts": "run2skill_previewFacts_OghXMq",
|
|
5657
|
-
"modeGroup": "run2skill_modeGroup_OghXMq",
|
|
5658
5882
|
"revisionBox": "run2skill_revisionBox_OghXMq",
|
|
5659
|
-
"
|
|
5660
|
-
"
|
|
5883
|
+
"legacyHeader": "run2skill_legacyHeader_OghXMq",
|
|
5884
|
+
"activityItem": "run2skill_activityItem_OghXMq",
|
|
5885
|
+
"sectionHeader": "run2skill_sectionHeader_OghXMq",
|
|
5886
|
+
"proposalToolbar": "run2skill_proposalToolbar_OghXMq",
|
|
5887
|
+
"textBlock": "run2skill_textBlock_OghXMq",
|
|
5888
|
+
"proposalListButton": "run2skill_proposalListButton_OghXMq",
|
|
5661
5889
|
"legacyDetail": "run2skill_legacyDetail_OghXMq",
|
|
5662
|
-
"proposalToolbarCompact": "run2skill_proposalToolbarCompact_OghXMq",
|
|
5663
5890
|
"section": "run2skill_section_OghXMq",
|
|
5664
|
-
"proposalToolbar": "run2skill_proposalToolbar_OghXMq",
|
|
5665
|
-
"activityList": "run2skill_activityList_OghXMq",
|
|
5666
5891
|
"detail": "run2skill_detail_OghXMq",
|
|
5667
|
-
"activityItem": "run2skill_activityItem_OghXMq",
|
|
5668
5892
|
"technicalDetails": "run2skill_technicalDetails_OghXMq",
|
|
5669
|
-
"
|
|
5670
|
-
"
|
|
5671
|
-
"
|
|
5672
|
-
"queue": "run2skill_queue_OghXMq",
|
|
5673
|
-
"proposalLayout": "run2skill_proposalLayout_OghXMq",
|
|
5674
|
-
"page": "run2skill_page_OghXMq",
|
|
5893
|
+
"legacyDialog": "run2skill_legacyDialog_OghXMq",
|
|
5894
|
+
"proposalMeta": "run2skill_proposalMeta_OghXMq",
|
|
5895
|
+
"legacyList": "run2skill_legacyList_OghXMq",
|
|
5675
5896
|
"rejectCard": "run2skill_rejectCard_OghXMq",
|
|
5676
|
-
"
|
|
5897
|
+
"publicationFeedback": "run2skill_publicationFeedback_OghXMq",
|
|
5898
|
+
"page": "run2skill_page_OghXMq",
|
|
5677
5899
|
"danger": "run2skill_danger_OghXMq",
|
|
5900
|
+
"proposalLayout": "run2skill_proposalLayout_OghXMq",
|
|
5901
|
+
"empty": "run2skill_empty_OghXMq",
|
|
5902
|
+
"learningStatusRow": "run2skill_learningStatusRow_OghXMq",
|
|
5903
|
+
"proposalName": "run2skill_proposalName_OghXMq",
|
|
5904
|
+
"muted": "run2skill_muted_OghXMq",
|
|
5678
5905
|
"sectionTitle": "run2skill_sectionTitle_OghXMq",
|
|
5906
|
+
"actions": "run2skill_actions_OghXMq",
|
|
5679
5907
|
"rejectOverlay": "run2skill_rejectOverlay_OghXMq",
|
|
5680
|
-
"textBlock": "run2skill_textBlock_OghXMq",
|
|
5681
|
-
"empty": "run2skill_empty_OghXMq",
|
|
5682
|
-
"attentionList": "run2skill_attentionList_OghXMq",
|
|
5683
5908
|
"proposalList": "run2skill_proposalList_OghXMq",
|
|
5684
|
-
"learningStatusRow": "run2skill_learningStatusRow_OghXMq",
|
|
5685
|
-
"detailFacts": "run2skill_detailFacts_OghXMq",
|
|
5686
|
-
"legacyDialog": "run2skill_legacyDialog_OghXMq",
|
|
5687
|
-
"legacyHeader": "run2skill_legacyHeader_OghXMq",
|
|
5688
5909
|
"blocked": "run2skill_blocked_OghXMq",
|
|
5689
|
-
"
|
|
5910
|
+
"activityList": "run2skill_activityList_OghXMq",
|
|
5911
|
+
"attentionGroup": "run2skill_attentionGroup_OghXMq",
|
|
5912
|
+
"sectionBody": "run2skill_sectionBody_OghXMq",
|
|
5913
|
+
"toolbar": "run2skill_toolbar_OghXMq",
|
|
5914
|
+
"modeGroup": "run2skill_modeGroup_OghXMq",
|
|
5915
|
+
"backdrop": "run2skill_backdrop_OghXMq",
|
|
5916
|
+
"previewFacts": "run2skill_previewFacts_OghXMq",
|
|
5917
|
+
"proposalToolbarCompact": "run2skill_proposalToolbarCompact_OghXMq",
|
|
5918
|
+
"status": "run2skill_status_OghXMq",
|
|
5919
|
+
"queue": "run2skill_queue_OghXMq",
|
|
5920
|
+
"attentionList": "run2skill_attentionList_OghXMq",
|
|
5921
|
+
"detailFacts": "run2skill_detailFacts_OghXMq",
|
|
5922
|
+
"activitySummary": "run2skill_activitySummary_OghXMq"
|
|
5690
5923
|
};
|
|
5691
5924
|
//#endregion
|
|
5692
5925
|
//#region src/client/purge-settings.ts
|