@settlemint/sdk-utils 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.
@@ -9,7 +9,9 @@ var __export = (target, all) => {
9
9
 
10
10
  //#endregion
11
11
 
12
- //#region ../../node_modules/zod/dist/esm/v4/core/core.js
12
+ //#region ../../node_modules/zod/v4/core/core.js
13
+ /** A special constant with type `never` */
14
+ const NEVER = Object.freeze({ status: "aborted" });
13
15
  function $constructor(name, initializer$2, params) {
14
16
  function init(inst, def) {
15
17
  var _a;
@@ -60,7 +62,7 @@ function config(newConfig) {
60
62
  }
61
63
 
62
64
  //#endregion
63
- //#region ../../node_modules/zod/dist/esm/v4/core/util.js
65
+ //#region ../../node_modules/zod/v4/core/util.js
64
66
  var util_exports = {};
65
67
  __export(util_exports, {
66
68
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -75,6 +77,7 @@ __export(util_exports, {
75
77
  assertNotEqual: () => assertNotEqual,
76
78
  assignProp: () => assignProp,
77
79
  cached: () => cached,
80
+ captureStackTrace: () => captureStackTrace,
78
81
  cleanEnum: () => cleanEnum,
79
82
  cleanRegex: () => cleanRegex,
80
83
  clone: () => clone,
@@ -213,10 +216,14 @@ function randomString(length = 10) {
213
216
  function esc(str) {
214
217
  return JSON.stringify(str);
215
218
  }
219
+ const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {};
216
220
  function isObject(data) {
217
221
  return typeof data === "object" && data !== null && !Array.isArray(data);
218
222
  }
219
223
  const allowsEval = cached(() => {
224
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
225
+ return false;
226
+ }
220
227
  try {
221
228
  const F = Function;
222
229
  new F("");
@@ -225,9 +232,6 @@ const allowsEval = cached(() => {
225
232
  return false;
226
233
  }
227
234
  });
228
- function _isObject(o) {
229
- return Object.prototype.toString.call(o) === "[object Object]";
230
- }
231
235
  function isPlainObject(o) {
232
236
  if (isObject(o) === false) return false;
233
237
  const ctor = o.constructor;
@@ -407,6 +411,9 @@ function omit(schema, mask) {
407
411
  });
408
412
  }
409
413
  function extend(schema, shape) {
414
+ if (!isPlainObject(shape)) {
415
+ throw new Error("Invalid input to extend: expected a plain object");
416
+ }
410
417
  const def = {
411
418
  ...schema._zod.def,
412
419
  get shape() {
@@ -494,7 +501,7 @@ function required(Class$1, schema, mask) {
494
501
  }
495
502
  function aborted(x, startIndex = 0) {
496
503
  for (let i = startIndex; i < x.issues.length; i++) {
497
- if (x.issues[i].continue !== true) return true;
504
+ if (x.issues[i]?.continue !== true) return true;
498
505
  }
499
506
  return false;
500
507
  }
@@ -558,7 +565,7 @@ var Class = class {
558
565
  };
559
566
 
560
567
  //#endregion
561
- //#region ../../node_modules/zod/dist/esm/v4/core/errors.js
568
+ //#region ../../node_modules/zod/v4/core/errors.js
562
569
  const initializer$1 = (inst, def) => {
563
570
  inst.name = "$ZodError";
564
571
  Object.defineProperty(inst, "_zod", {
@@ -575,13 +582,17 @@ const initializer$1 = (inst, def) => {
575
582
  },
576
583
  enumerable: true
577
584
  });
585
+ Object.defineProperty(inst, "toString", {
586
+ value: () => inst.message,
587
+ enumerable: false
588
+ });
578
589
  };
579
590
  const $ZodError = $constructor("$ZodError", initializer$1);
580
591
  const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
581
- function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
592
+ function flattenError(error$39, mapper = (issue$1) => issue$1.message) {
582
593
  const fieldErrors = {};
583
594
  const formErrors = [];
584
- for (const sub of error$37.issues) {
595
+ for (const sub of error$39.issues) {
585
596
  if (sub.path.length > 0) {
586
597
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
587
598
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -594,13 +605,13 @@ function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
594
605
  fieldErrors
595
606
  };
596
607
  }
597
- function formatError(error$37, _mapper) {
608
+ function formatError(error$39, _mapper) {
598
609
  const mapper = _mapper || function(issue$1) {
599
610
  return issue$1.message;
600
611
  };
601
612
  const fieldErrors = { _errors: [] };
602
- const processError = (error$38) => {
603
- for (const issue$1 of error$38.issues) {
613
+ const processError = (error$40) => {
614
+ for (const issue$1 of error$40.issues) {
604
615
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
605
616
  issue$1.errors.map((issues) => processError({ issues }));
606
617
  } else if (issue$1.code === "invalid_key") {
@@ -627,17 +638,17 @@ function formatError(error$37, _mapper) {
627
638
  }
628
639
  }
629
640
  };
630
- processError(error$37);
641
+ processError(error$39);
631
642
  return fieldErrors;
632
643
  }
633
- function treeifyError(error$37, _mapper) {
644
+ function treeifyError(error$39, _mapper) {
634
645
  const mapper = _mapper || function(issue$1) {
635
646
  return issue$1.message;
636
647
  };
637
648
  const result = { errors: [] };
638
- const processError = (error$38, path = []) => {
649
+ const processError = (error$40, path = []) => {
639
650
  var _a, _b;
640
- for (const issue$1 of error$38.issues) {
651
+ for (const issue$1 of error$40.issues) {
641
652
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
642
653
  issue$1.errors.map((issues) => processError({ issues }, issue$1.path));
643
654
  } else if (issue$1.code === "invalid_key") {
@@ -672,7 +683,7 @@ function treeifyError(error$37, _mapper) {
672
683
  }
673
684
  }
674
685
  };
675
- processError(error$37);
686
+ processError(error$39);
676
687
  return result;
677
688
  }
678
689
  /** Format a ZodError as a human-readable string in the following form.
@@ -720,9 +731,9 @@ function toDotPath(path) {
720
731
  }
721
732
  return segs.join("");
722
733
  }
723
- function prettifyError(error$37) {
734
+ function prettifyError(error$39) {
724
735
  const lines = [];
725
- const issues = [...error$37.issues].sort((a, b) => a.path.length - b.path.length);
736
+ const issues = [...error$39.issues].sort((a, b) => a.path.length - b.path.length);
726
737
  for (const issue$1 of issues) {
727
738
  lines.push(`✖ ${issue$1.message}`);
728
739
  if (issue$1.path?.length) lines.push(` → at ${toDotPath(issue$1.path)}`);
@@ -731,7 +742,7 @@ function prettifyError(error$37) {
731
742
  }
732
743
 
733
744
  //#endregion
734
- //#region ../../node_modules/zod/dist/esm/v4/core/parse.js
745
+ //#region ../../node_modules/zod/v4/core/parse.js
735
746
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
736
747
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
737
748
  const result = schema._zod.run({
@@ -743,7 +754,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
743
754
  }
744
755
  if (result.issues.length) {
745
756
  const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
746
- Error.captureStackTrace(e, _params?.callee);
757
+ captureStackTrace(e, _params?.callee);
747
758
  throw e;
748
759
  }
749
760
  return result.value;
@@ -758,7 +769,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
758
769
  if (result instanceof Promise) result = await result;
759
770
  if (result.issues.length) {
760
771
  const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
761
- Error.captureStackTrace(e, params?.callee);
772
+ captureStackTrace(e, params?.callee);
762
773
  throw e;
763
774
  }
764
775
  return result.value;
@@ -803,10 +814,9 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
803
814
  const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
804
815
 
805
816
  //#endregion
806
- //#region ../../node_modules/zod/dist/esm/v4/core/regexes.js
817
+ //#region ../../node_modules/zod/v4/core/regexes.js
807
818
  var regexes_exports = {};
808
819
  __export(regexes_exports, {
809
- _emoji: () => _emoji$1,
810
820
  base64: () => base64$1,
811
821
  base64url: () => base64url$1,
812
822
  bigint: () => bigint$2,
@@ -892,27 +902,23 @@ const base64url$1 = /^[A-Za-z0-9_-]*$/;
892
902
  const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
893
903
  const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
894
904
  const e164$1 = /^\+(?:[0-9]){6,14}[0-9]$/;
895
- 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])))`;
905
+ 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])))`;
896
906
  const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
897
907
  function timeSource(args) {
898
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
899
- if (args.precision) {
900
- regex = `${regex}\\.\\d{${args.precision}}`;
901
- } else if (args.precision == null) {
902
- regex = `${regex}(\\.\\d+)?`;
903
- }
908
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
909
+ 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+)?)?`;
904
910
  return regex;
905
911
  }
906
912
  function time$1(args) {
907
913
  return new RegExp(`^${timeSource(args)}$`);
908
914
  }
909
915
  function datetime$1(args) {
910
- let regex = `${dateSource}T${timeSource(args)}`;
911
- const opts = [];
912
- opts.push(args.local ? `Z?` : `Z`);
913
- if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`);
914
- regex = `${regex}(${opts.join("|")})`;
915
- return new RegExp(`^${regex}$`);
916
+ const time$2 = timeSource({ precision: args.precision });
917
+ const opts = ["Z"];
918
+ if (args.local) opts.push("");
919
+ if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
920
+ const timeRegex = `${time$2}(?:${opts.join("|")})`;
921
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
916
922
  }
917
923
  const string$2 = (params) => {
918
924
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
@@ -928,7 +934,7 @@ const lowercase = /^[^A-Z]*$/;
928
934
  const uppercase = /^[^a-z]*$/;
929
935
 
930
936
  //#endregion
931
- //#region ../../node_modules/zod/dist/esm/v4/core/checks.js
937
+ //#region ../../node_modules/zod/v4/core/checks.js
932
938
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
933
939
  var _a;
934
940
  inst._zod ?? (inst._zod = {});
@@ -1119,11 +1125,12 @@ const $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntForma
1119
1125
  };
1120
1126
  });
1121
1127
  const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1128
+ var _a;
1122
1129
  $ZodCheck.init(inst, def);
1123
- inst._zod.when = (payload) => {
1130
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1124
1131
  const val = payload.value;
1125
1132
  return !nullish$1(val) && val.size !== undefined;
1126
- };
1133
+ });
1127
1134
  inst._zod.onattach.push((inst$1) => {
1128
1135
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1129
1136
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1143,11 +1150,12 @@ const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst,
1143
1150
  };
1144
1151
  });
1145
1152
  const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1153
+ var _a;
1146
1154
  $ZodCheck.init(inst, def);
1147
- inst._zod.when = (payload) => {
1155
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1148
1156
  const val = payload.value;
1149
1157
  return !nullish$1(val) && val.size !== undefined;
1150
- };
1158
+ });
1151
1159
  inst._zod.onattach.push((inst$1) => {
1152
1160
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1153
1161
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1167,11 +1175,12 @@ const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst,
1167
1175
  };
1168
1176
  });
1169
1177
  const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1178
+ var _a;
1170
1179
  $ZodCheck.init(inst, def);
1171
- inst._zod.when = (payload) => {
1180
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1172
1181
  const val = payload.value;
1173
1182
  return !nullish$1(val) && val.size !== undefined;
1174
- };
1183
+ });
1175
1184
  inst._zod.onattach.push((inst$1) => {
1176
1185
  const bag = inst$1._zod.bag;
1177
1186
  bag.minimum = def.size;
@@ -1192,6 +1201,8 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1192
1201
  code: "too_small",
1193
1202
  minimum: def.size
1194
1203
  },
1204
+ inclusive: true,
1205
+ exact: true,
1195
1206
  input: payload.value,
1196
1207
  inst,
1197
1208
  continue: !def.abort
@@ -1199,11 +1210,12 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1199
1210
  };
1200
1211
  });
1201
1212
  const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1213
+ var _a;
1202
1214
  $ZodCheck.init(inst, def);
1203
- inst._zod.when = (payload) => {
1215
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1204
1216
  const val = payload.value;
1205
1217
  return !nullish$1(val) && val.length !== undefined;
1206
- };
1218
+ });
1207
1219
  inst._zod.onattach.push((inst$1) => {
1208
1220
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1209
1221
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1225,11 +1237,12 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
1225
1237
  };
1226
1238
  });
1227
1239
  const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1240
+ var _a;
1228
1241
  $ZodCheck.init(inst, def);
1229
- inst._zod.when = (payload) => {
1242
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1230
1243
  const val = payload.value;
1231
1244
  return !nullish$1(val) && val.length !== undefined;
1232
- };
1245
+ });
1233
1246
  inst._zod.onattach.push((inst$1) => {
1234
1247
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1235
1248
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1251,11 +1264,12 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
1251
1264
  };
1252
1265
  });
1253
1266
  const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1267
+ var _a;
1254
1268
  $ZodCheck.init(inst, def);
1255
- inst._zod.when = (payload) => {
1269
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1256
1270
  const val = payload.value;
1257
1271
  return !nullish$1(val) && val.length !== undefined;
1258
- };
1272
+ });
1259
1273
  inst._zod.onattach.push((inst$1) => {
1260
1274
  const bag = inst$1._zod.bag;
1261
1275
  bag.minimum = def.length;
@@ -1277,6 +1291,8 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1277
1291
  code: "too_small",
1278
1292
  minimum: def.length
1279
1293
  },
1294
+ inclusive: true,
1295
+ exact: true,
1280
1296
  input: payload.value,
1281
1297
  inst,
1282
1298
  continue: !def.abort
@@ -1284,7 +1300,7 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1284
1300
  };
1285
1301
  });
1286
1302
  const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1287
- var _a;
1303
+ var _a, _b;
1288
1304
  $ZodCheck.init(inst, def);
1289
1305
  inst._zod.onattach.push((inst$1) => {
1290
1306
  const bag = inst$1._zod.bag;
@@ -1294,8 +1310,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1294
1310
  bag.patterns.add(def.pattern);
1295
1311
  }
1296
1312
  });
1297
- (_a = inst._zod).check ?? (_a.check = (payload) => {
1298
- if (!def.pattern) throw new Error("Not implemented.");
1313
+ if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
1299
1314
  def.pattern.lastIndex = 0;
1300
1315
  if (def.pattern.test(payload.value)) return;
1301
1316
  payload.issues.push({
@@ -1308,6 +1323,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1308
1323
  continue: !def.abort
1309
1324
  });
1310
1325
  });
1326
+ else (_b = inst._zod).check ?? (_b.check = () => {});
1311
1327
  });
1312
1328
  const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1313
1329
  $ZodCheckStringFormat.init(inst, def);
@@ -1431,7 +1447,6 @@ const $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (ins
1431
1447
  code: "invalid_value",
1432
1448
  values: def.mime,
1433
1449
  input: payload.value.type,
1434
- path: ["type"],
1435
1450
  inst
1436
1451
  });
1437
1452
  };
@@ -1444,7 +1459,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1444
1459
  });
1445
1460
 
1446
1461
  //#endregion
1447
- //#region ../../node_modules/zod/dist/esm/v4/core/doc.js
1462
+ //#region ../../node_modules/zod/v4/core/doc.js
1448
1463
  var Doc = class {
1449
1464
  constructor(args = []) {
1450
1465
  this.content = [];
@@ -1480,19 +1495,18 @@ var Doc = class {
1480
1495
  };
1481
1496
 
1482
1497
  //#endregion
1483
- //#region ../../node_modules/zod/dist/esm/v4/core/versions.js
1498
+ //#region ../../node_modules/zod/v4/core/versions.js
1484
1499
  const version = {
1485
1500
  major: 4,
1486
1501
  minor: 0,
1487
- patch: 0
1502
+ patch: 5
1488
1503
  };
1489
1504
 
1490
1505
  //#endregion
1491
- //#region ../../node_modules/zod/dist/esm/v4/core/schemas.js
1506
+ //#region ../../node_modules/zod/v4/core/schemas.js
1492
1507
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1493
1508
  var _a;
1494
1509
  inst ?? (inst = {});
1495
- inst._zod.id = def.type + "_" + randomString(10);
1496
1510
  inst._zod.def = def;
1497
1511
  inst._zod.bag = inst._zod.bag || {};
1498
1512
  inst._zod.version = version;
@@ -1515,13 +1529,11 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1515
1529
  let isAborted = aborted(payload);
1516
1530
  let asyncResult;
1517
1531
  for (const ch of checks$1) {
1518
- if (ch._zod.when) {
1519
- const shouldRun = ch._zod.when(payload);
1532
+ if (ch._zod.def.when) {
1533
+ const shouldRun = ch._zod.def.when(payload);
1520
1534
  if (!shouldRun) continue;
1521
- } else {
1522
- if (isAborted) {
1523
- continue;
1524
- }
1535
+ } else if (isAborted) {
1536
+ continue;
1525
1537
  }
1526
1538
  const currLen = payload.issues.length;
1527
1539
  const _ = ch._zod.check(payload);
@@ -1621,7 +1633,9 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1621
1633
  $ZodStringFormat.init(inst, def);
1622
1634
  inst._zod.check = (payload) => {
1623
1635
  try {
1624
- const url$1 = new URL(payload.value);
1636
+ const orig = payload.value;
1637
+ const url$1 = new URL(orig);
1638
+ const href = url$1.href;
1625
1639
  if (def.hostname) {
1626
1640
  def.hostname.lastIndex = 0;
1627
1641
  if (!def.hostname.test(url$1.hostname)) {
@@ -1650,6 +1664,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1650
1664
  });
1651
1665
  }
1652
1666
  }
1667
+ if (!orig.endsWith("/") && href.endsWith("/")) {
1668
+ payload.value = href.slice(0, -1);
1669
+ } else {
1670
+ payload.value = href;
1671
+ }
1653
1672
  return;
1654
1673
  } catch (_) {
1655
1674
  payload.issues.push({
@@ -1820,6 +1839,7 @@ function isValidJWT(token, algorithm = null) {
1820
1839
  const tokensParts = token.split(".");
1821
1840
  if (tokensParts.length !== 3) return false;
1822
1841
  const [header] = tokensParts;
1842
+ if (!header) return false;
1823
1843
  const parsedHeader = JSON.parse(atob(header));
1824
1844
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1825
1845
  if (!parsedHeader.alg) return false;
@@ -1842,6 +1862,19 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1842
1862
  });
1843
1863
  };
1844
1864
  });
1865
+ const $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => {
1866
+ $ZodStringFormat.init(inst, def);
1867
+ inst._zod.check = (payload) => {
1868
+ if (def.fn(payload.value)) return;
1869
+ payload.issues.push({
1870
+ code: "invalid_format",
1871
+ format: def.format,
1872
+ input: payload.value,
1873
+ inst,
1874
+ continue: !def.abort
1875
+ });
1876
+ };
1877
+ });
1845
1878
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1846
1879
  $ZodType.init(inst, def);
1847
1880
  inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
@@ -1893,12 +1926,11 @@ const $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
1893
1926
  if (def.coerce) try {
1894
1927
  payload.value = BigInt(payload.value);
1895
1928
  } catch (_) {}
1896
- const { value: input } = payload;
1897
- if (typeof input === "bigint") return payload;
1929
+ if (typeof payload.value === "bigint") return payload;
1898
1930
  payload.issues.push({
1899
1931
  expected: "bigint",
1900
1932
  code: "invalid_type",
1901
- input,
1933
+ input: payload.value,
1902
1934
  inst
1903
1935
  });
1904
1936
  return payload;
@@ -1911,7 +1943,7 @@ const $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def)
1911
1943
  const $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
1912
1944
  $ZodType.init(inst, def);
1913
1945
  inst._zod.parse = (payload, _ctx) => {
1914
- const { value: input } = payload;
1946
+ const input = payload.value;
1915
1947
  if (typeof input === "symbol") return payload;
1916
1948
  payload.issues.push({
1917
1949
  expected: "symbol",
@@ -1926,8 +1958,10 @@ const $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def)
1926
1958
  $ZodType.init(inst, def);
1927
1959
  inst._zod.pattern = _undefined$2;
1928
1960
  inst._zod.values = new Set([undefined]);
1961
+ inst._zod.optin = "optional";
1962
+ inst._zod.optout = "optional";
1929
1963
  inst._zod.parse = (payload, _ctx) => {
1930
- const { value: input } = payload;
1964
+ const input = payload.value;
1931
1965
  if (typeof input === "undefined") return payload;
1932
1966
  payload.issues.push({
1933
1967
  expected: "undefined",
@@ -1943,7 +1977,7 @@ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1943
1977
  inst._zod.pattern = _null$2;
1944
1978
  inst._zod.values = new Set([null]);
1945
1979
  inst._zod.parse = (payload, _ctx) => {
1946
- const { value: input } = payload;
1980
+ const input = payload.value;
1947
1981
  if (input === null) return payload;
1948
1982
  payload.issues.push({
1949
1983
  expected: "null",
@@ -1977,7 +2011,7 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1977
2011
  const $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
1978
2012
  $ZodType.init(inst, def);
1979
2013
  inst._zod.parse = (payload, _ctx) => {
1980
- const { value: input } = payload;
2014
+ const input = payload.value;
1981
2015
  if (typeof input === "undefined") return payload;
1982
2016
  payload.issues.push({
1983
2017
  expected: "void",
@@ -2108,19 +2142,20 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2108
2142
  "payload",
2109
2143
  "ctx"
2110
2144
  ]);
2111
- const { keys, optionalKeys: optionalKeys$1 } = _normalized.value;
2145
+ const normalized = _normalized.value;
2112
2146
  const parseStr = (key) => {
2113
2147
  const k = esc(key);
2114
2148
  return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
2115
2149
  };
2116
2150
  doc.write(`const input = payload.value;`);
2117
2151
  const ids = Object.create(null);
2118
- for (const key of keys) {
2119
- ids[key] = randomString(15);
2152
+ let counter = 0;
2153
+ for (const key of normalized.keys) {
2154
+ ids[key] = `key_${counter++}`;
2120
2155
  }
2121
2156
  doc.write(`const newResult = {}`);
2122
- for (const key of keys) {
2123
- if (optionalKeys$1.has(key)) {
2157
+ for (const key of normalized.keys) {
2158
+ if (normalized.optionalKeys.has(key)) {
2124
2159
  const id = ids[key];
2125
2160
  doc.write(`const ${id} = ${parseStr(key)};`);
2126
2161
  const k = esc(key);
@@ -2165,7 +2200,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2165
2200
  const jit = !globalConfig.jitless;
2166
2201
  const allowsEval$1 = allowsEval;
2167
2202
  const fastEnabled = jit && allowsEval$1.value;
2168
- const { catchall } = def;
2203
+ const catchall = def.catchall;
2169
2204
  let value;
2170
2205
  inst._zod.parse = (payload, ctx) => {
2171
2206
  value ?? (value = _normalized.value);
@@ -2195,12 +2230,10 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2195
2230
  const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
2196
2231
  if (r instanceof Promise) {
2197
2232
  proms.push(r.then((r$1) => isOptional ? handleOptionalObjectResult(r$1, payload, key, input) : handleObjectResult(r$1, payload, key)));
2233
+ } else if (isOptional) {
2234
+ handleOptionalObjectResult(r, payload, key, input);
2198
2235
  } else {
2199
- if (isOptional) {
2200
- handleOptionalObjectResult(r, payload, key, input);
2201
- } else {
2202
- handleObjectResult(r, payload, key);
2203
- }
2236
+ handleObjectResult(r, payload, key);
2204
2237
  }
2205
2238
  }
2206
2239
  }
@@ -2258,6 +2291,8 @@ function handleUnionResults(results, final, inst, ctx) {
2258
2291
  }
2259
2292
  const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
2260
2293
  $ZodType.init(inst, def);
2294
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
2295
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
2261
2296
  defineLazy(inst._zod, "values", () => {
2262
2297
  if (def.options.every((o) => o._zod.values)) {
2263
2298
  return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
@@ -2314,7 +2349,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2314
2349
  const opts = def.options;
2315
2350
  const map$1 = new Map();
2316
2351
  for (const o of opts) {
2317
- const values = o._zod.propValues[def.discriminator];
2352
+ const values = o._zod.propValues?.[def.discriminator];
2318
2353
  if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
2319
2354
  for (const v of values) {
2320
2355
  if (map$1.has(v)) {
@@ -2357,7 +2392,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2357
2392
  const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
2358
2393
  $ZodType.init(inst, def);
2359
2394
  inst._zod.parse = (payload, ctx) => {
2360
- const { value: input } = payload;
2395
+ const input = payload.value;
2361
2396
  const left = def.left._zod.run({
2362
2397
  value: input,
2363
2398
  issues: []
@@ -2814,6 +2849,9 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
2814
2849
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined;
2815
2850
  });
2816
2851
  inst._zod.parse = (payload, ctx) => {
2852
+ if (def.innerType._zod.optin === "optional") {
2853
+ return def.innerType._zod.run(payload, ctx);
2854
+ }
2817
2855
  if (payload.value === undefined) {
2818
2856
  return payload;
2819
2857
  }
@@ -2913,7 +2951,7 @@ const $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
2913
2951
  });
2914
2952
  const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2915
2953
  $ZodType.init(inst, def);
2916
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2954
+ inst._zod.optin = "optional";
2917
2955
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2918
2956
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2919
2957
  inst._zod.parse = (payload, ctx) => {
@@ -2964,6 +3002,7 @@ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
2964
3002
  defineLazy(inst._zod, "values", () => def.in._zod.values);
2965
3003
  defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2966
3004
  defineLazy(inst._zod, "optout", () => def.out._zod.optout);
3005
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2967
3006
  inst._zod.parse = (payload, ctx) => {
2968
3007
  const left = def.in._zod.run(payload, ctx);
2969
3008
  if (left instanceof Promise) {
@@ -2984,6 +3023,7 @@ function handlePipeResult(left, def, ctx) {
2984
3023
  const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2985
3024
  $ZodType.init(inst, def);
2986
3025
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
3026
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2987
3027
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2988
3028
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2989
3029
  inst._zod.parse = (payload, ctx) => {
@@ -3034,7 +3074,7 @@ const $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral",
3034
3074
  input: payload.value,
3035
3075
  inst,
3036
3076
  code: "invalid_format",
3037
- format: "template_literal",
3077
+ format: def.format ?? "template_literal",
3038
3078
  pattern: inst._zod.pattern.source
3039
3079
  });
3040
3080
  return payload;
@@ -3094,8 +3134,8 @@ function handleRefineResult(result, payload, input, inst) {
3094
3134
  }
3095
3135
 
3096
3136
  //#endregion
3097
- //#region ../../node_modules/zod/dist/esm/v4/locales/ar.js
3098
- const error$36 = () => {
3137
+ //#region ../../node_modules/zod/v4/locales/ar.js
3138
+ const error$38 = () => {
3099
3139
  const Sizable = {
3100
3140
  string: {
3101
3141
  unit: "حرف",
@@ -3117,7 +3157,7 @@ const error$36 = () => {
3117
3157
  function getSizing(origin) {
3118
3158
  return Sizable[origin] ?? null;
3119
3159
  }
3120
- const parsedType$2 = (data) => {
3160
+ const parsedType$3 = (data) => {
3121
3161
  const t = typeof data;
3122
3162
  switch (t) {
3123
3163
  case "number": {
@@ -3169,7 +3209,7 @@ const error$36 = () => {
3169
3209
  };
3170
3210
  return (issue$1) => {
3171
3211
  switch (issue$1.code) {
3172
- case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$2(issue$1.input)}`;
3212
+ case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$3(issue$1.input)}`;
3173
3213
  case "invalid_value":
3174
3214
  if (issue$1.values.length === 1) return `مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(issue$1.values[0])}`;
3175
3215
  return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(issue$1.values, "|")}`;
@@ -3205,12 +3245,12 @@ const error$36 = () => {
3205
3245
  };
3206
3246
  };
3207
3247
  function ar_default() {
3208
- return { localeError: error$36() };
3248
+ return { localeError: error$38() };
3209
3249
  }
3210
3250
 
3211
3251
  //#endregion
3212
- //#region ../../node_modules/zod/dist/esm/v4/locales/az.js
3213
- const error$35 = () => {
3252
+ //#region ../../node_modules/zod/v4/locales/az.js
3253
+ const error$37 = () => {
3214
3254
  const Sizable = {
3215
3255
  string: {
3216
3256
  unit: "simvol",
@@ -3232,7 +3272,7 @@ const error$35 = () => {
3232
3272
  function getSizing(origin) {
3233
3273
  return Sizable[origin] ?? null;
3234
3274
  }
3235
- const parsedType$2 = (data) => {
3275
+ const parsedType$3 = (data) => {
3236
3276
  const t = typeof data;
3237
3277
  switch (t) {
3238
3278
  case "number": {
@@ -3284,7 +3324,7 @@ const error$35 = () => {
3284
3324
  };
3285
3325
  return (issue$1) => {
3286
3326
  switch (issue$1.code) {
3287
- case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$2(issue$1.input)}`;
3327
+ case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$3(issue$1.input)}`;
3288
3328
  case "invalid_value":
3289
3329
  if (issue$1.values.length === 1) return `Yanlış dəyər: gözlənilən ${stringifyPrimitive(issue$1.values[0])}`;
3290
3330
  return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(issue$1.values, "|")}`;
@@ -3318,11 +3358,11 @@ const error$35 = () => {
3318
3358
  };
3319
3359
  };
3320
3360
  function az_default() {
3321
- return { localeError: error$35() };
3361
+ return { localeError: error$37() };
3322
3362
  }
3323
3363
 
3324
3364
  //#endregion
3325
- //#region ../../node_modules/zod/dist/esm/v4/locales/be.js
3365
+ //#region ../../node_modules/zod/v4/locales/be.js
3326
3366
  function getBelarusianPlural(count, one, few, many) {
3327
3367
  const absCount = Math.abs(count);
3328
3368
  const lastDigit = absCount % 10;
@@ -3338,7 +3378,7 @@ function getBelarusianPlural(count, one, few, many) {
3338
3378
  }
3339
3379
  return many;
3340
3380
  }
3341
- const error$34 = () => {
3381
+ const error$36 = () => {
3342
3382
  const Sizable = {
3343
3383
  string: {
3344
3384
  unit: {
@@ -3376,7 +3416,7 @@ const error$34 = () => {
3376
3416
  function getSizing(origin) {
3377
3417
  return Sizable[origin] ?? null;
3378
3418
  }
3379
- const parsedType$2 = (data) => {
3419
+ const parsedType$3 = (data) => {
3380
3420
  const t = typeof data;
3381
3421
  switch (t) {
3382
3422
  case "number": {
@@ -3428,7 +3468,7 @@ const error$34 = () => {
3428
3468
  };
3429
3469
  return (issue$1) => {
3430
3470
  switch (issue$1.code) {
3431
- case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$2(issue$1.input)}`;
3471
+ case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$3(issue$1.input)}`;
3432
3472
  case "invalid_value":
3433
3473
  if (issue$1.values.length === 1) return `Няправільны ўвод: чакалася ${stringifyPrimitive(issue$1.values[0])}`;
3434
3474
  return `Няправільны варыянт: чакаўся адзін з ${joinValues(issue$1.values, "|")}`;
@@ -3470,12 +3510,12 @@ const error$34 = () => {
3470
3510
  };
3471
3511
  };
3472
3512
  function be_default() {
3473
- return { localeError: error$34() };
3513
+ return { localeError: error$36() };
3474
3514
  }
3475
3515
 
3476
3516
  //#endregion
3477
- //#region ../../node_modules/zod/dist/esm/v4/locales/ca.js
3478
- const error$33 = () => {
3517
+ //#region ../../node_modules/zod/v4/locales/ca.js
3518
+ const error$35 = () => {
3479
3519
  const Sizable = {
3480
3520
  string: {
3481
3521
  unit: "caràcters",
@@ -3497,7 +3537,7 @@ const error$33 = () => {
3497
3537
  function getSizing(origin) {
3498
3538
  return Sizable[origin] ?? null;
3499
3539
  }
3500
- const parsedType$2 = (data) => {
3540
+ const parsedType$3 = (data) => {
3501
3541
  const t = typeof data;
3502
3542
  switch (t) {
3503
3543
  case "number": {
@@ -3549,7 +3589,7 @@ const error$33 = () => {
3549
3589
  };
3550
3590
  return (issue$1) => {
3551
3591
  switch (issue$1.code) {
3552
- case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$2(issue$1.input)}`;
3592
+ case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$3(issue$1.input)}`;
3553
3593
  case "invalid_value":
3554
3594
  if (issue$1.values.length === 1) return `Valor invàlid: s'esperava ${stringifyPrimitive(issue$1.values[0])}`;
3555
3595
  return `Opció invàlida: s'esperava una de ${joinValues(issue$1.values, " o ")}`;
@@ -3587,12 +3627,12 @@ const error$33 = () => {
3587
3627
  };
3588
3628
  };
3589
3629
  function ca_default() {
3590
- return { localeError: error$33() };
3630
+ return { localeError: error$35() };
3591
3631
  }
3592
3632
 
3593
3633
  //#endregion
3594
- //#region ../../node_modules/zod/dist/esm/v4/locales/cs.js
3595
- const error$32 = () => {
3634
+ //#region ../../node_modules/zod/v4/locales/cs.js
3635
+ const error$34 = () => {
3596
3636
  const Sizable = {
3597
3637
  string: {
3598
3638
  unit: "znaků",
@@ -3614,7 +3654,7 @@ const error$32 = () => {
3614
3654
  function getSizing(origin) {
3615
3655
  return Sizable[origin] ?? null;
3616
3656
  }
3617
- const parsedType$2 = (data) => {
3657
+ const parsedType$3 = (data) => {
3618
3658
  const t = typeof data;
3619
3659
  switch (t) {
3620
3660
  case "number": {
@@ -3684,7 +3724,7 @@ const error$32 = () => {
3684
3724
  };
3685
3725
  return (issue$1) => {
3686
3726
  switch (issue$1.code) {
3687
- case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$2(issue$1.input)}`;
3727
+ case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$3(issue$1.input)}`;
3688
3728
  case "invalid_value":
3689
3729
  if (issue$1.values.length === 1) return `Neplatný vstup: očekáváno ${stringifyPrimitive(issue$1.values[0])}`;
3690
3730
  return `Neplatná možnost: očekávána jedna z hodnot ${joinValues(issue$1.values, "|")}`;
@@ -3722,12 +3762,12 @@ const error$32 = () => {
3722
3762
  };
3723
3763
  };
3724
3764
  function cs_default() {
3725
- return { localeError: error$32() };
3765
+ return { localeError: error$34() };
3726
3766
  }
3727
3767
 
3728
3768
  //#endregion
3729
- //#region ../../node_modules/zod/dist/esm/v4/locales/de.js
3730
- const error$31 = () => {
3769
+ //#region ../../node_modules/zod/v4/locales/de.js
3770
+ const error$33 = () => {
3731
3771
  const Sizable = {
3732
3772
  string: {
3733
3773
  unit: "Zeichen",
@@ -3749,7 +3789,7 @@ const error$31 = () => {
3749
3789
  function getSizing(origin) {
3750
3790
  return Sizable[origin] ?? null;
3751
3791
  }
3752
- const parsedType$2 = (data) => {
3792
+ const parsedType$3 = (data) => {
3753
3793
  const t = typeof data;
3754
3794
  switch (t) {
3755
3795
  case "number": {
@@ -3801,7 +3841,7 @@ const error$31 = () => {
3801
3841
  };
3802
3842
  return (issue$1) => {
3803
3843
  switch (issue$1.code) {
3804
- case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$2(issue$1.input)}`;
3844
+ case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$3(issue$1.input)}`;
3805
3845
  case "invalid_value":
3806
3846
  if (issue$1.values.length === 1) return `Ungültige Eingabe: erwartet ${stringifyPrimitive(issue$1.values[0])}`;
3807
3847
  return `Ungültige Option: erwartet eine von ${joinValues(issue$1.values, "|")}`;
@@ -3837,12 +3877,12 @@ const error$31 = () => {
3837
3877
  };
3838
3878
  };
3839
3879
  function de_default() {
3840
- return { localeError: error$31() };
3880
+ return { localeError: error$33() };
3841
3881
  }
3842
3882
 
3843
3883
  //#endregion
3844
- //#region ../../node_modules/zod/dist/esm/v4/locales/en.js
3845
- const parsedType$1 = (data) => {
3884
+ //#region ../../node_modules/zod/v4/locales/en.js
3885
+ const parsedType$2 = (data) => {
3846
3886
  const t = typeof data;
3847
3887
  switch (t) {
3848
3888
  case "number": {
@@ -3862,7 +3902,7 @@ const parsedType$1 = (data) => {
3862
3902
  }
3863
3903
  return t;
3864
3904
  };
3865
- const error$30 = () => {
3905
+ const error$32 = () => {
3866
3906
  const Sizable = {
3867
3907
  string: {
3868
3908
  unit: "characters",
@@ -3916,7 +3956,7 @@ const error$30 = () => {
3916
3956
  };
3917
3957
  return (issue$1) => {
3918
3958
  switch (issue$1.code) {
3919
- case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$1(issue$1.input)}`;
3959
+ case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$2(issue$1.input)}`;
3920
3960
  case "invalid_value":
3921
3961
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
3922
3962
  return `Invalid option: expected one of ${joinValues(issue$1.values, "|")}`;
@@ -3954,12 +3994,127 @@ const error$30 = () => {
3954
3994
  };
3955
3995
  };
3956
3996
  function en_default() {
3957
- return { localeError: error$30() };
3997
+ return { localeError: error$32() };
3958
3998
  }
3959
3999
 
3960
4000
  //#endregion
3961
- //#region ../../node_modules/zod/dist/esm/v4/locales/es.js
3962
- const error$29 = () => {
4001
+ //#region ../../node_modules/zod/v4/locales/eo.js
4002
+ const parsedType$1 = (data) => {
4003
+ const t = typeof data;
4004
+ switch (t) {
4005
+ case "number": {
4006
+ return Number.isNaN(data) ? "NaN" : "nombro";
4007
+ }
4008
+ case "object": {
4009
+ if (Array.isArray(data)) {
4010
+ return "tabelo";
4011
+ }
4012
+ if (data === null) {
4013
+ return "senvalora";
4014
+ }
4015
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
4016
+ return data.constructor.name;
4017
+ }
4018
+ }
4019
+ }
4020
+ return t;
4021
+ };
4022
+ const error$31 = () => {
4023
+ const Sizable = {
4024
+ string: {
4025
+ unit: "karaktrojn",
4026
+ verb: "havi"
4027
+ },
4028
+ file: {
4029
+ unit: "bajtojn",
4030
+ verb: "havi"
4031
+ },
4032
+ array: {
4033
+ unit: "elementojn",
4034
+ verb: "havi"
4035
+ },
4036
+ set: {
4037
+ unit: "elementojn",
4038
+ verb: "havi"
4039
+ }
4040
+ };
4041
+ function getSizing(origin) {
4042
+ return Sizable[origin] ?? null;
4043
+ }
4044
+ const Nouns = {
4045
+ regex: "enigo",
4046
+ email: "retadreso",
4047
+ url: "URL",
4048
+ emoji: "emoĝio",
4049
+ uuid: "UUID",
4050
+ uuidv4: "UUIDv4",
4051
+ uuidv6: "UUIDv6",
4052
+ nanoid: "nanoid",
4053
+ guid: "GUID",
4054
+ cuid: "cuid",
4055
+ cuid2: "cuid2",
4056
+ ulid: "ULID",
4057
+ xid: "XID",
4058
+ ksuid: "KSUID",
4059
+ datetime: "ISO-datotempo",
4060
+ date: "ISO-dato",
4061
+ time: "ISO-tempo",
4062
+ duration: "ISO-daŭro",
4063
+ ipv4: "IPv4-adreso",
4064
+ ipv6: "IPv6-adreso",
4065
+ cidrv4: "IPv4-rango",
4066
+ cidrv6: "IPv6-rango",
4067
+ base64: "64-ume kodita karaktraro",
4068
+ base64url: "URL-64-ume kodita karaktraro",
4069
+ json_string: "JSON-karaktraro",
4070
+ e164: "E.164-nombro",
4071
+ jwt: "JWT",
4072
+ template_literal: "enigo"
4073
+ };
4074
+ return (issue$1) => {
4075
+ switch (issue$1.code) {
4076
+ case "invalid_type": return `Nevalida enigo: atendiĝis ${issue$1.expected}, riceviĝis ${parsedType$1(issue$1.input)}`;
4077
+ case "invalid_value":
4078
+ if (issue$1.values.length === 1) return `Nevalida enigo: atendiĝis ${stringifyPrimitive(issue$1.values[0])}`;
4079
+ return `Nevalida opcio: atendiĝis unu el ${joinValues(issue$1.values, "|")}`;
4080
+ case "too_big": {
4081
+ const adj = issue$1.inclusive ? "<=" : "<";
4082
+ const sizing = getSizing(issue$1.origin);
4083
+ if (sizing) return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
4084
+ return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()}`;
4085
+ }
4086
+ case "too_small": {
4087
+ const adj = issue$1.inclusive ? ">=" : ">";
4088
+ const sizing = getSizing(issue$1.origin);
4089
+ if (sizing) {
4090
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} havu ${adj}${issue$1.minimum.toString()} ${sizing.unit}`;
4091
+ }
4092
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} estu ${adj}${issue$1.minimum.toString()}`;
4093
+ }
4094
+ case "invalid_format": {
4095
+ const _issue = issue$1;
4096
+ if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
4097
+ if (_issue.format === "ends_with") return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
4098
+ if (_issue.format === "includes") return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
4099
+ if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
4100
+ return `Nevalida ${Nouns[_issue.format] ?? issue$1.format}`;
4101
+ }
4102
+ case "not_multiple_of": return `Nevalida nombro: devas esti oblo de ${issue$1.divisor}`;
4103
+ case "unrecognized_keys": return `Nekonata${issue$1.keys.length > 1 ? "j" : ""} ŝlosilo${issue$1.keys.length > 1 ? "j" : ""}: ${joinValues(issue$1.keys, ", ")}`;
4104
+ case "invalid_key": return `Nevalida ŝlosilo en ${issue$1.origin}`;
4105
+ case "invalid_union": return "Nevalida enigo";
4106
+ case "invalid_element": return `Nevalida valoro en ${issue$1.origin}`;
4107
+ default: return `Nevalida enigo`;
4108
+ }
4109
+ };
4110
+ };
4111
+ function eo_default() {
4112
+ return { localeError: error$31() };
4113
+ }
4114
+
4115
+ //#endregion
4116
+ //#region ../../node_modules/zod/v4/locales/es.js
4117
+ const error$30 = () => {
3963
4118
  const Sizable = {
3964
4119
  string: {
3965
4120
  unit: "caracteres",
@@ -3981,7 +4136,7 @@ const error$29 = () => {
3981
4136
  function getSizing(origin) {
3982
4137
  return Sizable[origin] ?? null;
3983
4138
  }
3984
- const parsedType$2 = (data) => {
4139
+ const parsedType$3 = (data) => {
3985
4140
  const t = typeof data;
3986
4141
  switch (t) {
3987
4142
  case "number": {
@@ -4033,7 +4188,7 @@ const error$29 = () => {
4033
4188
  };
4034
4189
  return (issue$1) => {
4035
4190
  switch (issue$1.code) {
4036
- case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$2(issue$1.input)}`;
4191
+ case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$3(issue$1.input)}`;
4037
4192
  case "invalid_value":
4038
4193
  if (issue$1.values.length === 1) return `Entrada inválida: se esperaba ${stringifyPrimitive(issue$1.values[0])}`;
4039
4194
  return `Opción inválida: se esperaba una de ${joinValues(issue$1.values, "|")}`;
@@ -4069,12 +4224,12 @@ const error$29 = () => {
4069
4224
  };
4070
4225
  };
4071
4226
  function es_default() {
4072
- return { localeError: error$29() };
4227
+ return { localeError: error$30() };
4073
4228
  }
4074
4229
 
4075
4230
  //#endregion
4076
- //#region ../../node_modules/zod/dist/esm/v4/locales/fa.js
4077
- const error$28 = () => {
4231
+ //#region ../../node_modules/zod/v4/locales/fa.js
4232
+ const error$29 = () => {
4078
4233
  const Sizable = {
4079
4234
  string: {
4080
4235
  unit: "کاراکتر",
@@ -4096,7 +4251,7 @@ const error$28 = () => {
4096
4251
  function getSizing(origin) {
4097
4252
  return Sizable[origin] ?? null;
4098
4253
  }
4099
- const parsedType$2 = (data) => {
4254
+ const parsedType$3 = (data) => {
4100
4255
  const t = typeof data;
4101
4256
  switch (t) {
4102
4257
  case "number": {
@@ -4148,7 +4303,7 @@ const error$28 = () => {
4148
4303
  };
4149
4304
  return (issue$1) => {
4150
4305
  switch (issue$1.code) {
4151
- case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$2(issue$1.input)} دریافت شد`;
4306
+ case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$3(issue$1.input)} دریافت شد`;
4152
4307
  case "invalid_value":
4153
4308
  if (issue$1.values.length === 1) {
4154
4309
  return `ورودی نامعتبر: می‌بایست ${stringifyPrimitive(issue$1.values[0])} می‌بود`;
@@ -4196,12 +4351,12 @@ const error$28 = () => {
4196
4351
  };
4197
4352
  };
4198
4353
  function fa_default() {
4199
- return { localeError: error$28() };
4354
+ return { localeError: error$29() };
4200
4355
  }
4201
4356
 
4202
4357
  //#endregion
4203
- //#region ../../node_modules/zod/dist/esm/v4/locales/fi.js
4204
- const error$27 = () => {
4358
+ //#region ../../node_modules/zod/v4/locales/fi.js
4359
+ const error$28 = () => {
4205
4360
  const Sizable = {
4206
4361
  string: {
4207
4362
  unit: "merkkiä",
@@ -4239,7 +4394,7 @@ const error$27 = () => {
4239
4394
  function getSizing(origin) {
4240
4395
  return Sizable[origin] ?? null;
4241
4396
  }
4242
- const parsedType$2 = (data) => {
4397
+ const parsedType$3 = (data) => {
4243
4398
  const t = typeof data;
4244
4399
  switch (t) {
4245
4400
  case "number": {
@@ -4291,7 +4446,7 @@ const error$27 = () => {
4291
4446
  };
4292
4447
  return (issue$1) => {
4293
4448
  switch (issue$1.code) {
4294
- case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$2(issue$1.input)}`;
4449
+ case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$3(issue$1.input)}`;
4295
4450
  case "invalid_value":
4296
4451
  if (issue$1.values.length === 1) return `Virheellinen syöte: täytyy olla ${stringifyPrimitive(issue$1.values[0])}`;
4297
4452
  return `Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(issue$1.values, "|")}`;
@@ -4331,12 +4486,12 @@ const error$27 = () => {
4331
4486
  };
4332
4487
  };
4333
4488
  function fi_default() {
4334
- return { localeError: error$27() };
4489
+ return { localeError: error$28() };
4335
4490
  }
4336
4491
 
4337
4492
  //#endregion
4338
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr.js
4339
- const error$26 = () => {
4493
+ //#region ../../node_modules/zod/v4/locales/fr.js
4494
+ const error$27 = () => {
4340
4495
  const Sizable = {
4341
4496
  string: {
4342
4497
  unit: "caractères",
@@ -4358,7 +4513,7 @@ const error$26 = () => {
4358
4513
  function getSizing(origin) {
4359
4514
  return Sizable[origin] ?? null;
4360
4515
  }
4361
- const parsedType$2 = (data) => {
4516
+ const parsedType$3 = (data) => {
4362
4517
  const t = typeof data;
4363
4518
  switch (t) {
4364
4519
  case "number": {
@@ -4410,7 +4565,7 @@ const error$26 = () => {
4410
4565
  };
4411
4566
  return (issue$1) => {
4412
4567
  switch (issue$1.code) {
4413
- case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$2(issue$1.input)} reçu`;
4568
+ case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$3(issue$1.input)} reçu`;
4414
4569
  case "invalid_value":
4415
4570
  if (issue$1.values.length === 1) return `Entrée invalide : ${stringifyPrimitive(issue$1.values[0])} attendu`;
4416
4571
  return `Option invalide : une valeur parmi ${joinValues(issue$1.values, "|")} attendue`;
@@ -4446,12 +4601,12 @@ const error$26 = () => {
4446
4601
  };
4447
4602
  };
4448
4603
  function fr_default() {
4449
- return { localeError: error$26() };
4604
+ return { localeError: error$27() };
4450
4605
  }
4451
4606
 
4452
4607
  //#endregion
4453
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr-CA.js
4454
- const error$25 = () => {
4608
+ //#region ../../node_modules/zod/v4/locales/fr-CA.js
4609
+ const error$26 = () => {
4455
4610
  const Sizable = {
4456
4611
  string: {
4457
4612
  unit: "caractères",
@@ -4473,7 +4628,7 @@ const error$25 = () => {
4473
4628
  function getSizing(origin) {
4474
4629
  return Sizable[origin] ?? null;
4475
4630
  }
4476
- const parsedType$2 = (data) => {
4631
+ const parsedType$3 = (data) => {
4477
4632
  const t = typeof data;
4478
4633
  switch (t) {
4479
4634
  case "number": {
@@ -4525,7 +4680,7 @@ const error$25 = () => {
4525
4680
  };
4526
4681
  return (issue$1) => {
4527
4682
  switch (issue$1.code) {
4528
- case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$2(issue$1.input)}`;
4683
+ case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$3(issue$1.input)}`;
4529
4684
  case "invalid_value":
4530
4685
  if (issue$1.values.length === 1) return `Entrée invalide : attendu ${stringifyPrimitive(issue$1.values[0])}`;
4531
4686
  return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue$1.values, "|")}`;
@@ -4563,12 +4718,12 @@ const error$25 = () => {
4563
4718
  };
4564
4719
  };
4565
4720
  function fr_CA_default() {
4566
- return { localeError: error$25() };
4721
+ return { localeError: error$26() };
4567
4722
  }
4568
4723
 
4569
4724
  //#endregion
4570
- //#region ../../node_modules/zod/dist/esm/v4/locales/he.js
4571
- const error$24 = () => {
4725
+ //#region ../../node_modules/zod/v4/locales/he.js
4726
+ const error$25 = () => {
4572
4727
  const Sizable = {
4573
4728
  string: {
4574
4729
  unit: "אותיות",
@@ -4590,7 +4745,7 @@ const error$24 = () => {
4590
4745
  function getSizing(origin) {
4591
4746
  return Sizable[origin] ?? null;
4592
4747
  }
4593
- const parsedType$2 = (data) => {
4748
+ const parsedType$3 = (data) => {
4594
4749
  const t = typeof data;
4595
4750
  switch (t) {
4596
4751
  case "number": {
@@ -4642,7 +4797,7 @@ const error$24 = () => {
4642
4797
  };
4643
4798
  return (issue$1) => {
4644
4799
  switch (issue$1.code) {
4645
- case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$2(issue$1.input)}`;
4800
+ case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$3(issue$1.input)}`;
4646
4801
  case "invalid_value":
4647
4802
  if (issue$1.values.length === 1) return `קלט לא תקין: צריך ${stringifyPrimitive(issue$1.values[0])}`;
4648
4803
  return `קלט לא תקין: צריך אחת מהאפשרויות ${joinValues(issue$1.values, "|")}`;
@@ -4678,12 +4833,12 @@ const error$24 = () => {
4678
4833
  };
4679
4834
  };
4680
4835
  function he_default() {
4681
- return { localeError: error$24() };
4836
+ return { localeError: error$25() };
4682
4837
  }
4683
4838
 
4684
4839
  //#endregion
4685
- //#region ../../node_modules/zod/dist/esm/v4/locales/hu.js
4686
- const error$23 = () => {
4840
+ //#region ../../node_modules/zod/v4/locales/hu.js
4841
+ const error$24 = () => {
4687
4842
  const Sizable = {
4688
4843
  string: {
4689
4844
  unit: "karakter",
@@ -4705,7 +4860,7 @@ const error$23 = () => {
4705
4860
  function getSizing(origin) {
4706
4861
  return Sizable[origin] ?? null;
4707
4862
  }
4708
- const parsedType$2 = (data) => {
4863
+ const parsedType$3 = (data) => {
4709
4864
  const t = typeof data;
4710
4865
  switch (t) {
4711
4866
  case "number": {
@@ -4757,7 +4912,7 @@ const error$23 = () => {
4757
4912
  };
4758
4913
  return (issue$1) => {
4759
4914
  switch (issue$1.code) {
4760
- case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$2(issue$1.input)}`;
4915
+ case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$3(issue$1.input)}`;
4761
4916
  case "invalid_value":
4762
4917
  if (issue$1.values.length === 1) return `Érvénytelen bemenet: a várt érték ${stringifyPrimitive(issue$1.values[0])}`;
4763
4918
  return `Érvénytelen opció: valamelyik érték várt ${joinValues(issue$1.values, "|")}`;
@@ -4793,12 +4948,12 @@ const error$23 = () => {
4793
4948
  };
4794
4949
  };
4795
4950
  function hu_default() {
4796
- return { localeError: error$23() };
4951
+ return { localeError: error$24() };
4797
4952
  }
4798
4953
 
4799
4954
  //#endregion
4800
- //#region ../../node_modules/zod/dist/esm/v4/locales/id.js
4801
- const error$22 = () => {
4955
+ //#region ../../node_modules/zod/v4/locales/id.js
4956
+ const error$23 = () => {
4802
4957
  const Sizable = {
4803
4958
  string: {
4804
4959
  unit: "karakter",
@@ -4820,7 +4975,7 @@ const error$22 = () => {
4820
4975
  function getSizing(origin) {
4821
4976
  return Sizable[origin] ?? null;
4822
4977
  }
4823
- const parsedType$2 = (data) => {
4978
+ const parsedType$3 = (data) => {
4824
4979
  const t = typeof data;
4825
4980
  switch (t) {
4826
4981
  case "number": {
@@ -4872,7 +5027,7 @@ const error$22 = () => {
4872
5027
  };
4873
5028
  return (issue$1) => {
4874
5029
  switch (issue$1.code) {
4875
- case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5030
+ case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
4876
5031
  case "invalid_value":
4877
5032
  if (issue$1.values.length === 1) return `Input tidak valid: diharapkan ${stringifyPrimitive(issue$1.values[0])}`;
4878
5033
  return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue$1.values, "|")}`;
@@ -4908,12 +5063,12 @@ const error$22 = () => {
4908
5063
  };
4909
5064
  };
4910
5065
  function id_default() {
4911
- return { localeError: error$22() };
5066
+ return { localeError: error$23() };
4912
5067
  }
4913
5068
 
4914
5069
  //#endregion
4915
- //#region ../../node_modules/zod/dist/esm/v4/locales/it.js
4916
- const error$21 = () => {
5070
+ //#region ../../node_modules/zod/v4/locales/it.js
5071
+ const error$22 = () => {
4917
5072
  const Sizable = {
4918
5073
  string: {
4919
5074
  unit: "caratteri",
@@ -4935,7 +5090,7 @@ const error$21 = () => {
4935
5090
  function getSizing(origin) {
4936
5091
  return Sizable[origin] ?? null;
4937
5092
  }
4938
- const parsedType$2 = (data) => {
5093
+ const parsedType$3 = (data) => {
4939
5094
  const t = typeof data;
4940
5095
  switch (t) {
4941
5096
  case "number": {
@@ -4987,7 +5142,7 @@ const error$21 = () => {
4987
5142
  };
4988
5143
  return (issue$1) => {
4989
5144
  switch (issue$1.code) {
4990
- case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$2(issue$1.input)}`;
5145
+ case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$3(issue$1.input)}`;
4991
5146
  case "invalid_value":
4992
5147
  if (issue$1.values.length === 1) return `Input non valido: atteso ${stringifyPrimitive(issue$1.values[0])}`;
4993
5148
  return `Opzione non valida: atteso uno tra ${joinValues(issue$1.values, "|")}`;
@@ -5023,12 +5178,12 @@ const error$21 = () => {
5023
5178
  };
5024
5179
  };
5025
5180
  function it_default() {
5026
- return { localeError: error$21() };
5181
+ return { localeError: error$22() };
5027
5182
  }
5028
5183
 
5029
5184
  //#endregion
5030
- //#region ../../node_modules/zod/dist/esm/v4/locales/ja.js
5031
- const error$20 = () => {
5185
+ //#region ../../node_modules/zod/v4/locales/ja.js
5186
+ const error$21 = () => {
5032
5187
  const Sizable = {
5033
5188
  string: {
5034
5189
  unit: "文字",
@@ -5050,7 +5205,7 @@ const error$20 = () => {
5050
5205
  function getSizing(origin) {
5051
5206
  return Sizable[origin] ?? null;
5052
5207
  }
5053
- const parsedType$2 = (data) => {
5208
+ const parsedType$3 = (data) => {
5054
5209
  const t = typeof data;
5055
5210
  switch (t) {
5056
5211
  case "number": {
@@ -5102,21 +5257,21 @@ const error$20 = () => {
5102
5257
  };
5103
5258
  return (issue$1) => {
5104
5259
  switch (issue$1.code) {
5105
- case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$2(issue$1.input)}が入力されました`;
5260
+ case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$3(issue$1.input)}が入力されました`;
5106
5261
  case "invalid_value":
5107
5262
  if (issue$1.values.length === 1) return `無効な入力: ${stringifyPrimitive(issue$1.values[0])}が期待されました`;
5108
5263
  return `無効な選択: ${joinValues(issue$1.values, "、")}のいずれかである必要があります`;
5109
5264
  case "too_big": {
5110
- const adj = issue$1.inclusive ? "<=" : "<";
5265
+ const adj = issue$1.inclusive ? "以下である" : "より小さい";
5111
5266
  const sizing = getSizing(issue$1.origin);
5112
- if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}である必要があります`;
5113
- return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}である必要があります`;
5267
+ if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`;
5268
+ return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}必要があります`;
5114
5269
  }
5115
5270
  case "too_small": {
5116
- const adj = issue$1.inclusive ? ">=" : ">";
5271
+ const adj = issue$1.inclusive ? "以上である" : "より大きい";
5117
5272
  const sizing = getSizing(issue$1.origin);
5118
- if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}である必要があります`;
5119
- return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}である必要があります`;
5273
+ if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}必要があります`;
5274
+ return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}必要があります`;
5120
5275
  }
5121
5276
  case "invalid_format": {
5122
5277
  const _issue = issue$1;
@@ -5136,12 +5291,12 @@ const error$20 = () => {
5136
5291
  };
5137
5292
  };
5138
5293
  function ja_default() {
5139
- return { localeError: error$20() };
5294
+ return { localeError: error$21() };
5140
5295
  }
5141
5296
 
5142
5297
  //#endregion
5143
- //#region ../../node_modules/zod/dist/esm/v4/locales/kh.js
5144
- const error$19 = () => {
5298
+ //#region ../../node_modules/zod/v4/locales/kh.js
5299
+ const error$20 = () => {
5145
5300
  const Sizable = {
5146
5301
  string: {
5147
5302
  unit: "តួអក្សរ",
@@ -5163,7 +5318,7 @@ const error$19 = () => {
5163
5318
  function getSizing(origin) {
5164
5319
  return Sizable[origin] ?? null;
5165
5320
  }
5166
- const parsedType$2 = (data) => {
5321
+ const parsedType$3 = (data) => {
5167
5322
  const t = typeof data;
5168
5323
  switch (t) {
5169
5324
  case "number": {
@@ -5215,7 +5370,7 @@ const error$19 = () => {
5215
5370
  };
5216
5371
  return (issue$1) => {
5217
5372
  switch (issue$1.code) {
5218
- case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$2(issue$1.input)}`;
5373
+ case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$3(issue$1.input)}`;
5219
5374
  case "invalid_value":
5220
5375
  if (issue$1.values.length === 1) return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue$1.values[0])}`;
5221
5376
  return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(issue$1.values, "|")}`;
@@ -5253,12 +5408,12 @@ const error$19 = () => {
5253
5408
  };
5254
5409
  };
5255
5410
  function kh_default() {
5256
- return { localeError: error$19() };
5411
+ return { localeError: error$20() };
5257
5412
  }
5258
5413
 
5259
5414
  //#endregion
5260
- //#region ../../node_modules/zod/dist/esm/v4/locales/ko.js
5261
- const error$18 = () => {
5415
+ //#region ../../node_modules/zod/v4/locales/ko.js
5416
+ const error$19 = () => {
5262
5417
  const Sizable = {
5263
5418
  string: {
5264
5419
  unit: "문자",
@@ -5280,7 +5435,7 @@ const error$18 = () => {
5280
5435
  function getSizing(origin) {
5281
5436
  return Sizable[origin] ?? null;
5282
5437
  }
5283
- const parsedType$2 = (data) => {
5438
+ const parsedType$3 = (data) => {
5284
5439
  const t = typeof data;
5285
5440
  switch (t) {
5286
5441
  case "number": {
@@ -5332,7 +5487,7 @@ const error$18 = () => {
5332
5487
  };
5333
5488
  return (issue$1) => {
5334
5489
  switch (issue$1.code) {
5335
- case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$2(issue$1.input)}입니다`;
5490
+ case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$3(issue$1.input)}입니다`;
5336
5491
  case "invalid_value":
5337
5492
  if (issue$1.values.length === 1) return `잘못된 입력: 값은 ${stringifyPrimitive(issue$1.values[0])} 이어야 합니다`;
5338
5493
  return `잘못된 옵션: ${joinValues(issue$1.values, "또는 ")} 중 하나여야 합니다`;
@@ -5374,12 +5529,12 @@ const error$18 = () => {
5374
5529
  };
5375
5530
  };
5376
5531
  function ko_default() {
5377
- return { localeError: error$18() };
5532
+ return { localeError: error$19() };
5378
5533
  }
5379
5534
 
5380
5535
  //#endregion
5381
- //#region ../../node_modules/zod/dist/esm/v4/locales/mk.js
5382
- const error$17 = () => {
5536
+ //#region ../../node_modules/zod/v4/locales/mk.js
5537
+ const error$18 = () => {
5383
5538
  const Sizable = {
5384
5539
  string: {
5385
5540
  unit: "знаци",
@@ -5401,7 +5556,7 @@ const error$17 = () => {
5401
5556
  function getSizing(origin) {
5402
5557
  return Sizable[origin] ?? null;
5403
5558
  }
5404
- const parsedType$2 = (data) => {
5559
+ const parsedType$3 = (data) => {
5405
5560
  const t = typeof data;
5406
5561
  switch (t) {
5407
5562
  case "number": {
@@ -5453,7 +5608,7 @@ const error$17 = () => {
5453
5608
  };
5454
5609
  return (issue$1) => {
5455
5610
  switch (issue$1.code) {
5456
- case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$2(issue$1.input)}`;
5611
+ case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$3(issue$1.input)}`;
5457
5612
  case "invalid_value":
5458
5613
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
5459
5614
  return `Грешана опција: се очекува една ${joinValues(issue$1.values, "|")}`;
@@ -5491,12 +5646,12 @@ const error$17 = () => {
5491
5646
  };
5492
5647
  };
5493
5648
  function mk_default() {
5494
- return { localeError: error$17() };
5649
+ return { localeError: error$18() };
5495
5650
  }
5496
5651
 
5497
5652
  //#endregion
5498
- //#region ../../node_modules/zod/dist/esm/v4/locales/ms.js
5499
- const error$16 = () => {
5653
+ //#region ../../node_modules/zod/v4/locales/ms.js
5654
+ const error$17 = () => {
5500
5655
  const Sizable = {
5501
5656
  string: {
5502
5657
  unit: "aksara",
@@ -5518,7 +5673,7 @@ const error$16 = () => {
5518
5673
  function getSizing(origin) {
5519
5674
  return Sizable[origin] ?? null;
5520
5675
  }
5521
- const parsedType$2 = (data) => {
5676
+ const parsedType$3 = (data) => {
5522
5677
  const t = typeof data;
5523
5678
  switch (t) {
5524
5679
  case "number": {
@@ -5570,7 +5725,7 @@ const error$16 = () => {
5570
5725
  };
5571
5726
  return (issue$1) => {
5572
5727
  switch (issue$1.code) {
5573
- case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5728
+ case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
5574
5729
  case "invalid_value":
5575
5730
  if (issue$1.values.length === 1) return `Input tidak sah: dijangka ${stringifyPrimitive(issue$1.values[0])}`;
5576
5731
  return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue$1.values, "|")}`;
@@ -5606,12 +5761,12 @@ const error$16 = () => {
5606
5761
  };
5607
5762
  };
5608
5763
  function ms_default() {
5609
- return { localeError: error$16() };
5764
+ return { localeError: error$17() };
5610
5765
  }
5611
5766
 
5612
5767
  //#endregion
5613
- //#region ../../node_modules/zod/dist/esm/v4/locales/nl.js
5614
- const error$15 = () => {
5768
+ //#region ../../node_modules/zod/v4/locales/nl.js
5769
+ const error$16 = () => {
5615
5770
  const Sizable = {
5616
5771
  string: { unit: "tekens" },
5617
5772
  file: { unit: "bytes" },
@@ -5621,7 +5776,7 @@ const error$15 = () => {
5621
5776
  function getSizing(origin) {
5622
5777
  return Sizable[origin] ?? null;
5623
5778
  }
5624
- const parsedType$2 = (data) => {
5779
+ const parsedType$3 = (data) => {
5625
5780
  const t = typeof data;
5626
5781
  switch (t) {
5627
5782
  case "number": {
@@ -5673,7 +5828,7 @@ const error$15 = () => {
5673
5828
  };
5674
5829
  return (issue$1) => {
5675
5830
  switch (issue$1.code) {
5676
- case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$2(issue$1.input)}`;
5831
+ case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$3(issue$1.input)}`;
5677
5832
  case "invalid_value":
5678
5833
  if (issue$1.values.length === 1) return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue$1.values[0])}`;
5679
5834
  return `Ongeldige optie: verwacht één van ${joinValues(issue$1.values, "|")}`;
@@ -5711,12 +5866,12 @@ const error$15 = () => {
5711
5866
  };
5712
5867
  };
5713
5868
  function nl_default() {
5714
- return { localeError: error$15() };
5869
+ return { localeError: error$16() };
5715
5870
  }
5716
5871
 
5717
5872
  //#endregion
5718
- //#region ../../node_modules/zod/dist/esm/v4/locales/no.js
5719
- const error$14 = () => {
5873
+ //#region ../../node_modules/zod/v4/locales/no.js
5874
+ const error$15 = () => {
5720
5875
  const Sizable = {
5721
5876
  string: {
5722
5877
  unit: "tegn",
@@ -5738,7 +5893,7 @@ const error$14 = () => {
5738
5893
  function getSizing(origin) {
5739
5894
  return Sizable[origin] ?? null;
5740
5895
  }
5741
- const parsedType$2 = (data) => {
5896
+ const parsedType$3 = (data) => {
5742
5897
  const t = typeof data;
5743
5898
  switch (t) {
5744
5899
  case "number": {
@@ -5790,7 +5945,7 @@ const error$14 = () => {
5790
5945
  };
5791
5946
  return (issue$1) => {
5792
5947
  switch (issue$1.code) {
5793
- case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$2(issue$1.input)}`;
5948
+ case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$3(issue$1.input)}`;
5794
5949
  case "invalid_value":
5795
5950
  if (issue$1.values.length === 1) return `Ugyldig verdi: forventet ${stringifyPrimitive(issue$1.values[0])}`;
5796
5951
  return `Ugyldig valg: forventet en av ${joinValues(issue$1.values, "|")}`;
@@ -5826,12 +5981,12 @@ const error$14 = () => {
5826
5981
  };
5827
5982
  };
5828
5983
  function no_default() {
5829
- return { localeError: error$14() };
5984
+ return { localeError: error$15() };
5830
5985
  }
5831
5986
 
5832
5987
  //#endregion
5833
- //#region ../../node_modules/zod/dist/esm/v4/locales/ota.js
5834
- const error$13 = () => {
5988
+ //#region ../../node_modules/zod/v4/locales/ota.js
5989
+ const error$14 = () => {
5835
5990
  const Sizable = {
5836
5991
  string: {
5837
5992
  unit: "harf",
@@ -5853,7 +6008,7 @@ const error$13 = () => {
5853
6008
  function getSizing(origin) {
5854
6009
  return Sizable[origin] ?? null;
5855
6010
  }
5856
- const parsedType$2 = (data) => {
6011
+ const parsedType$3 = (data) => {
5857
6012
  const t = typeof data;
5858
6013
  switch (t) {
5859
6014
  case "number": {
@@ -5905,7 +6060,7 @@ const error$13 = () => {
5905
6060
  };
5906
6061
  return (issue$1) => {
5907
6062
  switch (issue$1.code) {
5908
- case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$2(issue$1.input)}`;
6063
+ case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$3(issue$1.input)}`;
5909
6064
  case "invalid_value":
5910
6065
  if (issue$1.values.length === 1) return `Fâsit giren: umulan ${stringifyPrimitive(issue$1.values[0])}`;
5911
6066
  return `Fâsit tercih: mûteberler ${joinValues(issue$1.values, "|")}`;
@@ -5941,11 +6096,138 @@ const error$13 = () => {
5941
6096
  };
5942
6097
  };
5943
6098
  function ota_default() {
6099
+ return { localeError: error$14() };
6100
+ }
6101
+
6102
+ //#endregion
6103
+ //#region ../../node_modules/zod/v4/locales/ps.js
6104
+ const error$13 = () => {
6105
+ const Sizable = {
6106
+ string: {
6107
+ unit: "توکي",
6108
+ verb: "ولري"
6109
+ },
6110
+ file: {
6111
+ unit: "بایټس",
6112
+ verb: "ولري"
6113
+ },
6114
+ array: {
6115
+ unit: "توکي",
6116
+ verb: "ولري"
6117
+ },
6118
+ set: {
6119
+ unit: "توکي",
6120
+ verb: "ولري"
6121
+ }
6122
+ };
6123
+ function getSizing(origin) {
6124
+ return Sizable[origin] ?? null;
6125
+ }
6126
+ const parsedType$3 = (data) => {
6127
+ const t = typeof data;
6128
+ switch (t) {
6129
+ case "number": {
6130
+ return Number.isNaN(data) ? "NaN" : "عدد";
6131
+ }
6132
+ case "object": {
6133
+ if (Array.isArray(data)) {
6134
+ return "ارې";
6135
+ }
6136
+ if (data === null) {
6137
+ return "null";
6138
+ }
6139
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
6140
+ return data.constructor.name;
6141
+ }
6142
+ }
6143
+ }
6144
+ return t;
6145
+ };
6146
+ const Nouns = {
6147
+ regex: "ورودي",
6148
+ email: "بریښنالیک",
6149
+ url: "یو آر ال",
6150
+ emoji: "ایموجي",
6151
+ uuid: "UUID",
6152
+ uuidv4: "UUIDv4",
6153
+ uuidv6: "UUIDv6",
6154
+ nanoid: "nanoid",
6155
+ guid: "GUID",
6156
+ cuid: "cuid",
6157
+ cuid2: "cuid2",
6158
+ ulid: "ULID",
6159
+ xid: "XID",
6160
+ ksuid: "KSUID",
6161
+ datetime: "نیټه او وخت",
6162
+ date: "نېټه",
6163
+ time: "وخت",
6164
+ duration: "موده",
6165
+ ipv4: "د IPv4 پته",
6166
+ ipv6: "د IPv6 پته",
6167
+ cidrv4: "د IPv4 ساحه",
6168
+ cidrv6: "د IPv6 ساحه",
6169
+ base64: "base64-encoded متن",
6170
+ base64url: "base64url-encoded متن",
6171
+ json_string: "JSON متن",
6172
+ e164: "د E.164 شمېره",
6173
+ jwt: "JWT",
6174
+ template_literal: "ورودي"
6175
+ };
6176
+ return (issue$1) => {
6177
+ switch (issue$1.code) {
6178
+ case "invalid_type": return `ناسم ورودي: باید ${issue$1.expected} وای, مګر ${parsedType$3(issue$1.input)} ترلاسه شو`;
6179
+ case "invalid_value":
6180
+ if (issue$1.values.length === 1) {
6181
+ return `ناسم ورودي: باید ${stringifyPrimitive(issue$1.values[0])} وای`;
6182
+ }
6183
+ return `ناسم انتخاب: باید یو له ${joinValues(issue$1.values, "|")} څخه وای`;
6184
+ case "too_big": {
6185
+ const adj = issue$1.inclusive ? "<=" : "<";
6186
+ const sizing = getSizing(issue$1.origin);
6187
+ if (sizing) {
6188
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
6189
+ }
6190
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} وي`;
6191
+ }
6192
+ case "too_small": {
6193
+ const adj = issue$1.inclusive ? ">=" : ">";
6194
+ const sizing = getSizing(issue$1.origin);
6195
+ if (sizing) {
6196
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} ${sizing.unit} ولري`;
6197
+ }
6198
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} وي`;
6199
+ }
6200
+ case "invalid_format": {
6201
+ const _issue = issue$1;
6202
+ if (_issue.format === "starts_with") {
6203
+ return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
6204
+ }
6205
+ if (_issue.format === "ends_with") {
6206
+ return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
6207
+ }
6208
+ if (_issue.format === "includes") {
6209
+ return `ناسم متن: باید "${_issue.includes}" ولري`;
6210
+ }
6211
+ if (_issue.format === "regex") {
6212
+ return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
6213
+ }
6214
+ return `${Nouns[_issue.format] ?? issue$1.format} ناسم دی`;
6215
+ }
6216
+ case "not_multiple_of": return `ناسم عدد: باید د ${issue$1.divisor} مضرب وي`;
6217
+ case "unrecognized_keys": return `ناسم ${issue$1.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${joinValues(issue$1.keys, ", ")}`;
6218
+ case "invalid_key": return `ناسم کلیډ په ${issue$1.origin} کې`;
6219
+ case "invalid_union": return `ناسمه ورودي`;
6220
+ case "invalid_element": return `ناسم عنصر په ${issue$1.origin} کې`;
6221
+ default: return `ناسمه ورودي`;
6222
+ }
6223
+ };
6224
+ };
6225
+ function ps_default() {
5944
6226
  return { localeError: error$13() };
5945
6227
  }
5946
6228
 
5947
6229
  //#endregion
5948
- //#region ../../node_modules/zod/dist/esm/v4/locales/pl.js
6230
+ //#region ../../node_modules/zod/v4/locales/pl.js
5949
6231
  const error$12 = () => {
5950
6232
  const Sizable = {
5951
6233
  string: {
@@ -5968,7 +6250,7 @@ const error$12 = () => {
5968
6250
  function getSizing(origin) {
5969
6251
  return Sizable[origin] ?? null;
5970
6252
  }
5971
- const parsedType$2 = (data) => {
6253
+ const parsedType$3 = (data) => {
5972
6254
  const t = typeof data;
5973
6255
  switch (t) {
5974
6256
  case "number": {
@@ -6020,7 +6302,7 @@ const error$12 = () => {
6020
6302
  };
6021
6303
  return (issue$1) => {
6022
6304
  switch (issue$1.code) {
6023
- case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$2(issue$1.input)}`;
6305
+ case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$3(issue$1.input)}`;
6024
6306
  case "invalid_value":
6025
6307
  if (issue$1.values.length === 1) return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue$1.values[0])}`;
6026
6308
  return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(issue$1.values, "|")}`;
@@ -6062,7 +6344,7 @@ function pl_default() {
6062
6344
  }
6063
6345
 
6064
6346
  //#endregion
6065
- //#region ../../node_modules/zod/dist/esm/v4/locales/pt.js
6347
+ //#region ../../node_modules/zod/v4/locales/pt.js
6066
6348
  const error$11 = () => {
6067
6349
  const Sizable = {
6068
6350
  string: {
@@ -6085,7 +6367,7 @@ const error$11 = () => {
6085
6367
  function getSizing(origin) {
6086
6368
  return Sizable[origin] ?? null;
6087
6369
  }
6088
- const parsedType$2 = (data) => {
6370
+ const parsedType$3 = (data) => {
6089
6371
  const t = typeof data;
6090
6372
  switch (t) {
6091
6373
  case "number": {
@@ -6137,7 +6419,7 @@ const error$11 = () => {
6137
6419
  };
6138
6420
  return (issue$1) => {
6139
6421
  switch (issue$1.code) {
6140
- case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$2(issue$1.input)}`;
6422
+ case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$3(issue$1.input)}`;
6141
6423
  case "invalid_value":
6142
6424
  if (issue$1.values.length === 1) return `Entrada inválida: esperado ${stringifyPrimitive(issue$1.values[0])}`;
6143
6425
  return `Opção inválida: esperada uma das ${joinValues(issue$1.values, "|")}`;
@@ -6177,7 +6459,7 @@ function pt_default() {
6177
6459
  }
6178
6460
 
6179
6461
  //#endregion
6180
- //#region ../../node_modules/zod/dist/esm/v4/locales/ru.js
6462
+ //#region ../../node_modules/zod/v4/locales/ru.js
6181
6463
  function getRussianPlural(count, one, few, many) {
6182
6464
  const absCount = Math.abs(count);
6183
6465
  const lastDigit = absCount % 10;
@@ -6231,7 +6513,7 @@ const error$10 = () => {
6231
6513
  function getSizing(origin) {
6232
6514
  return Sizable[origin] ?? null;
6233
6515
  }
6234
- const parsedType$2 = (data) => {
6516
+ const parsedType$3 = (data) => {
6235
6517
  const t = typeof data;
6236
6518
  switch (t) {
6237
6519
  case "number": {
@@ -6283,7 +6565,7 @@ const error$10 = () => {
6283
6565
  };
6284
6566
  return (issue$1) => {
6285
6567
  switch (issue$1.code) {
6286
- case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$2(issue$1.input)}`;
6568
+ case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$3(issue$1.input)}`;
6287
6569
  case "invalid_value":
6288
6570
  if (issue$1.values.length === 1) return `Неверный ввод: ожидалось ${stringifyPrimitive(issue$1.values[0])}`;
6289
6571
  return `Неверный вариант: ожидалось одно из ${joinValues(issue$1.values, "|")}`;
@@ -6329,7 +6611,7 @@ function ru_default() {
6329
6611
  }
6330
6612
 
6331
6613
  //#endregion
6332
- //#region ../../node_modules/zod/dist/esm/v4/locales/sl.js
6614
+ //#region ../../node_modules/zod/v4/locales/sl.js
6333
6615
  const error$9 = () => {
6334
6616
  const Sizable = {
6335
6617
  string: {
@@ -6352,7 +6634,7 @@ const error$9 = () => {
6352
6634
  function getSizing(origin) {
6353
6635
  return Sizable[origin] ?? null;
6354
6636
  }
6355
- const parsedType$2 = (data) => {
6637
+ const parsedType$3 = (data) => {
6356
6638
  const t = typeof data;
6357
6639
  switch (t) {
6358
6640
  case "number": {
@@ -6404,7 +6686,7 @@ const error$9 = () => {
6404
6686
  };
6405
6687
  return (issue$1) => {
6406
6688
  switch (issue$1.code) {
6407
- case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$2(issue$1.input)}`;
6689
+ case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$3(issue$1.input)}`;
6408
6690
  case "invalid_value":
6409
6691
  if (issue$1.values.length === 1) return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue$1.values[0])}`;
6410
6692
  return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue$1.values, "|")}`;
@@ -6446,7 +6728,7 @@ function sl_default() {
6446
6728
  }
6447
6729
 
6448
6730
  //#endregion
6449
- //#region ../../node_modules/zod/dist/esm/v4/locales/sv.js
6731
+ //#region ../../node_modules/zod/v4/locales/sv.js
6450
6732
  const error$8 = () => {
6451
6733
  const Sizable = {
6452
6734
  string: {
@@ -6469,7 +6751,7 @@ const error$8 = () => {
6469
6751
  function getSizing(origin) {
6470
6752
  return Sizable[origin] ?? null;
6471
6753
  }
6472
- const parsedType$2 = (data) => {
6754
+ const parsedType$3 = (data) => {
6473
6755
  const t = typeof data;
6474
6756
  switch (t) {
6475
6757
  case "number": {
@@ -6521,7 +6803,7 @@ const error$8 = () => {
6521
6803
  };
6522
6804
  return (issue$1) => {
6523
6805
  switch (issue$1.code) {
6524
- case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$2(issue$1.input)}`;
6806
+ case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$3(issue$1.input)}`;
6525
6807
  case "invalid_value":
6526
6808
  if (issue$1.values.length === 1) return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue$1.values[0])}`;
6527
6809
  return `Ogiltigt val: förväntade en av ${joinValues(issue$1.values, "|")}`;
@@ -6565,7 +6847,7 @@ function sv_default() {
6565
6847
  }
6566
6848
 
6567
6849
  //#endregion
6568
- //#region ../../node_modules/zod/dist/esm/v4/locales/ta.js
6850
+ //#region ../../node_modules/zod/v4/locales/ta.js
6569
6851
  const error$7 = () => {
6570
6852
  const Sizable = {
6571
6853
  string: {
@@ -6588,7 +6870,7 @@ const error$7 = () => {
6588
6870
  function getSizing(origin) {
6589
6871
  return Sizable[origin] ?? null;
6590
6872
  }
6591
- const parsedType$2 = (data) => {
6873
+ const parsedType$3 = (data) => {
6592
6874
  const t = typeof data;
6593
6875
  switch (t) {
6594
6876
  case "number": {
@@ -6640,7 +6922,7 @@ const error$7 = () => {
6640
6922
  };
6641
6923
  return (issue$1) => {
6642
6924
  switch (issue$1.code) {
6643
- case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$2(issue$1.input)}`;
6925
+ case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$3(issue$1.input)}`;
6644
6926
  case "invalid_value":
6645
6927
  if (issue$1.values.length === 1) return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue$1.values[0])}`;
6646
6928
  return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(issue$1.values, "|")} இல் ஒன்று`;
@@ -6682,7 +6964,7 @@ function ta_default() {
6682
6964
  }
6683
6965
 
6684
6966
  //#endregion
6685
- //#region ../../node_modules/zod/dist/esm/v4/locales/th.js
6967
+ //#region ../../node_modules/zod/v4/locales/th.js
6686
6968
  const error$6 = () => {
6687
6969
  const Sizable = {
6688
6970
  string: {
@@ -6705,7 +6987,7 @@ const error$6 = () => {
6705
6987
  function getSizing(origin) {
6706
6988
  return Sizable[origin] ?? null;
6707
6989
  }
6708
- const parsedType$2 = (data) => {
6990
+ const parsedType$3 = (data) => {
6709
6991
  const t = typeof data;
6710
6992
  switch (t) {
6711
6993
  case "number": {
@@ -6757,7 +7039,7 @@ const error$6 = () => {
6757
7039
  };
6758
7040
  return (issue$1) => {
6759
7041
  switch (issue$1.code) {
6760
- case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$2(issue$1.input)}`;
7042
+ case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$3(issue$1.input)}`;
6761
7043
  case "invalid_value":
6762
7044
  if (issue$1.values.length === 1) return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue$1.values[0])}`;
6763
7045
  return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(issue$1.values, "|")}`;
@@ -6799,7 +7081,7 @@ function th_default() {
6799
7081
  }
6800
7082
 
6801
7083
  //#endregion
6802
- //#region ../../node_modules/zod/dist/esm/v4/locales/tr.js
7084
+ //#region ../../node_modules/zod/v4/locales/tr.js
6803
7085
  const parsedType = (data) => {
6804
7086
  const t = typeof data;
6805
7087
  switch (t) {
@@ -6912,7 +7194,7 @@ function tr_default() {
6912
7194
  }
6913
7195
 
6914
7196
  //#endregion
6915
- //#region ../../node_modules/zod/dist/esm/v4/locales/ua.js
7197
+ //#region ../../node_modules/zod/v4/locales/ua.js
6916
7198
  const error$4 = () => {
6917
7199
  const Sizable = {
6918
7200
  string: {
@@ -6935,7 +7217,7 @@ const error$4 = () => {
6935
7217
  function getSizing(origin) {
6936
7218
  return Sizable[origin] ?? null;
6937
7219
  }
6938
- const parsedType$2 = (data) => {
7220
+ const parsedType$3 = (data) => {
6939
7221
  const t = typeof data;
6940
7222
  switch (t) {
6941
7223
  case "number": {
@@ -6987,7 +7269,7 @@ const error$4 = () => {
6987
7269
  };
6988
7270
  return (issue$1) => {
6989
7271
  switch (issue$1.code) {
6990
- case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$2(issue$1.input)}`;
7272
+ case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$3(issue$1.input)}`;
6991
7273
  case "invalid_value":
6992
7274
  if (issue$1.values.length === 1) return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue$1.values[0])}`;
6993
7275
  return `Неправильна опція: очікується одне з ${joinValues(issue$1.values, "|")}`;
@@ -7027,7 +7309,7 @@ function ua_default() {
7027
7309
  }
7028
7310
 
7029
7311
  //#endregion
7030
- //#region ../../node_modules/zod/dist/esm/v4/locales/ur.js
7312
+ //#region ../../node_modules/zod/v4/locales/ur.js
7031
7313
  const error$3 = () => {
7032
7314
  const Sizable = {
7033
7315
  string: {
@@ -7050,7 +7332,7 @@ const error$3 = () => {
7050
7332
  function getSizing(origin) {
7051
7333
  return Sizable[origin] ?? null;
7052
7334
  }
7053
- const parsedType$2 = (data) => {
7335
+ const parsedType$3 = (data) => {
7054
7336
  const t = typeof data;
7055
7337
  switch (t) {
7056
7338
  case "number": {
@@ -7102,7 +7384,7 @@ const error$3 = () => {
7102
7384
  };
7103
7385
  return (issue$1) => {
7104
7386
  switch (issue$1.code) {
7105
- case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$2(issue$1.input)} موصول ہوا`;
7387
+ case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$3(issue$1.input)} موصول ہوا`;
7106
7388
  case "invalid_value":
7107
7389
  if (issue$1.values.length === 1) return `غلط ان پٹ: ${stringifyPrimitive(issue$1.values[0])} متوقع تھا`;
7108
7390
  return `غلط آپشن: ${joinValues(issue$1.values, "|")} میں سے ایک متوقع تھا`;
@@ -7144,7 +7426,7 @@ function ur_default() {
7144
7426
  }
7145
7427
 
7146
7428
  //#endregion
7147
- //#region ../../node_modules/zod/dist/esm/v4/locales/vi.js
7429
+ //#region ../../node_modules/zod/v4/locales/vi.js
7148
7430
  const error$2 = () => {
7149
7431
  const Sizable = {
7150
7432
  string: {
@@ -7167,7 +7449,7 @@ const error$2 = () => {
7167
7449
  function getSizing(origin) {
7168
7450
  return Sizable[origin] ?? null;
7169
7451
  }
7170
- const parsedType$2 = (data) => {
7452
+ const parsedType$3 = (data) => {
7171
7453
  const t = typeof data;
7172
7454
  switch (t) {
7173
7455
  case "number": {
@@ -7219,7 +7501,7 @@ const error$2 = () => {
7219
7501
  };
7220
7502
  return (issue$1) => {
7221
7503
  switch (issue$1.code) {
7222
- 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)}`;
7504
+ 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)}`;
7223
7505
  case "invalid_value":
7224
7506
  if (issue$1.values.length === 1) return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue$1.values[0])}`;
7225
7507
  return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(issue$1.values, "|")}`;
@@ -7259,7 +7541,7 @@ function vi_default() {
7259
7541
  }
7260
7542
 
7261
7543
  //#endregion
7262
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-CN.js
7544
+ //#region ../../node_modules/zod/v4/locales/zh-CN.js
7263
7545
  const error$1 = () => {
7264
7546
  const Sizable = {
7265
7547
  string: {
@@ -7282,7 +7564,7 @@ const error$1 = () => {
7282
7564
  function getSizing(origin) {
7283
7565
  return Sizable[origin] ?? null;
7284
7566
  }
7285
- const parsedType$2 = (data) => {
7567
+ const parsedType$3 = (data) => {
7286
7568
  const t = typeof data;
7287
7569
  switch (t) {
7288
7570
  case "number": {
@@ -7334,7 +7616,7 @@ const error$1 = () => {
7334
7616
  };
7335
7617
  return (issue$1) => {
7336
7618
  switch (issue$1.code) {
7337
- case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$2(issue$1.input)}`;
7619
+ case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$3(issue$1.input)}`;
7338
7620
  case "invalid_value":
7339
7621
  if (issue$1.values.length === 1) return `无效输入:期望 ${stringifyPrimitive(issue$1.values[0])}`;
7340
7622
  return `无效选项:期望以下之一 ${joinValues(issue$1.values, "|")}`;
@@ -7374,7 +7656,7 @@ function zh_CN_default() {
7374
7656
  }
7375
7657
 
7376
7658
  //#endregion
7377
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-TW.js
7659
+ //#region ../../node_modules/zod/v4/locales/zh-TW.js
7378
7660
  const error = () => {
7379
7661
  const Sizable = {
7380
7662
  string: {
@@ -7397,7 +7679,7 @@ const error = () => {
7397
7679
  function getSizing(origin) {
7398
7680
  return Sizable[origin] ?? null;
7399
7681
  }
7400
- const parsedType$2 = (data) => {
7682
+ const parsedType$3 = (data) => {
7401
7683
  const t = typeof data;
7402
7684
  switch (t) {
7403
7685
  case "number": {
@@ -7449,7 +7731,7 @@ const error = () => {
7449
7731
  };
7450
7732
  return (issue$1) => {
7451
7733
  switch (issue$1.code) {
7452
- case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$2(issue$1.input)}`;
7734
+ case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$3(issue$1.input)}`;
7453
7735
  case "invalid_value":
7454
7736
  if (issue$1.values.length === 1) return `無效的輸入值:預期為 ${stringifyPrimitive(issue$1.values[0])}`;
7455
7737
  return `無效的選項:預期為以下其中之一 ${joinValues(issue$1.values, "|")}`;
@@ -7491,7 +7773,7 @@ function zh_TW_default() {
7491
7773
  }
7492
7774
 
7493
7775
  //#endregion
7494
- //#region ../../node_modules/zod/dist/esm/v4/locales/index.js
7776
+ //#region ../../node_modules/zod/v4/locales/index.js
7495
7777
  var locales_exports = {};
7496
7778
  __export(locales_exports, {
7497
7779
  ar: () => ar_default,
@@ -7501,6 +7783,7 @@ __export(locales_exports, {
7501
7783
  cs: () => cs_default,
7502
7784
  de: () => de_default,
7503
7785
  en: () => en_default,
7786
+ eo: () => eo_default,
7504
7787
  es: () => es_default,
7505
7788
  fa: () => fa_default,
7506
7789
  fi: () => fi_default,
@@ -7519,6 +7802,7 @@ __export(locales_exports, {
7519
7802
  no: () => no_default,
7520
7803
  ota: () => ota_default,
7521
7804
  pl: () => pl_default,
7805
+ ps: () => ps_default,
7522
7806
  pt: () => pt_default,
7523
7807
  ru: () => ru_default,
7524
7808
  sl: () => sl_default,
@@ -7534,12 +7818,12 @@ __export(locales_exports, {
7534
7818
  });
7535
7819
 
7536
7820
  //#endregion
7537
- //#region ../../node_modules/zod/dist/esm/v4/core/registries.js
7821
+ //#region ../../node_modules/zod/v4/core/registries.js
7538
7822
  const $output = Symbol("ZodOutput");
7539
7823
  const $input = Symbol("ZodInput");
7540
7824
  var $ZodRegistry = class {
7541
7825
  constructor() {
7542
- this._map = new WeakMap();
7826
+ this._map = new Map();
7543
7827
  this._idmap = new Map();
7544
7828
  }
7545
7829
  add(schema, ..._meta) {
@@ -7553,7 +7837,16 @@ var $ZodRegistry = class {
7553
7837
  }
7554
7838
  return this;
7555
7839
  }
7840
+ clear() {
7841
+ this._map = new Map();
7842
+ this._idmap = new Map();
7843
+ return this;
7844
+ }
7556
7845
  remove(schema) {
7846
+ const meta = this._map.get(schema);
7847
+ if (meta && typeof meta === "object" && "id" in meta) {
7848
+ this._idmap.delete(meta.id);
7849
+ }
7557
7850
  this._map.delete(schema);
7558
7851
  return this;
7559
7852
  }
@@ -7579,7 +7872,7 @@ function registry() {
7579
7872
  const globalRegistry = /* @__PURE__ */ registry();
7580
7873
 
7581
7874
  //#endregion
7582
- //#region ../../node_modules/zod/dist/esm/v4/core/api.js
7875
+ //#region ../../node_modules/zod/v4/core/api.js
7583
7876
  function _string(Class$1, params) {
7584
7877
  return new Class$1({
7585
7878
  type: "string",
@@ -7794,6 +8087,13 @@ function _jwt(Class$1, params) {
7794
8087
  ...normalizeParams(params)
7795
8088
  });
7796
8089
  }
8090
+ const TimePrecision = {
8091
+ Any: null,
8092
+ Minute: -1,
8093
+ Second: 0,
8094
+ Millisecond: 3,
8095
+ Microsecond: 6
8096
+ };
7797
8097
  function _isoDateTime(Class$1, params) {
7798
8098
  return new Class$1({
7799
8099
  type: "string",
@@ -8360,8 +8660,8 @@ function _refine(Class$1, fn, _params) {
8360
8660
  return schema;
8361
8661
  }
8362
8662
  function _stringbool(Classes, _params) {
8363
- const { case: _case, error: error$37, truthy, falsy } = normalizeParams(_params);
8364
- let truthyArray = truthy ?? [
8663
+ const params = normalizeParams(_params);
8664
+ let truthyArray = params.truthy ?? [
8365
8665
  "true",
8366
8666
  "1",
8367
8667
  "yes",
@@ -8369,7 +8669,7 @@ function _stringbool(Classes, _params) {
8369
8669
  "y",
8370
8670
  "enabled"
8371
8671
  ];
8372
- let falsyArray = falsy ?? [
8672
+ let falsyArray = params.falsy ?? [
8373
8673
  "false",
8374
8674
  "0",
8375
8675
  "no",
@@ -8377,7 +8677,7 @@ function _stringbool(Classes, _params) {
8377
8677
  "n",
8378
8678
  "disabled"
8379
8679
  ];
8380
- if (_case !== "sensitive") {
8680
+ if (params.case !== "sensitive") {
8381
8681
  truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8382
8682
  falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8383
8683
  }
@@ -8391,7 +8691,7 @@ function _stringbool(Classes, _params) {
8391
8691
  type: "transform",
8392
8692
  transform: (input, payload) => {
8393
8693
  let data = input;
8394
- if (_case !== "sensitive") data = data.toLowerCase();
8694
+ if (params.case !== "sensitive") data = data.toLowerCase();
8395
8695
  if (truthySet.has(data)) {
8396
8696
  return true;
8397
8697
  } else if (falsySet.has(data)) {
@@ -8407,31 +8707,47 @@ function _stringbool(Classes, _params) {
8407
8707
  return {};
8408
8708
  }
8409
8709
  },
8410
- error: error$37
8710
+ error: params.error
8411
8711
  });
8412
8712
  const innerPipe = new _Pipe({
8413
8713
  type: "pipe",
8414
8714
  in: new _String({
8415
8715
  type: "string",
8416
- error: error$37
8716
+ error: params.error
8417
8717
  }),
8418
8718
  out: tx,
8419
- error: error$37
8719
+ error: params.error
8420
8720
  });
8421
8721
  const outerPipe = new _Pipe({
8422
8722
  type: "pipe",
8423
8723
  in: innerPipe,
8424
8724
  out: new _Boolean({
8425
8725
  type: "boolean",
8426
- error: error$37
8726
+ error: params.error
8427
8727
  }),
8428
- error: error$37
8728
+ error: params.error
8429
8729
  });
8430
8730
  return outerPipe;
8431
8731
  }
8732
+ function _stringFormat(Class$1, format, fnOrRegex, _params = {}) {
8733
+ const params = normalizeParams(_params);
8734
+ const def = {
8735
+ ...normalizeParams(_params),
8736
+ check: "string_format",
8737
+ type: "string",
8738
+ format,
8739
+ fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
8740
+ ...params
8741
+ };
8742
+ if (fnOrRegex instanceof RegExp) {
8743
+ def.pattern = fnOrRegex;
8744
+ }
8745
+ const inst = new Class$1(def);
8746
+ return inst;
8747
+ }
8432
8748
 
8433
8749
  //#endregion
8434
- //#region ../../node_modules/zod/dist/esm/v4/core/function.js
8750
+ //#region ../../node_modules/zod/v4/core/function.js
8435
8751
  var $ZodFunction = class {
8436
8752
  constructor(def) {
8437
8753
  this._def = def;
@@ -8502,7 +8818,7 @@ function _function(params) {
8502
8818
  }
8503
8819
 
8504
8820
  //#endregion
8505
- //#region ../../node_modules/zod/dist/esm/v4/core/to-json-schema.js
8821
+ //#region ../../node_modules/zod/v4/core/to-json-schema.js
8506
8822
  var JSONSchemaGenerator = class {
8507
8823
  constructor(params) {
8508
8824
  this.counter = 0;
@@ -8538,431 +8854,435 @@ var JSONSchemaGenerator = class {
8538
8854
  const result = {
8539
8855
  schema: {},
8540
8856
  count: 1,
8541
- cycle: undefined
8542
- };
8543
- this.seen.set(schema, result);
8544
- if (schema._zod.toJSONSchema) {
8545
- result.schema = schema._zod.toJSONSchema();
8546
- }
8547
- const params = {
8548
- ..._params,
8549
- schemaPath: [..._params.schemaPath, schema],
8857
+ cycle: undefined,
8550
8858
  path: _params.path
8551
8859
  };
8552
- const parent = schema._zod.parent;
8553
- if (parent) {
8554
- result.ref = parent;
8555
- this.process(parent, params);
8556
- this.seen.get(parent).isParent = true;
8860
+ this.seen.set(schema, result);
8861
+ const overrideSchema = schema._zod.toJSONSchema?.();
8862
+ if (overrideSchema) {
8863
+ result.schema = overrideSchema;
8557
8864
  } else {
8558
- const _json = result.schema;
8559
- switch (def.type) {
8560
- case "string": {
8561
- const json$1 = _json;
8562
- json$1.type = "string";
8563
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8564
- if (typeof minimum === "number") json$1.minLength = minimum;
8565
- if (typeof maximum === "number") json$1.maxLength = maximum;
8566
- if (format) {
8567
- json$1.format = formatMap[format] ?? format;
8568
- if (json$1.format === "") delete json$1.format;
8865
+ const params = {
8866
+ ..._params,
8867
+ schemaPath: [..._params.schemaPath, schema],
8868
+ path: _params.path
8869
+ };
8870
+ const parent = schema._zod.parent;
8871
+ if (parent) {
8872
+ result.ref = parent;
8873
+ this.process(parent, params);
8874
+ this.seen.get(parent).isParent = true;
8875
+ } else {
8876
+ const _json = result.schema;
8877
+ switch (def.type) {
8878
+ case "string": {
8879
+ const json$1 = _json;
8880
+ json$1.type = "string";
8881
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8882
+ if (typeof minimum === "number") json$1.minLength = minimum;
8883
+ if (typeof maximum === "number") json$1.maxLength = maximum;
8884
+ if (format) {
8885
+ json$1.format = formatMap[format] ?? format;
8886
+ if (json$1.format === "") delete json$1.format;
8887
+ }
8888
+ if (contentEncoding) json$1.contentEncoding = contentEncoding;
8889
+ if (patterns && patterns.size > 0) {
8890
+ const regexes = [...patterns];
8891
+ if (regexes.length === 1) json$1.pattern = regexes[0].source;
8892
+ else if (regexes.length > 1) {
8893
+ result.schema.allOf = [...regexes.map((regex) => ({
8894
+ ...this.target === "draft-7" ? { type: "string" } : {},
8895
+ pattern: regex.source
8896
+ }))];
8897
+ }
8898
+ }
8899
+ break;
8569
8900
  }
8570
- if (contentEncoding) json$1.contentEncoding = contentEncoding;
8571
- if (patterns && patterns.size > 0) {
8572
- const regexes = [...patterns];
8573
- if (regexes.length === 1) json$1.pattern = regexes[0].source;
8574
- else if (regexes.length > 1) {
8575
- result.schema.allOf = [...regexes.map((regex) => ({
8576
- ...this.target === "draft-7" ? { type: "string" } : {},
8577
- pattern: regex.source
8578
- }))];
8901
+ case "number": {
8902
+ const json$1 = _json;
8903
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8904
+ if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8905
+ else json$1.type = "number";
8906
+ if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8907
+ if (typeof minimum === "number") {
8908
+ json$1.minimum = minimum;
8909
+ if (typeof exclusiveMinimum === "number") {
8910
+ if (exclusiveMinimum >= minimum) delete json$1.minimum;
8911
+ else delete json$1.exclusiveMinimum;
8912
+ }
8579
8913
  }
8914
+ if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8915
+ if (typeof maximum === "number") {
8916
+ json$1.maximum = maximum;
8917
+ if (typeof exclusiveMaximum === "number") {
8918
+ if (exclusiveMaximum <= maximum) delete json$1.maximum;
8919
+ else delete json$1.exclusiveMaximum;
8920
+ }
8921
+ }
8922
+ if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8923
+ break;
8580
8924
  }
8581
- break;
8582
- }
8583
- case "number": {
8584
- const json$1 = _json;
8585
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8586
- if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8587
- else json$1.type = "number";
8588
- if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8589
- if (typeof minimum === "number") {
8590
- json$1.minimum = minimum;
8591
- if (typeof exclusiveMinimum === "number") {
8592
- if (exclusiveMinimum >= minimum) delete json$1.minimum;
8593
- else delete json$1.exclusiveMinimum;
8925
+ case "boolean": {
8926
+ const json$1 = _json;
8927
+ json$1.type = "boolean";
8928
+ break;
8929
+ }
8930
+ case "bigint": {
8931
+ if (this.unrepresentable === "throw") {
8932
+ throw new Error("BigInt cannot be represented in JSON Schema");
8594
8933
  }
8934
+ break;
8595
8935
  }
8596
- if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8597
- if (typeof maximum === "number") {
8598
- json$1.maximum = maximum;
8599
- if (typeof exclusiveMaximum === "number") {
8600
- if (exclusiveMaximum <= maximum) delete json$1.maximum;
8601
- else delete json$1.exclusiveMaximum;
8936
+ case "symbol": {
8937
+ if (this.unrepresentable === "throw") {
8938
+ throw new Error("Symbols cannot be represented in JSON Schema");
8602
8939
  }
8940
+ break;
8603
8941
  }
8604
- if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8605
- break;
8606
- }
8607
- case "boolean": {
8608
- const json$1 = _json;
8609
- json$1.type = "boolean";
8610
- break;
8611
- }
8612
- case "bigint": {
8613
- if (this.unrepresentable === "throw") {
8614
- throw new Error("BigInt cannot be represented in JSON Schema");
8942
+ case "null": {
8943
+ _json.type = "null";
8944
+ break;
8615
8945
  }
8616
- break;
8617
- }
8618
- case "symbol": {
8619
- if (this.unrepresentable === "throw") {
8620
- throw new Error("Symbols cannot be represented in JSON Schema");
8946
+ case "any": {
8947
+ break;
8621
8948
  }
8622
- break;
8623
- }
8624
- case "undefined": {
8625
- const json$1 = _json;
8626
- json$1.type = "null";
8627
- break;
8628
- }
8629
- case "null": {
8630
- _json.type = "null";
8631
- break;
8632
- }
8633
- case "any": {
8634
- break;
8635
- }
8636
- case "unknown": {
8637
- break;
8638
- }
8639
- case "never": {
8640
- _json.not = {};
8641
- break;
8642
- }
8643
- case "void": {
8644
- if (this.unrepresentable === "throw") {
8645
- throw new Error("Void cannot be represented in JSON Schema");
8949
+ case "unknown": {
8950
+ break;
8646
8951
  }
8647
- break;
8648
- }
8649
- case "date": {
8650
- if (this.unrepresentable === "throw") {
8651
- throw new Error("Date cannot be represented in JSON Schema");
8952
+ case "undefined": {
8953
+ if (this.unrepresentable === "throw") {
8954
+ throw new Error("Undefined cannot be represented in JSON Schema");
8955
+ }
8956
+ break;
8652
8957
  }
8653
- break;
8654
- }
8655
- case "array": {
8656
- const json$1 = _json;
8657
- const { minimum, maximum } = schema._zod.bag;
8658
- if (typeof minimum === "number") json$1.minItems = minimum;
8659
- if (typeof maximum === "number") json$1.maxItems = maximum;
8660
- json$1.type = "array";
8661
- json$1.items = this.process(def.element, {
8662
- ...params,
8663
- path: [...params.path, "items"]
8664
- });
8665
- break;
8666
- }
8667
- case "object": {
8668
- const json$1 = _json;
8669
- json$1.type = "object";
8670
- json$1.properties = {};
8671
- const shape = def.shape;
8672
- for (const key in shape) {
8673
- json$1.properties[key] = this.process(shape[key], {
8674
- ...params,
8675
- path: [
8676
- ...params.path,
8677
- "properties",
8678
- key
8679
- ]
8680
- });
8958
+ case "void": {
8959
+ if (this.unrepresentable === "throw") {
8960
+ throw new Error("Void cannot be represented in JSON Schema");
8961
+ }
8962
+ break;
8681
8963
  }
8682
- const allKeys = new Set(Object.keys(shape));
8683
- const requiredKeys = new Set([...allKeys].filter((key) => {
8684
- const v = def.shape[key]._zod;
8685
- if (this.io === "input") {
8686
- return v.optin === undefined;
8687
- } else {
8688
- return v.optout === undefined;
8964
+ case "never": {
8965
+ _json.not = {};
8966
+ break;
8967
+ }
8968
+ case "date": {
8969
+ if (this.unrepresentable === "throw") {
8970
+ throw new Error("Date cannot be represented in JSON Schema");
8689
8971
  }
8690
- }));
8691
- if (requiredKeys.size > 0) {
8692
- json$1.required = Array.from(requiredKeys);
8972
+ break;
8693
8973
  }
8694
- if (def.catchall?._zod.def.type === "never") {
8695
- json$1.additionalProperties = false;
8696
- } else if (!def.catchall) {
8697
- if (this.io === "output") json$1.additionalProperties = false;
8698
- } else if (def.catchall) {
8699
- json$1.additionalProperties = this.process(def.catchall, {
8974
+ case "array": {
8975
+ const json$1 = _json;
8976
+ const { minimum, maximum } = schema._zod.bag;
8977
+ if (typeof minimum === "number") json$1.minItems = minimum;
8978
+ if (typeof maximum === "number") json$1.maxItems = maximum;
8979
+ json$1.type = "array";
8980
+ json$1.items = this.process(def.element, {
8700
8981
  ...params,
8701
- path: [...params.path, "additionalProperties"]
8982
+ path: [...params.path, "items"]
8702
8983
  });
8984
+ break;
8703
8985
  }
8704
- break;
8705
- }
8706
- case "union": {
8707
- const json$1 = _json;
8708
- json$1.anyOf = def.options.map((x, i) => this.process(x, {
8709
- ...params,
8710
- path: [
8711
- ...params.path,
8712
- "anyOf",
8713
- i
8714
- ]
8715
- }));
8716
- break;
8717
- }
8718
- case "intersection": {
8719
- const json$1 = _json;
8720
- const a = this.process(def.left, {
8721
- ...params,
8722
- path: [
8723
- ...params.path,
8724
- "allOf",
8725
- 0
8726
- ]
8727
- });
8728
- const b = this.process(def.right, {
8729
- ...params,
8730
- path: [
8731
- ...params.path,
8732
- "allOf",
8733
- 1
8734
- ]
8735
- });
8736
- const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
8737
- const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
8738
- json$1.allOf = allOf;
8739
- break;
8740
- }
8741
- case "tuple": {
8742
- const json$1 = _json;
8743
- json$1.type = "array";
8744
- const prefixItems = def.items.map((x, i) => this.process(x, {
8745
- ...params,
8746
- path: [
8747
- ...params.path,
8748
- "prefixItems",
8749
- i
8750
- ]
8751
- }));
8752
- if (this.target === "draft-2020-12") {
8753
- json$1.prefixItems = prefixItems;
8754
- } else {
8755
- json$1.items = prefixItems;
8986
+ case "object": {
8987
+ const json$1 = _json;
8988
+ json$1.type = "object";
8989
+ json$1.properties = {};
8990
+ const shape = def.shape;
8991
+ for (const key in shape) {
8992
+ json$1.properties[key] = this.process(shape[key], {
8993
+ ...params,
8994
+ path: [
8995
+ ...params.path,
8996
+ "properties",
8997
+ key
8998
+ ]
8999
+ });
9000
+ }
9001
+ const allKeys = new Set(Object.keys(shape));
9002
+ const requiredKeys = new Set([...allKeys].filter((key) => {
9003
+ const v = def.shape[key]._zod;
9004
+ if (this.io === "input") {
9005
+ return v.optin === undefined;
9006
+ } else {
9007
+ return v.optout === undefined;
9008
+ }
9009
+ }));
9010
+ if (requiredKeys.size > 0) {
9011
+ json$1.required = Array.from(requiredKeys);
9012
+ }
9013
+ if (def.catchall?._zod.def.type === "never") {
9014
+ json$1.additionalProperties = false;
9015
+ } else if (!def.catchall) {
9016
+ if (this.io === "output") json$1.additionalProperties = false;
9017
+ } else if (def.catchall) {
9018
+ json$1.additionalProperties = this.process(def.catchall, {
9019
+ ...params,
9020
+ path: [...params.path, "additionalProperties"]
9021
+ });
9022
+ }
9023
+ break;
8756
9024
  }
8757
- if (def.rest) {
8758
- const rest = this.process(def.rest, {
9025
+ case "union": {
9026
+ const json$1 = _json;
9027
+ json$1.anyOf = def.options.map((x, i) => this.process(x, {
8759
9028
  ...params,
8760
- path: [...params.path, "items"]
9029
+ path: [
9030
+ ...params.path,
9031
+ "anyOf",
9032
+ i
9033
+ ]
9034
+ }));
9035
+ break;
9036
+ }
9037
+ case "intersection": {
9038
+ const json$1 = _json;
9039
+ const a = this.process(def.left, {
9040
+ ...params,
9041
+ path: [
9042
+ ...params.path,
9043
+ "allOf",
9044
+ 0
9045
+ ]
9046
+ });
9047
+ const b = this.process(def.right, {
9048
+ ...params,
9049
+ path: [
9050
+ ...params.path,
9051
+ "allOf",
9052
+ 1
9053
+ ]
8761
9054
  });
9055
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
9056
+ const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
9057
+ json$1.allOf = allOf;
9058
+ break;
9059
+ }
9060
+ case "tuple": {
9061
+ const json$1 = _json;
9062
+ json$1.type = "array";
9063
+ const prefixItems = def.items.map((x, i) => this.process(x, {
9064
+ ...params,
9065
+ path: [
9066
+ ...params.path,
9067
+ "prefixItems",
9068
+ i
9069
+ ]
9070
+ }));
8762
9071
  if (this.target === "draft-2020-12") {
8763
- json$1.items = rest;
9072
+ json$1.prefixItems = prefixItems;
8764
9073
  } else {
8765
- json$1.additionalItems = rest;
9074
+ json$1.items = prefixItems;
9075
+ }
9076
+ if (def.rest) {
9077
+ const rest = this.process(def.rest, {
9078
+ ...params,
9079
+ path: [...params.path, "items"]
9080
+ });
9081
+ if (this.target === "draft-2020-12") {
9082
+ json$1.items = rest;
9083
+ } else {
9084
+ json$1.additionalItems = rest;
9085
+ }
8766
9086
  }
9087
+ if (def.rest) {
9088
+ json$1.items = this.process(def.rest, {
9089
+ ...params,
9090
+ path: [...params.path, "items"]
9091
+ });
9092
+ }
9093
+ const { minimum, maximum } = schema._zod.bag;
9094
+ if (typeof minimum === "number") json$1.minItems = minimum;
9095
+ if (typeof maximum === "number") json$1.maxItems = maximum;
9096
+ break;
8767
9097
  }
8768
- if (def.rest) {
8769
- json$1.items = this.process(def.rest, {
9098
+ case "record": {
9099
+ const json$1 = _json;
9100
+ json$1.type = "object";
9101
+ json$1.propertyNames = this.process(def.keyType, {
8770
9102
  ...params,
8771
- path: [...params.path, "items"]
9103
+ path: [...params.path, "propertyNames"]
8772
9104
  });
9105
+ json$1.additionalProperties = this.process(def.valueType, {
9106
+ ...params,
9107
+ path: [...params.path, "additionalProperties"]
9108
+ });
9109
+ break;
8773
9110
  }
8774
- const { minimum, maximum } = schema._zod.bag;
8775
- if (typeof minimum === "number") json$1.minItems = minimum;
8776
- if (typeof maximum === "number") json$1.maxItems = maximum;
8777
- break;
8778
- }
8779
- case "record": {
8780
- const json$1 = _json;
8781
- json$1.type = "object";
8782
- json$1.propertyNames = this.process(def.keyType, {
8783
- ...params,
8784
- path: [...params.path, "propertyNames"]
8785
- });
8786
- json$1.additionalProperties = this.process(def.valueType, {
8787
- ...params,
8788
- path: [...params.path, "additionalProperties"]
8789
- });
8790
- break;
8791
- }
8792
- case "map": {
8793
- if (this.unrepresentable === "throw") {
8794
- throw new Error("Map cannot be represented in JSON Schema");
9111
+ case "map": {
9112
+ if (this.unrepresentable === "throw") {
9113
+ throw new Error("Map cannot be represented in JSON Schema");
9114
+ }
9115
+ break;
8795
9116
  }
8796
- break;
8797
- }
8798
- case "set": {
8799
- if (this.unrepresentable === "throw") {
8800
- throw new Error("Set cannot be represented in JSON Schema");
9117
+ case "set": {
9118
+ if (this.unrepresentable === "throw") {
9119
+ throw new Error("Set cannot be represented in JSON Schema");
9120
+ }
9121
+ break;
9122
+ }
9123
+ case "enum": {
9124
+ const json$1 = _json;
9125
+ const values = getEnumValues(def.entries);
9126
+ if (values.every((v) => typeof v === "number")) json$1.type = "number";
9127
+ if (values.every((v) => typeof v === "string")) json$1.type = "string";
9128
+ json$1.enum = values;
9129
+ break;
8801
9130
  }
8802
- break;
8803
- }
8804
- case "enum": {
8805
- const json$1 = _json;
8806
- const values = getEnumValues(def.entries);
8807
- if (values.every((v) => typeof v === "number")) json$1.type = "number";
8808
- if (values.every((v) => typeof v === "string")) json$1.type = "string";
8809
- json$1.enum = values;
8810
- break;
8811
- }
8812
- case "literal": {
8813
- const json$1 = _json;
8814
- const vals = [];
8815
- for (const val of def.values) {
8816
- if (val === undefined) {
8817
- if (this.unrepresentable === "throw") {
8818
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
8819
- } else {}
8820
- } else if (typeof val === "bigint") {
8821
- if (this.unrepresentable === "throw") {
8822
- throw new Error("BigInt literals cannot be represented in JSON Schema");
9131
+ case "literal": {
9132
+ const json$1 = _json;
9133
+ const vals = [];
9134
+ for (const val of def.values) {
9135
+ if (val === undefined) {
9136
+ if (this.unrepresentable === "throw") {
9137
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
9138
+ } else {}
9139
+ } else if (typeof val === "bigint") {
9140
+ if (this.unrepresentable === "throw") {
9141
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
9142
+ } else {
9143
+ vals.push(Number(val));
9144
+ }
8823
9145
  } else {
8824
- vals.push(Number(val));
9146
+ vals.push(val);
8825
9147
  }
9148
+ }
9149
+ if (vals.length === 0) {} else if (vals.length === 1) {
9150
+ const val = vals[0];
9151
+ json$1.type = val === null ? "null" : typeof val;
9152
+ json$1.const = val;
8826
9153
  } else {
8827
- vals.push(val);
9154
+ if (vals.every((v) => typeof v === "number")) json$1.type = "number";
9155
+ if (vals.every((v) => typeof v === "string")) json$1.type = "string";
9156
+ if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
9157
+ if (vals.every((v) => v === null)) json$1.type = "null";
9158
+ json$1.enum = vals;
8828
9159
  }
9160
+ break;
8829
9161
  }
8830
- if (vals.length === 0) {} else if (vals.length === 1) {
8831
- const val = vals[0];
8832
- json$1.type = val === null ? "null" : typeof val;
8833
- json$1.const = val;
8834
- } else {
8835
- if (vals.every((v) => typeof v === "number")) json$1.type = "number";
8836
- if (vals.every((v) => typeof v === "string")) json$1.type = "string";
8837
- if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
8838
- if (vals.every((v) => v === null)) json$1.type = "null";
8839
- json$1.enum = vals;
8840
- }
8841
- break;
8842
- }
8843
- case "file": {
8844
- const json$1 = _json;
8845
- const file$1 = {
8846
- type: "string",
8847
- format: "binary",
8848
- contentEncoding: "binary"
8849
- };
8850
- const { minimum, maximum, mime } = schema._zod.bag;
8851
- if (minimum !== undefined) file$1.minLength = minimum;
8852
- if (maximum !== undefined) file$1.maxLength = maximum;
8853
- if (mime) {
8854
- if (mime.length === 1) {
8855
- file$1.contentMediaType = mime[0];
8856
- Object.assign(json$1, file$1);
9162
+ case "file": {
9163
+ const json$1 = _json;
9164
+ const file$1 = {
9165
+ type: "string",
9166
+ format: "binary",
9167
+ contentEncoding: "binary"
9168
+ };
9169
+ const { minimum, maximum, mime } = schema._zod.bag;
9170
+ if (minimum !== undefined) file$1.minLength = minimum;
9171
+ if (maximum !== undefined) file$1.maxLength = maximum;
9172
+ if (mime) {
9173
+ if (mime.length === 1) {
9174
+ file$1.contentMediaType = mime[0];
9175
+ Object.assign(json$1, file$1);
9176
+ } else {
9177
+ json$1.anyOf = mime.map((m) => {
9178
+ const mFile = {
9179
+ ...file$1,
9180
+ contentMediaType: m
9181
+ };
9182
+ return mFile;
9183
+ });
9184
+ }
8857
9185
  } else {
8858
- json$1.anyOf = mime.map((m) => {
8859
- const mFile = {
8860
- ...file$1,
8861
- contentMediaType: m
8862
- };
8863
- return mFile;
8864
- });
9186
+ Object.assign(json$1, file$1);
8865
9187
  }
8866
- } else {
8867
- Object.assign(json$1, file$1);
9188
+ break;
8868
9189
  }
8869
- break;
8870
- }
8871
- case "transform": {
8872
- if (this.unrepresentable === "throw") {
8873
- throw new Error("Transforms cannot be represented in JSON Schema");
9190
+ case "transform": {
9191
+ if (this.unrepresentable === "throw") {
9192
+ throw new Error("Transforms cannot be represented in JSON Schema");
9193
+ }
9194
+ break;
8874
9195
  }
8875
- break;
8876
- }
8877
- case "nullable": {
8878
- const inner = this.process(def.innerType, params);
8879
- _json.anyOf = [inner, { type: "null" }];
8880
- break;
8881
- }
8882
- case "nonoptional": {
8883
- this.process(def.innerType, params);
8884
- result.ref = def.innerType;
8885
- break;
8886
- }
8887
- case "success": {
8888
- const json$1 = _json;
8889
- json$1.type = "boolean";
8890
- break;
8891
- }
8892
- case "default": {
8893
- this.process(def.innerType, params);
8894
- result.ref = def.innerType;
8895
- _json.default = def.defaultValue;
8896
- break;
8897
- }
8898
- case "prefault": {
8899
- this.process(def.innerType, params);
8900
- result.ref = def.innerType;
8901
- if (this.io === "input") _json._prefault = def.defaultValue;
8902
- break;
8903
- }
8904
- case "catch": {
8905
- this.process(def.innerType, params);
8906
- result.ref = def.innerType;
8907
- let catchValue;
8908
- try {
8909
- catchValue = def.catchValue(undefined);
8910
- } catch {
8911
- throw new Error("Dynamic catch values are not supported in JSON Schema");
9196
+ case "nullable": {
9197
+ const inner = this.process(def.innerType, params);
9198
+ _json.anyOf = [inner, { type: "null" }];
9199
+ break;
8912
9200
  }
8913
- _json.default = catchValue;
8914
- break;
8915
- }
8916
- case "nan": {
8917
- if (this.unrepresentable === "throw") {
8918
- throw new Error("NaN cannot be represented in JSON Schema");
9201
+ case "nonoptional": {
9202
+ this.process(def.innerType, params);
9203
+ result.ref = def.innerType;
9204
+ break;
8919
9205
  }
8920
- break;
8921
- }
8922
- case "template_literal": {
8923
- const json$1 = _json;
8924
- const pattern = schema._zod.pattern;
8925
- if (!pattern) throw new Error("Pattern not found in template literal");
8926
- json$1.type = "string";
8927
- json$1.pattern = pattern.source;
8928
- break;
8929
- }
8930
- case "pipe": {
8931
- const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
8932
- this.process(innerType, params);
8933
- result.ref = innerType;
8934
- break;
8935
- }
8936
- case "readonly": {
8937
- this.process(def.innerType, params);
8938
- result.ref = def.innerType;
8939
- _json.readOnly = true;
8940
- break;
8941
- }
8942
- case "promise": {
8943
- this.process(def.innerType, params);
8944
- result.ref = def.innerType;
8945
- break;
8946
- }
8947
- case "optional": {
8948
- this.process(def.innerType, params);
8949
- result.ref = def.innerType;
8950
- break;
8951
- }
8952
- case "lazy": {
8953
- const innerType = schema._zod.innerType;
8954
- this.process(innerType, params);
8955
- result.ref = innerType;
8956
- break;
8957
- }
8958
- case "custom": {
8959
- if (this.unrepresentable === "throw") {
8960
- throw new Error("Custom types cannot be represented in JSON Schema");
9206
+ case "success": {
9207
+ const json$1 = _json;
9208
+ json$1.type = "boolean";
9209
+ break;
9210
+ }
9211
+ case "default": {
9212
+ this.process(def.innerType, params);
9213
+ result.ref = def.innerType;
9214
+ _json.default = JSON.parse(JSON.stringify(def.defaultValue));
9215
+ break;
9216
+ }
9217
+ case "prefault": {
9218
+ this.process(def.innerType, params);
9219
+ result.ref = def.innerType;
9220
+ if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
9221
+ break;
9222
+ }
9223
+ case "catch": {
9224
+ this.process(def.innerType, params);
9225
+ result.ref = def.innerType;
9226
+ let catchValue;
9227
+ try {
9228
+ catchValue = def.catchValue(undefined);
9229
+ } catch {
9230
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
9231
+ }
9232
+ _json.default = catchValue;
9233
+ break;
9234
+ }
9235
+ case "nan": {
9236
+ if (this.unrepresentable === "throw") {
9237
+ throw new Error("NaN cannot be represented in JSON Schema");
9238
+ }
9239
+ break;
9240
+ }
9241
+ case "template_literal": {
9242
+ const json$1 = _json;
9243
+ const pattern = schema._zod.pattern;
9244
+ if (!pattern) throw new Error("Pattern not found in template literal");
9245
+ json$1.type = "string";
9246
+ json$1.pattern = pattern.source;
9247
+ break;
9248
+ }
9249
+ case "pipe": {
9250
+ const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
9251
+ this.process(innerType, params);
9252
+ result.ref = innerType;
9253
+ break;
9254
+ }
9255
+ case "readonly": {
9256
+ this.process(def.innerType, params);
9257
+ result.ref = def.innerType;
9258
+ _json.readOnly = true;
9259
+ break;
9260
+ }
9261
+ case "promise": {
9262
+ this.process(def.innerType, params);
9263
+ result.ref = def.innerType;
9264
+ break;
9265
+ }
9266
+ case "optional": {
9267
+ this.process(def.innerType, params);
9268
+ result.ref = def.innerType;
9269
+ break;
9270
+ }
9271
+ case "lazy": {
9272
+ const innerType = schema._zod.innerType;
9273
+ this.process(innerType, params);
9274
+ result.ref = innerType;
9275
+ break;
9276
+ }
9277
+ case "custom": {
9278
+ if (this.unrepresentable === "throw") {
9279
+ throw new Error("Custom types cannot be represented in JSON Schema");
9280
+ }
9281
+ break;
9282
+ }
9283
+ default: {
9284
+ def;
8961
9285
  }
8962
- break;
8963
- }
8964
- default: {
8965
- def;
8966
9286
  }
8967
9287
  }
8968
9288
  }
@@ -8989,12 +9309,15 @@ var JSONSchemaGenerator = class {
8989
9309
  const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
8990
9310
  if (params.external) {
8991
9311
  const externalId = params.external.registry.get(entry[0])?.id;
8992
- if (externalId) return { ref: params.external.uri(externalId) };
9312
+ const uriGenerator = params.external.uri ?? ((id$1) => id$1);
9313
+ if (externalId) {
9314
+ return { ref: uriGenerator(externalId) };
9315
+ }
8993
9316
  const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
8994
9317
  entry[1].defId = id;
8995
9318
  return {
8996
9319
  defId: id,
8997
- ref: `${params.external.uri("__shared")}#/${defsSegment}/${id}`
9320
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
8998
9321
  };
8999
9322
  }
9000
9323
  if (entry[1] === root) {
@@ -9022,6 +9345,14 @@ var JSONSchemaGenerator = class {
9022
9345
  }
9023
9346
  schema$1.$ref = ref;
9024
9347
  };
9348
+ if (params.cycles === "throw") {
9349
+ for (const entry of this.seen.entries()) {
9350
+ const seen = entry[1];
9351
+ if (seen.cycle) {
9352
+ throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9353
+ }
9354
+ }
9355
+ }
9025
9356
  for (const entry of this.seen.entries()) {
9026
9357
  const seen = entry[1];
9027
9358
  if (schema === entry[0]) {
@@ -9041,11 +9372,7 @@ var JSONSchemaGenerator = class {
9041
9372
  continue;
9042
9373
  }
9043
9374
  if (seen.cycle) {
9044
- if (params.cycles === "throw") {
9045
- throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9046
- } else if (params.cycles === "ref") {
9047
- extractToDef(entry);
9048
- }
9375
+ extractToDef(entry);
9049
9376
  continue;
9050
9377
  }
9051
9378
  if (seen.count > 1) {
@@ -9077,7 +9404,8 @@ var JSONSchemaGenerator = class {
9077
9404
  }
9078
9405
  if (!seen.isParent) this.override({
9079
9406
  zodSchema,
9080
- jsonSchema: schema$1
9407
+ jsonSchema: schema$1,
9408
+ path: seen.path ?? []
9081
9409
  });
9082
9410
  };
9083
9411
  for (const entry of [...this.seen.entries()].reverse()) {
@@ -9091,6 +9419,11 @@ var JSONSchemaGenerator = class {
9091
9419
  } else {
9092
9420
  console.warn(`Invalid target: ${this.target}`);
9093
9421
  }
9422
+ if (params.external?.uri) {
9423
+ const id = params.external.registry.get(schema)?.id;
9424
+ if (!id) throw new Error("Schema is missing an `id` property");
9425
+ result.$id = params.external.uri(id);
9426
+ }
9094
9427
  Object.assign(result, root.def);
9095
9428
  const defs = params.external?.defs ?? {};
9096
9429
  for (const entry of this.seen.entries()) {
@@ -9099,11 +9432,13 @@ var JSONSchemaGenerator = class {
9099
9432
  defs[seen.defId] = seen.def;
9100
9433
  }
9101
9434
  }
9102
- if (!params.external && Object.keys(defs).length > 0) {
9103
- if (this.target === "draft-2020-12") {
9104
- result.$defs = defs;
9105
- } else {
9106
- result.definitions = defs;
9435
+ if (params.external) {} else {
9436
+ if (Object.keys(defs).length > 0) {
9437
+ if (this.target === "draft-2020-12") {
9438
+ result.$defs = defs;
9439
+ } else {
9440
+ result.definitions = defs;
9441
+ }
9107
9442
  }
9108
9443
  }
9109
9444
  try {
@@ -9124,7 +9459,7 @@ function toJSONSchema(input, _params) {
9124
9459
  const schemas = {};
9125
9460
  const external = {
9126
9461
  registry: input,
9127
- uri: _params?.uri || ((id) => id),
9462
+ uri: _params?.uri,
9128
9463
  defs
9129
9464
  };
9130
9465
  for (const entry of input._idmap.entries()) {
@@ -9235,11 +9570,11 @@ function isTransforming(_schema, _ctx) {
9235
9570
  }
9236
9571
 
9237
9572
  //#endregion
9238
- //#region ../../node_modules/zod/dist/esm/v4/core/json-schema.js
9573
+ //#region ../../node_modules/zod/v4/core/json-schema.js
9239
9574
  var json_schema_exports = {};
9240
9575
 
9241
9576
  //#endregion
9242
- //#region ../../node_modules/zod/dist/esm/v4/core/index.js
9577
+ //#region ../../node_modules/zod/v4/core/index.js
9243
9578
  var core_exports = {};
9244
9579
  __export(core_exports, {
9245
9580
  $ZodAny: () => $ZodAny,
@@ -9278,6 +9613,7 @@ __export(core_exports, {
9278
9613
  $ZodCheckStringFormat: () => $ZodCheckStringFormat,
9279
9614
  $ZodCheckUpperCase: () => $ZodCheckUpperCase,
9280
9615
  $ZodCustom: () => $ZodCustom,
9616
+ $ZodCustomStringFormat: () => $ZodCustomStringFormat,
9281
9617
  $ZodDate: () => $ZodDate,
9282
9618
  $ZodDefault: () => $ZodDefault,
9283
9619
  $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion,
@@ -9342,6 +9678,8 @@ __export(core_exports, {
9342
9678
  Doc: () => Doc,
9343
9679
  JSONSchema: () => json_schema_exports,
9344
9680
  JSONSchemaGenerator: () => JSONSchemaGenerator,
9681
+ NEVER: () => NEVER,
9682
+ TimePrecision: () => TimePrecision,
9345
9683
  _any: () => _any,
9346
9684
  _array: () => _array,
9347
9685
  _base64: () => _base64,
@@ -9431,6 +9769,7 @@ __export(core_exports, {
9431
9769
  _size: () => _size,
9432
9770
  _startsWith: () => _startsWith,
9433
9771
  _string: () => _string,
9772
+ _stringFormat: () => _stringFormat,
9434
9773
  _stringbool: () => _stringbool,
9435
9774
  _success: () => _success,
9436
9775
  _symbol: () => _symbol,
@@ -9480,7 +9819,7 @@ __export(core_exports, {
9480
9819
  });
9481
9820
 
9482
9821
  //#endregion
9483
- //#region ../../node_modules/zod/dist/esm/v4/classic/iso.js
9822
+ //#region ../../node_modules/zod/v4/classic/iso.js
9484
9823
  var iso_exports = {};
9485
9824
  __export(iso_exports, {
9486
9825
  ZodISODate: () => ZodISODate,
@@ -9522,7 +9861,7 @@ function duration(params) {
9522
9861
  }
9523
9862
 
9524
9863
  //#endregion
9525
- //#region ../../node_modules/zod/dist/esm/v4/classic/errors.js
9864
+ //#region ../../node_modules/zod/v4/classic/errors.js
9526
9865
  const initializer = (inst, issues) => {
9527
9866
  $ZodError.init(inst, issues);
9528
9867
  inst.name = "ZodError";
@@ -9540,14 +9879,14 @@ const ZodError = $constructor("ZodError", initializer);
9540
9879
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
9541
9880
 
9542
9881
  //#endregion
9543
- //#region ../../node_modules/zod/dist/esm/v4/classic/parse.js
9882
+ //#region ../../node_modules/zod/v4/classic/parse.js
9544
9883
  const parse = /* @__PURE__ */ _parse(ZodRealError);
9545
9884
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
9546
9885
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
9547
9886
  const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
9548
9887
 
9549
9888
  //#endregion
9550
- //#region ../../node_modules/zod/dist/esm/v4/classic/schemas.js
9889
+ //#region ../../node_modules/zod/v4/classic/schemas.js
9551
9890
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
9552
9891
  $ZodType.init(inst, def);
9553
9892
  inst.def = def;
@@ -9815,6 +10154,13 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
9815
10154
  function jwt(params) {
9816
10155
  return _jwt(ZodJWT, params);
9817
10156
  }
10157
+ const ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
10158
+ $ZodCustomStringFormat.init(inst, def);
10159
+ ZodStringFormat.init(inst, def);
10160
+ });
10161
+ function stringFormat(format, fnOrRegex, _params = {}) {
10162
+ return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
10163
+ }
9818
10164
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
9819
10165
  $ZodNumber.init(inst, def);
9820
10166
  ZodType.init(inst, def);
@@ -9984,9 +10330,7 @@ function keyof(schema) {
9984
10330
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
9985
10331
  $ZodObject.init(inst, def);
9986
10332
  ZodType.init(inst, def);
9987
- defineLazy(inst, "shape", () => {
9988
- return Object.fromEntries(Object.entries(inst._zod.def.shape));
9989
- });
10333
+ defineLazy(inst, "shape", () => def.shape);
9990
10334
  inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
9991
10335
  inst.catchall = (catchall) => inst.clone({
9992
10336
  ...inst._zod.def,
@@ -10431,11 +10775,8 @@ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
10431
10775
  $ZodCustom.init(inst, def);
10432
10776
  ZodType.init(inst, def);
10433
10777
  });
10434
- function check(fn, params) {
10435
- const ch = new $ZodCheck({
10436
- check: "custom",
10437
- ...normalizeParams(params)
10438
- });
10778
+ function check(fn) {
10779
+ const ch = new $ZodCheck({ check: "custom" });
10439
10780
  ch._zod.check = fn;
10440
10781
  return ch;
10441
10782
  }
@@ -10445,7 +10786,7 @@ function custom(fn, _params) {
10445
10786
  function refine(fn, _params = {}) {
10446
10787
  return _refine(ZodCustom, fn, _params);
10447
10788
  }
10448
- function superRefine(fn, params) {
10789
+ function superRefine(fn) {
10449
10790
  const ch = check((payload) => {
10450
10791
  payload.addIssue = (issue$1) => {
10451
10792
  if (typeof issue$1 === "string") {
@@ -10461,7 +10802,7 @@ function superRefine(fn, params) {
10461
10802
  }
10462
10803
  };
10463
10804
  return fn(payload.value, payload);
10464
- }, params);
10805
+ });
10465
10806
  return ch;
10466
10807
  }
10467
10808
  function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) {
@@ -10499,7 +10840,7 @@ function preprocess(fn, schema) {
10499
10840
  }
10500
10841
 
10501
10842
  //#endregion
10502
- //#region ../../node_modules/zod/dist/esm/v4/classic/compat.js
10843
+ //#region ../../node_modules/zod/v4/classic/compat.js
10503
10844
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
10504
10845
  const ZodIssueCode = {
10505
10846
  invalid_type: "invalid_type",
@@ -10514,10 +10855,6 @@ const ZodIssueCode = {
10514
10855
  invalid_value: "invalid_value",
10515
10856
  custom: "custom"
10516
10857
  };
10517
- /** @deprecated Not necessary in Zod 4. */
10518
- const INVALID = Object.freeze({ status: "aborted" });
10519
- /** A special constant with type `never` */
10520
- const NEVER = INVALID;
10521
10858
  /** @deprecated Use `z.config(params)` instead. */
10522
10859
  function setErrorMap(map$1) {
10523
10860
  config({ customError: map$1 });
@@ -10526,9 +10863,12 @@ function setErrorMap(map$1) {
10526
10863
  function getErrorMap() {
10527
10864
  return config().customError;
10528
10865
  }
10866
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
10867
+ var ZodFirstPartyTypeKind;
10868
+ (function(ZodFirstPartyTypeKind$1) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
10529
10869
 
10530
10870
  //#endregion
10531
- //#region ../../node_modules/zod/dist/esm/v4/classic/coerce.js
10871
+ //#region ../../node_modules/zod/v4/classic/coerce.js
10532
10872
  var coerce_exports = {};
10533
10873
  __export(coerce_exports, {
10534
10874
  bigint: () => bigint,
@@ -10554,13 +10894,14 @@ function date(params) {
10554
10894
  }
10555
10895
 
10556
10896
  //#endregion
10557
- //#region ../../node_modules/zod/dist/esm/v4/classic/external.js
10897
+ //#region ../../node_modules/zod/v4/classic/external.js
10558
10898
  var external_exports = {};
10559
10899
  __export(external_exports, {
10560
10900
  $brand: () => $brand,
10561
10901
  $input: () => $input,
10562
10902
  $output: () => $output,
10563
10903
  NEVER: () => NEVER,
10904
+ TimePrecision: () => TimePrecision,
10564
10905
  ZodAny: () => ZodAny,
10565
10906
  ZodArray: () => ZodArray,
10566
10907
  ZodBase64: () => ZodBase64,
@@ -10574,6 +10915,7 @@ __export(external_exports, {
10574
10915
  ZodCUID2: () => ZodCUID2,
10575
10916
  ZodCatch: () => ZodCatch,
10576
10917
  ZodCustom: () => ZodCustom,
10918
+ ZodCustomStringFormat: () => ZodCustomStringFormat,
10577
10919
  ZodDate: () => ZodDate,
10578
10920
  ZodDefault: () => ZodDefault,
10579
10921
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
@@ -10583,6 +10925,7 @@ __export(external_exports, {
10583
10925
  ZodEnum: () => ZodEnum,
10584
10926
  ZodError: () => ZodError,
10585
10927
  ZodFile: () => ZodFile,
10928
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
10586
10929
  ZodGUID: () => ZodGUID,
10587
10930
  ZodIPv4: () => ZodIPv4,
10588
10931
  ZodIPv6: () => ZodIPv6,
@@ -10735,6 +11078,7 @@ __export(external_exports, {
10735
11078
  startsWith: () => _startsWith,
10736
11079
  strictObject: () => strictObject,
10737
11080
  string: () => string$1,
11081
+ stringFormat: () => stringFormat,
10738
11082
  stringbool: () => stringbool,
10739
11083
  success: () => success,
10740
11084
  superRefine: () => superRefine,
@@ -10765,11 +11109,11 @@ __export(external_exports, {
10765
11109
  config(en_default());
10766
11110
 
10767
11111
  //#endregion
10768
- //#region ../../node_modules/zod/dist/esm/v4/classic/index.js
11112
+ //#region ../../node_modules/zod/v4/classic/index.js
10769
11113
  var classic_default = external_exports;
10770
11114
 
10771
11115
  //#endregion
10772
- //#region ../../node_modules/zod/dist/esm/v4/index.js
11116
+ //#region ../../node_modules/zod/v4/index.js
10773
11117
  var v4_default = classic_default;
10774
11118
 
10775
11119
  //#endregion
@@ -10790,12 +11134,12 @@ var v4_default = classic_default;
10790
11134
  function validate(schema, value) {
10791
11135
  try {
10792
11136
  return schema.parse(value);
10793
- } catch (error$37) {
10794
- if (error$37 instanceof ZodError) {
10795
- const formattedErrors = error$37.issues.map((err) => `- ${err.path.join(".")}: ${err.message}`).join("\n");
10796
- throw new Error(`Validation error${error$37.issues.length > 1 ? "s" : ""}:\n${formattedErrors}`);
11137
+ } catch (error$39) {
11138
+ if (error$39 instanceof ZodError) {
11139
+ const formattedErrors = error$39.issues.map((err) => `- ${err.path.join(".")}: ${err.message}`).join("\n");
11140
+ throw new Error(`Validation error${error$39.issues.length > 1 ? "s" : ""}:\n${formattedErrors}`);
10797
11141
  }
10798
- throw error$37;
11142
+ throw error$39;
10799
11143
  }
10800
11144
  }
10801
11145