@khorsheed/dsh-client-message-tools 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -7,82 +7,34 @@ window.__ModuleLoader__.load({
7
7
  let react = require("react");
8
8
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
10
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
11
- var _a$1;
12
- function $constructor(name, initializer, params) {
13
- function init(inst, def) {
14
- if (!inst._zod) Object.defineProperty(inst, "_zod", {
15
- value: {
16
- def,
17
- constr: _,
18
- traits: /* @__PURE__ */ new Set()
19
- },
20
- enumerable: false
21
- });
22
- if (inst._zod.traits.has(name)) return;
23
- inst._zod.traits.add(name);
24
- initializer(inst, def);
25
- const proto = _.prototype;
26
- const keys = Object.keys(proto);
27
- for (let i = 0; i < keys.length; i++) {
28
- const k = keys[i];
29
- if (!(k in inst)) inst[k] = proto[k].bind(inst);
30
- }
31
- }
32
- const Parent = params?.Parent ?? Object;
33
- class Definition extends Parent {}
34
- Object.defineProperty(Definition, "name", { value: name });
35
- function _(def) {
36
- var _a;
37
- const inst = params?.Parent ? new Definition() : this;
38
- init(inst, def);
39
- (_a = inst._zod).deferred ?? (_a.deferred = []);
40
- for (const fn of inst._zod.deferred) fn();
41
- return inst;
42
- }
43
- Object.defineProperty(_, "init", { value: init });
44
- Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
45
- if (params?.Parent && inst instanceof params.Parent) return true;
46
- return inst?._zod?.traits?.has(name);
47
- } });
48
- Object.defineProperty(_, "name", { value: name });
49
- return _;
50
- }
51
- var $ZodAsyncError = class extends Error {
52
- constructor() {
53
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
54
- }
55
- };
56
- var $ZodEncodeError = class extends Error {
57
- constructor(name) {
58
- super(`Encountered unidirectional transform during encode: ${name}`);
59
- this.name = "ZodEncodeError";
60
- }
61
- };
62
- (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
63
- const globalConfig = globalThis.__zod_globalConfig;
64
- function config(newConfig) {
65
- if (newConfig) Object.assign(globalConfig, newConfig);
66
- return globalConfig;
67
- }
68
- //#endregion
69
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
10
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
70
11
  function getEnumValues(entries) {
71
12
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
72
13
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
73
14
  }
15
+ function joinValues(array, separator = "|") {
16
+ return array.map((val) => stringifyPrimitive(val)).join(separator);
17
+ }
74
18
  function jsonStringifyReplacer(_, value) {
75
19
  if (typeof value === "bigint") return value.toString();
76
20
  return value;
77
21
  }
78
- function cached(getter) {
79
- return { get value() {
80
- {
81
- const value = getter();
82
- Object.defineProperty(this, "value", { value });
83
- return value;
22
+ var Cached = class {
23
+ constructor(getter) {
24
+ this._getter = getter;
25
+ this._value = void 0;
26
+ }
27
+ get value() {
28
+ const getter = this._getter;
29
+ if (getter !== void 0) {
30
+ this._value = getter();
31
+ this._getter = void 0;
84
32
  }
85
- } };
33
+ return this._value;
34
+ }
35
+ };
36
+ function cached(getter) {
37
+ return new Cached(getter);
86
38
  }
87
39
  function nullish(input) {
88
40
  return input === null || input === void 0;
@@ -95,28 +47,10 @@ window.__ModuleLoader__.load({
95
47
  function floatSafeRemainder(val, step) {
96
48
  const ratio = val / step;
97
49
  const roundedRatio = Math.round(ratio);
98
- const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
50
+ const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
99
51
  if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
100
52
  return ratio - roundedRatio;
101
53
  }
102
- const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
103
- function defineLazy(object, key, getter) {
104
- let value = void 0;
105
- Object.defineProperty(object, key, {
106
- get() {
107
- if (value === EVALUATING) return;
108
- if (value === void 0) {
109
- value = EVALUATING;
110
- value = getter();
111
- }
112
- return value;
113
- },
114
- set(v) {
115
- Object.defineProperty(object, key, { value: v });
116
- },
117
- configurable: true
118
- });
119
- }
120
54
  function assignProp(target, prop, value) {
121
55
  Object.defineProperty(target, prop, {
122
56
  value,
@@ -125,6 +59,58 @@ window.__ModuleLoader__.load({
125
59
  configurable: true
126
60
  });
127
61
  }
62
+ /**
63
+ * Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
64
+ *
65
+ * 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.
66
+ */
67
+ function rawShape(def) {
68
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
69
+ return desc?.get ? desc.get.raw : desc?.value;
70
+ }
71
+ function sourceShape(schema) {
72
+ return rawShape(schema._zod.def) ?? schema._zod.def.shape;
73
+ }
74
+ function deferProp(target, key, getter) {
75
+ Object.defineProperty(target, key, {
76
+ get() {
77
+ const value = getter();
78
+ assignProp(this, key, value);
79
+ return value;
80
+ },
81
+ enumerable: true,
82
+ configurable: true
83
+ });
84
+ }
85
+ function putProp(target, key, value) {
86
+ if (key in target) assignProp(target, key, value);
87
+ else target[key] = value;
88
+ }
89
+ /**
90
+ * Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
91
+ *
92
+ * 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.
93
+ */
94
+ function mirrorShape(target, source, keys, wrap) {
95
+ const raw = sourceShape(source);
96
+ for (const key of keys) {
97
+ const desc = Object.getOwnPropertyDescriptor(raw, key);
98
+ if (!desc.enumerable) continue;
99
+ if (desc.get) deferProp(target, key, () => {
100
+ const value = source._zod.def.shape[key];
101
+ return wrap ? wrap(value, key) : value;
102
+ });
103
+ else putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
104
+ }
105
+ }
106
+ function mirrorProps(target, source) {
107
+ for (const key of Reflect.ownKeys(source)) {
108
+ const desc = Object.getOwnPropertyDescriptor(source, key);
109
+ if (!desc.enumerable) continue;
110
+ if (desc.get) deferProp(target, key, () => source[key]);
111
+ else putProp(target, key, desc.value);
112
+ }
113
+ }
128
114
  function mergeDefs(...defs) {
129
115
  const mergedDescriptors = {};
130
116
  for (const def of defs) {
@@ -198,51 +184,56 @@ window.__ModuleLoader__.load({
198
184
  };
199
185
  return params;
200
186
  }
187
+ function stringifyPrimitive(value) {
188
+ if (typeof value === "bigint") return value.toString() + "n";
189
+ if (typeof value === "string") return `"${value}"`;
190
+ return `${value}`;
191
+ }
201
192
  function optionalKeys(shape) {
202
193
  return Object.keys(shape).filter((k) => {
203
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
194
+ return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
204
195
  });
205
196
  }
206
- const NUMBER_FORMAT_RANGES = {
197
+ const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
207
198
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
208
199
  int32: [-2147483648, 2147483647],
209
200
  uint32: [0, 4294967295],
210
201
  float32: [-34028234663852886e22, 34028234663852886e22],
211
202
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
203
+ }))();
204
+ const BIGINT_FORMAT_RANGES = {
205
+ int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
206
+ uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
212
207
  };
213
208
  function pick(schema, mask) {
214
209
  const currDef = schema._zod.def;
215
210
  const checks = currDef.checks;
216
211
  if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
217
- return clone(schema, mergeDefs(schema._zod.def, {
218
- get shape() {
219
- const newShape = {};
220
- for (const key in mask) {
221
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
222
- if (!mask[key]) continue;
223
- newShape[key] = currDef.shape[key];
224
- }
225
- assignProp(this, "shape", newShape);
226
- return newShape;
227
- },
212
+ const newShape = {};
213
+ mirrorShape(newShape, schema, maskedKeys(schema, mask));
214
+ return clone(schema, mergeDefs(currDef, {
215
+ shape: newShape,
228
216
  checks: []
229
217
  }));
230
218
  }
219
+ function maskedKeys(schema, mask) {
220
+ const raw = sourceShape(schema);
221
+ const keys = [];
222
+ for (const key of Reflect.ownKeys(mask)) {
223
+ if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) throw new Error(`Unrecognized key: "${String(key)}"`);
224
+ if (mask[key]) keys.push(key);
225
+ }
226
+ return keys;
227
+ }
231
228
  function omit(schema, mask) {
232
229
  const currDef = schema._zod.def;
233
230
  const checks = currDef.checks;
234
231
  if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
235
- return clone(schema, mergeDefs(schema._zod.def, {
236
- get shape() {
237
- const newShape = { ...schema._zod.def.shape };
238
- for (const key in mask) {
239
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
240
- if (!mask[key]) continue;
241
- delete newShape[key];
242
- }
243
- assignProp(this, "shape", newShape);
244
- return newShape;
245
- },
232
+ const omitted = new Set(maskedKeys(schema, mask));
233
+ const newShape = {};
234
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
235
+ return clone(schema, mergeDefs(currDef, {
236
+ shape: newShape,
246
237
  checks: []
247
238
  }));
248
239
  }
@@ -250,90 +241,57 @@ window.__ModuleLoader__.load({
250
241
  if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
251
242
  const checks = schema._zod.def.checks;
252
243
  if (checks && checks.length > 0) {
253
- const existingShape = schema._zod.def.shape;
254
- for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
244
+ const existingShape = sourceShape(schema);
245
+ 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.");
255
246
  }
256
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
257
- const _shape = {
258
- ...schema._zod.def.shape,
259
- ...shape
260
- };
261
- assignProp(this, "shape", _shape);
262
- return _shape;
263
- } }));
247
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
248
+ }
249
+ function extended(schema, shape) {
250
+ const newShape = {};
251
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
252
+ mirrorProps(newShape, shape);
253
+ return newShape;
264
254
  }
265
255
  function safeExtend(schema, shape) {
266
256
  if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
267
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
268
- const _shape = {
269
- ...schema._zod.def.shape,
270
- ...shape
271
- };
272
- assignProp(this, "shape", _shape);
273
- return _shape;
274
- } }));
257
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
275
258
  }
276
259
  function merge(a, b) {
260
+ if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
277
261
  if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
262
+ const newShape = {};
263
+ mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
264
+ mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
278
265
  return clone(a, mergeDefs(a._zod.def, {
279
- get shape() {
280
- const _shape = {
281
- ...a._zod.def.shape,
282
- ...b._zod.def.shape
283
- };
284
- assignProp(this, "shape", _shape);
285
- return _shape;
286
- },
266
+ shape: newShape,
287
267
  get catchall() {
288
268
  return b._zod.def.catchall;
289
269
  },
290
270
  checks: b._zod.def.checks ?? []
291
271
  }));
292
272
  }
293
- function partial(Class, schema, mask) {
273
+ function partial(Class, schema, mask, name = "partial") {
294
274
  const checks = schema._zod.def.checks;
295
- if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
275
+ if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
276
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
277
+ const newShape = {};
278
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({
279
+ type: "optional",
280
+ innerType: value
281
+ })));
296
282
  return clone(schema, mergeDefs(schema._zod.def, {
297
- get shape() {
298
- const oldShape = schema._zod.def.shape;
299
- const shape = { ...oldShape };
300
- if (mask) for (const key in mask) {
301
- if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
302
- if (!mask[key]) continue;
303
- shape[key] = Class ? new Class({
304
- type: "optional",
305
- innerType: oldShape[key]
306
- }) : oldShape[key];
307
- }
308
- else for (const key in oldShape) shape[key] = Class ? new Class({
309
- type: "optional",
310
- innerType: oldShape[key]
311
- }) : oldShape[key];
312
- assignProp(this, "shape", shape);
313
- return shape;
314
- },
283
+ shape: newShape,
315
284
  checks: []
316
285
  }));
317
286
  }
318
287
  function required(Class, schema, mask) {
319
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
320
- const oldShape = schema._zod.def.shape;
321
- const shape = { ...oldShape };
322
- if (mask) for (const key in mask) {
323
- if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
324
- if (!mask[key]) continue;
325
- shape[key] = new Class({
326
- type: "nonoptional",
327
- innerType: oldShape[key]
328
- });
329
- }
330
- else for (const key in oldShape) shape[key] = new Class({
331
- type: "nonoptional",
332
- innerType: oldShape[key]
333
- });
334
- assignProp(this, "shape", shape);
335
- return shape;
336
- } }));
288
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
289
+ const newShape = {};
290
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({
291
+ type: "nonoptional",
292
+ innerType: value
293
+ }));
294
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
337
295
  }
338
296
  function aborted(x, startIndex = 0) {
339
297
  if (x.aborted === true) return true;
@@ -356,19 +314,58 @@ window.__ModuleLoader__.load({
356
314
  function unwrapMessage(message) {
357
315
  return typeof message === "string" ? message : message?.message;
358
316
  }
317
+ function attachSchema(issues, start, inst) {
318
+ var _a;
319
+ for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
320
+ }
359
321
  function finalizeIssue(iss, ctx, config) {
360
- const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
361
- const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
362
- rest.path ?? (rest.path = []);
363
- rest.message = message;
364
- if (ctx?.reportInput) rest.input = _input;
365
- return rest;
322
+ var _a;
323
+ const traits = iss.inst?._zod?.traits;
324
+ if (traits?.has("$ZodType")) {
325
+ if (traits.has("$ZodCheck")) (_a = iss).schema ?? (_a.schema = iss.inst);
326
+ else iss.schema = iss.inst;
327
+ }
328
+ const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
329
+ 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";
330
+ const full = {};
331
+ for (const k of Object.keys(iss)) {
332
+ if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
333
+ full[k] = iss[k];
334
+ }
335
+ full.path ?? (full.path = []);
336
+ full.message = message;
337
+ if (ctx?.reportInput) full.input = iss.input;
338
+ return full;
339
+ }
340
+ const highSurrogate = /[\uD800-\uDBFF]/;
341
+ function codePointLength(str) {
342
+ const units = str.length;
343
+ if (!highSurrogate.test(str)) return units;
344
+ let count = units;
345
+ for (let i = 0; i < units - 1; i++) if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
346
+ count--;
347
+ i++;
348
+ }
349
+ return count;
366
350
  }
367
351
  function getLengthableOrigin(input) {
368
352
  if (Array.isArray(input)) return "array";
369
353
  if (typeof input === "string") return "string";
370
354
  return "unknown";
371
355
  }
356
+ function parsedType(data) {
357
+ const t = typeof data;
358
+ switch (t) {
359
+ case "number": return Number.isNaN(data) ? "nan" : "number";
360
+ case "object": {
361
+ if (data === null) return "null";
362
+ if (Array.isArray(data)) return "array";
363
+ const obj = data;
364
+ if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) return obj.constructor.name;
365
+ }
366
+ }
367
+ return t;
368
+ }
372
369
  function issue(...args) {
373
370
  const [iss, input, inst] = args;
374
371
  if (typeof iss === "string") return {
@@ -379,33 +376,339 @@ window.__ModuleLoader__.load({
379
376
  };
380
377
  return { ...iss };
381
378
  }
382
- //#endregion
383
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
384
- const initializer$1 = (inst, def) => {
385
- inst.name = "$ZodError";
386
- Object.defineProperty(inst, "_zod", {
387
- value: inst._zod,
388
- enumerable: false
379
+ /**
380
+ * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
381
+ *
382
+ * Call this from a `proto` initializer, which runs once per prototype — never per instance.
383
+ */
384
+ function members(proto, table) {
385
+ for (const key in table) {
386
+ const desc = Object.getOwnPropertyDescriptor(table, key);
387
+ if (desc.get) Object.defineProperty(proto, key, {
388
+ ...desc,
389
+ enumerable: false
390
+ });
391
+ else defineBound(proto, key, desc.value);
392
+ }
393
+ }
394
+ /** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
395
+ function own(inst, key, value, enumerable = true) {
396
+ Object.defineProperty(inst, key, {
397
+ configurable: true,
398
+ writable: true,
399
+ enumerable,
400
+ value
401
+ });
402
+ return value;
403
+ }
404
+ /** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
405
+ function hide(inst, key, value) {
406
+ return own(inst, key, value, false);
407
+ }
408
+ /** 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. */
409
+ function derived(computes, table) {
410
+ for (const key in computes) {
411
+ const compute = computes[key];
412
+ Object.defineProperty(table, key, {
413
+ configurable: true,
414
+ enumerable: true,
415
+ get() {
416
+ return own(this, key, compute(this));
417
+ },
418
+ set(value) {
419
+ own(this, key, value);
420
+ }
421
+ });
422
+ }
423
+ return table;
424
+ }
425
+ function defineBound(proto, key, fn) {
426
+ Object.defineProperty(proto, key, {
427
+ configurable: true,
428
+ get() {
429
+ return this == null ? fn : own(this, key, fn.bind(this));
430
+ },
431
+ set(value) {
432
+ own(this, key, value);
433
+ }
389
434
  });
390
- Object.defineProperty(inst, "issues", {
391
- value: def,
392
- enumerable: false
435
+ }
436
+ /** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
437
+ function claim(inst, sentinel) {
438
+ const proto = Object.getPrototypeOf(inst);
439
+ return sentinel in proto ? void 0 : proto;
440
+ }
441
+ let installing;
442
+ let broke = false;
443
+ const breaker = {
444
+ configurable: true,
445
+ get() {
446
+ broke = true;
447
+ }
448
+ };
449
+ /**
450
+ * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
451
+ * constructor, computed from the internals object itself and cached there on
452
+ * first read. One accessor per constructor rather than one per instance.
453
+ */
454
+ function defineLazyInternal(inst, key, compute) {
455
+ const proto = Object.getPrototypeOf(inst._zod);
456
+ if (key in proto && installing !== inst._zod) {
457
+ installing = void 0;
458
+ return;
459
+ }
460
+ installing = inst._zod;
461
+ Object.defineProperty(proto, key, {
462
+ configurable: true,
463
+ get() {
464
+ Object.defineProperty(this, key, breaker);
465
+ const outer = broke;
466
+ broke = false;
467
+ try {
468
+ const value = compute(this);
469
+ if (broke) delete this[key];
470
+ else Object.defineProperty(this, key, {
471
+ configurable: true,
472
+ writable: true,
473
+ value
474
+ });
475
+ broke = broke || outer;
476
+ return value;
477
+ } catch (err) {
478
+ delete this[key];
479
+ broke = broke || outer;
480
+ throw err;
481
+ }
482
+ },
483
+ set(value) {
484
+ Object.defineProperty(this, key, {
485
+ configurable: true,
486
+ writable: true,
487
+ value
488
+ });
489
+ }
393
490
  });
394
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
395
- Object.defineProperty(inst, "toString", {
396
- value: () => inst.message,
397
- enumerable: false
491
+ }
492
+ /**
493
+ * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
494
+ * data property. One accessor per constructor rather than one per instance, because an own accessor
495
+ * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
496
+ */
497
+ function installLazyProp(inst, key, make, enumerable) {
498
+ const proto = claim(inst, key);
499
+ if (!proto) return;
500
+ Object.defineProperty(proto, key, {
501
+ configurable: true,
502
+ get() {
503
+ const desc = {
504
+ configurable: true,
505
+ writable: true,
506
+ enumerable,
507
+ value: void 0
508
+ };
509
+ Object.defineProperty(this, key, desc);
510
+ desc.value = make(this);
511
+ Object.defineProperty(this, key, desc);
512
+ return desc.value;
513
+ },
514
+ set(value) {
515
+ Object.defineProperty(this, key, {
516
+ configurable: true,
517
+ writable: true,
518
+ enumerable,
519
+ value
520
+ });
521
+ }
398
522
  });
523
+ }
524
+ /** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
525
+ const CONSTANT_CATCH = "~constantCatch";
526
+ /** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
527
+ function constantCatch(value) {
528
+ const fn = () => value;
529
+ fn[CONSTANT_CATCH] = true;
530
+ return fn;
531
+ }
532
+ //#endregion
533
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
534
+ var _a$1;
535
+ const _zodDesc = {
536
+ value: void 0,
537
+ enumerable: false
538
+ };
539
+ let _E = "captureStackTrace" in Error ? Error : null;
540
+ function newError(Definition) {
541
+ const E = _E;
542
+ if (E) {
543
+ const saved = E.stackTraceLimit;
544
+ if (typeof saved === "number") {
545
+ try {
546
+ E.stackTraceLimit = 0;
547
+ } catch {
548
+ _E = null;
549
+ return new Definition();
550
+ }
551
+ try {
552
+ return new Definition();
553
+ } finally {
554
+ E.stackTraceLimit = saved;
555
+ }
556
+ }
557
+ }
558
+ return new Definition();
559
+ }
560
+ function $constructor(name, initializer, proto, params) {
561
+ const zodProto = {};
562
+ function Internals(def) {
563
+ this.def = def;
564
+ this.constr = _;
565
+ this.traits = /* @__PURE__ */ new Set();
566
+ }
567
+ Internals.prototype = zodProto;
568
+ const protoMembers = proto;
569
+ const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
570
+ function init(inst, def) {
571
+ if (!inst._zod) {
572
+ _zodDesc.value = new Internals(def);
573
+ try {
574
+ Object.defineProperty(inst, "_zod", _zodDesc);
575
+ } finally {
576
+ _zodDesc.value = void 0;
577
+ }
578
+ } else if (inst._zod.traits.has(name)) return;
579
+ inst._zod.traits.add(name);
580
+ initializer(inst, def);
581
+ if (initialized) {
582
+ const own = Object.getPrototypeOf(inst);
583
+ const ctorProto = inst._zod.constr.prototype;
584
+ let up = own;
585
+ while (up && up !== ctorProto) up = Object.getPrototypeOf(up);
586
+ const target = up ?? own;
587
+ if (!initialized.has(target)) {
588
+ initialized.add(target);
589
+ members(target, protoMembers);
590
+ }
591
+ }
592
+ const proto = _.prototype;
593
+ for (const k in proto) {
594
+ if (!Object.prototype.hasOwnProperty.call(proto, k)) continue;
595
+ if (!(k in inst)) inst[k] = proto[k].bind(inst);
596
+ }
597
+ }
598
+ const Parent = params?.Parent ?? Object;
599
+ class Definition extends Parent {}
600
+ Object.defineProperty(Definition, "name", { value: name });
601
+ function _(def) {
602
+ const inst = params?.Parent ? newError(Definition) : this;
603
+ init(inst, def);
604
+ const deferred = inst._zod.deferred;
605
+ if (deferred) {
606
+ for (const fn of deferred) fn();
607
+ inst._zod.deferred = void 0;
608
+ }
609
+ const pp = globalThis.__zod_globalConfig?.postProcessor;
610
+ if (pp) pp(inst);
611
+ return inst;
612
+ }
613
+ Object.defineProperty(_, "init", { value: init });
614
+ Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
615
+ if (params?.Parent && inst instanceof params.Parent) return true;
616
+ return inst?._zod?.traits?.has(name);
617
+ } });
618
+ Object.defineProperty(_, "name", { value: name });
619
+ return _;
620
+ }
621
+ var $ZodAsyncError = class extends Error {
622
+ constructor() {
623
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
624
+ }
625
+ };
626
+ var $ZodEncodeError = class extends Error {
627
+ constructor(name) {
628
+ super(`Encountered unidirectional transform during encode: ${name}`);
629
+ this.name = "ZodEncodeError";
630
+ }
631
+ };
632
+ (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
633
+ const globalConfig = globalThis.__zod_globalConfig;
634
+ function config(newConfig) {
635
+ if (newConfig) Object.assign(globalConfig, newConfig);
636
+ return globalConfig;
637
+ }
638
+ //#endregion
639
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
640
+ function _getMessage() {
641
+ const internals = this._zod;
642
+ internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
643
+ return internals.message;
644
+ }
645
+ function _setMessage(value) {
646
+ this._zod.message = value;
647
+ }
648
+ const _messageDesc = {
649
+ get: _getMessage,
650
+ set: _setMessage,
651
+ enumerable: true,
652
+ configurable: true
653
+ };
654
+ const _issuesDesc = {
655
+ value: void 0,
656
+ enumerable: false
657
+ };
658
+ const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
659
+ const initializer$1 = (inst, def) => {
660
+ inst.name = "$ZodError";
661
+ _issuesDesc.value = def;
662
+ Object.defineProperty(inst, "issues", _issuesDesc);
663
+ _issuesDesc.value = void 0;
664
+ Object.defineProperty(inst, "message", _messageDesc);
665
+ const proto = Object.getPrototypeOf(inst);
666
+ if (!_installedToString.has(proto)) {
667
+ _installedToString.add(proto);
668
+ Object.defineProperty(proto, "toString", {
669
+ configurable: true,
670
+ enumerable: false,
671
+ get() {
672
+ const value = () => this.message;
673
+ Object.defineProperty(this, "toString", {
674
+ value,
675
+ configurable: true,
676
+ writable: true
677
+ });
678
+ return value;
679
+ },
680
+ set(value) {
681
+ Object.defineProperty(this, "toString", {
682
+ value,
683
+ configurable: true,
684
+ writable: true
685
+ });
686
+ }
687
+ });
688
+ }
399
689
  };
400
690
  const $ZodError = $constructor("$ZodError", initializer$1);
401
- const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
691
+ $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
692
+ /** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
693
+ * ("toString", "constructor") would otherwise read through to the prototype, and assigning
694
+ * "__proto__" would hit the setter instead of creating a key. */
695
+ function node(obj, key, make) {
696
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
697
+ if (key === "__proto__") Object.defineProperty(obj, key, {
698
+ value: make(),
699
+ writable: true,
700
+ enumerable: true,
701
+ configurable: true
702
+ });
703
+ else obj[key] = make();
704
+ }
705
+ return obj[key];
706
+ }
402
707
  function flattenError(error, mapper = (issue) => issue.message) {
403
708
  const fieldErrors = {};
404
709
  const formErrors = [];
405
- for (const sub of error.issues) if (sub.path.length > 0) {
406
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
407
- fieldErrors[sub.path[0]].push(mapper(sub));
408
- } else formErrors.push(mapper(sub));
710
+ for (const sub of error.issues) if (sub.path.length > 0) node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
711
+ else formErrors.push(mapper(sub));
409
712
  return {
410
713
  formErrors,
411
714
  fieldErrors
@@ -425,12 +728,21 @@ window.__ModuleLoader__.load({
425
728
  let i = 0;
426
729
  while (i < fullpath.length) {
427
730
  const el = fullpath[i];
428
- if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
429
- else {
430
- curr[el] = curr[el] || { _errors: [] };
431
- curr[el]._errors.push(mapper(issue));
731
+ const terminal = i === fullpath.length - 1;
732
+ if (el === "_errors") {
733
+ if (terminal) curr._errors.push(mapper(issue));
734
+ i++;
735
+ continue;
432
736
  }
433
- curr = curr[el];
737
+ if (!Object.prototype.hasOwnProperty.call(curr, el)) Object.defineProperty(curr, el, {
738
+ value: { _errors: [] },
739
+ enumerable: true,
740
+ writable: true,
741
+ configurable: true
742
+ });
743
+ const node = curr[el];
744
+ if (terminal) node._errors.push(mapper(issue));
745
+ curr = node;
434
746
  i++;
435
747
  }
436
748
  }
@@ -440,40 +752,52 @@ window.__ModuleLoader__.load({
440
752
  return fieldErrors;
441
753
  }
442
754
  //#endregion
443
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
444
- const _parse = (_Err) => (schema, value, _ctx, _params) => {
445
- const ctx = _ctx ? {
446
- ..._ctx,
447
- async: false
448
- } : { async: false };
449
- const result = schema._zod.run({
450
- value,
451
- issues: []
452
- }, ctx);
453
- if (result instanceof Promise) throw new $ZodAsyncError();
454
- if (result.issues.length) {
455
- const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
456
- captureStackTrace(e, _params?.callee);
457
- throw e;
458
- }
459
- return result.value;
755
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
756
+ function finalizeParams(callee, params) {
757
+ return {
758
+ callee: params?.callee ?? callee,
759
+ Err: params?.Err
760
+ };
761
+ }
762
+ const _parse = (_Err) => {
763
+ const fn = (schema, value, _ctx, _params) => {
764
+ const ctx = _ctx ? {
765
+ ..._ctx,
766
+ async: false
767
+ } : { async: false };
768
+ const result = schema._zod.run({
769
+ value,
770
+ issues: []
771
+ }, ctx);
772
+ if (result instanceof Promise) throw new $ZodAsyncError();
773
+ if (result.issues.length) {
774
+ const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
775
+ captureStackTrace(e, _params?.callee ?? fn);
776
+ throw e;
777
+ }
778
+ return result.value;
779
+ };
780
+ return fn;
460
781
  };
461
- const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
462
- const ctx = _ctx ? {
463
- ..._ctx,
464
- async: true
465
- } : { async: true };
466
- let result = schema._zod.run({
467
- value,
468
- issues: []
469
- }, ctx);
470
- if (result instanceof Promise) result = await result;
471
- if (result.issues.length) {
472
- const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
473
- captureStackTrace(e, params?.callee);
474
- throw e;
475
- }
476
- return result.value;
782
+ const _parseAsync = (_Err) => {
783
+ const fn = async (schema, value, _ctx, params) => {
784
+ const ctx = _ctx ? {
785
+ ..._ctx,
786
+ async: true
787
+ } : { async: true };
788
+ let result = schema._zod.run({
789
+ value,
790
+ issues: []
791
+ }, ctx);
792
+ if (result instanceof Promise) result = await result;
793
+ if (result.issues.length) {
794
+ const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
795
+ captureStackTrace(e, params?.callee ?? fn);
796
+ throw e;
797
+ }
798
+ return result.value;
799
+ };
800
+ return fn;
477
801
  };
478
802
  const _safeParse = (_Err) => (schema, value, _ctx) => {
479
803
  const ctx = _ctx ? {
@@ -485,15 +809,30 @@ window.__ModuleLoader__.load({
485
809
  issues: []
486
810
  }, ctx);
487
811
  if (result instanceof Promise) throw new $ZodAsyncError();
488
- return result.issues.length ? {
489
- success: false,
490
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
491
- } : {
812
+ return result.issues.length ? failure(_Err, result.issues, ctx) : {
492
813
  success: true,
493
814
  data: result.value
494
815
  };
495
816
  };
496
- const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
817
+ function failure(Err, issues, ctx) {
818
+ let error;
819
+ return {
820
+ success: false,
821
+ get error() {
822
+ if (!error) {
823
+ error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
824
+ issues = void 0;
825
+ ctx = void 0;
826
+ }
827
+ return error;
828
+ },
829
+ set error(e) {
830
+ error = e;
831
+ issues = void 0;
832
+ ctx = void 0;
833
+ }
834
+ };
835
+ }
497
836
  const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
498
837
  const ctx = _ctx ? {
499
838
  ..._ctx,
@@ -504,34 +843,96 @@ window.__ModuleLoader__.load({
504
843
  issues: []
505
844
  }, ctx);
506
845
  if (result instanceof Promise) result = await result;
507
- return result.issues.length ? {
508
- success: false,
509
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
510
- } : {
846
+ return result.issues.length ? failure(_Err, result.issues, ctx) : {
511
847
  success: true,
512
848
  data: result.value
513
849
  };
514
850
  };
515
- const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
516
- const _encode = (_Err) => (schema, value, _ctx) => {
851
+ const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
852
+ const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
853
+ const validate = ((schema, value, _ctx) => {
854
+ const validator = schema._zod.bag.validator;
855
+ if (validator !== void 0) {
856
+ if (validator(value) !== COMPILE_INVALID) return true;
857
+ if (validator.definite === true && _ctx === void 0) return false;
858
+ }
859
+ return validateFallback(schema, value, _ctx);
860
+ });
861
+ function validateFallback(schema, value, _ctx) {
517
862
  const ctx = _ctx ? {
518
863
  ..._ctx,
519
- direction: "backward"
520
- } : { direction: "backward" };
521
- return _parse(_Err)(schema, value, ctx);
522
- };
523
- const _decode = (_Err) => (schema, value, _ctx) => {
524
- return _parse(_Err)(schema, value, _ctx);
525
- };
526
- const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
864
+ async: false,
865
+ abortEarly: true
866
+ } : {
867
+ async: false,
868
+ abortEarly: true
869
+ };
870
+ const fallbackRun = schema._zod.bag.fallbackRun;
871
+ let result;
872
+ if (fallbackRun) {
873
+ ctx[COMPILE_FALLBACK] = true;
874
+ result = fallbackRun({
875
+ value,
876
+ issues: []
877
+ }, ctx);
878
+ } else result = schema._zod.run({
879
+ value,
880
+ issues: []
881
+ }, ctx);
882
+ if (result instanceof Promise) throw new $ZodAsyncError();
883
+ return result.issues.length === 0;
884
+ }
885
+ const validateAsync$1 = async (schema, value, _ctx) => {
527
886
  const ctx = _ctx ? {
528
887
  ..._ctx,
529
- direction: "backward"
530
- } : { direction: "backward" };
531
- return _parseAsync(_Err)(schema, value, ctx);
888
+ async: true,
889
+ abortEarly: true
890
+ } : {
891
+ async: true,
892
+ abortEarly: true
893
+ };
894
+ let result = schema._zod.run({
895
+ value,
896
+ issues: []
897
+ }, ctx);
898
+ if (result instanceof Promise) result = await result;
899
+ return result.issues.length === 0;
900
+ };
901
+ const _encode = (_Err) => {
902
+ const parse = _parse(_Err);
903
+ const fn = (schema, value, _ctx, _params) => {
904
+ const ctx = _ctx ? {
905
+ ..._ctx,
906
+ direction: "backward"
907
+ } : { direction: "backward" };
908
+ return parse(schema, value, ctx, finalizeParams(fn, _params));
909
+ };
910
+ return fn;
911
+ };
912
+ const _decode = (_Err) => {
913
+ const parse = _parse(_Err);
914
+ const fn = (schema, value, _ctx, _params) => {
915
+ return parse(schema, value, _ctx, finalizeParams(fn, _params));
916
+ };
917
+ return fn;
918
+ };
919
+ const _encodeAsync = (_Err) => {
920
+ const parseAsync = _parseAsync(_Err);
921
+ const fn = async (schema, value, _ctx, _params) => {
922
+ const ctx = _ctx ? {
923
+ ..._ctx,
924
+ direction: "backward"
925
+ } : { direction: "backward" };
926
+ return await parseAsync(schema, value, ctx, finalizeParams(fn, _params));
927
+ };
928
+ return fn;
532
929
  };
533
- const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
534
- return _parseAsync(_Err)(schema, value, _ctx);
930
+ const _decodeAsync = (_Err) => {
931
+ const parseAsync = _parseAsync(_Err);
932
+ const fn = async (schema, value, _ctx, _params) => {
933
+ return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));
934
+ };
935
+ return fn;
535
936
  };
536
937
  const _safeEncode = (_Err) => (schema, value, _ctx) => {
537
938
  const ctx = _ctx ? {
@@ -554,7 +955,7 @@ window.__ModuleLoader__.load({
554
955
  return _safeParseAsync(_Err)(schema, value, _ctx);
555
956
  };
556
957
  //#endregion
557
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
958
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
558
959
  /**
559
960
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
560
961
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -562,12 +963,15 @@ window.__ModuleLoader__.load({
562
963
  */
563
964
  const cuid = /^[cC][0-9a-z]{6,}$/;
564
965
  const cuid2 = /^[0-9a-z]+$/;
565
- const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
966
+ const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
566
967
  const xid = /^[0-9a-vA-V]{20}$/;
567
968
  const ksuid = /^[A-Za-z0-9]{27}$/;
568
969
  const nanoid = /^[a-zA-Z0-9_-]{21}$/;
970
+ function nanoidOfLength(length) {
971
+ return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);
972
+ }
569
973
  /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
570
- const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
974
+ const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
571
975
  /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
572
976
  const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
573
977
  /** Returns a regex for validating an RFC 9562/4122 UUID.
@@ -578,53 +982,62 @@ window.__ModuleLoader__.load({
578
982
  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})$`);
579
983
  };
580
984
  /** Practical email validation */
581
- const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
582
- const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
985
+ 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,}$/;
986
+ const _emoji$1 = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
583
987
  function emoji() {
584
988
  return new RegExp(_emoji$1, "u");
585
989
  }
586
990
  const ipv4 = /^(?:(?: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])$/;
587
991
  const ipv6 = /^(([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}|:))$/;
588
992
  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])$/;
589
- const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
993
+ 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])$/;
590
994
  const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
591
- const base64url = /^[A-Za-z0-9_-]*$/;
995
+ const base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
592
996
  const httpProtocol = /^https?$/;
593
997
  const e164 = /^\+[1-9]\d{6,14}$/;
594
998
  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])))`;
595
- const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
999
+ /** Anchors a pattern source. The interpolation lives here rather than at the call site because
1000
+ * esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it
1001
+ * will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */
1002
+ function anchor(source) {
1003
+ return new RegExp(`^${source}$`);
1004
+ }
1005
+ const date = /*@__PURE__*/ anchor(dateSource);
596
1006
  function timeSource(args) {
597
1007
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
598
- return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
1008
+ return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
599
1009
  }
600
- function time$1(args) {
1010
+ function time(args) {
601
1011
  return new RegExp(`^${timeSource(args)}$`);
602
1012
  }
603
- function datetime$1(args) {
604
- const time = timeSource({ precision: args.precision });
1013
+ function datetime(args) {
605
1014
  const opts = ["Z"];
606
- if (args.local) opts.push("");
607
1015
  if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
608
- const timeRegex = `${time}(?:${opts.join("|")})`;
1016
+ const qualified = `${timeSource({
1017
+ precision: args.precision,
1018
+ seconds: true
1019
+ })}(?:${opts.join("|")})`;
1020
+ const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
609
1021
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
610
1022
  }
611
- const string$1 = (params) => {
612
- const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
613
- return new RegExp(`^${regex}$`);
614
- };
615
- const integer = /^-?\d+$/;
1023
+ const anyString = /^[\s\S]{0,}$/;
616
1024
  const number$1 = /^-?\d+(?:\.\d+)?$/;
617
1025
  const boolean$1 = /^(?:true|false)$/i;
618
1026
  const lowercase = /^[^A-Z]*$/;
619
1027
  const uppercase = /^[^a-z]*$/;
620
1028
  //#endregion
621
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
1029
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
622
1030
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
623
1031
  var _a;
624
1032
  inst._zod ?? (inst._zod = {});
625
1033
  inst._zod.def = def;
626
1034
  (_a = inst._zod).onattach ?? (_a.onattach = []);
627
1035
  });
1036
+ /** Default `when` for length-based checks: run only on non-nullish values with a `length`. */
1037
+ const _whenHasLength = (payload) => {
1038
+ const val = payload.value;
1039
+ return !nullish(val) && val.length !== void 0;
1040
+ };
628
1041
  const numericOriginMap = {
629
1042
  number: "number",
630
1043
  bigint: "bigint",
@@ -633,18 +1046,10 @@ window.__ModuleLoader__.load({
633
1046
  const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
634
1047
  $ZodCheck.init(inst, def);
635
1048
  const origin = numericOriginMap[typeof def.value];
636
- inst._zod.onattach.push((inst) => {
637
- const bag = inst._zod.bag;
638
- const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
639
- if (def.value < curr) {
640
- if (def.inclusive) bag.maximum = def.value;
641
- else bag.exclusiveMaximum = def.value;
642
- }
643
- });
644
1049
  inst._zod.check = (payload) => {
645
1050
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
646
1051
  payload.issues.push({
647
- origin,
1052
+ origin: numericOriginMap[typeof payload.value] ?? origin,
648
1053
  code: "too_big",
649
1054
  maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
650
1055
  input: payload.value,
@@ -657,18 +1062,10 @@ window.__ModuleLoader__.load({
657
1062
  const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
658
1063
  $ZodCheck.init(inst, def);
659
1064
  const origin = numericOriginMap[typeof def.value];
660
- inst._zod.onattach.push((inst) => {
661
- const bag = inst._zod.bag;
662
- const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
663
- if (def.value > curr) {
664
- if (def.inclusive) bag.minimum = def.value;
665
- else bag.exclusiveMinimum = def.value;
666
- }
667
- });
668
1065
  inst._zod.check = (payload) => {
669
1066
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
670
1067
  payload.issues.push({
671
- origin,
1068
+ origin: numericOriginMap[typeof payload.value] ?? origin,
672
1069
  code: "too_small",
673
1070
  minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
674
1071
  input: payload.value,
@@ -680,13 +1077,9 @@ window.__ModuleLoader__.load({
680
1077
  });
681
1078
  const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
682
1079
  $ZodCheck.init(inst, def);
683
- inst._zod.onattach.push((inst) => {
684
- var _a;
685
- (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
686
- });
687
1080
  inst._zod.check = (payload) => {
688
1081
  if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
689
- if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
1082
+ if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
690
1083
  payload.issues.push({
691
1084
  origin: typeof payload.value,
692
1085
  code: "not_multiple_of",
@@ -703,13 +1096,6 @@ window.__ModuleLoader__.load({
703
1096
  const isInt = def.format?.includes("int");
704
1097
  const origin = isInt ? "int" : "number";
705
1098
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
706
- inst._zod.onattach.push((inst) => {
707
- const bag = inst._zod.bag;
708
- bag.format = def.format;
709
- bag.minimum = minimum;
710
- bag.maximum = maximum;
711
- if (isInt) bag.pattern = integer;
712
- });
713
1099
  inst._zod.check = (payload) => {
714
1100
  const input = payload.value;
715
1101
  if (isInt) {
@@ -771,17 +1157,11 @@ window.__ModuleLoader__.load({
771
1157
  const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
772
1158
  var _a;
773
1159
  $ZodCheck.init(inst, def);
774
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
775
- const val = payload.value;
776
- return !nullish(val) && val.length !== void 0;
777
- });
778
- inst._zod.onattach.push((inst) => {
779
- const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
780
- if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
781
- });
1160
+ (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
782
1161
  inst._zod.check = (payload) => {
783
1162
  const input = payload.value;
784
- if (input.length <= def.maximum) return;
1163
+ const units = input.length;
1164
+ if ((typeof input === "string" && units > def.maximum ? codePointLength(input) : units) <= def.maximum) return;
785
1165
  const origin = getLengthableOrigin(input);
786
1166
  payload.issues.push({
787
1167
  origin,
@@ -797,17 +1177,11 @@ window.__ModuleLoader__.load({
797
1177
  const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
798
1178
  var _a;
799
1179
  $ZodCheck.init(inst, def);
800
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
801
- const val = payload.value;
802
- return !nullish(val) && val.length !== void 0;
803
- });
804
- inst._zod.onattach.push((inst) => {
805
- const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
806
- if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
807
- });
1180
+ (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
808
1181
  inst._zod.check = (payload) => {
809
1182
  const input = payload.value;
810
- if (input.length >= def.minimum) return;
1183
+ const units = input.length;
1184
+ if ((typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units) >= def.minimum) return;
811
1185
  const origin = getLengthableOrigin(input);
812
1186
  payload.issues.push({
813
1187
  origin,
@@ -823,19 +1197,11 @@ window.__ModuleLoader__.load({
823
1197
  const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
824
1198
  var _a;
825
1199
  $ZodCheck.init(inst, def);
826
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
827
- const val = payload.value;
828
- return !nullish(val) && val.length !== void 0;
829
- });
830
- inst._zod.onattach.push((inst) => {
831
- const bag = inst._zod.bag;
832
- bag.minimum = def.length;
833
- bag.maximum = def.length;
834
- bag.length = def.length;
835
- });
1200
+ (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
836
1201
  inst._zod.check = (payload) => {
837
1202
  const input = payload.value;
838
- const length = input.length;
1203
+ const units = input.length;
1204
+ const length = typeof input === "string" && units >= def.length && units <= def.length * 2 ? codePointLength(input) : units;
839
1205
  if (length === def.length) return;
840
1206
  const origin = getLengthableOrigin(input);
841
1207
  const tooBig = length > def.length;
@@ -859,14 +1225,6 @@ window.__ModuleLoader__.load({
859
1225
  const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
860
1226
  var _a, _b;
861
1227
  $ZodCheck.init(inst, def);
862
- inst._zod.onattach.push((inst) => {
863
- const bag = inst._zod.bag;
864
- bag.format = def.format;
865
- if (def.pattern) {
866
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
867
- bag.patterns.add(def.pattern);
868
- }
869
- });
870
1228
  if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
871
1229
  def.pattern.lastIndex = 0;
872
1230
  if (def.pattern.test(payload.value)) return;
@@ -909,13 +1267,7 @@ window.__ModuleLoader__.load({
909
1267
  const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
910
1268
  $ZodCheck.init(inst, def);
911
1269
  const escapedRegex = escapeRegex(def.includes);
912
- const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
913
- def.pattern = pattern;
914
- inst._zod.onattach.push((inst) => {
915
- const bag = inst._zod.bag;
916
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
917
- bag.patterns.add(pattern);
918
- });
1270
+ def.pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
919
1271
  inst._zod.check = (payload) => {
920
1272
  if (payload.value.includes(def.includes, def.position)) return;
921
1273
  payload.issues.push({
@@ -933,11 +1285,6 @@ window.__ModuleLoader__.load({
933
1285
  $ZodCheck.init(inst, def);
934
1286
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
935
1287
  def.pattern ?? (def.pattern = pattern);
936
- inst._zod.onattach.push((inst) => {
937
- const bag = inst._zod.bag;
938
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
939
- bag.patterns.add(pattern);
940
- });
941
1288
  inst._zod.check = (payload) => {
942
1289
  if (payload.value.startsWith(def.prefix)) return;
943
1290
  payload.issues.push({
@@ -955,11 +1302,6 @@ window.__ModuleLoader__.load({
955
1302
  $ZodCheck.init(inst, def);
956
1303
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
957
1304
  def.pattern ?? (def.pattern = pattern);
958
- inst._zod.onattach.push((inst) => {
959
- const bag = inst._zod.bag;
960
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
961
- bag.patterns.add(pattern);
962
- });
963
1305
  inst._zod.check = (payload) => {
964
1306
  if (payload.value.endsWith(def.suffix)) return;
965
1307
  payload.issues.push({
@@ -980,17 +1322,21 @@ window.__ModuleLoader__.load({
980
1322
  };
981
1323
  });
982
1324
  //#endregion
983
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
1325
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
984
1326
  var Doc = class {
985
- constructor(args = []) {
1327
+ constructor(args = [], closed = {}) {
986
1328
  this.content = [];
987
1329
  this.indent = 0;
988
- if (this) this.args = args;
1330
+ this.args = args;
1331
+ this.closed = closed;
989
1332
  }
990
1333
  indented(fn) {
991
1334
  this.indent += 1;
992
- fn(this);
993
- this.indent -= 1;
1335
+ try {
1336
+ fn(this);
1337
+ } finally {
1338
+ this.indent -= 1;
1339
+ }
994
1340
  }
995
1341
  write(arg) {
996
1342
  if (typeof arg === "function") {
@@ -1005,28 +1351,27 @@ window.__ModuleLoader__.load({
1005
1351
  }
1006
1352
  compile() {
1007
1353
  const F = Function;
1008
- const args = this?.args;
1009
- const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)];
1010
- return new F(...args, lines.join("\n"));
1354
+ const content = this?.content ?? [``];
1355
+ return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
1011
1356
  }
1012
1357
  };
1013
1358
  //#endregion
1014
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
1359
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
1015
1360
  const version = {
1016
1361
  major: 4,
1017
- minor: 4,
1018
- patch: 3
1362
+ minor: 6,
1363
+ patch: 5
1019
1364
  };
1020
1365
  //#endregion
1021
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
1366
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
1022
1367
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1023
1368
  var _a;
1024
1369
  inst ?? (inst = {});
1025
1370
  inst._zod.def = def;
1026
1371
  inst._zod.bag = inst._zod.bag || {};
1027
1372
  inst._zod.version = version;
1028
- const checks = [...inst._zod.def.checks ?? []];
1029
- if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1373
+ const defChecks = inst._zod.def.checks;
1374
+ const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
1030
1375
  for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
1031
1376
  if (checks.length === 0) {
1032
1377
  (_a = inst._zod).deferred ?? (_a.deferred = []);
@@ -1035,6 +1380,7 @@ window.__ModuleLoader__.load({
1035
1380
  });
1036
1381
  } else {
1037
1382
  const runChecks = (payload, checks, ctx) => {
1383
+ if (payload.memo) return payload;
1038
1384
  let isAborted = aborted(payload);
1039
1385
  let asyncResult;
1040
1386
  for (const ch of checks) {
@@ -1048,10 +1394,12 @@ window.__ModuleLoader__.load({
1048
1394
  if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
1049
1395
  await _;
1050
1396
  if (payload.issues.length === currLen) return;
1397
+ attachSchema(payload.issues, currLen, inst);
1051
1398
  if (!isAborted) isAborted = aborted(payload, currLen);
1052
1399
  });
1053
1400
  else {
1054
1401
  if (payload.issues.length === currLen) continue;
1402
+ attachSchema(payload.issues, currLen, inst);
1055
1403
  if (!isAborted) isAborted = aborted(payload, currLen);
1056
1404
  }
1057
1405
  }
@@ -1095,22 +1443,43 @@ window.__ModuleLoader__.load({
1095
1443
  return runChecks(result, checks, ctx);
1096
1444
  };
1097
1445
  }
1098
- defineLazy(inst, "~standard", () => ({
1446
+ }, {
1447
+ get "~standard"() {
1448
+ return hide(this, "~standard", standardProps(this));
1449
+ },
1450
+ set "~standard"(value) {
1451
+ own(this, "~standard", value);
1452
+ }
1453
+ });
1454
+ /** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
1455
+ const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
1456
+ async function validateAsync(inst, value) {
1457
+ const ctx = { async: true };
1458
+ return toStandardResult(await inst._zod.run({
1459
+ value,
1460
+ issues: []
1461
+ }, ctx), ctx);
1462
+ }
1463
+ function standardProps(inst) {
1464
+ return {
1099
1465
  validate: (value) => {
1466
+ const ctx = { async: false };
1100
1467
  try {
1101
- const r = safeParse$1(inst, value);
1102
- return r.success ? { value: r.data } : { issues: r.error?.issues };
1103
- } catch (_) {
1104
- return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1105
- }
1468
+ const r = inst._zod.run({
1469
+ value,
1470
+ issues: []
1471
+ }, ctx);
1472
+ if (!(r instanceof Promise)) return toStandardResult(r, ctx);
1473
+ } catch (_) {}
1474
+ return validateAsync(inst, value);
1106
1475
  },
1107
1476
  vendor: "zod",
1108
1477
  version: 1
1109
- }));
1110
- });
1478
+ };
1479
+ }
1111
1480
  const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
1112
1481
  $ZodType.init(inst, def);
1113
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
1482
+ inst._zod.pattern = def.pattern ?? anyString;
1114
1483
  inst._zod.parse = (payload, _) => {
1115
1484
  if (def.coerce) try {
1116
1485
  payload.value = String(payload.value);
@@ -1154,51 +1523,95 @@ window.__ModuleLoader__.load({
1154
1523
  def.pattern ?? (def.pattern = email);
1155
1524
  $ZodStringFormat.init(inst, def);
1156
1525
  });
1526
+ function canParseURL(input) {
1527
+ try {
1528
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
1529
+ new URL(input);
1530
+ return true;
1531
+ } catch {
1532
+ return false;
1533
+ }
1534
+ }
1535
+ function validateURL(trimmed, def) {
1536
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
1537
+ return parseURLObject(trimmed, def);
1538
+ }
1539
+ /** Parses a URL while preserving the non-normalizing HTTP guard. */
1540
+ function parseURLObject(trimmed, def) {
1541
+ if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
1542
+ try {
1543
+ if (typeof URL !== "undefined") {
1544
+ const URLStatic = URL;
1545
+ if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
1546
+ }
1547
+ return new URL(trimmed);
1548
+ } catch {
1549
+ return 2;
1550
+ }
1551
+ }
1552
+ const asciiTabOrNewline = /[\t\n\r]/g;
1553
+ /** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
1554
+ function stripTabAndNewline(value) {
1555
+ return value.replace(asciiTabOrNewline, "");
1556
+ }
1557
+ function urlHostnameOk(url, hostname) {
1558
+ hostname.lastIndex = 0;
1559
+ return hostname.test(url.hostname);
1560
+ }
1561
+ function urlProtocolOk(url, protocol) {
1562
+ protocol.lastIndex = 0;
1563
+ return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
1564
+ }
1157
1565
  const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1158
1566
  $ZodStringFormat.init(inst, def);
1159
1567
  inst._zod.check = (payload) => {
1160
1568
  try {
1161
1569
  const trimmed = payload.value.trim();
1162
- if (!def.normalize && def.protocol?.source === httpProtocol.source) {
1163
- if (!/^https?:\/\//i.test(trimmed)) {
1164
- payload.issues.push({
1165
- code: "invalid_format",
1166
- format: "url",
1167
- note: "Invalid URL format",
1168
- input: payload.value,
1169
- inst,
1170
- continue: !def.abort
1171
- });
1172
- return;
1173
- }
1174
- }
1175
- const url = new URL(trimmed);
1176
- if (def.hostname) {
1177
- def.hostname.lastIndex = 0;
1178
- if (!def.hostname.test(url.hostname)) payload.issues.push({
1570
+ const url = validateURL(trimmed, def);
1571
+ if (url === 1) {
1572
+ payload.issues.push({
1179
1573
  code: "invalid_format",
1180
1574
  format: "url",
1181
- note: "Invalid hostname",
1182
- pattern: def.hostname.source,
1575
+ note: "Invalid URL format",
1183
1576
  input: payload.value,
1184
1577
  inst,
1185
1578
  continue: !def.abort
1186
1579
  });
1580
+ return;
1187
1581
  }
1188
- if (def.protocol) {
1189
- def.protocol.lastIndex = 0;
1190
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
1582
+ if (url === 2) {
1583
+ payload.issues.push({
1191
1584
  code: "invalid_format",
1192
1585
  format: "url",
1193
- note: "Invalid protocol",
1194
- pattern: def.protocol.source,
1195
1586
  input: payload.value,
1196
1587
  inst,
1197
1588
  continue: !def.abort
1198
1589
  });
1590
+ return;
1591
+ }
1592
+ if (url === true) {
1593
+ payload.value = stripTabAndNewline(trimmed);
1594
+ return;
1199
1595
  }
1200
- if (def.normalize) payload.value = url.href;
1201
- else payload.value = trimmed;
1596
+ if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
1597
+ code: "invalid_format",
1598
+ format: "url",
1599
+ note: "Invalid hostname",
1600
+ pattern: def.hostname.source,
1601
+ input: payload.value,
1602
+ inst,
1603
+ continue: !def.abort
1604
+ });
1605
+ if (def.protocol && !urlProtocolOk(url, def.protocol)) payload.issues.push({
1606
+ code: "invalid_format",
1607
+ format: "url",
1608
+ note: "Invalid protocol",
1609
+ pattern: def.protocol.source,
1610
+ input: payload.value,
1611
+ inst,
1612
+ continue: !def.abort
1613
+ });
1614
+ payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
1202
1615
  return;
1203
1616
  } catch (_) {
1204
1617
  payload.issues.push({
@@ -1216,7 +1629,8 @@ window.__ModuleLoader__.load({
1216
1629
  $ZodStringFormat.init(inst, def);
1217
1630
  });
1218
1631
  const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
1219
- def.pattern ?? (def.pattern = nanoid);
1632
+ if (def.length !== void 0 && (!Number.isInteger(def.length) || def.length < 1)) throw new Error(`Invalid nanoid length: ${def.length}`);
1633
+ def.pattern ?? (def.pattern = def.length === void 0 ? nanoid : nanoidOfLength(def.length));
1220
1634
  $ZodStringFormat.init(inst, def);
1221
1635
  });
1222
1636
  /**
@@ -1245,70 +1659,69 @@ window.__ModuleLoader__.load({
1245
1659
  $ZodStringFormat.init(inst, def);
1246
1660
  });
1247
1661
  const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
1248
- def.pattern ?? (def.pattern = datetime$1(def));
1662
+ def.pattern ?? (def.pattern = datetime(def));
1249
1663
  $ZodStringFormat.init(inst, def);
1250
1664
  });
1251
1665
  const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
1252
- def.pattern ?? (def.pattern = date$1);
1666
+ def.pattern ?? (def.pattern = date);
1253
1667
  $ZodStringFormat.init(inst, def);
1254
1668
  });
1255
1669
  const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
1256
- def.pattern ?? (def.pattern = time$1(def));
1670
+ def.pattern ?? (def.pattern = time(def));
1257
1671
  $ZodStringFormat.init(inst, def);
1258
1672
  });
1259
1673
  const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
1260
- def.pattern ?? (def.pattern = duration$1);
1674
+ def.pattern ?? (def.pattern = duration);
1261
1675
  $ZodStringFormat.init(inst, def);
1262
1676
  });
1263
1677
  const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
1264
1678
  def.pattern ?? (def.pattern = ipv4);
1265
1679
  $ZodStringFormat.init(inst, def);
1266
- inst._zod.bag.format = `ipv4`;
1267
1680
  });
1681
+ /** 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`. */
1682
+ const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
1683
+ function isValidIPv6(value) {
1684
+ if (!ipv6Alphabet.test(value)) return false;
1685
+ return canParseURL(`http://[${value}]`);
1686
+ }
1268
1687
  const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
1269
1688
  def.pattern ?? (def.pattern = ipv6);
1270
1689
  $ZodStringFormat.init(inst, def);
1271
- inst._zod.bag.format = `ipv6`;
1272
1690
  inst._zod.check = (payload) => {
1273
- try {
1274
- new URL(`http://[${payload.value}]`);
1275
- } catch {
1276
- payload.issues.push({
1277
- code: "invalid_format",
1278
- format: "ipv6",
1279
- input: payload.value,
1280
- inst,
1281
- continue: !def.abort
1282
- });
1283
- }
1691
+ if (!isValidIPv6(payload.value)) payload.issues.push({
1692
+ code: "invalid_format",
1693
+ format: "ipv6",
1694
+ input: payload.value,
1695
+ inst,
1696
+ continue: !def.abort
1697
+ });
1284
1698
  };
1285
1699
  });
1286
1700
  const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
1287
1701
  def.pattern ?? (def.pattern = cidrv4);
1288
1702
  $ZodStringFormat.init(inst, def);
1289
1703
  });
1704
+ function isValidCIDRv6(value) {
1705
+ const parts = value.split("/");
1706
+ if (parts.length !== 2) return false;
1707
+ const [address, prefix] = parts;
1708
+ if (!prefix) return false;
1709
+ const prefixNum = Number(prefix);
1710
+ if (`${prefixNum}` !== prefix) return false;
1711
+ if (prefixNum < 0 || prefixNum > 128) return false;
1712
+ return isValidIPv6(address);
1713
+ }
1290
1714
  const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
1291
1715
  def.pattern ?? (def.pattern = cidrv6);
1292
1716
  $ZodStringFormat.init(inst, def);
1293
1717
  inst._zod.check = (payload) => {
1294
- const parts = payload.value.split("/");
1295
- try {
1296
- if (parts.length !== 2) throw new Error();
1297
- const [address, prefix] = parts;
1298
- if (!prefix) throw new Error();
1299
- const prefixNum = Number(prefix);
1300
- if (`${prefixNum}` !== prefix) throw new Error();
1301
- if (prefixNum < 0 || prefixNum > 128) throw new Error();
1302
- new URL(`http://[${address}]`);
1303
- } catch {
1304
- payload.issues.push({
1305
- code: "invalid_format",
1306
- format: "cidrv6",
1307
- input: payload.value,
1308
- inst,
1309
- continue: !def.abort
1310
- });
1311
- }
1718
+ if (!isValidCIDRv6(payload.value)) payload.issues.push({
1719
+ code: "invalid_format",
1720
+ format: "cidrv6",
1721
+ input: payload.value,
1722
+ inst,
1723
+ continue: !def.abort
1724
+ });
1312
1725
  };
1313
1726
  });
1314
1727
  function isValidBase64(data) {
@@ -1322,10 +1735,10 @@ window.__ModuleLoader__.load({
1322
1735
  return false;
1323
1736
  }
1324
1737
  }
1738
+ const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
1325
1739
  const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
1326
- def.pattern ?? (def.pattern = base64);
1740
+ def.pattern ?? (def.pattern = base64Charset);
1327
1741
  $ZodStringFormat.init(inst, def);
1328
- inst._zod.bag.contentEncoding = "base64";
1329
1742
  inst._zod.check = (payload) => {
1330
1743
  if (isValidBase64(payload.value)) return;
1331
1744
  payload.issues.push({
@@ -1337,15 +1750,15 @@ window.__ModuleLoader__.load({
1337
1750
  });
1338
1751
  };
1339
1752
  });
1753
+ const base64urlCharset = /^[A-Za-z0-9_-]*$/;
1340
1754
  function isValidBase64URL(data) {
1341
- if (!base64url.test(data)) return false;
1755
+ if (!base64urlCharset.test(data)) return false;
1342
1756
  const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1343
1757
  return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
1344
1758
  }
1345
1759
  const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
1346
- def.pattern ?? (def.pattern = base64url);
1760
+ def.pattern ?? (def.pattern = base64urlCharset);
1347
1761
  $ZodStringFormat.init(inst, def);
1348
- inst._zod.bag.contentEncoding = "base64url";
1349
1762
  inst._zod.check = (payload) => {
1350
1763
  if (isValidBase64URL(payload.value)) return;
1351
1764
  payload.issues.push({
@@ -1391,14 +1804,14 @@ window.__ModuleLoader__.load({
1391
1804
  });
1392
1805
  const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
1393
1806
  $ZodType.init(inst, def);
1394
- inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
1807
+ inst._zod.pattern = number$1;
1395
1808
  inst._zod.parse = (payload, _ctx) => {
1396
1809
  if (def.coerce) try {
1397
1810
  payload.value = Number(payload.value);
1398
1811
  } catch (_) {}
1399
1812
  const input = payload.value;
1400
1813
  if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
1401
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
1814
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? String(input) : void 0 : void 0;
1402
1815
  payload.issues.push({
1403
1816
  expected: "number",
1404
1817
  code: "invalid_type",
@@ -1453,6 +1866,8 @@ window.__ModuleLoader__.load({
1453
1866
  }
1454
1867
  const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1455
1868
  $ZodType.init(inst, def);
1869
+ const memo = globalConfig.memoizer;
1870
+ memo?.attach(inst);
1456
1871
  inst._zod.parse = (payload, ctx) => {
1457
1872
  const input = payload.value;
1458
1873
  if (!Array.isArray(input)) {
@@ -1464,8 +1879,9 @@ window.__ModuleLoader__.load({
1464
1879
  });
1465
1880
  return payload;
1466
1881
  }
1467
- payload.value = Array(input.length);
1882
+ payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
1468
1883
  const proms = [];
1884
+ const abortEarly = ctx?.abortEarly;
1469
1885
  for (let i = 0; i < input.length; i++) {
1470
1886
  const item = input[i];
1471
1887
  const result = def.element._zod.run({
@@ -1473,19 +1889,24 @@ window.__ModuleLoader__.load({
1473
1889
  issues: []
1474
1890
  }, ctx);
1475
1891
  if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
1476
- else handleArrayResult(result, payload, i);
1892
+ else {
1893
+ handleArrayResult(result, payload, i);
1894
+ if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
1895
+ }
1477
1896
  }
1478
1897
  if (proms.length) return Promise.all(proms).then(() => payload);
1479
1898
  return payload;
1480
1899
  };
1481
1900
  });
1482
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
1901
+ function handlePropertyResult(result, final, key, input, optin, optout) {
1483
1902
  const isPresent = key in input;
1903
+ const isOptionalOut = optout === "optional";
1904
+ if (!isPresent && isOptionalOut && optin === "optional") return;
1484
1905
  if (result.issues.length) {
1485
- if (isOptionalIn && isOptionalOut && !isPresent) return;
1906
+ if (optin !== void 0 && isOptionalOut && !isPresent) return;
1486
1907
  final.issues.push(...prefixIssues(key, result.issues));
1487
1908
  }
1488
- if (!isPresent && !isOptionalIn) {
1909
+ if (!isPresent && optin === void 0) {
1489
1910
  if (!result.issues.length) final.issues.push({
1490
1911
  code: "invalid_type",
1491
1912
  expected: "nonoptional",
@@ -1495,31 +1916,44 @@ window.__ModuleLoader__.load({
1495
1916
  return;
1496
1917
  }
1497
1918
  if (result.value === void 0) {
1498
- if (isPresent) final.value[key] = void 0;
1919
+ if (isPresent || optin === "defaulted" && !isOptionalOut) final.value[key] = void 0;
1499
1920
  } else final.value[key] = result.value;
1500
1921
  }
1922
+ const NO_SYMBOL_KEYS = [];
1501
1923
  function normalizeDef(def) {
1502
1924
  const keys = Object.keys(def.shape);
1503
- for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1925
+ const ownSymbols = Object.getOwnPropertySymbols(def.shape);
1926
+ const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
1927
+ const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
1928
+ for (const k of allKeys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
1504
1929
  const okeys = optionalKeys(def.shape);
1505
1930
  return {
1506
1931
  ...def,
1507
- keys,
1932
+ allKeys,
1933
+ symbolKeys,
1508
1934
  keySet: new Set(keys),
1509
1935
  numKeys: keys.length,
1510
1936
  optionalKeys: new Set(okeys)
1511
1937
  };
1512
1938
  }
1513
- function handleCatchall(proms, input, payload, ctx, def, inst) {
1939
+ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
1514
1940
  const unrecognized = [];
1515
1941
  const keySet = def.keySet;
1516
1942
  const _catchall = def.catchall._zod;
1517
1943
  const t = _catchall.def.type;
1518
- const isOptionalIn = _catchall.optin === "optional";
1519
- const isOptionalOut = _catchall.optout === "optional";
1944
+ const optin = _catchall.optin;
1945
+ const optout = _catchall.optout;
1946
+ let seen = 0;
1520
1947
  for (const key in input) {
1521
- if (key === "__proto__") continue;
1948
+ if (abortEarly && payload.issues.length !== seen) {
1949
+ if (aborted(payload, seen)) break;
1950
+ seen = payload.issues.length;
1951
+ }
1522
1952
  if (keySet.has(key)) continue;
1953
+ if (key === "__proto__") {
1954
+ if (t === "never") unrecognized.push(key);
1955
+ continue;
1956
+ }
1523
1957
  if (t === "never") {
1524
1958
  unrecognized.push(key);
1525
1959
  continue;
@@ -1528,14 +1962,15 @@ window.__ModuleLoader__.load({
1528
1962
  value: input[key],
1529
1963
  issues: []
1530
1964
  }, ctx);
1531
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1532
- else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1965
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
1966
+ else handlePropertyResult(r, payload, key, input, optin, optout);
1533
1967
  }
1534
1968
  if (unrecognized.length) payload.issues.push({
1535
1969
  code: "unrecognized_keys",
1536
1970
  keys: unrecognized,
1537
1971
  input,
1538
- inst
1972
+ inst,
1973
+ continue: true
1539
1974
  });
1540
1975
  if (!proms.length) return payload;
1541
1976
  return Promise.all(proms).then(() => {
@@ -1544,34 +1979,41 @@ window.__ModuleLoader__.load({
1544
1979
  }
1545
1980
  const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
1546
1981
  $ZodType.init(inst, def);
1547
- if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
1548
- const sh = def.shape;
1549
- Object.defineProperty(def, "shape", { get: () => {
1982
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
1983
+ const sh = desc?.get ? desc.get.raw : def.shape ?? {};
1984
+ if (sh) {
1985
+ const get = () => {
1550
1986
  const newSh = { ...sh };
1551
1987
  Object.defineProperty(def, "shape", { value: newSh });
1988
+ get.raw = newSh;
1552
1989
  return newSh;
1553
- } });
1990
+ };
1991
+ get.raw = sh;
1992
+ Object.defineProperty(def, "shape", { get });
1554
1993
  }
1555
1994
  const _normalized = cached(() => normalizeDef(def));
1556
- defineLazy(inst._zod, "propValues", () => {
1557
- const shape = def.shape;
1995
+ defineLazyInternal(inst, "propValues", (zod) => {
1996
+ const shape = zod.def.shape;
1558
1997
  const propValues = {};
1559
1998
  for (const key in shape) {
1560
1999
  const field = shape[key]._zod;
1561
2000
  if (field.values) {
1562
- propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
2001
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) assignProp(propValues, key, /* @__PURE__ */ new Set());
1563
2002
  for (const v of field.values) propValues[key].add(v);
2003
+ if (field.optin !== void 0) propValues[key].add(void 0);
1564
2004
  }
1565
2005
  }
1566
2006
  return propValues;
1567
2007
  });
1568
- const isObject$1 = isObject;
2008
+ const isObject$2 = isObject;
1569
2009
  const catchall = def.catchall;
1570
2010
  let value;
2011
+ const memo = globalConfig.memoizer;
2012
+ memo?.attach(inst);
1571
2013
  inst._zod.parse = (payload, ctx) => {
1572
2014
  value ?? (value = _normalized.value);
1573
2015
  const input = payload.value;
1574
- if (!isObject$1(input)) {
2016
+ if (!isObject$2(input)) {
1575
2017
  payload.issues.push({
1576
2018
  expected: "object",
1577
2019
  code: "invalid_type",
@@ -1580,77 +2022,90 @@ window.__ModuleLoader__.load({
1580
2022
  });
1581
2023
  return payload;
1582
2024
  }
1583
- payload.value = {};
2025
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1584
2026
  const proms = [];
1585
2027
  const shape = value.shape;
1586
- for (const key of value.keys) {
2028
+ const abortEarly = ctx?.abortEarly;
2029
+ let seen = payload.issues.length;
2030
+ for (const key of value.allKeys) {
2031
+ if (abortEarly && payload.issues.length !== seen) {
2032
+ if (aborted(payload, seen)) break;
2033
+ seen = payload.issues.length;
2034
+ }
2035
+ if (key === "__proto__") continue;
1587
2036
  const el = shape[key];
1588
- const isOptionalIn = el._zod.optin === "optional";
1589
- const isOptionalOut = el._zod.optout === "optional";
2037
+ const optin = el._zod.optin;
2038
+ const optout = el._zod.optout;
1590
2039
  const r = el._zod.run({
1591
2040
  value: input[key],
1592
2041
  issues: []
1593
2042
  }, ctx);
1594
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1595
- else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
2043
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
2044
+ else handlePropertyResult(r, payload, key, input, optin, optout);
1596
2045
  }
1597
2046
  if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1598
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
2047
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
1599
2048
  };
1600
2049
  });
1601
2050
  const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
1602
2051
  $ZodObject.init(inst, def);
1603
2052
  const superParse = inst._zod.parse;
1604
2053
  const _normalized = cached(() => normalizeDef(def));
2054
+ const memo = globalConfig.memoizer;
1605
2055
  const generateFastpass = (shape) => {
1606
- const doc = new Doc([
1607
- "shape",
1608
- "payload",
1609
- "ctx"
1610
- ]);
1611
2056
  const normalized = _normalized.value;
1612
- const parseStr = (key) => {
1613
- const k = esc(key);
1614
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1615
- };
2057
+ const syms = normalized.symbolKeys;
2058
+ const doc = new Doc(["payload", "ctx"], {
2059
+ shape,
2060
+ inst,
2061
+ memo,
2062
+ syms
2063
+ });
2064
+ const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
2065
+ const prefixStr = (id, k) => `
2066
+ let ${id}_ab = false;
2067
+ for (let i = 0; i < ${id}.issues.length; i++) {
2068
+ const iss = ${id}.issues[i];
2069
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
2070
+ payload.issues.push(iss);
2071
+ if (iss.continue !== true) ${id}_ab = true;
2072
+ }
2073
+ if (${id}_ab && ctx && ctx.abortEarly) {
2074
+ payload.value = newResult;
2075
+ return payload;
2076
+ }`;
1616
2077
  doc.write(`const input = payload.value;`);
1617
2078
  const ids = Object.create(null);
1618
2079
  let counter = 0;
1619
- for (const key of normalized.keys) ids[key] = `key_${counter++}`;
1620
- doc.write(`const newResult = {};`);
1621
- for (const key of normalized.keys) {
2080
+ for (const key of normalized.allKeys) ids[key] = `key_${counter++}`;
2081
+ doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
2082
+ for (const key of normalized.allKeys) {
2083
+ if (key === "__proto__") continue;
1622
2084
  const id = ids[key];
1623
- const k = esc(key);
2085
+ const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
2086
+ const isPresent = `${k} in input`;
1624
2087
  const schema = shape[key];
1625
- const isOptionalIn = schema?._zod?.optin === "optional";
2088
+ const optin = schema?._zod?.optin;
2089
+ const isOptionalIn = optin !== void 0;
1626
2090
  const isOptionalOut = schema?._zod?.optout === "optional";
1627
- doc.write(`const ${id} = ${parseStr(key)};`);
1628
- if (isOptionalIn && isOptionalOut) doc.write(`
1629
- if (${id}.issues.length) {
1630
- if (${k} in input) {
1631
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1632
- ...iss,
1633
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1634
- })));
2091
+ doc.write(`const ${id} = ${parseStr(k)};`);
2092
+ if (isOptionalIn && isOptionalOut) {
2093
+ const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
2094
+ doc.write(`
2095
+ const ${id}_present = ${isPresent};
2096
+ if (!${id}.issues.length || ${id}_present) {
2097
+ if (${id}.issues.length) {${prefixStr(id, k)}
1635
2098
  }
1636
- }
1637
-
1638
- if (${id}.value === undefined) {
1639
- if (${k} in input) {
1640
- newResult[${k}] = undefined;
2099
+
2100
+ if (${assign}) {
2101
+ newResult[${k}] = ${id}.value;
1641
2102
  }
1642
- } else {
1643
- newResult[${k}] = ${id}.value;
1644
2103
  }
1645
-
2104
+
1646
2105
  `);
1647
- else if (!isOptionalIn) doc.write(`
1648
- const ${id}_present = ${k} in input;
1649
- if (${id}.issues.length) {
1650
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1651
- ...iss,
1652
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1653
- })));
2106
+ } else if (!isOptionalIn) doc.write(`
2107
+ const ${id}_present = ${isPresent};
2108
+ if (${id}.issues.length) {${prefixStr(id, k)}
1654
2109
  }
1655
2110
  if (!${id}_present && !${id}.issues.length) {
1656
2111
  payload.issues.push({
@@ -1659,42 +2114,36 @@ window.__ModuleLoader__.load({
1659
2114
  input: undefined,
1660
2115
  path: [${k}]
1661
2116
  });
2117
+ if (ctx && ctx.abortEarly) {
2118
+ payload.value = newResult;
2119
+ return payload;
2120
+ }
1662
2121
  }
1663
2122
 
1664
2123
  if (${id}_present) {
1665
- if (${id}.value === undefined) {
1666
- newResult[${k}] = undefined;
1667
- } else {
1668
- newResult[${k}] = ${id}.value;
1669
- }
2124
+ newResult[${k}] = ${id}.value;
1670
2125
  }
1671
2126
 
1672
2127
  `);
1673
- else doc.write(`
1674
- if (${id}.issues.length) {
1675
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1676
- ...iss,
1677
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1678
- })));
2128
+ else {
2129
+ doc.write(`
2130
+ if (${id}.issues.length) {${prefixStr(id, k)}
1679
2131
  }
1680
-
1681
- if (${id}.value === undefined) {
1682
- if (${k} in input) {
1683
- newResult[${k}] = undefined;
1684
- }
1685
- } else {
2132
+ `);
2133
+ if (optin === "defaulted") doc.write(`newResult[${k}] = ${id}.value;`);
2134
+ else doc.write(`
2135
+ if (${id}.value !== undefined || ${isPresent}) {
1686
2136
  newResult[${k}] = ${id}.value;
1687
2137
  }
1688
-
1689
2138
  `);
2139
+ }
1690
2140
  }
1691
2141
  doc.write(`payload.value = newResult;`);
1692
2142
  doc.write(`return payload;`);
1693
- const fn = doc.compile();
1694
- return (payload, ctx) => fn(shape, payload, ctx);
2143
+ return doc.compile();
1695
2144
  };
1696
2145
  let fastpass;
1697
- const isObject$2 = isObject;
2146
+ const isObject$1 = isObject;
1698
2147
  const jit = !globalConfig.jitless;
1699
2148
  const fastEnabled = jit && allowsEval.value;
1700
2149
  const catchall = def.catchall;
@@ -1702,7 +2151,7 @@ window.__ModuleLoader__.load({
1702
2151
  inst._zod.parse = (payload, ctx) => {
1703
2152
  value ?? (value = _normalized.value);
1704
2153
  const input = payload.value;
1705
- if (!isObject$2(input)) {
2154
+ if (!isObject$1(input)) {
1706
2155
  payload.issues.push({
1707
2156
  expected: "object",
1708
2157
  code: "invalid_type",
@@ -1715,7 +2164,7 @@ window.__ModuleLoader__.load({
1715
2164
  if (!fastpass) fastpass = generateFastpass(def.shape);
1716
2165
  payload = fastpass(payload, ctx);
1717
2166
  if (!catchall) return payload;
1718
- return handleCatchall([], input, payload, ctx, value, inst);
2167
+ return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
1719
2168
  }
1720
2169
  return superParse(payload, ctx);
1721
2170
  };
@@ -1740,14 +2189,14 @@ window.__ModuleLoader__.load({
1740
2189
  }
1741
2190
  const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
1742
2191
  $ZodType.init(inst, def);
1743
- defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1744
- defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
1745
- defineLazy(inst._zod, "values", () => {
1746
- if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
2192
+ defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted") ? "defaulted" : zod.def.options.some((o) => o._zod.optin !== void 0) ? "optional" : void 0);
2193
+ defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
2194
+ defineLazyInternal(inst, "values", (zod) => {
2195
+ if (zod.def.options.every((o) => o._zod.values)) return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
1747
2196
  });
1748
- defineLazy(inst._zod, "pattern", () => {
1749
- if (def.options.every((o) => o._zod.pattern)) {
1750
- const patterns = def.options.map((o) => o._zod.pattern);
2197
+ defineLazyInternal(inst, "pattern", (zod) => {
2198
+ if (zod.def.options.every((o) => o._zod.pattern)) {
2199
+ const patterns = zod.def.options.map((o) => o._zod.pattern);
1751
2200
  return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1752
2201
  }
1753
2202
  });
@@ -1809,7 +2258,9 @@ window.__ModuleLoader__.load({
1809
2258
  ...a,
1810
2259
  ...b
1811
2260
  };
2261
+ if (Object.prototype.hasOwnProperty.call(newObj, "__proto__")) delete newObj.__proto__;
1812
2262
  for (const key of sharedKeys) {
2263
+ if (key === "__proto__") continue;
1813
2264
  const sharedValue = mergeValues(a[key], b[key]);
1814
2265
  if (!sharedValue.valid) return {
1815
2266
  valid: false,
@@ -1851,26 +2302,39 @@ window.__ModuleLoader__.load({
1851
2302
  function handleIntersectionResults(result, left, right) {
1852
2303
  const unrecKeys = /* @__PURE__ */ new Map();
1853
2304
  let unrecIssue;
1854
- for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
1855
- unrecIssue ?? (unrecIssue = iss);
1856
- for (const k of iss.keys) {
2305
+ const keyIssues = /* @__PURE__ */ new Map();
2306
+ const collect = (iss, side) => {
2307
+ let keys;
2308
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
2309
+ unrecIssue ?? (unrecIssue = iss);
2310
+ keys = iss.keys;
2311
+ } else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
2312
+ const k = String(iss.path[0]);
2313
+ if (!keyIssues.has(k)) keyIssues.set(k, iss);
2314
+ keys = [k];
2315
+ } else return false;
2316
+ for (const k of keys) {
1857
2317
  if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1858
- unrecKeys.get(k).l = true;
2318
+ unrecKeys.get(k)[side] = true;
1859
2319
  }
1860
- } else result.issues.push(iss);
1861
- for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
1862
- if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1863
- unrecKeys.get(k).r = true;
1864
- }
1865
- else result.issues.push(iss);
2320
+ return true;
2321
+ };
2322
+ for (const iss of left.issues) if (!collect(iss, "l")) result.issues.push(iss);
2323
+ for (const iss of right.issues) if (!collect(iss, "r")) result.issues.push(iss);
1866
2324
  const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1867
- if (bothKeys.length && unrecIssue) result.issues.push({
1868
- ...unrecIssue,
1869
- keys: bothKeys
1870
- });
1871
- if (aborted(result)) return result;
2325
+ if (bothKeys.length) {
2326
+ const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
2327
+ if (aggregated.length) result.issues.push({
2328
+ ...unrecIssue,
2329
+ keys: aggregated
2330
+ });
2331
+ for (const k of bothKeys) if (!aggregated.includes(k) && keyIssues.has(k)) result.issues.push(keyIssues.get(k));
2332
+ }
1872
2333
  const merged = mergeValues(left.value, right.value);
1873
- if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
2334
+ if (!merged.valid) {
2335
+ if (aborted(result)) return result;
2336
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
2337
+ }
1874
2338
  result.value = merged.data;
1875
2339
  return result;
1876
2340
  }
@@ -1879,7 +2343,10 @@ window.__ModuleLoader__.load({
1879
2343
  const values = getEnumValues(def.entries);
1880
2344
  const valuesSet = new Set(values);
1881
2345
  inst._zod.values = valuesSet;
1882
- inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
2346
+ defineLazyInternal(inst, "pattern", (zod) => {
2347
+ const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
2348
+ return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
2349
+ });
1883
2350
  inst._zod.parse = (payload, _ctx) => {
1884
2351
  const input = payload.value;
1885
2352
  if (valuesSet.has(input)) return payload;
@@ -1894,10 +2361,12 @@ window.__ModuleLoader__.load({
1894
2361
  });
1895
2362
  const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
1896
2363
  $ZodType.init(inst, def);
1897
- if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
1898
2364
  const values = new Set(def.values);
1899
2365
  inst._zod.values = values;
1900
- inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
2366
+ defineLazyInternal(inst, "pattern", (zod) => {
2367
+ const vals = zod.def.values;
2368
+ return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
2369
+ });
1901
2370
  inst._zod.parse = (payload, _ctx) => {
1902
2371
  const input = payload.value;
1903
2372
  if (values.has(input)) return payload;
@@ -1913,67 +2382,66 @@ window.__ModuleLoader__.load({
1913
2382
  const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
1914
2383
  $ZodType.init(inst, def);
1915
2384
  inst._zod.optin = "optional";
2385
+ globalConfig.memoizer?.guard(inst);
1916
2386
  inst._zod.parse = (payload, ctx) => {
1917
2387
  if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
1918
2388
  const _out = def.transform(payload.value, payload);
1919
2389
  if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
1920
2390
  payload.value = output;
1921
- payload.fallback = true;
1922
2391
  return payload;
1923
2392
  });
1924
2393
  if (_out instanceof Promise) throw new $ZodAsyncError();
1925
2394
  payload.value = _out;
1926
- payload.fallback = true;
1927
2395
  return payload;
1928
2396
  };
1929
2397
  });
1930
- function handleOptionalResult(result, input) {
1931
- if (input === void 0 && (result.issues.length || result.fallback)) return {
1932
- issues: [],
1933
- value: void 0
1934
- };
1935
- return result;
2398
+ function handleOptionalResult(payload, result) {
2399
+ payload.value = result.issues.length ? void 0 : result.value;
2400
+ return payload;
1936
2401
  }
1937
2402
  const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
1938
2403
  $ZodType.init(inst, def);
1939
- inst._zod.optin = "optional";
2404
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
1940
2405
  inst._zod.optout = "optional";
1941
- defineLazy(inst._zod, "values", () => {
1942
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
2406
+ defineLazyInternal(inst, "values", (zod) => {
2407
+ const values = zod.def.innerType._zod.values;
2408
+ return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
1943
2409
  });
1944
- defineLazy(inst._zod, "pattern", () => {
1945
- const pattern = def.innerType._zod.pattern;
2410
+ defineLazyInternal(inst, "pattern", (zod) => {
2411
+ const pattern = zod.def.innerType._zod.pattern;
1946
2412
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
1947
2413
  });
1948
2414
  inst._zod.parse = (payload, ctx) => {
1949
- if (def.innerType._zod.optin === "optional") {
1950
- const input = payload.value;
1951
- const result = def.innerType._zod.run(payload, ctx);
1952
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
1953
- return handleOptionalResult(result, input);
2415
+ if (payload.value === void 0) {
2416
+ if (def.innerType._zod.optin !== "defaulted") return payload;
2417
+ const result = def.innerType._zod.run({
2418
+ value: payload.value,
2419
+ issues: []
2420
+ }, ctx);
2421
+ if (result instanceof Promise) return result.then((result) => handleOptionalResult(payload, result));
2422
+ return handleOptionalResult(payload, result);
1954
2423
  }
1955
- if (payload.value === void 0) return payload;
1956
2424
  return def.innerType._zod.run(payload, ctx);
1957
2425
  };
1958
2426
  });
1959
2427
  const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
1960
2428
  $ZodOptional.init(inst, def);
1961
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1962
- defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
2429
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2430
+ defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
1963
2431
  inst._zod.parse = (payload, ctx) => {
1964
2432
  return def.innerType._zod.run(payload, ctx);
1965
2433
  };
1966
2434
  });
1967
2435
  const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
1968
2436
  $ZodType.init(inst, def);
1969
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1970
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1971
- defineLazy(inst._zod, "pattern", () => {
1972
- const pattern = def.innerType._zod.pattern;
2437
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
2438
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2439
+ defineLazyInternal(inst, "pattern", (zod) => {
2440
+ const pattern = zod.def.innerType._zod.pattern;
1973
2441
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
1974
2442
  });
1975
- defineLazy(inst._zod, "values", () => {
1976
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
2443
+ defineLazyInternal(inst, "values", (zod) => {
2444
+ return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
1977
2445
  });
1978
2446
  inst._zod.parse = (payload, ctx) => {
1979
2447
  if (payload.value === null) return payload;
@@ -1982,8 +2450,8 @@ window.__ModuleLoader__.load({
1982
2450
  });
1983
2451
  const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
1984
2452
  $ZodType.init(inst, def);
1985
- inst._zod.optin = "optional";
1986
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2453
+ inst._zod.optin = "defaulted";
2454
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
1987
2455
  inst._zod.parse = (payload, ctx) => {
1988
2456
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1989
2457
  if (payload.value === void 0) {
@@ -2004,8 +2472,8 @@ window.__ModuleLoader__.load({
2004
2472
  }
2005
2473
  const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
2006
2474
  $ZodType.init(inst, def);
2007
- inst._zod.optin = "optional";
2008
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2475
+ inst._zod.optin = "defaulted";
2476
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2009
2477
  inst._zod.parse = (payload, ctx) => {
2010
2478
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2011
2479
  if (payload.value === void 0) payload.value = def.defaultValue;
@@ -2014,8 +2482,8 @@ window.__ModuleLoader__.load({
2014
2482
  });
2015
2483
  const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
2016
2484
  $ZodType.init(inst, def);
2017
- defineLazy(inst._zod, "values", () => {
2018
- const v = def.innerType._zod.values;
2485
+ defineLazyInternal(inst, "values", (zod) => {
2486
+ const v = zod.def.innerType._zod.values;
2019
2487
  return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
2020
2488
  });
2021
2489
  inst._zod.parse = (payload, ctx) => {
@@ -2033,46 +2501,41 @@ window.__ModuleLoader__.load({
2033
2501
  });
2034
2502
  return payload;
2035
2503
  }
2504
+ function handleCatchResult(payload, result, def, ctx) {
2505
+ if (!result.issues.length) {
2506
+ payload.value = result.value;
2507
+ if (result.memo) payload.memo = true;
2508
+ return payload;
2509
+ }
2510
+ payload.value = def.catchValue({
2511
+ ...result,
2512
+ value: payload.value,
2513
+ error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2514
+ input: payload.value
2515
+ });
2516
+ return payload;
2517
+ }
2036
2518
  const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
2037
2519
  $ZodType.init(inst, def);
2038
- inst._zod.optin = "optional";
2039
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2040
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2520
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
2521
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2522
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2041
2523
  inst._zod.parse = (payload, ctx) => {
2042
2524
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2043
- const result = def.innerType._zod.run(payload, ctx);
2044
- if (result instanceof Promise) return result.then((result) => {
2045
- payload.value = result.value;
2046
- if (result.issues.length) {
2047
- payload.value = def.catchValue({
2048
- ...payload,
2049
- error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2050
- input: payload.value
2051
- });
2052
- payload.issues = [];
2053
- payload.fallback = true;
2054
- }
2055
- return payload;
2056
- });
2057
- payload.value = result.value;
2058
- if (result.issues.length) {
2059
- payload.value = def.catchValue({
2060
- ...payload,
2061
- error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2062
- input: payload.value
2063
- });
2064
- payload.issues = [];
2065
- payload.fallback = true;
2066
- }
2067
- return payload;
2525
+ const result = def.innerType._zod.run({
2526
+ value: payload.value,
2527
+ issues: []
2528
+ }, ctx);
2529
+ if (result instanceof Promise) return result.then((result) => handleCatchResult(payload, result, def, ctx));
2530
+ return handleCatchResult(payload, result, def, ctx);
2068
2531
  };
2069
2532
  });
2070
2533
  const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
2071
2534
  $ZodType.init(inst, def);
2072
- defineLazy(inst._zod, "values", () => def.in._zod.values);
2073
- defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2074
- defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2075
- defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2535
+ defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2536
+ defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2537
+ defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2538
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
2076
2539
  inst._zod.parse = (payload, ctx) => {
2077
2540
  if (ctx.direction === "backward") {
2078
2541
  const right = def.out._zod.run(payload, ctx);
@@ -2085,22 +2548,21 @@ window.__ModuleLoader__.load({
2085
2548
  };
2086
2549
  });
2087
2550
  function handlePipeResult(left, next, ctx) {
2088
- if (left.issues.length) {
2551
+ if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
2089
2552
  left.aborted = true;
2090
2553
  return left;
2091
2554
  }
2092
2555
  return next._zod.run({
2093
2556
  value: left.value,
2094
- issues: left.issues,
2095
- fallback: left.fallback
2557
+ issues: left.issues
2096
2558
  }, ctx);
2097
2559
  }
2098
2560
  const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
2099
2561
  $ZodType.init(inst, def);
2100
- defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2101
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2102
- defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
2103
- defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
2562
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
2563
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2564
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
2565
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
2104
2566
  inst._zod.parse = (payload, ctx) => {
2105
2567
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2106
2568
  const result = def.innerType._zod.run(payload, ctx);
@@ -2109,7 +2571,7 @@ window.__ModuleLoader__.load({
2109
2571
  };
2110
2572
  });
2111
2573
  function handleReadonlyResult(payload) {
2112
- payload.value = Object.freeze(payload.value);
2574
+ if (!payload.memo) payload.value = Object.freeze(payload.value);
2113
2575
  return payload;
2114
2576
  }
2115
2577
  const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
@@ -2139,22 +2601,383 @@ window.__ModuleLoader__.load({
2139
2601
  }
2140
2602
  }
2141
2603
  //#endregion
2142
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
2143
- var _a;
2144
- var $ZodRegistry = class {
2604
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
2605
+ var $ZodCyclicError = class extends Error {
2145
2606
  constructor() {
2146
- this._map = /* @__PURE__ */ new WeakMap();
2147
- this._idmap = /* @__PURE__ */ new Map();
2148
- }
2149
- add(schema, ..._meta) {
2150
- const meta = _meta[0];
2151
- this._map.set(schema, meta);
2152
- if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
2153
- return this;
2607
+ super(`Cannot parse a reference cycle that closes through a transform`);
2608
+ this.name = "ZodCyclicError";
2154
2609
  }
2155
- clear() {
2156
- this._map = /* @__PURE__ */ new WeakMap();
2157
- this._idmap = /* @__PURE__ */ new Map();
2610
+ };
2611
+ /** Keyed off the context object every schema in one parse call already shares. */
2612
+ const STATE = "~memo";
2613
+ const NO_ISSUES = [];
2614
+ function isRef(value) {
2615
+ return value !== null && typeof value === "object";
2616
+ }
2617
+ function cloneIssues(issues) {
2618
+ return issues.map((iss) => iss.path ? {
2619
+ ...iss,
2620
+ path: iss.path.slice()
2621
+ } : { ...iss });
2622
+ }
2623
+ const recursive = /*@__PURE__*/ new WeakMap();
2624
+ /** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
2625
+ const NONE = 0;
2626
+ const ASSUMED = 1;
2627
+ const PROVEN = 2;
2628
+ /** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
2629
+ function isRecursive(inst, stack, resolve) {
2630
+ const cached = recursive.get(inst);
2631
+ if (cached !== void 0) return cached ? PROVEN : NONE;
2632
+ if (stack.has(inst)) return PROVEN;
2633
+ stack.add(inst);
2634
+ let result = NONE;
2635
+ const check = (child) => {
2636
+ if (result !== PROVEN && child?._zod) {
2637
+ const answer = isRecursive(child, stack, resolve);
2638
+ if (answer > result) result = answer;
2639
+ }
2640
+ };
2641
+ const shape = (sh, spread) => {
2642
+ let answer = NONE;
2643
+ for (const key of Reflect.ownKeys(sh)) {
2644
+ const desc = Object.getOwnPropertyDescriptor(sh, key);
2645
+ if (spread && !desc.enumerable) continue;
2646
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
2647
+ if (child > answer) answer = child;
2648
+ }
2649
+ return answer;
2650
+ };
2651
+ const merge = (answer) => {
2652
+ if (answer > result) result = answer;
2653
+ };
2654
+ const def = inst._zod.def;
2655
+ switch (def.type) {
2656
+ case "object": {
2657
+ const raw = rawShape(def);
2658
+ merge(raw ? shape(raw, true) : ASSUMED);
2659
+ check(def.catchall);
2660
+ break;
2661
+ }
2662
+ case "array":
2663
+ check(def.element);
2664
+ break;
2665
+ case "tuple":
2666
+ for (const el of def.items) check(el);
2667
+ check(def.rest);
2668
+ break;
2669
+ case "record":
2670
+ case "map":
2671
+ check(def.keyType);
2672
+ check(def.valueType);
2673
+ break;
2674
+ case "set":
2675
+ check(def.valueType);
2676
+ break;
2677
+ case "union":
2678
+ for (const el of def.options) check(el);
2679
+ break;
2680
+ case "intersection":
2681
+ check(def.left);
2682
+ check(def.right);
2683
+ break;
2684
+ case "optional":
2685
+ case "nullable":
2686
+ case "default":
2687
+ case "prefault":
2688
+ case "catch":
2689
+ case "readonly":
2690
+ case "nonoptional":
2691
+ case "promise":
2692
+ case "success":
2693
+ check(def.innerType);
2694
+ break;
2695
+ case "pipe":
2696
+ check(def.in);
2697
+ check(def.out);
2698
+ break;
2699
+ case "function":
2700
+ check(def.input);
2701
+ check(def.output);
2702
+ break;
2703
+ case "lazy": {
2704
+ const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
2705
+ merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
2706
+ break;
2707
+ }
2708
+ case "template_literal":
2709
+ case "string":
2710
+ case "number":
2711
+ case "int":
2712
+ case "boolean":
2713
+ case "bigint":
2714
+ case "symbol":
2715
+ case "undefined":
2716
+ case "null":
2717
+ case "void":
2718
+ case "never":
2719
+ case "any":
2720
+ case "unknown":
2721
+ case "date":
2722
+ case "nan":
2723
+ case "enum":
2724
+ case "literal":
2725
+ case "file":
2726
+ case "transform":
2727
+ case "custom": break;
2728
+ default: for (const key in def) {
2729
+ const desc = Object.getOwnPropertyDescriptor(def, key);
2730
+ if (!desc || desc.get) continue;
2731
+ const value = desc.value;
2732
+ if (!value || typeof value !== "object") continue;
2733
+ if (value._zod) check(value);
2734
+ else if (Array.isArray(value)) for (const el of value) check(el);
2735
+ }
2736
+ }
2737
+ stack.delete(inst);
2738
+ return settle(inst, result);
2739
+ }
2740
+ /** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
2741
+ function settle(inst, answer) {
2742
+ if (answer !== ASSUMED) recursive.set(inst, answer === PROVEN);
2743
+ return answer;
2744
+ }
2745
+ function bucketFor(state, inst) {
2746
+ let bucket = state.buckets.get(inst);
2747
+ if (!bucket) {
2748
+ bucket = /* @__PURE__ */ new WeakMap();
2749
+ state.buckets.set(inst, bucket);
2750
+ }
2751
+ return bucket;
2752
+ }
2753
+ let handoff;
2754
+ const open = [];
2755
+ const memo$1 = {
2756
+ alloc(_inst, payload, empty) {
2757
+ const bucket = handoff;
2758
+ if (!bucket) return empty;
2759
+ handoff = void 0;
2760
+ const entry = {
2761
+ value: empty,
2762
+ issues: null
2763
+ };
2764
+ bucket.set(payload.value, entry);
2765
+ open.push(entry);
2766
+ return empty;
2767
+ },
2768
+ guard(inst) {
2769
+ var _a;
2770
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
2771
+ inst._zod.deferred.push(() => {
2772
+ const base = inst._zod.parse;
2773
+ const wrapped = (payload, ctx) => {
2774
+ if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value)) throw new $ZodCyclicError();
2775
+ return base(payload, ctx);
2776
+ };
2777
+ inst._zod.parse = wrapped;
2778
+ if (inst._zod.run === base) inst._zod.run = wrapped;
2779
+ });
2780
+ },
2781
+ attach(inst) {
2782
+ var _a;
2783
+ let isRecursiveInst;
2784
+ let rechecked = false;
2785
+ let lastCtx;
2786
+ let lastBucket;
2787
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
2788
+ inst._zod.deferred.push(() => {
2789
+ const base = inst._zod.parse;
2790
+ const wrapped = (payload, ctx) => {
2791
+ if (isRecursiveInst === void 0) {
2792
+ const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
2793
+ if (walked === NONE) {
2794
+ inst._zod.parse = base;
2795
+ if (inst._zod.run === wrapped) inst._zod.run = base;
2796
+ return base(payload, ctx);
2797
+ }
2798
+ if (walked === PROVEN || rechecked) isRecursiveInst = true;
2799
+ else rechecked = true;
2800
+ }
2801
+ const input = payload.value;
2802
+ if (!isRef(input)) return base(payload, ctx);
2803
+ let state = ctx[STATE];
2804
+ if (!state) {
2805
+ state = {
2806
+ buckets: /* @__PURE__ */ new WeakMap(),
2807
+ backEdges: void 0
2808
+ };
2809
+ ctx[STATE] = state;
2810
+ }
2811
+ let bucket;
2812
+ if (lastCtx === ctx) bucket = lastBucket;
2813
+ else {
2814
+ bucket = bucketFor(state, inst);
2815
+ lastCtx = ctx;
2816
+ lastBucket = bucket;
2817
+ }
2818
+ const hit = bucket.get(input);
2819
+ if (hit) {
2820
+ payload.value = hit.value;
2821
+ if (hit.issues) {
2822
+ if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
2823
+ } else {
2824
+ payload.memo = true;
2825
+ state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
2826
+ state.backEdges.add(hit.value);
2827
+ }
2828
+ return payload;
2829
+ }
2830
+ handoff = bucket;
2831
+ const depth = open.length;
2832
+ const result = base(payload, ctx);
2833
+ handoff = void 0;
2834
+ const entry = open.length > depth ? open.pop() : void 0;
2835
+ if (result instanceof Promise) return result.then((r) => {
2836
+ if (entry) entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
2837
+ return r;
2838
+ });
2839
+ if (entry) entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
2840
+ return result;
2841
+ };
2842
+ inst._zod.parse = wrapped;
2843
+ if (inst._zod.run === base) inst._zod.run = wrapped;
2844
+ });
2845
+ }
2846
+ };
2847
+ /** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */
2848
+ function memoizer() {
2849
+ return memo$1;
2850
+ }
2851
+ /** Whether this value is a node a back-edge resolved to before it finished. */
2852
+ function isBackEdge(ctx, value) {
2853
+ const backEdges = ctx[STATE]?.backEdges;
2854
+ return backEdges !== void 0 && isRef(value) && backEdges.has(value);
2855
+ }
2856
+ //#endregion
2857
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
2858
+ const error = () => {
2859
+ const Sizable = {
2860
+ string: {
2861
+ unit: "characters",
2862
+ verb: "to have"
2863
+ },
2864
+ file: {
2865
+ unit: "bytes",
2866
+ verb: "to have"
2867
+ },
2868
+ array: {
2869
+ unit: "items",
2870
+ verb: "to have"
2871
+ },
2872
+ set: {
2873
+ unit: "items",
2874
+ verb: "to have"
2875
+ },
2876
+ map: {
2877
+ unit: "entries",
2878
+ verb: "to have"
2879
+ }
2880
+ };
2881
+ function getSizing(origin) {
2882
+ return Sizable[origin] ?? null;
2883
+ }
2884
+ const FormatDictionary = {
2885
+ regex: "input",
2886
+ email: "email address",
2887
+ url: "URL",
2888
+ emoji: "emoji",
2889
+ uuid: "UUID",
2890
+ uuidv4: "UUIDv4",
2891
+ uuidv6: "UUIDv6",
2892
+ nanoid: "nanoid",
2893
+ guid: "GUID",
2894
+ cuid: "cuid",
2895
+ cuid2: "cuid2",
2896
+ ulid: "ULID",
2897
+ xid: "XID",
2898
+ ksuid: "KSUID",
2899
+ datetime: "ISO datetime",
2900
+ date: "ISO date",
2901
+ time: "ISO time",
2902
+ duration: "ISO duration",
2903
+ ipv4: "IPv4 address",
2904
+ ipv6: "IPv6 address",
2905
+ mac: "MAC address",
2906
+ cidrv4: "IPv4 range",
2907
+ cidrv6: "IPv6 range",
2908
+ base64: "base64-encoded string",
2909
+ base64url: "base64url-encoded string",
2910
+ json_string: "JSON string",
2911
+ e164: "E.164 number",
2912
+ currency_code: "currency code",
2913
+ credit_card: "credit card number",
2914
+ iban: "IBAN",
2915
+ jwt: "JWT",
2916
+ template_literal: "input"
2917
+ };
2918
+ const TypeDictionary = { nan: "NaN" };
2919
+ function getTypeName(type, input) {
2920
+ if (type === "number" && typeof input === "number" && !Number.isFinite(input)) return String(input);
2921
+ return TypeDictionary[type] ?? type;
2922
+ }
2923
+ return (issue) => {
2924
+ switch (issue.code) {
2925
+ case "invalid_type": return `Invalid input: expected ${getTypeName(issue.expected)}, received ${getTypeName(parsedType(issue.input), issue.input)}`;
2926
+ case "invalid_value":
2927
+ if (issue.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
2928
+ return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
2929
+ case "too_big": {
2930
+ const adj = issue.exact ? "exactly " : issue.inclusive ? "<=" : "<";
2931
+ const sizing = getSizing(issue.origin);
2932
+ if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
2933
+ return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
2934
+ }
2935
+ case "too_small": {
2936
+ const adj = issue.exact ? "exactly " : issue.inclusive ? ">=" : ">";
2937
+ const sizing = getSizing(issue.origin);
2938
+ if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
2939
+ return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
2940
+ }
2941
+ case "invalid_format": {
2942
+ const _issue = issue;
2943
+ if (_issue.format === "starts_with") return `Invalid string: must start with "${_issue.prefix}"`;
2944
+ if (_issue.format === "ends_with") return `Invalid string: must end with "${_issue.suffix}"`;
2945
+ if (_issue.format === "includes") return `Invalid string: must include "${_issue.includes}"`;
2946
+ if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`;
2947
+ return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;
2948
+ }
2949
+ case "not_multiple_of": return `Invalid number: must be a multiple of ${issue.divisor}`;
2950
+ case "unrecognized_keys": return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
2951
+ case "invalid_key": return `Invalid key in ${issue.origin}`;
2952
+ case "invalid_union":
2953
+ if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) return `Invalid discriminator value. Expected ${issue.options.map((o) => `'${o}'`).join(" | ")}`;
2954
+ if (issue.inclusive === false) return "Invalid input: more than one option matched";
2955
+ return "Invalid input";
2956
+ case "invalid_element": return `Invalid value in ${issue.origin}`;
2957
+ default: return `Invalid input`;
2958
+ }
2959
+ };
2960
+ };
2961
+ function en_default() {
2962
+ return { localeError: error() };
2963
+ }
2964
+ //#endregion
2965
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
2966
+ var _a;
2967
+ var $ZodRegistry = class {
2968
+ constructor() {
2969
+ this._map = /* @__PURE__ */ new WeakMap();
2970
+ this._idmap = /* @__PURE__ */ new Map();
2971
+ }
2972
+ add(schema, ..._meta) {
2973
+ const meta = _meta[0];
2974
+ this._map.set(schema, meta);
2975
+ if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
2976
+ return this;
2977
+ }
2978
+ clear() {
2979
+ this._map = /* @__PURE__ */ new WeakMap();
2980
+ this._idmap = /* @__PURE__ */ new Map();
2158
2981
  return this;
2159
2982
  }
2160
2983
  remove(schema) {
@@ -2186,13 +3009,17 @@ window.__ModuleLoader__.load({
2186
3009
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2187
3010
  const globalRegistry = globalThis.__zod_globalRegistry;
2188
3011
  //#endregion
2189
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
3012
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
3013
+ function snapshotChecks(def) {
3014
+ if (def.checks) def.checks = [...def.checks];
3015
+ return def;
3016
+ }
2190
3017
  // @__NO_SIDE_EFFECTS__
2191
3018
  function _string(Class, params) {
2192
- return new Class({
3019
+ return new Class(snapshotChecks({
2193
3020
  type: "string",
2194
3021
  ...normalizeParams(params)
2195
- });
3022
+ }));
2196
3023
  }
2197
3024
  // @__NO_SIDE_EFFECTS__
2198
3025
  function _email(Class, params) {
@@ -2464,11 +3291,11 @@ window.__ModuleLoader__.load({
2464
3291
  }
2465
3292
  // @__NO_SIDE_EFFECTS__
2466
3293
  function _number(Class, params) {
2467
- return new Class({
3294
+ return new Class(snapshotChecks({
2468
3295
  type: "number",
2469
3296
  checks: [],
2470
3297
  ...normalizeParams(params)
2471
- });
3298
+ }));
2472
3299
  }
2473
3300
  // @__NO_SIDE_EFFECTS__
2474
3301
  function _int(Class, params) {
@@ -2671,7 +3498,7 @@ window.__ModuleLoader__.load({
2671
3498
  const _issue = issue$2;
2672
3499
  if (_issue.fatal) _issue.continue = false;
2673
3500
  _issue.code ?? (_issue.code = "custom");
2674
- _issue.input ?? (_issue.input = payload.value);
3501
+ if (!("input" in _issue)) _issue.input = payload.value;
2675
3502
  _issue.inst ?? (_issue.inst = ch);
2676
3503
  _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
2677
3504
  payload.issues.push(issue(_issue));
@@ -2691,7 +3518,11 @@ window.__ModuleLoader__.load({
2691
3518
  return ch;
2692
3519
  }
2693
3520
  //#endregion
2694
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
3521
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
3522
+ function assignProps(target, ...sources) {
3523
+ for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
3524
+ return target;
3525
+ }
2695
3526
  function initializeContext(params) {
2696
3527
  let target = params?.target ?? "draft-2020-12";
2697
3528
  if (target === "draft-4") target = "draft-04";
@@ -2705,12 +3536,32 @@ window.__ModuleLoader__.load({
2705
3536
  io: params?.io ?? "output",
2706
3537
  counter: 0,
2707
3538
  seen: /* @__PURE__ */ new Map(),
3539
+ sharedDefsExtractedFor: void 0,
3540
+ sharedEmitDoneFor: void 0,
2708
3541
  cycles: params?.cycles ?? "ref",
2709
3542
  reused: params?.reused ?? "inline",
3543
+ intersections: [],
3544
+ deferred: [],
2710
3545
  external: params?.external ?? void 0
2711
3546
  };
2712
3547
  }
2713
- function process(schema, ctx, _params = {
3548
+ /**
3549
+ * Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws
3550
+ * `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a
3551
+ * custom JSON Schema was written into `json`, in which case the caller must not write its own.
3552
+ */
3553
+ function handleUnrepresentable(schema, ctx, json, params, message) {
3554
+ const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({
3555
+ zodSchema: schema,
3556
+ path: params.path,
3557
+ message
3558
+ }) : ctx.unrepresentable;
3559
+ if (result === "any") return false;
3560
+ if (result === void 0 || result === "throw") throw new Error(message);
3561
+ Object.assign(json, result);
3562
+ return true;
3563
+ }
3564
+ function processSchema(schema, ctx, _params = {
2714
3565
  path: [],
2715
3566
  schemaPath: []
2716
3567
  }) {
@@ -2729,6 +3580,8 @@ window.__ModuleLoader__.load({
2729
3580
  path: _params.path
2730
3581
  };
2731
3582
  ctx.seen.set(schema, result);
3583
+ ctx.sharedDefsExtractedFor = void 0;
3584
+ ctx.sharedEmitDoneFor = void 0;
2732
3585
  const overrideSchema = schema._zod.toJSONSchema?.();
2733
3586
  if (overrideSchema) result.schema = overrideSchema;
2734
3587
  else {
@@ -2747,12 +3600,12 @@ window.__ModuleLoader__.load({
2747
3600
  const parent = schema._zod.parent;
2748
3601
  if (parent) {
2749
3602
  if (!result.ref) result.ref = parent;
2750
- process(parent, ctx, params);
3603
+ processSchema(parent, ctx, params);
2751
3604
  ctx.seen.get(parent).isParent = true;
2752
3605
  }
2753
3606
  }
2754
3607
  const meta = ctx.metadataRegistry.get(schema);
2755
- if (meta) Object.assign(result.schema, meta);
3608
+ if (meta) assignProps(result.schema, meta);
2756
3609
  if (ctx.io === "input" && isTransforming(schema)) {
2757
3610
  delete result.schema.examples;
2758
3611
  delete result.schema.default;
@@ -2761,9 +3614,13 @@ window.__ModuleLoader__.load({
2761
3614
  delete result.schema._prefault;
2762
3615
  return ctx.seen.get(schema).schema;
2763
3616
  }
3617
+ function encodeJSONPointerSegment(segment) {
3618
+ return segment.replace(/~/g, "~0").replace(/\//g, "~1");
3619
+ }
2764
3620
  function extractDefs(ctx, schema) {
2765
3621
  const root = ctx.seen.get(schema);
2766
3622
  if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
3623
+ if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external) return;
2767
3624
  const idToSchema = /* @__PURE__ */ new Map();
2768
3625
  for (const entry of ctx.seen.entries()) {
2769
3626
  const id = ctx.metadataRegistry.get(entry[0])?.id;
@@ -2783,15 +3640,16 @@ window.__ModuleLoader__.load({
2783
3640
  entry[1].defId = id;
2784
3641
  return {
2785
3642
  defId: id,
2786
- ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
3643
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}`
2787
3644
  };
2788
3645
  }
2789
- if (entry[1] === root) return { ref: "#" };
2790
- const defUriPrefix = `#/${defsSegment}/`;
3646
+ const uriPrefix = `#`;
3647
+ const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
3648
+ if (entry[1] === root && !entry[1].schema.id) return { ref: uriPrefix };
2791
3649
  const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
2792
3650
  return {
2793
3651
  defId,
2794
- ref: defUriPrefix + defId
3652
+ ref: defUriPrefix + encodeJSONPointerSegment(defId)
2795
3653
  };
2796
3654
  };
2797
3655
  const extractToDef = (entry) => {
@@ -2832,12 +3690,114 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2832
3690
  continue;
2833
3691
  }
2834
3692
  if (seen.count > 1) {
2835
- if (ctx.reused === "ref") {
2836
- extractToDef(entry);
2837
- continue;
3693
+ if (ctx.reused === "ref") extractToDef(entry);
3694
+ }
3695
+ }
3696
+ if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
3697
+ }
3698
+ /** Rewrites `anyOf: [{type: "a"}, {type: "b"}]` to `type: ["a", "b"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so "exactly one" and "at least one" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */
3699
+ function compactTypeUnion(schema) {
3700
+ const options = schema.anyOf;
3701
+ if (!Array.isArray(options) || options.length === 0 || schema.type !== void 0) return;
3702
+ const types = [];
3703
+ for (const option of options) {
3704
+ if (!option || typeof option !== "object") return;
3705
+ compactTypeUnion(option);
3706
+ const keys = Object.keys(option);
3707
+ if (keys.length !== 1 || keys[0] !== "type") return;
3708
+ const type = option.type;
3709
+ for (const member of Array.isArray(type) ? type : [type]) {
3710
+ if (typeof member !== "string") return;
3711
+ if (!types.includes(member)) types.push(member);
3712
+ }
3713
+ }
3714
+ delete schema.anyOf;
3715
+ schema.type = types.length === 1 ? types[0] : types;
3716
+ }
3717
+ /** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,
3718
+ * an annotation like `description` — makes a member unfoldable, so a constraint this does not
3719
+ * understand leaves the `allOf` alone instead of being silently dropped or misattributed. */
3720
+ const FOLDABLE_KEYS = /* @__PURE__ */ new Set([
3721
+ "type",
3722
+ "properties",
3723
+ "required",
3724
+ "additionalProperties"
3725
+ ]);
3726
+ const UNION_KEYS = ["oneOf", "anyOf"];
3727
+ /** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */
3728
+ function undeclaredConstraint(member) {
3729
+ const extra = member.additionalProperties;
3730
+ if (extra === void 0 || extra === false || typeof extra !== "object" || extra === null) return null;
3731
+ return Object.keys(extra).length ? extra : null;
3732
+ }
3733
+ /** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */
3734
+ function foldObjects(members) {
3735
+ const objects = [];
3736
+ for (const member of members) {
3737
+ if (typeof member !== "object" || member.type !== "object") return null;
3738
+ for (const key in member) if (!FOLDABLE_KEYS.has(key)) return null;
3739
+ objects.push(member);
3740
+ }
3741
+ const properties = {};
3742
+ const required = /* @__PURE__ */ new Set();
3743
+ for (const object of objects) {
3744
+ for (const key in object.properties) {
3745
+ if (Object.prototype.hasOwnProperty.call(properties, key)) continue;
3746
+ const parts = [];
3747
+ for (const other of objects) {
3748
+ const part = other.properties?.[key] ?? undeclaredConstraint(other);
3749
+ if (part === null || part === void 0) continue;
3750
+ if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part))) parts.push(part);
2838
3751
  }
3752
+ assignProp(properties, key, parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts });
3753
+ }
3754
+ for (const key of object.required ?? []) required.add(key);
3755
+ }
3756
+ const folded = {
3757
+ type: "object",
3758
+ properties
3759
+ };
3760
+ if (required.size) folded.required = [...required];
3761
+ if (objects.every((object) => object.additionalProperties === false)) folded.additionalProperties = false;
3762
+ else {
3763
+ const constraints = [];
3764
+ for (const object of objects) {
3765
+ const constraint = undeclaredConstraint(object);
3766
+ if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint))) constraints.push(constraint);
2839
3767
  }
3768
+ if (constraints.length === 1) folded.additionalProperties = constraints[0];
3769
+ else if (constraints.length > 1) folded.additionalProperties = { allOf: constraints };
2840
3770
  }
3771
+ return folded;
3772
+ }
3773
+ /** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two
3774
+ * closed object members reject each other's keys and the schema validates nothing. Zod's parser
3775
+ * pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when
3776
+ * *every* side rejects it — so the emitted schema has to pool them too, and folding the members
3777
+ * into one object is the encoding that says so on every target.
3778
+ *
3779
+ * This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`
3780
+ * machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it
3781
+ * keeps its reference and its own closedness rather than being inlined as a stale copy. */
3782
+ function foldIntersection(json) {
3783
+ const allOf = json.allOf;
3784
+ if (!Array.isArray(allOf) || allOf.length < 2) return;
3785
+ for (const key of FOLDABLE_KEYS) if (key in json) return;
3786
+ const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
3787
+ let folded = null;
3788
+ if (!unions.length) folded = foldObjects(allOf);
3789
+ else {
3790
+ const union = unions[0];
3791
+ const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));
3792
+ if (Object.keys(union).length !== 1) return;
3793
+ const rest = allOf.filter((m) => m !== union);
3794
+ const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));
3795
+ if (branches.some((b) => !b)) return;
3796
+ folded = { [keyword]: branches };
3797
+ }
3798
+ if (!folded) return;
3799
+ delete json.allOf;
3800
+ assignProps(json, folded);
2841
3801
  }
2842
3802
  function finalize(ctx, schema) {
2843
3803
  const root = ctx.seen.get(schema);
@@ -2856,8 +3816,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2856
3816
  if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
2857
3817
  schema.allOf = schema.allOf ?? [];
2858
3818
  schema.allOf.push(refSchema);
2859
- } else Object.assign(schema, refSchema);
2860
- Object.assign(schema, _cached);
3819
+ } else assignProps(schema, refSchema);
3820
+ assignProps(schema, _cached);
2861
3821
  if (zodSchema._zod.parent === ref) for (const key in schema) {
2862
3822
  if (key === "$ref" || key === "allOf") continue;
2863
3823
  if (!(key in _cached)) delete schema[key];
@@ -2885,7 +3845,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2885
3845
  path: seen.path ?? []
2886
3846
  });
2887
3847
  };
2888
- for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
3848
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
3849
+ for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
3850
+ if (ctx.target !== "openapi-3.0") for (const entry of ctx.seen.entries()) compactTypeUnion(entry[1].def ?? entry[1].schema);
3851
+ for (const rewrite of ctx.deferred) rewrite();
3852
+ if (ctx.intersections.length) {
3853
+ const carriers = /* @__PURE__ */ new Map();
3854
+ for (const seen of ctx.seen.values()) for (const json of [seen.schema, seen.def]) {
3855
+ const allOf = json?.allOf;
3856
+ if (!Array.isArray(allOf)) continue;
3857
+ const existing = carriers.get(allOf);
3858
+ if (existing) existing.push(json);
3859
+ else carriers.set(allOf, [json]);
3860
+ }
3861
+ for (const allOf of ctx.intersections) for (const json of carriers.get(allOf) ?? []) foldIntersection(json);
3862
+ }
3863
+ }
2889
3864
  const result = {};
2890
3865
  if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
2891
3866
  else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
@@ -2896,17 +3871,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2896
3871
  if (!id) throw new Error("Schema is missing an `id` property");
2897
3872
  result.$id = ctx.external.uri(id);
2898
3873
  }
2899
- Object.assign(result, root.def ?? root.schema);
3874
+ assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
2900
3875
  const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
2901
3876
  if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id;
2902
3877
  const defs = ctx.external?.defs ?? {};
2903
- for (const entry of ctx.seen.entries()) {
3878
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) for (const entry of ctx.seen.entries()) {
2904
3879
  const seen = entry[1];
2905
3880
  if (seen.def && seen.defId) {
2906
3881
  if (seen.def.id === seen.defId) delete seen.def.id;
2907
- defs[seen.defId] = seen.def;
3882
+ assignProp(defs, seen.defId, seen.def);
2908
3883
  }
2909
3884
  }
3885
+ if (ctx.external) ctx.sharedEmitDoneFor = ctx.external;
2910
3886
  if (ctx.external) {} else if (Object.keys(defs).length > 0) {
2911
3887
  if (ctx.target === "draft-2020-12") result.$defs = defs;
2912
3888
  else result.definitions = defs;
@@ -2938,7 +3914,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2938
3914
  if (def.type === "array") return isTransforming(def.element, ctx);
2939
3915
  if (def.type === "set") return isTransforming(def.valueType, ctx);
2940
3916
  if (def.type === "lazy") return isTransforming(def.getter(), ctx);
2941
- if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
3917
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault" || def.type === "catch") return isTransforming(def.innerType, ctx);
2942
3918
  if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
2943
3919
  if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
2944
3920
  if (def.type === "pipe") {
@@ -2969,7 +3945,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2969
3945
  ...params,
2970
3946
  processors
2971
3947
  });
2972
- process(schema, ctx);
3948
+ processSchema(schema, ctx);
2973
3949
  extractDefs(ctx, schema);
2974
3950
  return finalize(ctx, schema);
2975
3951
  };
@@ -2981,12 +3957,84 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2981
3957
  io,
2982
3958
  processors
2983
3959
  });
2984
- process(schema, ctx);
3960
+ processSchema(schema, ctx);
2985
3961
  extractDefs(ctx, schema);
2986
3962
  return finalize(ctx, schema);
2987
3963
  };
2988
3964
  //#endregion
2989
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
3965
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
3966
+ const narrowMin = (agg, key, value) => {
3967
+ if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
3968
+ };
3969
+ const narrowMax = (agg, key, value) => {
3970
+ if (agg[key] === void 0 || value < agg[key]) agg[key] = value;
3971
+ };
3972
+ const narrowBoth = (agg, value) => {
3973
+ narrowMin(agg, "minimum", value);
3974
+ narrowMax(agg, "maximum", value);
3975
+ };
3976
+ const addDivisor = (agg, value) => {
3977
+ agg.multipleOf ?? (agg.multipleOf = []);
3978
+ if (!agg.multipleOf.includes(value)) agg.multipleOf.push(value);
3979
+ };
3980
+ const addPattern = (agg, pattern) => {
3981
+ agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
3982
+ agg.patterns.add(pattern);
3983
+ };
3984
+ const intersectMime = (agg, mime) => {
3985
+ agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
3986
+ };
3987
+ const setFormat = (agg, format) => {
3988
+ agg.format = format;
3989
+ if (format.includes("int")) agg.isInt = true;
3990
+ };
3991
+ const minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
3992
+ const maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
3993
+ const formatContributor = (ranges) => (agg, def) => {
3994
+ setFormat(agg, def.format);
3995
+ const [minimum, maximum] = ranges[def.format];
3996
+ narrowMin(agg, "minimum", minimum);
3997
+ narrowMax(agg, "maximum", maximum);
3998
+ };
3999
+ const contributors = {
4000
+ greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
4001
+ less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
4002
+ multiple_of: (agg, def) => addDivisor(agg, def.value),
4003
+ number_format: formatContributor(NUMBER_FORMAT_RANGES),
4004
+ bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
4005
+ min_length: minContributor,
4006
+ max_length: maxContributor,
4007
+ length_equals: (agg, def) => narrowBoth(agg, def.length),
4008
+ min_size: minContributor,
4009
+ max_size: maxContributor,
4010
+ size_equals: (agg, def) => narrowBoth(agg, def.size),
4011
+ string_format: (agg, def) => {
4012
+ setFormat(agg, def.format);
4013
+ if (def.pattern) addPattern(agg, def.pattern);
4014
+ if (def.format === "base64" || def.format === "base64url") agg.contentEncoding = def.format;
4015
+ if (def.local || def.precision === -1) agg.laxFormat = true;
4016
+ },
4017
+ mime_type: (agg, def) => intersectMime(agg, def.mime)
4018
+ };
4019
+ function aggregateChecks(schema) {
4020
+ const agg = {};
4021
+ const def = schema._zod.def;
4022
+ const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
4023
+ for (const ch of list) contributors[ch._zod.def.check]?.(agg, ch._zod.def);
4024
+ const bag = schema._zod.bag;
4025
+ if (bag.minimum !== void 0) narrowMin(agg, "minimum", bag.minimum);
4026
+ if (bag.exclusiveMinimum !== void 0) narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
4027
+ if (bag.maximum !== void 0) narrowMax(agg, "maximum", bag.maximum);
4028
+ if (bag.exclusiveMaximum !== void 0) narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
4029
+ if (bag.multipleOf !== void 0) addDivisor(agg, bag.multipleOf);
4030
+ if (bag.format !== void 0) {
4031
+ agg.format ?? (agg.format = bag.format);
4032
+ if (bag.format.includes("int")) agg.isInt = true;
4033
+ }
4034
+ if (bag.mime) intersectMime(agg, bag.mime);
4035
+ for (const pattern of bag.patterns ?? []) addPattern(agg, pattern);
4036
+ return agg;
4037
+ }
2990
4038
  const formatMap = {
2991
4039
  guid: "uuid",
2992
4040
  url: "uri",
@@ -2994,32 +4042,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2994
4042
  json_string: "json-string",
2995
4043
  regex: ""
2996
4044
  };
4045
+ const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
4046
+ const exactPattern = (p) => exactPatterns.get(p) ?? p;
2997
4047
  const stringProcessor = (schema, ctx, _json, _params) => {
2998
4048
  const json = _json;
2999
4049
  json.type = "string";
3000
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
4050
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
3001
4051
  if (typeof minimum === "number") json.minLength = minimum;
3002
4052
  if (typeof maximum === "number") json.maxLength = maximum;
3003
4053
  if (format) {
3004
4054
  json.format = formatMap[format] ?? format;
3005
4055
  if (json.format === "") delete json.format;
3006
- if (format === "time") delete json.format;
4056
+ if (format === "time" || laxFormat) delete json.format;
3007
4057
  }
3008
4058
  if (contentEncoding) json.contentEncoding = contentEncoding;
3009
4059
  if (patterns && patterns.size > 0) {
3010
- const regexes = [...patterns];
3011
- if (regexes.length === 1) json.pattern = regexes[0].source;
3012
- else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
4060
+ const patternList = [...patterns].map(exactPattern);
4061
+ if (patternList.length === 1) json.pattern = patternList[0].source;
4062
+ else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
3013
4063
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
3014
4064
  pattern: regex.source
3015
4065
  }))];
3016
4066
  }
3017
4067
  };
3018
- const numberProcessor = (schema, ctx, _json, _params) => {
4068
+ const numberProcessor = (schema, ctx, _json, params) => {
3019
4069
  const json = _json;
3020
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
3021
- if (typeof format === "string" && format.includes("int")) json.type = "integer";
3022
- else json.type = "number";
4070
+ const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
4071
+ json.type = isInt ? "integer" : "number";
3023
4072
  const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
3024
4073
  const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
3025
4074
  const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
@@ -3035,7 +4084,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3035
4084
  json.exclusiveMaximum = true;
3036
4085
  } else json.exclusiveMaximum = exclusiveMaximum;
3037
4086
  } else if (typeof maximum === "number") json.maximum = maximum;
3038
- if (typeof multipleOf === "number") json.multipleOf = multipleOf;
4087
+ if (multipleOf) {
4088
+ const divisors = /* @__PURE__ */ new Set();
4089
+ for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
4090
+ else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
4091
+ const [first, ...rest] = divisors;
4092
+ if (first !== void 0) json.multipleOf = first;
4093
+ if (rest.length) json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
4094
+ }
3039
4095
  };
3040
4096
  const booleanProcessor = (_schema, _ctx, json, _params) => {
3041
4097
  json.type = "boolean";
@@ -3046,18 +4102,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3046
4102
  const enumProcessor = (schema, _ctx, json, _params) => {
3047
4103
  const def = schema._zod.def;
3048
4104
  const values = getEnumValues(def.entries);
4105
+ if (values.length === 0) {
4106
+ json.not = {};
4107
+ return;
4108
+ }
3049
4109
  if (values.every((v) => typeof v === "number")) json.type = "number";
3050
4110
  if (values.every((v) => typeof v === "string")) json.type = "string";
3051
4111
  json.enum = values;
3052
4112
  };
3053
- const literalProcessor = (schema, ctx, json, _params) => {
4113
+ const literalProcessor = (schema, ctx, json, params) => {
3054
4114
  const def = schema._zod.def;
4115
+ if (def.values.length === 0) {
4116
+ json.not = {};
4117
+ return;
4118
+ }
3055
4119
  const vals = [];
3056
4120
  for (const val of def.values) if (val === void 0) {
3057
- if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
4121
+ if (handleUnrepresentable(schema, ctx, json, params, "Literal `undefined` cannot be represented in JSON Schema")) return;
3058
4122
  } else if (typeof val === "bigint") {
3059
- if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
3060
- else vals.push(Number(val));
4123
+ if (handleUnrepresentable(schema, ctx, json, params, "BigInt literals cannot be represented in JSON Schema")) return;
4124
+ vals.push(Number(val));
3061
4125
  } else vals.push(val);
3062
4126
  if (vals.length === 0) {} else if (vals.length === 1) {
3063
4127
  const val = vals[0];
@@ -3072,49 +4136,55 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3072
4136
  json.enum = vals;
3073
4137
  }
3074
4138
  };
3075
- const customProcessor = (_schema, ctx, _json, _params) => {
3076
- if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
4139
+ const customProcessor = (schema, ctx, json, params) => {
4140
+ handleUnrepresentable(schema, ctx, json, params, "Custom types cannot be represented in JSON Schema");
3077
4141
  };
3078
- const transformProcessor = (_schema, ctx, _json, _params) => {
3079
- if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
4142
+ const transformProcessor = (schema, ctx, json, params) => {
4143
+ handleUnrepresentable(schema, ctx, json, params, "Transforms cannot be represented in JSON Schema");
3080
4144
  };
3081
4145
  const arrayProcessor = (schema, ctx, _json, params) => {
3082
4146
  const json = _json;
3083
4147
  const def = schema._zod.def;
3084
- const { minimum, maximum } = schema._zod.bag;
4148
+ const { minimum, maximum } = aggregateChecks(schema);
3085
4149
  if (typeof minimum === "number") json.minItems = minimum;
3086
4150
  if (typeof maximum === "number") json.maxItems = maximum;
3087
4151
  json.type = "array";
3088
- json.items = process(def.element, ctx, {
4152
+ json.items = processSchema(def.element, ctx, {
3089
4153
  ...params,
3090
4154
  path: [...params.path, "items"]
3091
4155
  });
3092
4156
  };
4157
+ function inputOptin(schema) {
4158
+ const def = schema._zod.def;
4159
+ if (def.type === "pipe" && def.in._zod.traits.has("$ZodTransform")) return inputOptin(def.out);
4160
+ if (def.type === "catch") return inputOptin(def.innerType);
4161
+ return schema._zod.optin;
4162
+ }
3093
4163
  const objectProcessor = (schema, ctx, _json, params) => {
3094
4164
  const json = _json;
3095
4165
  const def = schema._zod.def;
4166
+ const shape = def.shape;
4167
+ if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
3096
4168
  json.type = "object";
3097
4169
  json.properties = {};
3098
- const shape = def.shape;
3099
- for (const key in shape) json.properties[key] = process(shape[key], ctx, {
4170
+ for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
3100
4171
  ...params,
3101
4172
  path: [
3102
4173
  ...params.path,
3103
4174
  "properties",
3104
4175
  key
3105
4176
  ]
3106
- });
3107
- const allKeys = new Set(Object.keys(shape));
3108
- const requiredKeys = new Set([...allKeys].filter((key) => {
3109
- const v = def.shape[key]._zod;
3110
- if (ctx.io === "input") return v.optin === void 0;
3111
- else return v.optout === void 0;
3112
4177
  }));
3113
- if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
4178
+ const requiredKeys = [];
4179
+ for (const key of Object.keys(shape)) {
4180
+ const field = def.shape[key];
4181
+ if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) requiredKeys.push(key);
4182
+ }
4183
+ if (requiredKeys.length > 0) json.required = requiredKeys;
3114
4184
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
3115
4185
  else if (!def.catchall) {
3116
4186
  if (ctx.io === "output") json.additionalProperties = false;
3117
- } else if (def.catchall) json.additionalProperties = process(def.catchall, ctx, {
4187
+ } else if (def.catchall) json.additionalProperties = processSchema(def.catchall, ctx, {
3118
4188
  ...params,
3119
4189
  path: [...params.path, "additionalProperties"]
3120
4190
  });
@@ -3122,7 +4192,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3122
4192
  const unionProcessor = (schema, ctx, json, params) => {
3123
4193
  const def = schema._zod.def;
3124
4194
  const isExclusive = def.inclusive === false;
3125
- const options = def.options.map((x, i) => process(x, ctx, {
4195
+ const options = def.options.map((x, i) => processSchema(x, ctx, {
3126
4196
  ...params,
3127
4197
  path: [
3128
4198
  ...params.path,
@@ -3135,7 +4205,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3135
4205
  };
3136
4206
  const intersectionProcessor = (schema, ctx, json, params) => {
3137
4207
  const def = schema._zod.def;
3138
- const a = process(def.left, ctx, {
4208
+ const a = processSchema(def.left, ctx, {
3139
4209
  ...params,
3140
4210
  path: [
3141
4211
  ...params.path,
@@ -3143,7 +4213,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3143
4213
  0
3144
4214
  ]
3145
4215
  });
3146
- const b = process(def.right, ctx, {
4216
+ const b = processSchema(def.right, ctx, {
3147
4217
  ...params,
3148
4218
  path: [
3149
4219
  ...params.path,
@@ -3152,11 +4222,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3152
4222
  ]
3153
4223
  });
3154
4224
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3155
- json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
4225
+ const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
4226
+ json.allOf = allOf;
4227
+ ctx.intersections.push(allOf);
3156
4228
  };
3157
4229
  const nullableProcessor = (schema, ctx, json, params) => {
3158
4230
  const def = schema._zod.def;
3159
- const inner = process(def.innerType, ctx, params);
4231
+ const inner = processSchema(def.innerType, ctx, params);
3160
4232
  const seen = ctx.seen.get(schema);
3161
4233
  if (ctx.target === "openapi-3.0") {
3162
4234
  seen.ref = def.innerType;
@@ -3165,34 +4237,53 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3165
4237
  };
3166
4238
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
3167
4239
  const def = schema._zod.def;
3168
- process(def.innerType, ctx, params);
4240
+ processSchema(def.innerType, ctx, params);
3169
4241
  const seen = ctx.seen.get(schema);
3170
4242
  seen.ref = def.innerType;
3171
4243
  };
4244
+ /** Round-trips a default value through JSON so the emitted schema is guaranteed to be valid JSON.
4245
+ * A BigInt has no reliable encoding, so it goes through `unrepresentable` like any other
4246
+ * unrepresentable value. Returns a sentinel when the caller must not write a default of its own. */
4247
+ const UNREPRESENTABLE_DEFAULT = Symbol();
4248
+ function serializeDefaultValue(value, schema, ctx, json, params) {
4249
+ let unrepresentable = false;
4250
+ const serialized = JSON.stringify(value, (_, val) => {
4251
+ if (typeof val !== "bigint") return val;
4252
+ unrepresentable = true;
4253
+ return null;
4254
+ });
4255
+ if (!unrepresentable) return JSON.parse(serialized);
4256
+ handleUnrepresentable(schema, ctx, json, params, "BigInt defaults cannot be represented in JSON Schema");
4257
+ return UNREPRESENTABLE_DEFAULT;
4258
+ }
3172
4259
  const defaultProcessor = (schema, ctx, json, params) => {
3173
4260
  const def = schema._zod.def;
3174
- process(def.innerType, ctx, params);
4261
+ processSchema(def.innerType, ctx, params);
3175
4262
  const seen = ctx.seen.get(schema);
3176
4263
  seen.ref = def.innerType;
3177
- json.default = JSON.parse(JSON.stringify(def.defaultValue));
4264
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
4265
+ if (value !== UNREPRESENTABLE_DEFAULT) json.default = value;
3178
4266
  };
3179
4267
  const prefaultProcessor = (schema, ctx, json, params) => {
3180
4268
  const def = schema._zod.def;
3181
- process(def.innerType, ctx, params);
4269
+ processSchema(def.innerType, ctx, params);
3182
4270
  const seen = ctx.seen.get(schema);
3183
4271
  seen.ref = def.innerType;
3184
- if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
4272
+ if (ctx.io !== "input") return;
4273
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
4274
+ if (value !== UNREPRESENTABLE_DEFAULT) json._prefault = value;
3185
4275
  };
3186
4276
  const catchProcessor = (schema, ctx, json, params) => {
3187
4277
  const def = schema._zod.def;
3188
- process(def.innerType, ctx, params);
4278
+ processSchema(def.innerType, ctx, params);
3189
4279
  const seen = ctx.seen.get(schema);
3190
4280
  seen.ref = def.innerType;
3191
4281
  let catchValue;
3192
4282
  try {
3193
4283
  catchValue = def.catchValue(void 0);
3194
4284
  } catch {
3195
- throw new Error("Dynamic catch values are not supported in JSON Schema");
4285
+ handleUnrepresentable(schema, ctx, json, params, "Dynamic catch values are not supported in JSON Schema");
4286
+ return;
3196
4287
  }
3197
4288
  json.default = catchValue;
3198
4289
  };
@@ -3200,77 +4291,75 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3200
4291
  const def = schema._zod.def;
3201
4292
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
3202
4293
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
3203
- process(innerType, ctx, params);
4294
+ processSchema(innerType, ctx, params);
3204
4295
  const seen = ctx.seen.get(schema);
3205
4296
  seen.ref = innerType;
3206
4297
  };
3207
4298
  const readonlyProcessor = (schema, ctx, json, params) => {
3208
4299
  const def = schema._zod.def;
3209
- process(def.innerType, ctx, params);
4300
+ processSchema(def.innerType, ctx, params);
3210
4301
  const seen = ctx.seen.get(schema);
3211
4302
  seen.ref = def.innerType;
3212
4303
  json.readOnly = true;
3213
4304
  };
3214
4305
  const optionalProcessor = (schema, ctx, _json, params) => {
3215
4306
  const def = schema._zod.def;
3216
- process(def.innerType, ctx, params);
4307
+ processSchema(def.innerType, ctx, params);
3217
4308
  const seen = ctx.seen.get(schema);
3218
4309
  seen.ref = def.innerType;
3219
4310
  };
3220
4311
  //#endregion
3221
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
3222
- const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
3223
- $ZodISODateTime.init(inst, def);
3224
- ZodStringFormat.init(inst, def);
3225
- });
3226
- function datetime(params) {
3227
- return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
3228
- }
3229
- const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
3230
- $ZodISODate.init(inst, def);
3231
- ZodStringFormat.init(inst, def);
3232
- });
3233
- function date(params) {
3234
- return /* @__PURE__ */ _isoDate(ZodISODate, params);
3235
- }
3236
- const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
3237
- $ZodISOTime.init(inst, def);
3238
- ZodStringFormat.init(inst, def);
3239
- });
3240
- function time(params) {
3241
- return /* @__PURE__ */ _isoTime(ZodISOTime, params);
3242
- }
3243
- const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
3244
- $ZodISODuration.init(inst, def);
3245
- ZodStringFormat.init(inst, def);
3246
- });
3247
- function duration(params) {
3248
- return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
4312
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
4313
+ const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4314
+ function _lazyMethod(proto, key, make) {
4315
+ Object.defineProperty(proto, key, {
4316
+ configurable: true,
4317
+ enumerable: false,
4318
+ get() {
4319
+ const value = make(this);
4320
+ Object.defineProperty(this, key, {
4321
+ value,
4322
+ configurable: true,
4323
+ writable: true
4324
+ });
4325
+ return value;
4326
+ },
4327
+ set(value) {
4328
+ Object.defineProperty(this, key, {
4329
+ value,
4330
+ configurable: true,
4331
+ writable: true
4332
+ });
4333
+ }
4334
+ });
3249
4335
  }
3250
- //#endregion
3251
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
3252
4336
  const initializer = (inst, issues) => {
3253
4337
  $ZodError.init(inst, issues);
3254
4338
  inst.name = "ZodError";
3255
- Object.defineProperties(inst, {
3256
- format: { value: (mapper) => formatError(inst, mapper) },
3257
- flatten: { value: (mapper) => flattenError(inst, mapper) },
3258
- addIssue: { value: (issue) => {
3259
- inst.issues.push(issue);
3260
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3261
- } },
3262
- addIssues: { value: (issues) => {
3263
- inst.issues.push(...issues);
3264
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3265
- } },
3266
- isEmpty: { get() {
3267
- return inst.issues.length === 0;
3268
- } }
4339
+ const proto = Object.getPrototypeOf(inst);
4340
+ if (_installedErrorProtos.has(proto)) return;
4341
+ _installedErrorProtos.add(proto);
4342
+ _lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
4343
+ _lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
4344
+ _lazyMethod(proto, "addIssue", (self) => (issue) => {
4345
+ self.issues.push(issue);
4346
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
4347
+ });
4348
+ _lazyMethod(proto, "addIssues", (self) => (issues) => {
4349
+ self.issues.push(...issues);
4350
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
4351
+ });
4352
+ Object.defineProperty(proto, "isEmpty", {
4353
+ configurable: true,
4354
+ enumerable: false,
4355
+ get() {
4356
+ return this.issues.length === 0;
4357
+ }
3269
4358
  });
3270
4359
  };
3271
- const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
4360
+ const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
3272
4361
  //#endregion
3273
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
4362
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
3274
4363
  const parse = /* @__PURE__ */ _parse(ZodRealError);
3275
4364
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3276
4365
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -3284,255 +4373,320 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3284
4373
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3285
4374
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3286
4375
  //#endregion
3287
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
3288
- const _installedGroups = /* @__PURE__ */ new WeakMap();
3289
- function _installLazyMethods(inst, group, methods) {
3290
- const proto = Object.getPrototypeOf(inst);
3291
- let installed = _installedGroups.get(proto);
3292
- if (!installed) {
3293
- installed = /* @__PURE__ */ new Set();
3294
- _installedGroups.set(proto, installed);
3295
- }
3296
- if (installed.has(group)) return;
3297
- installed.add(group);
3298
- for (const key in methods) {
3299
- const fn = methods[key];
3300
- Object.defineProperty(proto, key, {
3301
- configurable: true,
3302
- enumerable: false,
3303
- get() {
3304
- const bound = fn.bind(this);
3305
- Object.defineProperty(this, key, {
3306
- configurable: true,
3307
- writable: true,
3308
- enumerable: true,
3309
- value: bound
3310
- });
3311
- return bound;
3312
- },
3313
- set(v) {
3314
- Object.defineProperty(this, key, {
3315
- configurable: true,
3316
- writable: true,
3317
- enumerable: true,
3318
- value: v
3319
- });
3320
- }
3321
- });
3322
- }
4376
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
4377
+ function _ensureDefaultLocale() {
4378
+ if (!globalConfig.localeError) config(en_default());
4379
+ }
4380
+ function _ensureDefaultMemoizer() {
4381
+ if (!globalConfig.memoizer) config({ memoizer: memoizer() });
3323
4382
  }
3324
4383
  const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
4384
+ _ensureDefaultLocale();
3325
4385
  $ZodType.init(inst, def);
3326
- Object.assign(inst["~standard"], { jsonSchema: {
3327
- input: createStandardJSONSchemaMethod(inst, "input"),
3328
- output: createStandardJSONSchemaMethod(inst, "output")
3329
- } });
3330
- inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
3331
4386
  inst.def = def;
3332
4387
  inst.type = def.type;
3333
- Object.defineProperty(inst, "_def", { value: def });
3334
- inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
3335
- inst.safeParse = (data, params) => safeParse(inst, data, params);
3336
- inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
3337
- inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
3338
- inst.spa = inst.safeParseAsync;
3339
- inst.encode = (data, params) => encode(inst, data, params);
3340
- inst.decode = (data, params) => decode(inst, data, params);
3341
- inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
3342
- inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
3343
- inst.safeEncode = (data, params) => safeEncode(inst, data, params);
3344
- inst.safeDecode = (data, params) => safeDecode(inst, data, params);
3345
- inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
3346
- inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
3347
- _installLazyMethods(inst, "ZodType", {
3348
- check(...chks) {
3349
- const def = this.def;
3350
- return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
3351
- check: ch,
3352
- def: { check: "custom" },
3353
- onattach: []
3354
- } } : ch)] }), { parent: true });
3355
- },
3356
- with(...chks) {
3357
- return this.check(...chks);
3358
- },
3359
- clone(def, params) {
3360
- return clone(this, def, params);
3361
- },
3362
- brand() {
3363
- return this;
3364
- },
3365
- register(reg, meta) {
3366
- reg.add(this, meta);
3367
- return this;
3368
- },
3369
- refine(check, params) {
3370
- return this.check(refine(check, params));
3371
- },
3372
- superRefine(refinement, params) {
3373
- return this.check(superRefine(refinement, params));
3374
- },
3375
- overwrite(fn) {
3376
- return this.check(/* @__PURE__ */ _overwrite(fn));
3377
- },
3378
- optional() {
3379
- return optional(this);
3380
- },
3381
- exactOptional() {
3382
- return exactOptional(this);
3383
- },
3384
- nullable() {
3385
- return nullable(this);
3386
- },
3387
- nullish() {
3388
- return optional(nullable(this));
3389
- },
3390
- nonoptional(params) {
3391
- return nonoptional(this, params);
3392
- },
3393
- array() {
3394
- return array(this);
3395
- },
3396
- or(arg) {
3397
- return union([this, arg]);
3398
- },
3399
- and(arg) {
3400
- return intersection(this, arg);
3401
- },
3402
- transform(tx) {
3403
- return pipe(this, transform(tx));
3404
- },
3405
- default(d) {
3406
- return _default(this, d);
3407
- },
3408
- prefault(d) {
3409
- return prefault(this, d);
3410
- },
3411
- catch(params) {
3412
- return _catch(this, params);
3413
- },
3414
- pipe(target) {
3415
- return pipe(this, target);
3416
- },
3417
- readonly() {
3418
- return readonly(this);
3419
- },
3420
- describe(description) {
3421
- const cl = this.clone();
3422
- globalRegistry.add(cl, { description });
3423
- return cl;
3424
- },
3425
- meta(...args) {
3426
- if (args.length === 0) return globalRegistry.get(this);
3427
- const cl = this.clone();
3428
- globalRegistry.add(cl, args[0]);
3429
- return cl;
3430
- },
3431
- isOptional() {
3432
- return this.safeParse(void 0).success;
3433
- },
3434
- isNullable() {
3435
- return this.safeParse(null).success;
3436
- },
3437
- apply(fn) {
3438
- return fn(this);
3439
- }
3440
- });
3441
- Object.defineProperty(inst, "description", {
3442
- get() {
3443
- return globalRegistry.get(inst)?.description;
3444
- },
3445
- configurable: true
3446
- });
3447
4388
  return inst;
4389
+ }, {
4390
+ check(...chks) {
4391
+ const def = this.def;
4392
+ return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
4393
+ check: ch,
4394
+ def: { check: "custom" },
4395
+ onattach: []
4396
+ } } : ch)] }), { parent: true });
4397
+ },
4398
+ with(...chks) {
4399
+ return this.check(...chks);
4400
+ },
4401
+ clone(def, params) {
4402
+ return clone(this, def, params);
4403
+ },
4404
+ brand() {
4405
+ return this;
4406
+ },
4407
+ register(reg, meta) {
4408
+ reg.add(this, meta);
4409
+ return this;
4410
+ },
4411
+ refine(check, params) {
4412
+ return this.check(refine(check, params));
4413
+ },
4414
+ superRefine(refinement, params) {
4415
+ return this.check(superRefine(refinement, params));
4416
+ },
4417
+ overwrite(fn) {
4418
+ return this.check(/* @__PURE__ */ _overwrite(fn));
4419
+ },
4420
+ optional() {
4421
+ return optional(this);
4422
+ },
4423
+ exactOptional() {
4424
+ return exactOptional(this);
4425
+ },
4426
+ nullable() {
4427
+ return nullable(this);
4428
+ },
4429
+ nullish() {
4430
+ return optional(nullable(this));
4431
+ },
4432
+ nonoptional(params) {
4433
+ return nonoptional(this, params);
4434
+ },
4435
+ array() {
4436
+ return array(this);
4437
+ },
4438
+ or(arg) {
4439
+ return union([this, arg]);
4440
+ },
4441
+ and(arg) {
4442
+ return intersection(this, arg);
4443
+ },
4444
+ transform(tx) {
4445
+ return pipe(this, transform(tx));
4446
+ },
4447
+ default(d) {
4448
+ return _default(this, d);
4449
+ },
4450
+ prefault(d) {
4451
+ return prefault(this, d);
4452
+ },
4453
+ catch(params) {
4454
+ return _catch(this, params);
4455
+ },
4456
+ pipe(target) {
4457
+ return pipe(this, target);
4458
+ },
4459
+ readonly() {
4460
+ return readonly(this);
4461
+ },
4462
+ describe(description) {
4463
+ const cl = this.clone();
4464
+ globalRegistry.add(cl, { description });
4465
+ return cl;
4466
+ },
4467
+ meta(...args) {
4468
+ if (args.length === 0) return globalRegistry.get(this);
4469
+ const cl = this.clone();
4470
+ globalRegistry.add(cl, args[0]);
4471
+ return cl;
4472
+ },
4473
+ isOptional() {
4474
+ return this.safeParse(void 0).success;
4475
+ },
4476
+ isNullable() {
4477
+ return this.safeParse(null).success;
4478
+ },
4479
+ apply(fn, ...args) {
4480
+ return args.length === 0 ? fn(this) : fn(this, ...args);
4481
+ },
4482
+ get "~standard"() {
4483
+ return hide(this, "~standard", {
4484
+ ...standardProps(this),
4485
+ jsonSchema: {
4486
+ input: createStandardJSONSchemaMethod(this, "input"),
4487
+ output: createStandardJSONSchemaMethod(this, "output")
4488
+ }
4489
+ });
4490
+ },
4491
+ set "~standard"(value) {
4492
+ own(this, "~standard", value);
4493
+ },
4494
+ parse: function _parse(data, params) {
4495
+ return parse(this, data, params, { callee: _parse });
4496
+ },
4497
+ parseAsync: async function _parseAsync(data, params) {
4498
+ return await parseAsync(this, data, params, { callee: _parseAsync });
4499
+ },
4500
+ safeParse(data, params) {
4501
+ return safeParse(this, data, params);
4502
+ },
4503
+ async safeParseAsync(data, params) {
4504
+ return safeParseAsync(this, data, params);
4505
+ },
4506
+ get spa() {
4507
+ return this?.safeParseAsync;
4508
+ },
4509
+ set spa(value) {
4510
+ own(this, "spa", value);
4511
+ },
4512
+ validate(data, params) {
4513
+ return validate(this, data, params);
4514
+ },
4515
+ validateAsync(data, params) {
4516
+ return validateAsync$1(this, data, params);
4517
+ },
4518
+ encode: function _encode(data, params) {
4519
+ return encode(this, data, params, { callee: _encode });
4520
+ },
4521
+ decode: function _decode(data, params) {
4522
+ return decode(this, data, params, { callee: _decode });
4523
+ },
4524
+ encodeAsync: async function _encodeAsync(data, params) {
4525
+ return await encodeAsync(this, data, params, { callee: _encodeAsync });
4526
+ },
4527
+ decodeAsync: async function _decodeAsync(data, params) {
4528
+ return await decodeAsync(this, data, params, { callee: _decodeAsync });
4529
+ },
4530
+ safeEncode(data, params) {
4531
+ return safeEncode(this, data, params);
4532
+ },
4533
+ safeDecode(data, params) {
4534
+ return safeDecode(this, data, params);
4535
+ },
4536
+ async safeEncodeAsync(data, params) {
4537
+ return safeEncodeAsync(this, data, params);
4538
+ },
4539
+ async safeDecodeAsync(data, params) {
4540
+ return safeDecodeAsync(this, data, params);
4541
+ },
4542
+ toJSONSchema(params) {
4543
+ return createToJSONSchemaMethod(this, {})(params);
4544
+ },
4545
+ get description() {
4546
+ return globalRegistry.get(this)?.description;
4547
+ },
4548
+ get _def() {
4549
+ return this._zod.def;
4550
+ }
3448
4551
  });
3449
4552
  /** @internal */
3450
4553
  const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
3451
4554
  $ZodString.init(inst, def);
3452
4555
  ZodType.init(inst, def);
3453
4556
  inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
3454
- const bag = inst._zod.bag;
3455
- inst.format = bag.format ?? null;
3456
- inst.minLength = bag.minimum ?? null;
3457
- inst.maxLength = bag.maximum ?? null;
3458
- _installLazyMethods(inst, "_ZodString", {
3459
- regex(...args) {
3460
- return this.check(/* @__PURE__ */ _regex(...args));
3461
- },
3462
- includes(...args) {
3463
- return this.check(/* @__PURE__ */ _includes(...args));
3464
- },
3465
- startsWith(...args) {
3466
- return this.check(/* @__PURE__ */ _startsWith(...args));
3467
- },
3468
- endsWith(...args) {
3469
- return this.check(/* @__PURE__ */ _endsWith(...args));
3470
- },
3471
- min(...args) {
3472
- return this.check(/* @__PURE__ */ _minLength(...args));
3473
- },
3474
- max(...args) {
3475
- return this.check(/* @__PURE__ */ _maxLength(...args));
3476
- },
3477
- length(...args) {
3478
- return this.check(/* @__PURE__ */ _length(...args));
3479
- },
3480
- nonempty(...args) {
3481
- return this.check(/* @__PURE__ */ _minLength(1, ...args));
3482
- },
3483
- lowercase(params) {
3484
- return this.check(/* @__PURE__ */ _lowercase(params));
3485
- },
3486
- uppercase(params) {
3487
- return this.check(/* @__PURE__ */ _uppercase(params));
3488
- },
3489
- trim() {
3490
- return this.check(/* @__PURE__ */ _trim());
3491
- },
3492
- normalize(...args) {
3493
- return this.check(/* @__PURE__ */ _normalize(...args));
3494
- },
3495
- toLowerCase() {
3496
- return this.check(/* @__PURE__ */ _toLowerCase());
3497
- },
3498
- toUpperCase() {
3499
- return this.check(/* @__PURE__ */ _toUpperCase());
3500
- },
3501
- slugify() {
3502
- return this.check(/* @__PURE__ */ _slugify());
3503
- }
3504
- });
3505
- });
4557
+ }, /*@__PURE__*/ derived({
4558
+ format: (inst) => aggregateChecks(inst).format ?? null,
4559
+ minLength: (inst) => aggregateChecks(inst).minimum ?? null,
4560
+ maxLength: (inst) => aggregateChecks(inst).maximum ?? null
4561
+ }, {
4562
+ regex(...args) {
4563
+ return this.check(/* @__PURE__ */ _regex(...args));
4564
+ },
4565
+ includes(...args) {
4566
+ return this.check(/* @__PURE__ */ _includes(...args));
4567
+ },
4568
+ startsWith(...args) {
4569
+ return this.check(/* @__PURE__ */ _startsWith(...args));
4570
+ },
4571
+ endsWith(...args) {
4572
+ return this.check(/* @__PURE__ */ _endsWith(...args));
4573
+ },
4574
+ min(...args) {
4575
+ return this.check(/* @__PURE__ */ _minLength(...args));
4576
+ },
4577
+ max(...args) {
4578
+ return this.check(/* @__PURE__ */ _maxLength(...args));
4579
+ },
4580
+ length(...args) {
4581
+ return this.check(/* @__PURE__ */ _length(...args));
4582
+ },
4583
+ nonempty(...args) {
4584
+ return this.check(/* @__PURE__ */ _minLength(1, ...args));
4585
+ },
4586
+ lowercase(params) {
4587
+ return this.check(/* @__PURE__ */ _lowercase(params));
4588
+ },
4589
+ uppercase(params) {
4590
+ return this.check(/* @__PURE__ */ _uppercase(params));
4591
+ },
4592
+ trim() {
4593
+ return this.check(/* @__PURE__ */ _trim());
4594
+ },
4595
+ normalize(...args) {
4596
+ return this.check(/* @__PURE__ */ _normalize(...args));
4597
+ },
4598
+ toLowerCase() {
4599
+ return this.check(/* @__PURE__ */ _toLowerCase());
4600
+ },
4601
+ toUpperCase() {
4602
+ return this.check(/* @__PURE__ */ _toUpperCase());
4603
+ },
4604
+ slugify() {
4605
+ return this.check(/* @__PURE__ */ _slugify());
4606
+ }
4607
+ }));
3506
4608
  const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
3507
4609
  $ZodString.init(inst, def);
3508
4610
  _ZodString.init(inst, def);
3509
- inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
3510
- inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
3511
- inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
3512
- inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
3513
- inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3514
- inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
3515
- inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
3516
- inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
3517
- inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
3518
- inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
3519
- inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3520
- inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
3521
- inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
3522
- inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
3523
- inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
3524
- inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
3525
- inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
3526
- inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
3527
- inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
3528
- inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
3529
- inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
3530
- inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
3531
- inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
3532
- inst.datetime = (params) => inst.check(datetime(params));
3533
- inst.date = (params) => inst.check(date(params));
3534
- inst.time = (params) => inst.check(time(params));
3535
- inst.duration = (params) => inst.check(duration(params));
4611
+ }, {
4612
+ email(params) {
4613
+ return this.check(/* @__PURE__ */ _email(ZodEmail, params));
4614
+ },
4615
+ url(params) {
4616
+ return this.check(/* @__PURE__ */ _url(ZodURL, params));
4617
+ },
4618
+ jwt(params) {
4619
+ return this.check(/* @__PURE__ */ _jwt(ZodJWT, params));
4620
+ },
4621
+ emoji(params) {
4622
+ return this.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
4623
+ },
4624
+ guid(params) {
4625
+ return this.check(/* @__PURE__ */ _guid(ZodGUID, params));
4626
+ },
4627
+ uuid(params) {
4628
+ return this.check(/* @__PURE__ */ _uuid(ZodUUID, params));
4629
+ },
4630
+ uuidv4(params) {
4631
+ return this.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
4632
+ },
4633
+ uuidv6(params) {
4634
+ return this.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
4635
+ },
4636
+ uuidv7(params) {
4637
+ return this.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
4638
+ },
4639
+ nanoid(params) {
4640
+ return this.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
4641
+ },
4642
+ cuid(params) {
4643
+ return this.check(/* @__PURE__ */ _cuid(ZodCUID, params));
4644
+ },
4645
+ cuid2(params) {
4646
+ return this.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
4647
+ },
4648
+ ulid(params) {
4649
+ return this.check(/* @__PURE__ */ _ulid(ZodULID, params));
4650
+ },
4651
+ base64(params) {
4652
+ return this.check(/* @__PURE__ */ _base64(ZodBase64, params));
4653
+ },
4654
+ base64url(params) {
4655
+ return this.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
4656
+ },
4657
+ xid(params) {
4658
+ return this.check(/* @__PURE__ */ _xid(ZodXID, params));
4659
+ },
4660
+ ksuid(params) {
4661
+ return this.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
4662
+ },
4663
+ ipv4(params) {
4664
+ return this.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
4665
+ },
4666
+ ipv6(params) {
4667
+ return this.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
4668
+ },
4669
+ cidrv4(params) {
4670
+ return this.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
4671
+ },
4672
+ cidrv6(params) {
4673
+ return this.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
4674
+ },
4675
+ e164(params) {
4676
+ return this.check(/* @__PURE__ */ _e164(ZodE164, params));
4677
+ },
4678
+ datetime(params) {
4679
+ return this.check(/* @__PURE__ */ _isoDateTime(ZodISODateTime, params));
4680
+ },
4681
+ date(params) {
4682
+ return this.check(/* @__PURE__ */ _isoDate(ZodISODate, params));
4683
+ },
4684
+ time(params) {
4685
+ return this.check(/* @__PURE__ */ _isoTime(ZodISOTime, params));
4686
+ },
4687
+ duration(params) {
4688
+ return this.check(/* @__PURE__ */ _isoDuration(ZodISODuration, params));
4689
+ }
3536
4690
  });
3537
4691
  function string(params) {
3538
4692
  return /* @__PURE__ */ _string(ZodString, params);
@@ -3541,6 +4695,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3541
4695
  $ZodStringFormat.init(inst, def);
3542
4696
  _ZodString.init(inst, def);
3543
4697
  });
4698
+ const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
4699
+ $ZodISODateTime.init(inst, def);
4700
+ ZodStringFormat.init(inst, def);
4701
+ });
4702
+ const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
4703
+ $ZodISODate.init(inst, def);
4704
+ ZodStringFormat.init(inst, def);
4705
+ });
4706
+ const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
4707
+ $ZodISOTime.init(inst, def);
4708
+ ZodStringFormat.init(inst, def);
4709
+ });
4710
+ const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
4711
+ $ZodISODuration.init(inst, def);
4712
+ ZodStringFormat.init(inst, def);
4713
+ });
3544
4714
  const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
3545
4715
  $ZodEmail.init(inst, def);
3546
4716
  ZodStringFormat.init(inst, def);
@@ -3626,60 +4796,68 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3626
4796
  $ZodNumber.init(inst, def);
3627
4797
  ZodType.init(inst, def);
3628
4798
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
3629
- _installLazyMethods(inst, "ZodNumber", {
3630
- gt(value, params) {
3631
- return this.check(/* @__PURE__ */ _gt(value, params));
3632
- },
3633
- gte(value, params) {
3634
- return this.check(/* @__PURE__ */ _gte(value, params));
3635
- },
3636
- min(value, params) {
3637
- return this.check(/* @__PURE__ */ _gte(value, params));
3638
- },
3639
- lt(value, params) {
3640
- return this.check(/* @__PURE__ */ _lt(value, params));
3641
- },
3642
- lte(value, params) {
3643
- return this.check(/* @__PURE__ */ _lte(value, params));
3644
- },
3645
- max(value, params) {
3646
- return this.check(/* @__PURE__ */ _lte(value, params));
3647
- },
3648
- int(params) {
3649
- return this.check(int(params));
3650
- },
3651
- safe(params) {
3652
- return this.check(int(params));
3653
- },
3654
- positive(params) {
3655
- return this.check(/* @__PURE__ */ _gt(0, params));
3656
- },
3657
- nonnegative(params) {
3658
- return this.check(/* @__PURE__ */ _gte(0, params));
3659
- },
3660
- negative(params) {
3661
- return this.check(/* @__PURE__ */ _lt(0, params));
3662
- },
3663
- nonpositive(params) {
3664
- return this.check(/* @__PURE__ */ _lte(0, params));
3665
- },
3666
- multipleOf(value, params) {
3667
- return this.check(/* @__PURE__ */ _multipleOf(value, params));
3668
- },
3669
- step(value, params) {
3670
- return this.check(/* @__PURE__ */ _multipleOf(value, params));
3671
- },
3672
- finite() {
3673
- return this;
3674
- }
3675
- });
3676
- const bag = inst._zod.bag;
3677
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3678
- inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
3679
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
3680
4799
  inst.isFinite = true;
3681
- inst.format = bag.format ?? null;
3682
- });
4800
+ }, /*@__PURE__*/ derived({
4801
+ minValue: (inst) => {
4802
+ const { minimum, exclusiveMinimum } = aggregateChecks(inst);
4803
+ return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
4804
+ },
4805
+ maxValue: (inst) => {
4806
+ const { maximum, exclusiveMaximum } = aggregateChecks(inst);
4807
+ return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
4808
+ },
4809
+ isInt: (inst) => {
4810
+ const { isInt, multipleOf } = aggregateChecks(inst);
4811
+ return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
4812
+ },
4813
+ format: (inst) => aggregateChecks(inst).format ?? null
4814
+ }, {
4815
+ gt(value, params) {
4816
+ return this.check(/* @__PURE__ */ _gt(value, params));
4817
+ },
4818
+ gte(value, params) {
4819
+ return this.check(/* @__PURE__ */ _gte(value, params));
4820
+ },
4821
+ min(value, params) {
4822
+ return this.check(/* @__PURE__ */ _gte(value, params));
4823
+ },
4824
+ lt(value, params) {
4825
+ return this.check(/* @__PURE__ */ _lt(value, params));
4826
+ },
4827
+ lte(value, params) {
4828
+ return this.check(/* @__PURE__ */ _lte(value, params));
4829
+ },
4830
+ max(value, params) {
4831
+ return this.check(/* @__PURE__ */ _lte(value, params));
4832
+ },
4833
+ int(params) {
4834
+ return this.check(int(params));
4835
+ },
4836
+ safe(params) {
4837
+ return this.check(int(params));
4838
+ },
4839
+ positive(params) {
4840
+ return this.check(/* @__PURE__ */ _gt(0, params));
4841
+ },
4842
+ nonnegative(params) {
4843
+ return this.check(/* @__PURE__ */ _gte(0, params));
4844
+ },
4845
+ negative(params) {
4846
+ return this.check(/* @__PURE__ */ _lt(0, params));
4847
+ },
4848
+ nonpositive(params) {
4849
+ return this.check(/* @__PURE__ */ _lte(0, params));
4850
+ },
4851
+ multipleOf(value, params) {
4852
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
4853
+ },
4854
+ step(value, params) {
4855
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
4856
+ },
4857
+ finite() {
4858
+ return this;
4859
+ }
4860
+ }));
3683
4861
  function number(params) {
3684
4862
  return /* @__PURE__ */ _number(ZodNumber, params);
3685
4863
  }
@@ -3715,94 +4893,80 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3715
4893
  return /* @__PURE__ */ _never(ZodNever, params);
3716
4894
  }
3717
4895
  const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
4896
+ _ensureDefaultMemoizer();
3718
4897
  $ZodArray.init(inst, def);
3719
4898
  ZodType.init(inst, def);
3720
4899
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3721
4900
  inst.element = def.element;
3722
- _installLazyMethods(inst, "ZodArray", {
3723
- min(n, params) {
3724
- return this.check(/* @__PURE__ */ _minLength(n, params));
3725
- },
3726
- nonempty(params) {
3727
- return this.check(/* @__PURE__ */ _minLength(1, params));
3728
- },
3729
- max(n, params) {
3730
- return this.check(/* @__PURE__ */ _maxLength(n, params));
3731
- },
3732
- length(n, params) {
3733
- return this.check(/* @__PURE__ */ _length(n, params));
3734
- },
3735
- unwrap() {
3736
- return this.element;
3737
- }
3738
- });
4901
+ }, {
4902
+ min(n, params) {
4903
+ return this.check(/* @__PURE__ */ _minLength(n, params));
4904
+ },
4905
+ nonempty(params) {
4906
+ return this.check(/* @__PURE__ */ _minLength(1, params));
4907
+ },
4908
+ max(n, params) {
4909
+ return this.check(/* @__PURE__ */ _maxLength(n, params));
4910
+ },
4911
+ length(n, params) {
4912
+ return this.check(/* @__PURE__ */ _length(n, params));
4913
+ },
4914
+ unwrap() {
4915
+ return this.element;
4916
+ }
3739
4917
  });
3740
4918
  function array(element, params) {
3741
4919
  return /* @__PURE__ */ _array(ZodArray, element, params);
3742
4920
  }
3743
4921
  const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
4922
+ _ensureDefaultMemoizer();
3744
4923
  $ZodObjectJIT.init(inst, def);
3745
4924
  ZodType.init(inst, def);
3746
4925
  inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
3747
- defineLazy(inst, "shape", () => {
3748
- return def.shape;
3749
- });
3750
- _installLazyMethods(inst, "ZodObject", {
3751
- keyof() {
3752
- return _enum(Object.keys(this._zod.def.shape));
3753
- },
3754
- catchall(catchall) {
3755
- return this.clone({
3756
- ...this._zod.def,
3757
- catchall
3758
- });
3759
- },
3760
- passthrough() {
3761
- return this.clone({
3762
- ...this._zod.def,
3763
- catchall: unknown()
3764
- });
3765
- },
3766
- loose() {
3767
- return this.clone({
3768
- ...this._zod.def,
3769
- catchall: unknown()
3770
- });
3771
- },
3772
- strict() {
3773
- return this.clone({
3774
- ...this._zod.def,
3775
- catchall: never()
3776
- });
3777
- },
3778
- strip() {
3779
- return this.clone({
3780
- ...this._zod.def,
3781
- catchall: void 0
3782
- });
3783
- },
3784
- extend(incoming) {
3785
- return extend(this, incoming);
3786
- },
3787
- safeExtend(incoming) {
3788
- return safeExtend(this, incoming);
3789
- },
3790
- merge(other) {
3791
- return merge(this, other);
3792
- },
3793
- pick(mask) {
3794
- return pick(this, mask);
3795
- },
3796
- omit(mask) {
3797
- return omit(this, mask);
3798
- },
3799
- partial(...args) {
3800
- return partial(ZodOptional, this, args[0]);
3801
- },
3802
- required(...args) {
3803
- return required(ZodNonOptional, this, args[0]);
3804
- }
3805
- });
4926
+ installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
4927
+ }, {
4928
+ keyof() {
4929
+ return _enum(Object.keys(this._zod.def.shape));
4930
+ },
4931
+ catchall(catchall) {
4932
+ return this.clone(mergeDefs(this._zod.def, { catchall }));
4933
+ },
4934
+ passthrough() {
4935
+ return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
4936
+ },
4937
+ loose() {
4938
+ return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
4939
+ },
4940
+ strict() {
4941
+ return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
4942
+ },
4943
+ strip() {
4944
+ return this.clone(mergeDefs(this._zod.def, { catchall: void 0 }));
4945
+ },
4946
+ extend(incoming) {
4947
+ return extend(this, incoming);
4948
+ },
4949
+ safeExtend(incoming) {
4950
+ return safeExtend(this, incoming);
4951
+ },
4952
+ merge(other) {
4953
+ return merge(this, other);
4954
+ },
4955
+ pick(mask) {
4956
+ return pick(this, mask);
4957
+ },
4958
+ omit(mask) {
4959
+ return omit(this, mask);
4960
+ },
4961
+ partial(...args) {
4962
+ return partial(ZodOptional, this, args[0]);
4963
+ },
4964
+ exactPartial(...args) {
4965
+ return partial(ZodExactOptional, this, args[0], "exactPartial");
4966
+ },
4967
+ required(...args) {
4968
+ return required(ZodNonOptional, this, args[0]);
4969
+ }
3806
4970
  });
3807
4971
  function object(shape, params) {
3808
4972
  const def = {
@@ -3842,7 +5006,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3842
5006
  ZodType.init(inst, def);
3843
5007
  inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
3844
5008
  inst.enum = def.entries;
3845
- inst.options = Object.values(def.entries);
5009
+ inst.options = [...inst._zod.values];
3846
5010
  const keys = new Set(Object.keys(def.entries));
3847
5011
  inst.extract = (values, params) => {
3848
5012
  const newEntries = {};
@@ -3893,6 +5057,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3893
5057
  });
3894
5058
  }
3895
5059
  const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
5060
+ _ensureDefaultMemoizer();
3896
5061
  $ZodTransform.init(inst, def);
3897
5062
  ZodType.init(inst, def);
3898
5063
  inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
@@ -3904,7 +5069,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3904
5069
  const _issue = issue$1;
3905
5070
  if (_issue.fatal) _issue.continue = false;
3906
5071
  _issue.code ?? (_issue.code = "custom");
3907
- _issue.input ?? (_issue.input = payload.value);
5072
+ if (!("input" in _issue)) _issue.input = payload.value;
3908
5073
  _issue.inst ?? (_issue.inst = inst);
3909
5074
  payload.issues.push(issue(_issue));
3910
5075
  }
@@ -3912,11 +5077,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3912
5077
  const output = def.transform(payload.value, payload);
3913
5078
  if (output instanceof Promise) return output.then((output) => {
3914
5079
  payload.value = output;
3915
- payload.fallback = true;
3916
5080
  return payload;
3917
5081
  });
3918
5082
  payload.value = output;
3919
- payload.fallback = true;
3920
5083
  return payload;
3921
5084
  };
3922
5085
  });
@@ -4017,7 +5180,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4017
5180
  return new ZodCatch({
4018
5181
  type: "catch",
4019
5182
  innerType,
4020
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
5183
+ catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
4021
5184
  });
4022
5185
  }
4023
5186
  const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
@@ -4286,7 +5449,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4286
5449
  }
4287
5450
  }
4288
5451
  //#endregion
4289
- //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.1.7-rc.2_@deepseek-ai+cordis@4.0.4_@deepseek-ai+dsh-scope@0._96480dbecf47e43f89b841d272151264/node_modules/@deepseek-ai/dsh-session/lib/types/surface.js
5452
+ //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-session@0.2.0-rc.2_@deepseek-ai+cordis@4.0.4_@deepseek-ai+dsh-scope@0._c9dee8deba3bd498ce58eb9c566c157f/node_modules/@deepseek-ai/dsh-session/lib/types/surface.js
4290
5453
  /** Runtime counterpart of the message-producing event union. */
4291
5454
  const SURFACE_EVENT_TYPES = /* @__PURE__ */ new Set([
4292
5455
  "system/message",
@@ -5067,7 +6230,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5067
6230
  return true;
5068
6231
  }
5069
6232
  //#endregion
5070
- //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-store@0.1.7-rc.2_@deepseek-ai+cordis@4.0.4/node_modules/@deepseek-ai/dsh-client-store/lib/index.js
6233
+ //#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-store@0.2.0-rc.2_@deepseek-ai+cordis@4.0.4/node_modules/@deepseek-ai/dsh-client-store/lib/index.js
5071
6234
  /**
5072
6235
  * Shallow equality for selector slices (zustand/shallow semantics; travels
5073
6236
  * with the engine so hook consumers need no zustand dependency).
@@ -5203,7 +6366,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5203
6366
  }
5204
6367
  //#endregion
5205
6368
  //#region \0dsh-css:src/client/ModelChip.module.css.mjs
5206
- const css$3 = ".IO2TjW_chip{align-items:center;gap:6px;display:flex;position:relative}.IO2TjW_trigger{height:28px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));cursor:pointer;background:0 0;border:none;border-radius:24px;align-items:center;gap:4px;padding:0 8px;font-size:13px;font-weight:500;display:inline-flex}.IO2TjW_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.IO2TjW_trigger:disabled{cursor:default;opacity:.6}.IO2TjW_triggerEffort{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed))}.IO2TjW_menu{z-index:20;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));min-width:220px;max-height:320px;box-shadow:0 4px 16px var(--dsw-alias-shadow,var(--dsw-alias-border-l2,#0000001f));border-radius:8px;padding:4px;position:absolute;bottom:calc(100% + 4px);left:0;overflow-y:auto}.IO2TjW_group+.IO2TjW_group{margin-top:4px}.IO2TjW_groupTitle{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:4px 8px;font-size:12px;line-height:18px}.IO2TjW_option{width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;font-size:13px;line-height:20px;display:flex}.IO2TjW_option:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.IO2TjW_option:disabled{cursor:default;opacity:.6}.IO2TjW_check{width:16px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex:none;display:inline-flex}.IO2TjW_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:8px;font-size:13px}.IO2TjW_selectFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));white-space:nowrap;font-size:12px}";
6369
+ const css$3 = ".he-h5G_chip{align-items:center;gap:6px;display:flex;position:relative}.he-h5G_trigger{height:28px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));cursor:pointer;background:0 0;border:none;border-radius:24px;align-items:center;gap:4px;padding:0 8px;font-size:13px;font-weight:500;display:inline-flex}.he-h5G_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.he-h5G_trigger:disabled{cursor:default;opacity:.6}.he-h5G_triggerEffort{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed))}.he-h5G_menu{z-index:20;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));min-width:220px;max-height:320px;box-shadow:0 4px 16px var(--dsw-alias-shadow,var(--dsw-alias-border-l2,#0000001f));border-radius:8px;padding:4px;position:absolute;bottom:calc(100% + 4px);left:0;overflow-y:auto}.he-h5G_group+.he-h5G_group{margin-top:4px}.he-h5G_groupTitle{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:4px 8px;font-size:12px;line-height:18px}.he-h5G_option{width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;font-size:13px;line-height:20px;display:flex}.he-h5G_option:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.he-h5G_option:disabled{cursor:default;opacity:.6}.he-h5G_check{width:16px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex:none;display:inline-flex}.he-h5G_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));padding:8px;font-size:13px}.he-h5G_selectFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));white-space:nowrap;font-size:12px}";
5207
6370
  const tagId$3 = "@khorsheed/dsh-client-message-tools/ModelChip.module.css";
5208
6371
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
5209
6372
  const tag = document.createElement("style");
@@ -5213,16 +6376,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5213
6376
  document.head.appendChild(tag);
5214
6377
  }
5215
6378
  var ModelChip_module_css_default = {
5216
- "trigger": "IO2TjW_trigger",
5217
- "option": "IO2TjW_option",
5218
- "chip": "IO2TjW_chip",
5219
- "empty": "IO2TjW_empty",
5220
- "check": "IO2TjW_check",
5221
- "groupTitle": "IO2TjW_groupTitle",
5222
- "triggerEffort": "IO2TjW_triggerEffort",
5223
- "selectFailed": "IO2TjW_selectFailed",
5224
- "group": "IO2TjW_group",
5225
- "menu": "IO2TjW_menu"
6379
+ "trigger": "he-h5G_trigger",
6380
+ "group": "he-h5G_group",
6381
+ "selectFailed": "he-h5G_selectFailed",
6382
+ "groupTitle": "he-h5G_groupTitle",
6383
+ "chip": "he-h5G_chip",
6384
+ "triggerEffort": "he-h5G_triggerEffort",
6385
+ "option": "he-h5G_option",
6386
+ "menu": "he-h5G_menu",
6387
+ "check": "he-h5G_check",
6388
+ "empty": "he-h5G_empty"
5226
6389
  };
5227
6390
  //#endregion
5228
6391
  //#region src/client/ModelChip.tsx
@@ -5395,7 +6558,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5395
6558
  }
5396
6559
  //#endregion
5397
6560
  //#region \0dsh-css:src/client/UserMessageView.module.css.mjs
5398
- const css$2 = ".uq6O-a_userRow{flex-direction:column;align-items:flex-end;gap:6px;display:flex}.uq6O-a_userStack{flex-direction:column;align-items:flex-end;gap:8px;min-width:0;max-width:min(525px,82%);display:flex}.uq6O-a_bubble{background:var(--dsw-specific-bubble,var(--dsw-alias-bg-layer-1));max-width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));border-radius:22px;padding:10px 16px;font-size:16px;line-height:24px}.uq6O-a_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.uq6O-a_refChip{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));white-space:nowrap;vertical-align:baseline;background:#6187d838;border-radius:6px;margin:0 2px;padding:0 8px;font-size:.85em;line-height:1.6;display:inline-block}.uq6O-a_actions{align-items:center;gap:10px;height:28px;display:flex}.uq6O-a_action{width:28px;height:28px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));cursor:pointer;background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}.uq6O-a_action:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary))}.uq6O-a_editor{border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));border-radius:8px;flex-direction:column;gap:8px;width:100%;padding:12px;display:flex}.uq6O-a_editorInput{border:1px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1,var(--dsw-alias-label-primary-dimmed)));resize:none;width:100%;max-height:240px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));font:inherit;background:0 0;border-radius:6px;outline:none;padding:8px;overflow-y:auto}.uq6O-a_editorActions{justify-content:flex-end;align-items:center;gap:8px;display:flex}.uq6O-a_editorTrailing{align-items:center;margin-right:auto;display:flex}.uq6O-a_actionError{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));align-self:flex-end;padding:2px 4px;font-size:13px;line-height:20px}.uq6O-a_editedLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-self:flex-end;font-size:12px;line-height:18px}";
6561
+ const css$2 = ".kCWYAa_userRow{flex-direction:column;align-items:flex-end;gap:6px;display:flex}.kCWYAa_userStack{flex-direction:column;align-items:flex-end;gap:8px;min-width:0;max-width:min(525px,82%);display:flex}.kCWYAa_bubble{background:var(--dsw-specific-bubble,var(--dsw-alias-bg-layer-1));max-width:100%;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));border-radius:22px;padding:10px 16px;font-size:16px;line-height:24px}.kCWYAa_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.kCWYAa_refChip{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));white-space:nowrap;vertical-align:baseline;background:#6187d838;border-radius:6px;margin:0 2px;padding:0 8px;font-size:.85em;line-height:1.6;display:inline-block}.kCWYAa_actions{align-items:center;gap:10px;height:28px;display:flex}.kCWYAa_action{width:28px;height:28px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));cursor:pointer;background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}.kCWYAa_action:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary))}.kCWYAa_editor{border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));border-radius:8px;flex-direction:column;gap:8px;width:100%;padding:12px;display:flex}.kCWYAa_editorInput{border:1px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1,var(--dsw-alias-label-primary-dimmed)));resize:none;width:100%;max-height:240px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));font:inherit;background:0 0;border-radius:6px;outline:none;padding:8px;overflow-y:auto}.kCWYAa_editorActions{justify-content:flex-end;align-items:center;gap:8px;display:flex}.kCWYAa_editorTrailing{align-items:center;margin-right:auto;display:flex}.kCWYAa_actionError{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));align-self:flex-end;padding:2px 4px;font-size:13px;line-height:20px}.kCWYAa_editedLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-self:flex-end;font-size:12px;line-height:18px}";
5399
6562
  const tagId$2 = "@khorsheed/dsh-client-message-tools/UserMessageView.module.css";
5400
6563
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
5401
6564
  const tag = document.createElement("style");
@@ -5405,19 +6568,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5405
6568
  document.head.appendChild(tag);
5406
6569
  }
5407
6570
  var UserMessageView_module_css_default = {
5408
- "bubble": "uq6O-a_bubble",
5409
- "editor": "uq6O-a_editor",
5410
- "editorTrailing": "uq6O-a_editorTrailing",
5411
- "textRun": "uq6O-a_textRun",
5412
- "actions": "uq6O-a_actions",
5413
- "actionError": "uq6O-a_actionError",
5414
- "action": "uq6O-a_action",
5415
- "editedLabel": "uq6O-a_editedLabel",
5416
- "userRow": "uq6O-a_userRow",
5417
- "editorActions": "uq6O-a_editorActions",
5418
- "userStack": "uq6O-a_userStack",
5419
- "editorInput": "uq6O-a_editorInput",
5420
- "refChip": "uq6O-a_refChip"
6571
+ "actionError": "kCWYAa_actionError",
6572
+ "editor": "kCWYAa_editor",
6573
+ "editedLabel": "kCWYAa_editedLabel",
6574
+ "bubble": "kCWYAa_bubble",
6575
+ "userRow": "kCWYAa_userRow",
6576
+ "textRun": "kCWYAa_textRun",
6577
+ "actions": "kCWYAa_actions",
6578
+ "userStack": "kCWYAa_userStack",
6579
+ "editorInput": "kCWYAa_editorInput",
6580
+ "refChip": "kCWYAa_refChip",
6581
+ "editorActions": "kCWYAa_editorActions",
6582
+ "editorTrailing": "kCWYAa_editorTrailing",
6583
+ "action": "kCWYAa_action"
5421
6584
  };
5422
6585
  //#endregion
5423
6586
  //#region src/client/UserMessageView.tsx
@@ -5744,7 +6907,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5744
6907
  });
5745
6908
  //#endregion
5746
6909
  //#region \0dsh-css:src/client/RestoredMessageView.module.css.mjs
5747
- const css$1 = ".MHYySG_restoredLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-items:center;gap:4px;font-size:12px;line-height:18px;display:inline-flex}.MHYySG_restoredAssistantRow{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex-direction:column;align-items:flex-start;gap:4px;display:flex}";
6910
+ const css$1 = ".hDMXAG_restoredLabel{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));align-items:center;gap:4px;font-size:12px;line-height:18px;display:inline-flex}.hDMXAG_restoredAssistantRow{color:var(--dsw-alias-label-primary,var(--dsw-alias-label-secondary));flex-direction:column;align-items:flex-start;gap:4px;display:flex}";
5748
6911
  const tagId$1 = "@khorsheed/dsh-client-message-tools/RestoredMessageView.module.css";
5749
6912
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
5750
6913
  const tag = document.createElement("style");
@@ -5754,8 +6917,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5754
6917
  document.head.appendChild(tag);
5755
6918
  }
5756
6919
  var RestoredMessageView_module_css_default = {
5757
- "restoredAssistantRow": "MHYySG_restoredAssistantRow",
5758
- "restoredLabel": "MHYySG_restoredLabel"
6920
+ "restoredLabel": "hDMXAG_restoredLabel",
6921
+ "restoredAssistantRow": "hDMXAG_restoredAssistantRow"
5759
6922
  };
5760
6923
  //#endregion
5761
6924
  //#region src/client/RestoredMessageView.tsx
@@ -5796,7 +6959,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5796
6959
  }
5797
6960
  //#endregion
5798
6961
  //#region \0dsh-css:src/client/WithdrawnDividerView.module.css.mjs
5799
- const css = ".Hb4H5q_row{padding:2px 0}.Hb4H5q_marker{width:100%;min-width:0;height:24px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;padding:0;display:flex}.Hb4H5q_marker:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.Hb4H5q_leading{width:16px;height:16px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex}.Hb4H5q_title{color:var(--dsw-alias-label-primary-dimmed,var(--dsw-alias-label-tertiary));flex:none;font-size:14px;line-height:24px}.Hb4H5q_badge{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));flex:none;align-items:center;gap:4px;margin-left:10px;font-size:12px;line-height:18px;display:inline-flex}.Hb4H5q_body{padding:4px 0 4px 22px}.Hb4H5q_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));font-size:13px;line-height:20px}.Hb4H5q_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.Hb4H5q_entryUser,.Hb4H5q_entryAssistant{color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));padding:4px 0;font-size:14px;line-height:22px}.Hb4H5q_entryKind{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));margin-bottom:2px;font-size:12px;line-height:18px}.Hb4H5q_entryUser{border-left:2px solid var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed));padding-left:8px}.Hb4H5q_entryImages{margin-top:4px}.Hb4H5q_entryAssistant{border-left:2px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));padding-left:8px}.Hb4H5q_restoreRow{align-items:center;gap:8px;padding-top:8px;display:flex}.Hb4H5q_restoreFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));font-size:12px}";
6962
+ const css = ".JtQ9hG_row{padding:2px 0}.JtQ9hG_marker{width:100%;min-width:0;height:24px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;padding:0;display:flex}.JtQ9hG_marker:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1))}.JtQ9hG_leading{width:16px;height:16px;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex}.JtQ9hG_title{color:var(--dsw-alias-label-primary-dimmed,var(--dsw-alias-label-tertiary));flex:none;font-size:14px;line-height:24px}.JtQ9hG_badge{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));flex:none;align-items:center;gap:4px;margin-left:10px;font-size:12px;line-height:18px;display:inline-flex}.JtQ9hG_body{padding:4px 0 4px 22px}.JtQ9hG_empty{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));font-size:13px;line-height:20px}.JtQ9hG_textRun{white-space:pre-wrap;word-break:break-word;font-size:inherit;line-height:inherit}.JtQ9hG_entryUser,.JtQ9hG_entryAssistant{color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));padding:4px 0;font-size:14px;line-height:22px}.JtQ9hG_entryKind{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-primary-dimmed));margin-bottom:2px;font-size:12px;line-height:18px}.JtQ9hG_entryUser{border-left:2px solid var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed));padding-left:8px}.JtQ9hG_entryImages{margin-top:4px}.JtQ9hG_entryAssistant{border-left:2px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,var(--dsw-alias-label-primary-dimmed)));padding-left:8px}.JtQ9hG_restoreRow{align-items:center;gap:8px;padding-top:8px;display:flex}.JtQ9hG_restoreFailed{color:var(--dsw-alias-state-error-primary,var(--dsw-alias-label-secondary));font-size:12px}";
5800
6963
  const tagId = "@khorsheed/dsh-client-message-tools/WithdrawnDividerView.module.css";
5801
6964
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
5802
6965
  const tag = document.createElement("style");
@@ -5806,20 +6969,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5806
6969
  document.head.appendChild(tag);
5807
6970
  }
5808
6971
  var WithdrawnDividerView_module_css_default = {
5809
- "textRun": "Hb4H5q_textRun",
5810
- "empty": "Hb4H5q_empty",
5811
- "entryImages": "Hb4H5q_entryImages",
5812
- "title": "Hb4H5q_title",
5813
- "restoreFailed": "Hb4H5q_restoreFailed",
5814
- "body": "Hb4H5q_body",
5815
- "badge": "Hb4H5q_badge",
5816
- "marker": "Hb4H5q_marker",
5817
- "row": "Hb4H5q_row",
5818
- "entryAssistant": "Hb4H5q_entryAssistant",
5819
- "entryUser": "Hb4H5q_entryUser",
5820
- "leading": "Hb4H5q_leading",
5821
- "entryKind": "Hb4H5q_entryKind",
5822
- "restoreRow": "Hb4H5q_restoreRow"
6972
+ "entryImages": "JtQ9hG_entryImages",
6973
+ "body": "JtQ9hG_body",
6974
+ "leading": "JtQ9hG_leading",
6975
+ "empty": "JtQ9hG_empty",
6976
+ "restoreRow": "JtQ9hG_restoreRow",
6977
+ "row": "JtQ9hG_row",
6978
+ "restoreFailed": "JtQ9hG_restoreFailed",
6979
+ "entryAssistant": "JtQ9hG_entryAssistant",
6980
+ "badge": "JtQ9hG_badge",
6981
+ "entryKind": "JtQ9hG_entryKind",
6982
+ "title": "JtQ9hG_title",
6983
+ "entryUser": "JtQ9hG_entryUser",
6984
+ "marker": "JtQ9hG_marker",
6985
+ "textRun": "JtQ9hG_textRun"
5823
6986
  };
5824
6987
  //#endregion
5825
6988
  //#region src/client/WithdrawnDividerView.tsx