@settlemint/sdk-viem 2.5.1-mainf0c7fb9b → 2.5.1-mainffd47926

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/viem.js CHANGED
@@ -16,7 +16,9 @@ var __export = (target, all) => {
16
16
  };
17
17
 
18
18
  //#endregion
19
- //#region ../../node_modules/zod/dist/esm/v4/core/core.js
19
+ //#region ../../node_modules/zod/v4/core/core.js
20
+ /** A special constant with type `never` */
21
+ const NEVER = Object.freeze({ status: "aborted" });
20
22
  function $constructor(name, initializer$2, params) {
21
23
  function init(inst, def) {
22
24
  var _a;
@@ -67,7 +69,7 @@ function config(newConfig) {
67
69
  }
68
70
 
69
71
  //#endregion
70
- //#region ../../node_modules/zod/dist/esm/v4/core/util.js
72
+ //#region ../../node_modules/zod/v4/core/util.js
71
73
  var util_exports = {};
72
74
  __export(util_exports, {
73
75
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -82,6 +84,7 @@ __export(util_exports, {
82
84
  assertNotEqual: () => assertNotEqual,
83
85
  assignProp: () => assignProp,
84
86
  cached: () => cached,
87
+ captureStackTrace: () => captureStackTrace,
85
88
  cleanEnum: () => cleanEnum,
86
89
  cleanRegex: () => cleanRegex,
87
90
  clone: () => clone,
@@ -220,10 +223,14 @@ function randomString(length = 10) {
220
223
  function esc(str) {
221
224
  return JSON.stringify(str);
222
225
  }
226
+ const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {};
223
227
  function isObject(data) {
224
228
  return typeof data === "object" && data !== null && !Array.isArray(data);
225
229
  }
226
230
  const allowsEval = cached(() => {
231
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
232
+ return false;
233
+ }
227
234
  try {
228
235
  const F = Function;
229
236
  new F("");
@@ -232,9 +239,6 @@ const allowsEval = cached(() => {
232
239
  return false;
233
240
  }
234
241
  });
235
- function _isObject(o) {
236
- return Object.prototype.toString.call(o) === "[object Object]";
237
- }
238
242
  function isPlainObject(o) {
239
243
  if (isObject(o) === false) return false;
240
244
  const ctor = o.constructor;
@@ -414,6 +418,9 @@ function omit(schema, mask) {
414
418
  });
415
419
  }
416
420
  function extend(schema, shape) {
421
+ if (!isPlainObject(shape)) {
422
+ throw new Error("Invalid input to extend: expected a plain object");
423
+ }
417
424
  const def = {
418
425
  ...schema._zod.def,
419
426
  get shape() {
@@ -501,7 +508,7 @@ function required(Class$1, schema, mask) {
501
508
  }
502
509
  function aborted(x, startIndex = 0) {
503
510
  for (let i = startIndex; i < x.issues.length; i++) {
504
- if (x.issues[i].continue !== true) return true;
511
+ if (x.issues[i]?.continue !== true) return true;
505
512
  }
506
513
  return false;
507
514
  }
@@ -565,7 +572,7 @@ var Class = class {
565
572
  };
566
573
 
567
574
  //#endregion
568
- //#region ../../node_modules/zod/dist/esm/v4/core/errors.js
575
+ //#region ../../node_modules/zod/v4/core/errors.js
569
576
  const initializer$1 = (inst, def) => {
570
577
  inst.name = "$ZodError";
571
578
  Object.defineProperty(inst, "_zod", {
@@ -582,13 +589,17 @@ const initializer$1 = (inst, def) => {
582
589
  },
583
590
  enumerable: true
584
591
  });
592
+ Object.defineProperty(inst, "toString", {
593
+ value: () => inst.message,
594
+ enumerable: false
595
+ });
585
596
  };
586
597
  const $ZodError = $constructor("$ZodError", initializer$1);
587
598
  const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
588
- function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
599
+ function flattenError(error$39, mapper = (issue$1) => issue$1.message) {
589
600
  const fieldErrors = {};
590
601
  const formErrors = [];
591
- for (const sub of error$37.issues) {
602
+ for (const sub of error$39.issues) {
592
603
  if (sub.path.length > 0) {
593
604
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
594
605
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -601,13 +612,13 @@ function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
601
612
  fieldErrors
602
613
  };
603
614
  }
604
- function formatError(error$37, _mapper) {
615
+ function formatError(error$39, _mapper) {
605
616
  const mapper = _mapper || function(issue$1) {
606
617
  return issue$1.message;
607
618
  };
608
619
  const fieldErrors = { _errors: [] };
609
- const processError = (error$38) => {
610
- for (const issue$1 of error$38.issues) {
620
+ const processError = (error$40) => {
621
+ for (const issue$1 of error$40.issues) {
611
622
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
612
623
  issue$1.errors.map((issues) => processError({ issues }));
613
624
  } else if (issue$1.code === "invalid_key") {
@@ -634,17 +645,17 @@ function formatError(error$37, _mapper) {
634
645
  }
635
646
  }
636
647
  };
637
- processError(error$37);
648
+ processError(error$39);
638
649
  return fieldErrors;
639
650
  }
640
- function treeifyError(error$37, _mapper) {
651
+ function treeifyError(error$39, _mapper) {
641
652
  const mapper = _mapper || function(issue$1) {
642
653
  return issue$1.message;
643
654
  };
644
655
  const result = { errors: [] };
645
- const processError = (error$38, path = []) => {
656
+ const processError = (error$40, path = []) => {
646
657
  var _a, _b;
647
- for (const issue$1 of error$38.issues) {
658
+ for (const issue$1 of error$40.issues) {
648
659
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
649
660
  issue$1.errors.map((issues) => processError({ issues }, issue$1.path));
650
661
  } else if (issue$1.code === "invalid_key") {
@@ -679,7 +690,7 @@ function treeifyError(error$37, _mapper) {
679
690
  }
680
691
  }
681
692
  };
682
- processError(error$37);
693
+ processError(error$39);
683
694
  return result;
684
695
  }
685
696
  /** Format a ZodError as a human-readable string in the following form.
@@ -727,9 +738,9 @@ function toDotPath(path) {
727
738
  }
728
739
  return segs.join("");
729
740
  }
730
- function prettifyError(error$37) {
741
+ function prettifyError(error$39) {
731
742
  const lines = [];
732
- const issues = [...error$37.issues].sort((a, b) => a.path.length - b.path.length);
743
+ const issues = [...error$39.issues].sort((a, b) => a.path.length - b.path.length);
733
744
  for (const issue$1 of issues) {
734
745
  lines.push(`✖ ${issue$1.message}`);
735
746
  if (issue$1.path?.length) lines.push(` → at ${toDotPath(issue$1.path)}`);
@@ -738,7 +749,7 @@ function prettifyError(error$37) {
738
749
  }
739
750
 
740
751
  //#endregion
741
- //#region ../../node_modules/zod/dist/esm/v4/core/parse.js
752
+ //#region ../../node_modules/zod/v4/core/parse.js
742
753
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
743
754
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
744
755
  const result = schema._zod.run({
@@ -750,7 +761,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
750
761
  }
751
762
  if (result.issues.length) {
752
763
  const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
753
- Error.captureStackTrace(e, _params?.callee);
764
+ captureStackTrace(e, _params?.callee);
754
765
  throw e;
755
766
  }
756
767
  return result.value;
@@ -765,7 +776,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
765
776
  if (result instanceof Promise) result = await result;
766
777
  if (result.issues.length) {
767
778
  const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
768
- Error.captureStackTrace(e, params?.callee);
779
+ captureStackTrace(e, params?.callee);
769
780
  throw e;
770
781
  }
771
782
  return result.value;
@@ -810,10 +821,9 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
810
821
  const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
811
822
 
812
823
  //#endregion
813
- //#region ../../node_modules/zod/dist/esm/v4/core/regexes.js
824
+ //#region ../../node_modules/zod/v4/core/regexes.js
814
825
  var regexes_exports = {};
815
826
  __export(regexes_exports, {
816
- _emoji: () => _emoji$1,
817
827
  base64: () => base64$1,
818
828
  base64url: () => base64url$1,
819
829
  bigint: () => bigint$2,
@@ -899,27 +909,23 @@ const base64url$1 = /^[A-Za-z0-9_-]*$/;
899
909
  const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
900
910
  const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
901
911
  const e164$1 = /^\+(?:[0-9]){6,14}[0-9]$/;
902
- const dateSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
912
+ const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
903
913
  const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
904
914
  function timeSource(args) {
905
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
906
- if (args.precision) {
907
- regex = `${regex}\\.\\d{${args.precision}}`;
908
- } else if (args.precision == null) {
909
- regex = `${regex}(\\.\\d+)?`;
910
- }
915
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
916
+ const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
911
917
  return regex;
912
918
  }
913
919
  function time$1(args) {
914
920
  return new RegExp(`^${timeSource(args)}$`);
915
921
  }
916
922
  function datetime$1(args) {
917
- let regex = `${dateSource}T${timeSource(args)}`;
918
- const opts = [];
919
- opts.push(args.local ? `Z?` : `Z`);
920
- if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`);
921
- regex = `${regex}(${opts.join("|")})`;
922
- return new RegExp(`^${regex}$`);
923
+ const time$2 = timeSource({ precision: args.precision });
924
+ const opts = ["Z"];
925
+ if (args.local) opts.push("");
926
+ if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
927
+ const timeRegex = `${time$2}(?:${opts.join("|")})`;
928
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
923
929
  }
924
930
  const string$2 = (params) => {
925
931
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
@@ -935,7 +941,7 @@ const lowercase = /^[^A-Z]*$/;
935
941
  const uppercase = /^[^a-z]*$/;
936
942
 
937
943
  //#endregion
938
- //#region ../../node_modules/zod/dist/esm/v4/core/checks.js
944
+ //#region ../../node_modules/zod/v4/core/checks.js
939
945
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
940
946
  var _a;
941
947
  inst._zod ?? (inst._zod = {});
@@ -1126,11 +1132,12 @@ const $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntForma
1126
1132
  };
1127
1133
  });
1128
1134
  const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1135
+ var _a;
1129
1136
  $ZodCheck.init(inst, def);
1130
- inst._zod.when = (payload) => {
1137
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1131
1138
  const val = payload.value;
1132
1139
  return !nullish$1(val) && val.size !== undefined;
1133
- };
1140
+ });
1134
1141
  inst._zod.onattach.push((inst$1) => {
1135
1142
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1136
1143
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1150,11 +1157,12 @@ const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst,
1150
1157
  };
1151
1158
  });
1152
1159
  const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1160
+ var _a;
1153
1161
  $ZodCheck.init(inst, def);
1154
- inst._zod.when = (payload) => {
1162
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1155
1163
  const val = payload.value;
1156
1164
  return !nullish$1(val) && val.size !== undefined;
1157
- };
1165
+ });
1158
1166
  inst._zod.onattach.push((inst$1) => {
1159
1167
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1160
1168
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1174,11 +1182,12 @@ const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst,
1174
1182
  };
1175
1183
  });
1176
1184
  const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1185
+ var _a;
1177
1186
  $ZodCheck.init(inst, def);
1178
- inst._zod.when = (payload) => {
1187
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1179
1188
  const val = payload.value;
1180
1189
  return !nullish$1(val) && val.size !== undefined;
1181
- };
1190
+ });
1182
1191
  inst._zod.onattach.push((inst$1) => {
1183
1192
  const bag = inst$1._zod.bag;
1184
1193
  bag.minimum = def.size;
@@ -1199,6 +1208,8 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1199
1208
  code: "too_small",
1200
1209
  minimum: def.size
1201
1210
  },
1211
+ inclusive: true,
1212
+ exact: true,
1202
1213
  input: payload.value,
1203
1214
  inst,
1204
1215
  continue: !def.abort
@@ -1206,11 +1217,12 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1206
1217
  };
1207
1218
  });
1208
1219
  const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1220
+ var _a;
1209
1221
  $ZodCheck.init(inst, def);
1210
- inst._zod.when = (payload) => {
1222
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1211
1223
  const val = payload.value;
1212
1224
  return !nullish$1(val) && val.length !== undefined;
1213
- };
1225
+ });
1214
1226
  inst._zod.onattach.push((inst$1) => {
1215
1227
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1216
1228
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1232,11 +1244,12 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
1232
1244
  };
1233
1245
  });
1234
1246
  const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1247
+ var _a;
1235
1248
  $ZodCheck.init(inst, def);
1236
- inst._zod.when = (payload) => {
1249
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1237
1250
  const val = payload.value;
1238
1251
  return !nullish$1(val) && val.length !== undefined;
1239
- };
1252
+ });
1240
1253
  inst._zod.onattach.push((inst$1) => {
1241
1254
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1242
1255
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1258,11 +1271,12 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
1258
1271
  };
1259
1272
  });
1260
1273
  const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1274
+ var _a;
1261
1275
  $ZodCheck.init(inst, def);
1262
- inst._zod.when = (payload) => {
1276
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1263
1277
  const val = payload.value;
1264
1278
  return !nullish$1(val) && val.length !== undefined;
1265
- };
1279
+ });
1266
1280
  inst._zod.onattach.push((inst$1) => {
1267
1281
  const bag = inst$1._zod.bag;
1268
1282
  bag.minimum = def.length;
@@ -1284,6 +1298,8 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1284
1298
  code: "too_small",
1285
1299
  minimum: def.length
1286
1300
  },
1301
+ inclusive: true,
1302
+ exact: true,
1287
1303
  input: payload.value,
1288
1304
  inst,
1289
1305
  continue: !def.abort
@@ -1291,7 +1307,7 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1291
1307
  };
1292
1308
  });
1293
1309
  const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1294
- var _a;
1310
+ var _a, _b;
1295
1311
  $ZodCheck.init(inst, def);
1296
1312
  inst._zod.onattach.push((inst$1) => {
1297
1313
  const bag = inst$1._zod.bag;
@@ -1301,8 +1317,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1301
1317
  bag.patterns.add(def.pattern);
1302
1318
  }
1303
1319
  });
1304
- (_a = inst._zod).check ?? (_a.check = (payload) => {
1305
- if (!def.pattern) throw new Error("Not implemented.");
1320
+ if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
1306
1321
  def.pattern.lastIndex = 0;
1307
1322
  if (def.pattern.test(payload.value)) return;
1308
1323
  payload.issues.push({
@@ -1315,6 +1330,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1315
1330
  continue: !def.abort
1316
1331
  });
1317
1332
  });
1333
+ else (_b = inst._zod).check ?? (_b.check = () => {});
1318
1334
  });
1319
1335
  const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1320
1336
  $ZodCheckStringFormat.init(inst, def);
@@ -1438,7 +1454,6 @@ const $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (ins
1438
1454
  code: "invalid_value",
1439
1455
  values: def.mime,
1440
1456
  input: payload.value.type,
1441
- path: ["type"],
1442
1457
  inst
1443
1458
  });
1444
1459
  };
@@ -1451,7 +1466,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1451
1466
  });
1452
1467
 
1453
1468
  //#endregion
1454
- //#region ../../node_modules/zod/dist/esm/v4/core/doc.js
1469
+ //#region ../../node_modules/zod/v4/core/doc.js
1455
1470
  var Doc = class {
1456
1471
  constructor(args = []) {
1457
1472
  this.content = [];
@@ -1487,19 +1502,18 @@ var Doc = class {
1487
1502
  };
1488
1503
 
1489
1504
  //#endregion
1490
- //#region ../../node_modules/zod/dist/esm/v4/core/versions.js
1505
+ //#region ../../node_modules/zod/v4/core/versions.js
1491
1506
  const version = {
1492
1507
  major: 4,
1493
1508
  minor: 0,
1494
- patch: 0
1509
+ patch: 5
1495
1510
  };
1496
1511
 
1497
1512
  //#endregion
1498
- //#region ../../node_modules/zod/dist/esm/v4/core/schemas.js
1513
+ //#region ../../node_modules/zod/v4/core/schemas.js
1499
1514
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1500
1515
  var _a;
1501
1516
  inst ?? (inst = {});
1502
- inst._zod.id = def.type + "_" + randomString(10);
1503
1517
  inst._zod.def = def;
1504
1518
  inst._zod.bag = inst._zod.bag || {};
1505
1519
  inst._zod.version = version;
@@ -1522,13 +1536,11 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1522
1536
  let isAborted = aborted(payload);
1523
1537
  let asyncResult;
1524
1538
  for (const ch of checks$1) {
1525
- if (ch._zod.when) {
1526
- const shouldRun = ch._zod.when(payload);
1539
+ if (ch._zod.def.when) {
1540
+ const shouldRun = ch._zod.def.when(payload);
1527
1541
  if (!shouldRun) continue;
1528
- } else {
1529
- if (isAborted) {
1530
- continue;
1531
- }
1542
+ } else if (isAborted) {
1543
+ continue;
1532
1544
  }
1533
1545
  const currLen = payload.issues.length;
1534
1546
  const _ = ch._zod.check(payload);
@@ -1628,7 +1640,9 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1628
1640
  $ZodStringFormat.init(inst, def);
1629
1641
  inst._zod.check = (payload) => {
1630
1642
  try {
1631
- const url$1 = new URL(payload.value);
1643
+ const orig = payload.value;
1644
+ const url$1 = new URL(orig);
1645
+ const href = url$1.href;
1632
1646
  if (def.hostname) {
1633
1647
  def.hostname.lastIndex = 0;
1634
1648
  if (!def.hostname.test(url$1.hostname)) {
@@ -1657,6 +1671,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1657
1671
  });
1658
1672
  }
1659
1673
  }
1674
+ if (!orig.endsWith("/") && href.endsWith("/")) {
1675
+ payload.value = href.slice(0, -1);
1676
+ } else {
1677
+ payload.value = href;
1678
+ }
1660
1679
  return;
1661
1680
  } catch (_) {
1662
1681
  payload.issues.push({
@@ -1827,6 +1846,7 @@ function isValidJWT(token, algorithm = null) {
1827
1846
  const tokensParts = token.split(".");
1828
1847
  if (tokensParts.length !== 3) return false;
1829
1848
  const [header] = tokensParts;
1849
+ if (!header) return false;
1830
1850
  const parsedHeader = JSON.parse(atob(header));
1831
1851
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1832
1852
  if (!parsedHeader.alg) return false;
@@ -1849,6 +1869,19 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1849
1869
  });
1850
1870
  };
1851
1871
  });
1872
+ const $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => {
1873
+ $ZodStringFormat.init(inst, def);
1874
+ inst._zod.check = (payload) => {
1875
+ if (def.fn(payload.value)) return;
1876
+ payload.issues.push({
1877
+ code: "invalid_format",
1878
+ format: def.format,
1879
+ input: payload.value,
1880
+ inst,
1881
+ continue: !def.abort
1882
+ });
1883
+ };
1884
+ });
1852
1885
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1853
1886
  $ZodType.init(inst, def);
1854
1887
  inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
@@ -1900,12 +1933,11 @@ const $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
1900
1933
  if (def.coerce) try {
1901
1934
  payload.value = BigInt(payload.value);
1902
1935
  } catch (_) {}
1903
- const { value: input } = payload;
1904
- if (typeof input === "bigint") return payload;
1936
+ if (typeof payload.value === "bigint") return payload;
1905
1937
  payload.issues.push({
1906
1938
  expected: "bigint",
1907
1939
  code: "invalid_type",
1908
- input,
1940
+ input: payload.value,
1909
1941
  inst
1910
1942
  });
1911
1943
  return payload;
@@ -1918,7 +1950,7 @@ const $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def)
1918
1950
  const $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
1919
1951
  $ZodType.init(inst, def);
1920
1952
  inst._zod.parse = (payload, _ctx) => {
1921
- const { value: input } = payload;
1953
+ const input = payload.value;
1922
1954
  if (typeof input === "symbol") return payload;
1923
1955
  payload.issues.push({
1924
1956
  expected: "symbol",
@@ -1933,8 +1965,10 @@ const $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def)
1933
1965
  $ZodType.init(inst, def);
1934
1966
  inst._zod.pattern = _undefined$2;
1935
1967
  inst._zod.values = new Set([undefined]);
1968
+ inst._zod.optin = "optional";
1969
+ inst._zod.optout = "optional";
1936
1970
  inst._zod.parse = (payload, _ctx) => {
1937
- const { value: input } = payload;
1971
+ const input = payload.value;
1938
1972
  if (typeof input === "undefined") return payload;
1939
1973
  payload.issues.push({
1940
1974
  expected: "undefined",
@@ -1950,7 +1984,7 @@ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1950
1984
  inst._zod.pattern = _null$2;
1951
1985
  inst._zod.values = new Set([null]);
1952
1986
  inst._zod.parse = (payload, _ctx) => {
1953
- const { value: input } = payload;
1987
+ const input = payload.value;
1954
1988
  if (input === null) return payload;
1955
1989
  payload.issues.push({
1956
1990
  expected: "null",
@@ -1984,7 +2018,7 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1984
2018
  const $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
1985
2019
  $ZodType.init(inst, def);
1986
2020
  inst._zod.parse = (payload, _ctx) => {
1987
- const { value: input } = payload;
2021
+ const input = payload.value;
1988
2022
  if (typeof input === "undefined") return payload;
1989
2023
  payload.issues.push({
1990
2024
  expected: "void",
@@ -2115,19 +2149,20 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2115
2149
  "payload",
2116
2150
  "ctx"
2117
2151
  ]);
2118
- const { keys, optionalKeys: optionalKeys$1 } = _normalized.value;
2152
+ const normalized = _normalized.value;
2119
2153
  const parseStr = (key) => {
2120
2154
  const k = esc(key);
2121
2155
  return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
2122
2156
  };
2123
2157
  doc.write(`const input = payload.value;`);
2124
2158
  const ids = Object.create(null);
2125
- for (const key of keys) {
2126
- ids[key] = randomString(15);
2159
+ let counter = 0;
2160
+ for (const key of normalized.keys) {
2161
+ ids[key] = `key_${counter++}`;
2127
2162
  }
2128
2163
  doc.write(`const newResult = {}`);
2129
- for (const key of keys) {
2130
- if (optionalKeys$1.has(key)) {
2164
+ for (const key of normalized.keys) {
2165
+ if (normalized.optionalKeys.has(key)) {
2131
2166
  const id = ids[key];
2132
2167
  doc.write(`const ${id} = ${parseStr(key)};`);
2133
2168
  const k = esc(key);
@@ -2172,7 +2207,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2172
2207
  const jit = !globalConfig.jitless;
2173
2208
  const allowsEval$1 = allowsEval;
2174
2209
  const fastEnabled = jit && allowsEval$1.value;
2175
- const { catchall } = def;
2210
+ const catchall = def.catchall;
2176
2211
  let value;
2177
2212
  inst._zod.parse = (payload, ctx) => {
2178
2213
  value ?? (value = _normalized.value);
@@ -2202,12 +2237,10 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2202
2237
  const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
2203
2238
  if (r instanceof Promise) {
2204
2239
  proms.push(r.then((r$1) => isOptional ? handleOptionalObjectResult(r$1, payload, key, input) : handleObjectResult(r$1, payload, key)));
2240
+ } else if (isOptional) {
2241
+ handleOptionalObjectResult(r, payload, key, input);
2205
2242
  } else {
2206
- if (isOptional) {
2207
- handleOptionalObjectResult(r, payload, key, input);
2208
- } else {
2209
- handleObjectResult(r, payload, key);
2210
- }
2243
+ handleObjectResult(r, payload, key);
2211
2244
  }
2212
2245
  }
2213
2246
  }
@@ -2265,6 +2298,8 @@ function handleUnionResults(results, final, inst, ctx) {
2265
2298
  }
2266
2299
  const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
2267
2300
  $ZodType.init(inst, def);
2301
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
2302
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
2268
2303
  defineLazy(inst._zod, "values", () => {
2269
2304
  if (def.options.every((o) => o._zod.values)) {
2270
2305
  return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
@@ -2321,7 +2356,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2321
2356
  const opts = def.options;
2322
2357
  const map$1 = new Map();
2323
2358
  for (const o of opts) {
2324
- const values = o._zod.propValues[def.discriminator];
2359
+ const values = o._zod.propValues?.[def.discriminator];
2325
2360
  if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
2326
2361
  for (const v of values) {
2327
2362
  if (map$1.has(v)) {
@@ -2364,7 +2399,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2364
2399
  const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
2365
2400
  $ZodType.init(inst, def);
2366
2401
  inst._zod.parse = (payload, ctx) => {
2367
- const { value: input } = payload;
2402
+ const input = payload.value;
2368
2403
  const left = def.left._zod.run({
2369
2404
  value: input,
2370
2405
  issues: []
@@ -2821,6 +2856,9 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
2821
2856
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined;
2822
2857
  });
2823
2858
  inst._zod.parse = (payload, ctx) => {
2859
+ if (def.innerType._zod.optin === "optional") {
2860
+ return def.innerType._zod.run(payload, ctx);
2861
+ }
2824
2862
  if (payload.value === undefined) {
2825
2863
  return payload;
2826
2864
  }
@@ -2920,7 +2958,7 @@ const $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
2920
2958
  });
2921
2959
  const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2922
2960
  $ZodType.init(inst, def);
2923
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2961
+ inst._zod.optin = "optional";
2924
2962
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2925
2963
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2926
2964
  inst._zod.parse = (payload, ctx) => {
@@ -2971,6 +3009,7 @@ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
2971
3009
  defineLazy(inst._zod, "values", () => def.in._zod.values);
2972
3010
  defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2973
3011
  defineLazy(inst._zod, "optout", () => def.out._zod.optout);
3012
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2974
3013
  inst._zod.parse = (payload, ctx) => {
2975
3014
  const left = def.in._zod.run(payload, ctx);
2976
3015
  if (left instanceof Promise) {
@@ -2991,6 +3030,7 @@ function handlePipeResult(left, def, ctx) {
2991
3030
  const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2992
3031
  $ZodType.init(inst, def);
2993
3032
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
3033
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2994
3034
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2995
3035
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2996
3036
  inst._zod.parse = (payload, ctx) => {
@@ -3041,7 +3081,7 @@ const $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral",
3041
3081
  input: payload.value,
3042
3082
  inst,
3043
3083
  code: "invalid_format",
3044
- format: "template_literal",
3084
+ format: def.format ?? "template_literal",
3045
3085
  pattern: inst._zod.pattern.source
3046
3086
  });
3047
3087
  return payload;
@@ -3101,8 +3141,8 @@ function handleRefineResult(result, payload, input, inst) {
3101
3141
  }
3102
3142
 
3103
3143
  //#endregion
3104
- //#region ../../node_modules/zod/dist/esm/v4/locales/ar.js
3105
- const error$36 = () => {
3144
+ //#region ../../node_modules/zod/v4/locales/ar.js
3145
+ const error$38 = () => {
3106
3146
  const Sizable = {
3107
3147
  string: {
3108
3148
  unit: "حرف",
@@ -3124,7 +3164,7 @@ const error$36 = () => {
3124
3164
  function getSizing(origin) {
3125
3165
  return Sizable[origin] ?? null;
3126
3166
  }
3127
- const parsedType$2 = (data) => {
3167
+ const parsedType$3 = (data) => {
3128
3168
  const t = typeof data;
3129
3169
  switch (t) {
3130
3170
  case "number": {
@@ -3176,7 +3216,7 @@ const error$36 = () => {
3176
3216
  };
3177
3217
  return (issue$1) => {
3178
3218
  switch (issue$1.code) {
3179
- case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$2(issue$1.input)}`;
3219
+ case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$3(issue$1.input)}`;
3180
3220
  case "invalid_value":
3181
3221
  if (issue$1.values.length === 1) return `مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(issue$1.values[0])}`;
3182
3222
  return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(issue$1.values, "|")}`;
@@ -3212,12 +3252,12 @@ const error$36 = () => {
3212
3252
  };
3213
3253
  };
3214
3254
  function ar_default() {
3215
- return { localeError: error$36() };
3255
+ return { localeError: error$38() };
3216
3256
  }
3217
3257
 
3218
3258
  //#endregion
3219
- //#region ../../node_modules/zod/dist/esm/v4/locales/az.js
3220
- const error$35 = () => {
3259
+ //#region ../../node_modules/zod/v4/locales/az.js
3260
+ const error$37 = () => {
3221
3261
  const Sizable = {
3222
3262
  string: {
3223
3263
  unit: "simvol",
@@ -3239,7 +3279,7 @@ const error$35 = () => {
3239
3279
  function getSizing(origin) {
3240
3280
  return Sizable[origin] ?? null;
3241
3281
  }
3242
- const parsedType$2 = (data) => {
3282
+ const parsedType$3 = (data) => {
3243
3283
  const t = typeof data;
3244
3284
  switch (t) {
3245
3285
  case "number": {
@@ -3291,7 +3331,7 @@ const error$35 = () => {
3291
3331
  };
3292
3332
  return (issue$1) => {
3293
3333
  switch (issue$1.code) {
3294
- case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$2(issue$1.input)}`;
3334
+ case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$3(issue$1.input)}`;
3295
3335
  case "invalid_value":
3296
3336
  if (issue$1.values.length === 1) return `Yanlış dəyər: gözlənilən ${stringifyPrimitive(issue$1.values[0])}`;
3297
3337
  return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(issue$1.values, "|")}`;
@@ -3325,11 +3365,11 @@ const error$35 = () => {
3325
3365
  };
3326
3366
  };
3327
3367
  function az_default() {
3328
- return { localeError: error$35() };
3368
+ return { localeError: error$37() };
3329
3369
  }
3330
3370
 
3331
3371
  //#endregion
3332
- //#region ../../node_modules/zod/dist/esm/v4/locales/be.js
3372
+ //#region ../../node_modules/zod/v4/locales/be.js
3333
3373
  function getBelarusianPlural(count, one, few, many) {
3334
3374
  const absCount = Math.abs(count);
3335
3375
  const lastDigit = absCount % 10;
@@ -3345,7 +3385,7 @@ function getBelarusianPlural(count, one, few, many) {
3345
3385
  }
3346
3386
  return many;
3347
3387
  }
3348
- const error$34 = () => {
3388
+ const error$36 = () => {
3349
3389
  const Sizable = {
3350
3390
  string: {
3351
3391
  unit: {
@@ -3383,7 +3423,7 @@ const error$34 = () => {
3383
3423
  function getSizing(origin) {
3384
3424
  return Sizable[origin] ?? null;
3385
3425
  }
3386
- const parsedType$2 = (data) => {
3426
+ const parsedType$3 = (data) => {
3387
3427
  const t = typeof data;
3388
3428
  switch (t) {
3389
3429
  case "number": {
@@ -3435,7 +3475,7 @@ const error$34 = () => {
3435
3475
  };
3436
3476
  return (issue$1) => {
3437
3477
  switch (issue$1.code) {
3438
- case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$2(issue$1.input)}`;
3478
+ case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$3(issue$1.input)}`;
3439
3479
  case "invalid_value":
3440
3480
  if (issue$1.values.length === 1) return `Няправільны ўвод: чакалася ${stringifyPrimitive(issue$1.values[0])}`;
3441
3481
  return `Няправільны варыянт: чакаўся адзін з ${joinValues(issue$1.values, "|")}`;
@@ -3477,12 +3517,12 @@ const error$34 = () => {
3477
3517
  };
3478
3518
  };
3479
3519
  function be_default() {
3480
- return { localeError: error$34() };
3520
+ return { localeError: error$36() };
3481
3521
  }
3482
3522
 
3483
3523
  //#endregion
3484
- //#region ../../node_modules/zod/dist/esm/v4/locales/ca.js
3485
- const error$33 = () => {
3524
+ //#region ../../node_modules/zod/v4/locales/ca.js
3525
+ const error$35 = () => {
3486
3526
  const Sizable = {
3487
3527
  string: {
3488
3528
  unit: "caràcters",
@@ -3504,7 +3544,7 @@ const error$33 = () => {
3504
3544
  function getSizing(origin) {
3505
3545
  return Sizable[origin] ?? null;
3506
3546
  }
3507
- const parsedType$2 = (data) => {
3547
+ const parsedType$3 = (data) => {
3508
3548
  const t = typeof data;
3509
3549
  switch (t) {
3510
3550
  case "number": {
@@ -3556,7 +3596,7 @@ const error$33 = () => {
3556
3596
  };
3557
3597
  return (issue$1) => {
3558
3598
  switch (issue$1.code) {
3559
- case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$2(issue$1.input)}`;
3599
+ case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$3(issue$1.input)}`;
3560
3600
  case "invalid_value":
3561
3601
  if (issue$1.values.length === 1) return `Valor invàlid: s'esperava ${stringifyPrimitive(issue$1.values[0])}`;
3562
3602
  return `Opció invàlida: s'esperava una de ${joinValues(issue$1.values, " o ")}`;
@@ -3594,12 +3634,12 @@ const error$33 = () => {
3594
3634
  };
3595
3635
  };
3596
3636
  function ca_default() {
3597
- return { localeError: error$33() };
3637
+ return { localeError: error$35() };
3598
3638
  }
3599
3639
 
3600
3640
  //#endregion
3601
- //#region ../../node_modules/zod/dist/esm/v4/locales/cs.js
3602
- const error$32 = () => {
3641
+ //#region ../../node_modules/zod/v4/locales/cs.js
3642
+ const error$34 = () => {
3603
3643
  const Sizable = {
3604
3644
  string: {
3605
3645
  unit: "znaků",
@@ -3621,7 +3661,7 @@ const error$32 = () => {
3621
3661
  function getSizing(origin) {
3622
3662
  return Sizable[origin] ?? null;
3623
3663
  }
3624
- const parsedType$2 = (data) => {
3664
+ const parsedType$3 = (data) => {
3625
3665
  const t = typeof data;
3626
3666
  switch (t) {
3627
3667
  case "number": {
@@ -3691,7 +3731,7 @@ const error$32 = () => {
3691
3731
  };
3692
3732
  return (issue$1) => {
3693
3733
  switch (issue$1.code) {
3694
- case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$2(issue$1.input)}`;
3734
+ case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$3(issue$1.input)}`;
3695
3735
  case "invalid_value":
3696
3736
  if (issue$1.values.length === 1) return `Neplatný vstup: očekáváno ${stringifyPrimitive(issue$1.values[0])}`;
3697
3737
  return `Neplatná možnost: očekávána jedna z hodnot ${joinValues(issue$1.values, "|")}`;
@@ -3729,12 +3769,12 @@ const error$32 = () => {
3729
3769
  };
3730
3770
  };
3731
3771
  function cs_default() {
3732
- return { localeError: error$32() };
3772
+ return { localeError: error$34() };
3733
3773
  }
3734
3774
 
3735
3775
  //#endregion
3736
- //#region ../../node_modules/zod/dist/esm/v4/locales/de.js
3737
- const error$31 = () => {
3776
+ //#region ../../node_modules/zod/v4/locales/de.js
3777
+ const error$33 = () => {
3738
3778
  const Sizable = {
3739
3779
  string: {
3740
3780
  unit: "Zeichen",
@@ -3756,7 +3796,7 @@ const error$31 = () => {
3756
3796
  function getSizing(origin) {
3757
3797
  return Sizable[origin] ?? null;
3758
3798
  }
3759
- const parsedType$2 = (data) => {
3799
+ const parsedType$3 = (data) => {
3760
3800
  const t = typeof data;
3761
3801
  switch (t) {
3762
3802
  case "number": {
@@ -3808,7 +3848,7 @@ const error$31 = () => {
3808
3848
  };
3809
3849
  return (issue$1) => {
3810
3850
  switch (issue$1.code) {
3811
- case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$2(issue$1.input)}`;
3851
+ case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$3(issue$1.input)}`;
3812
3852
  case "invalid_value":
3813
3853
  if (issue$1.values.length === 1) return `Ungültige Eingabe: erwartet ${stringifyPrimitive(issue$1.values[0])}`;
3814
3854
  return `Ungültige Option: erwartet eine von ${joinValues(issue$1.values, "|")}`;
@@ -3844,12 +3884,12 @@ const error$31 = () => {
3844
3884
  };
3845
3885
  };
3846
3886
  function de_default() {
3847
- return { localeError: error$31() };
3887
+ return { localeError: error$33() };
3848
3888
  }
3849
3889
 
3850
3890
  //#endregion
3851
- //#region ../../node_modules/zod/dist/esm/v4/locales/en.js
3852
- const parsedType$1 = (data) => {
3891
+ //#region ../../node_modules/zod/v4/locales/en.js
3892
+ const parsedType$2 = (data) => {
3853
3893
  const t = typeof data;
3854
3894
  switch (t) {
3855
3895
  case "number": {
@@ -3869,7 +3909,7 @@ const parsedType$1 = (data) => {
3869
3909
  }
3870
3910
  return t;
3871
3911
  };
3872
- const error$30 = () => {
3912
+ const error$32 = () => {
3873
3913
  const Sizable = {
3874
3914
  string: {
3875
3915
  unit: "characters",
@@ -3923,7 +3963,7 @@ const error$30 = () => {
3923
3963
  };
3924
3964
  return (issue$1) => {
3925
3965
  switch (issue$1.code) {
3926
- case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$1(issue$1.input)}`;
3966
+ case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$2(issue$1.input)}`;
3927
3967
  case "invalid_value":
3928
3968
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
3929
3969
  return `Invalid option: expected one of ${joinValues(issue$1.values, "|")}`;
@@ -3961,12 +4001,127 @@ const error$30 = () => {
3961
4001
  };
3962
4002
  };
3963
4003
  function en_default() {
3964
- return { localeError: error$30() };
4004
+ return { localeError: error$32() };
3965
4005
  }
3966
4006
 
3967
4007
  //#endregion
3968
- //#region ../../node_modules/zod/dist/esm/v4/locales/es.js
3969
- const error$29 = () => {
4008
+ //#region ../../node_modules/zod/v4/locales/eo.js
4009
+ const parsedType$1 = (data) => {
4010
+ const t = typeof data;
4011
+ switch (t) {
4012
+ case "number": {
4013
+ return Number.isNaN(data) ? "NaN" : "nombro";
4014
+ }
4015
+ case "object": {
4016
+ if (Array.isArray(data)) {
4017
+ return "tabelo";
4018
+ }
4019
+ if (data === null) {
4020
+ return "senvalora";
4021
+ }
4022
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
4023
+ return data.constructor.name;
4024
+ }
4025
+ }
4026
+ }
4027
+ return t;
4028
+ };
4029
+ const error$31 = () => {
4030
+ const Sizable = {
4031
+ string: {
4032
+ unit: "karaktrojn",
4033
+ verb: "havi"
4034
+ },
4035
+ file: {
4036
+ unit: "bajtojn",
4037
+ verb: "havi"
4038
+ },
4039
+ array: {
4040
+ unit: "elementojn",
4041
+ verb: "havi"
4042
+ },
4043
+ set: {
4044
+ unit: "elementojn",
4045
+ verb: "havi"
4046
+ }
4047
+ };
4048
+ function getSizing(origin) {
4049
+ return Sizable[origin] ?? null;
4050
+ }
4051
+ const Nouns = {
4052
+ regex: "enigo",
4053
+ email: "retadreso",
4054
+ url: "URL",
4055
+ emoji: "emoĝio",
4056
+ uuid: "UUID",
4057
+ uuidv4: "UUIDv4",
4058
+ uuidv6: "UUIDv6",
4059
+ nanoid: "nanoid",
4060
+ guid: "GUID",
4061
+ cuid: "cuid",
4062
+ cuid2: "cuid2",
4063
+ ulid: "ULID",
4064
+ xid: "XID",
4065
+ ksuid: "KSUID",
4066
+ datetime: "ISO-datotempo",
4067
+ date: "ISO-dato",
4068
+ time: "ISO-tempo",
4069
+ duration: "ISO-daŭro",
4070
+ ipv4: "IPv4-adreso",
4071
+ ipv6: "IPv6-adreso",
4072
+ cidrv4: "IPv4-rango",
4073
+ cidrv6: "IPv6-rango",
4074
+ base64: "64-ume kodita karaktraro",
4075
+ base64url: "URL-64-ume kodita karaktraro",
4076
+ json_string: "JSON-karaktraro",
4077
+ e164: "E.164-nombro",
4078
+ jwt: "JWT",
4079
+ template_literal: "enigo"
4080
+ };
4081
+ return (issue$1) => {
4082
+ switch (issue$1.code) {
4083
+ case "invalid_type": return `Nevalida enigo: atendiĝis ${issue$1.expected}, riceviĝis ${parsedType$1(issue$1.input)}`;
4084
+ case "invalid_value":
4085
+ if (issue$1.values.length === 1) return `Nevalida enigo: atendiĝis ${stringifyPrimitive(issue$1.values[0])}`;
4086
+ return `Nevalida opcio: atendiĝis unu el ${joinValues(issue$1.values, "|")}`;
4087
+ case "too_big": {
4088
+ const adj = issue$1.inclusive ? "<=" : "<";
4089
+ const sizing = getSizing(issue$1.origin);
4090
+ if (sizing) return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
4091
+ return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()}`;
4092
+ }
4093
+ case "too_small": {
4094
+ const adj = issue$1.inclusive ? ">=" : ">";
4095
+ const sizing = getSizing(issue$1.origin);
4096
+ if (sizing) {
4097
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} havu ${adj}${issue$1.minimum.toString()} ${sizing.unit}`;
4098
+ }
4099
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} estu ${adj}${issue$1.minimum.toString()}`;
4100
+ }
4101
+ case "invalid_format": {
4102
+ const _issue = issue$1;
4103
+ if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
4104
+ if (_issue.format === "ends_with") return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
4105
+ if (_issue.format === "includes") return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
4106
+ if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
4107
+ return `Nevalida ${Nouns[_issue.format] ?? issue$1.format}`;
4108
+ }
4109
+ case "not_multiple_of": return `Nevalida nombro: devas esti oblo de ${issue$1.divisor}`;
4110
+ case "unrecognized_keys": return `Nekonata${issue$1.keys.length > 1 ? "j" : ""} ŝlosilo${issue$1.keys.length > 1 ? "j" : ""}: ${joinValues(issue$1.keys, ", ")}`;
4111
+ case "invalid_key": return `Nevalida ŝlosilo en ${issue$1.origin}`;
4112
+ case "invalid_union": return "Nevalida enigo";
4113
+ case "invalid_element": return `Nevalida valoro en ${issue$1.origin}`;
4114
+ default: return `Nevalida enigo`;
4115
+ }
4116
+ };
4117
+ };
4118
+ function eo_default() {
4119
+ return { localeError: error$31() };
4120
+ }
4121
+
4122
+ //#endregion
4123
+ //#region ../../node_modules/zod/v4/locales/es.js
4124
+ const error$30 = () => {
3970
4125
  const Sizable = {
3971
4126
  string: {
3972
4127
  unit: "caracteres",
@@ -3988,7 +4143,7 @@ const error$29 = () => {
3988
4143
  function getSizing(origin) {
3989
4144
  return Sizable[origin] ?? null;
3990
4145
  }
3991
- const parsedType$2 = (data) => {
4146
+ const parsedType$3 = (data) => {
3992
4147
  const t = typeof data;
3993
4148
  switch (t) {
3994
4149
  case "number": {
@@ -4040,7 +4195,7 @@ const error$29 = () => {
4040
4195
  };
4041
4196
  return (issue$1) => {
4042
4197
  switch (issue$1.code) {
4043
- case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$2(issue$1.input)}`;
4198
+ case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$3(issue$1.input)}`;
4044
4199
  case "invalid_value":
4045
4200
  if (issue$1.values.length === 1) return `Entrada inválida: se esperaba ${stringifyPrimitive(issue$1.values[0])}`;
4046
4201
  return `Opción inválida: se esperaba una de ${joinValues(issue$1.values, "|")}`;
@@ -4076,12 +4231,12 @@ const error$29 = () => {
4076
4231
  };
4077
4232
  };
4078
4233
  function es_default() {
4079
- return { localeError: error$29() };
4234
+ return { localeError: error$30() };
4080
4235
  }
4081
4236
 
4082
4237
  //#endregion
4083
- //#region ../../node_modules/zod/dist/esm/v4/locales/fa.js
4084
- const error$28 = () => {
4238
+ //#region ../../node_modules/zod/v4/locales/fa.js
4239
+ const error$29 = () => {
4085
4240
  const Sizable = {
4086
4241
  string: {
4087
4242
  unit: "کاراکتر",
@@ -4103,7 +4258,7 @@ const error$28 = () => {
4103
4258
  function getSizing(origin) {
4104
4259
  return Sizable[origin] ?? null;
4105
4260
  }
4106
- const parsedType$2 = (data) => {
4261
+ const parsedType$3 = (data) => {
4107
4262
  const t = typeof data;
4108
4263
  switch (t) {
4109
4264
  case "number": {
@@ -4155,7 +4310,7 @@ const error$28 = () => {
4155
4310
  };
4156
4311
  return (issue$1) => {
4157
4312
  switch (issue$1.code) {
4158
- case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$2(issue$1.input)} دریافت شد`;
4313
+ case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$3(issue$1.input)} دریافت شد`;
4159
4314
  case "invalid_value":
4160
4315
  if (issue$1.values.length === 1) {
4161
4316
  return `ورودی نامعتبر: می‌بایست ${stringifyPrimitive(issue$1.values[0])} می‌بود`;
@@ -4203,12 +4358,12 @@ const error$28 = () => {
4203
4358
  };
4204
4359
  };
4205
4360
  function fa_default() {
4206
- return { localeError: error$28() };
4361
+ return { localeError: error$29() };
4207
4362
  }
4208
4363
 
4209
4364
  //#endregion
4210
- //#region ../../node_modules/zod/dist/esm/v4/locales/fi.js
4211
- const error$27 = () => {
4365
+ //#region ../../node_modules/zod/v4/locales/fi.js
4366
+ const error$28 = () => {
4212
4367
  const Sizable = {
4213
4368
  string: {
4214
4369
  unit: "merkkiä",
@@ -4246,7 +4401,7 @@ const error$27 = () => {
4246
4401
  function getSizing(origin) {
4247
4402
  return Sizable[origin] ?? null;
4248
4403
  }
4249
- const parsedType$2 = (data) => {
4404
+ const parsedType$3 = (data) => {
4250
4405
  const t = typeof data;
4251
4406
  switch (t) {
4252
4407
  case "number": {
@@ -4298,7 +4453,7 @@ const error$27 = () => {
4298
4453
  };
4299
4454
  return (issue$1) => {
4300
4455
  switch (issue$1.code) {
4301
- case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$2(issue$1.input)}`;
4456
+ case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$3(issue$1.input)}`;
4302
4457
  case "invalid_value":
4303
4458
  if (issue$1.values.length === 1) return `Virheellinen syöte: täytyy olla ${stringifyPrimitive(issue$1.values[0])}`;
4304
4459
  return `Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(issue$1.values, "|")}`;
@@ -4338,12 +4493,12 @@ const error$27 = () => {
4338
4493
  };
4339
4494
  };
4340
4495
  function fi_default() {
4341
- return { localeError: error$27() };
4496
+ return { localeError: error$28() };
4342
4497
  }
4343
4498
 
4344
4499
  //#endregion
4345
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr.js
4346
- const error$26 = () => {
4500
+ //#region ../../node_modules/zod/v4/locales/fr.js
4501
+ const error$27 = () => {
4347
4502
  const Sizable = {
4348
4503
  string: {
4349
4504
  unit: "caractères",
@@ -4365,7 +4520,7 @@ const error$26 = () => {
4365
4520
  function getSizing(origin) {
4366
4521
  return Sizable[origin] ?? null;
4367
4522
  }
4368
- const parsedType$2 = (data) => {
4523
+ const parsedType$3 = (data) => {
4369
4524
  const t = typeof data;
4370
4525
  switch (t) {
4371
4526
  case "number": {
@@ -4417,7 +4572,7 @@ const error$26 = () => {
4417
4572
  };
4418
4573
  return (issue$1) => {
4419
4574
  switch (issue$1.code) {
4420
- case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$2(issue$1.input)} reçu`;
4575
+ case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$3(issue$1.input)} reçu`;
4421
4576
  case "invalid_value":
4422
4577
  if (issue$1.values.length === 1) return `Entrée invalide : ${stringifyPrimitive(issue$1.values[0])} attendu`;
4423
4578
  return `Option invalide : une valeur parmi ${joinValues(issue$1.values, "|")} attendue`;
@@ -4453,12 +4608,12 @@ const error$26 = () => {
4453
4608
  };
4454
4609
  };
4455
4610
  function fr_default() {
4456
- return { localeError: error$26() };
4611
+ return { localeError: error$27() };
4457
4612
  }
4458
4613
 
4459
4614
  //#endregion
4460
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr-CA.js
4461
- const error$25 = () => {
4615
+ //#region ../../node_modules/zod/v4/locales/fr-CA.js
4616
+ const error$26 = () => {
4462
4617
  const Sizable = {
4463
4618
  string: {
4464
4619
  unit: "caractères",
@@ -4480,7 +4635,7 @@ const error$25 = () => {
4480
4635
  function getSizing(origin) {
4481
4636
  return Sizable[origin] ?? null;
4482
4637
  }
4483
- const parsedType$2 = (data) => {
4638
+ const parsedType$3 = (data) => {
4484
4639
  const t = typeof data;
4485
4640
  switch (t) {
4486
4641
  case "number": {
@@ -4532,7 +4687,7 @@ const error$25 = () => {
4532
4687
  };
4533
4688
  return (issue$1) => {
4534
4689
  switch (issue$1.code) {
4535
- case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$2(issue$1.input)}`;
4690
+ case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$3(issue$1.input)}`;
4536
4691
  case "invalid_value":
4537
4692
  if (issue$1.values.length === 1) return `Entrée invalide : attendu ${stringifyPrimitive(issue$1.values[0])}`;
4538
4693
  return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue$1.values, "|")}`;
@@ -4570,12 +4725,12 @@ const error$25 = () => {
4570
4725
  };
4571
4726
  };
4572
4727
  function fr_CA_default() {
4573
- return { localeError: error$25() };
4728
+ return { localeError: error$26() };
4574
4729
  }
4575
4730
 
4576
4731
  //#endregion
4577
- //#region ../../node_modules/zod/dist/esm/v4/locales/he.js
4578
- const error$24 = () => {
4732
+ //#region ../../node_modules/zod/v4/locales/he.js
4733
+ const error$25 = () => {
4579
4734
  const Sizable = {
4580
4735
  string: {
4581
4736
  unit: "אותיות",
@@ -4597,7 +4752,7 @@ const error$24 = () => {
4597
4752
  function getSizing(origin) {
4598
4753
  return Sizable[origin] ?? null;
4599
4754
  }
4600
- const parsedType$2 = (data) => {
4755
+ const parsedType$3 = (data) => {
4601
4756
  const t = typeof data;
4602
4757
  switch (t) {
4603
4758
  case "number": {
@@ -4649,7 +4804,7 @@ const error$24 = () => {
4649
4804
  };
4650
4805
  return (issue$1) => {
4651
4806
  switch (issue$1.code) {
4652
- case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$2(issue$1.input)}`;
4807
+ case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$3(issue$1.input)}`;
4653
4808
  case "invalid_value":
4654
4809
  if (issue$1.values.length === 1) return `קלט לא תקין: צריך ${stringifyPrimitive(issue$1.values[0])}`;
4655
4810
  return `קלט לא תקין: צריך אחת מהאפשרויות ${joinValues(issue$1.values, "|")}`;
@@ -4685,12 +4840,12 @@ const error$24 = () => {
4685
4840
  };
4686
4841
  };
4687
4842
  function he_default() {
4688
- return { localeError: error$24() };
4843
+ return { localeError: error$25() };
4689
4844
  }
4690
4845
 
4691
4846
  //#endregion
4692
- //#region ../../node_modules/zod/dist/esm/v4/locales/hu.js
4693
- const error$23 = () => {
4847
+ //#region ../../node_modules/zod/v4/locales/hu.js
4848
+ const error$24 = () => {
4694
4849
  const Sizable = {
4695
4850
  string: {
4696
4851
  unit: "karakter",
@@ -4712,7 +4867,7 @@ const error$23 = () => {
4712
4867
  function getSizing(origin) {
4713
4868
  return Sizable[origin] ?? null;
4714
4869
  }
4715
- const parsedType$2 = (data) => {
4870
+ const parsedType$3 = (data) => {
4716
4871
  const t = typeof data;
4717
4872
  switch (t) {
4718
4873
  case "number": {
@@ -4764,7 +4919,7 @@ const error$23 = () => {
4764
4919
  };
4765
4920
  return (issue$1) => {
4766
4921
  switch (issue$1.code) {
4767
- case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$2(issue$1.input)}`;
4922
+ case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$3(issue$1.input)}`;
4768
4923
  case "invalid_value":
4769
4924
  if (issue$1.values.length === 1) return `Érvénytelen bemenet: a várt érték ${stringifyPrimitive(issue$1.values[0])}`;
4770
4925
  return `Érvénytelen opció: valamelyik érték várt ${joinValues(issue$1.values, "|")}`;
@@ -4800,12 +4955,12 @@ const error$23 = () => {
4800
4955
  };
4801
4956
  };
4802
4957
  function hu_default() {
4803
- return { localeError: error$23() };
4958
+ return { localeError: error$24() };
4804
4959
  }
4805
4960
 
4806
4961
  //#endregion
4807
- //#region ../../node_modules/zod/dist/esm/v4/locales/id.js
4808
- const error$22 = () => {
4962
+ //#region ../../node_modules/zod/v4/locales/id.js
4963
+ const error$23 = () => {
4809
4964
  const Sizable = {
4810
4965
  string: {
4811
4966
  unit: "karakter",
@@ -4827,7 +4982,7 @@ const error$22 = () => {
4827
4982
  function getSizing(origin) {
4828
4983
  return Sizable[origin] ?? null;
4829
4984
  }
4830
- const parsedType$2 = (data) => {
4985
+ const parsedType$3 = (data) => {
4831
4986
  const t = typeof data;
4832
4987
  switch (t) {
4833
4988
  case "number": {
@@ -4879,7 +5034,7 @@ const error$22 = () => {
4879
5034
  };
4880
5035
  return (issue$1) => {
4881
5036
  switch (issue$1.code) {
4882
- case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5037
+ case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
4883
5038
  case "invalid_value":
4884
5039
  if (issue$1.values.length === 1) return `Input tidak valid: diharapkan ${stringifyPrimitive(issue$1.values[0])}`;
4885
5040
  return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue$1.values, "|")}`;
@@ -4915,12 +5070,12 @@ const error$22 = () => {
4915
5070
  };
4916
5071
  };
4917
5072
  function id_default() {
4918
- return { localeError: error$22() };
5073
+ return { localeError: error$23() };
4919
5074
  }
4920
5075
 
4921
5076
  //#endregion
4922
- //#region ../../node_modules/zod/dist/esm/v4/locales/it.js
4923
- const error$21 = () => {
5077
+ //#region ../../node_modules/zod/v4/locales/it.js
5078
+ const error$22 = () => {
4924
5079
  const Sizable = {
4925
5080
  string: {
4926
5081
  unit: "caratteri",
@@ -4942,7 +5097,7 @@ const error$21 = () => {
4942
5097
  function getSizing(origin) {
4943
5098
  return Sizable[origin] ?? null;
4944
5099
  }
4945
- const parsedType$2 = (data) => {
5100
+ const parsedType$3 = (data) => {
4946
5101
  const t = typeof data;
4947
5102
  switch (t) {
4948
5103
  case "number": {
@@ -4994,7 +5149,7 @@ const error$21 = () => {
4994
5149
  };
4995
5150
  return (issue$1) => {
4996
5151
  switch (issue$1.code) {
4997
- case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$2(issue$1.input)}`;
5152
+ case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$3(issue$1.input)}`;
4998
5153
  case "invalid_value":
4999
5154
  if (issue$1.values.length === 1) return `Input non valido: atteso ${stringifyPrimitive(issue$1.values[0])}`;
5000
5155
  return `Opzione non valida: atteso uno tra ${joinValues(issue$1.values, "|")}`;
@@ -5030,12 +5185,12 @@ const error$21 = () => {
5030
5185
  };
5031
5186
  };
5032
5187
  function it_default() {
5033
- return { localeError: error$21() };
5188
+ return { localeError: error$22() };
5034
5189
  }
5035
5190
 
5036
5191
  //#endregion
5037
- //#region ../../node_modules/zod/dist/esm/v4/locales/ja.js
5038
- const error$20 = () => {
5192
+ //#region ../../node_modules/zod/v4/locales/ja.js
5193
+ const error$21 = () => {
5039
5194
  const Sizable = {
5040
5195
  string: {
5041
5196
  unit: "文字",
@@ -5057,7 +5212,7 @@ const error$20 = () => {
5057
5212
  function getSizing(origin) {
5058
5213
  return Sizable[origin] ?? null;
5059
5214
  }
5060
- const parsedType$2 = (data) => {
5215
+ const parsedType$3 = (data) => {
5061
5216
  const t = typeof data;
5062
5217
  switch (t) {
5063
5218
  case "number": {
@@ -5109,21 +5264,21 @@ const error$20 = () => {
5109
5264
  };
5110
5265
  return (issue$1) => {
5111
5266
  switch (issue$1.code) {
5112
- case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$2(issue$1.input)}が入力されました`;
5267
+ case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$3(issue$1.input)}が入力されました`;
5113
5268
  case "invalid_value":
5114
5269
  if (issue$1.values.length === 1) return `無効な入力: ${stringifyPrimitive(issue$1.values[0])}が期待されました`;
5115
5270
  return `無効な選択: ${joinValues(issue$1.values, "、")}のいずれかである必要があります`;
5116
5271
  case "too_big": {
5117
- const adj = issue$1.inclusive ? "<=" : "<";
5272
+ const adj = issue$1.inclusive ? "以下である" : "より小さい";
5118
5273
  const sizing = getSizing(issue$1.origin);
5119
- if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}である必要があります`;
5120
- return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}である必要があります`;
5274
+ if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`;
5275
+ return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}必要があります`;
5121
5276
  }
5122
5277
  case "too_small": {
5123
- const adj = issue$1.inclusive ? ">=" : ">";
5278
+ const adj = issue$1.inclusive ? "以上である" : "より大きい";
5124
5279
  const sizing = getSizing(issue$1.origin);
5125
- if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}である必要があります`;
5126
- return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}である必要があります`;
5280
+ if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}必要があります`;
5281
+ return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}必要があります`;
5127
5282
  }
5128
5283
  case "invalid_format": {
5129
5284
  const _issue = issue$1;
@@ -5143,12 +5298,12 @@ const error$20 = () => {
5143
5298
  };
5144
5299
  };
5145
5300
  function ja_default() {
5146
- return { localeError: error$20() };
5301
+ return { localeError: error$21() };
5147
5302
  }
5148
5303
 
5149
5304
  //#endregion
5150
- //#region ../../node_modules/zod/dist/esm/v4/locales/kh.js
5151
- const error$19 = () => {
5305
+ //#region ../../node_modules/zod/v4/locales/kh.js
5306
+ const error$20 = () => {
5152
5307
  const Sizable = {
5153
5308
  string: {
5154
5309
  unit: "តួអក្សរ",
@@ -5170,7 +5325,7 @@ const error$19 = () => {
5170
5325
  function getSizing(origin) {
5171
5326
  return Sizable[origin] ?? null;
5172
5327
  }
5173
- const parsedType$2 = (data) => {
5328
+ const parsedType$3 = (data) => {
5174
5329
  const t = typeof data;
5175
5330
  switch (t) {
5176
5331
  case "number": {
@@ -5222,7 +5377,7 @@ const error$19 = () => {
5222
5377
  };
5223
5378
  return (issue$1) => {
5224
5379
  switch (issue$1.code) {
5225
- case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$2(issue$1.input)}`;
5380
+ case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$3(issue$1.input)}`;
5226
5381
  case "invalid_value":
5227
5382
  if (issue$1.values.length === 1) return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue$1.values[0])}`;
5228
5383
  return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(issue$1.values, "|")}`;
@@ -5260,12 +5415,12 @@ const error$19 = () => {
5260
5415
  };
5261
5416
  };
5262
5417
  function kh_default() {
5263
- return { localeError: error$19() };
5418
+ return { localeError: error$20() };
5264
5419
  }
5265
5420
 
5266
5421
  //#endregion
5267
- //#region ../../node_modules/zod/dist/esm/v4/locales/ko.js
5268
- const error$18 = () => {
5422
+ //#region ../../node_modules/zod/v4/locales/ko.js
5423
+ const error$19 = () => {
5269
5424
  const Sizable = {
5270
5425
  string: {
5271
5426
  unit: "문자",
@@ -5287,7 +5442,7 @@ const error$18 = () => {
5287
5442
  function getSizing(origin) {
5288
5443
  return Sizable[origin] ?? null;
5289
5444
  }
5290
- const parsedType$2 = (data) => {
5445
+ const parsedType$3 = (data) => {
5291
5446
  const t = typeof data;
5292
5447
  switch (t) {
5293
5448
  case "number": {
@@ -5339,7 +5494,7 @@ const error$18 = () => {
5339
5494
  };
5340
5495
  return (issue$1) => {
5341
5496
  switch (issue$1.code) {
5342
- case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$2(issue$1.input)}입니다`;
5497
+ case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$3(issue$1.input)}입니다`;
5343
5498
  case "invalid_value":
5344
5499
  if (issue$1.values.length === 1) return `잘못된 입력: 값은 ${stringifyPrimitive(issue$1.values[0])} 이어야 합니다`;
5345
5500
  return `잘못된 옵션: ${joinValues(issue$1.values, "또는 ")} 중 하나여야 합니다`;
@@ -5381,12 +5536,12 @@ const error$18 = () => {
5381
5536
  };
5382
5537
  };
5383
5538
  function ko_default() {
5384
- return { localeError: error$18() };
5539
+ return { localeError: error$19() };
5385
5540
  }
5386
5541
 
5387
5542
  //#endregion
5388
- //#region ../../node_modules/zod/dist/esm/v4/locales/mk.js
5389
- const error$17 = () => {
5543
+ //#region ../../node_modules/zod/v4/locales/mk.js
5544
+ const error$18 = () => {
5390
5545
  const Sizable = {
5391
5546
  string: {
5392
5547
  unit: "знаци",
@@ -5408,7 +5563,7 @@ const error$17 = () => {
5408
5563
  function getSizing(origin) {
5409
5564
  return Sizable[origin] ?? null;
5410
5565
  }
5411
- const parsedType$2 = (data) => {
5566
+ const parsedType$3 = (data) => {
5412
5567
  const t = typeof data;
5413
5568
  switch (t) {
5414
5569
  case "number": {
@@ -5460,7 +5615,7 @@ const error$17 = () => {
5460
5615
  };
5461
5616
  return (issue$1) => {
5462
5617
  switch (issue$1.code) {
5463
- case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$2(issue$1.input)}`;
5618
+ case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$3(issue$1.input)}`;
5464
5619
  case "invalid_value":
5465
5620
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
5466
5621
  return `Грешана опција: се очекува една ${joinValues(issue$1.values, "|")}`;
@@ -5498,12 +5653,12 @@ const error$17 = () => {
5498
5653
  };
5499
5654
  };
5500
5655
  function mk_default() {
5501
- return { localeError: error$17() };
5656
+ return { localeError: error$18() };
5502
5657
  }
5503
5658
 
5504
5659
  //#endregion
5505
- //#region ../../node_modules/zod/dist/esm/v4/locales/ms.js
5506
- const error$16 = () => {
5660
+ //#region ../../node_modules/zod/v4/locales/ms.js
5661
+ const error$17 = () => {
5507
5662
  const Sizable = {
5508
5663
  string: {
5509
5664
  unit: "aksara",
@@ -5525,7 +5680,7 @@ const error$16 = () => {
5525
5680
  function getSizing(origin) {
5526
5681
  return Sizable[origin] ?? null;
5527
5682
  }
5528
- const parsedType$2 = (data) => {
5683
+ const parsedType$3 = (data) => {
5529
5684
  const t = typeof data;
5530
5685
  switch (t) {
5531
5686
  case "number": {
@@ -5577,7 +5732,7 @@ const error$16 = () => {
5577
5732
  };
5578
5733
  return (issue$1) => {
5579
5734
  switch (issue$1.code) {
5580
- case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5735
+ case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
5581
5736
  case "invalid_value":
5582
5737
  if (issue$1.values.length === 1) return `Input tidak sah: dijangka ${stringifyPrimitive(issue$1.values[0])}`;
5583
5738
  return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue$1.values, "|")}`;
@@ -5613,12 +5768,12 @@ const error$16 = () => {
5613
5768
  };
5614
5769
  };
5615
5770
  function ms_default() {
5616
- return { localeError: error$16() };
5771
+ return { localeError: error$17() };
5617
5772
  }
5618
5773
 
5619
5774
  //#endregion
5620
- //#region ../../node_modules/zod/dist/esm/v4/locales/nl.js
5621
- const error$15 = () => {
5775
+ //#region ../../node_modules/zod/v4/locales/nl.js
5776
+ const error$16 = () => {
5622
5777
  const Sizable = {
5623
5778
  string: { unit: "tekens" },
5624
5779
  file: { unit: "bytes" },
@@ -5628,7 +5783,7 @@ const error$15 = () => {
5628
5783
  function getSizing(origin) {
5629
5784
  return Sizable[origin] ?? null;
5630
5785
  }
5631
- const parsedType$2 = (data) => {
5786
+ const parsedType$3 = (data) => {
5632
5787
  const t = typeof data;
5633
5788
  switch (t) {
5634
5789
  case "number": {
@@ -5680,7 +5835,7 @@ const error$15 = () => {
5680
5835
  };
5681
5836
  return (issue$1) => {
5682
5837
  switch (issue$1.code) {
5683
- case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$2(issue$1.input)}`;
5838
+ case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$3(issue$1.input)}`;
5684
5839
  case "invalid_value":
5685
5840
  if (issue$1.values.length === 1) return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue$1.values[0])}`;
5686
5841
  return `Ongeldige optie: verwacht één van ${joinValues(issue$1.values, "|")}`;
@@ -5718,12 +5873,12 @@ const error$15 = () => {
5718
5873
  };
5719
5874
  };
5720
5875
  function nl_default() {
5721
- return { localeError: error$15() };
5876
+ return { localeError: error$16() };
5722
5877
  }
5723
5878
 
5724
5879
  //#endregion
5725
- //#region ../../node_modules/zod/dist/esm/v4/locales/no.js
5726
- const error$14 = () => {
5880
+ //#region ../../node_modules/zod/v4/locales/no.js
5881
+ const error$15 = () => {
5727
5882
  const Sizable = {
5728
5883
  string: {
5729
5884
  unit: "tegn",
@@ -5745,7 +5900,7 @@ const error$14 = () => {
5745
5900
  function getSizing(origin) {
5746
5901
  return Sizable[origin] ?? null;
5747
5902
  }
5748
- const parsedType$2 = (data) => {
5903
+ const parsedType$3 = (data) => {
5749
5904
  const t = typeof data;
5750
5905
  switch (t) {
5751
5906
  case "number": {
@@ -5797,7 +5952,7 @@ const error$14 = () => {
5797
5952
  };
5798
5953
  return (issue$1) => {
5799
5954
  switch (issue$1.code) {
5800
- case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$2(issue$1.input)}`;
5955
+ case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$3(issue$1.input)}`;
5801
5956
  case "invalid_value":
5802
5957
  if (issue$1.values.length === 1) return `Ugyldig verdi: forventet ${stringifyPrimitive(issue$1.values[0])}`;
5803
5958
  return `Ugyldig valg: forventet en av ${joinValues(issue$1.values, "|")}`;
@@ -5833,12 +5988,12 @@ const error$14 = () => {
5833
5988
  };
5834
5989
  };
5835
5990
  function no_default() {
5836
- return { localeError: error$14() };
5991
+ return { localeError: error$15() };
5837
5992
  }
5838
5993
 
5839
5994
  //#endregion
5840
- //#region ../../node_modules/zod/dist/esm/v4/locales/ota.js
5841
- const error$13 = () => {
5995
+ //#region ../../node_modules/zod/v4/locales/ota.js
5996
+ const error$14 = () => {
5842
5997
  const Sizable = {
5843
5998
  string: {
5844
5999
  unit: "harf",
@@ -5860,7 +6015,7 @@ const error$13 = () => {
5860
6015
  function getSizing(origin) {
5861
6016
  return Sizable[origin] ?? null;
5862
6017
  }
5863
- const parsedType$2 = (data) => {
6018
+ const parsedType$3 = (data) => {
5864
6019
  const t = typeof data;
5865
6020
  switch (t) {
5866
6021
  case "number": {
@@ -5912,7 +6067,7 @@ const error$13 = () => {
5912
6067
  };
5913
6068
  return (issue$1) => {
5914
6069
  switch (issue$1.code) {
5915
- case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$2(issue$1.input)}`;
6070
+ case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$3(issue$1.input)}`;
5916
6071
  case "invalid_value":
5917
6072
  if (issue$1.values.length === 1) return `Fâsit giren: umulan ${stringifyPrimitive(issue$1.values[0])}`;
5918
6073
  return `Fâsit tercih: mûteberler ${joinValues(issue$1.values, "|")}`;
@@ -5948,11 +6103,138 @@ const error$13 = () => {
5948
6103
  };
5949
6104
  };
5950
6105
  function ota_default() {
6106
+ return { localeError: error$14() };
6107
+ }
6108
+
6109
+ //#endregion
6110
+ //#region ../../node_modules/zod/v4/locales/ps.js
6111
+ const error$13 = () => {
6112
+ const Sizable = {
6113
+ string: {
6114
+ unit: "توکي",
6115
+ verb: "ولري"
6116
+ },
6117
+ file: {
6118
+ unit: "بایټس",
6119
+ verb: "ولري"
6120
+ },
6121
+ array: {
6122
+ unit: "توکي",
6123
+ verb: "ولري"
6124
+ },
6125
+ set: {
6126
+ unit: "توکي",
6127
+ verb: "ولري"
6128
+ }
6129
+ };
6130
+ function getSizing(origin) {
6131
+ return Sizable[origin] ?? null;
6132
+ }
6133
+ const parsedType$3 = (data) => {
6134
+ const t = typeof data;
6135
+ switch (t) {
6136
+ case "number": {
6137
+ return Number.isNaN(data) ? "NaN" : "عدد";
6138
+ }
6139
+ case "object": {
6140
+ if (Array.isArray(data)) {
6141
+ return "ارې";
6142
+ }
6143
+ if (data === null) {
6144
+ return "null";
6145
+ }
6146
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
6147
+ return data.constructor.name;
6148
+ }
6149
+ }
6150
+ }
6151
+ return t;
6152
+ };
6153
+ const Nouns = {
6154
+ regex: "ورودي",
6155
+ email: "بریښنالیک",
6156
+ url: "یو آر ال",
6157
+ emoji: "ایموجي",
6158
+ uuid: "UUID",
6159
+ uuidv4: "UUIDv4",
6160
+ uuidv6: "UUIDv6",
6161
+ nanoid: "nanoid",
6162
+ guid: "GUID",
6163
+ cuid: "cuid",
6164
+ cuid2: "cuid2",
6165
+ ulid: "ULID",
6166
+ xid: "XID",
6167
+ ksuid: "KSUID",
6168
+ datetime: "نیټه او وخت",
6169
+ date: "نېټه",
6170
+ time: "وخت",
6171
+ duration: "موده",
6172
+ ipv4: "د IPv4 پته",
6173
+ ipv6: "د IPv6 پته",
6174
+ cidrv4: "د IPv4 ساحه",
6175
+ cidrv6: "د IPv6 ساحه",
6176
+ base64: "base64-encoded متن",
6177
+ base64url: "base64url-encoded متن",
6178
+ json_string: "JSON متن",
6179
+ e164: "د E.164 شمېره",
6180
+ jwt: "JWT",
6181
+ template_literal: "ورودي"
6182
+ };
6183
+ return (issue$1) => {
6184
+ switch (issue$1.code) {
6185
+ case "invalid_type": return `ناسم ورودي: باید ${issue$1.expected} وای, مګر ${parsedType$3(issue$1.input)} ترلاسه شو`;
6186
+ case "invalid_value":
6187
+ if (issue$1.values.length === 1) {
6188
+ return `ناسم ورودي: باید ${stringifyPrimitive(issue$1.values[0])} وای`;
6189
+ }
6190
+ return `ناسم انتخاب: باید یو له ${joinValues(issue$1.values, "|")} څخه وای`;
6191
+ case "too_big": {
6192
+ const adj = issue$1.inclusive ? "<=" : "<";
6193
+ const sizing = getSizing(issue$1.origin);
6194
+ if (sizing) {
6195
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
6196
+ }
6197
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} وي`;
6198
+ }
6199
+ case "too_small": {
6200
+ const adj = issue$1.inclusive ? ">=" : ">";
6201
+ const sizing = getSizing(issue$1.origin);
6202
+ if (sizing) {
6203
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} ${sizing.unit} ولري`;
6204
+ }
6205
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} وي`;
6206
+ }
6207
+ case "invalid_format": {
6208
+ const _issue = issue$1;
6209
+ if (_issue.format === "starts_with") {
6210
+ return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
6211
+ }
6212
+ if (_issue.format === "ends_with") {
6213
+ return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
6214
+ }
6215
+ if (_issue.format === "includes") {
6216
+ return `ناسم متن: باید "${_issue.includes}" ولري`;
6217
+ }
6218
+ if (_issue.format === "regex") {
6219
+ return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
6220
+ }
6221
+ return `${Nouns[_issue.format] ?? issue$1.format} ناسم دی`;
6222
+ }
6223
+ case "not_multiple_of": return `ناسم عدد: باید د ${issue$1.divisor} مضرب وي`;
6224
+ case "unrecognized_keys": return `ناسم ${issue$1.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${joinValues(issue$1.keys, ", ")}`;
6225
+ case "invalid_key": return `ناسم کلیډ په ${issue$1.origin} کې`;
6226
+ case "invalid_union": return `ناسمه ورودي`;
6227
+ case "invalid_element": return `ناسم عنصر په ${issue$1.origin} کې`;
6228
+ default: return `ناسمه ورودي`;
6229
+ }
6230
+ };
6231
+ };
6232
+ function ps_default() {
5951
6233
  return { localeError: error$13() };
5952
6234
  }
5953
6235
 
5954
6236
  //#endregion
5955
- //#region ../../node_modules/zod/dist/esm/v4/locales/pl.js
6237
+ //#region ../../node_modules/zod/v4/locales/pl.js
5956
6238
  const error$12 = () => {
5957
6239
  const Sizable = {
5958
6240
  string: {
@@ -5975,7 +6257,7 @@ const error$12 = () => {
5975
6257
  function getSizing(origin) {
5976
6258
  return Sizable[origin] ?? null;
5977
6259
  }
5978
- const parsedType$2 = (data) => {
6260
+ const parsedType$3 = (data) => {
5979
6261
  const t = typeof data;
5980
6262
  switch (t) {
5981
6263
  case "number": {
@@ -6027,7 +6309,7 @@ const error$12 = () => {
6027
6309
  };
6028
6310
  return (issue$1) => {
6029
6311
  switch (issue$1.code) {
6030
- case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$2(issue$1.input)}`;
6312
+ case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$3(issue$1.input)}`;
6031
6313
  case "invalid_value":
6032
6314
  if (issue$1.values.length === 1) return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue$1.values[0])}`;
6033
6315
  return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(issue$1.values, "|")}`;
@@ -6069,7 +6351,7 @@ function pl_default() {
6069
6351
  }
6070
6352
 
6071
6353
  //#endregion
6072
- //#region ../../node_modules/zod/dist/esm/v4/locales/pt.js
6354
+ //#region ../../node_modules/zod/v4/locales/pt.js
6073
6355
  const error$11 = () => {
6074
6356
  const Sizable = {
6075
6357
  string: {
@@ -6092,7 +6374,7 @@ const error$11 = () => {
6092
6374
  function getSizing(origin) {
6093
6375
  return Sizable[origin] ?? null;
6094
6376
  }
6095
- const parsedType$2 = (data) => {
6377
+ const parsedType$3 = (data) => {
6096
6378
  const t = typeof data;
6097
6379
  switch (t) {
6098
6380
  case "number": {
@@ -6144,7 +6426,7 @@ const error$11 = () => {
6144
6426
  };
6145
6427
  return (issue$1) => {
6146
6428
  switch (issue$1.code) {
6147
- case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$2(issue$1.input)}`;
6429
+ case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$3(issue$1.input)}`;
6148
6430
  case "invalid_value":
6149
6431
  if (issue$1.values.length === 1) return `Entrada inválida: esperado ${stringifyPrimitive(issue$1.values[0])}`;
6150
6432
  return `Opção inválida: esperada uma das ${joinValues(issue$1.values, "|")}`;
@@ -6184,7 +6466,7 @@ function pt_default() {
6184
6466
  }
6185
6467
 
6186
6468
  //#endregion
6187
- //#region ../../node_modules/zod/dist/esm/v4/locales/ru.js
6469
+ //#region ../../node_modules/zod/v4/locales/ru.js
6188
6470
  function getRussianPlural(count, one, few, many) {
6189
6471
  const absCount = Math.abs(count);
6190
6472
  const lastDigit = absCount % 10;
@@ -6238,7 +6520,7 @@ const error$10 = () => {
6238
6520
  function getSizing(origin) {
6239
6521
  return Sizable[origin] ?? null;
6240
6522
  }
6241
- const parsedType$2 = (data) => {
6523
+ const parsedType$3 = (data) => {
6242
6524
  const t = typeof data;
6243
6525
  switch (t) {
6244
6526
  case "number": {
@@ -6290,7 +6572,7 @@ const error$10 = () => {
6290
6572
  };
6291
6573
  return (issue$1) => {
6292
6574
  switch (issue$1.code) {
6293
- case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$2(issue$1.input)}`;
6575
+ case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$3(issue$1.input)}`;
6294
6576
  case "invalid_value":
6295
6577
  if (issue$1.values.length === 1) return `Неверный ввод: ожидалось ${stringifyPrimitive(issue$1.values[0])}`;
6296
6578
  return `Неверный вариант: ожидалось одно из ${joinValues(issue$1.values, "|")}`;
@@ -6336,7 +6618,7 @@ function ru_default() {
6336
6618
  }
6337
6619
 
6338
6620
  //#endregion
6339
- //#region ../../node_modules/zod/dist/esm/v4/locales/sl.js
6621
+ //#region ../../node_modules/zod/v4/locales/sl.js
6340
6622
  const error$9 = () => {
6341
6623
  const Sizable = {
6342
6624
  string: {
@@ -6359,7 +6641,7 @@ const error$9 = () => {
6359
6641
  function getSizing(origin) {
6360
6642
  return Sizable[origin] ?? null;
6361
6643
  }
6362
- const parsedType$2 = (data) => {
6644
+ const parsedType$3 = (data) => {
6363
6645
  const t = typeof data;
6364
6646
  switch (t) {
6365
6647
  case "number": {
@@ -6411,7 +6693,7 @@ const error$9 = () => {
6411
6693
  };
6412
6694
  return (issue$1) => {
6413
6695
  switch (issue$1.code) {
6414
- case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$2(issue$1.input)}`;
6696
+ case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$3(issue$1.input)}`;
6415
6697
  case "invalid_value":
6416
6698
  if (issue$1.values.length === 1) return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue$1.values[0])}`;
6417
6699
  return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue$1.values, "|")}`;
@@ -6453,7 +6735,7 @@ function sl_default() {
6453
6735
  }
6454
6736
 
6455
6737
  //#endregion
6456
- //#region ../../node_modules/zod/dist/esm/v4/locales/sv.js
6738
+ //#region ../../node_modules/zod/v4/locales/sv.js
6457
6739
  const error$8 = () => {
6458
6740
  const Sizable = {
6459
6741
  string: {
@@ -6476,7 +6758,7 @@ const error$8 = () => {
6476
6758
  function getSizing(origin) {
6477
6759
  return Sizable[origin] ?? null;
6478
6760
  }
6479
- const parsedType$2 = (data) => {
6761
+ const parsedType$3 = (data) => {
6480
6762
  const t = typeof data;
6481
6763
  switch (t) {
6482
6764
  case "number": {
@@ -6528,7 +6810,7 @@ const error$8 = () => {
6528
6810
  };
6529
6811
  return (issue$1) => {
6530
6812
  switch (issue$1.code) {
6531
- case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$2(issue$1.input)}`;
6813
+ case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$3(issue$1.input)}`;
6532
6814
  case "invalid_value":
6533
6815
  if (issue$1.values.length === 1) return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue$1.values[0])}`;
6534
6816
  return `Ogiltigt val: förväntade en av ${joinValues(issue$1.values, "|")}`;
@@ -6572,7 +6854,7 @@ function sv_default() {
6572
6854
  }
6573
6855
 
6574
6856
  //#endregion
6575
- //#region ../../node_modules/zod/dist/esm/v4/locales/ta.js
6857
+ //#region ../../node_modules/zod/v4/locales/ta.js
6576
6858
  const error$7 = () => {
6577
6859
  const Sizable = {
6578
6860
  string: {
@@ -6595,7 +6877,7 @@ const error$7 = () => {
6595
6877
  function getSizing(origin) {
6596
6878
  return Sizable[origin] ?? null;
6597
6879
  }
6598
- const parsedType$2 = (data) => {
6880
+ const parsedType$3 = (data) => {
6599
6881
  const t = typeof data;
6600
6882
  switch (t) {
6601
6883
  case "number": {
@@ -6647,7 +6929,7 @@ const error$7 = () => {
6647
6929
  };
6648
6930
  return (issue$1) => {
6649
6931
  switch (issue$1.code) {
6650
- case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$2(issue$1.input)}`;
6932
+ case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$3(issue$1.input)}`;
6651
6933
  case "invalid_value":
6652
6934
  if (issue$1.values.length === 1) return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue$1.values[0])}`;
6653
6935
  return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(issue$1.values, "|")} இல் ஒன்று`;
@@ -6689,7 +6971,7 @@ function ta_default() {
6689
6971
  }
6690
6972
 
6691
6973
  //#endregion
6692
- //#region ../../node_modules/zod/dist/esm/v4/locales/th.js
6974
+ //#region ../../node_modules/zod/v4/locales/th.js
6693
6975
  const error$6 = () => {
6694
6976
  const Sizable = {
6695
6977
  string: {
@@ -6712,7 +6994,7 @@ const error$6 = () => {
6712
6994
  function getSizing(origin) {
6713
6995
  return Sizable[origin] ?? null;
6714
6996
  }
6715
- const parsedType$2 = (data) => {
6997
+ const parsedType$3 = (data) => {
6716
6998
  const t = typeof data;
6717
6999
  switch (t) {
6718
7000
  case "number": {
@@ -6764,7 +7046,7 @@ const error$6 = () => {
6764
7046
  };
6765
7047
  return (issue$1) => {
6766
7048
  switch (issue$1.code) {
6767
- case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$2(issue$1.input)}`;
7049
+ case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$3(issue$1.input)}`;
6768
7050
  case "invalid_value":
6769
7051
  if (issue$1.values.length === 1) return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue$1.values[0])}`;
6770
7052
  return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(issue$1.values, "|")}`;
@@ -6806,7 +7088,7 @@ function th_default() {
6806
7088
  }
6807
7089
 
6808
7090
  //#endregion
6809
- //#region ../../node_modules/zod/dist/esm/v4/locales/tr.js
7091
+ //#region ../../node_modules/zod/v4/locales/tr.js
6810
7092
  const parsedType = (data) => {
6811
7093
  const t = typeof data;
6812
7094
  switch (t) {
@@ -6919,7 +7201,7 @@ function tr_default() {
6919
7201
  }
6920
7202
 
6921
7203
  //#endregion
6922
- //#region ../../node_modules/zod/dist/esm/v4/locales/ua.js
7204
+ //#region ../../node_modules/zod/v4/locales/ua.js
6923
7205
  const error$4 = () => {
6924
7206
  const Sizable = {
6925
7207
  string: {
@@ -6942,7 +7224,7 @@ const error$4 = () => {
6942
7224
  function getSizing(origin) {
6943
7225
  return Sizable[origin] ?? null;
6944
7226
  }
6945
- const parsedType$2 = (data) => {
7227
+ const parsedType$3 = (data) => {
6946
7228
  const t = typeof data;
6947
7229
  switch (t) {
6948
7230
  case "number": {
@@ -6994,7 +7276,7 @@ const error$4 = () => {
6994
7276
  };
6995
7277
  return (issue$1) => {
6996
7278
  switch (issue$1.code) {
6997
- case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$2(issue$1.input)}`;
7279
+ case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$3(issue$1.input)}`;
6998
7280
  case "invalid_value":
6999
7281
  if (issue$1.values.length === 1) return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue$1.values[0])}`;
7000
7282
  return `Неправильна опція: очікується одне з ${joinValues(issue$1.values, "|")}`;
@@ -7034,7 +7316,7 @@ function ua_default() {
7034
7316
  }
7035
7317
 
7036
7318
  //#endregion
7037
- //#region ../../node_modules/zod/dist/esm/v4/locales/ur.js
7319
+ //#region ../../node_modules/zod/v4/locales/ur.js
7038
7320
  const error$3 = () => {
7039
7321
  const Sizable = {
7040
7322
  string: {
@@ -7057,7 +7339,7 @@ const error$3 = () => {
7057
7339
  function getSizing(origin) {
7058
7340
  return Sizable[origin] ?? null;
7059
7341
  }
7060
- const parsedType$2 = (data) => {
7342
+ const parsedType$3 = (data) => {
7061
7343
  const t = typeof data;
7062
7344
  switch (t) {
7063
7345
  case "number": {
@@ -7109,7 +7391,7 @@ const error$3 = () => {
7109
7391
  };
7110
7392
  return (issue$1) => {
7111
7393
  switch (issue$1.code) {
7112
- case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$2(issue$1.input)} موصول ہوا`;
7394
+ case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$3(issue$1.input)} موصول ہوا`;
7113
7395
  case "invalid_value":
7114
7396
  if (issue$1.values.length === 1) return `غلط ان پٹ: ${stringifyPrimitive(issue$1.values[0])} متوقع تھا`;
7115
7397
  return `غلط آپشن: ${joinValues(issue$1.values, "|")} میں سے ایک متوقع تھا`;
@@ -7151,7 +7433,7 @@ function ur_default() {
7151
7433
  }
7152
7434
 
7153
7435
  //#endregion
7154
- //#region ../../node_modules/zod/dist/esm/v4/locales/vi.js
7436
+ //#region ../../node_modules/zod/v4/locales/vi.js
7155
7437
  const error$2 = () => {
7156
7438
  const Sizable = {
7157
7439
  string: {
@@ -7174,7 +7456,7 @@ const error$2 = () => {
7174
7456
  function getSizing(origin) {
7175
7457
  return Sizable[origin] ?? null;
7176
7458
  }
7177
- const parsedType$2 = (data) => {
7459
+ const parsedType$3 = (data) => {
7178
7460
  const t = typeof data;
7179
7461
  switch (t) {
7180
7462
  case "number": {
@@ -7226,7 +7508,7 @@ const error$2 = () => {
7226
7508
  };
7227
7509
  return (issue$1) => {
7228
7510
  switch (issue$1.code) {
7229
- case "invalid_type": return `Đầu vào không hợp lệ: mong đợi ${issue$1.expected}, nhận được ${parsedType$2(issue$1.input)}`;
7511
+ case "invalid_type": return `Đầu vào không hợp lệ: mong đợi ${issue$1.expected}, nhận được ${parsedType$3(issue$1.input)}`;
7230
7512
  case "invalid_value":
7231
7513
  if (issue$1.values.length === 1) return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue$1.values[0])}`;
7232
7514
  return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(issue$1.values, "|")}`;
@@ -7266,7 +7548,7 @@ function vi_default() {
7266
7548
  }
7267
7549
 
7268
7550
  //#endregion
7269
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-CN.js
7551
+ //#region ../../node_modules/zod/v4/locales/zh-CN.js
7270
7552
  const error$1 = () => {
7271
7553
  const Sizable = {
7272
7554
  string: {
@@ -7289,7 +7571,7 @@ const error$1 = () => {
7289
7571
  function getSizing(origin) {
7290
7572
  return Sizable[origin] ?? null;
7291
7573
  }
7292
- const parsedType$2 = (data) => {
7574
+ const parsedType$3 = (data) => {
7293
7575
  const t = typeof data;
7294
7576
  switch (t) {
7295
7577
  case "number": {
@@ -7341,7 +7623,7 @@ const error$1 = () => {
7341
7623
  };
7342
7624
  return (issue$1) => {
7343
7625
  switch (issue$1.code) {
7344
- case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$2(issue$1.input)}`;
7626
+ case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$3(issue$1.input)}`;
7345
7627
  case "invalid_value":
7346
7628
  if (issue$1.values.length === 1) return `无效输入:期望 ${stringifyPrimitive(issue$1.values[0])}`;
7347
7629
  return `无效选项:期望以下之一 ${joinValues(issue$1.values, "|")}`;
@@ -7381,7 +7663,7 @@ function zh_CN_default() {
7381
7663
  }
7382
7664
 
7383
7665
  //#endregion
7384
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-TW.js
7666
+ //#region ../../node_modules/zod/v4/locales/zh-TW.js
7385
7667
  const error = () => {
7386
7668
  const Sizable = {
7387
7669
  string: {
@@ -7404,7 +7686,7 @@ const error = () => {
7404
7686
  function getSizing(origin) {
7405
7687
  return Sizable[origin] ?? null;
7406
7688
  }
7407
- const parsedType$2 = (data) => {
7689
+ const parsedType$3 = (data) => {
7408
7690
  const t = typeof data;
7409
7691
  switch (t) {
7410
7692
  case "number": {
@@ -7456,7 +7738,7 @@ const error = () => {
7456
7738
  };
7457
7739
  return (issue$1) => {
7458
7740
  switch (issue$1.code) {
7459
- case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$2(issue$1.input)}`;
7741
+ case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$3(issue$1.input)}`;
7460
7742
  case "invalid_value":
7461
7743
  if (issue$1.values.length === 1) return `無效的輸入值:預期為 ${stringifyPrimitive(issue$1.values[0])}`;
7462
7744
  return `無效的選項:預期為以下其中之一 ${joinValues(issue$1.values, "|")}`;
@@ -7498,7 +7780,7 @@ function zh_TW_default() {
7498
7780
  }
7499
7781
 
7500
7782
  //#endregion
7501
- //#region ../../node_modules/zod/dist/esm/v4/locales/index.js
7783
+ //#region ../../node_modules/zod/v4/locales/index.js
7502
7784
  var locales_exports = {};
7503
7785
  __export(locales_exports, {
7504
7786
  ar: () => ar_default,
@@ -7508,6 +7790,7 @@ __export(locales_exports, {
7508
7790
  cs: () => cs_default,
7509
7791
  de: () => de_default,
7510
7792
  en: () => en_default,
7793
+ eo: () => eo_default,
7511
7794
  es: () => es_default,
7512
7795
  fa: () => fa_default,
7513
7796
  fi: () => fi_default,
@@ -7526,6 +7809,7 @@ __export(locales_exports, {
7526
7809
  no: () => no_default,
7527
7810
  ota: () => ota_default,
7528
7811
  pl: () => pl_default,
7812
+ ps: () => ps_default,
7529
7813
  pt: () => pt_default,
7530
7814
  ru: () => ru_default,
7531
7815
  sl: () => sl_default,
@@ -7541,12 +7825,12 @@ __export(locales_exports, {
7541
7825
  });
7542
7826
 
7543
7827
  //#endregion
7544
- //#region ../../node_modules/zod/dist/esm/v4/core/registries.js
7828
+ //#region ../../node_modules/zod/v4/core/registries.js
7545
7829
  const $output = Symbol("ZodOutput");
7546
7830
  const $input = Symbol("ZodInput");
7547
7831
  var $ZodRegistry = class {
7548
7832
  constructor() {
7549
- this._map = new WeakMap();
7833
+ this._map = new Map();
7550
7834
  this._idmap = new Map();
7551
7835
  }
7552
7836
  add(schema, ..._meta) {
@@ -7560,7 +7844,16 @@ var $ZodRegistry = class {
7560
7844
  }
7561
7845
  return this;
7562
7846
  }
7847
+ clear() {
7848
+ this._map = new Map();
7849
+ this._idmap = new Map();
7850
+ return this;
7851
+ }
7563
7852
  remove(schema) {
7853
+ const meta = this._map.get(schema);
7854
+ if (meta && typeof meta === "object" && "id" in meta) {
7855
+ this._idmap.delete(meta.id);
7856
+ }
7564
7857
  this._map.delete(schema);
7565
7858
  return this;
7566
7859
  }
@@ -7586,7 +7879,7 @@ function registry() {
7586
7879
  const globalRegistry = /* @__PURE__ */ registry();
7587
7880
 
7588
7881
  //#endregion
7589
- //#region ../../node_modules/zod/dist/esm/v4/core/api.js
7882
+ //#region ../../node_modules/zod/v4/core/api.js
7590
7883
  function _string(Class$1, params) {
7591
7884
  return new Class$1({
7592
7885
  type: "string",
@@ -7801,6 +8094,13 @@ function _jwt(Class$1, params) {
7801
8094
  ...normalizeParams(params)
7802
8095
  });
7803
8096
  }
8097
+ const TimePrecision = {
8098
+ Any: null,
8099
+ Minute: -1,
8100
+ Second: 0,
8101
+ Millisecond: 3,
8102
+ Microsecond: 6
8103
+ };
7804
8104
  function _isoDateTime(Class$1, params) {
7805
8105
  return new Class$1({
7806
8106
  type: "string",
@@ -8367,8 +8667,8 @@ function _refine(Class$1, fn, _params) {
8367
8667
  return schema;
8368
8668
  }
8369
8669
  function _stringbool(Classes, _params) {
8370
- const { case: _case, error: error$37, truthy, falsy } = normalizeParams(_params);
8371
- let truthyArray = truthy ?? [
8670
+ const params = normalizeParams(_params);
8671
+ let truthyArray = params.truthy ?? [
8372
8672
  "true",
8373
8673
  "1",
8374
8674
  "yes",
@@ -8376,7 +8676,7 @@ function _stringbool(Classes, _params) {
8376
8676
  "y",
8377
8677
  "enabled"
8378
8678
  ];
8379
- let falsyArray = falsy ?? [
8679
+ let falsyArray = params.falsy ?? [
8380
8680
  "false",
8381
8681
  "0",
8382
8682
  "no",
@@ -8384,7 +8684,7 @@ function _stringbool(Classes, _params) {
8384
8684
  "n",
8385
8685
  "disabled"
8386
8686
  ];
8387
- if (_case !== "sensitive") {
8687
+ if (params.case !== "sensitive") {
8388
8688
  truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8389
8689
  falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8390
8690
  }
@@ -8398,7 +8698,7 @@ function _stringbool(Classes, _params) {
8398
8698
  type: "transform",
8399
8699
  transform: (input, payload) => {
8400
8700
  let data = input;
8401
- if (_case !== "sensitive") data = data.toLowerCase();
8701
+ if (params.case !== "sensitive") data = data.toLowerCase();
8402
8702
  if (truthySet.has(data)) {
8403
8703
  return true;
8404
8704
  } else if (falsySet.has(data)) {
@@ -8414,31 +8714,47 @@ function _stringbool(Classes, _params) {
8414
8714
  return {};
8415
8715
  }
8416
8716
  },
8417
- error: error$37
8717
+ error: params.error
8418
8718
  });
8419
8719
  const innerPipe = new _Pipe({
8420
8720
  type: "pipe",
8421
8721
  in: new _String({
8422
8722
  type: "string",
8423
- error: error$37
8723
+ error: params.error
8424
8724
  }),
8425
8725
  out: tx,
8426
- error: error$37
8726
+ error: params.error
8427
8727
  });
8428
8728
  const outerPipe = new _Pipe({
8429
8729
  type: "pipe",
8430
8730
  in: innerPipe,
8431
8731
  out: new _Boolean({
8432
8732
  type: "boolean",
8433
- error: error$37
8733
+ error: params.error
8434
8734
  }),
8435
- error: error$37
8735
+ error: params.error
8436
8736
  });
8437
8737
  return outerPipe;
8438
8738
  }
8739
+ function _stringFormat(Class$1, format, fnOrRegex, _params = {}) {
8740
+ const params = normalizeParams(_params);
8741
+ const def = {
8742
+ ...normalizeParams(_params),
8743
+ check: "string_format",
8744
+ type: "string",
8745
+ format,
8746
+ fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
8747
+ ...params
8748
+ };
8749
+ if (fnOrRegex instanceof RegExp) {
8750
+ def.pattern = fnOrRegex;
8751
+ }
8752
+ const inst = new Class$1(def);
8753
+ return inst;
8754
+ }
8439
8755
 
8440
8756
  //#endregion
8441
- //#region ../../node_modules/zod/dist/esm/v4/core/function.js
8757
+ //#region ../../node_modules/zod/v4/core/function.js
8442
8758
  var $ZodFunction = class {
8443
8759
  constructor(def) {
8444
8760
  this._def = def;
@@ -8509,7 +8825,7 @@ function _function(params) {
8509
8825
  }
8510
8826
 
8511
8827
  //#endregion
8512
- //#region ../../node_modules/zod/dist/esm/v4/core/to-json-schema.js
8828
+ //#region ../../node_modules/zod/v4/core/to-json-schema.js
8513
8829
  var JSONSchemaGenerator = class {
8514
8830
  constructor(params) {
8515
8831
  this.counter = 0;
@@ -8545,431 +8861,435 @@ var JSONSchemaGenerator = class {
8545
8861
  const result = {
8546
8862
  schema: {},
8547
8863
  count: 1,
8548
- cycle: undefined
8549
- };
8550
- this.seen.set(schema, result);
8551
- if (schema._zod.toJSONSchema) {
8552
- result.schema = schema._zod.toJSONSchema();
8553
- }
8554
- const params = {
8555
- ..._params,
8556
- schemaPath: [..._params.schemaPath, schema],
8864
+ cycle: undefined,
8557
8865
  path: _params.path
8558
8866
  };
8559
- const parent = schema._zod.parent;
8560
- if (parent) {
8561
- result.ref = parent;
8562
- this.process(parent, params);
8563
- this.seen.get(parent).isParent = true;
8867
+ this.seen.set(schema, result);
8868
+ const overrideSchema = schema._zod.toJSONSchema?.();
8869
+ if (overrideSchema) {
8870
+ result.schema = overrideSchema;
8564
8871
  } else {
8565
- const _json = result.schema;
8566
- switch (def.type) {
8567
- case "string": {
8568
- const json$1 = _json;
8569
- json$1.type = "string";
8570
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8571
- if (typeof minimum === "number") json$1.minLength = minimum;
8572
- if (typeof maximum === "number") json$1.maxLength = maximum;
8573
- if (format) {
8574
- json$1.format = formatMap[format] ?? format;
8575
- if (json$1.format === "") delete json$1.format;
8872
+ const params = {
8873
+ ..._params,
8874
+ schemaPath: [..._params.schemaPath, schema],
8875
+ path: _params.path
8876
+ };
8877
+ const parent = schema._zod.parent;
8878
+ if (parent) {
8879
+ result.ref = parent;
8880
+ this.process(parent, params);
8881
+ this.seen.get(parent).isParent = true;
8882
+ } else {
8883
+ const _json = result.schema;
8884
+ switch (def.type) {
8885
+ case "string": {
8886
+ const json$1 = _json;
8887
+ json$1.type = "string";
8888
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8889
+ if (typeof minimum === "number") json$1.minLength = minimum;
8890
+ if (typeof maximum === "number") json$1.maxLength = maximum;
8891
+ if (format) {
8892
+ json$1.format = formatMap[format] ?? format;
8893
+ if (json$1.format === "") delete json$1.format;
8894
+ }
8895
+ if (contentEncoding) json$1.contentEncoding = contentEncoding;
8896
+ if (patterns && patterns.size > 0) {
8897
+ const regexes = [...patterns];
8898
+ if (regexes.length === 1) json$1.pattern = regexes[0].source;
8899
+ else if (regexes.length > 1) {
8900
+ result.schema.allOf = [...regexes.map((regex) => ({
8901
+ ...this.target === "draft-7" ? { type: "string" } : {},
8902
+ pattern: regex.source
8903
+ }))];
8904
+ }
8905
+ }
8906
+ break;
8576
8907
  }
8577
- if (contentEncoding) json$1.contentEncoding = contentEncoding;
8578
- if (patterns && patterns.size > 0) {
8579
- const regexes = [...patterns];
8580
- if (regexes.length === 1) json$1.pattern = regexes[0].source;
8581
- else if (regexes.length > 1) {
8582
- result.schema.allOf = [...regexes.map((regex) => ({
8583
- ...this.target === "draft-7" ? { type: "string" } : {},
8584
- pattern: regex.source
8585
- }))];
8908
+ case "number": {
8909
+ const json$1 = _json;
8910
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8911
+ if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8912
+ else json$1.type = "number";
8913
+ if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8914
+ if (typeof minimum === "number") {
8915
+ json$1.minimum = minimum;
8916
+ if (typeof exclusiveMinimum === "number") {
8917
+ if (exclusiveMinimum >= minimum) delete json$1.minimum;
8918
+ else delete json$1.exclusiveMinimum;
8919
+ }
8586
8920
  }
8921
+ if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8922
+ if (typeof maximum === "number") {
8923
+ json$1.maximum = maximum;
8924
+ if (typeof exclusiveMaximum === "number") {
8925
+ if (exclusiveMaximum <= maximum) delete json$1.maximum;
8926
+ else delete json$1.exclusiveMaximum;
8927
+ }
8928
+ }
8929
+ if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8930
+ break;
8587
8931
  }
8588
- break;
8589
- }
8590
- case "number": {
8591
- const json$1 = _json;
8592
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8593
- if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8594
- else json$1.type = "number";
8595
- if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8596
- if (typeof minimum === "number") {
8597
- json$1.minimum = minimum;
8598
- if (typeof exclusiveMinimum === "number") {
8599
- if (exclusiveMinimum >= minimum) delete json$1.minimum;
8600
- else delete json$1.exclusiveMinimum;
8932
+ case "boolean": {
8933
+ const json$1 = _json;
8934
+ json$1.type = "boolean";
8935
+ break;
8936
+ }
8937
+ case "bigint": {
8938
+ if (this.unrepresentable === "throw") {
8939
+ throw new Error("BigInt cannot be represented in JSON Schema");
8601
8940
  }
8941
+ break;
8602
8942
  }
8603
- if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8604
- if (typeof maximum === "number") {
8605
- json$1.maximum = maximum;
8606
- if (typeof exclusiveMaximum === "number") {
8607
- if (exclusiveMaximum <= maximum) delete json$1.maximum;
8608
- else delete json$1.exclusiveMaximum;
8943
+ case "symbol": {
8944
+ if (this.unrepresentable === "throw") {
8945
+ throw new Error("Symbols cannot be represented in JSON Schema");
8609
8946
  }
8947
+ break;
8610
8948
  }
8611
- if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8612
- break;
8613
- }
8614
- case "boolean": {
8615
- const json$1 = _json;
8616
- json$1.type = "boolean";
8617
- break;
8618
- }
8619
- case "bigint": {
8620
- if (this.unrepresentable === "throw") {
8621
- throw new Error("BigInt cannot be represented in JSON Schema");
8949
+ case "null": {
8950
+ _json.type = "null";
8951
+ break;
8622
8952
  }
8623
- break;
8624
- }
8625
- case "symbol": {
8626
- if (this.unrepresentable === "throw") {
8627
- throw new Error("Symbols cannot be represented in JSON Schema");
8953
+ case "any": {
8954
+ break;
8628
8955
  }
8629
- break;
8630
- }
8631
- case "undefined": {
8632
- const json$1 = _json;
8633
- json$1.type = "null";
8634
- break;
8635
- }
8636
- case "null": {
8637
- _json.type = "null";
8638
- break;
8639
- }
8640
- case "any": {
8641
- break;
8642
- }
8643
- case "unknown": {
8644
- break;
8645
- }
8646
- case "never": {
8647
- _json.not = {};
8648
- break;
8649
- }
8650
- case "void": {
8651
- if (this.unrepresentable === "throw") {
8652
- throw new Error("Void cannot be represented in JSON Schema");
8956
+ case "unknown": {
8957
+ break;
8653
8958
  }
8654
- break;
8655
- }
8656
- case "date": {
8657
- if (this.unrepresentable === "throw") {
8658
- throw new Error("Date cannot be represented in JSON Schema");
8959
+ case "undefined": {
8960
+ if (this.unrepresentable === "throw") {
8961
+ throw new Error("Undefined cannot be represented in JSON Schema");
8962
+ }
8963
+ break;
8659
8964
  }
8660
- break;
8661
- }
8662
- case "array": {
8663
- const json$1 = _json;
8664
- const { minimum, maximum } = schema._zod.bag;
8665
- if (typeof minimum === "number") json$1.minItems = minimum;
8666
- if (typeof maximum === "number") json$1.maxItems = maximum;
8667
- json$1.type = "array";
8668
- json$1.items = this.process(def.element, {
8669
- ...params,
8670
- path: [...params.path, "items"]
8671
- });
8672
- break;
8673
- }
8674
- case "object": {
8675
- const json$1 = _json;
8676
- json$1.type = "object";
8677
- json$1.properties = {};
8678
- const shape = def.shape;
8679
- for (const key in shape) {
8680
- json$1.properties[key] = this.process(shape[key], {
8681
- ...params,
8682
- path: [
8683
- ...params.path,
8684
- "properties",
8685
- key
8686
- ]
8687
- });
8965
+ case "void": {
8966
+ if (this.unrepresentable === "throw") {
8967
+ throw new Error("Void cannot be represented in JSON Schema");
8968
+ }
8969
+ break;
8688
8970
  }
8689
- const allKeys = new Set(Object.keys(shape));
8690
- const requiredKeys = new Set([...allKeys].filter((key) => {
8691
- const v = def.shape[key]._zod;
8692
- if (this.io === "input") {
8693
- return v.optin === undefined;
8694
- } else {
8695
- return v.optout === undefined;
8971
+ case "never": {
8972
+ _json.not = {};
8973
+ break;
8974
+ }
8975
+ case "date": {
8976
+ if (this.unrepresentable === "throw") {
8977
+ throw new Error("Date cannot be represented in JSON Schema");
8696
8978
  }
8697
- }));
8698
- if (requiredKeys.size > 0) {
8699
- json$1.required = Array.from(requiredKeys);
8979
+ break;
8700
8980
  }
8701
- if (def.catchall?._zod.def.type === "never") {
8702
- json$1.additionalProperties = false;
8703
- } else if (!def.catchall) {
8704
- if (this.io === "output") json$1.additionalProperties = false;
8705
- } else if (def.catchall) {
8706
- json$1.additionalProperties = this.process(def.catchall, {
8981
+ case "array": {
8982
+ const json$1 = _json;
8983
+ const { minimum, maximum } = schema._zod.bag;
8984
+ if (typeof minimum === "number") json$1.minItems = minimum;
8985
+ if (typeof maximum === "number") json$1.maxItems = maximum;
8986
+ json$1.type = "array";
8987
+ json$1.items = this.process(def.element, {
8707
8988
  ...params,
8708
- path: [...params.path, "additionalProperties"]
8989
+ path: [...params.path, "items"]
8709
8990
  });
8991
+ break;
8710
8992
  }
8711
- break;
8712
- }
8713
- case "union": {
8714
- const json$1 = _json;
8715
- json$1.anyOf = def.options.map((x, i) => this.process(x, {
8716
- ...params,
8717
- path: [
8718
- ...params.path,
8719
- "anyOf",
8720
- i
8721
- ]
8722
- }));
8723
- break;
8724
- }
8725
- case "intersection": {
8726
- const json$1 = _json;
8727
- const a = this.process(def.left, {
8728
- ...params,
8729
- path: [
8730
- ...params.path,
8731
- "allOf",
8732
- 0
8733
- ]
8734
- });
8735
- const b = this.process(def.right, {
8736
- ...params,
8737
- path: [
8738
- ...params.path,
8739
- "allOf",
8740
- 1
8741
- ]
8742
- });
8743
- const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
8744
- const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
8745
- json$1.allOf = allOf;
8746
- break;
8747
- }
8748
- case "tuple": {
8749
- const json$1 = _json;
8750
- json$1.type = "array";
8751
- const prefixItems = def.items.map((x, i) => this.process(x, {
8752
- ...params,
8753
- path: [
8754
- ...params.path,
8755
- "prefixItems",
8756
- i
8757
- ]
8758
- }));
8759
- if (this.target === "draft-2020-12") {
8760
- json$1.prefixItems = prefixItems;
8761
- } else {
8762
- json$1.items = prefixItems;
8993
+ case "object": {
8994
+ const json$1 = _json;
8995
+ json$1.type = "object";
8996
+ json$1.properties = {};
8997
+ const shape = def.shape;
8998
+ for (const key in shape) {
8999
+ json$1.properties[key] = this.process(shape[key], {
9000
+ ...params,
9001
+ path: [
9002
+ ...params.path,
9003
+ "properties",
9004
+ key
9005
+ ]
9006
+ });
9007
+ }
9008
+ const allKeys = new Set(Object.keys(shape));
9009
+ const requiredKeys = new Set([...allKeys].filter((key) => {
9010
+ const v = def.shape[key]._zod;
9011
+ if (this.io === "input") {
9012
+ return v.optin === undefined;
9013
+ } else {
9014
+ return v.optout === undefined;
9015
+ }
9016
+ }));
9017
+ if (requiredKeys.size > 0) {
9018
+ json$1.required = Array.from(requiredKeys);
9019
+ }
9020
+ if (def.catchall?._zod.def.type === "never") {
9021
+ json$1.additionalProperties = false;
9022
+ } else if (!def.catchall) {
9023
+ if (this.io === "output") json$1.additionalProperties = false;
9024
+ } else if (def.catchall) {
9025
+ json$1.additionalProperties = this.process(def.catchall, {
9026
+ ...params,
9027
+ path: [...params.path, "additionalProperties"]
9028
+ });
9029
+ }
9030
+ break;
8763
9031
  }
8764
- if (def.rest) {
8765
- const rest = this.process(def.rest, {
9032
+ case "union": {
9033
+ const json$1 = _json;
9034
+ json$1.anyOf = def.options.map((x, i) => this.process(x, {
8766
9035
  ...params,
8767
- path: [...params.path, "items"]
9036
+ path: [
9037
+ ...params.path,
9038
+ "anyOf",
9039
+ i
9040
+ ]
9041
+ }));
9042
+ break;
9043
+ }
9044
+ case "intersection": {
9045
+ const json$1 = _json;
9046
+ const a = this.process(def.left, {
9047
+ ...params,
9048
+ path: [
9049
+ ...params.path,
9050
+ "allOf",
9051
+ 0
9052
+ ]
9053
+ });
9054
+ const b = this.process(def.right, {
9055
+ ...params,
9056
+ path: [
9057
+ ...params.path,
9058
+ "allOf",
9059
+ 1
9060
+ ]
8768
9061
  });
9062
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
9063
+ const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
9064
+ json$1.allOf = allOf;
9065
+ break;
9066
+ }
9067
+ case "tuple": {
9068
+ const json$1 = _json;
9069
+ json$1.type = "array";
9070
+ const prefixItems = def.items.map((x, i) => this.process(x, {
9071
+ ...params,
9072
+ path: [
9073
+ ...params.path,
9074
+ "prefixItems",
9075
+ i
9076
+ ]
9077
+ }));
8769
9078
  if (this.target === "draft-2020-12") {
8770
- json$1.items = rest;
9079
+ json$1.prefixItems = prefixItems;
8771
9080
  } else {
8772
- json$1.additionalItems = rest;
9081
+ json$1.items = prefixItems;
9082
+ }
9083
+ if (def.rest) {
9084
+ const rest = this.process(def.rest, {
9085
+ ...params,
9086
+ path: [...params.path, "items"]
9087
+ });
9088
+ if (this.target === "draft-2020-12") {
9089
+ json$1.items = rest;
9090
+ } else {
9091
+ json$1.additionalItems = rest;
9092
+ }
8773
9093
  }
9094
+ if (def.rest) {
9095
+ json$1.items = this.process(def.rest, {
9096
+ ...params,
9097
+ path: [...params.path, "items"]
9098
+ });
9099
+ }
9100
+ const { minimum, maximum } = schema._zod.bag;
9101
+ if (typeof minimum === "number") json$1.minItems = minimum;
9102
+ if (typeof maximum === "number") json$1.maxItems = maximum;
9103
+ break;
8774
9104
  }
8775
- if (def.rest) {
8776
- json$1.items = this.process(def.rest, {
9105
+ case "record": {
9106
+ const json$1 = _json;
9107
+ json$1.type = "object";
9108
+ json$1.propertyNames = this.process(def.keyType, {
8777
9109
  ...params,
8778
- path: [...params.path, "items"]
9110
+ path: [...params.path, "propertyNames"]
8779
9111
  });
9112
+ json$1.additionalProperties = this.process(def.valueType, {
9113
+ ...params,
9114
+ path: [...params.path, "additionalProperties"]
9115
+ });
9116
+ break;
8780
9117
  }
8781
- const { minimum, maximum } = schema._zod.bag;
8782
- if (typeof minimum === "number") json$1.minItems = minimum;
8783
- if (typeof maximum === "number") json$1.maxItems = maximum;
8784
- break;
8785
- }
8786
- case "record": {
8787
- const json$1 = _json;
8788
- json$1.type = "object";
8789
- json$1.propertyNames = this.process(def.keyType, {
8790
- ...params,
8791
- path: [...params.path, "propertyNames"]
8792
- });
8793
- json$1.additionalProperties = this.process(def.valueType, {
8794
- ...params,
8795
- path: [...params.path, "additionalProperties"]
8796
- });
8797
- break;
8798
- }
8799
- case "map": {
8800
- if (this.unrepresentable === "throw") {
8801
- throw new Error("Map cannot be represented in JSON Schema");
9118
+ case "map": {
9119
+ if (this.unrepresentable === "throw") {
9120
+ throw new Error("Map cannot be represented in JSON Schema");
9121
+ }
9122
+ break;
8802
9123
  }
8803
- break;
8804
- }
8805
- case "set": {
8806
- if (this.unrepresentable === "throw") {
8807
- throw new Error("Set cannot be represented in JSON Schema");
9124
+ case "set": {
9125
+ if (this.unrepresentable === "throw") {
9126
+ throw new Error("Set cannot be represented in JSON Schema");
9127
+ }
9128
+ break;
9129
+ }
9130
+ case "enum": {
9131
+ const json$1 = _json;
9132
+ const values = getEnumValues(def.entries);
9133
+ if (values.every((v) => typeof v === "number")) json$1.type = "number";
9134
+ if (values.every((v) => typeof v === "string")) json$1.type = "string";
9135
+ json$1.enum = values;
9136
+ break;
8808
9137
  }
8809
- break;
8810
- }
8811
- case "enum": {
8812
- const json$1 = _json;
8813
- const values = getEnumValues(def.entries);
8814
- if (values.every((v) => typeof v === "number")) json$1.type = "number";
8815
- if (values.every((v) => typeof v === "string")) json$1.type = "string";
8816
- json$1.enum = values;
8817
- break;
8818
- }
8819
- case "literal": {
8820
- const json$1 = _json;
8821
- const vals = [];
8822
- for (const val of def.values) {
8823
- if (val === undefined) {
8824
- if (this.unrepresentable === "throw") {
8825
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
8826
- } else {}
8827
- } else if (typeof val === "bigint") {
8828
- if (this.unrepresentable === "throw") {
8829
- throw new Error("BigInt literals cannot be represented in JSON Schema");
9138
+ case "literal": {
9139
+ const json$1 = _json;
9140
+ const vals = [];
9141
+ for (const val of def.values) {
9142
+ if (val === undefined) {
9143
+ if (this.unrepresentable === "throw") {
9144
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
9145
+ } else {}
9146
+ } else if (typeof val === "bigint") {
9147
+ if (this.unrepresentable === "throw") {
9148
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
9149
+ } else {
9150
+ vals.push(Number(val));
9151
+ }
8830
9152
  } else {
8831
- vals.push(Number(val));
9153
+ vals.push(val);
8832
9154
  }
9155
+ }
9156
+ if (vals.length === 0) {} else if (vals.length === 1) {
9157
+ const val = vals[0];
9158
+ json$1.type = val === null ? "null" : typeof val;
9159
+ json$1.const = val;
8833
9160
  } else {
8834
- vals.push(val);
9161
+ if (vals.every((v) => typeof v === "number")) json$1.type = "number";
9162
+ if (vals.every((v) => typeof v === "string")) json$1.type = "string";
9163
+ if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
9164
+ if (vals.every((v) => v === null)) json$1.type = "null";
9165
+ json$1.enum = vals;
8835
9166
  }
9167
+ break;
8836
9168
  }
8837
- if (vals.length === 0) {} else if (vals.length === 1) {
8838
- const val = vals[0];
8839
- json$1.type = val === null ? "null" : typeof val;
8840
- json$1.const = val;
8841
- } else {
8842
- if (vals.every((v) => typeof v === "number")) json$1.type = "number";
8843
- if (vals.every((v) => typeof v === "string")) json$1.type = "string";
8844
- if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
8845
- if (vals.every((v) => v === null)) json$1.type = "null";
8846
- json$1.enum = vals;
8847
- }
8848
- break;
8849
- }
8850
- case "file": {
8851
- const json$1 = _json;
8852
- const file$1 = {
8853
- type: "string",
8854
- format: "binary",
8855
- contentEncoding: "binary"
8856
- };
8857
- const { minimum, maximum, mime } = schema._zod.bag;
8858
- if (minimum !== undefined) file$1.minLength = minimum;
8859
- if (maximum !== undefined) file$1.maxLength = maximum;
8860
- if (mime) {
8861
- if (mime.length === 1) {
8862
- file$1.contentMediaType = mime[0];
8863
- Object.assign(json$1, file$1);
9169
+ case "file": {
9170
+ const json$1 = _json;
9171
+ const file$1 = {
9172
+ type: "string",
9173
+ format: "binary",
9174
+ contentEncoding: "binary"
9175
+ };
9176
+ const { minimum, maximum, mime } = schema._zod.bag;
9177
+ if (minimum !== undefined) file$1.minLength = minimum;
9178
+ if (maximum !== undefined) file$1.maxLength = maximum;
9179
+ if (mime) {
9180
+ if (mime.length === 1) {
9181
+ file$1.contentMediaType = mime[0];
9182
+ Object.assign(json$1, file$1);
9183
+ } else {
9184
+ json$1.anyOf = mime.map((m) => {
9185
+ const mFile = {
9186
+ ...file$1,
9187
+ contentMediaType: m
9188
+ };
9189
+ return mFile;
9190
+ });
9191
+ }
8864
9192
  } else {
8865
- json$1.anyOf = mime.map((m) => {
8866
- const mFile = {
8867
- ...file$1,
8868
- contentMediaType: m
8869
- };
8870
- return mFile;
8871
- });
9193
+ Object.assign(json$1, file$1);
8872
9194
  }
8873
- } else {
8874
- Object.assign(json$1, file$1);
9195
+ break;
8875
9196
  }
8876
- break;
8877
- }
8878
- case "transform": {
8879
- if (this.unrepresentable === "throw") {
8880
- throw new Error("Transforms cannot be represented in JSON Schema");
9197
+ case "transform": {
9198
+ if (this.unrepresentable === "throw") {
9199
+ throw new Error("Transforms cannot be represented in JSON Schema");
9200
+ }
9201
+ break;
8881
9202
  }
8882
- break;
8883
- }
8884
- case "nullable": {
8885
- const inner = this.process(def.innerType, params);
8886
- _json.anyOf = [inner, { type: "null" }];
8887
- break;
8888
- }
8889
- case "nonoptional": {
8890
- this.process(def.innerType, params);
8891
- result.ref = def.innerType;
8892
- break;
8893
- }
8894
- case "success": {
8895
- const json$1 = _json;
8896
- json$1.type = "boolean";
8897
- break;
8898
- }
8899
- case "default": {
8900
- this.process(def.innerType, params);
8901
- result.ref = def.innerType;
8902
- _json.default = def.defaultValue;
8903
- break;
8904
- }
8905
- case "prefault": {
8906
- this.process(def.innerType, params);
8907
- result.ref = def.innerType;
8908
- if (this.io === "input") _json._prefault = def.defaultValue;
8909
- break;
8910
- }
8911
- case "catch": {
8912
- this.process(def.innerType, params);
8913
- result.ref = def.innerType;
8914
- let catchValue;
8915
- try {
8916
- catchValue = def.catchValue(undefined);
8917
- } catch {
8918
- throw new Error("Dynamic catch values are not supported in JSON Schema");
9203
+ case "nullable": {
9204
+ const inner = this.process(def.innerType, params);
9205
+ _json.anyOf = [inner, { type: "null" }];
9206
+ break;
8919
9207
  }
8920
- _json.default = catchValue;
8921
- break;
8922
- }
8923
- case "nan": {
8924
- if (this.unrepresentable === "throw") {
8925
- throw new Error("NaN cannot be represented in JSON Schema");
9208
+ case "nonoptional": {
9209
+ this.process(def.innerType, params);
9210
+ result.ref = def.innerType;
9211
+ break;
8926
9212
  }
8927
- break;
8928
- }
8929
- case "template_literal": {
8930
- const json$1 = _json;
8931
- const pattern = schema._zod.pattern;
8932
- if (!pattern) throw new Error("Pattern not found in template literal");
8933
- json$1.type = "string";
8934
- json$1.pattern = pattern.source;
8935
- break;
8936
- }
8937
- case "pipe": {
8938
- const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
8939
- this.process(innerType, params);
8940
- result.ref = innerType;
8941
- break;
8942
- }
8943
- case "readonly": {
8944
- this.process(def.innerType, params);
8945
- result.ref = def.innerType;
8946
- _json.readOnly = true;
8947
- break;
8948
- }
8949
- case "promise": {
8950
- this.process(def.innerType, params);
8951
- result.ref = def.innerType;
8952
- break;
8953
- }
8954
- case "optional": {
8955
- this.process(def.innerType, params);
8956
- result.ref = def.innerType;
8957
- break;
8958
- }
8959
- case "lazy": {
8960
- const innerType = schema._zod.innerType;
8961
- this.process(innerType, params);
8962
- result.ref = innerType;
8963
- break;
8964
- }
8965
- case "custom": {
8966
- if (this.unrepresentable === "throw") {
8967
- throw new Error("Custom types cannot be represented in JSON Schema");
9213
+ case "success": {
9214
+ const json$1 = _json;
9215
+ json$1.type = "boolean";
9216
+ break;
9217
+ }
9218
+ case "default": {
9219
+ this.process(def.innerType, params);
9220
+ result.ref = def.innerType;
9221
+ _json.default = JSON.parse(JSON.stringify(def.defaultValue));
9222
+ break;
9223
+ }
9224
+ case "prefault": {
9225
+ this.process(def.innerType, params);
9226
+ result.ref = def.innerType;
9227
+ if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
9228
+ break;
9229
+ }
9230
+ case "catch": {
9231
+ this.process(def.innerType, params);
9232
+ result.ref = def.innerType;
9233
+ let catchValue;
9234
+ try {
9235
+ catchValue = def.catchValue(undefined);
9236
+ } catch {
9237
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
9238
+ }
9239
+ _json.default = catchValue;
9240
+ break;
9241
+ }
9242
+ case "nan": {
9243
+ if (this.unrepresentable === "throw") {
9244
+ throw new Error("NaN cannot be represented in JSON Schema");
9245
+ }
9246
+ break;
9247
+ }
9248
+ case "template_literal": {
9249
+ const json$1 = _json;
9250
+ const pattern = schema._zod.pattern;
9251
+ if (!pattern) throw new Error("Pattern not found in template literal");
9252
+ json$1.type = "string";
9253
+ json$1.pattern = pattern.source;
9254
+ break;
9255
+ }
9256
+ case "pipe": {
9257
+ const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
9258
+ this.process(innerType, params);
9259
+ result.ref = innerType;
9260
+ break;
9261
+ }
9262
+ case "readonly": {
9263
+ this.process(def.innerType, params);
9264
+ result.ref = def.innerType;
9265
+ _json.readOnly = true;
9266
+ break;
9267
+ }
9268
+ case "promise": {
9269
+ this.process(def.innerType, params);
9270
+ result.ref = def.innerType;
9271
+ break;
9272
+ }
9273
+ case "optional": {
9274
+ this.process(def.innerType, params);
9275
+ result.ref = def.innerType;
9276
+ break;
9277
+ }
9278
+ case "lazy": {
9279
+ const innerType = schema._zod.innerType;
9280
+ this.process(innerType, params);
9281
+ result.ref = innerType;
9282
+ break;
9283
+ }
9284
+ case "custom": {
9285
+ if (this.unrepresentable === "throw") {
9286
+ throw new Error("Custom types cannot be represented in JSON Schema");
9287
+ }
9288
+ break;
9289
+ }
9290
+ default: {
9291
+ def;
8968
9292
  }
8969
- break;
8970
- }
8971
- default: {
8972
- def;
8973
9293
  }
8974
9294
  }
8975
9295
  }
@@ -8996,12 +9316,15 @@ var JSONSchemaGenerator = class {
8996
9316
  const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
8997
9317
  if (params.external) {
8998
9318
  const externalId = params.external.registry.get(entry[0])?.id;
8999
- if (externalId) return { ref: params.external.uri(externalId) };
9319
+ const uriGenerator = params.external.uri ?? ((id$1) => id$1);
9320
+ if (externalId) {
9321
+ return { ref: uriGenerator(externalId) };
9322
+ }
9000
9323
  const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
9001
9324
  entry[1].defId = id;
9002
9325
  return {
9003
9326
  defId: id,
9004
- ref: `${params.external.uri("__shared")}#/${defsSegment}/${id}`
9327
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
9005
9328
  };
9006
9329
  }
9007
9330
  if (entry[1] === root) {
@@ -9029,6 +9352,14 @@ var JSONSchemaGenerator = class {
9029
9352
  }
9030
9353
  schema$1.$ref = ref;
9031
9354
  };
9355
+ if (params.cycles === "throw") {
9356
+ for (const entry of this.seen.entries()) {
9357
+ const seen = entry[1];
9358
+ if (seen.cycle) {
9359
+ throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9360
+ }
9361
+ }
9362
+ }
9032
9363
  for (const entry of this.seen.entries()) {
9033
9364
  const seen = entry[1];
9034
9365
  if (schema === entry[0]) {
@@ -9048,11 +9379,7 @@ var JSONSchemaGenerator = class {
9048
9379
  continue;
9049
9380
  }
9050
9381
  if (seen.cycle) {
9051
- if (params.cycles === "throw") {
9052
- throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9053
- } else if (params.cycles === "ref") {
9054
- extractToDef(entry);
9055
- }
9382
+ extractToDef(entry);
9056
9383
  continue;
9057
9384
  }
9058
9385
  if (seen.count > 1) {
@@ -9084,7 +9411,8 @@ var JSONSchemaGenerator = class {
9084
9411
  }
9085
9412
  if (!seen.isParent) this.override({
9086
9413
  zodSchema,
9087
- jsonSchema: schema$1
9414
+ jsonSchema: schema$1,
9415
+ path: seen.path ?? []
9088
9416
  });
9089
9417
  };
9090
9418
  for (const entry of [...this.seen.entries()].reverse()) {
@@ -9098,6 +9426,11 @@ var JSONSchemaGenerator = class {
9098
9426
  } else {
9099
9427
  console.warn(`Invalid target: ${this.target}`);
9100
9428
  }
9429
+ if (params.external?.uri) {
9430
+ const id = params.external.registry.get(schema)?.id;
9431
+ if (!id) throw new Error("Schema is missing an `id` property");
9432
+ result.$id = params.external.uri(id);
9433
+ }
9101
9434
  Object.assign(result, root.def);
9102
9435
  const defs = params.external?.defs ?? {};
9103
9436
  for (const entry of this.seen.entries()) {
@@ -9106,11 +9439,13 @@ var JSONSchemaGenerator = class {
9106
9439
  defs[seen.defId] = seen.def;
9107
9440
  }
9108
9441
  }
9109
- if (!params.external && Object.keys(defs).length > 0) {
9110
- if (this.target === "draft-2020-12") {
9111
- result.$defs = defs;
9112
- } else {
9113
- result.definitions = defs;
9442
+ if (params.external) {} else {
9443
+ if (Object.keys(defs).length > 0) {
9444
+ if (this.target === "draft-2020-12") {
9445
+ result.$defs = defs;
9446
+ } else {
9447
+ result.definitions = defs;
9448
+ }
9114
9449
  }
9115
9450
  }
9116
9451
  try {
@@ -9131,7 +9466,7 @@ function toJSONSchema(input, _params) {
9131
9466
  const schemas = {};
9132
9467
  const external = {
9133
9468
  registry: input,
9134
- uri: _params?.uri || ((id) => id),
9469
+ uri: _params?.uri,
9135
9470
  defs
9136
9471
  };
9137
9472
  for (const entry of input._idmap.entries()) {
@@ -9242,11 +9577,11 @@ function isTransforming(_schema, _ctx) {
9242
9577
  }
9243
9578
 
9244
9579
  //#endregion
9245
- //#region ../../node_modules/zod/dist/esm/v4/core/json-schema.js
9580
+ //#region ../../node_modules/zod/v4/core/json-schema.js
9246
9581
  var json_schema_exports = {};
9247
9582
 
9248
9583
  //#endregion
9249
- //#region ../../node_modules/zod/dist/esm/v4/core/index.js
9584
+ //#region ../../node_modules/zod/v4/core/index.js
9250
9585
  var core_exports = {};
9251
9586
  __export(core_exports, {
9252
9587
  $ZodAny: () => $ZodAny,
@@ -9285,6 +9620,7 @@ __export(core_exports, {
9285
9620
  $ZodCheckStringFormat: () => $ZodCheckStringFormat,
9286
9621
  $ZodCheckUpperCase: () => $ZodCheckUpperCase,
9287
9622
  $ZodCustom: () => $ZodCustom,
9623
+ $ZodCustomStringFormat: () => $ZodCustomStringFormat,
9288
9624
  $ZodDate: () => $ZodDate,
9289
9625
  $ZodDefault: () => $ZodDefault,
9290
9626
  $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion,
@@ -9349,6 +9685,8 @@ __export(core_exports, {
9349
9685
  Doc: () => Doc,
9350
9686
  JSONSchema: () => json_schema_exports,
9351
9687
  JSONSchemaGenerator: () => JSONSchemaGenerator,
9688
+ NEVER: () => NEVER,
9689
+ TimePrecision: () => TimePrecision,
9352
9690
  _any: () => _any,
9353
9691
  _array: () => _array,
9354
9692
  _base64: () => _base64,
@@ -9438,6 +9776,7 @@ __export(core_exports, {
9438
9776
  _size: () => _size,
9439
9777
  _startsWith: () => _startsWith,
9440
9778
  _string: () => _string,
9779
+ _stringFormat: () => _stringFormat,
9441
9780
  _stringbool: () => _stringbool,
9442
9781
  _success: () => _success,
9443
9782
  _symbol: () => _symbol,
@@ -9487,7 +9826,7 @@ __export(core_exports, {
9487
9826
  });
9488
9827
 
9489
9828
  //#endregion
9490
- //#region ../../node_modules/zod/dist/esm/v4/classic/iso.js
9829
+ //#region ../../node_modules/zod/v4/classic/iso.js
9491
9830
  var iso_exports = {};
9492
9831
  __export(iso_exports, {
9493
9832
  ZodISODate: () => ZodISODate,
@@ -9529,7 +9868,7 @@ function duration(params) {
9529
9868
  }
9530
9869
 
9531
9870
  //#endregion
9532
- //#region ../../node_modules/zod/dist/esm/v4/classic/errors.js
9871
+ //#region ../../node_modules/zod/v4/classic/errors.js
9533
9872
  const initializer = (inst, issues) => {
9534
9873
  $ZodError.init(inst, issues);
9535
9874
  inst.name = "ZodError";
@@ -9547,14 +9886,14 @@ const ZodError = $constructor("ZodError", initializer);
9547
9886
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
9548
9887
 
9549
9888
  //#endregion
9550
- //#region ../../node_modules/zod/dist/esm/v4/classic/parse.js
9889
+ //#region ../../node_modules/zod/v4/classic/parse.js
9551
9890
  const parse = /* @__PURE__ */ _parse(ZodRealError);
9552
9891
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
9553
9892
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
9554
9893
  const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
9555
9894
 
9556
9895
  //#endregion
9557
- //#region ../../node_modules/zod/dist/esm/v4/classic/schemas.js
9896
+ //#region ../../node_modules/zod/v4/classic/schemas.js
9558
9897
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
9559
9898
  $ZodType.init(inst, def);
9560
9899
  inst.def = def;
@@ -9822,6 +10161,13 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
9822
10161
  function jwt(params) {
9823
10162
  return _jwt(ZodJWT, params);
9824
10163
  }
10164
+ const ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
10165
+ $ZodCustomStringFormat.init(inst, def);
10166
+ ZodStringFormat.init(inst, def);
10167
+ });
10168
+ function stringFormat(format, fnOrRegex, _params = {}) {
10169
+ return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
10170
+ }
9825
10171
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
9826
10172
  $ZodNumber.init(inst, def);
9827
10173
  ZodType.init(inst, def);
@@ -9991,9 +10337,7 @@ function keyof(schema) {
9991
10337
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
9992
10338
  $ZodObject.init(inst, def);
9993
10339
  ZodType.init(inst, def);
9994
- defineLazy(inst, "shape", () => {
9995
- return Object.fromEntries(Object.entries(inst._zod.def.shape));
9996
- });
10340
+ defineLazy(inst, "shape", () => def.shape);
9997
10341
  inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
9998
10342
  inst.catchall = (catchall) => inst.clone({
9999
10343
  ...inst._zod.def,
@@ -10438,11 +10782,8 @@ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
10438
10782
  $ZodCustom.init(inst, def);
10439
10783
  ZodType.init(inst, def);
10440
10784
  });
10441
- function check(fn, params) {
10442
- const ch = new $ZodCheck({
10443
- check: "custom",
10444
- ...normalizeParams(params)
10445
- });
10785
+ function check(fn) {
10786
+ const ch = new $ZodCheck({ check: "custom" });
10446
10787
  ch._zod.check = fn;
10447
10788
  return ch;
10448
10789
  }
@@ -10452,7 +10793,7 @@ function custom(fn, _params) {
10452
10793
  function refine(fn, _params = {}) {
10453
10794
  return _refine(ZodCustom, fn, _params);
10454
10795
  }
10455
- function superRefine(fn, params) {
10796
+ function superRefine(fn) {
10456
10797
  const ch = check((payload) => {
10457
10798
  payload.addIssue = (issue$1) => {
10458
10799
  if (typeof issue$1 === "string") {
@@ -10468,7 +10809,7 @@ function superRefine(fn, params) {
10468
10809
  }
10469
10810
  };
10470
10811
  return fn(payload.value, payload);
10471
- }, params);
10812
+ });
10472
10813
  return ch;
10473
10814
  }
10474
10815
  function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) {
@@ -10506,7 +10847,7 @@ function preprocess(fn, schema) {
10506
10847
  }
10507
10848
 
10508
10849
  //#endregion
10509
- //#region ../../node_modules/zod/dist/esm/v4/classic/compat.js
10850
+ //#region ../../node_modules/zod/v4/classic/compat.js
10510
10851
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
10511
10852
  const ZodIssueCode = {
10512
10853
  invalid_type: "invalid_type",
@@ -10521,10 +10862,6 @@ const ZodIssueCode = {
10521
10862
  invalid_value: "invalid_value",
10522
10863
  custom: "custom"
10523
10864
  };
10524
- /** @deprecated Not necessary in Zod 4. */
10525
- const INVALID = Object.freeze({ status: "aborted" });
10526
- /** A special constant with type `never` */
10527
- const NEVER = INVALID;
10528
10865
  /** @deprecated Use `z.config(params)` instead. */
10529
10866
  function setErrorMap(map$1) {
10530
10867
  config({ customError: map$1 });
@@ -10533,9 +10870,12 @@ function setErrorMap(map$1) {
10533
10870
  function getErrorMap() {
10534
10871
  return config().customError;
10535
10872
  }
10873
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
10874
+ var ZodFirstPartyTypeKind;
10875
+ (function(ZodFirstPartyTypeKind$1) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
10536
10876
 
10537
10877
  //#endregion
10538
- //#region ../../node_modules/zod/dist/esm/v4/classic/coerce.js
10878
+ //#region ../../node_modules/zod/v4/classic/coerce.js
10539
10879
  var coerce_exports = {};
10540
10880
  __export(coerce_exports, {
10541
10881
  bigint: () => bigint,
@@ -10561,13 +10901,14 @@ function date(params) {
10561
10901
  }
10562
10902
 
10563
10903
  //#endregion
10564
- //#region ../../node_modules/zod/dist/esm/v4/classic/external.js
10904
+ //#region ../../node_modules/zod/v4/classic/external.js
10565
10905
  var external_exports = {};
10566
10906
  __export(external_exports, {
10567
10907
  $brand: () => $brand,
10568
10908
  $input: () => $input,
10569
10909
  $output: () => $output,
10570
10910
  NEVER: () => NEVER,
10911
+ TimePrecision: () => TimePrecision,
10571
10912
  ZodAny: () => ZodAny,
10572
10913
  ZodArray: () => ZodArray,
10573
10914
  ZodBase64: () => ZodBase64,
@@ -10581,6 +10922,7 @@ __export(external_exports, {
10581
10922
  ZodCUID2: () => ZodCUID2,
10582
10923
  ZodCatch: () => ZodCatch,
10583
10924
  ZodCustom: () => ZodCustom,
10925
+ ZodCustomStringFormat: () => ZodCustomStringFormat,
10584
10926
  ZodDate: () => ZodDate,
10585
10927
  ZodDefault: () => ZodDefault,
10586
10928
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
@@ -10590,6 +10932,7 @@ __export(external_exports, {
10590
10932
  ZodEnum: () => ZodEnum,
10591
10933
  ZodError: () => ZodError,
10592
10934
  ZodFile: () => ZodFile,
10935
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
10593
10936
  ZodGUID: () => ZodGUID,
10594
10937
  ZodIPv4: () => ZodIPv4,
10595
10938
  ZodIPv6: () => ZodIPv6,
@@ -10742,6 +11085,7 @@ __export(external_exports, {
10742
11085
  startsWith: () => _startsWith,
10743
11086
  strictObject: () => strictObject,
10744
11087
  string: () => string$1,
11088
+ stringFormat: () => stringFormat,
10745
11089
  stringbool: () => stringbool,
10746
11090
  success: () => success,
10747
11091
  superRefine: () => superRefine,
@@ -10772,11 +11116,11 @@ __export(external_exports, {
10772
11116
  config(en_default());
10773
11117
 
10774
11118
  //#endregion
10775
- //#region ../../node_modules/zod/dist/esm/v4/classic/index.js
11119
+ //#region ../../node_modules/zod/v4/classic/index.js
10776
11120
  var classic_default = external_exports;
10777
11121
 
10778
11122
  //#endregion
10779
- //#region ../../node_modules/zod/dist/esm/v4/index.js
11123
+ //#region ../../node_modules/zod/v4/index.js
10780
11124
  var v4_default = classic_default;
10781
11125
 
10782
11126
  //#endregion