@hasna/skills 0.10.6 → 0.10.8

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/dist/index.js CHANGED
@@ -622,38 +622,36 @@ var require_Alias = __commonJS((exports) => {
622
622
  if (node.anchor === this.source)
623
623
  found = node;
624
624
  }
625
- if (found && ctx) {
626
- const { anchors: anchors2, doc: doc2, maxAliasCount } = ctx;
627
- let data = anchors2.get(found);
628
- if (!data) {
629
- toJS.toJS(found, null, ctx);
630
- data = anchors2.get(found);
631
- }
632
- if (data?.res === undefined) {
633
- const msg = "This should not happen: Alias anchor was not resolved?";
634
- throw new ReferenceError(msg);
635
- }
636
- if (maxAliasCount >= 0) {
637
- data.count += 1;
638
- if (data.aliasCount === 0)
639
- data.aliasCount = getAliasCount(doc2, found, anchors2);
640
- if (data.count * data.aliasCount > maxAliasCount) {
641
- const msg = "Excessive alias count indicates a resource exhaustion attack";
642
- throw new ReferenceError(msg);
643
- }
644
- }
645
- }
646
625
  return found;
647
626
  }
648
627
  toJSON(_arg, ctx) {
649
628
  if (!ctx)
650
629
  return { source: this.source };
651
- const source = this.resolve(ctx.doc, ctx);
630
+ const { anchors: anchors2, doc, maxAliasCount } = ctx;
631
+ const source = this.resolve(doc, ctx);
652
632
  if (!source) {
653
633
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
654
634
  throw new ReferenceError(msg);
655
635
  }
656
- return ctx.anchors.get(source).res;
636
+ let data = anchors2.get(source);
637
+ if (!data) {
638
+ toJS.toJS(source, null, ctx);
639
+ data = anchors2.get(source);
640
+ }
641
+ if (data?.res === undefined) {
642
+ const msg = "This should not happen: Alias anchor was not resolved?";
643
+ throw new ReferenceError(msg);
644
+ }
645
+ if (maxAliasCount >= 0) {
646
+ data.count += 1;
647
+ if (data.aliasCount === 0)
648
+ data.aliasCount = getAliasCount(doc, source, anchors2);
649
+ if (data.count * data.aliasCount > maxAliasCount) {
650
+ const msg = "Excessive alias count indicates a resource exhaustion attack";
651
+ throw new ReferenceError(msg);
652
+ }
653
+ }
654
+ return data.res;
657
655
  }
658
656
  toString(ctx, _onComment, _onChompKeep) {
659
657
  const src = `*${this.source}`;
@@ -4415,32 +4413,33 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
4415
4413
  }
4416
4414
  if (badChar)
4417
4415
  onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
4418
- return unfoldLines(source);
4416
+ return foldLines(source);
4419
4417
  }
4420
4418
  function singleQuotedValue(source, onError) {
4421
4419
  if (source[source.length - 1] !== "'" || source.length === 1)
4422
4420
  onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
4423
- return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
4421
+ return foldLines(source.slice(1, -1)).replace(/''/g, "'");
4424
4422
  }
4425
- function unfoldLines(source) {
4426
- const line = /(.*?)\r?\n/sy;
4427
- let match = line.exec(source);
4428
- if (!match)
4429
- return source;
4430
- let trimEnd, trimBoth;
4423
+ function foldLines(source) {
4424
+ let first, line;
4431
4425
  try {
4432
- trimEnd = new RegExp("(?<![ \t])[ \t]+$");
4433
- trimBoth = new RegExp("^[ \t]+|(?<![ \t])[ \t]+$", "g");
4426
+ first = new RegExp(`(.*?)(?<![ ])[ ]*\r?
4427
+ `, "sy");
4428
+ line = new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
4429
+ `, "sy");
4434
4430
  } catch {
4435
- trimEnd = /[ \t]+$/;
4436
- trimBoth = /^[ \t]+|[ \t]+$/g;
4431
+ first = /(.*?)[ \t]*\r?\n/sy;
4432
+ line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
4437
4433
  }
4438
- let res = match[1].replace(trimEnd, "");
4434
+ let match = first.exec(source);
4435
+ if (!match)
4436
+ return source;
4437
+ let res = match[1];
4439
4438
  let sep2 = " ";
4440
- let pos = line.lastIndex;
4439
+ let pos = first.lastIndex;
4440
+ line.lastIndex = pos;
4441
4441
  while (match = line.exec(source)) {
4442
- const lm = match[1].replace(trimBoth, "");
4443
- if (lm === "") {
4442
+ if (match[1] === "") {
4444
4443
  if (sep2 === `
4445
4444
  `)
4446
4445
  res += sep2;
@@ -4448,7 +4447,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
4448
4447
  sep2 = `
4449
4448
  `;
4450
4449
  } else {
4451
- res += sep2 + lm;
4450
+ res += sep2 + match[1];
4452
4451
  sep2 = " ";
4453
4452
  }
4454
4453
  pos = line.lastIndex;
@@ -9612,7 +9611,7 @@ import { isAbsolute as isAbsolute11, join as join23, resolve as resolve11 } from
9612
9611
  // package.json
9613
9612
  var package_default = {
9614
9613
  name: "@hasna/skills",
9615
- version: "0.10.6",
9614
+ version: "0.10.8",
9616
9615
  description: "Skills library for AI coding agents",
9617
9616
  type: "module",
9618
9617
  bin: {
@@ -9674,6 +9673,7 @@ var package_default = {
9674
9673
  migrate: "bun run ./src/server/migrate.ts",
9675
9674
  typecheck: "tsc --noEmit",
9676
9675
  "verify:release": "bun run scripts/release-guard.ts",
9676
+ "verify:release-review": "bun run scripts/verify-release-review.ts",
9677
9677
  "verify:consumer-types": "bun run scripts/consumer-types.ts",
9678
9678
  prepack: "bun run verify:generated && bun run verify:release && bun run verify:consumer-types",
9679
9679
  prepublishOnly: "bun run verify:producer && bun run typecheck && bun run test",
@@ -14137,6 +14137,9 @@ function assertManagedAgentBridge(agent, options = {}) {
14137
14137
  const runtimeCache = canonicalAgentPath(join16(home, ".cache", "codex-runtimes"), aliases);
14138
14138
  if (entry.path.startsWith(runtimeCache + sep4) && discovery?.method === "automatic" && discovery.roots.some((root) => entry.path.startsWith(root + sep4)))
14139
14139
  return true;
14140
+ const bundledMarketplaces = canonicalAgentPath(join16(home, ".codex", ".tmp", "bundled-marketplaces"), aliases);
14141
+ if (entry.path.startsWith(bundledMarketplaces + sep4) && discovery?.method === "automatic" && discovery.roots.some((root) => entry.path.startsWith(root + sep4)))
14142
+ return true;
14140
14143
  if (!entry.path.startsWith(canonicalAgentPath(join16(home, ".codex", "skills", ".system"), aliases) + sep4))
14141
14144
  return false;
14142
14145
  return Array.isArray(binding.disabledBuiltins) && binding.disabledBuiltins.some((item) => item.path === entry.path && item.hash === entry.hash);
@@ -18159,7 +18162,6 @@ var exports_external = {};
18159
18162
  __export(exports_external, {
18160
18163
  xor: () => xor,
18161
18164
  xid: () => xid2,
18162
- withParser: () => withParser,
18163
18165
  void: () => _void2,
18164
18166
  validateAsync: () => validateAsync,
18165
18167
  validate: () => validate,
@@ -18271,7 +18273,6 @@ __export(exports_external, {
18271
18273
  instanceof: () => _instanceof,
18272
18274
  input: () => input,
18273
18275
  includes: () => _includes,
18274
- iban: () => iban2,
18275
18276
  httpUrl: () => httpUrl,
18276
18277
  hostname: () => hostname3,
18277
18278
  hex: () => hex2,
@@ -18304,7 +18305,6 @@ __export(exports_external, {
18304
18305
  decode: () => decode2,
18305
18306
  date: () => date2,
18306
18307
  custom: () => custom,
18307
- currencyCode: () => currencyCode2,
18308
18308
  cuid2: () => cuid22,
18309
18309
  cuid: () => cuid3,
18310
18310
  creditCard: () => creditCard2,
@@ -18370,14 +18370,12 @@ __export(exports_external, {
18370
18370
  ZodJWT: () => ZodJWT,
18371
18371
  ZodIssueCode: () => ZodIssueCode,
18372
18372
  ZodIntersection: () => ZodIntersection,
18373
- ZodInstanceOf: () => ZodInstanceOf,
18374
18373
  ZodISOTime: () => ZodISOTime,
18375
18374
  ZodISODuration: () => ZodISODuration,
18376
18375
  ZodISODateTime: () => ZodISODateTime,
18377
18376
  ZodISODate: () => ZodISODate,
18378
18377
  ZodIPv6: () => ZodIPv6,
18379
18378
  ZodIPv4: () => ZodIPv4,
18380
- ZodIBAN: () => ZodIBAN,
18381
18379
  ZodGUID: () => ZodGUID,
18382
18380
  ZodFunction: () => ZodFunction,
18383
18381
  ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
@@ -18411,7 +18409,6 @@ __export(exports_external, {
18411
18409
  ZodAny: () => ZodAny,
18412
18410
  TimePrecision: () => TimePrecision,
18413
18411
  NEVER: () => NEVER,
18414
- INVALID: () => INVALID,
18415
18412
  $output: () => $output,
18416
18413
  $input: () => $input,
18417
18414
  $brand: () => $brand
@@ -18420,9 +18417,7 @@ __export(exports_external, {
18420
18417
  // node_modules/zod/v4/core/index.js
18421
18418
  var exports_core2 = {};
18422
18419
  __export(exports_core2, {
18423
- withParser: () => withParser,
18424
18420
  version: () => version,
18425
- validateURL: () => validateURL,
18426
18421
  validateAsync: () => validateAsync,
18427
18422
  validate: () => validate,
18428
18423
  util: () => exports_util,
@@ -18442,8 +18437,7 @@ __export(exports_core2, {
18442
18437
  safeDecode: () => safeDecode,
18443
18438
  registry: () => registry,
18444
18439
  regexes: () => exports_regexes,
18445
- processSchema: () => processSchema,
18446
- process: () => processSchema,
18440
+ process: () => process2,
18447
18441
  prettifyError: () => prettifyError,
18448
18442
  parseURLObject: () => parseURLObject,
18449
18443
  parseAsync: () => parseAsync,
@@ -18454,7 +18448,6 @@ __export(exports_core2, {
18454
18448
  locales: () => exports_locales,
18455
18449
  isValidJWT: () => isValidJWT,
18456
18450
  isValidIPv6: () => isValidIPv6,
18457
- isValidIBAN: () => isValidIBAN,
18458
18451
  isValidCreditCard: () => isValidCreditCard,
18459
18452
  isValidCIDRv6: () => isValidCIDRv6,
18460
18453
  isValidBase64URL: () => isValidBase64URL,
@@ -18481,9 +18474,6 @@ __export(exports_core2, {
18481
18474
  compileFn: () => compileFn,
18482
18475
  compile: () => compile,
18483
18476
  clone: () => clone,
18484
- canParseURL: () => canParseURL,
18485
- base64urlCharset: () => base64urlCharset,
18486
- base64Charset: () => base64Charset,
18487
18477
  _xor: () => _xor,
18488
18478
  _xid: () => _xid,
18489
18479
  _void: () => _void,
@@ -18575,7 +18565,6 @@ __export(exports_core2, {
18575
18565
  _int32: () => _int32,
18576
18566
  _int: () => _int,
18577
18567
  _includes: () => _includes,
18578
- _iban: () => _iban,
18579
18568
  _guid: () => _guid,
18580
18569
  _gte: () => _gte,
18581
18570
  _gt: () => _gt,
@@ -18677,7 +18666,6 @@ __export(exports_core2, {
18677
18666
  $ZodISODate: () => $ZodISODate,
18678
18667
  $ZodIPv6: () => $ZodIPv6,
18679
18668
  $ZodIPv4: () => $ZodIPv4,
18680
- $ZodIBAN: () => $ZodIBAN,
18681
18669
  $ZodGUID: () => $ZodGUID,
18682
18670
  $ZodFunction: () => $ZodFunction,
18683
18671
  $ZodFile: () => $ZodFile,
@@ -18702,7 +18690,6 @@ __export(exports_core2, {
18702
18690
  $ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
18703
18691
  $ZodCheckRegex: () => $ZodCheckRegex,
18704
18692
  $ZodCheckProperty: () => $ZodCheckProperty,
18705
- $ZodCheckProperties: () => $ZodCheckProperties,
18706
18693
  $ZodCheckOverwrite: () => $ZodCheckOverwrite,
18707
18694
  $ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
18708
18695
  $ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
@@ -18747,7 +18734,6 @@ __export(exports_util, {
18747
18734
  shallowClone: () => shallowClone,
18748
18735
  safeExtend: () => safeExtend,
18749
18736
  required: () => required,
18750
- rawShape: () => rawShape,
18751
18737
  randomString: () => randomString,
18752
18738
  propertyKeyTypes: () => propertyKeyTypes,
18753
18739
  promiseAllObject: () => promiseAllObject,
@@ -18785,7 +18771,6 @@ __export(exports_util, {
18785
18771
  explicitlyAborted: () => explicitlyAborted,
18786
18772
  escapeRegex: () => escapeRegex,
18787
18773
  esc: () => esc,
18788
- derived: () => derived,
18789
18774
  defineLazyInternal: () => defineLazyInternal,
18790
18775
  defineLazy: () => defineLazy,
18791
18776
  createTransparentProxy: () => createTransparentProxy,
@@ -18840,23 +18825,18 @@ function jsonStringifyReplacer(_, value) {
18840
18825
  return value.toString();
18841
18826
  return value;
18842
18827
  }
18843
-
18844
- class Cached {
18845
- constructor(getter) {
18846
- this._getter = getter;
18847
- this._value = undefined;
18848
- }
18849
- get value() {
18850
- const getter = this._getter;
18851
- if (getter !== undefined) {
18852
- this._value = getter();
18853
- this._getter = undefined;
18854
- }
18855
- return this._value;
18856
- }
18857
- }
18858
18828
  function cached(getter) {
18859
- return new Cached(getter);
18829
+ const set = false;
18830
+ return {
18831
+ get value() {
18832
+ if (!set) {
18833
+ const value = getter();
18834
+ Object.defineProperty(this, "value", { value });
18835
+ return value;
18836
+ }
18837
+ throw new Error("cached value already set");
18838
+ }
18839
+ };
18860
18840
  }
18861
18841
  function nullish(input) {
18862
18842
  return input === null || input === undefined;
@@ -18907,56 +18887,6 @@ function assignProp(target, prop, value) {
18907
18887
  configurable: true
18908
18888
  });
18909
18889
  }
18910
- function rawShape(def) {
18911
- const desc = Object.getOwnPropertyDescriptor(def, "shape");
18912
- return desc?.get ? desc.get.raw : desc?.value;
18913
- }
18914
- function sourceShape(schema) {
18915
- return rawShape(schema._zod.def) ?? schema._zod.def.shape;
18916
- }
18917
- function deferProp(target, key, getter) {
18918
- Object.defineProperty(target, key, {
18919
- get() {
18920
- const value = getter();
18921
- assignProp(this, key, value);
18922
- return value;
18923
- },
18924
- enumerable: true,
18925
- configurable: true
18926
- });
18927
- }
18928
- function putProp(target, key, value) {
18929
- if (key in target)
18930
- assignProp(target, key, value);
18931
- else
18932
- target[key] = value;
18933
- }
18934
- function mirrorShape(target, source, keys, wrap) {
18935
- const raw = sourceShape(source);
18936
- for (const key of keys) {
18937
- const desc = Object.getOwnPropertyDescriptor(raw, key);
18938
- if (!desc.enumerable)
18939
- continue;
18940
- if (desc.get) {
18941
- deferProp(target, key, () => {
18942
- const value = source._zod.def.shape[key];
18943
- return wrap ? wrap(value, key) : value;
18944
- });
18945
- } else
18946
- putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
18947
- }
18948
- }
18949
- function mirrorProps(target, source) {
18950
- for (const key of Reflect.ownKeys(source)) {
18951
- const desc = Object.getOwnPropertyDescriptor(source, key);
18952
- if (!desc.enumerable)
18953
- continue;
18954
- if (desc.get)
18955
- deferProp(target, key, () => source[key]);
18956
- else
18957
- putProp(target, key, desc.value);
18958
- }
18959
- }
18960
18890
  function mergeDefs(...defs) {
18961
18891
  const mergedDescriptors = {};
18962
18892
  for (const def of defs) {
@@ -19194,21 +19124,23 @@ function pick(schema, mask) {
19194
19124
  if (hasChecks) {
19195
19125
  throw new Error(".pick() cannot be used on object schemas containing refinements");
19196
19126
  }
19197
- const newShape = {};
19198
- mirrorShape(newShape, schema, maskedKeys(schema, mask));
19199
- return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
19200
- }
19201
- function maskedKeys(schema, mask) {
19202
- const raw = sourceShape(schema);
19203
- const keys = [];
19204
- for (const key of Reflect.ownKeys(mask)) {
19205
- if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
19206
- throw new Error(`Unrecognized key: "${String(key)}"`);
19207
- }
19208
- if (mask[key])
19209
- keys.push(key);
19210
- }
19211
- return keys;
19127
+ const def = mergeDefs(schema._zod.def, {
19128
+ get shape() {
19129
+ const newShape = {};
19130
+ for (const key of Reflect.ownKeys(mask)) {
19131
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
19132
+ throw new Error(`Unrecognized key: "${String(key)}"`);
19133
+ }
19134
+ if (!mask[key])
19135
+ continue;
19136
+ assignProp(newShape, key, currDef.shape[key]);
19137
+ }
19138
+ assignProp(this, "shape", newShape);
19139
+ return newShape;
19140
+ },
19141
+ checks: []
19142
+ });
19143
+ return clone(schema, def);
19212
19144
  }
19213
19145
  function omit(schema, mask) {
19214
19146
  const currDef = schema._zod.def;
@@ -19217,10 +19149,23 @@ function omit(schema, mask) {
19217
19149
  if (hasChecks) {
19218
19150
  throw new Error(".omit() cannot be used on object schemas containing refinements");
19219
19151
  }
19220
- const omitted = new Set(maskedKeys(schema, mask));
19221
- const newShape = {};
19222
- mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
19223
- return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
19152
+ const def = mergeDefs(schema._zod.def, {
19153
+ get shape() {
19154
+ const newShape = { ...schema._zod.def.shape };
19155
+ for (const key of Reflect.ownKeys(mask)) {
19156
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
19157
+ throw new Error(`Unrecognized key: "${String(key)}"`);
19158
+ }
19159
+ if (!mask[key])
19160
+ continue;
19161
+ delete newShape[key];
19162
+ }
19163
+ assignProp(this, "shape", newShape);
19164
+ return newShape;
19165
+ },
19166
+ checks: []
19167
+ });
19168
+ return clone(schema, def);
19224
19169
  }
19225
19170
  function extend(schema, shape) {
19226
19171
  if (!isPlainObject(shape)) {
@@ -19229,26 +19174,34 @@ function extend(schema, shape) {
19229
19174
  const checks = schema._zod.def.checks;
19230
19175
  const hasChecks = checks && checks.length > 0;
19231
19176
  if (hasChecks) {
19232
- const existingShape = sourceShape(schema);
19177
+ const existingShape = schema._zod.def.shape;
19233
19178
  for (const key of Reflect.ownKeys(shape)) {
19234
19179
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
19235
19180
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
19236
19181
  }
19237
19182
  }
19238
19183
  }
19239
- return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
19240
- }
19241
- function extended(schema, shape) {
19242
- const newShape = {};
19243
- mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
19244
- mirrorProps(newShape, shape);
19245
- return newShape;
19184
+ const def = mergeDefs(schema._zod.def, {
19185
+ get shape() {
19186
+ const _shape = { ...schema._zod.def.shape, ...shape };
19187
+ assignProp(this, "shape", _shape);
19188
+ return _shape;
19189
+ }
19190
+ });
19191
+ return clone(schema, def);
19246
19192
  }
19247
19193
  function safeExtend(schema, shape) {
19248
19194
  if (!isPlainObject(shape)) {
19249
19195
  throw new Error("Invalid input to safeExtend: expected a plain object");
19250
19196
  }
19251
- return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
19197
+ const def = mergeDefs(schema._zod.def, {
19198
+ get shape() {
19199
+ const _shape = { ...schema._zod.def.shape, ...shape };
19200
+ assignProp(this, "shape", _shape);
19201
+ return _shape;
19202
+ }
19203
+ });
19204
+ return clone(schema, def);
19252
19205
  }
19253
19206
  function merge(a, b) {
19254
19207
  if (!b?._zod?.def) {
@@ -19257,11 +19210,12 @@ function merge(a, b) {
19257
19210
  if (a._zod.def.checks?.length) {
19258
19211
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
19259
19212
  }
19260
- const newShape = {};
19261
- mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
19262
- mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
19263
19213
  const def = mergeDefs(a._zod.def, {
19264
- shape: newShape,
19214
+ get shape() {
19215
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
19216
+ assignProp(this, "shape", _shape);
19217
+ return _shape;
19218
+ },
19265
19219
  get catchall() {
19266
19220
  return b._zod.def.catchall;
19267
19221
  },
@@ -19276,16 +19230,67 @@ function partial(Class, schema, mask, name = "partial") {
19276
19230
  if (hasChecks) {
19277
19231
  throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
19278
19232
  }
19279
- const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
19280
- const newShape = {};
19281
- mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })));
19282
- return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
19233
+ const def = mergeDefs(schema._zod.def, {
19234
+ get shape() {
19235
+ const oldShape = schema._zod.def.shape;
19236
+ const shape = { ...oldShape };
19237
+ if (mask) {
19238
+ for (const key of Reflect.ownKeys(mask)) {
19239
+ if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
19240
+ throw new Error(`Unrecognized key: "${String(key)}"`);
19241
+ }
19242
+ if (!mask[key])
19243
+ continue;
19244
+ shape[key] = Class ? new Class({
19245
+ type: "optional",
19246
+ innerType: oldShape[key]
19247
+ }) : oldShape[key];
19248
+ }
19249
+ } else {
19250
+ for (const key of Reflect.ownKeys(oldShape)) {
19251
+ shape[key] = Class ? new Class({
19252
+ type: "optional",
19253
+ innerType: oldShape[key]
19254
+ }) : oldShape[key];
19255
+ }
19256
+ }
19257
+ assignProp(this, "shape", shape);
19258
+ return shape;
19259
+ },
19260
+ checks: []
19261
+ });
19262
+ return clone(schema, def);
19283
19263
  }
19284
19264
  function required(Class, schema, mask) {
19285
- const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
19286
- const newShape = {};
19287
- mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
19288
- return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
19265
+ const def = mergeDefs(schema._zod.def, {
19266
+ get shape() {
19267
+ const oldShape = schema._zod.def.shape;
19268
+ const shape = { ...oldShape };
19269
+ if (mask) {
19270
+ for (const key of Reflect.ownKeys(mask)) {
19271
+ if (!Object.prototype.hasOwnProperty.call(shape, key)) {
19272
+ throw new Error(`Unrecognized key: "${String(key)}"`);
19273
+ }
19274
+ if (!mask[key])
19275
+ continue;
19276
+ shape[key] = new Class({
19277
+ type: "nonoptional",
19278
+ innerType: oldShape[key]
19279
+ });
19280
+ }
19281
+ } else {
19282
+ for (const key of Reflect.ownKeys(oldShape)) {
19283
+ shape[key] = new Class({
19284
+ type: "nonoptional",
19285
+ innerType: oldShape[key]
19286
+ });
19287
+ }
19288
+ }
19289
+ assignProp(this, "shape", shape);
19290
+ return shape;
19291
+ }
19292
+ });
19293
+ return clone(schema, def);
19289
19294
  }
19290
19295
  function aborted(x, startIndex = 0) {
19291
19296
  if (x.aborted === true)
@@ -19335,18 +19340,13 @@ function finalizeIssue(iss, ctx, config) {
19335
19340
  }
19336
19341
  const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
19337
19342
  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";
19338
- const full = {};
19339
- for (const k of Object.keys(iss)) {
19340
- if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
19341
- continue;
19342
- full[k] = iss[k];
19343
- }
19344
- full.path ?? (full.path = []);
19345
- full.message = message;
19343
+ const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
19344
+ rest.path ?? (rest.path = []);
19345
+ rest.message = message;
19346
19346
  if (ctx?.reportInput) {
19347
- full.input = iss.input;
19347
+ rest.input = _input;
19348
19348
  }
19349
- return full;
19349
+ return rest;
19350
19350
  }
19351
19351
  function getSizableOrigin(input) {
19352
19352
  if (input instanceof Set)
@@ -19473,22 +19473,6 @@ function own(inst, key, value, enumerable = true) {
19473
19473
  function hide(inst, key, value) {
19474
19474
  return own(inst, key, value, false);
19475
19475
  }
19476
- function derived(computes, table) {
19477
- for (const key in computes) {
19478
- const compute = computes[key];
19479
- Object.defineProperty(table, key, {
19480
- configurable: true,
19481
- enumerable: true,
19482
- get() {
19483
- return own(this, key, compute(this));
19484
- },
19485
- set(value) {
19486
- own(this, key, value);
19487
- }
19488
- });
19489
- }
19490
- return table;
19491
- }
19492
19476
  function defineBound(proto, key, fn) {
19493
19477
  Object.defineProperty(proto, key, {
19494
19478
  configurable: true,
@@ -19615,7 +19599,8 @@ function $constructor(name, initializer, proto, params) {
19615
19599
  } finally {
19616
19600
  _zodDesc.value = undefined;
19617
19601
  }
19618
- } else if (inst._zod.traits.has(name)) {
19602
+ }
19603
+ if (inst._zod.traits.has(name)) {
19619
19604
  return;
19620
19605
  }
19621
19606
  inst._zod.traits.add(name);
@@ -19708,12 +19693,16 @@ var _messageDesc = {
19708
19693
  enumerable: true,
19709
19694
  configurable: true
19710
19695
  };
19696
+ var _zodDesc2 = { value: undefined, enumerable: false };
19711
19697
  var _issuesDesc = { value: undefined, enumerable: false };
19712
19698
  var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
19713
19699
  var initializer = (inst, def) => {
19714
19700
  inst.name = "$ZodError";
19701
+ _zodDesc2.value = inst._zod;
19702
+ Object.defineProperty(inst, "_zod", _zodDesc2);
19715
19703
  _issuesDesc.value = def;
19716
19704
  Object.defineProperty(inst, "issues", _issuesDesc);
19705
+ _zodDesc2.value = undefined;
19717
19706
  _issuesDesc.value = undefined;
19718
19707
  Object.defineProperty(inst, "message", _messageDesc);
19719
19708
  const proto = Object.getPrototypeOf(inst);
@@ -19929,50 +19918,33 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
19929
19918
  if (result instanceof Promise) {
19930
19919
  throw new $ZodAsyncError;
19931
19920
  }
19932
- return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
19921
+ return result.issues.length ? {
19922
+ success: false,
19923
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
19924
+ } : { success: true, data: result.value };
19933
19925
  };
19934
19926
  var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
19935
- function failure(Err, issues, ctx) {
19936
- let error;
19937
- return {
19938
- success: false,
19939
- get error() {
19940
- if (!error) {
19941
- error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
19942
- issues = undefined;
19943
- ctx = undefined;
19944
- }
19945
- return error;
19946
- },
19947
- set error(e2) {
19948
- error = e2;
19949
- issues = undefined;
19950
- ctx = undefined;
19951
- }
19952
- };
19953
- }
19954
19927
  var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
19955
19928
  const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
19956
19929
  let result = schema._zod.run({ value, issues: [] }, ctx);
19957
19930
  if (result instanceof Promise)
19958
19931
  result = await result;
19959
- return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
19932
+ return result.issues.length ? {
19933
+ success: false,
19934
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
19935
+ } : { success: true, data: result.value };
19960
19936
  };
19961
19937
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
19962
19938
  var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
19963
19939
  var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
19964
19940
  var validate = (schema, value, _ctx) => {
19965
19941
  const validator = schema._zod.bag.validator;
19966
- if (validator !== undefined) {
19967
- if (validator(value) !== COMPILE_INVALID)
19968
- return true;
19969
- if (validator.definite === true && _ctx === undefined)
19970
- return false;
19971
- }
19942
+ if (validator !== undefined && validator(value) !== COMPILE_INVALID)
19943
+ return true;
19972
19944
  return validateFallback(schema, value, _ctx);
19973
19945
  };
19974
19946
  function validateFallback(schema, value, _ctx) {
19975
- const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
19947
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
19976
19948
  const fallbackRun = schema._zod.bag.fallbackRun;
19977
19949
  let result;
19978
19950
  if (fallbackRun) {
@@ -19987,7 +19959,7 @@ function validateFallback(schema, value, _ctx) {
19987
19959
  return result.issues.length === 0;
19988
19960
  }
19989
19961
  var validateAsync = async (schema, value, _ctx) => {
19990
- const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
19962
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
19991
19963
  let result = schema._zod.run({ value, issues: [] }, ctx);
19992
19964
  if (result instanceof Promise)
19993
19965
  result = await result;
@@ -20086,7 +20058,6 @@ __export(exports_regexes, {
20086
20058
  ipv4: () => ipv4,
20087
20059
  integer: () => integer,
20088
20060
  idnEmail: () => idnEmail,
20089
- iban: () => iban,
20090
20061
  httpProtocol: () => httpProtocol,
20091
20062
  html5Email: () => html5Email,
20092
20063
  hostname: () => hostname2,
@@ -20100,7 +20071,6 @@ __export(exports_regexes, {
20100
20071
  domain: () => domain,
20101
20072
  datetime: () => datetime,
20102
20073
  date: () => date,
20103
- currencyCode: () => currencyCode,
20104
20074
  cuid2: () => cuid2,
20105
20075
  cuid: () => cuid,
20106
20076
  creditCard: () => creditCard,
@@ -20110,8 +20080,7 @@ __export(exports_regexes, {
20110
20080
  boolean: () => boolean,
20111
20081
  bigint: () => bigint,
20112
20082
  base64url: () => base64url,
20113
- base64: () => base64,
20114
- anyString: () => anyString
20083
+ base64: () => base64
20115
20084
  });
20116
20085
  var cuid = /^[cC][0-9a-z]{6,}$/;
20117
20086
  var cuid2 = /^[0-9a-z]+$/;
@@ -20133,13 +20102,13 @@ var uuid = (version) => {
20133
20102
  var uuid4 = /* @__PURE__ */ uuid(4);
20134
20103
  var uuid6 = /* @__PURE__ */ uuid(6);
20135
20104
  var uuid7 = /* @__PURE__ */ uuid(7);
20136
- var 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,}$/;
20105
+ var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
20137
20106
  var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
20138
20107
  var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
20139
20108
  var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
20140
20109
  var idnEmail = unicodeEmail;
20141
20110
  var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
20142
- var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
20111
+ var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
20143
20112
  function emoji() {
20144
20113
  return new RegExp(_emoji, "u");
20145
20114
  }
@@ -20152,14 +20121,12 @@ var mac = (delimiter) => {
20152
20121
  var 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])$/;
20153
20122
  var 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])$/;
20154
20123
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
20155
- var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
20124
+ var base64url = /^[A-Za-z0-9_-]*$/;
20156
20125
  var hostname2 = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
20157
20126
  var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
20158
20127
  var httpProtocol = /^https?$/;
20159
20128
  var e164 = /^\+[1-9]\d{6,14}$/;
20160
20129
  var creditCard = /^\d(?:[ -]?\d){11,18}$/;
20161
- var currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
20162
- var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
20163
20130
  var 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])))`;
20164
20131
  function anchor(source) {
20165
20132
  return new RegExp(`^${source}$`);
@@ -20181,7 +20148,6 @@ function datetime(args) {
20181
20148
  const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
20182
20149
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
20183
20150
  }
20184
- var anyString = /^[\s\S]{0,}$/;
20185
20151
  var string = (params) => {
20186
20152
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
20187
20153
  return new RegExp(`^${regex}$`);
@@ -20240,6 +20206,16 @@ var numericOriginMap = {
20240
20206
  var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
20241
20207
  $ZodCheck.init(inst, def);
20242
20208
  const origin = numericOriginMap[typeof def.value];
20209
+ inst._zod.onattach.push((inst2) => {
20210
+ const bag = inst2._zod.bag;
20211
+ const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
20212
+ if (def.value < curr) {
20213
+ if (def.inclusive)
20214
+ bag.maximum = def.value;
20215
+ else
20216
+ bag.exclusiveMaximum = def.value;
20217
+ }
20218
+ });
20243
20219
  inst._zod.check = (payload) => {
20244
20220
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
20245
20221
  return;
@@ -20258,6 +20234,16 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
20258
20234
  var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
20259
20235
  $ZodCheck.init(inst, def);
20260
20236
  const origin = numericOriginMap[typeof def.value];
20237
+ inst._zod.onattach.push((inst2) => {
20238
+ const bag = inst2._zod.bag;
20239
+ const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
20240
+ if (def.value > curr) {
20241
+ if (def.inclusive)
20242
+ bag.minimum = def.value;
20243
+ else
20244
+ bag.exclusiveMinimum = def.value;
20245
+ }
20246
+ });
20261
20247
  inst._zod.check = (payload) => {
20262
20248
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
20263
20249
  return;
@@ -20275,6 +20261,10 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
20275
20261
  });
20276
20262
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
20277
20263
  $ZodCheck.init(inst, def);
20264
+ inst._zod.onattach.push((inst2) => {
20265
+ var _a2;
20266
+ (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
20267
+ });
20278
20268
  inst._zod.check = (payload) => {
20279
20269
  if (typeof payload.value !== typeof def.value)
20280
20270
  throw new Error("Cannot mix number and bigint in multiple_of check.");
@@ -20297,6 +20287,14 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
20297
20287
  const isInt = def.format?.includes("int");
20298
20288
  const origin = isInt ? "int" : "number";
20299
20289
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
20290
+ inst._zod.onattach.push((inst2) => {
20291
+ const bag = inst2._zod.bag;
20292
+ bag.format = def.format;
20293
+ bag.minimum = minimum;
20294
+ bag.maximum = maximum;
20295
+ if (isInt)
20296
+ bag.pattern = integer;
20297
+ });
20300
20298
  inst._zod.check = (payload) => {
20301
20299
  const input = payload.value;
20302
20300
  if (isInt) {
@@ -20365,6 +20363,12 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
20365
20363
  var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
20366
20364
  $ZodCheck.init(inst, def);
20367
20365
  const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
20366
+ inst._zod.onattach.push((inst2) => {
20367
+ const bag = inst2._zod.bag;
20368
+ bag.format = def.format;
20369
+ bag.minimum = minimum;
20370
+ bag.maximum = maximum;
20371
+ });
20368
20372
  inst._zod.check = (payload) => {
20369
20373
  const input = payload.value;
20370
20374
  if (input < minimum) {
@@ -20395,6 +20399,11 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
20395
20399
  var _a2;
20396
20400
  $ZodCheck.init(inst, def);
20397
20401
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
20402
+ inst._zod.onattach.push((inst2) => {
20403
+ const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
20404
+ if (def.maximum < curr)
20405
+ inst2._zod.bag.maximum = def.maximum;
20406
+ });
20398
20407
  inst._zod.check = (payload) => {
20399
20408
  const input = payload.value;
20400
20409
  const size = input.size;
@@ -20415,6 +20424,11 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
20415
20424
  var _a2;
20416
20425
  $ZodCheck.init(inst, def);
20417
20426
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
20427
+ inst._zod.onattach.push((inst2) => {
20428
+ const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
20429
+ if (def.minimum > curr)
20430
+ inst2._zod.bag.minimum = def.minimum;
20431
+ });
20418
20432
  inst._zod.check = (payload) => {
20419
20433
  const input = payload.value;
20420
20434
  const size = input.size;
@@ -20435,6 +20449,12 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
20435
20449
  var _a2;
20436
20450
  $ZodCheck.init(inst, def);
20437
20451
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
20452
+ inst._zod.onattach.push((inst2) => {
20453
+ const bag = inst2._zod.bag;
20454
+ bag.minimum = def.size;
20455
+ bag.maximum = def.size;
20456
+ bag.size = def.size;
20457
+ });
20438
20458
  inst._zod.check = (payload) => {
20439
20459
  const input = payload.value;
20440
20460
  const size = input.size;
@@ -20456,6 +20476,11 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
20456
20476
  var _a2;
20457
20477
  $ZodCheck.init(inst, def);
20458
20478
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
20479
+ inst._zod.onattach.push((inst2) => {
20480
+ const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
20481
+ if (def.maximum < curr)
20482
+ inst2._zod.bag.maximum = def.maximum;
20483
+ });
20459
20484
  inst._zod.check = (payload) => {
20460
20485
  const input = payload.value;
20461
20486
  const units = input.length;
@@ -20478,6 +20503,11 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
20478
20503
  var _a2;
20479
20504
  $ZodCheck.init(inst, def);
20480
20505
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
20506
+ inst._zod.onattach.push((inst2) => {
20507
+ const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
20508
+ if (def.minimum > curr)
20509
+ inst2._zod.bag.minimum = def.minimum;
20510
+ });
20481
20511
  inst._zod.check = (payload) => {
20482
20512
  const input = payload.value;
20483
20513
  const units = input.length;
@@ -20500,6 +20530,12 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
20500
20530
  var _a2;
20501
20531
  $ZodCheck.init(inst, def);
20502
20532
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
20533
+ inst._zod.onattach.push((inst2) => {
20534
+ const bag = inst2._zod.bag;
20535
+ bag.minimum = def.length;
20536
+ bag.maximum = def.length;
20537
+ bag.length = def.length;
20538
+ });
20503
20539
  inst._zod.check = (payload) => {
20504
20540
  const input = payload.value;
20505
20541
  const units = input.length;
@@ -20522,6 +20558,14 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
20522
20558
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
20523
20559
  var _a2, _b;
20524
20560
  $ZodCheck.init(inst, def);
20561
+ inst._zod.onattach.push((inst2) => {
20562
+ const bag = inst2._zod.bag;
20563
+ bag.format = def.format;
20564
+ if (def.pattern) {
20565
+ bag.patterns ?? (bag.patterns = new Set);
20566
+ bag.patterns.add(def.pattern);
20567
+ }
20568
+ });
20525
20569
  if (def.pattern)
20526
20570
  (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
20527
20571
  def.pattern.lastIndex = 0;
@@ -20570,6 +20614,11 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
20570
20614
  const escapedRegex = escapeRegex(def.includes);
20571
20615
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
20572
20616
  def.pattern = pattern;
20617
+ inst._zod.onattach.push((inst2) => {
20618
+ const bag = inst2._zod.bag;
20619
+ bag.patterns ?? (bag.patterns = new Set);
20620
+ bag.patterns.add(pattern);
20621
+ });
20573
20622
  inst._zod.check = (payload) => {
20574
20623
  if (payload.value.includes(def.includes, def.position))
20575
20624
  return;
@@ -20588,6 +20637,11 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
20588
20637
  $ZodCheck.init(inst, def);
20589
20638
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
20590
20639
  def.pattern ?? (def.pattern = pattern);
20640
+ inst._zod.onattach.push((inst2) => {
20641
+ const bag = inst2._zod.bag;
20642
+ bag.patterns ?? (bag.patterns = new Set);
20643
+ bag.patterns.add(pattern);
20644
+ });
20591
20645
  inst._zod.check = (payload) => {
20592
20646
  if (payload.value.startsWith(def.prefix))
20593
20647
  return;
@@ -20606,6 +20660,11 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
20606
20660
  $ZodCheck.init(inst, def);
20607
20661
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
20608
20662
  def.pattern ?? (def.pattern = pattern);
20663
+ inst._zod.onattach.push((inst2) => {
20664
+ const bag = inst2._zod.bag;
20665
+ bag.patterns ?? (bag.patterns = new Set);
20666
+ bag.patterns.add(pattern);
20667
+ });
20609
20668
  inst._zod.check = (payload) => {
20610
20669
  if (payload.value.endsWith(def.suffix))
20611
20670
  return;
@@ -20639,39 +20698,12 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
20639
20698
  return;
20640
20699
  };
20641
20700
  });
20642
- var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
20643
- $ZodCheck.init(inst, def);
20644
- hide(inst, Symbol.iterator, function* () {
20645
- yield inst;
20646
- });
20647
- let entries;
20648
- inst._zod.check = (payload) => {
20649
- if (payload.value == null) {
20650
- payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
20651
- return;
20652
- }
20653
- entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
20654
- const input = payload.value;
20655
- let proms;
20656
- for (const [key, schema] of entries) {
20657
- const result = schema._zod.run({ value: input[key], issues: [] }, {});
20658
- if (result instanceof Promise) {
20659
- proms ?? (proms = []);
20660
- proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
20661
- } else {
20662
- handleCheckPropertyResult(result, payload, key);
20663
- }
20664
- }
20665
- if (proms)
20666
- return Promise.all(proms).then(() => {
20667
- return;
20668
- });
20669
- return;
20670
- };
20671
- });
20672
20701
  var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
20673
20702
  $ZodCheck.init(inst, def);
20674
20703
  const mimeSet = new Set(def.mime);
20704
+ inst._zod.onattach.push((inst2) => {
20705
+ inst2._zod.bag.mime = def.mime;
20706
+ });
20675
20707
  inst._zod.check = (payload) => {
20676
20708
  if (mimeSet.has(payload.value.type))
20677
20709
  return;
@@ -20701,11 +20733,8 @@ class Doc {
20701
20733
  }
20702
20734
  indented(fn) {
20703
20735
  this.indent += 1;
20704
- try {
20705
- fn(this);
20706
- } finally {
20707
- this.indent -= 1;
20708
- }
20736
+ fn(this);
20737
+ this.indent -= 1;
20709
20738
  }
20710
20739
  write(arg) {
20711
20740
  if (typeof arg === "function") {
@@ -20736,8 +20765,8 @@ ${content.join(`
20736
20765
  // node_modules/zod/v4/core/versions.js
20737
20766
  var version = {
20738
20767
  major: 4,
20739
- minor: 6,
20740
- patch: 5
20768
+ minor: 5,
20769
+ patch: 4
20741
20770
  };
20742
20771
 
20743
20772
  // node_modules/zod/v4/core/schemas.js
@@ -20849,21 +20878,15 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
20849
20878
  own(this, "~standard", value);
20850
20879
  }
20851
20880
  });
20852
- var toStandardResult = (r2, ctx) => r2.issues.length ? { issues: r2.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r2.value };
20853
- async function validateAsync2(inst, value) {
20854
- const ctx = { async: true };
20855
- return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
20856
- }
20881
+ var toStandardResult = (r2) => r2.success ? { value: r2.data } : { issues: r2.error?.issues };
20857
20882
  function standardProps(inst) {
20858
20883
  return {
20859
20884
  validate: (value) => {
20860
- const ctx = { async: false };
20861
20885
  try {
20862
- const r2 = inst._zod.run({ value, issues: [] }, ctx);
20863
- if (!(r2 instanceof Promise))
20864
- return toStandardResult(r2, ctx);
20865
- } catch (_) {}
20866
- return validateAsync2(inst, value);
20886
+ return toStandardResult(safeParse(inst, value));
20887
+ } catch (_) {
20888
+ return safeParseAsync(inst, value).then(toStandardResult);
20889
+ }
20867
20890
  },
20868
20891
  vendor: "zod",
20869
20892
  version: 1
@@ -20871,7 +20894,7 @@ function standardProps(inst) {
20871
20894
  }
20872
20895
  var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
20873
20896
  $ZodType.init(inst, def);
20874
- inst._zod.pattern = def.pattern ?? anyString;
20897
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
20875
20898
  inst._zod.parse = (payload, _) => {
20876
20899
  if (def.coerce)
20877
20900
  try {
@@ -20922,32 +20945,11 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
20922
20945
  });
20923
20946
  var URL_BAD_FORMAT = 1;
20924
20947
  var URL_UNPARSEABLE = 2;
20925
- function canParseURL(input) {
20926
- try {
20927
- if (typeof URL !== "undefined" && typeof URL.canParse === "function")
20928
- return URL.canParse(input);
20929
- new URL(input);
20930
- return true;
20931
- } catch {
20932
- return false;
20933
- }
20934
- }
20935
- function validateURL(trimmed, def) {
20936
- if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
20937
- return canParseURL(trimmed) || URL_UNPARSEABLE;
20938
- }
20939
- return parseURLObject(trimmed, def);
20940
- }
20941
20948
  function parseURLObject(trimmed, def) {
20942
20949
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
20943
20950
  return URL_BAD_FORMAT;
20944
20951
  }
20945
20952
  try {
20946
- if (typeof URL !== "undefined") {
20947
- const URLStatic = URL;
20948
- if (typeof URLStatic.parse === "function")
20949
- return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
20950
- }
20951
20953
  return new URL(trimmed);
20952
20954
  } catch {
20953
20955
  return URL_UNPARSEABLE;
@@ -20970,7 +20972,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
20970
20972
  inst._zod.check = (payload) => {
20971
20973
  try {
20972
20974
  const trimmed = payload.value.trim();
20973
- const url = validateURL(trimmed, def);
20975
+ const url = parseURLObject(trimmed, def);
20974
20976
  if (url === URL_BAD_FORMAT) {
20975
20977
  payload.issues.push({
20976
20978
  code: "invalid_format",
@@ -20992,10 +20994,6 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
20992
20994
  });
20993
20995
  return;
20994
20996
  }
20995
- if (url === true) {
20996
- payload.value = stripTabAndNewline(trimmed);
20997
- return;
20998
- }
20999
20997
  if (def.hostname && !urlHostnameOk(url, def.hostname)) {
21000
20998
  payload.issues.push({
21001
20999
  code: "invalid_format",
@@ -21064,6 +21062,12 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
21064
21062
  var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
21065
21063
  def.pattern ?? (def.pattern = datetime(def));
21066
21064
  $ZodStringFormat.init(inst, def);
21065
+ if (def.local || def.precision === -1) {
21066
+ inst._zod.bag.laxFormat = true;
21067
+ inst._zod.onattach.push((s) => {
21068
+ s._zod.bag.laxFormat = true;
21069
+ });
21070
+ }
21067
21071
  });
21068
21072
  var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
21069
21073
  def.pattern ?? (def.pattern = date);
@@ -21080,16 +21084,23 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
21080
21084
  var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
21081
21085
  def.pattern ?? (def.pattern = ipv4);
21082
21086
  $ZodStringFormat.init(inst, def);
21087
+ inst._zod.bag.format = `ipv4`;
21083
21088
  });
21084
21089
  var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
21085
21090
  function isValidIPv6(value) {
21086
21091
  if (!ipv6Alphabet.test(value))
21087
21092
  return false;
21088
- return canParseURL(`http://[${value}]`);
21093
+ try {
21094
+ new URL(`http://[${value}]`);
21095
+ return true;
21096
+ } catch {
21097
+ return false;
21098
+ }
21089
21099
  }
21090
21100
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
21091
21101
  def.pattern ?? (def.pattern = ipv6);
21092
21102
  $ZodStringFormat.init(inst, def);
21103
+ inst._zod.bag.format = `ipv6`;
21093
21104
  inst._zod.check = (payload) => {
21094
21105
  if (!isValidIPv6(payload.value)) {
21095
21106
  payload.issues.push({
@@ -21105,6 +21116,7 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
21105
21116
  var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
21106
21117
  def.pattern ?? (def.pattern = mac(def.delimiter));
21107
21118
  $ZodStringFormat.init(inst, def);
21119
+ inst._zod.bag.format = `mac`;
21108
21120
  });
21109
21121
  var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
21110
21122
  def.pattern ?? (def.pattern = cidrv4);
@@ -21153,10 +21165,10 @@ function isValidBase64(data) {
21153
21165
  return false;
21154
21166
  }
21155
21167
  }
21156
- var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
21157
21168
  var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
21158
- def.pattern ?? (def.pattern = base64Charset);
21169
+ def.pattern ?? (def.pattern = base64);
21159
21170
  $ZodStringFormat.init(inst, def);
21171
+ inst._zod.bag.contentEncoding = "base64";
21160
21172
  inst._zod.check = (payload) => {
21161
21173
  if (isValidBase64(payload.value))
21162
21174
  return;
@@ -21169,17 +21181,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
21169
21181
  });
21170
21182
  };
21171
21183
  });
21172
- var base64urlCharset = /^[A-Za-z0-9_-]*$/;
21173
21184
  function isValidBase64URL(data) {
21174
- if (!base64urlCharset.test(data))
21185
+ if (!base64url.test(data))
21175
21186
  return false;
21176
21187
  const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
21177
21188
  const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
21178
21189
  return isValidBase64(padded);
21179
21190
  }
21180
21191
  var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
21181
- def.pattern ?? (def.pattern = base64urlCharset);
21192
+ def.pattern ?? (def.pattern = base64url);
21182
21193
  $ZodStringFormat.init(inst, def);
21194
+ inst._zod.bag.contentEncoding = "base64url";
21183
21195
  inst._zod.check = (payload) => {
21184
21196
  if (isValidBase64URL(payload.value))
21185
21197
  return;
@@ -21202,7 +21214,7 @@ function isLuhnAlgo(digits) {
21202
21214
  let bit = 1;
21203
21215
  let sum = 0;
21204
21216
  while (length) {
21205
- const value = digits.charCodeAt(--length) - 48;
21217
+ const value = +digits[--length];
21206
21218
  bit ^= 1;
21207
21219
  sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
21208
21220
  }
@@ -21228,39 +21240,6 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
21228
21240
  });
21229
21241
  };
21230
21242
  });
21231
- function isIso7064Mod97(iban2) {
21232
- let remainder = 0;
21233
- const len = iban2.length;
21234
- for (let i = 4;i < len; i++) {
21235
- const code = iban2.charCodeAt(i);
21236
- remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
21237
- }
21238
- for (let i = 0;i < 4; i++) {
21239
- const code = iban2.charCodeAt(i);
21240
- remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
21241
- }
21242
- return remainder === 1;
21243
- }
21244
- function isValidIBAN(input) {
21245
- if (!iban.test(input))
21246
- return false;
21247
- return isIso7064Mod97(input);
21248
- }
21249
- var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
21250
- def.pattern ?? (def.pattern = iban);
21251
- $ZodStringFormat.init(inst, def);
21252
- inst._zod.check = (payload) => {
21253
- if (isValidIBAN(payload.value))
21254
- return;
21255
- payload.issues.push({
21256
- code: "invalid_format",
21257
- format: "iban",
21258
- input: payload.value,
21259
- inst,
21260
- continue: !def.abort
21261
- });
21262
- };
21263
- });
21264
21243
  function isValidJWT(token, algorithm = null) {
21265
21244
  try {
21266
21245
  const tokensParts = token.split(".");
@@ -21311,7 +21290,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
21311
21290
  });
21312
21291
  var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
21313
21292
  $ZodType.init(inst, def);
21314
- inst._zod.pattern = number;
21293
+ inst._zod.pattern = inst._zod.bag.pattern ?? number;
21315
21294
  inst._zod.parse = (payload, _ctx) => {
21316
21295
  if (def.coerce)
21317
21296
  try {
@@ -21509,7 +21488,6 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
21509
21488
  }
21510
21489
  payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
21511
21490
  const proms = [];
21512
- const abortEarly = ctx?.abortEarly;
21513
21491
  for (let i = 0;i < input.length; i++) {
21514
21492
  const item = input[i];
21515
21493
  const result = def.element._zod.run({
@@ -21520,8 +21498,6 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
21520
21498
  proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
21521
21499
  } else {
21522
21500
  handleArrayResult(result, payload, i);
21523
- if (abortEarly && result.issues.length !== 0 && aborted(result))
21524
- break;
21525
21501
  }
21526
21502
  }
21527
21503
  if (proms.length) {
@@ -21554,7 +21530,7 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
21554
21530
  return;
21555
21531
  }
21556
21532
  if (result.value === undefined) {
21557
- if (isPresent || optin === "defaulted" && !isOptionalOut) {
21533
+ if (isPresent) {
21558
21534
  final.value[key] = undefined;
21559
21535
  }
21560
21536
  } else {
@@ -21582,20 +21558,14 @@ function normalizeDef(def) {
21582
21558
  optionalKeys: new Set(okeys)
21583
21559
  };
21584
21560
  }
21585
- function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
21561
+ function handleCatchall(proms, input, payload, ctx, def, inst) {
21586
21562
  const unrecognized = [];
21587
21563
  const keySet = def.keySet;
21588
21564
  const _catchall = def.catchall._zod;
21589
21565
  const t2 = _catchall.def.type;
21590
21566
  const optin = _catchall.optin;
21591
21567
  const optout = _catchall.optout;
21592
- let seen = 0;
21593
21568
  for (const key in input) {
21594
- if (abortEarly && payload.issues.length !== seen) {
21595
- if (aborted(payload, seen))
21596
- break;
21597
- seen = payload.issues.length;
21598
- }
21599
21569
  if (keySet.has(key))
21600
21570
  continue;
21601
21571
  if (key === "__proto__") {
@@ -21629,19 +21599,23 @@ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
21629
21599
  return payload;
21630
21600
  });
21631
21601
  }
21602
+ var propShapes = new WeakMap;
21632
21603
  var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
21633
21604
  $ZodType.init(inst, def);
21634
21605
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
21635
- const sh = desc?.get ? desc.get.raw : def.shape ?? {};
21636
- if (sh) {
21637
- const get = () => {
21638
- const newSh = { ...sh };
21639
- Object.defineProperty(def, "shape", { value: newSh });
21640
- get.raw = newSh;
21641
- return newSh;
21642
- };
21643
- get.raw = sh;
21644
- Object.defineProperty(def, "shape", { get });
21606
+ if (!desc?.get) {
21607
+ const sh = def.shape;
21608
+ propShapes.set(def, sh);
21609
+ Object.defineProperty(def, "shape", {
21610
+ get: () => {
21611
+ const newSh = { ...sh };
21612
+ Object.defineProperty(def, "shape", {
21613
+ value: newSh
21614
+ });
21615
+ propShapes.set(def, newSh);
21616
+ return newSh;
21617
+ }
21618
+ });
21645
21619
  }
21646
21620
  const _normalized = cached(() => normalizeDef(def));
21647
21621
  defineLazyInternal(inst, "propValues", (zod) => {
@@ -21681,14 +21655,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
21681
21655
  payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
21682
21656
  const proms = [];
21683
21657
  const shape = value.shape;
21684
- const abortEarly = ctx?.abortEarly;
21685
- let seen = payload.issues.length;
21686
21658
  for (const key of value.allKeys) {
21687
- if (abortEarly && payload.issues.length !== seen) {
21688
- if (aborted(payload, seen))
21689
- break;
21690
- seen = payload.issues.length;
21691
- }
21692
21659
  if (key === "__proto__")
21693
21660
  continue;
21694
21661
  const el = shape[key];
@@ -21704,7 +21671,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
21704
21671
  if (!catchall) {
21705
21672
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
21706
21673
  }
21707
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
21674
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
21708
21675
  };
21709
21676
  });
21710
21677
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -21718,16 +21685,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21718
21685
  const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
21719
21686
  const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
21720
21687
  const prefixStr = (id, k) => `
21721
- let ${id}_ab = false;
21722
21688
  for (let i = 0; i < ${id}.issues.length; i++) {
21723
21689
  const iss = ${id}.issues[i];
21724
21690
  iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
21725
21691
  payload.issues.push(iss);
21726
- if (iss.continue !== true) ${id}_ab = true;
21727
- }
21728
- if (${id}_ab && ctx && ctx.abortEarly) {
21729
- payload.value = newResult;
21730
- return payload;
21731
21692
  }`;
21732
21693
  doc.write(`const input = payload.value;`);
21733
21694
  const ids = Object.create(null);
@@ -21773,10 +21734,6 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21773
21734
  input: undefined,
21774
21735
  path: [${k}]
21775
21736
  });
21776
- if (ctx && ctx.abortEarly) {
21777
- payload.value = newResult;
21778
- return payload;
21779
- }
21780
21737
  }
21781
21738
 
21782
21739
  if (${id}_present) {
@@ -21788,16 +21745,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21788
21745
  doc.write(`
21789
21746
  if (${id}.issues.length) {${prefixStr(id, k)}
21790
21747
  }
21791
- `);
21792
- if (optin === "defaulted") {
21793
- doc.write(`newResult[${k}] = ${id}.value;`);
21748
+
21749
+ if (${id}.value === undefined) {
21750
+ if (${isPresent}) {
21751
+ newResult[${k}] = undefined;
21752
+ }
21794
21753
  } else {
21795
- doc.write(`
21796
- if (${id}.value !== undefined || ${isPresent}) {
21797
21754
  newResult[${k}] = ${id}.value;
21798
21755
  }
21756
+
21799
21757
  `);
21800
- }
21801
21758
  }
21802
21759
  }
21803
21760
  doc.write(`payload.value = newResult;`);
@@ -21829,7 +21786,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21829
21786
  payload = fastpass(payload, ctx);
21830
21787
  if (!catchall)
21831
21788
  return payload;
21832
- return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
21789
+ return handleCatchall([], input, payload, ctx, value, inst);
21833
21790
  }
21834
21791
  return superParse(payload, ctx);
21835
21792
  };
@@ -21961,31 +21918,16 @@ function getDiscriminatedOption(union, value) {
21961
21918
  const internals = union._zod;
21962
21919
  let map = internals.bag.optionsMap;
21963
21920
  if (!map) {
21964
- map = discriminatorMap(internals.def);
21965
- internals.bag.optionsMap = map;
21966
- }
21967
- const option = map.get(value);
21968
- if (option === null)
21969
- throw new Error(`Ambiguous discriminator value "${String(value)}"`);
21970
- return option;
21971
- }
21972
- function discriminatorMap(def) {
21973
- const map = new Map;
21974
- for (const option of def.options) {
21975
- const values = option._zod.propValues?.[def.discriminator];
21976
- if (!values || values.size === 0)
21977
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
21978
- for (const value of values) {
21979
- if (map.has(value)) {
21980
- if (value !== undefined)
21981
- throw new Error(`Duplicate discriminator value "${String(value)}"`);
21982
- map.set(value, null);
21983
- } else {
21984
- map.set(value, option);
21985
- }
21921
+ map = new Map;
21922
+ const { options, discriminator } = internals.def;
21923
+ for (const option of options) {
21924
+ for (const v of option._zod.propValues?.[discriminator] ?? [])
21925
+ if (!map.has(v))
21926
+ map.set(v, option);
21986
21927
  }
21928
+ internals.bag.optionsMap = map;
21987
21929
  }
21988
- return map;
21930
+ return map.get(value);
21989
21931
  }
21990
21932
  var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
21991
21933
  def.inclusive = false;
@@ -21993,13 +21935,10 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
21993
21935
  const _super = inst._zod.parse;
21994
21936
  defineLazyInternal(inst, "propValues", (zod) => {
21995
21937
  const propValues = {};
21996
- let undefinedCount = 0;
21997
21938
  for (const option of zod.def.options) {
21998
21939
  const pv = option._zod.propValues;
21999
21940
  if (!pv || Object.keys(pv).length === 0)
22000
21941
  throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
22001
- if (pv[zod.def.discriminator]?.has(undefined))
22002
- undefinedCount++;
22003
21942
  for (const [k, v] of Object.entries(pv)) {
22004
21943
  if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
22005
21944
  assignProp(propValues, k, new Set);
@@ -22009,17 +21948,30 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
22009
21948
  }
22010
21949
  }
22011
21950
  }
22012
- if (!zod.def.unionFallback && undefinedCount > 1)
22013
- propValues[zod.def.discriminator]?.delete(undefined);
22014
21951
  return propValues;
22015
21952
  });
22016
21953
  def.options.forEach((option, i) => {
22017
- const propShape = rawShape(option._zod.def);
21954
+ const propShape = propShapes.get(option._zod.def);
22018
21955
  if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
22019
21956
  throw new Error(`Invalid discriminated union option at index "${i}"`);
22020
21957
  }
22021
21958
  });
22022
- const disc = cached(() => discriminatorMap(def));
21959
+ const disc = cached(() => {
21960
+ const opts = def.options;
21961
+ const map = new Map;
21962
+ for (const o2 of opts) {
21963
+ const values = o2._zod.propValues?.[def.discriminator];
21964
+ if (!values || values.size === 0)
21965
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o2)}"`);
21966
+ for (const v of values) {
21967
+ if (map.has(v)) {
21968
+ throw new Error(`Duplicate discriminator value "${String(v)}"`);
21969
+ }
21970
+ map.set(v, o2);
21971
+ }
21972
+ }
21973
+ return map;
21974
+ });
22023
21975
  inst._zod.parse = (payload, ctx) => {
22024
21976
  const input = payload.value;
22025
21977
  if (!isObject(input)) {
@@ -22031,9 +21983,8 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
22031
21983
  });
22032
21984
  return payload;
22033
21985
  }
22034
- const value = input?.[def.discriminator];
22035
- const opt = disc.value.get(value);
22036
- if (opt && (value !== undefined || ctx.direction !== "backward")) {
21986
+ const opt = disc.value.get(input?.[def.discriminator]);
21987
+ if (opt) {
22037
21988
  return opt._zod.run(payload, ctx);
22038
21989
  }
22039
21990
  if (def.unionFallback || ctx.direction === "backward") {
@@ -22044,7 +21995,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
22044
21995
  errors: [],
22045
21996
  note: "No matching discriminator",
22046
21997
  discriminator: def.discriminator,
22047
- options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
21998
+ options: Array.from(disc.value.keys()),
22048
21999
  input,
22049
22000
  path: [def.discriminator],
22050
22001
  inst
@@ -22210,8 +22161,6 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
22210
22161
  }
22211
22162
  }
22212
22163
  const itemResults = new Array(items.length);
22213
- const abortEarly = def.rest ? ctx?.abortEarly : undefined;
22214
- let itemAborted = false;
22215
22164
  for (let i = 0;i < items.length; i++) {
22216
22165
  const r2 = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
22217
22166
  if (r2 instanceof Promise) {
@@ -22220,20 +22169,12 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
22220
22169
  }));
22221
22170
  } else {
22222
22171
  itemResults[i] = r2;
22223
- if (abortEarly && !itemAborted && r2.issues.length)
22224
- itemAborted = aborted(r2);
22225
22172
  }
22226
22173
  }
22227
- if (def.rest && !itemAborted) {
22174
+ if (def.rest) {
22228
22175
  let i = items.length - 1;
22229
22176
  const rest = input.slice(items.length);
22230
- let seen = payload.issues.length;
22231
22177
  for (const el of rest) {
22232
- if (abortEarly && payload.issues.length !== seen) {
22233
- if (aborted(payload, seen))
22234
- break;
22235
- seen = payload.issues.length;
22236
- }
22237
22178
  i++;
22238
22179
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
22239
22180
  if (result instanceof Promise) {
@@ -22461,14 +22402,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
22461
22402
  }
22462
22403
  const proms = [];
22463
22404
  payload.value = memo ? memo.alloc(inst, payload, new Map, ctx) : new Map;
22464
- const abortEarly = ctx?.abortEarly;
22465
- let seen = payload.issues.length;
22466
22405
  for (const [key, value] of input) {
22467
- if (abortEarly && payload.issues.length !== seen) {
22468
- if (aborted(payload, seen))
22469
- break;
22470
- seen = payload.issues.length;
22471
- }
22472
22406
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
22473
22407
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
22474
22408
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
@@ -22531,14 +22465,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
22531
22465
  }
22532
22466
  const proms = [];
22533
22467
  payload.value = memo ? memo.alloc(inst, payload, new Set, ctx) : new Set;
22534
- const abortEarly = ctx?.abortEarly;
22535
- let seen = payload.issues.length;
22536
22468
  for (const item of input) {
22537
- if (abortEarly && payload.issues.length !== seen) {
22538
- if (aborted(payload, seen))
22539
- break;
22540
- seen = payload.issues.length;
22541
- }
22542
22469
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
22543
22470
  if (result instanceof Promise) {
22544
22471
  proms.push(result.then((result2) => handleSetResult(result2, payload)));
@@ -22561,10 +22488,8 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
22561
22488
  const values = getEnumValues(def.entries);
22562
22489
  const valuesSet = new Set(values);
22563
22490
  inst._zod.values = valuesSet;
22564
- defineLazyInternal(inst, "pattern", (zod) => {
22565
- const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
22566
- return new RegExp(patternValues.length ? `^(${patternValues.map((o2) => escapeRegex(o2.toString())).join("|")})$` : "^[^\\s\\S]$");
22567
- });
22491
+ const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
22492
+ inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o2) => escapeRegex(o2.toString())).join("|")})$` : "^[^\\s\\S]$");
22568
22493
  inst._zod.parse = (payload, _ctx) => {
22569
22494
  const input = payload.value;
22570
22495
  if (valuesSet.has(input)) {
@@ -22583,10 +22508,7 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
22583
22508
  $ZodType.init(inst, def);
22584
22509
  const values = new Set(def.values);
22585
22510
  inst._zod.values = values;
22586
- defineLazyInternal(inst, "pattern", (zod) => {
22587
- const vals = zod.def.values;
22588
- return new RegExp(vals.length ? `^(${vals.map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2 ? escapeRegex(o2.toString()) : String(o2)).join("|")})$` : "^[^\\s\\S]$");
22589
- });
22511
+ inst._zod.pattern = new RegExp(def.values.length ? `^(${def.values.map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2 ? escapeRegex(o2.toString()) : String(o2)).join("|")})$` : "^[^\\s\\S]$");
22590
22512
  inst._zod.parse = (payload, _ctx) => {
22591
22513
  const input = payload.value;
22592
22514
  if (values.has(input)) {
@@ -22924,62 +22846,20 @@ function handleReadonlyResult(payload) {
22924
22846
  payload.value = Object.freeze(payload.value);
22925
22847
  return payload;
22926
22848
  }
22927
- function leafPattern(schema) {
22928
- const def = schema._zod.def;
22929
- let pattern = def.pattern;
22930
- let isInt = !!def.format?.includes("int");
22931
- let minimum;
22932
- let maximum;
22933
- for (const ch of def.checks ?? []) {
22934
- const d = ch._zod.def;
22935
- if (d.pattern)
22936
- pattern = d.pattern;
22937
- isInt || (isInt = !!d.format?.includes("int"));
22938
- const lo = d.minimum ?? d.length;
22939
- const hi = d.maximum ?? d.length;
22940
- if (lo !== undefined && (minimum === undefined || lo > minimum))
22941
- minimum = lo;
22942
- if (hi !== undefined && (maximum === undefined || hi < maximum))
22943
- maximum = hi;
22944
- }
22945
- if (pattern)
22946
- return pattern.source;
22947
- if (minimum !== undefined && maximum !== undefined && minimum > maximum)
22948
- return "(?!)";
22949
- if (minimum !== undefined || maximum !== undefined)
22950
- return string({ minimum, maximum }).source;
22951
- const own2 = schema._zod.pattern;
22952
- return (isInt && own2 === number ? integer : own2)?.source;
22953
- }
22954
- function partPattern(schema) {
22955
- const def = schema._zod.def;
22956
- const own2 = schema._zod.pattern?.source;
22957
- const inner = def.innerType ?? schema._zod.innerType;
22958
- if (inner) {
22959
- const before = inner._zod.pattern?.source;
22960
- const after = partPattern(inner);
22961
- if (own2 && before && after && after !== before) {
22962
- return own2.replace(cleanRegex(before), () => cleanRegex(after));
22963
- }
22964
- return own2;
22965
- }
22966
- if (def.options) {
22967
- const sources = def.options.map(partPattern);
22968
- if (sources.every(Boolean))
22969
- return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
22970
- }
22971
- return leafPattern(schema);
22972
- }
22973
22849
  var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
22974
22850
  $ZodType.init(inst, def);
22975
22851
  const regexParts = [];
22976
22852
  for (const part of def.parts) {
22977
22853
  if (typeof part === "object" && part !== null) {
22978
- const source = partPattern(part);
22979
- if (!source) {
22854
+ if (!part._zod.pattern) {
22980
22855
  throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
22981
22856
  }
22982
- regexParts.push(cleanRegex(source));
22857
+ const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
22858
+ if (!source)
22859
+ throw new Error(`Invalid template literal part: ${part._zod.traits}`);
22860
+ const start = source.startsWith("^") ? 1 : 0;
22861
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
22862
+ regexParts.push(source.slice(start, end));
22983
22863
  } else if (part === null || primitiveTypes.has(typeof part)) {
22984
22864
  regexParts.push(escapeRegex(`${part}`));
22985
22865
  } else {
@@ -23150,53 +23030,28 @@ class $ZodCyclicError extends Error {
23150
23030
  }
23151
23031
  var STATE = "~memo";
23152
23032
  var NO_ISSUES = [];
23153
- function isRef(value) {
23154
- return value !== null && typeof value === "object";
23155
- }
23156
23033
  function cloneIssues(issues) {
23157
23034
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
23158
23035
  }
23159
23036
  var recursive = /* @__PURE__ */ new WeakMap;
23160
- var NONE = 0;
23161
- var ASSUMED = 1;
23162
- var PROVEN = 2;
23163
- function isRecursive(inst, stack, resolve17) {
23037
+ function isRecursive(inst, stack) {
23164
23038
  const cached2 = recursive.get(inst);
23165
23039
  if (cached2 !== undefined)
23166
- return cached2 ? PROVEN : NONE;
23040
+ return cached2;
23167
23041
  if (stack.has(inst))
23168
- return PROVEN;
23042
+ return true;
23169
23043
  stack.add(inst);
23170
- let result = NONE;
23044
+ let result = false;
23171
23045
  const check = (child) => {
23172
- if (result !== PROVEN && child?._zod) {
23173
- const answer = isRecursive(child, stack, resolve17);
23174
- if (answer > result)
23175
- result = answer;
23176
- }
23177
- };
23178
- const shape = (sh, spread) => {
23179
- let answer = NONE;
23180
- for (const key of Reflect.ownKeys(sh)) {
23181
- const desc = Object.getOwnPropertyDescriptor(sh, key);
23182
- if (spread && !desc.enumerable)
23183
- continue;
23184
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve17) : NONE;
23185
- if (child > answer)
23186
- answer = child;
23187
- }
23188
- return answer;
23189
- };
23190
- const merge2 = (answer) => {
23191
- if (answer > result)
23192
- result = answer;
23046
+ if (!result && child?._zod && isRecursive(child, stack))
23047
+ result = true;
23193
23048
  };
23194
23049
  const def = inst._zod.def;
23195
23050
  const kind = def.type;
23196
23051
  switch (kind) {
23197
23052
  case "object": {
23198
- const raw = rawShape(def);
23199
- merge2(raw ? shape(raw, true) : ASSUMED);
23053
+ for (const key of Reflect.ownKeys(def.shape))
23054
+ check(def.shape[key]);
23200
23055
  check(def.catchall);
23201
23056
  break;
23202
23057
  }
@@ -23243,11 +23098,9 @@ function isRecursive(inst, stack, resolve17) {
23243
23098
  check(def.input);
23244
23099
  check(def.output);
23245
23100
  break;
23246
- case "lazy": {
23247
- const inner = def._cachedInner ?? (resolve17 ? inst._zod.innerType : undefined);
23248
- merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
23101
+ case "lazy":
23102
+ check(inst._zod.innerType);
23249
23103
  break;
23250
- }
23251
23104
  case "template_literal":
23252
23105
  case "string":
23253
23106
  case "number":
@@ -23286,20 +23139,16 @@ function isRecursive(inst, stack, resolve17) {
23286
23139
  }
23287
23140
  }
23288
23141
  stack.delete(inst);
23289
- return settle(inst, result);
23290
- }
23291
- function settle(inst, answer) {
23292
- if (answer !== ASSUMED)
23293
- recursive.set(inst, answer === PROVEN);
23294
- return answer;
23142
+ recursive.set(inst, result);
23143
+ return result;
23295
23144
  }
23296
23145
  function isRecursiveSchema(inst) {
23297
- return isRecursive(inst, new Set, true) !== NONE;
23146
+ return isRecursive(inst, new Set);
23298
23147
  }
23299
23148
  function bucketFor(state, inst) {
23300
23149
  let bucket = state.buckets.get(inst);
23301
23150
  if (!bucket) {
23302
- bucket = new WeakMap;
23151
+ bucket = new Map;
23303
23152
  state.buckets.set(inst, bucket);
23304
23153
  }
23305
23154
  return bucket;
@@ -23335,7 +23184,6 @@ var memo = {
23335
23184
  attach(inst) {
23336
23185
  var _a2;
23337
23186
  let isRecursiveInst;
23338
- let rechecked = false;
23339
23187
  let lastCtx;
23340
23188
  let lastBucket;
23341
23189
  (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
@@ -23343,24 +23191,20 @@ var memo = {
23343
23191
  const base = inst._zod.parse;
23344
23192
  const wrapped = (payload, ctx) => {
23345
23193
  if (isRecursiveInst === undefined) {
23346
- const walked = isRecursive(inst, new Set, false);
23347
- if (walked === NONE) {
23194
+ isRecursiveInst = isRecursive(inst, new Set);
23195
+ if (!isRecursiveInst) {
23348
23196
  inst._zod.parse = base;
23349
23197
  if (inst._zod.run === wrapped)
23350
23198
  inst._zod.run = base;
23351
23199
  return base(payload, ctx);
23352
23200
  }
23353
- if (walked === PROVEN || rechecked)
23354
- isRecursiveInst = true;
23355
- else
23356
- rechecked = true;
23357
23201
  }
23358
23202
  const input = payload.value;
23359
- if (!isRef(input))
23203
+ if (input === null || typeof input !== "object")
23360
23204
  return base(payload, ctx);
23361
23205
  let state = ctx[STATE];
23362
23206
  if (!state) {
23363
- state = { buckets: new WeakMap, backEdges: undefined };
23207
+ state = { buckets: new Map, backEdges: undefined };
23364
23208
  ctx[STATE] = state;
23365
23209
  }
23366
23210
  let bucket;
@@ -23379,7 +23223,7 @@ var memo = {
23379
23223
  payload.issues.push(...cloneIssues(hit.issues));
23380
23224
  } else {
23381
23225
  payload.memo = true;
23382
- state.backEdges ?? (state.backEdges = new WeakSet);
23226
+ state.backEdges ?? (state.backEdges = new Set);
23383
23227
  state.backEdges.add(hit.value);
23384
23228
  }
23385
23229
  return payload;
@@ -23411,7 +23255,7 @@ function memoizer() {
23411
23255
  }
23412
23256
  function isBackEdge(ctx, value) {
23413
23257
  const backEdges = ctx[STATE]?.backEdges;
23414
- return backEdges !== undefined && isRef(value) && backEdges.has(value);
23258
+ return backEdges !== undefined && value !== null && typeof value === "object" && backEdges.has(value);
23415
23259
  }
23416
23260
  // node_modules/zod/v4/locales/index.js
23417
23261
  var exports_locales = {};
@@ -23427,7 +23271,6 @@ __export(exports_locales, {
23427
23271
  tr: () => tr_default,
23428
23272
  tk: () => tk_default,
23429
23273
  th: () => th_default,
23430
- tg: () => tg_default,
23431
23274
  ta: () => ta_default,
23432
23275
  sv: () => sv_default,
23433
23276
  sl: () => sl_default,
@@ -23522,8 +23365,6 @@ var error = () => {
23522
23365
  json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
23523
23366
  e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
23524
23367
  credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
23525
- currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
23526
- iban: "IBAN",
23527
23368
  jwt: "JWT",
23528
23369
  template_literal: "\u0645\u062F\u062E\u0644"
23529
23370
  };
@@ -23633,8 +23474,6 @@ var error2 = () => {
23633
23474
  json_string: "JSON string",
23634
23475
  e164: "E.164 number",
23635
23476
  credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
23636
- currency_code: "valyuta kodu",
23637
- iban: "IBAN",
23638
23477
  jwt: "JWT",
23639
23478
  template_literal: "input"
23640
23479
  };
@@ -23793,8 +23632,6 @@ var error3 = () => {
23793
23632
  json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
23794
23633
  e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
23795
23634
  credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
23796
- currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
23797
- iban: "IBAN",
23798
23635
  jwt: "JWT",
23799
23636
  template_literal: "\u0443\u0432\u043E\u0434"
23800
23637
  };
@@ -23911,8 +23748,6 @@ var error4 = () => {
23911
23748
  json_string: "JSON \u043D\u0438\u0437",
23912
23749
  e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
23913
23750
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
23914
- currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
23915
- iban: "IBAN",
23916
23751
  jwt: "JWT",
23917
23752
  template_literal: "\u0432\u0445\u043E\u0434"
23918
23753
  };
@@ -24036,8 +23871,6 @@ var error5 = () => {
24036
23871
  json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
24037
23872
  e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
24038
23873
  credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
24039
- currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
24040
- iban: "IBAN",
24041
23874
  jwt: "JWT",
24042
23875
  template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
24043
23876
  };
@@ -24149,8 +23982,6 @@ var error6 = () => {
24149
23982
  json_string: "cadena JSON",
24150
23983
  e164: "n\xFAmero E.164",
24151
23984
  credit_card: "n\xFAmero de targeta de cr\xE8dit",
24152
- currency_code: "codi de moneda",
24153
- iban: "IBAN",
24154
23985
  jwt: "JWT",
24155
23986
  template_literal: "entrada"
24156
23987
  };
@@ -24261,8 +24092,6 @@ var error7 = () => {
24261
24092
  json_string: "\u062F\u06D5\u0642\u06CC JSON",
24262
24093
  e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
24263
24094
  credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
24264
- currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
24265
- iban: "IBAN",
24266
24095
  jwt: "JWT",
24267
24096
  template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
24268
24097
  };
@@ -24393,8 +24222,6 @@ var error8 = () => {
24393
24222
  json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
24394
24223
  e164: "\u010D\xEDslo E.164",
24395
24224
  credit_card: "\u010D\xEDslo kreditn\xED karty",
24396
- currency_code: "k\xF3d m\u011Bny",
24397
- iban: "IBAN",
24398
24225
  jwt: "JWT",
24399
24226
  template_literal: "vstup"
24400
24227
  };
@@ -24509,8 +24336,6 @@ var error9 = () => {
24509
24336
  json_string: "JSON-streng",
24510
24337
  e164: "E.164-nummer",
24511
24338
  credit_card: "kreditkortnummer",
24512
- currency_code: "valutakode",
24513
- iban: "IBAN",
24514
24339
  jwt: "JWT",
24515
24340
  template_literal: "input"
24516
24341
  };
@@ -24629,8 +24454,6 @@ var error10 = () => {
24629
24454
  json_string: "JSON-String",
24630
24455
  e164: "E.164-Nummer",
24631
24456
  credit_card: "Kreditkartennummer",
24632
- currency_code: "W\xE4hrungscode",
24633
- iban: "IBAN",
24634
24457
  jwt: "JWT",
24635
24458
  template_literal: "Eingabe"
24636
24459
  };
@@ -24742,8 +24565,6 @@ var error11 = () => {
24742
24565
  json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
24743
24566
  e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
24744
24567
  credit_card: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",
24745
- currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
24746
- iban: "IBAN",
24747
24568
  jwt: "JWT",
24748
24569
  template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
24749
24570
  };
@@ -24853,9 +24674,7 @@ var error12 = () => {
24853
24674
  base64url: "base64url-encoded string",
24854
24675
  json_string: "JSON string",
24855
24676
  e164: "E.164 number",
24856
- currency_code: "currency code",
24857
24677
  credit_card: "credit card number",
24858
- iban: "IBAN",
24859
24678
  jwt: "JWT",
24860
24679
  template_literal: "input"
24861
24680
  };
@@ -24976,8 +24795,6 @@ var error13 = () => {
24976
24795
  json_string: "JSON-karaktraro",
24977
24796
  e164: "E.164-nombro",
24978
24797
  credit_card: "kreditkarta numero",
24979
- currency_code: "valuta kodo",
24980
- iban: "IBAN",
24981
24798
  jwt: "JWT",
24982
24799
  template_literal: "enigo"
24983
24800
  };
@@ -25089,8 +24906,6 @@ var error14 = () => {
25089
24906
  json_string: "cadena JSON",
25090
24907
  e164: "n\xFAmero E.164",
25091
24908
  credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
25092
- currency_code: "c\xF3digo de moneda",
25093
- iban: "IBAN",
25094
24909
  jwt: "JWT",
25095
24910
  template_literal: "entrada"
25096
24911
  };
@@ -25226,8 +25041,6 @@ var error15 = () => {
25226
25041
  json_string: "JSON \u0631\u0634\u062A\u0647",
25227
25042
  e164: "E.164 \u0639\u062F\u062F",
25228
25043
  credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
25229
- currency_code: "\u06A9\u062F \u0627\u0631\u0632",
25230
- iban: "IBAN",
25231
25044
  jwt: "JWT",
25232
25045
  template_literal: "\u0648\u0631\u0648\u062F\u06CC"
25233
25046
  };
@@ -25349,8 +25162,6 @@ var error16 = () => {
25349
25162
  json_string: "JSON-merkkijono",
25350
25163
  e164: "E.164-luku",
25351
25164
  credit_card: "luottokortin numero",
25352
- currency_code: "valuuttakoodi",
25353
- iban: "IBAN",
25354
25165
  jwt: "JWT",
25355
25166
  template_literal: "templaattimerkkijono"
25356
25167
  };
@@ -25461,8 +25272,6 @@ var error17 = () => {
25461
25272
  json_string: "cha\xEEne de caract\xE8res JSON",
25462
25273
  e164: "num\xE9ro au format E.164",
25463
25274
  credit_card: "num\xE9ro de carte de cr\xE9dit",
25464
- currency_code: "code de devise",
25465
- iban: "IBAN",
25466
25275
  jwt: "JWT",
25467
25276
  template_literal: "entr\xE9e"
25468
25277
  };
@@ -25591,8 +25400,6 @@ var error18 = () => {
25591
25400
  json_string: "cha\xEEne JSON",
25592
25401
  e164: "num\xE9ro E.164",
25593
25402
  credit_card: "num\xE9ro de carte de cr\xE9dit",
25594
- currency_code: "code de devise",
25595
- iban: "IBAN",
25596
25403
  jwt: "JWT",
25597
25404
  template_literal: "entr\xE9e"
25598
25405
  };
@@ -25703,8 +25510,6 @@ var error19 = () => {
25703
25510
  json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
25704
25511
  e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
25705
25512
  credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
25706
- currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
25707
- iban: "IBAN",
25708
25513
  jwt: "JWT",
25709
25514
  template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
25710
25515
  };
@@ -25851,8 +25656,6 @@ var error20 = () => {
25851
25656
  json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
25852
25657
  e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
25853
25658
  credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
25854
- currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
25855
- iban: { label: "IBAN", gender: "m" },
25856
25659
  jwt: { label: "JWT", gender: "m" },
25857
25660
  template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
25858
25661
  ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
@@ -26016,8 +25819,6 @@ var error21 = () => {
26016
25819
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
26017
25820
  e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
26018
25821
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
26019
- currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
26020
- iban: "IBAN",
26021
25822
  jwt: "JWT",
26022
25823
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
26023
25824
  };
@@ -26126,8 +25927,6 @@ var error22 = () => {
26126
25927
  json_string: "JSON tekst",
26127
25928
  e164: "E.164 broj",
26128
25929
  credit_card: "broj kreditne kartice",
26129
- currency_code: "kod valute",
26130
- iban: "IBAN",
26131
25930
  jwt: "JWT",
26132
25931
  template_literal: "unos"
26133
25932
  };
@@ -26253,8 +26052,6 @@ var error23 = () => {
26253
26052
  json_string: "JSON string",
26254
26053
  e164: "E.164 sz\xE1m",
26255
26054
  credit_card: "hitelk\xE1rtyasz\xE1m",
26256
- currency_code: "p\xE9nznemk\xF3d",
26257
- iban: "IBAN",
26258
26055
  jwt: "JWT",
26259
26056
  template_literal: "bemenet"
26260
26057
  };
@@ -26406,8 +26203,6 @@ var error24 = () => {
26406
26203
  json_string: "JSON \u057F\u0578\u0572",
26407
26204
  e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
26408
26205
  credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
26409
- currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
26410
- iban: "IBAN",
26411
26206
  jwt: "JWT",
26412
26207
  template_literal: "\u0574\u0578\u0582\u057F\u0584"
26413
26208
  };
@@ -26524,8 +26319,6 @@ var error25 = () => {
26524
26319
  json_string: "string JSON",
26525
26320
  e164: "angka E.164",
26526
26321
  credit_card: "nomor kartu kredit",
26527
- currency_code: "kode mata uang",
26528
- iban: "IBAN",
26529
26322
  jwt: "JWT",
26530
26323
  template_literal: "input"
26531
26324
  };
@@ -26635,8 +26428,6 @@ var error26 = () => {
26635
26428
  json_string: "JSON strengur",
26636
26429
  e164: "E.164 t\xF6lugildi",
26637
26430
  credit_card: "kreditkortan\xFAmer",
26638
- currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
26639
- iban: "IBAN",
26640
26431
  jwt: "JWT",
26641
26432
  template_literal: "gildi"
26642
26433
  };
@@ -26749,8 +26540,6 @@ var error27 = () => {
26749
26540
  json_string: "stringa JSON",
26750
26541
  e164: "numero E.164",
26751
26542
  credit_card: "numero di carta di credito",
26752
- currency_code: "codice valuta",
26753
- iban: "IBAN",
26754
26543
  jwt: "JWT",
26755
26544
  template_literal: "input"
26756
26545
  };
@@ -26862,8 +26651,6 @@ var error28 = () => {
26862
26651
  json_string: "JSON\u6587\u5B57\u5217",
26863
26652
  e164: "E.164\u756A\u53F7",
26864
26653
  credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
26865
- currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
26866
- iban: "IBAN",
26867
26654
  jwt: "JWT",
26868
26655
  template_literal: "\u5165\u529B\u5024"
26869
26656
  };
@@ -26974,8 +26761,6 @@ var error29 = () => {
26974
26761
  json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
26975
26762
  e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
26976
26763
  credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
26977
- currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
26978
- iban: "IBAN",
26979
26764
  jwt: "JWT",
26980
26765
  template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
26981
26766
  };
@@ -27091,8 +26876,6 @@ var error30 = () => {
27091
26876
  json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
27092
26877
  e164: "\u179B\u17C1\u1781 E.164",
27093
26878
  credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
27094
- currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
27095
- iban: "IBAN",
27096
26879
  jwt: "JWT",
27097
26880
  template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
27098
26881
  };
@@ -27211,8 +26994,6 @@ var error31 = () => {
27211
26994
  json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
27212
26995
  e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
27213
26996
  credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
27214
- currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
27215
- iban: "IBAN",
27216
26997
  jwt: "JWT",
27217
26998
  template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
27218
26999
  };
@@ -27324,8 +27105,6 @@ var error32 = () => {
27324
27105
  json_string: "JSON \uBB38\uC790\uC5F4",
27325
27106
  e164: "E.164 \uBC88\uD638",
27326
27107
  credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
27327
- currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
27328
- iban: "IBAN",
27329
27108
  jwt: "JWT",
27330
27109
  template_literal: "\uC785\uB825"
27331
27110
  };
@@ -27522,8 +27301,6 @@ var error33 = () => {
27522
27301
  json_string: "JSON eilut\u0117",
27523
27302
  e164: "E.164 numeris",
27524
27303
  credit_card: "kredito kortel\u0117s numeris",
27525
- currency_code: "valiutos kodas",
27526
- iban: "IBAN",
27527
27304
  jwt: "JWT",
27528
27305
  template_literal: "\u012Fvestis"
27529
27306
  };
@@ -27647,8 +27424,6 @@ var error34 = () => {
27647
27424
  json_string: "JSON \u043D\u0438\u0437\u0430",
27648
27425
  e164: "E.164 \u0431\u0440\u043E\u0458",
27649
27426
  credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
27650
- currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
27651
- iban: "IBAN",
27652
27427
  jwt: "JWT",
27653
27428
  template_literal: "\u0432\u043D\u0435\u0441"
27654
27429
  };
@@ -27761,8 +27536,6 @@ var error35 = () => {
27761
27536
  json_string: "string JSON",
27762
27537
  e164: "nombor E.164",
27763
27538
  credit_card: "nombor kad kredit",
27764
- currency_code: "kod mata wang",
27765
- iban: "IBAN",
27766
27539
  jwt: "JWT",
27767
27540
  template_literal: "input"
27768
27541
  };
@@ -27873,8 +27646,6 @@ var error36 = () => {
27873
27646
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
27874
27647
  e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
27875
27648
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
27876
- currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
27877
- iban: "IBAN",
27878
27649
  jwt: "JWT",
27879
27650
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
27880
27651
  };
@@ -27984,8 +27755,6 @@ var error37 = () => {
27984
27755
  json_string: "JSON string",
27985
27756
  e164: "E.164-nummer",
27986
27757
  credit_card: "creditcardnummer",
27987
- currency_code: "valutacode",
27988
- iban: "IBAN",
27989
27758
  jwt: "JWT",
27990
27759
  template_literal: "invoer"
27991
27760
  };
@@ -28099,8 +27868,6 @@ var error38 = () => {
28099
27868
  json_string: "JSON-streng",
28100
27869
  e164: "E.164-nummer",
28101
27870
  credit_card: "kredittkortnummer",
28102
- currency_code: "valutakode",
28103
- iban: "IBAN",
28104
27871
  jwt: "JWT",
28105
27872
  template_literal: "input"
28106
27873
  };
@@ -28212,8 +27979,6 @@ var error39 = () => {
28212
27979
  json_string: "JSON-streng",
28213
27980
  e164: "E.164-nummer",
28214
27981
  credit_card: "kredittkortnummer",
28215
- currency_code: "valutakode",
28216
- iban: "IBAN",
28217
27982
  jwt: "JWT",
28218
27983
  template_literal: "input"
28219
27984
  };
@@ -28325,8 +28090,6 @@ var error40 = () => {
28325
28090
  json_string: "JSON metin",
28326
28091
  e164: "E.164 say\u0131s\u0131",
28327
28092
  credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
28328
- currency_code: "para birimi kodu",
28329
- iban: "IBAN",
28330
28093
  jwt: "JWT",
28331
28094
  template_literal: "giren"
28332
28095
  };
@@ -28439,8 +28202,6 @@ var error41 = () => {
28439
28202
  json_string: "JSON \u0645\u062A\u0646",
28440
28203
  e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
28441
28204
  credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
28442
- currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
28443
- iban: "IBAN",
28444
28205
  jwt: "JWT",
28445
28206
  template_literal: "\u0648\u0631\u0648\u062F\u064A"
28446
28207
  };
@@ -28558,8 +28319,6 @@ var error42 = () => {
28558
28319
  json_string: "ci\u0105g znak\xF3w w formacie JSON",
28559
28320
  e164: "liczba E.164",
28560
28321
  credit_card: "numer karty kredytowej",
28561
- currency_code: "kod waluty",
28562
- iban: "IBAN",
28563
28322
  jwt: "JWT",
28564
28323
  template_literal: "wej\u015Bcie"
28565
28324
  };
@@ -28672,8 +28431,6 @@ var error43 = () => {
28672
28431
  json_string: "o texto JSON",
28673
28432
  e164: "o n\xFAmero E.164",
28674
28433
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
28675
- currency_code: "o c\xF3digo de moeda",
28676
- iban: "o IBAN",
28677
28434
  jwt: "o JWT",
28678
28435
  template_literal: "a entrada"
28679
28436
  };
@@ -28814,8 +28571,6 @@ var error44 = () => {
28814
28571
  json_string: "o texto JSON",
28815
28572
  e164: "o n\xFAmero E.164",
28816
28573
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
28817
- currency_code: "o c\xF3digo de moeda",
28818
- iban: "o IBAN",
28819
28574
  jwt: "o JWT",
28820
28575
  template_literal: "a entrada"
28821
28576
  };
@@ -28957,8 +28712,6 @@ var error45 = () => {
28957
28712
  json_string: "\u0219ir JSON",
28958
28713
  e164: "num\u0103r E.164",
28959
28714
  credit_card: "num\u0103r de card de credit",
28960
- currency_code: "cod valutar",
28961
- iban: "IBAN",
28962
28715
  jwt: "JWT",
28963
28716
  template_literal: "intrare"
28964
28717
  };
@@ -29129,8 +28882,6 @@ var error46 = () => {
29129
28882
  json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
29130
28883
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
29131
28884
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
29132
- currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
29133
- iban: "IBAN",
29134
28885
  jwt: "JWT",
29135
28886
  template_literal: "\u0432\u0432\u043E\u0434"
29136
28887
  };
@@ -29247,8 +28998,6 @@ var error47 = () => {
29247
28998
  json_string: "re\u0165azec vo form\xE1te JSON",
29248
28999
  e164: "\u010D\xEDslo E.164",
29249
29000
  credit_card: "\u010D\xEDslo kreditnej karty",
29250
- currency_code: "k\xF3d meny",
29251
- iban: "IBAN",
29252
29001
  jwt: "JWT",
29253
29002
  template_literal: "vstup"
29254
29003
  };
@@ -29363,8 +29112,6 @@ var error48 = () => {
29363
29112
  json_string: "JSON niz",
29364
29113
  e164: "E.164 \u0161tevilka",
29365
29114
  credit_card: "\u0161tevilka kreditne kartice",
29366
- currency_code: "koda valute",
29367
- iban: "IBAN",
29368
29115
  jwt: "JWT",
29369
29116
  template_literal: "vnos"
29370
29117
  };
@@ -29477,8 +29224,6 @@ var error49 = () => {
29477
29224
  json_string: "JSON-str\xE4ng",
29478
29225
  e164: "E.164-nummer",
29479
29226
  credit_card: "kreditkortsnummer",
29480
- currency_code: "valutakod",
29481
- iban: "IBAN",
29482
29227
  jwt: "JWT",
29483
29228
  template_literal: "mall-literal"
29484
29229
  };
@@ -29592,8 +29337,6 @@ var error50 = () => {
29592
29337
  json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
29593
29338
  e164: "E.164 \u0B8E\u0BA3\u0BCD",
29594
29339
  credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
29595
- currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
29596
- iban: "IBAN",
29597
29340
  jwt: "JWT",
29598
29341
  template_literal: "input"
29599
29342
  };
@@ -29666,124 +29409,8 @@ function ta_default() {
29666
29409
  localeError: error50()
29667
29410
  };
29668
29411
  }
29669
- // node_modules/zod/v4/locales/tg.js
29670
- var error51 = () => {
29671
- const Sizable = {
29672
- string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29673
- file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29674
- array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29675
- set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29676
- map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
29677
- };
29678
- function getSizing(origin) {
29679
- return Sizable[origin] ?? null;
29680
- }
29681
- const FormatDictionary = {
29682
- regex: "\u0432\u0443\u0440\u0443\u0434",
29683
- email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
29684
- url: "URL",
29685
- emoji: "\u044D\u043C\u043E\u04B7\u0438",
29686
- uuid: "UUID",
29687
- uuidv4: "UUIDv4",
29688
- uuidv6: "UUIDv6",
29689
- nanoid: "nanoid",
29690
- guid: "GUID",
29691
- cuid: "cuid",
29692
- cuid2: "cuid2",
29693
- ulid: "ULID",
29694
- xid: "XID",
29695
- ksuid: "KSUID",
29696
- datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
29697
- date: "\u0441\u0430\u043D\u0430\u0438 ISO",
29698
- time: "\u0432\u0430\u049B\u0442\u0438 ISO",
29699
- duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
29700
- ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
29701
- ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
29702
- mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
29703
- cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
29704
- cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
29705
- base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
29706
- base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
29707
- json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
29708
- e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
29709
- credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
29710
- currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
29711
- iban: "IBAN",
29712
- jwt: "JWT",
29713
- template_literal: "\u0432\u0443\u0440\u0443\u0434"
29714
- };
29715
- const TypeDictionary = {
29716
- nan: "NaN",
29717
- number: "\u0440\u0430\u049B\u0430\u043C",
29718
- string: "\u0441\u0430\u0442\u0440",
29719
- array: "\u043C\u0430\u0441\u0441\u0438\u0432",
29720
- object: "\u043E\u0431\u044A\u0435\u043A\u0442",
29721
- date: "\u0441\u0430\u043D\u0430"
29722
- };
29723
- return (issue2) => {
29724
- switch (issue2.code) {
29725
- case "invalid_type": {
29726
- const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
29727
- const receivedType = parsedType(issue2.input);
29728
- const received = TypeDictionary[receivedType] ?? receivedType;
29729
- return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${expected} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${received} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`;
29730
- }
29731
- case "invalid_value":
29732
- if (issue2.values.length === 1)
29733
- return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${stringifyPrimitive(issue2.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
29734
- return `\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${joinValues(issue2.values, "|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
29735
- case "too_big": {
29736
- const adj = issue2.inclusive ? "<=" : "<";
29737
- const sizing = getSizing(issue2.origin);
29738
- if (sizing)
29739
- return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
29740
- return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`;
29741
- }
29742
- case "too_small": {
29743
- const adj = issue2.inclusive ? ">=" : ">";
29744
- const sizing = getSizing(issue2.origin);
29745
- if (sizing)
29746
- return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
29747
- return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
29748
- }
29749
- case "invalid_format": {
29750
- const _issue = issue2;
29751
- if (_issue.format === "starts_with")
29752
- return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`;
29753
- if (_issue.format === "ends_with")
29754
- return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`;
29755
- if (_issue.format === "includes")
29756
- return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${_issue.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`;
29757
- if (_issue.format === "regex")
29758
- return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${_issue.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`;
29759
- return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
29760
- }
29761
- case "not_multiple_of":
29762
- return `\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${issue2.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;
29763
- case "unrecognized_keys":
29764
- return `\u041A\u0430\u043B\u0438\u0434${issue2.keys.length > 1 ? "\u04B3\u043E\u0438" : "\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${joinValues(issue2.keys, ", ")}`;
29765
- case "invalid_key":
29766
- return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
29767
- case "invalid_union":
29768
- if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
29769
- const opts = issue2.options.map((o2) => `'${o2}'`).join(" | ");
29770
- return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${opts} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
29771
- }
29772
- return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
29773
- case "invalid_element":
29774
- return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
29775
- default:
29776
- return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
29777
- }
29778
- };
29779
- };
29780
- function tg_default() {
29781
- return {
29782
- localeError: error51()
29783
- };
29784
- }
29785
29412
  // node_modules/zod/v4/locales/th.js
29786
- var error52 = () => {
29413
+ var error51 = () => {
29787
29414
  const Sizable = {
29788
29415
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
29789
29416
  file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -29823,8 +29450,6 @@ var error52 = () => {
29823
29450
  json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
29824
29451
  e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
29825
29452
  credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
29826
- currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
29827
- iban: "IBAN",
29828
29453
  jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
29829
29454
  template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
29830
29455
  };
@@ -29894,11 +29519,11 @@ var error52 = () => {
29894
29519
  };
29895
29520
  function th_default() {
29896
29521
  return {
29897
- localeError: error52()
29522
+ localeError: error51()
29898
29523
  };
29899
29524
  }
29900
29525
  // node_modules/zod/v4/locales/tk.js
29901
- var error53 = () => {
29526
+ var error52 = () => {
29902
29527
  const Sizable = {
29903
29528
  string: { unit: "simwol", verb: "bolmaly" },
29904
29529
  file: { unit: "ba\xFDt", verb: "bolmaly" },
@@ -29938,8 +29563,6 @@ var error53 = () => {
29938
29563
  json_string: "JSON setiri",
29939
29564
  e164: "E.164 nomeri",
29940
29565
  credit_card: "kredit kartyny\u0148 nomeri",
29941
- currency_code: "wal\xFDuta kody",
29942
- iban: "IBAN",
29943
29566
  jwt: "JWT",
29944
29567
  template_literal: "\u015Fablon"
29945
29568
  };
@@ -30001,11 +29624,11 @@ var error53 = () => {
30001
29624
  };
30002
29625
  function tk_default() {
30003
29626
  return {
30004
- localeError: error53()
29627
+ localeError: error52()
30005
29628
  };
30006
29629
  }
30007
29630
  // node_modules/zod/v4/locales/tr.js
30008
- var error54 = () => {
29631
+ var error53 = () => {
30009
29632
  const Sizable = {
30010
29633
  string: { unit: "karakter", verb: "olmal\u0131" },
30011
29634
  file: { unit: "bayt", verb: "olmal\u0131" },
@@ -30045,8 +29668,6 @@ var error54 = () => {
30045
29668
  json_string: "JSON dizesi",
30046
29669
  e164: "E.164 say\u0131s\u0131",
30047
29670
  credit_card: "kredi kart\u0131 numaras\u0131",
30048
- currency_code: "para birimi kodu",
30049
- iban: "IBAN",
30050
29671
  jwt: "JWT",
30051
29672
  template_literal: "\u015Eablon dizesi"
30052
29673
  };
@@ -30111,11 +29732,11 @@ var error54 = () => {
30111
29732
  };
30112
29733
  function tr_default() {
30113
29734
  return {
30114
- localeError: error54()
29735
+ localeError: error53()
30115
29736
  };
30116
29737
  }
30117
29738
  // node_modules/zod/v4/locales/uk.js
30118
- var error55 = () => {
29739
+ var error54 = () => {
30119
29740
  const Sizable = {
30120
29741
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
30121
29742
  file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -30155,8 +29776,6 @@ var error55 = () => {
30155
29776
  json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
30156
29777
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
30157
29778
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
30158
- currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
30159
- iban: "IBAN",
30160
29779
  jwt: "JWT",
30161
29780
  template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
30162
29781
  };
@@ -30224,7 +29843,7 @@ var error55 = () => {
30224
29843
  };
30225
29844
  function uk_default() {
30226
29845
  return {
30227
- localeError: error55()
29846
+ localeError: error54()
30228
29847
  };
30229
29848
  }
30230
29849
 
@@ -30233,7 +29852,7 @@ function ua_default() {
30233
29852
  return uk_default();
30234
29853
  }
30235
29854
  // node_modules/zod/v4/locales/ur.js
30236
- var error56 = () => {
29855
+ var error55 = () => {
30237
29856
  const Sizable = {
30238
29857
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
30239
29858
  file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
@@ -30273,8 +29892,6 @@ var error56 = () => {
30273
29892
  json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
30274
29893
  e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
30275
29894
  credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
30276
- currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
30277
- iban: "IBAN",
30278
29895
  jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
30279
29896
  template_literal: "\u0627\u0646 \u067E\u0679"
30280
29897
  };
@@ -30344,11 +29961,11 @@ var error56 = () => {
30344
29961
  };
30345
29962
  function ur_default() {
30346
29963
  return {
30347
- localeError: error56()
29964
+ localeError: error55()
30348
29965
  };
30349
29966
  }
30350
29967
  // node_modules/zod/v4/locales/uz.js
30351
- var error57 = () => {
29968
+ var error56 = () => {
30352
29969
  const Sizable = {
30353
29970
  string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
30354
29971
  file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
@@ -30388,8 +30005,6 @@ var error57 = () => {
30388
30005
  json_string: "JSON satr",
30389
30006
  e164: "E.164 raqam",
30390
30007
  credit_card: "kredit karta raqami",
30391
- currency_code: "valyuta kodi",
30392
- iban: "IBAN",
30393
30008
  jwt: "JWT",
30394
30009
  template_literal: "kirish"
30395
30010
  };
@@ -30457,11 +30072,11 @@ var error57 = () => {
30457
30072
  };
30458
30073
  function uz_default() {
30459
30074
  return {
30460
- localeError: error57()
30075
+ localeError: error56()
30461
30076
  };
30462
30077
  }
30463
30078
  // node_modules/zod/v4/locales/vi.js
30464
- var error58 = () => {
30079
+ var error57 = () => {
30465
30080
  const Sizable = {
30466
30081
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
30467
30082
  file: { unit: "byte", verb: "c\xF3" },
@@ -30501,8 +30116,6 @@ var error58 = () => {
30501
30116
  json_string: "chu\u1ED7i JSON",
30502
30117
  e164: "s\u1ED1 E.164",
30503
30118
  credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
30504
- currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
30505
- iban: "IBAN",
30506
30119
  jwt: "JWT",
30507
30120
  template_literal: "\u0111\u1EA7u v\xE0o"
30508
30121
  };
@@ -30570,11 +30183,11 @@ var error58 = () => {
30570
30183
  };
30571
30184
  function vi_default() {
30572
30185
  return {
30573
- localeError: error58()
30186
+ localeError: error57()
30574
30187
  };
30575
30188
  }
30576
30189
  // node_modules/zod/v4/locales/zh-CN.js
30577
- var error59 = () => {
30190
+ var error58 = () => {
30578
30191
  const Sizable = {
30579
30192
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
30580
30193
  file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
@@ -30614,8 +30227,6 @@ var error59 = () => {
30614
30227
  json_string: "JSON\u5B57\u7B26\u4E32",
30615
30228
  e164: "E.164\u53F7\u7801",
30616
30229
  credit_card: "\u4FE1\u7528\u5361\u53F7",
30617
- currency_code: "\u8D27\u5E01\u4EE3\u7801",
30618
- iban: "IBAN",
30619
30230
  jwt: "JWT",
30620
30231
  template_literal: "\u8F93\u5165"
30621
30232
  };
@@ -30684,11 +30295,11 @@ var error59 = () => {
30684
30295
  };
30685
30296
  function zh_CN_default() {
30686
30297
  return {
30687
- localeError: error59()
30298
+ localeError: error58()
30688
30299
  };
30689
30300
  }
30690
30301
  // node_modules/zod/v4/locales/zh-TW.js
30691
- var error60 = () => {
30302
+ var error59 = () => {
30692
30303
  const Sizable = {
30693
30304
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
30694
30305
  file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
@@ -30728,8 +30339,6 @@ var error60 = () => {
30728
30339
  json_string: "JSON \u5B57\u4E32",
30729
30340
  e164: "E.164 \u6578\u503C",
30730
30341
  credit_card: "\u4FE1\u7528\u5361\u865F",
30731
- currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
30732
- iban: "IBAN",
30733
30342
  jwt: "JWT",
30734
30343
  template_literal: "\u8F38\u5165"
30735
30344
  };
@@ -30796,11 +30405,11 @@ var error60 = () => {
30796
30405
  };
30797
30406
  function zh_TW_default() {
30798
30407
  return {
30799
- localeError: error60()
30408
+ localeError: error59()
30800
30409
  };
30801
30410
  }
30802
30411
  // node_modules/zod/v4/locales/yo.js
30803
- var error61 = () => {
30412
+ var error60 = () => {
30804
30413
  const Sizable = {
30805
30414
  string: { unit: "\xE0mi", verb: "n\xED" },
30806
30415
  file: { unit: "bytes", verb: "n\xED" },
@@ -30840,8 +30449,6 @@ var error61 = () => {
30840
30449
  json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
30841
30450
  e164: "n\u1ECD\u0301mb\xE0 E.164",
30842
30451
  credit_card: "n\u1ECDmba kaadi gbese",
30843
- currency_code: "koodu ow\xF3",
30844
- iban: "IBAN",
30845
30452
  jwt: "JWT",
30846
30453
  template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
30847
30454
  };
@@ -30908,7 +30515,7 @@ var error61 = () => {
30908
30515
  };
30909
30516
  function yo_default() {
30910
30517
  return {
30911
- localeError: error61()
30518
+ localeError: error60()
30912
30519
  };
30913
30520
  }
30914
30521
  // node_modules/zod/v4/core/registries.js
@@ -30989,8 +30596,31 @@ function compileValidator(schema, parser2) {
30989
30596
  function compile(schema, options) {
30990
30597
  try {
30991
30598
  const parser2 = compileFn(schema);
30992
- const clone2 = withParser(schema, parser2);
30599
+ const clone2 = clone(schema);
30600
+ const liveRun = schema._zod.run;
30601
+ const originalRun = liveRun.__originalRun ?? liveRun;
30602
+ const wrapped = (payload, ctx) => {
30603
+ if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
30604
+ return originalRun(payload, ctx);
30605
+ }
30606
+ if (ctx && isBackEdge(ctx, payload.value)) {
30607
+ return originalRun(payload, ctx);
30608
+ }
30609
+ const out = parser2(payload.value);
30610
+ if (out !== INVALID) {
30611
+ payload.value = out;
30612
+ return payload;
30613
+ }
30614
+ if (ctx)
30615
+ ctx[FALLBACK_FLAG] = true;
30616
+ return originalRun(payload, ctx);
30617
+ };
30618
+ wrapped.__originalRun = originalRun;
30619
+ clone2._zod.bag.fallbackRun = originalRun;
30993
30620
  clone2._zod.bag.validator = compileValidator(schema, parser2);
30621
+ clone2._zod.run = wrapped;
30622
+ if (!liveRun.__originalRun)
30623
+ installCompiledUserMethods(clone2, schema, parser2);
30994
30624
  return clone2;
30995
30625
  } catch (err) {
30996
30626
  if (options?.strict)
@@ -30998,37 +30628,6 @@ function compile(schema, options) {
30998
30628
  return schema;
30999
30629
  }
31000
30630
  }
31001
- function withParser(schema, parser2) {
31002
- if (isRecursiveSchema(schema)) {
31003
- throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
31004
- }
31005
- const clone2 = clone(schema);
31006
- const liveRun = schema._zod.run;
31007
- const originalRun = liveRun.__originalRun ?? liveRun;
31008
- const wrapped = (payload, ctx) => {
31009
- if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
31010
- return originalRun(payload, ctx);
31011
- }
31012
- if (ctx && isBackEdge(ctx, payload.value)) {
31013
- return originalRun(payload, ctx);
31014
- }
31015
- const out = parser2(payload.value);
31016
- if (out !== INVALID) {
31017
- payload.value = out;
31018
- return payload;
31019
- }
31020
- if (ctx)
31021
- ctx[FALLBACK_FLAG] = true;
31022
- return originalRun(payload, ctx);
31023
- };
31024
- wrapped.__originalRun = originalRun;
31025
- clone2._zod.bag.fallbackRun = originalRun;
31026
- clone2._zod.bag.validator = parser2;
31027
- clone2._zod.run = wrapped;
31028
- if (!liveRun.__originalRun)
31029
- installCompiledUserMethods(clone2, schema, parser2);
31030
- return clone2;
31031
- }
31032
30631
  function installCompiledUserMethods(target, source, parser2) {
31033
30632
  const targetAny = target;
31034
30633
  const sourceAny = source;
@@ -31064,8 +30663,7 @@ function compileFn(schema, options) {
31064
30663
  const ctx = {
31065
30664
  constants: new Map,
31066
30665
  constantCounter: 0,
31067
- varCounter: 0,
31068
- definite: true
30666
+ varCounter: 0
31069
30667
  };
31070
30668
  const doc = new Doc(["input"]);
31071
30669
  const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
@@ -31090,7 +30688,6 @@ ${code}
31090
30688
  if (options?.debug) {
31091
30689
  fn.code = fullCode;
31092
30690
  }
31093
- fn.definite = ctx.definite;
31094
30691
  return fn;
31095
30692
  }
31096
30693
  function addConstant(ctx, value) {
@@ -31102,10 +30699,6 @@ function addConstant(ctx, value) {
31102
30699
  ctx.constants.set(name, value);
31103
30700
  return name;
31104
30701
  }
31105
- function addUserConstant(ctx, fn) {
31106
- ctx.definite = false;
31107
- return addConstant(ctx, fn);
31108
- }
31109
30702
  function newVar(ctx) {
31110
30703
  return `v${ctx.varCounter++}`;
31111
30704
  }
@@ -31138,7 +30731,6 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
31138
30731
  }
31139
30732
  }
31140
30733
  function emitRuntimeIsland(doc, ctx, schema, accessor) {
31141
- ctx.definite = false;
31142
30734
  const schemaConst = addConstant(ctx, schema);
31143
30735
  const runConst = addConstant(ctx, runtimeRun);
31144
30736
  const outVar = newVar(ctx);
@@ -31219,9 +30811,6 @@ function generateChecks(doc, ctx, schema, accessor) {
31219
30811
  case "property":
31220
30812
  generatePropertyCheck(doc, ctx, def, currentAccessor);
31221
30813
  break;
31222
- case "properties":
31223
- generatePropertiesChecks(doc, ctx, def, currentAccessor);
31224
- break;
31225
30814
  case "overwrite": {
31226
30815
  const newAccessor = newVar(ctx);
31227
30816
  generateOverwriteCheck(doc, ctx, check, currentAccessor, newAccessor);
@@ -31327,19 +30916,6 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
31327
30916
  doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
31328
30917
  }
31329
30918
  }
31330
- function generatePropertiesChecks(doc, ctx, def, accessor) {
31331
- if (def.when) {
31332
- throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
31333
- }
31334
- doc.write(`if (${accessor} == null) return INVALID;`);
31335
- const shape = def.shape;
31336
- for (const key of Reflect.ownKeys(shape)) {
31337
- const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
31338
- const inputVar = newVar(ctx);
31339
- doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
31340
- compileChild(doc, ctx, shape[key], inputVar, false);
31341
- }
31342
- }
31343
30919
  function generatePropertyCheck(doc, ctx, def, accessor) {
31344
30920
  const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
31345
30921
  generateCheck(doc, ctx, def.schema, propAccessor);
@@ -31367,7 +30943,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
31367
30943
  if (isAsyncFunction(def.fn)) {
31368
30944
  throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
31369
30945
  }
31370
- const fnConst = addUserConstant(ctx, def.fn);
30946
+ const fnConst = addConstant(ctx, def.fn);
31371
30947
  const throwAsyncConst = addConstant(ctx, throwAsync);
31372
30948
  const resVar = newVar(ctx);
31373
30949
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -31387,7 +30963,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
31387
30963
  throwAsync();
31388
30964
  return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
31389
30965
  };
31390
- const helperConst = addUserConstant(ctx, helperFn);
30966
+ const helperConst = addConstant(ctx, helperFn);
31391
30967
  const outVar = newVar(ctx);
31392
30968
  doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
31393
30969
  doc.write(`if (${outVar} === INVALID) return INVALID;`);
@@ -31421,7 +30997,7 @@ var PATTERN_IS_COMPLETE = new Set([
31421
30997
  "uuid",
31422
30998
  "xid"
31423
30999
  ]);
31424
- function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
31000
+ function generateStringFormatCheck(doc, ctx, def, accessor) {
31425
31001
  const fmt = def.format;
31426
31002
  if (fmt === "base64") {
31427
31003
  const validator = addConstant(ctx, isValidBase64);
@@ -31454,14 +31030,9 @@ function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
31454
31030
  doc.write(`if (!${validator}(${accessor})) return INVALID;`);
31455
31031
  return accessor;
31456
31032
  }
31457
- if (fmt === "iban") {
31458
- const validator = addConstant(ctx, isValidIBAN);
31459
- doc.write(`if (!${validator}(${accessor})) return INVALID;`);
31460
- return accessor;
31461
- }
31462
31033
  const formatDef = def;
31463
31034
  if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== undefined || formatDef.protocol !== undefined) {
31464
- const parseConst = addConstant(ctx, validateURL);
31035
+ const parseConst = addConstant(ctx, parseURLObject);
31465
31036
  const defConst = addConstant(ctx, def);
31466
31037
  const trimVar = newVar(ctx);
31467
31038
  const urlVar = newVar(ctx);
@@ -31476,8 +31047,6 @@ function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
31476
31047
  const protocolConst = addConstant(ctx, urlProtocolOk);
31477
31048
  doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
31478
31049
  }
31479
- if (!needsValue)
31480
- return null;
31481
31050
  const outputVar = newVar(ctx);
31482
31051
  const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
31483
31052
  doc.write(`const ${outputVar} = ${outputExpr};`);
@@ -31536,7 +31105,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
31536
31105
  let typeAccessor;
31537
31106
  switch (type) {
31538
31107
  case "string":
31539
- typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
31108
+ typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
31540
31109
  break;
31541
31110
  case "number":
31542
31111
  typeAccessor = generateNumberCheck(doc, schema, accessor);
@@ -31656,12 +31225,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
31656
31225
  return null;
31657
31226
  return generateChecks(doc, ctx, schema, typeAccessor);
31658
31227
  }
31659
- function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
31228
+ function generateStringCheck(doc, ctx, schema, accessor) {
31660
31229
  doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
31661
31230
  const def = schema._zod.def;
31662
31231
  if (def.format === undefined)
31663
31232
  return accessor;
31664
- return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
31233
+ return generateStringFormatCheck(doc, ctx, def, accessor);
31665
31234
  }
31666
31235
  function generateNumberCheck(doc, schema, accessor) {
31667
31236
  doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
@@ -31779,7 +31348,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
31779
31348
  }
31780
31349
  }
31781
31350
  const outputVar = newVar(ctx);
31782
- const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
31351
+ const hasConditionalKeys = allKeys.some((k) => mayOutputUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
31783
31352
  if (!buildsValue) {
31784
31353
  if (unknownKeysMode === "schema") {
31785
31354
  const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
@@ -31806,7 +31375,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
31806
31375
  const out = propOutputs.get(k);
31807
31376
  if (dropsWhenAbsent(propShape[k])) {
31808
31377
  doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
31809
- } else if (mayOmitUndefined(propShape[k])) {
31378
+ } else if (mayOutputUndefined(propShape[k])) {
31810
31379
  doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
31811
31380
  } else {
31812
31381
  doc.write(`${outputVar}[${kx}] = ${out};`);
@@ -31939,9 +31508,6 @@ function fastPathAcceptsAbsence(schema) {
31939
31508
  function dropsWhenAbsent(schema) {
31940
31509
  return schema._zod.optin === "optional" && schema._zod.optout === "optional";
31941
31510
  }
31942
- function mayOmitUndefined(schema) {
31943
- return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
31944
- }
31945
31511
  function mayOutputUndefined(schema) {
31946
31512
  const def = schema._zod.def;
31947
31513
  switch (def.type) {
@@ -32284,7 +31850,6 @@ function literalEquality(ctx, accessor, value) {
32284
31850
  }
32285
31851
  function generateIntersectionCheck(doc, ctx, schema, accessor) {
32286
31852
  const def = schema._zod.def;
32287
- ctx.definite = false;
32288
31853
  const leftOutput = compileChild(doc, ctx, def.left, accessor);
32289
31854
  const rightOutput = compileChild(doc, ctx, def.right, accessor);
32290
31855
  const mergeConst = addConstant(ctx, mergeValues);
@@ -32338,13 +31903,14 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
32338
31903
  const keyIsBareString = keyDef.type === "string" && keyDef.format === undefined && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
32339
31904
  if (!keyIsBareString) {
32340
31905
  const isLoose = def.mode === "loose";
32341
- const keyFn = compileFn(def.keyType);
32342
- if (keyFn.definite === false)
32343
- ctx.definite = false;
32344
- const keyFast = addConstant(ctx, keyFn);
31906
+ const keyFast = addConstant(ctx, compileFn(def.keyType));
32345
31907
  const numericConst = addConstant(ctx, number);
31908
+ const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
32346
31909
  const outKeyVar = newVar(ctx);
32347
- emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
31910
+ doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
31911
+ doc.indented((d) => {
31912
+ d.write(`if (${kVar} === "__proto__") continue;`);
31913
+ d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
32348
31914
  d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
32349
31915
  d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
32350
31916
  if (isLoose) {
@@ -32358,39 +31924,21 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
32358
31924
  const valOutput = compileChild(d, ctx, def.valueType, valueVar);
32359
31925
  d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
32360
31926
  });
31927
+ doc.write(`}`);
32361
31928
  return outputVar;
32362
31929
  }
32363
- emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
31930
+ const propIsEnumerable = addConstant(ctx, Object.prototype.propertyIsEnumerable);
31931
+ doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
31932
+ doc.indented((d) => {
31933
+ d.write(`if (${kVar} === "__proto__") continue;`);
31934
+ d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
31935
+ d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
32364
31936
  d.write(`const ${valVar} = ${accessor}[${kVar}];`);
32365
31937
  const valOutput = compileChild(d, ctx, def.valueType, valVar);
32366
31938
  d.write(`${outputVar}[${kVar}] = ${valOutput};`);
32367
- }, `return INVALID;`);
32368
- return outputVar;
32369
- }
32370
- function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
32371
- const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
32372
- const symsVar = newVar(ctx);
32373
- const keysVar = newVar(ctx);
32374
- const iVar = newVar(ctx);
32375
- doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
32376
- doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
32377
- doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
32378
- doc.indented((d) => {
32379
- d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
32380
- d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
32381
- body(d);
32382
- });
32383
- doc.write(`}`);
32384
- doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
32385
- doc.indented((d) => {
32386
- d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
32387
- d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
32388
- if (onSymbol)
32389
- d.write(onSymbol);
32390
- else
32391
- body(d);
32392
31939
  });
32393
31940
  doc.write(`}`);
31941
+ return outputVar;
32394
31942
  }
32395
31943
  function literalPropertyKey(ctx, key) {
32396
31944
  if (typeof key === "string")
@@ -32443,7 +31991,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
32443
31991
  }
32444
31992
  function generateLazyCheck(doc, ctx, schema, accessor) {
32445
31993
  const def = schema._zod.def;
32446
- const getterConst = addUserConstant(ctx, def.getter);
31994
+ const getterConst = addConstant(ctx, def.getter);
32447
31995
  const cacheConst = addConstant(ctx, { parser: null });
32448
31996
  doc.write(`if (!${cacheConst}.parser) {`);
32449
31997
  doc.indented((d) => {
@@ -32476,7 +32024,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
32476
32024
  return INVALID;
32477
32025
  return fakePayload.issues.length === 0 ? result : INVALID;
32478
32026
  };
32479
- const helperConst = addUserConstant(ctx, helperFn);
32027
+ const helperConst = addConstant(ctx, helperFn);
32480
32028
  const transformedVar = newVar(ctx);
32481
32029
  doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
32482
32030
  doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
@@ -32494,7 +32042,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
32494
32042
  if (isAsyncFunction(def.fn)) {
32495
32043
  throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
32496
32044
  }
32497
- const fnConst = addUserConstant(ctx, def.fn);
32045
+ const fnConst = addConstant(ctx, def.fn);
32498
32046
  const throwAsyncConst = addConstant(ctx, throwAsync);
32499
32047
  const resVar = newVar(ctx);
32500
32048
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -32527,7 +32075,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
32527
32075
  });
32528
32076
  doc.write(`})();`);
32529
32077
  const innerConst = addConstant(ctx, def.innerType);
32530
- const catchConst = addUserConstant(ctx, def.catchValue);
32078
+ const catchConst = addConstant(ctx, def.catchValue);
32531
32079
  const catchHelperConst = addConstant(ctx, runtimeCatch);
32532
32080
  doc.write(`if (${outputVar} === INVALID) {`);
32533
32081
  doc.indented((d) => {
@@ -32551,7 +32099,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
32551
32099
  return INVALID;
32552
32100
  return fakePayload.issues.length === 0 ? result : INVALID;
32553
32101
  };
32554
- const helperConst = addUserConstant(ctx, helperFn);
32102
+ const helperConst = addConstant(ctx, helperFn);
32555
32103
  const outputVar = newVar(ctx);
32556
32104
  doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
32557
32105
  doc.write(`if (${outputVar} === INVALID) return INVALID;`);
@@ -32560,16 +32108,18 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
32560
32108
  return accessor;
32561
32109
  }
32562
32110
  // node_modules/zod/v4/core/api.js
32563
- function snapshotChecks(def) {
32564
- if (def.checks)
32565
- def.checks = [...def.checks];
32566
- return def;
32567
- }
32568
32111
  function _string(Class2, params) {
32569
- return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
32112
+ return new Class2({
32113
+ type: "string",
32114
+ ...normalizeParams(params)
32115
+ });
32570
32116
  }
32571
32117
  function _coercedString(Class2, params) {
32572
- return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
32118
+ return new Class2({
32119
+ type: "string",
32120
+ coerce: true,
32121
+ ...normalizeParams(params)
32122
+ });
32573
32123
  }
32574
32124
  function _email(Class2, params) {
32575
32125
  return new Class2({
@@ -32781,15 +32331,6 @@ function _creditCard(Class2, params) {
32781
32331
  ...normalizeParams(params)
32782
32332
  });
32783
32333
  }
32784
- function _iban(Class2, params) {
32785
- return new Class2({
32786
- type: "string",
32787
- format: "iban",
32788
- check: "string_format",
32789
- abort: false,
32790
- ...normalizeParams(params)
32791
- });
32792
- }
32793
32334
  function _jwt(Class2, params) {
32794
32335
  return new Class2({
32795
32336
  type: "string",
@@ -32843,10 +32384,19 @@ function _isoDuration(Class2, params) {
32843
32384
  });
32844
32385
  }
32845
32386
  function _number(Class2, params) {
32846
- return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
32387
+ return new Class2({
32388
+ type: "number",
32389
+ checks: [],
32390
+ ...normalizeParams(params)
32391
+ });
32847
32392
  }
32848
32393
  function _coercedNumber(Class2, params) {
32849
- return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
32394
+ return new Class2({
32395
+ type: "number",
32396
+ coerce: true,
32397
+ checks: [],
32398
+ ...normalizeParams(params)
32399
+ });
32850
32400
  }
32851
32401
  function _int(Class2, params) {
32852
32402
  return new Class2({
@@ -33144,12 +32694,8 @@ function _property(property, schema, params) {
33144
32694
  ...normalizeParams(params)
33145
32695
  });
33146
32696
  }
33147
- function _properties(shape, params) {
33148
- return new $ZodCheckProperties({
33149
- check: "properties",
33150
- shape,
33151
- ...normalizeParams(params)
33152
- });
32697
+ function _properties(shape) {
32698
+ return Object.entries(shape).map(([property, schema]) => new $ZodCheckProperty({ check: "property", property, schema }));
33153
32699
  }
33154
32700
  function _mime(types, params) {
33155
32701
  return new $ZodCheckMimeType({
@@ -33540,7 +33086,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
33540
33086
  Object.assign(json, result);
33541
33087
  return true;
33542
33088
  }
33543
- function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
33089
+ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
33544
33090
  var _a3;
33545
33091
  const def = schema._zod.def;
33546
33092
  const seen = ctx.seen.get(schema);
@@ -33579,7 +33125,7 @@ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
33579
33125
  if (parent) {
33580
33126
  if (!result.ref)
33581
33127
  result.ref = parent;
33582
- processSchema(parent, ctx, params);
33128
+ process2(parent, ctx, params);
33583
33129
  ctx.seen.get(parent).isParent = true;
33584
33130
  }
33585
33131
  }
@@ -33684,6 +33230,7 @@ function extractDefs(ctx, schema) {
33684
33230
  if (seen.count > 1) {
33685
33231
  if (ctx.reused === "ref") {
33686
33232
  extractToDef(entry);
33233
+ continue;
33687
33234
  }
33688
33235
  }
33689
33236
  }
@@ -34008,106 +33555,18 @@ function isTransforming(_schema, _ctx) {
34008
33555
  }
34009
33556
  var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
34010
33557
  const ctx = initializeContext({ ...params, processors });
34011
- processSchema(schema, ctx);
33558
+ process2(schema, ctx);
34012
33559
  extractDefs(ctx, schema);
34013
33560
  return finalize(ctx, schema);
34014
33561
  };
34015
33562
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
34016
33563
  const { libraryOptions, target } = params ?? {};
34017
33564
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
34018
- processSchema(schema, ctx);
33565
+ process2(schema, ctx);
34019
33566
  extractDefs(ctx, schema);
34020
33567
  return finalize(ctx, schema);
34021
33568
  };
34022
33569
  // node_modules/zod/v4/core/json-schema-processors.js
34023
- var narrowMin = (agg, key, value) => {
34024
- if (agg[key] === undefined || value > agg[key])
34025
- agg[key] = value;
34026
- };
34027
- var narrowMax = (agg, key, value) => {
34028
- if (agg[key] === undefined || value < agg[key])
34029
- agg[key] = value;
34030
- };
34031
- var narrowBoth = (agg, value) => {
34032
- narrowMin(agg, "minimum", value);
34033
- narrowMax(agg, "maximum", value);
34034
- };
34035
- var addDivisor = (agg, value) => {
34036
- agg.multipleOf ?? (agg.multipleOf = []);
34037
- if (!agg.multipleOf.includes(value))
34038
- agg.multipleOf.push(value);
34039
- };
34040
- var addPattern = (agg, pattern) => {
34041
- agg.patterns ?? (agg.patterns = new Set);
34042
- agg.patterns.add(pattern);
34043
- };
34044
- var intersectMime = (agg, mime) => {
34045
- agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
34046
- };
34047
- var setFormat = (agg, format) => {
34048
- agg.format = format;
34049
- if (format.includes("int"))
34050
- agg.isInt = true;
34051
- };
34052
- var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
34053
- var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
34054
- var formatContributor = (ranges) => (agg, def) => {
34055
- setFormat(agg, def.format);
34056
- const [minimum, maximum] = ranges[def.format];
34057
- narrowMin(agg, "minimum", minimum);
34058
- narrowMax(agg, "maximum", maximum);
34059
- };
34060
- var contributors = {
34061
- greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
34062
- less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
34063
- multiple_of: (agg, def) => addDivisor(agg, def.value),
34064
- number_format: formatContributor(NUMBER_FORMAT_RANGES),
34065
- bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
34066
- min_length: minContributor,
34067
- max_length: maxContributor,
34068
- length_equals: (agg, def) => narrowBoth(agg, def.length),
34069
- min_size: minContributor,
34070
- max_size: maxContributor,
34071
- size_equals: (agg, def) => narrowBoth(agg, def.size),
34072
- string_format: (agg, def) => {
34073
- setFormat(agg, def.format);
34074
- if (def.pattern)
34075
- addPattern(agg, def.pattern);
34076
- if (def.format === "base64" || def.format === "base64url")
34077
- agg.contentEncoding = def.format;
34078
- if (def.local || def.precision === -1)
34079
- agg.laxFormat = true;
34080
- },
34081
- mime_type: (agg, def) => intersectMime(agg, def.mime)
34082
- };
34083
- function aggregateChecks(schema) {
34084
- const agg = {};
34085
- const def = schema._zod.def;
34086
- const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
34087
- for (const ch of list)
34088
- contributors[ch._zod.def.check]?.(agg, ch._zod.def);
34089
- const bag = schema._zod.bag;
34090
- if (bag.minimum !== undefined)
34091
- narrowMin(agg, "minimum", bag.minimum);
34092
- if (bag.exclusiveMinimum !== undefined)
34093
- narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
34094
- if (bag.maximum !== undefined)
34095
- narrowMax(agg, "maximum", bag.maximum);
34096
- if (bag.exclusiveMaximum !== undefined)
34097
- narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
34098
- if (bag.multipleOf !== undefined)
34099
- addDivisor(agg, bag.multipleOf);
34100
- if (bag.format !== undefined) {
34101
- agg.format ?? (agg.format = bag.format);
34102
- if (bag.format.includes("int"))
34103
- agg.isInt = true;
34104
- }
34105
- if (bag.mime)
34106
- intersectMime(agg, bag.mime);
34107
- for (const pattern of bag.patterns ?? [])
34108
- addPattern(agg, pattern);
34109
- return agg;
34110
- }
34111
33570
  var formatMap = {
34112
33571
  guid: "uuid",
34113
33572
  url: "uri",
@@ -34115,15 +33574,10 @@ var formatMap = {
34115
33574
  json_string: "json-string",
34116
33575
  regex: ""
34117
33576
  };
34118
- var exactPatterns = new Map([
34119
- [base64Charset, base64],
34120
- [base64urlCharset, base64url]
34121
- ]);
34122
- var exactPattern = (p) => exactPatterns.get(p) ?? p;
34123
33577
  var stringProcessor = (schema, ctx, _json, _params) => {
34124
33578
  const json = _json;
34125
33579
  json.type = "string";
34126
- const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
33580
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
34127
33581
  if (typeof minimum === "number")
34128
33582
  json.minLength = minimum;
34129
33583
  if (typeof maximum === "number")
@@ -34139,7 +33593,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
34139
33593
  if (contentEncoding)
34140
33594
  json.contentEncoding = contentEncoding;
34141
33595
  if (patterns && patterns.size > 0) {
34142
- const patternList = [...patterns].map(exactPattern);
33596
+ const patternList = [...patterns];
34143
33597
  if (patternList.length === 1)
34144
33598
  json.pattern = patternList[0].source;
34145
33599
  else if (patternList.length > 1) {
@@ -34154,8 +33608,11 @@ var stringProcessor = (schema, ctx, _json, _params) => {
34154
33608
  };
34155
33609
  var numberProcessor = (schema, ctx, _json, params) => {
34156
33610
  const json = _json;
34157
- const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
34158
- json.type = isInt ? "integer" : "number";
33611
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
33612
+ if (typeof format === "string" && format.includes("int"))
33613
+ json.type = "integer";
33614
+ else
33615
+ json.type = "number";
34159
33616
  const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
34160
33617
  const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
34161
33618
  const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
@@ -34179,19 +33636,11 @@ var numberProcessor = (schema, ctx, _json, params) => {
34179
33636
  } else if (typeof maximum === "number") {
34180
33637
  json.maximum = maximum;
34181
33638
  }
34182
- if (multipleOf) {
34183
- const divisors = new Set;
34184
- for (const divisor of multipleOf) {
34185
- if (Number.isFinite(divisor) && divisor !== 0)
34186
- divisors.add(Math.abs(divisor));
34187
- else
34188
- handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
34189
- }
34190
- const [first, ...rest] = divisors;
34191
- if (first !== undefined)
34192
- json.multipleOf = first;
34193
- if (rest.length)
34194
- json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
33639
+ if (typeof multipleOf === "number") {
33640
+ if (Number.isFinite(multipleOf) && multipleOf !== 0)
33641
+ json.multipleOf = Math.abs(multipleOf);
33642
+ else
33643
+ handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
34195
33644
  }
34196
33645
  };
34197
33646
  var booleanProcessor = (_schema, _ctx, json, _params) => {
@@ -34291,22 +33740,27 @@ var templateLiteralProcessor = (schema, _ctx, json, _params) => {
34291
33740
  };
34292
33741
  var fileProcessor = (schema, _ctx, json, _params) => {
34293
33742
  const _json = json;
34294
- _json.type = "string";
34295
- _json.format = "binary";
34296
- _json.contentEncoding = "binary";
34297
- const { minimum, maximum, mime } = aggregateChecks(schema);
33743
+ const file = {
33744
+ type: "string",
33745
+ format: "binary",
33746
+ contentEncoding: "binary"
33747
+ };
33748
+ const { minimum, maximum, mime } = schema._zod.bag;
34298
33749
  if (minimum !== undefined)
34299
- _json.minLength = minimum;
33750
+ file.minLength = minimum;
34300
33751
  if (maximum !== undefined)
34301
- _json.maxLength = maximum;
34302
- if (!mime)
34303
- return;
34304
- if (mime.length === 0)
34305
- _json.not = {};
34306
- else if (mime.length === 1)
34307
- _json.contentMediaType = mime[0];
34308
- else
34309
- _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
33752
+ file.maxLength = maximum;
33753
+ if (mime) {
33754
+ if (mime.length === 1) {
33755
+ file.contentMediaType = mime[0];
33756
+ Object.assign(_json, file);
33757
+ } else {
33758
+ Object.assign(_json, file);
33759
+ _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
33760
+ }
33761
+ } else {
33762
+ Object.assign(_json, file);
33763
+ }
34310
33764
  };
34311
33765
  var successProcessor = (_schema, _ctx, json, _params) => {
34312
33766
  json.type = "boolean";
@@ -34329,13 +33783,13 @@ var setProcessor = (schema, ctx, json, params) => {
34329
33783
  var arrayProcessor = (schema, ctx, _json, params) => {
34330
33784
  const json = _json;
34331
33785
  const def = schema._zod.def;
34332
- const { minimum, maximum } = aggregateChecks(schema);
33786
+ const { minimum, maximum } = schema._zod.bag;
34333
33787
  if (typeof minimum === "number")
34334
33788
  json.minItems = minimum;
34335
33789
  if (typeof maximum === "number")
34336
33790
  json.maxItems = maximum;
34337
33791
  json.type = "array";
34338
- json.items = processSchema(def.element, ctx, {
33792
+ json.items = process2(def.element, ctx, {
34339
33793
  ...params,
34340
33794
  path: [...params.path, "items"]
34341
33795
  });
@@ -34361,20 +33815,22 @@ var objectProcessor = (schema, ctx, _json, params) => {
34361
33815
  json.type = "object";
34362
33816
  json.properties = {};
34363
33817
  for (const key in shape) {
34364
- assignProp(json.properties, key, processSchema(shape[key], ctx, {
33818
+ assignProp(json.properties, key, process2(shape[key], ctx, {
34365
33819
  ...params,
34366
33820
  path: [...params.path, "properties", key]
34367
33821
  }));
34368
33822
  }
34369
- const requiredKeys = [];
34370
- for (const key of Object.keys(shape)) {
33823
+ const allKeys = new Set(Object.keys(shape));
33824
+ const requiredKeys = new Set([...allKeys].filter((key) => {
34371
33825
  const field2 = def.shape[key];
34372
- if (ctx.io === "input" ? inputOptin(field2) === undefined : field2._zod.optout === undefined) {
34373
- requiredKeys.push(key);
33826
+ if (ctx.io === "input") {
33827
+ return inputOptin(field2) === undefined;
33828
+ } else {
33829
+ return field2._zod.optout === undefined;
34374
33830
  }
34375
- }
34376
- if (requiredKeys.length > 0) {
34377
- json.required = requiredKeys;
33831
+ }));
33832
+ if (requiredKeys.size > 0) {
33833
+ json.required = Array.from(requiredKeys);
34378
33834
  }
34379
33835
  if (def.catchall?._zod.def.type === "never") {
34380
33836
  json.additionalProperties = false;
@@ -34382,7 +33838,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
34382
33838
  if (ctx.io === "output")
34383
33839
  json.additionalProperties = false;
34384
33840
  } else if (def.catchall) {
34385
- json.additionalProperties = processSchema(def.catchall, ctx, {
33841
+ json.additionalProperties = process2(def.catchall, ctx, {
34386
33842
  ...params,
34387
33843
  path: [...params.path, "additionalProperties"]
34388
33844
  });
@@ -34391,7 +33847,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
34391
33847
  var unionProcessor = (schema, ctx, json, params) => {
34392
33848
  const def = schema._zod.def;
34393
33849
  const isExclusive = def.inclusive === false;
34394
- const options = def.options.map((x, i) => processSchema(x, ctx, {
33850
+ const options = def.options.map((x, i) => process2(x, ctx, {
34395
33851
  ...params,
34396
33852
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
34397
33853
  }));
@@ -34403,11 +33859,11 @@ var unionProcessor = (schema, ctx, json, params) => {
34403
33859
  };
34404
33860
  var intersectionProcessor = (schema, ctx, json, params) => {
34405
33861
  const def = schema._zod.def;
34406
- const a = processSchema(def.left, ctx, {
33862
+ const a = process2(def.left, ctx, {
34407
33863
  ...params,
34408
33864
  path: [...params.path, "allOf", 0]
34409
33865
  });
34410
- const b = processSchema(def.right, ctx, {
33866
+ const b = process2(def.right, ctx, {
34411
33867
  ...params,
34412
33868
  path: [...params.path, "allOf", 1]
34413
33869
  });
@@ -34425,11 +33881,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
34425
33881
  json.type = "array";
34426
33882
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
34427
33883
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
34428
- const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
33884
+ const prefixItems = def.items.map((x, i) => process2(x, ctx, {
34429
33885
  ...params,
34430
33886
  path: [...params.path, prefixPath, i]
34431
33887
  }));
34432
- const rest = def.rest ? processSchema(def.rest, ctx, {
33888
+ const rest = def.rest ? process2(def.rest, ctx, {
34433
33889
  ...params,
34434
33890
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
34435
33891
  }) : null;
@@ -34477,7 +33933,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
34477
33933
  if (isClosed)
34478
33934
  json.maxItems = maxItems;
34479
33935
  }
34480
- const { minimum, maximum } = aggregateChecks(schema);
33936
+ const { minimum, maximum } = schema._zod.bag;
34481
33937
  if (typeof minimum === "number")
34482
33938
  json.minItems = minimum;
34483
33939
  if (typeof maximum === "number")
@@ -34551,19 +34007,20 @@ var recordProcessor = (schema, ctx, _json, params) => {
34551
34007
  const def = schema._zod.def;
34552
34008
  json.type = "object";
34553
34009
  const keyType = def.keyType;
34554
- const patterns = aggregateChecks(keyType).patterns;
34010
+ const keyBag = keyType._zod.bag;
34011
+ const patterns = keyBag?.patterns;
34555
34012
  if (def.mode === "loose" && patterns && patterns.size > 0) {
34556
- const valueSchema = processSchema(def.valueType, ctx, {
34013
+ const valueSchema = process2(def.valueType, ctx, {
34557
34014
  ...params,
34558
34015
  path: [...params.path, "patternProperties", "*"]
34559
34016
  });
34560
34017
  json.patternProperties = {};
34561
34018
  for (const pattern of patterns) {
34562
- assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
34019
+ assignProp(json.patternProperties, pattern.source, valueSchema);
34563
34020
  }
34564
34021
  } else {
34565
34022
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
34566
- json.propertyNames = processSchema(def.keyType, ctx, {
34023
+ json.propertyNames = process2(def.keyType, ctx, {
34567
34024
  ...params,
34568
34025
  path: [...params.path, "propertyNames"]
34569
34026
  });
@@ -34575,7 +34032,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
34575
34032
  }
34576
34033
  pending.push(schema);
34577
34034
  }
34578
- json.additionalProperties = processSchema(def.valueType, ctx, {
34035
+ json.additionalProperties = process2(def.valueType, ctx, {
34579
34036
  ...params,
34580
34037
  path: [...params.path, "additionalProperties"]
34581
34038
  });
@@ -34591,7 +34048,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
34591
34048
  };
34592
34049
  var nullableProcessor = (schema, ctx, json, params) => {
34593
34050
  const def = schema._zod.def;
34594
- const inner = processSchema(def.innerType, ctx, params);
34051
+ const inner = process2(def.innerType, ctx, params);
34595
34052
  const seen = ctx.seen.get(schema);
34596
34053
  if (ctx.target === "openapi-3.0") {
34597
34054
  seen.ref = def.innerType;
@@ -34602,7 +34059,7 @@ var nullableProcessor = (schema, ctx, json, params) => {
34602
34059
  };
34603
34060
  var nonoptionalProcessor = (schema, ctx, _json, params) => {
34604
34061
  const def = schema._zod.def;
34605
- processSchema(def.innerType, ctx, params);
34062
+ process2(def.innerType, ctx, params);
34606
34063
  const seen = ctx.seen.get(schema);
34607
34064
  seen.ref = def.innerType;
34608
34065
  };
@@ -34622,7 +34079,7 @@ function serializeDefaultValue(value, schema, ctx, json, params) {
34622
34079
  }
34623
34080
  var defaultProcessor = (schema, ctx, json, params) => {
34624
34081
  const def = schema._zod.def;
34625
- processSchema(def.innerType, ctx, params);
34082
+ process2(def.innerType, ctx, params);
34626
34083
  const seen = ctx.seen.get(schema);
34627
34084
  seen.ref = def.innerType;
34628
34085
  const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
@@ -34631,7 +34088,7 @@ var defaultProcessor = (schema, ctx, json, params) => {
34631
34088
  };
34632
34089
  var prefaultProcessor = (schema, ctx, json, params) => {
34633
34090
  const def = schema._zod.def;
34634
- processSchema(def.innerType, ctx, params);
34091
+ process2(def.innerType, ctx, params);
34635
34092
  const seen = ctx.seen.get(schema);
34636
34093
  seen.ref = def.innerType;
34637
34094
  if (ctx.io !== "input")
@@ -34642,7 +34099,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
34642
34099
  };
34643
34100
  var catchProcessor = (schema, ctx, json, params) => {
34644
34101
  const def = schema._zod.def;
34645
- processSchema(def.innerType, ctx, params);
34102
+ process2(def.innerType, ctx, params);
34646
34103
  const seen = ctx.seen.get(schema);
34647
34104
  seen.ref = def.innerType;
34648
34105
  let catchValue;
@@ -34658,32 +34115,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
34658
34115
  const def = schema._zod.def;
34659
34116
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
34660
34117
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
34661
- processSchema(innerType, ctx, params);
34118
+ process2(innerType, ctx, params);
34662
34119
  const seen = ctx.seen.get(schema);
34663
34120
  seen.ref = innerType;
34664
34121
  };
34665
34122
  var readonlyProcessor = (schema, ctx, json, params) => {
34666
34123
  const def = schema._zod.def;
34667
- processSchema(def.innerType, ctx, params);
34124
+ process2(def.innerType, ctx, params);
34668
34125
  const seen = ctx.seen.get(schema);
34669
34126
  seen.ref = def.innerType;
34670
34127
  json.readOnly = true;
34671
34128
  };
34672
34129
  var promiseProcessor = (schema, ctx, _json, params) => {
34673
34130
  const def = schema._zod.def;
34674
- processSchema(def.innerType, ctx, params);
34131
+ process2(def.innerType, ctx, params);
34675
34132
  const seen = ctx.seen.get(schema);
34676
34133
  seen.ref = def.innerType;
34677
34134
  };
34678
34135
  var optionalProcessor = (schema, ctx, _json, params) => {
34679
34136
  const def = schema._zod.def;
34680
- processSchema(def.innerType, ctx, params);
34137
+ process2(def.innerType, ctx, params);
34681
34138
  const seen = ctx.seen.get(schema);
34682
34139
  seen.ref = def.innerType;
34683
34140
  };
34684
34141
  var lazyProcessor = (schema, ctx, _json, params) => {
34685
34142
  const innerType = schema._zod.innerType;
34686
- processSchema(innerType, ctx, params);
34143
+ process2(innerType, ctx, params);
34687
34144
  const seen = ctx.seen.get(schema);
34688
34145
  seen.ref = innerType;
34689
34146
  };
@@ -34735,7 +34192,7 @@ function toJSONSchema(input, params) {
34735
34192
  const defs = {};
34736
34193
  for (const entry of registry2._idmap.entries()) {
34737
34194
  const [_, schema] = entry;
34738
- processSchema(schema, ctx2);
34195
+ process2(schema, ctx2);
34739
34196
  }
34740
34197
  const schemas = {};
34741
34198
  const external = {
@@ -34758,7 +34215,7 @@ function toJSONSchema(input, params) {
34758
34215
  return { schemas };
34759
34216
  }
34760
34217
  const ctx = initializeContext({ ...params, processors: allProcessors });
34761
- processSchema(input, ctx);
34218
+ process2(input, ctx);
34762
34219
  extractDefs(ctx, input);
34763
34220
  return finalize(ctx, input);
34764
34221
  }
@@ -34804,7 +34261,7 @@ class JSONSchemaGenerator {
34804
34261
  });
34805
34262
  }
34806
34263
  process(schema, _params = { path: [], schemaPath: [] }) {
34807
- return processSchema(schema, this.ctx, _params);
34264
+ return process2(schema, this.ctx, _params);
34808
34265
  }
34809
34266
  emit(schema, _params) {
34810
34267
  if (_params) {
@@ -34891,7 +34348,6 @@ __export(exports_schemas2, {
34891
34348
  int32: () => int32,
34892
34349
  int: () => int,
34893
34350
  instanceof: () => _instanceof,
34894
- iban: () => iban2,
34895
34351
  httpUrl: () => httpUrl,
34896
34352
  hostname: () => hostname3,
34897
34353
  hex: () => hex2,
@@ -34910,7 +34366,6 @@ __export(exports_schemas2, {
34910
34366
  describe: () => describe2,
34911
34367
  date: () => date2,
34912
34368
  custom: () => custom,
34913
- currencyCode: () => currencyCode2,
34914
34369
  cuid2: () => cuid22,
34915
34370
  cuid: () => cuid3,
34916
34371
  creditCard: () => creditCard2,
@@ -34969,14 +34424,12 @@ __export(exports_schemas2, {
34969
34424
  ZodKSUID: () => ZodKSUID,
34970
34425
  ZodJWT: () => ZodJWT,
34971
34426
  ZodIntersection: () => ZodIntersection,
34972
- ZodInstanceOf: () => ZodInstanceOf,
34973
34427
  ZodISOTime: () => ZodISOTime,
34974
34428
  ZodISODuration: () => ZodISODuration,
34975
34429
  ZodISODateTime: () => ZodISODateTime,
34976
34430
  ZodISODate: () => ZodISODate,
34977
34431
  ZodIPv6: () => ZodIPv6,
34978
34432
  ZodIPv4: () => ZodIPv4,
34979
- ZodIBAN: () => ZodIBAN,
34980
34433
  ZodGUID: () => ZodGUID,
34981
34434
  ZodFunction: () => ZodFunction,
34982
34435
  ZodFile: () => ZodFile,
@@ -35241,12 +34694,6 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
35241
34694
  set spa(value) {
35242
34695
  exports_util.own(this, "spa", value);
35243
34696
  },
35244
- validate(data, params) {
35245
- return validate(this, data, params);
35246
- },
35247
- validateAsync(data, params) {
35248
- return validateAsync(this, data, params);
35249
- },
35250
34697
  encode: function _encode2(data, params) {
35251
34698
  return encode2(this, data, params, { callee: _encode2 });
35252
34699
  },
@@ -35285,10 +34732,10 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
35285
34732
  $ZodString.init(inst, def);
35286
34733
  ZodType.init(inst, def);
35287
34734
  inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
35288
- }, /* @__PURE__ */ exports_util.derived({
35289
- format: (inst) => aggregateChecks(inst).format ?? null,
35290
- minLength: (inst) => aggregateChecks(inst).minimum ?? null,
35291
- maxLength: (inst) => aggregateChecks(inst).maximum ?? null
34735
+ const bag = inst._zod.bag;
34736
+ inst.format = bag.format ?? null;
34737
+ inst.minLength = bag.minimum ?? null;
34738
+ inst.maxLength = bag.maximum ?? null;
35292
34739
  }, {
35293
34740
  regex(...args) {
35294
34741
  return this.check(_regex(...args));
@@ -35335,7 +34782,7 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
35335
34782
  slugify() {
35336
34783
  return this.check(_slugify());
35337
34784
  }
35338
- }));
34785
+ });
35339
34786
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
35340
34787
  $ZodString.init(inst, def);
35341
34788
  _ZodString.init(inst, def);
@@ -35481,8 +34928,8 @@ function url(params) {
35481
34928
  }
35482
34929
  function httpUrl(params) {
35483
34930
  return _url(ZodURL, {
35484
- protocol: httpProtocol,
35485
- hostname: domain,
34931
+ protocol: exports_regexes.httpProtocol,
34932
+ hostname: exports_regexes.domain,
35486
34933
  ...exports_util.normalizeParams(params)
35487
34934
  });
35488
34935
  }
@@ -35598,13 +35045,6 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
35598
35045
  function creditCard2(params) {
35599
35046
  return _creditCard(ZodCreditCard, params);
35600
35047
  }
35601
- var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
35602
- $ZodIBAN.init(inst, def);
35603
- ZodStringFormat.init(inst, def);
35604
- });
35605
- function iban2(params) {
35606
- return _iban(ZodIBAN, params);
35607
- }
35608
35048
  var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
35609
35049
  $ZodJWT.init(inst, def);
35610
35050
  ZodStringFormat.init(inst, def);
@@ -35620,13 +35060,10 @@ function stringFormat(format, fnOrRegex, _params = {}) {
35620
35060
  return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
35621
35061
  }
35622
35062
  function hostname3(_params) {
35623
- return _stringFormat(ZodCustomStringFormat, "hostname", hostname2, _params);
35063
+ return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params);
35624
35064
  }
35625
35065
  function hex2(_params) {
35626
- return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
35627
- }
35628
- function currencyCode2(_params) {
35629
- return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
35066
+ return _stringFormat(ZodCustomStringFormat, "hex", exports_regexes.hex, _params);
35630
35067
  }
35631
35068
  function hash2(alg, params) {
35632
35069
  const enc = params?.enc ?? "hex";
@@ -35640,21 +35077,12 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
35640
35077
  $ZodNumber.init(inst, def);
35641
35078
  ZodType.init(inst, def);
35642
35079
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
35080
+ const bag = inst._zod.bag;
35081
+ inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
35082
+ inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
35083
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
35643
35084
  inst.isFinite = true;
35644
- }, /* @__PURE__ */ exports_util.derived({
35645
- minValue: (inst) => {
35646
- const { minimum, exclusiveMinimum } = aggregateChecks(inst);
35647
- return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
35648
- },
35649
- maxValue: (inst) => {
35650
- const { maximum, exclusiveMaximum } = aggregateChecks(inst);
35651
- return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
35652
- },
35653
- isInt: (inst) => {
35654
- const { isInt, multipleOf } = aggregateChecks(inst);
35655
- return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
35656
- },
35657
- format: (inst) => aggregateChecks(inst).format ?? null
35085
+ inst.format = bag.format ?? null;
35658
35086
  }, {
35659
35087
  gt(value, params) {
35660
35088
  return this.check(_gt(value, params));
@@ -35701,7 +35129,7 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
35701
35129
  finite() {
35702
35130
  return this;
35703
35131
  }
35704
- }));
35132
+ });
35705
35133
  function number2(params) {
35706
35134
  return _number(ZodNumber, params);
35707
35135
  }
@@ -35736,10 +35164,10 @@ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
35736
35164
  $ZodBigInt.init(inst, def);
35737
35165
  ZodType.init(inst, def);
35738
35166
  inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
35739
- }, /* @__PURE__ */ exports_util.derived({
35740
- minValue: (inst) => aggregateChecks(inst).minimum ?? null,
35741
- maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
35742
- format: (inst) => aggregateChecks(inst).format ?? null
35167
+ const bag = inst._zod.bag;
35168
+ inst.minValue = bag.minimum ?? null;
35169
+ inst.maxValue = bag.maximum ?? null;
35170
+ inst.format = bag.format ?? null;
35743
35171
  }, {
35744
35172
  gte(value, params) {
35745
35173
  return this.check(_gte(value, params));
@@ -35774,7 +35202,7 @@ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
35774
35202
  multipleOf(value, params) {
35775
35203
  return this.check(_multipleOf(value, params));
35776
35204
  }
35777
- }));
35205
+ });
35778
35206
  function bigint2(params) {
35779
35207
  return _bigint(ZodBigInt, params);
35780
35208
  }
@@ -35850,16 +35278,10 @@ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
35850
35278
  inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
35851
35279
  inst.min = (value, params) => inst.check(_gte(value, params));
35852
35280
  inst.max = (value, params) => inst.check(_lte(value, params));
35853
- }, /* @__PURE__ */ exports_util.derived({
35854
- minDate: (inst) => {
35855
- const { minimum } = aggregateChecks(inst);
35856
- return minimum ? new Date(minimum) : null;
35857
- },
35858
- maxDate: (inst) => {
35859
- const { maximum } = aggregateChecks(inst);
35860
- return maximum ? new Date(maximum) : null;
35861
- }
35862
- }, {}));
35281
+ const c = inst._zod.bag;
35282
+ inst.minDate = c.minimum ? new Date(c.minimum) : null;
35283
+ inst.maxDate = c.maximum ? new Date(c.maximum) : null;
35284
+ });
35863
35285
  function date2(params) {
35864
35286
  return _date(ZodDate, params);
35865
35287
  }
@@ -35904,19 +35326,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
35904
35326
  return _enum2(Object.keys(this._zod.def.shape));
35905
35327
  },
35906
35328
  catchall(catchall) {
35907
- return this.clone(exports_util.mergeDefs(this._zod.def, { catchall }));
35329
+ return this.clone({ ...this._zod.def, catchall });
35908
35330
  },
35909
35331
  passthrough() {
35910
- return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: unknown() }));
35332
+ return this.clone({ ...this._zod.def, catchall: unknown() });
35911
35333
  },
35912
35334
  loose() {
35913
- return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: unknown() }));
35335
+ return this.clone({ ...this._zod.def, catchall: unknown() });
35914
35336
  },
35915
35337
  strict() {
35916
- return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: never() }));
35338
+ return this.clone({ ...this._zod.def, catchall: never() });
35917
35339
  },
35918
35340
  strip() {
35919
- return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: undefined }));
35341
+ return this.clone({ ...this._zod.def, catchall: undefined });
35920
35342
  },
35921
35343
  extend(incoming) {
35922
35344
  return exports_util.extend(this, incoming);
@@ -36135,7 +35557,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
36135
35557
  ZodType.init(inst, def);
36136
35558
  inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
36137
35559
  inst.enum = def.entries;
36138
- inst.options = [...inst._zod.values];
35560
+ inst.options = Object.values(def.entries);
36139
35561
  const keys = new Set(Object.keys(def.entries));
36140
35562
  inst.extract = (values, params) => {
36141
35563
  const newEntries = {};
@@ -36496,15 +35918,8 @@ function superRefine(fn, params) {
36496
35918
  }
36497
35919
  var describe2 = describe;
36498
35920
  var meta2 = meta;
36499
- var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
36500
- ZodCustom.init(inst, def);
36501
- }, {
36502
- properties(shape, params) {
36503
- return this.check(_properties(shape, params));
36504
- }
36505
- });
36506
35921
  function _instanceof(cls, params = {}) {
36507
- const inst = new ZodInstanceOf({
35922
+ const inst = new ZodCustom({
36508
35923
  type: "custom",
36509
35924
  check: "custom",
36510
35925
  fn: (data) => data instanceof cls,
@@ -36694,188 +36109,27 @@ function resolveRef(ref, ctx) {
36694
36109
  }
36695
36110
  throw new Error(`Reference not found: ${ref}`);
36696
36111
  }
36697
- function checkObjectGuards(objectSchema, guards) {
36112
+ function checkPropertyNames(objectSchema, keySchema) {
36698
36113
  const guard = z.transform((value) => value).check((payload) => {
36699
36114
  const value = payload.value;
36700
36115
  if (typeof value !== "object" || value === null || Array.isArray(value))
36701
36116
  return;
36702
- const keys = Object.getOwnPropertyNames(value);
36703
- if (guards.minProperties !== undefined && keys.length < guards.minProperties) {
36704
- payload.issues.push({
36705
- origin: "object",
36706
- code: "too_small",
36707
- minimum: guards.minProperties,
36708
- inclusive: true,
36709
- message: `Too small: expected object to have >=${guards.minProperties} properties`,
36710
- input: value,
36711
- inst: objectSchema,
36712
- continue: true
36713
- });
36714
- }
36715
- if (guards.maxProperties !== undefined && keys.length > guards.maxProperties) {
36117
+ for (const key of Object.getOwnPropertyNames(value)) {
36118
+ const result = keySchema.safeParse(key);
36119
+ if (result.success)
36120
+ continue;
36716
36121
  payload.issues.push({
36717
- origin: "object",
36718
- code: "too_big",
36719
- maximum: guards.maxProperties,
36720
- inclusive: true,
36721
- message: `Too big: expected object to have <=${guards.maxProperties} properties`,
36722
- input: value,
36723
- inst: objectSchema,
36122
+ code: "invalid_key",
36123
+ origin: "record",
36124
+ issues: result.error.issues,
36125
+ input: key,
36126
+ path: [key],
36724
36127
  continue: true
36725
36128
  });
36726
36129
  }
36727
- if (guards.keySchema) {
36728
- for (const key of keys) {
36729
- const result = guards.keySchema.safeParse(key);
36730
- if (result.success)
36731
- continue;
36732
- payload.issues.push({
36733
- code: "invalid_key",
36734
- origin: "record",
36735
- issues: result.error.issues,
36736
- input: key,
36737
- path: [key],
36738
- continue: true
36739
- });
36740
- }
36741
- }
36742
36130
  });
36743
36131
  return guard.pipe(objectSchema);
36744
36132
  }
36745
- function canonicalKey(value, seen) {
36746
- if (value === null)
36747
- return "z";
36748
- const type = typeof value;
36749
- if (type !== "object") {
36750
- if (type === "number" && Number.isNaN(value))
36751
- return null;
36752
- const raw = String(value);
36753
- return `${type[0]}${raw.length}:${raw}`;
36754
- }
36755
- if (seen.has(value))
36756
- return null;
36757
- seen.add(value);
36758
- try {
36759
- if (Array.isArray(value)) {
36760
- const parts2 = [];
36761
- for (const item of value) {
36762
- const key = canonicalKey(item, seen);
36763
- if (key === null)
36764
- return null;
36765
- parts2.push(key);
36766
- }
36767
- return `a${parts2.length}:[${parts2.join(",")}]`;
36768
- }
36769
- const keys = Object.keys(value).sort();
36770
- const parts = [];
36771
- for (const k of keys) {
36772
- const key = canonicalKey(value[k], seen);
36773
- if (key === null)
36774
- return null;
36775
- parts.push(`${k.length}:${k}=${key}`);
36776
- }
36777
- return `o${parts.length}:{${parts.join(",")}}`;
36778
- } finally {
36779
- seen.delete(value);
36780
- }
36781
- }
36782
- var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
36783
- "items",
36784
- "prefixItems",
36785
- "additionalItems",
36786
- "additionalProperties",
36787
- "contains",
36788
- "propertyNames",
36789
- "not",
36790
- "if",
36791
- "then",
36792
- "else",
36793
- "allOf",
36794
- "anyOf",
36795
- "oneOf",
36796
- "unevaluatedItems",
36797
- "unevaluatedProperties",
36798
- "contentSchema"
36799
- ]);
36800
- var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
36801
- "properties",
36802
- "patternProperties",
36803
- "dependentSchemas",
36804
- "dependencies",
36805
- "$defs",
36806
- "definitions"
36807
- ]);
36808
- function containsRef(value) {
36809
- if (typeof value !== "object" || value === null)
36810
- return false;
36811
- if (Array.isArray(value))
36812
- return value.some(containsRef);
36813
- if (typeof value.$ref === "string")
36814
- return true;
36815
- return Object.entries(value).some(([key, sub]) => {
36816
- if (SCHEMA_KEYWORDS.has(key))
36817
- return containsRef(sub);
36818
- if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
36819
- return false;
36820
- return Object.values(sub).some(containsRef);
36821
- });
36822
- }
36823
- function plural(n2) {
36824
- return n2 === 1 ? "element" : "elements";
36825
- }
36826
- function checkArrayGuards(arraySchema, guards) {
36827
- const guard = z.transform((value) => value).check((payload) => {
36828
- const items = payload.value;
36829
- if (!Array.isArray(items))
36830
- return;
36831
- if (guards.uniqueItems === true) {
36832
- const firstSeen = new Map;
36833
- for (let i = 0;i < items.length; i++) {
36834
- const key = canonicalKey(items[i], new Set);
36835
- if (key === null)
36836
- continue;
36837
- const first = firstSeen.get(key);
36838
- if (first === undefined) {
36839
- firstSeen.set(key, i);
36840
- continue;
36841
- }
36842
- payload.issues.push({
36843
- code: "custom",
36844
- message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
36845
- input: items,
36846
- path: [i],
36847
- continue: true
36848
- });
36849
- }
36850
- }
36851
- if (guards.containsSchema) {
36852
- const minContains = guards.minContains ?? 1;
36853
- const ceiling = guards.maxContains !== undefined ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
36854
- let matches = 0;
36855
- for (const item of items) {
36856
- if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
36857
- break;
36858
- }
36859
- if (matches < minContains) {
36860
- payload.issues.push({
36861
- code: "custom",
36862
- message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
36863
- input: items,
36864
- continue: true
36865
- });
36866
- }
36867
- if (guards.maxContains !== undefined && matches > guards.maxContains) {
36868
- payload.issues.push({
36869
- code: "custom",
36870
- message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
36871
- input: items,
36872
- continue: true
36873
- });
36874
- }
36875
- }
36876
- });
36877
- return guard.pipe(arraySchema);
36878
- }
36879
36133
  function getTupleRest(restSchema, ctx) {
36880
36134
  if (restSchema === false) {
36881
36135
  return;
@@ -37005,8 +36259,6 @@ function convertBaseSchema(schema, ctx) {
37005
36259
  stringSchema = stringSchema.check(z.e164());
37006
36260
  } else if (format === "credit_card") {
37007
36261
  stringSchema = stringSchema.check(z.creditCard());
37008
- } else if (format === "iban") {
37009
- stringSchema = stringSchema.check(z.iban());
37010
36262
  } else if (format === "jwt") {
37011
36263
  stringSchema = stringSchema.check(z.jwt());
37012
36264
  } else if (format === "emoji") {
@@ -37139,16 +36391,9 @@ function convertBaseSchema(schema, ctx) {
37139
36391
  zodSchema = objectSchema.passthrough();
37140
36392
  }
37141
36393
  }
37142
- const hasKeyGuard = schema.propertyNames !== undefined && schema.propertyNames !== true;
37143
- const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : undefined;
37144
- const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : undefined;
37145
- if (hasKeyGuard || minProperties !== undefined || maxProperties !== undefined) {
37146
- let keySchema;
37147
- if (hasKeyGuard) {
37148
- const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
37149
- keySchema = convertSchema(keyJSONSchema, ctx);
37150
- }
37151
- zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
36394
+ if (schema.propertyNames !== undefined && schema.propertyNames !== true) {
36395
+ const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
36396
+ zodSchema = checkPropertyNames(zodSchema, convertSchema(keyJSONSchema, ctx));
37152
36397
  }
37153
36398
  break;
37154
36399
  }
@@ -37194,14 +36439,6 @@ function convertBaseSchema(schema, ctx) {
37194
36439
  } else {
37195
36440
  zodSchema = z.array(z.any());
37196
36441
  }
37197
- if (schema.uniqueItems === true || schema.contains !== undefined) {
37198
- zodSchema = checkArrayGuards(zodSchema, {
37199
- uniqueItems: schema.uniqueItems === true,
37200
- containsSchema: schema.contains !== undefined ? convertSchema(schema.contains, ctx) : undefined,
37201
- minContains: typeof schema.minContains === "number" ? schema.minContains : undefined,
37202
- maxContains: typeof schema.maxContains === "number" ? schema.maxContains : undefined
37203
- });
37204
- }
37205
36442
  break;
37206
36443
  }
37207
36444
  default:
@@ -37259,23 +36496,8 @@ function convertSchema(schema, ctx) {
37259
36496
  extraMeta[key] = schema[key];
37260
36497
  }
37261
36498
  }
37262
- if (schema.type === "object" && schema.$ref === undefined) {
37263
- if (schema.propertyNames !== undefined && !containsRef(schema.propertyNames)) {
37264
- extraMeta.propertyNames = schema.propertyNames;
37265
- }
37266
- for (const key of ["minProperties", "maxProperties"]) {
37267
- if (schema[key] !== undefined)
37268
- extraMeta[key] = schema[key];
37269
- }
37270
- }
37271
- if (schema.type === "array" && schema.$ref === undefined) {
37272
- if (schema.contains !== undefined && !containsRef(schema.contains)) {
37273
- extraMeta.contains = schema.contains;
37274
- }
37275
- for (const key of ["uniqueItems", "minContains", "maxContains"]) {
37276
- if (schema[key] !== undefined)
37277
- extraMeta[key] = schema[key];
37278
- }
36499
+ if (schema.propertyNames !== undefined && schema.type === "object" && schema.$ref === undefined) {
36500
+ extraMeta.propertyNames = schema.propertyNames;
37279
36501
  }
37280
36502
  for (const key of Object.keys(schema)) {
37281
36503
  if (!RECOGNIZED_KEYS.has(key)) {
@@ -37735,10 +36957,10 @@ function parseRemoteSkillPayload(payload) {
37735
36957
  function parseRemoteContract(schema, payload, message) {
37736
36958
  try {
37737
36959
  return schema.parse(payload);
37738
- } catch (error62) {
37739
- if (error62 instanceof exports_external.ZodError)
37740
- throw new Error(message, { cause: error62 });
37741
- throw error62;
36960
+ } catch (error61) {
36961
+ if (error61 instanceof exports_external.ZodError)
36962
+ throw new Error(message, { cause: error61 });
36963
+ throw error61;
37742
36964
  }
37743
36965
  }
37744
36966
  async function remoteRequestHeaders(options) {
@@ -39987,8 +39209,8 @@ class RemoteSkillsClient {
39987
39209
  throw new RemoteCreditCheckoutError("CREDIT_CHECKOUT_UNCONFIRMED", response.status, requestIdempotencyKey);
39988
39210
  }
39989
39211
  if (!response.ok) {
39990
- const failure2 = creditCheckoutFailure(value, response.status, requestIdempotencyKey);
39991
- throw new RemoteCreditCheckoutError(failure2.code, response.status, requestIdempotencyKey, failure2.retryAfterSeconds);
39212
+ const failure = creditCheckoutFailure(value, response.status, requestIdempotencyKey);
39213
+ throw new RemoteCreditCheckoutError(failure.code, response.status, requestIdempotencyKey, failure.retryAfterSeconds);
39992
39214
  }
39993
39215
  try {
39994
39216
  const checkout = parseRemoteCheckout(value);
@@ -40146,9 +39368,9 @@ class RemoteSkillsClient {
40146
39368
  async publishSkill(manifest, bundle2, ifMatch) {
40147
39369
  try {
40148
39370
  assertSkillsPermission(await this.getCapabilities({ refresh: true }), "publish");
40149
- } catch (error62) {
40150
- if (!(error62 instanceof RemoteRouteUnsupportedError))
40151
- throw error62;
39371
+ } catch (error61) {
39372
+ if (!(error61 instanceof RemoteRouteUnsupportedError))
39373
+ throw error61;
40152
39374
  }
40153
39375
  const form = new FormData;
40154
39376
  form.set("manifest", JSON.stringify(manifest));
@@ -40540,9 +39762,9 @@ function getNextRun(cron, from = new Date) {
40540
39762
  return null;
40541
39763
  }
40542
39764
  function addSchedule(skill, cron, options = {}) {
40543
- const { valid, error: error62 } = validateCron(cron);
39765
+ const { valid, error: error61 } = validateCron(cron);
40544
39766
  if (!valid)
40545
- return { schedule: null, error: error62 };
39767
+ return { schedule: null, error: error61 };
40546
39768
  const data = loadSchedules(options.targetDir);
40547
39769
  const id = `${skill}-${Date.now()}`;
40548
39770
  const now = new Date;
@@ -40699,8 +39921,8 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
40699
39921
  let slug2;
40700
39922
  try {
40701
39923
  slug2 = normalizePortableSkillName(bareName);
40702
- } catch (error62) {
40703
- return { name: rawName, success: false, error: error62.message };
39924
+ } catch (error61) {
39925
+ return { name: rawName, success: false, error: error61.message };
40704
39926
  }
40705
39927
  if (requestedVersion !== undefined && !isValidSkillVersion(requestedVersion)) {
40706
39928
  return { name: rawName, success: false, error: `'${requestedVersion}' is not a valid skill version (${SKILL_VERSION_RULE}).` };
@@ -40709,8 +39931,8 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
40709
39931
  let bundleResponse;
40710
39932
  try {
40711
39933
  bundleResponse = await client2.getBundle(slug2, requestedVersion);
40712
- } catch (error62) {
40713
- return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error62.message}` };
39934
+ } catch (error61) {
39935
+ return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error61.message}` };
40714
39936
  }
40715
39937
  if (requestedVersion && (!bundleResponse || bundleResponse.status === 404)) {
40716
39938
  return {
@@ -40746,18 +39968,18 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
40746
39968
  expectedSha256 = typeof recorded.bundleSha256 === "string" ? recorded.bundleSha256 : undefined;
40747
39969
  }
40748
39970
  return await installVerifiedBundle(slug2, bundleResponse, meta3, corpusOptions, verify, requestedVersion ? { version: requestedVersion, expectedSha256 } : undefined);
40749
- } catch (error62) {
40750
- if (error62 instanceof PullSkillError) {
40751
- return { name: slug2, success: false, error: error62.message };
39971
+ } catch (error61) {
39972
+ if (error61 instanceof PullSkillError) {
39973
+ return { name: slug2, success: false, error: error61.message };
40752
39974
  }
40753
- throw error62;
39975
+ throw error61;
40754
39976
  }
40755
39977
  }
40756
39978
  let skillMd;
40757
39979
  try {
40758
39980
  skillMd = await client2.getSkillMd(slug2);
40759
- } catch (error62) {
40760
- return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error62.message}` };
39981
+ } catch (error61) {
39982
+ return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error61.message}` };
40761
39983
  }
40762
39984
  if (skillMd === null) {
40763
39985
  return { name: slug2, success: false, error: `Skill '${slug2}' was not found on the configured Skills instance.` };
@@ -40771,11 +39993,11 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
40771
39993
  let provenRevisionId;
40772
39994
  try {
40773
39995
  provenRevisionId = meta3?.revisionId ? provenRevision({ ...meta3, skillMd }, slug2, {}) : undefined;
40774
- } catch (error62) {
40775
- if (error62 instanceof PullSkillError) {
40776
- return { name: slug2, success: false, error: error62.message };
39996
+ } catch (error61) {
39997
+ if (error61 instanceof PullSkillError) {
39998
+ return { name: slug2, success: false, error: error61.message };
40777
39999
  }
40778
- throw error62;
40000
+ throw error61;
40779
40001
  }
40780
40002
  const written = installCorpusSkillAtomically({ name: slug2, skillMd, meta: meta3 }, corpusOptions);
40781
40003
  writePullMarker(written.path, {
@@ -40854,8 +40076,8 @@ function installVerifiedBundle(slug2, response, meta3, corpusOptions, verify, ex
40854
40076
  let entries;
40855
40077
  try {
40856
40078
  entries = unpackSkillBundle(verified.bytes);
40857
- } catch (error62) {
40858
- throw new PullSkillError(`Bundle for '${slug2}' could not be unpacked: ${error62.message}`);
40079
+ } catch (error61) {
40080
+ throw new PullSkillError(`Bundle for '${slug2}' could not be unpacked: ${error61.message}`);
40859
40081
  }
40860
40082
  const version2 = exact?.version ?? served ?? str(meta3?.version) ?? versionFromEntries(entries) ?? "unknown";
40861
40083
  const sourceCommit = sourceCommitFromEntries(entries);
@@ -40991,14 +40213,14 @@ function installBundleAtomically(name, entries, options = {}, marker = {}) {
40991
40213
  renameSync6(staging, target);
40992
40214
  if (moved && backup)
40993
40215
  rmSync5(backup, { recursive: true, force: true });
40994
- } catch (error62) {
40216
+ } catch (error61) {
40995
40217
  rmSync5(staging, { recursive: true, force: true });
40996
40218
  if (moved && backup && existsSync17(join32(backup, name))) {
40997
40219
  try {
40998
40220
  renameSync6(join32(backup, name), target);
40999
40221
  } catch {}
41000
40222
  }
41001
- throw error62;
40223
+ throw error61;
41002
40224
  }
41003
40225
  return { path: target, created };
41004
40226
  }
@@ -41156,9 +40378,9 @@ async function requestInvitationEmail(origin, action, input2) {
41156
40378
  if (action === "accept" && response.status === 200 && uuid11(parsed.organizationId) && uuid11(parsed.membershipId) && parsed.accepted === true && parsed.changed === true && parsed.signInRequired === true) {
41157
40379
  return { organizationId: parsed.organizationId, membershipId: parsed.membershipId, accepted: true, changed: true, signInRequired: true };
41158
40380
  }
41159
- } catch (error62) {
41160
- if (error62 instanceof RemoteInvitationEmailError)
41161
- throw error62;
40381
+ } catch (error61) {
40382
+ if (error61 instanceof RemoteInvitationEmailError)
40383
+ throw error61;
41162
40384
  }
41163
40385
  throw new RemoteInvitationEmailUnconfirmedError(action);
41164
40386
  }
@@ -41289,11 +40511,11 @@ async function boundedJson(url2, init, token, mutation, budget2 = 15000, signal)
41289
40511
  timer = setTimeout(abort, Math.max(1, Math.min(15000, budget2)));
41290
40512
  signal?.addEventListener("abort", abort, { once: true });
41291
40513
  })]);
41292
- } catch (error62) {
41293
- if (error62 instanceof PrivatePublicationError) {
41294
- if (mutation && error62.code === "INVALID_PUBLICATION_RESPONSE")
40514
+ } catch (error61) {
40515
+ if (error61 instanceof PrivatePublicationError) {
40516
+ if (mutation && error61.code === "INVALID_PUBLICATION_RESPONSE")
41295
40517
  throw timeout;
41296
- throw error62;
40518
+ throw error61;
41297
40519
  }
41298
40520
  throw timeout;
41299
40521
  } finally {
@@ -41350,10 +40572,10 @@ class RemotePrivatePublicationsClient {
41350
40572
  if (!record8(value) || !Object.keys(value).every((k) => k === "upload" || k === "changed") || value.changed !== undefined && typeof value.changed !== "boolean")
41351
40573
  return invalid4();
41352
40574
  return checkedPublicationView(value.upload, skillId, intentId, declaration);
41353
- } catch (error62) {
40575
+ } catch (error61) {
41354
40576
  if (method !== "GET")
41355
40577
  throw new PrivatePublicationError("PUBLICATION_UNCONFIRMED", "The publication result could not be confirmed. Reconcile the saved intent before another action.", true);
41356
- throw error62;
40578
+ throw error61;
41357
40579
  }
41358
40580
  }
41359
40581
  async begin(skillId, input2) {
@@ -41448,10 +40670,10 @@ class RemotePrivatePublicationsClient {
41448
40670
  let view;
41449
40671
  try {
41450
40672
  view = await this.get(skillId, intentId, { timeoutMs: timeout === 0 ? 15000 : Math.max(1, Math.min(15000, until - Date.now())), signal: options.signal });
41451
- } catch (error62) {
40673
+ } catch (error61) {
41452
40674
  if (previous && Date.now() >= until && !options.signal?.aborted)
41453
40675
  return previous;
41454
- throw error62;
40676
+ throw error61;
41455
40677
  }
41456
40678
  previous = view;
41457
40679
  if (!["queued", "verifying"].includes(view.state) || Date.now() >= until)
@@ -41512,9 +40734,9 @@ async function requestAuthApi(instance, path, options) {
41512
40734
  if (!res.ok) {
41513
40735
  const record9 = isRecord5(body) ? body : {};
41514
40736
  const detail = typeof record9.detail === "string" ? record9.detail : undefined;
41515
- const error62 = typeof record9.error === "string" ? record9.error : undefined;
40737
+ const error61 = typeof record9.error === "string" ? record9.error : undefined;
41516
40738
  const code = typeof record9.code === "string" ? record9.code : undefined;
41517
- throw new HostedApiError(detail || error62 || `${res.status} ${res.statusText}`, {
40739
+ throw new HostedApiError(detail || error61 || `${res.status} ${res.statusText}`, {
41518
40740
  status: res.status,
41519
40741
  code,
41520
40742
  detail,
@@ -44013,8 +43235,8 @@ function readSnapshotManifest(repoRoot, stationId) {
44013
43235
  let manifest;
44014
43236
  try {
44015
43237
  manifest = JSON.parse(readFileSync26(manifestPath, "utf8"));
44016
- } catch (error62) {
44017
- fail("MANIFEST_UNREADABLE", `cannot read snapshot manifest: ${manifestPath}: ${error62.message}`);
43238
+ } catch (error61) {
43239
+ fail("MANIFEST_UNREADABLE", `cannot read snapshot manifest: ${manifestPath}: ${error61.message}`);
44018
43240
  }
44019
43241
  const sourceSnapshotSha = sha256File(manifestPath);
44020
43242
  return { manifest, manifestPath, sourceSnapshotSha };
@@ -44485,12 +43707,12 @@ async function continueLocked(client2, directory2, options) {
44485
43707
  save(directory2, receipt);
44486
43708
  try {
44487
43709
  await client2.upload(receipt.skillId, receipt.intent, bytes);
44488
- } catch (error62) {
44489
- if (error62 instanceof PrivatePublicationError && !error62.uncertain) {
43710
+ } catch (error61) {
43711
+ if (error61 instanceof PrivatePublicationError && !error61.uncertain) {
44490
43712
  receipt.phase = "awaiting_upload";
44491
43713
  save(directory2, receipt);
44492
43714
  }
44493
- throw error62;
43715
+ throw error61;
44494
43716
  }
44495
43717
  receipt.phase = "uploaded";
44496
43718
  save(directory2, receipt);