@settlemint/dalp-cli 3.1.19-main.34838212554 → 3.1.19-main.34862433650

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.
Files changed (3) hide show
  1. package/dist/dalp.js +1151 -604
  2. package/dist/dalp.js.map +21 -21
  3. package/package.json +2 -2
package/dist/dalp.js CHANGED
@@ -54,7 +54,7 @@ var __esm = (fn, res, err) => () => {
54
54
  };
55
55
  var __require = import.meta.require;
56
56
 
57
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/util.js
57
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/util.js
58
58
  function getEnumValues(entries) {
59
59
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
60
60
  const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -68,18 +68,23 @@ function jsonStringifyReplacer(_, value) {
68
68
  return value.toString();
69
69
  return value;
70
70
  }
71
- function cached(getter) {
72
- const set = false;
73
- return {
74
- get value() {
75
- if (!set) {
76
- const value = getter();
77
- Object.defineProperty(this, "value", { value });
78
- return value;
79
- }
80
- throw new Error("cached value already set");
71
+
72
+ class Cached {
73
+ constructor(getter) {
74
+ this._getter = getter;
75
+ this._value = undefined;
76
+ }
77
+ get value() {
78
+ const getter = this._getter;
79
+ if (getter !== undefined) {
80
+ this._value = getter();
81
+ this._getter = undefined;
81
82
  }
82
- };
83
+ return this._value;
84
+ }
85
+ }
86
+ function cached(getter) {
87
+ return new Cached(getter);
83
88
  }
84
89
  function nullish(input) {
85
90
  return input === null || input === undefined;
@@ -126,6 +131,56 @@ function assignProp(target, prop, value) {
126
131
  configurable: true
127
132
  });
128
133
  }
134
+ function rawShape(def) {
135
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
136
+ return desc?.get ? desc.get.raw : desc?.value;
137
+ }
138
+ function sourceShape(schema) {
139
+ return rawShape(schema._zod.def) ?? schema._zod.def.shape;
140
+ }
141
+ function deferProp(target, key, getter) {
142
+ Object.defineProperty(target, key, {
143
+ get() {
144
+ const value = getter();
145
+ assignProp(this, key, value);
146
+ return value;
147
+ },
148
+ enumerable: true,
149
+ configurable: true
150
+ });
151
+ }
152
+ function putProp(target, key, value) {
153
+ if (key in target)
154
+ assignProp(target, key, value);
155
+ else
156
+ target[key] = value;
157
+ }
158
+ function mirrorShape(target, source, keys, wrap) {
159
+ const raw = sourceShape(source);
160
+ for (const key of keys) {
161
+ const desc = Object.getOwnPropertyDescriptor(raw, key);
162
+ if (!desc.enumerable)
163
+ continue;
164
+ if (desc.get) {
165
+ deferProp(target, key, () => {
166
+ const value = source._zod.def.shape[key];
167
+ return wrap ? wrap(value, key) : value;
168
+ });
169
+ } else
170
+ putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
171
+ }
172
+ }
173
+ function mirrorProps(target, source) {
174
+ for (const key of Reflect.ownKeys(source)) {
175
+ const desc = Object.getOwnPropertyDescriptor(source, key);
176
+ if (!desc.enumerable)
177
+ continue;
178
+ if (desc.get)
179
+ deferProp(target, key, () => source[key]);
180
+ else
181
+ putProp(target, key, desc.value);
182
+ }
183
+ }
129
184
  function mergeDefs(...defs) {
130
185
  const mergedDescriptors = {};
131
186
  for (const def of defs) {
@@ -214,23 +269,21 @@ function pick(schema, mask) {
214
269
  if (hasChecks) {
215
270
  throw new Error(".pick() cannot be used on object schemas containing refinements");
216
271
  }
217
- const def = mergeDefs(schema._zod.def, {
218
- get shape() {
219
- const newShape = {};
220
- for (const key of Reflect.ownKeys(mask)) {
221
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
222
- throw new Error(`Unrecognized key: "${String(key)}"`);
223
- }
224
- if (!mask[key])
225
- continue;
226
- assignProp(newShape, key, currDef.shape[key]);
227
- }
228
- assignProp(this, "shape", newShape);
229
- return newShape;
230
- },
231
- checks: []
232
- });
233
- return clone(schema, def);
272
+ const newShape = {};
273
+ mirrorShape(newShape, schema, maskedKeys(schema, mask));
274
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
275
+ }
276
+ function maskedKeys(schema, mask) {
277
+ const raw = sourceShape(schema);
278
+ const keys = [];
279
+ for (const key of Reflect.ownKeys(mask)) {
280
+ if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
281
+ throw new Error(`Unrecognized key: "${String(key)}"`);
282
+ }
283
+ if (mask[key])
284
+ keys.push(key);
285
+ }
286
+ return keys;
234
287
  }
235
288
  function omit(schema, mask) {
236
289
  const currDef = schema._zod.def;
@@ -239,23 +292,10 @@ function omit(schema, mask) {
239
292
  if (hasChecks) {
240
293
  throw new Error(".omit() cannot be used on object schemas containing refinements");
241
294
  }
242
- const def = mergeDefs(schema._zod.def, {
243
- get shape() {
244
- const newShape = { ...schema._zod.def.shape };
245
- for (const key of Reflect.ownKeys(mask)) {
246
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
247
- throw new Error(`Unrecognized key: "${String(key)}"`);
248
- }
249
- if (!mask[key])
250
- continue;
251
- delete newShape[key];
252
- }
253
- assignProp(this, "shape", newShape);
254
- return newShape;
255
- },
256
- checks: []
257
- });
258
- return clone(schema, def);
295
+ const omitted = new Set(maskedKeys(schema, mask));
296
+ const newShape = {};
297
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
298
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
259
299
  }
260
300
  function extend(schema, shape) {
261
301
  if (!isPlainObject(shape)) {
@@ -264,34 +304,26 @@ function extend(schema, shape) {
264
304
  const checks = schema._zod.def.checks;
265
305
  const hasChecks = checks && checks.length > 0;
266
306
  if (hasChecks) {
267
- const existingShape = schema._zod.def.shape;
307
+ const existingShape = sourceShape(schema);
268
308
  for (const key of Reflect.ownKeys(shape)) {
269
309
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
270
310
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
271
311
  }
272
312
  }
273
313
  }
274
- const def = mergeDefs(schema._zod.def, {
275
- get shape() {
276
- const _shape = { ...schema._zod.def.shape, ...shape };
277
- assignProp(this, "shape", _shape);
278
- return _shape;
279
- }
280
- });
281
- return clone(schema, def);
314
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
315
+ }
316
+ function extended(schema, shape) {
317
+ const newShape = {};
318
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
319
+ mirrorProps(newShape, shape);
320
+ return newShape;
282
321
  }
283
322
  function safeExtend(schema, shape) {
284
323
  if (!isPlainObject(shape)) {
285
324
  throw new Error("Invalid input to safeExtend: expected a plain object");
286
325
  }
287
- const def = mergeDefs(schema._zod.def, {
288
- get shape() {
289
- const _shape = { ...schema._zod.def.shape, ...shape };
290
- assignProp(this, "shape", _shape);
291
- return _shape;
292
- }
293
- });
294
- return clone(schema, def);
326
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
295
327
  }
296
328
  function merge(a, b) {
297
329
  if (!b?._zod?.def) {
@@ -300,12 +332,11 @@ function merge(a, b) {
300
332
  if (a._zod.def.checks?.length) {
301
333
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
302
334
  }
335
+ const newShape = {};
336
+ mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
337
+ mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
303
338
  const def = mergeDefs(a._zod.def, {
304
- get shape() {
305
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
306
- assignProp(this, "shape", _shape);
307
- return _shape;
308
- },
339
+ shape: newShape,
309
340
  get catchall() {
310
341
  return b._zod.def.catchall;
311
342
  },
@@ -320,67 +351,16 @@ function partial(Class, schema, mask, name = "partial") {
320
351
  if (hasChecks) {
321
352
  throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
322
353
  }
323
- const def = mergeDefs(schema._zod.def, {
324
- get shape() {
325
- const oldShape = schema._zod.def.shape;
326
- const shape = { ...oldShape };
327
- if (mask) {
328
- for (const key of Reflect.ownKeys(mask)) {
329
- if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
330
- throw new Error(`Unrecognized key: "${String(key)}"`);
331
- }
332
- if (!mask[key])
333
- continue;
334
- shape[key] = Class ? new Class({
335
- type: "optional",
336
- innerType: oldShape[key]
337
- }) : oldShape[key];
338
- }
339
- } else {
340
- for (const key of Reflect.ownKeys(oldShape)) {
341
- shape[key] = Class ? new Class({
342
- type: "optional",
343
- innerType: oldShape[key]
344
- }) : oldShape[key];
345
- }
346
- }
347
- assignProp(this, "shape", shape);
348
- return shape;
349
- },
350
- checks: []
351
- });
352
- return clone(schema, def);
354
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
355
+ const newShape = {};
356
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })));
357
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
353
358
  }
354
359
  function required(Class, schema, mask) {
355
- const def = mergeDefs(schema._zod.def, {
356
- get shape() {
357
- const oldShape = schema._zod.def.shape;
358
- const shape = { ...oldShape };
359
- if (mask) {
360
- for (const key of Reflect.ownKeys(mask)) {
361
- if (!Object.prototype.hasOwnProperty.call(shape, key)) {
362
- throw new Error(`Unrecognized key: "${String(key)}"`);
363
- }
364
- if (!mask[key])
365
- continue;
366
- shape[key] = new Class({
367
- type: "nonoptional",
368
- innerType: oldShape[key]
369
- });
370
- }
371
- } else {
372
- for (const key of Reflect.ownKeys(oldShape)) {
373
- shape[key] = new Class({
374
- type: "nonoptional",
375
- innerType: oldShape[key]
376
- });
377
- }
378
- }
379
- assignProp(this, "shape", shape);
380
- return shape;
381
- }
382
- });
383
- return clone(schema, def);
360
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
361
+ const newShape = {};
362
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
363
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
384
364
  }
385
365
  function aborted(x, startIndex = 0) {
386
366
  if (x.aborted === true)
@@ -430,13 +410,18 @@ function finalizeIssue(iss, ctx, config) {
430
410
  }
431
411
  const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
432
412
  const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
433
- const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
434
- rest.path ?? (rest.path = []);
435
- rest.message = message;
413
+ const full = {};
414
+ for (const k of Object.keys(iss)) {
415
+ if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
416
+ continue;
417
+ full[k] = iss[k];
418
+ }
419
+ full.path ?? (full.path = []);
420
+ full.message = message;
436
421
  if (ctx?.reportInput) {
437
- rest.input = _input;
422
+ full.input = iss.input;
438
423
  }
439
- return rest;
424
+ return full;
440
425
  }
441
426
  function getSizableOrigin(input) {
442
427
  if (input instanceof Set)
@@ -516,6 +501,22 @@ function own(inst, key, value, enumerable = true) {
516
501
  function hide(inst, key, value) {
517
502
  return own(inst, key, value, false);
518
503
  }
504
+ function derived(computes, table) {
505
+ for (const key in computes) {
506
+ const compute = computes[key];
507
+ Object.defineProperty(table, key, {
508
+ configurable: true,
509
+ enumerable: true,
510
+ get() {
511
+ return own(this, key, compute(this));
512
+ },
513
+ set(value) {
514
+ own(this, key, value);
515
+ }
516
+ });
517
+ }
518
+ return table;
519
+ }
519
520
  function defineBound(proto, key, fn) {
520
521
  Object.defineProperty(proto, key, {
521
522
  configurable: true,
@@ -636,7 +637,7 @@ var init_util = __esm(() => {
636
637
  };
637
638
  });
638
639
 
639
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/core.js
640
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/core.js
640
641
  function newError(Definition) {
641
642
  const E = _E;
642
643
  if (E) {
@@ -675,8 +676,7 @@ function $constructor(name, initializer, proto, params) {
675
676
  } finally {
676
677
  _zodDesc.value = undefined;
677
678
  }
678
- }
679
- if (inst._zod.traits.has(name)) {
679
+ } else if (inst._zod.traits.has(name)) {
680
680
  return;
681
681
  }
682
682
  inst._zod.traits.add(name);
@@ -761,7 +761,7 @@ var init_core = __esm(() => {
761
761
  globalConfig = globalThis.__zod_globalConfig;
762
762
  });
763
763
 
764
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/doc.js
764
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/doc.js
765
765
  class Doc {
766
766
  constructor(args = [], closed = {}) {
767
767
  this.content = [];
@@ -771,8 +771,11 @@ class Doc {
771
771
  }
772
772
  indented(fn) {
773
773
  this.indent += 1;
774
- fn(this);
775
- this.indent -= 1;
774
+ try {
775
+ fn(this);
776
+ } finally {
777
+ this.indent -= 1;
778
+ }
776
779
  }
777
780
  write(arg) {
778
781
  if (typeof arg === "function") {
@@ -800,28 +803,50 @@ ${content.join(`
800
803
  }
801
804
  }
802
805
 
803
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/memoizer.js
806
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/memoizer.js
807
+ function isRef(value) {
808
+ return value !== null && typeof value === "object";
809
+ }
804
810
  function cloneIssues(issues) {
805
811
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
806
812
  }
807
- function isRecursive(inst, stack) {
813
+ function isRecursive(inst, stack, resolve) {
808
814
  const cached = recursive.get(inst);
809
815
  if (cached !== undefined)
810
- return cached;
816
+ return cached ? PROVEN : NONE;
811
817
  if (stack.has(inst))
812
- return true;
818
+ return PROVEN;
813
819
  stack.add(inst);
814
- let result = false;
820
+ let result = NONE;
815
821
  const check = (child) => {
816
- if (!result && child?._zod && isRecursive(child, stack))
817
- result = true;
822
+ if (result !== PROVEN && child?._zod) {
823
+ const answer = isRecursive(child, stack, resolve);
824
+ if (answer > result)
825
+ result = answer;
826
+ }
827
+ };
828
+ const shape = (sh, spread) => {
829
+ let answer = NONE;
830
+ for (const key of Reflect.ownKeys(sh)) {
831
+ const desc = Object.getOwnPropertyDescriptor(sh, key);
832
+ if (spread && !desc.enumerable)
833
+ continue;
834
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
835
+ if (child > answer)
836
+ answer = child;
837
+ }
838
+ return answer;
839
+ };
840
+ const merge = (answer) => {
841
+ if (answer > result)
842
+ result = answer;
818
843
  };
819
844
  const def = inst._zod.def;
820
845
  const kind = def.type;
821
846
  switch (kind) {
822
847
  case "object": {
823
- for (const key of Reflect.ownKeys(def.shape))
824
- check(def.shape[key]);
848
+ const raw = rawShape(def);
849
+ merge(raw ? shape(raw, true) : ASSUMED);
825
850
  check(def.catchall);
826
851
  break;
827
852
  }
@@ -868,9 +893,11 @@ function isRecursive(inst, stack) {
868
893
  check(def.input);
869
894
  check(def.output);
870
895
  break;
871
- case "lazy":
872
- check(inst._zod.innerType);
896
+ case "lazy": {
897
+ const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
898
+ merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
873
899
  break;
900
+ }
874
901
  case "template_literal":
875
902
  case "string":
876
903
  case "number":
@@ -909,16 +936,20 @@ function isRecursive(inst, stack) {
909
936
  }
910
937
  }
911
938
  stack.delete(inst);
912
- recursive.set(inst, result);
913
- return result;
939
+ return settle(inst, result);
940
+ }
941
+ function settle(inst, answer) {
942
+ if (answer !== ASSUMED)
943
+ recursive.set(inst, answer === PROVEN);
944
+ return answer;
914
945
  }
915
946
  function isRecursiveSchema(inst) {
916
- return isRecursive(inst, new Set);
947
+ return isRecursive(inst, new Set, true) !== NONE;
917
948
  }
918
949
  function bucketFor(state, inst) {
919
950
  let bucket = state.buckets.get(inst);
920
951
  if (!bucket) {
921
- bucket = new Map;
952
+ bucket = new WeakMap;
922
953
  state.buckets.set(inst, bucket);
923
954
  }
924
955
  return bucket;
@@ -928,10 +959,11 @@ function memoizer() {
928
959
  }
929
960
  function isBackEdge(ctx, value) {
930
961
  const backEdges = ctx[STATE]?.backEdges;
931
- return backEdges !== undefined && value !== null && typeof value === "object" && backEdges.has(value);
962
+ return backEdges !== undefined && isRef(value) && backEdges.has(value);
932
963
  }
933
- var $ZodCyclicError, STATE = "~memo", NO_ISSUES, recursive, handoff, open, memo;
964
+ var $ZodCyclicError, STATE = "~memo", NO_ISSUES, recursive, NONE = 0, ASSUMED = 1, PROVEN = 2, handoff, open, memo;
934
965
  var init_memoizer = __esm(() => {
966
+ init_util();
935
967
  $ZodCyclicError = class $ZodCyclicError extends Error {
936
968
  constructor() {
937
969
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -970,6 +1002,7 @@ var init_memoizer = __esm(() => {
970
1002
  attach(inst) {
971
1003
  var _a;
972
1004
  let isRecursiveInst;
1005
+ let rechecked = false;
973
1006
  let lastCtx;
974
1007
  let lastBucket;
975
1008
  (_a = inst._zod).deferred ?? (_a.deferred = []);
@@ -977,20 +1010,24 @@ var init_memoizer = __esm(() => {
977
1010
  const base = inst._zod.parse;
978
1011
  const wrapped = (payload, ctx) => {
979
1012
  if (isRecursiveInst === undefined) {
980
- isRecursiveInst = isRecursive(inst, new Set);
981
- if (!isRecursiveInst) {
1013
+ const walked = isRecursive(inst, new Set, false);
1014
+ if (walked === NONE) {
982
1015
  inst._zod.parse = base;
983
1016
  if (inst._zod.run === wrapped)
984
1017
  inst._zod.run = base;
985
1018
  return base(payload, ctx);
986
1019
  }
1020
+ if (walked === PROVEN || rechecked)
1021
+ isRecursiveInst = true;
1022
+ else
1023
+ rechecked = true;
987
1024
  }
988
1025
  const input = payload.value;
989
- if (input === null || typeof input !== "object")
1026
+ if (!isRef(input))
990
1027
  return base(payload, ctx);
991
1028
  let state = ctx[STATE];
992
1029
  if (!state) {
993
- state = { buckets: new Map, backEdges: undefined };
1030
+ state = { buckets: new WeakMap, backEdges: undefined };
994
1031
  ctx[STATE] = state;
995
1032
  }
996
1033
  let bucket;
@@ -1009,7 +1046,7 @@ var init_memoizer = __esm(() => {
1009
1046
  payload.issues.push(...cloneIssues(hit.issues));
1010
1047
  } else {
1011
1048
  payload.memo = true;
1012
- state.backEdges ?? (state.backEdges = new Set);
1049
+ state.backEdges ?? (state.backEdges = new WeakSet);
1013
1050
  state.backEdges.add(hit.value);
1014
1051
  }
1015
1052
  return payload;
@@ -1038,9 +1075,10 @@ var init_memoizer = __esm(() => {
1038
1075
  };
1039
1076
  });
1040
1077
 
1041
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/regexes.js
1078
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/regexes.js
1042
1079
  var exports_regexes = {};
1043
1080
  __exportGetters(exports_regexes, {
1081
+ anyString: () => anyString,
1044
1082
  base64: () => base64,
1045
1083
  base64url: () => base64url,
1046
1084
  bigint: () => bigint,
@@ -1051,6 +1089,7 @@ __exportGetters(exports_regexes, {
1051
1089
  creditCard: () => creditCard,
1052
1090
  cuid: () => cuid,
1053
1091
  cuid2: () => cuid2,
1092
+ currencyCode: () => currencyCode,
1054
1093
  date: () => date,
1055
1094
  datetime: () => datetime,
1056
1095
  domain: () => domain,
@@ -1064,6 +1103,7 @@ __exportGetters(exports_regexes, {
1064
1103
  hostname: () => hostname,
1065
1104
  html5Email: () => html5Email,
1066
1105
  httpProtocol: () => httpProtocol,
1106
+ iban: () => iban,
1067
1107
  idnEmail: () => idnEmail,
1068
1108
  integer: () => integer,
1069
1109
  ipv4: () => ipv4,
@@ -1138,10 +1178,10 @@ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uui
1138
1178
  if (!version)
1139
1179
  return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
1140
1180
  return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
1141
- }, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`, ipv4, ipv6, mac = (delimiter) => {
1181
+ }, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`, ipv4, ipv6, mac = (delimiter) => {
1142
1182
  const escapedDelim = escapeRegex(delimiter ?? ":");
1143
1183
  return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
1144
- }, cidrv4, cidrv6, base64, base64url, hostname, domain, httpProtocol, e164, creditCard, 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])))`, date, string = (params) => {
1184
+ }, cidrv4, cidrv6, base64, base64url, hostname, domain, httpProtocol, e164, creditCard, currencyCode, iban, 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])))`, date, anyString, string = (params) => {
1145
1185
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
1146
1186
  return new RegExp(`^${regex}$`);
1147
1187
  }, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url;
@@ -1159,7 +1199,7 @@ var init_regexes = __esm(() => {
1159
1199
  uuid4 = /* @__PURE__ */ uuid(4);
1160
1200
  uuid6 = /* @__PURE__ */ uuid(6);
1161
1201
  uuid7 = /* @__PURE__ */ uuid(7);
1162
- email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
1202
+ email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
1163
1203
  html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
1164
1204
  rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
1165
1205
  unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
@@ -1170,13 +1210,16 @@ var init_regexes = __esm(() => {
1170
1210
  cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
1171
1211
  cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
1172
1212
  base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
1173
- base64url = /^[A-Za-z0-9_-]*$/;
1213
+ base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
1174
1214
  hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
1175
1215
  domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
1176
1216
  httpProtocol = /^https?$/;
1177
1217
  e164 = /^\+[1-9]\d{6,14}$/;
1178
1218
  creditCard = /^\d(?:[ -]?\d){11,18}$/;
1219
+ currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
1220
+ iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
1179
1221
  date = /* @__PURE__ */ anchor(dateSource);
1222
+ anyString = /^[\s\S]{0,}$/;
1180
1223
  bigint = /^-?\d+n?$/;
1181
1224
  integer = /^-?\d+$/;
1182
1225
  number = /^-?\d+(?:\.\d+)?$/;
@@ -1203,7 +1246,7 @@ var init_regexes = __esm(() => {
1203
1246
  sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
1204
1247
  });
1205
1248
 
1206
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/checks.js
1249
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/checks.js
1207
1250
  function handleCheckPropertyResult(result, payload, property) {
1208
1251
  if (result.issues.length) {
1209
1252
  payload.issues.push(...prefixIssues(property, result.issues));
@@ -1215,7 +1258,7 @@ var $ZodCheck, _whenHasSize = (payload) => {
1215
1258
  }, _whenHasLength = (payload) => {
1216
1259
  const val = payload.value;
1217
1260
  return !nullish(val) && val.length !== undefined;
1218
- }, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite;
1261
+ }, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckProperties, $ZodCheckMimeType, $ZodCheckOverwrite;
1219
1262
  var init_checks = __esm(() => {
1220
1263
  init_core();
1221
1264
  init_regexes();
@@ -1234,16 +1277,6 @@ var init_checks = __esm(() => {
1234
1277
  $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
1235
1278
  $ZodCheck.init(inst, def);
1236
1279
  const origin = numericOriginMap[typeof def.value];
1237
- inst._zod.onattach.push((inst) => {
1238
- const bag = inst._zod.bag;
1239
- const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
1240
- if (def.value < curr) {
1241
- if (def.inclusive)
1242
- bag.maximum = def.value;
1243
- else
1244
- bag.exclusiveMaximum = def.value;
1245
- }
1246
- });
1247
1280
  inst._zod.check = (payload) => {
1248
1281
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
1249
1282
  return;
@@ -1262,16 +1295,6 @@ var init_checks = __esm(() => {
1262
1295
  $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
1263
1296
  $ZodCheck.init(inst, def);
1264
1297
  const origin = numericOriginMap[typeof def.value];
1265
- inst._zod.onattach.push((inst) => {
1266
- const bag = inst._zod.bag;
1267
- const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
1268
- if (def.value > curr) {
1269
- if (def.inclusive)
1270
- bag.minimum = def.value;
1271
- else
1272
- bag.exclusiveMinimum = def.value;
1273
- }
1274
- });
1275
1298
  inst._zod.check = (payload) => {
1276
1299
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
1277
1300
  return;
@@ -1289,10 +1312,6 @@ var init_checks = __esm(() => {
1289
1312
  });
1290
1313
  $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
1291
1314
  $ZodCheck.init(inst, def);
1292
- inst._zod.onattach.push((inst) => {
1293
- var _a;
1294
- (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
1295
- });
1296
1315
  inst._zod.check = (payload) => {
1297
1316
  if (typeof payload.value !== typeof def.value)
1298
1317
  throw new Error("Cannot mix number and bigint in multiple_of check.");
@@ -1315,14 +1334,6 @@ var init_checks = __esm(() => {
1315
1334
  const isInt = def.format?.includes("int");
1316
1335
  const origin = isInt ? "int" : "number";
1317
1336
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
1318
- inst._zod.onattach.push((inst) => {
1319
- const bag = inst._zod.bag;
1320
- bag.format = def.format;
1321
- bag.minimum = minimum;
1322
- bag.maximum = maximum;
1323
- if (isInt)
1324
- bag.pattern = integer;
1325
- });
1326
1337
  inst._zod.check = (payload) => {
1327
1338
  const input = payload.value;
1328
1339
  if (isInt) {
@@ -1391,12 +1402,6 @@ var init_checks = __esm(() => {
1391
1402
  $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
1392
1403
  $ZodCheck.init(inst, def);
1393
1404
  const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
1394
- inst._zod.onattach.push((inst) => {
1395
- const bag = inst._zod.bag;
1396
- bag.format = def.format;
1397
- bag.minimum = minimum;
1398
- bag.maximum = maximum;
1399
- });
1400
1405
  inst._zod.check = (payload) => {
1401
1406
  const input = payload.value;
1402
1407
  if (input < minimum) {
@@ -1427,11 +1432,6 @@ var init_checks = __esm(() => {
1427
1432
  var _a;
1428
1433
  $ZodCheck.init(inst, def);
1429
1434
  (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);
1430
- inst._zod.onattach.push((inst) => {
1431
- const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1432
- if (def.maximum < curr)
1433
- inst._zod.bag.maximum = def.maximum;
1434
- });
1435
1435
  inst._zod.check = (payload) => {
1436
1436
  const input = payload.value;
1437
1437
  const size = input.size;
@@ -1452,11 +1452,6 @@ var init_checks = __esm(() => {
1452
1452
  var _a;
1453
1453
  $ZodCheck.init(inst, def);
1454
1454
  (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);
1455
- inst._zod.onattach.push((inst) => {
1456
- const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1457
- if (def.minimum > curr)
1458
- inst._zod.bag.minimum = def.minimum;
1459
- });
1460
1455
  inst._zod.check = (payload) => {
1461
1456
  const input = payload.value;
1462
1457
  const size = input.size;
@@ -1477,12 +1472,6 @@ var init_checks = __esm(() => {
1477
1472
  var _a;
1478
1473
  $ZodCheck.init(inst, def);
1479
1474
  (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);
1480
- inst._zod.onattach.push((inst) => {
1481
- const bag = inst._zod.bag;
1482
- bag.minimum = def.size;
1483
- bag.maximum = def.size;
1484
- bag.size = def.size;
1485
- });
1486
1475
  inst._zod.check = (payload) => {
1487
1476
  const input = payload.value;
1488
1477
  const size = input.size;
@@ -1504,11 +1493,6 @@ var init_checks = __esm(() => {
1504
1493
  var _a;
1505
1494
  $ZodCheck.init(inst, def);
1506
1495
  (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
1507
- inst._zod.onattach.push((inst) => {
1508
- const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1509
- if (def.maximum < curr)
1510
- inst._zod.bag.maximum = def.maximum;
1511
- });
1512
1496
  inst._zod.check = (payload) => {
1513
1497
  const input = payload.value;
1514
1498
  const units = input.length;
@@ -1531,11 +1515,6 @@ var init_checks = __esm(() => {
1531
1515
  var _a;
1532
1516
  $ZodCheck.init(inst, def);
1533
1517
  (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
1534
- inst._zod.onattach.push((inst) => {
1535
- const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1536
- if (def.minimum > curr)
1537
- inst._zod.bag.minimum = def.minimum;
1538
- });
1539
1518
  inst._zod.check = (payload) => {
1540
1519
  const input = payload.value;
1541
1520
  const units = input.length;
@@ -1558,12 +1537,6 @@ var init_checks = __esm(() => {
1558
1537
  var _a;
1559
1538
  $ZodCheck.init(inst, def);
1560
1539
  (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
1561
- inst._zod.onattach.push((inst) => {
1562
- const bag = inst._zod.bag;
1563
- bag.minimum = def.length;
1564
- bag.maximum = def.length;
1565
- bag.length = def.length;
1566
- });
1567
1540
  inst._zod.check = (payload) => {
1568
1541
  const input = payload.value;
1569
1542
  const units = input.length;
@@ -1586,14 +1559,6 @@ var init_checks = __esm(() => {
1586
1559
  $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1587
1560
  var _a, _b;
1588
1561
  $ZodCheck.init(inst, def);
1589
- inst._zod.onattach.push((inst) => {
1590
- const bag = inst._zod.bag;
1591
- bag.format = def.format;
1592
- if (def.pattern) {
1593
- bag.patterns ?? (bag.patterns = new Set);
1594
- bag.patterns.add(def.pattern);
1595
- }
1596
- });
1597
1562
  if (def.pattern)
1598
1563
  (_a = inst._zod).check ?? (_a.check = (payload) => {
1599
1564
  def.pattern.lastIndex = 0;
@@ -1642,11 +1607,6 @@ var init_checks = __esm(() => {
1642
1607
  const escapedRegex = escapeRegex(def.includes);
1643
1608
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
1644
1609
  def.pattern = pattern;
1645
- inst._zod.onattach.push((inst) => {
1646
- const bag = inst._zod.bag;
1647
- bag.patterns ?? (bag.patterns = new Set);
1648
- bag.patterns.add(pattern);
1649
- });
1650
1610
  inst._zod.check = (payload) => {
1651
1611
  if (payload.value.includes(def.includes, def.position))
1652
1612
  return;
@@ -1665,11 +1625,6 @@ var init_checks = __esm(() => {
1665
1625
  $ZodCheck.init(inst, def);
1666
1626
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
1667
1627
  def.pattern ?? (def.pattern = pattern);
1668
- inst._zod.onattach.push((inst) => {
1669
- const bag = inst._zod.bag;
1670
- bag.patterns ?? (bag.patterns = new Set);
1671
- bag.patterns.add(pattern);
1672
- });
1673
1628
  inst._zod.check = (payload) => {
1674
1629
  if (payload.value.startsWith(def.prefix))
1675
1630
  return;
@@ -1688,11 +1643,6 @@ var init_checks = __esm(() => {
1688
1643
  $ZodCheck.init(inst, def);
1689
1644
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
1690
1645
  def.pattern ?? (def.pattern = pattern);
1691
- inst._zod.onattach.push((inst) => {
1692
- const bag = inst._zod.bag;
1693
- bag.patterns ?? (bag.patterns = new Set);
1694
- bag.patterns.add(pattern);
1695
- });
1696
1646
  inst._zod.check = (payload) => {
1697
1647
  if (payload.value.endsWith(def.suffix))
1698
1648
  return;
@@ -1721,12 +1671,39 @@ var init_checks = __esm(() => {
1721
1671
  return;
1722
1672
  };
1723
1673
  });
1674
+ $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
1675
+ $ZodCheck.init(inst, def);
1676
+ hide(inst, Symbol.iterator, function* () {
1677
+ yield inst;
1678
+ });
1679
+ let entries;
1680
+ inst._zod.check = (payload) => {
1681
+ if (payload.value == null) {
1682
+ payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
1683
+ return;
1684
+ }
1685
+ entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
1686
+ const input = payload.value;
1687
+ let proms;
1688
+ for (const [key, schema] of entries) {
1689
+ const result = schema._zod.run({ value: input[key], issues: [] }, {});
1690
+ if (result instanceof Promise) {
1691
+ proms ?? (proms = []);
1692
+ proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));
1693
+ } else {
1694
+ handleCheckPropertyResult(result, payload, key);
1695
+ }
1696
+ }
1697
+ if (proms)
1698
+ return Promise.all(proms).then(() => {
1699
+ return;
1700
+ });
1701
+ return;
1702
+ };
1703
+ });
1724
1704
  $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
1725
1705
  $ZodCheck.init(inst, def);
1726
1706
  const mimeSet = new Set(def.mime);
1727
- inst._zod.onattach.push((inst) => {
1728
- inst._zod.bag.mime = def.mime;
1729
- });
1730
1707
  inst._zod.check = (payload) => {
1731
1708
  if (mimeSet.has(payload.value.type))
1732
1709
  return;
@@ -1747,7 +1724,7 @@ var init_checks = __esm(() => {
1747
1724
  });
1748
1725
  });
1749
1726
 
1750
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/errors.js
1727
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/errors.js
1751
1728
  function _getMessage() {
1752
1729
  const internals = this._zod;
1753
1730
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -1826,13 +1803,10 @@ function formatError(error, mapper = (issue) => issue.message) {
1826
1803
  processError(error);
1827
1804
  return fieldErrors;
1828
1805
  }
1829
- var _messageDesc, _zodDesc2, _issuesDesc, _installedToString, initializer = (inst, def) => {
1806
+ var _messageDesc, _issuesDesc, _installedToString, initializer = (inst, def) => {
1830
1807
  inst.name = "$ZodError";
1831
- _zodDesc2.value = inst._zod;
1832
- Object.defineProperty(inst, "_zod", _zodDesc2);
1833
1808
  _issuesDesc.value = def;
1834
1809
  Object.defineProperty(inst, "issues", _issuesDesc);
1835
- _zodDesc2.value = undefined;
1836
1810
  _issuesDesc.value = undefined;
1837
1811
  Object.defineProperty(inst, "message", _messageDesc);
1838
1812
  const proto = Object.getPrototypeOf(inst);
@@ -1861,7 +1835,6 @@ var init_errors = __esm(() => {
1861
1835
  enumerable: true,
1862
1836
  configurable: true
1863
1837
  };
1864
- _zodDesc2 = { value: undefined, enumerable: false };
1865
1838
  _issuesDesc = { value: undefined, enumerable: false };
1866
1839
  _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
1867
1840
  $ZodError = $constructor("$ZodError", initializer);
@@ -1870,10 +1843,44 @@ var init_errors = __esm(() => {
1870
1843
  });
1871
1844
  });
1872
1845
 
1873
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/parse.js
1846
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/parse.js
1874
1847
  function finalizeParams(callee, params) {
1875
1848
  return { callee: params?.callee ?? callee, Err: params?.Err };
1876
1849
  }
1850
+ function failure(Err, issues, ctx) {
1851
+ let error;
1852
+ return {
1853
+ success: false,
1854
+ get error() {
1855
+ if (!error) {
1856
+ error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
1857
+ issues = undefined;
1858
+ ctx = undefined;
1859
+ }
1860
+ return error;
1861
+ },
1862
+ set error(e) {
1863
+ error = e;
1864
+ issues = undefined;
1865
+ ctx = undefined;
1866
+ }
1867
+ };
1868
+ }
1869
+ function validateFallback(schema, value, _ctx) {
1870
+ const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
1871
+ const fallbackRun = schema._zod.bag.fallbackRun;
1872
+ let result;
1873
+ if (fallbackRun) {
1874
+ ctx[COMPILE_FALLBACK] = true;
1875
+ result = fallbackRun({ value, issues: [] }, ctx);
1876
+ } else {
1877
+ result = schema._zod.run({ value, issues: [] }, ctx);
1878
+ }
1879
+ if (result instanceof Promise) {
1880
+ throw new $ZodAsyncError;
1881
+ }
1882
+ return result.issues.length === 0;
1883
+ }
1877
1884
  var _parse = (_Err) => {
1878
1885
  const fn = (schema, value, _ctx, _params) => {
1879
1886
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
@@ -1909,20 +1916,29 @@ var _parse = (_Err) => {
1909
1916
  if (result instanceof Promise) {
1910
1917
  throw new $ZodAsyncError;
1911
1918
  }
1912
- return result.issues.length ? {
1913
- success: false,
1914
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1915
- } : { success: true, data: result.value };
1916
- }, safeParse, _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
1919
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
1920
+ }, _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
1917
1921
  const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
1918
1922
  let result = schema._zod.run({ value, issues: [] }, ctx);
1919
1923
  if (result instanceof Promise)
1920
1924
  result = await result;
1921
- return result.issues.length ? {
1922
- success: false,
1923
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1924
- } : { success: true, data: result.value };
1925
- }, safeParseAsync, _encode = (_Err) => {
1925
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
1926
+ }, COMPILE_INVALID, COMPILE_FALLBACK, validate = (schema, value, _ctx) => {
1927
+ const validator = schema._zod.bag.validator;
1928
+ if (validator !== undefined) {
1929
+ if (validator(value) !== COMPILE_INVALID)
1930
+ return true;
1931
+ if (validator.definite === true && _ctx === undefined)
1932
+ return false;
1933
+ }
1934
+ return validateFallback(schema, value, _ctx);
1935
+ }, validateAsync = async (schema, value, _ctx) => {
1936
+ const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
1937
+ let result = schema._zod.run({ value, issues: [] }, ctx);
1938
+ if (result instanceof Promise)
1939
+ result = await result;
1940
+ return result.issues.length === 0;
1941
+ }, _encode = (_Err) => {
1926
1942
  const parse = _parse(_Err);
1927
1943
  const fn = (schema, value, _ctx, _params) => {
1928
1944
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
@@ -1965,39 +1981,66 @@ var init_parse = __esm(() => {
1965
1981
  init_util();
1966
1982
  parse = /* @__PURE__ */ _parse($ZodRealError);
1967
1983
  parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
1968
- safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
1969
- safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
1984
+ COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
1985
+ COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
1970
1986
  });
1971
1987
 
1972
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/versions.js
1988
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/versions.js
1973
1989
  var version;
1974
1990
  var init_versions = __esm(() => {
1975
1991
  version = {
1976
1992
  major: 4,
1977
- minor: 5,
1993
+ minor: 6,
1978
1994
  patch: 4
1979
1995
  };
1980
1996
  });
1981
1997
 
1982
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/schemas.js
1998
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/schemas.js
1999
+ async function validateAsync2(inst, value) {
2000
+ const ctx = { async: true };
2001
+ return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
2002
+ }
1983
2003
  function standardProps(inst) {
1984
2004
  return {
1985
2005
  validate: (value) => {
2006
+ const ctx = { async: false };
1986
2007
  try {
1987
- return toStandardResult(safeParse(inst, value));
1988
- } catch (_) {
1989
- return safeParseAsync(inst, value).then(toStandardResult);
1990
- }
2008
+ const r = inst._zod.run({ value, issues: [] }, ctx);
2009
+ if (!(r instanceof Promise))
2010
+ return toStandardResult(r, ctx);
2011
+ } catch (_) {}
2012
+ return validateAsync2(inst, value);
1991
2013
  },
1992
2014
  vendor: "zod",
1993
2015
  version: 1
1994
2016
  };
1995
2017
  }
2018
+ function canParseURL(input) {
2019
+ try {
2020
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function")
2021
+ return URL.canParse(input);
2022
+ new URL(input);
2023
+ return true;
2024
+ } catch {
2025
+ return false;
2026
+ }
2027
+ }
2028
+ function validateURL(trimmed, def) {
2029
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
2030
+ return canParseURL(trimmed) || URL_UNPARSEABLE;
2031
+ }
2032
+ return parseURLObject(trimmed, def);
2033
+ }
1996
2034
  function parseURLObject(trimmed, def) {
1997
2035
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
1998
2036
  return URL_BAD_FORMAT;
1999
2037
  }
2000
2038
  try {
2039
+ if (typeof URL !== "undefined") {
2040
+ const URLStatic = URL;
2041
+ if (typeof URLStatic.parse === "function")
2042
+ return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
2043
+ }
2001
2044
  return new URL(trimmed);
2002
2045
  } catch {
2003
2046
  return URL_UNPARSEABLE;
@@ -2017,12 +2060,7 @@ function urlProtocolOk(url, protocol) {
2017
2060
  function isValidIPv6(value) {
2018
2061
  if (!ipv6Alphabet.test(value))
2019
2062
  return false;
2020
- try {
2021
- new URL(`http://[${value}]`);
2022
- return true;
2023
- } catch {
2024
- return false;
2025
- }
2063
+ return canParseURL(`http://[${value}]`);
2026
2064
  }
2027
2065
  function isValidCIDRv6(value) {
2028
2066
  const parts = value.split("/");
@@ -2053,7 +2091,7 @@ function isValidBase64(data) {
2053
2091
  }
2054
2092
  }
2055
2093
  function isValidBase64URL(data) {
2056
- if (!base64url.test(data))
2094
+ if (!base64urlCharset.test(data))
2057
2095
  return false;
2058
2096
  const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
2059
2097
  const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
@@ -2064,7 +2102,7 @@ function isLuhnAlgo(digits) {
2064
2102
  let bit = 1;
2065
2103
  let sum = 0;
2066
2104
  while (length) {
2067
- const value = +digits[--length];
2105
+ const value = digits.charCodeAt(--length) - 48;
2068
2106
  bit ^= 1;
2069
2107
  sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
2070
2108
  }
@@ -2075,6 +2113,24 @@ function isValidCreditCard(input) {
2075
2113
  return false;
2076
2114
  return isLuhnAlgo(input.replace(CC_SANITIZE, ""));
2077
2115
  }
2116
+ function isIso7064Mod97(iban2) {
2117
+ let remainder = 0;
2118
+ const len = iban2.length;
2119
+ for (let i = 4;i < len; i++) {
2120
+ const code = iban2.charCodeAt(i);
2121
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
2122
+ }
2123
+ for (let i = 0;i < 4; i++) {
2124
+ const code = iban2.charCodeAt(i);
2125
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
2126
+ }
2127
+ return remainder === 1;
2128
+ }
2129
+ function isValidIBAN(input) {
2130
+ if (!iban.test(input))
2131
+ return false;
2132
+ return isIso7064Mod97(input);
2133
+ }
2078
2134
  function isValidJWT(token, algorithm = null) {
2079
2135
  try {
2080
2136
  const tokensParts = token.split(".");
@@ -2125,7 +2181,7 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
2125
2181
  return;
2126
2182
  }
2127
2183
  if (result.value === undefined) {
2128
- if (isPresent) {
2184
+ if (isPresent || optin === "defaulted" && !isOptionalOut) {
2129
2185
  final.value[key] = undefined;
2130
2186
  }
2131
2187
  } else {
@@ -2152,14 +2208,20 @@ function normalizeDef(def) {
2152
2208
  optionalKeys: new Set(okeys)
2153
2209
  };
2154
2210
  }
2155
- function handleCatchall(proms, input, payload, ctx, def, inst) {
2211
+ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
2156
2212
  const unrecognized = [];
2157
2213
  const keySet = def.keySet;
2158
2214
  const _catchall = def.catchall._zod;
2159
2215
  const t = _catchall.def.type;
2160
2216
  const optin = _catchall.optin;
2161
2217
  const optout = _catchall.optout;
2218
+ let seen = 0;
2162
2219
  for (const key in input) {
2220
+ if (abortEarly && payload.issues.length !== seen) {
2221
+ if (aborted(payload, seen))
2222
+ break;
2223
+ seen = payload.issues.length;
2224
+ }
2163
2225
  if (keySet.has(key))
2164
2226
  continue;
2165
2227
  if (key === "__proto__") {
@@ -2242,6 +2304,24 @@ function handleExclusiveUnionResults(results, final, inst, ctx) {
2242
2304
  }
2243
2305
  return final;
2244
2306
  }
2307
+ function discriminatorMap(def) {
2308
+ const map = new Map;
2309
+ for (const option of def.options) {
2310
+ const values = option._zod.propValues?.[def.discriminator];
2311
+ if (!values || values.size === 0)
2312
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
2313
+ for (const value of values) {
2314
+ if (map.has(value)) {
2315
+ if (value !== undefined)
2316
+ throw new Error(`Duplicate discriminator value "${String(value)}"`);
2317
+ map.set(value, null);
2318
+ } else {
2319
+ map.set(value, option);
2320
+ }
2321
+ }
2322
+ }
2323
+ return map;
2324
+ }
2245
2325
  function mergeValues(a, b) {
2246
2326
  if (a === b) {
2247
2327
  return { valid: true, data: a };
@@ -2494,6 +2574,52 @@ function handleReadonlyResult(payload) {
2494
2574
  payload.value = Object.freeze(payload.value);
2495
2575
  return payload;
2496
2576
  }
2577
+ function leafPattern(schema) {
2578
+ const def = schema._zod.def;
2579
+ let pattern = def.pattern;
2580
+ let isInt = !!def.format?.includes("int");
2581
+ let minimum;
2582
+ let maximum;
2583
+ for (const ch of def.checks ?? []) {
2584
+ const d = ch._zod.def;
2585
+ if (d.pattern)
2586
+ pattern = d.pattern;
2587
+ isInt || (isInt = !!d.format?.includes("int"));
2588
+ const lo = d.minimum ?? d.length;
2589
+ const hi = d.maximum ?? d.length;
2590
+ if (lo !== undefined && (minimum === undefined || lo > minimum))
2591
+ minimum = lo;
2592
+ if (hi !== undefined && (maximum === undefined || hi < maximum))
2593
+ maximum = hi;
2594
+ }
2595
+ if (pattern)
2596
+ return pattern.source;
2597
+ if (minimum !== undefined && maximum !== undefined && minimum > maximum)
2598
+ return "(?!)";
2599
+ if (minimum !== undefined || maximum !== undefined)
2600
+ return string({ minimum, maximum }).source;
2601
+ const own = schema._zod.pattern;
2602
+ return (isInt && own === number ? integer : own)?.source;
2603
+ }
2604
+ function partPattern(schema) {
2605
+ const def = schema._zod.def;
2606
+ const own = schema._zod.pattern?.source;
2607
+ const inner = def.innerType ?? schema._zod.innerType;
2608
+ if (inner) {
2609
+ const before = inner._zod.pattern?.source;
2610
+ const after = partPattern(inner);
2611
+ if (own && before && after && after !== before) {
2612
+ return own.replace(cleanRegex(before), () => cleanRegex(after));
2613
+ }
2614
+ return own;
2615
+ }
2616
+ if (def.options) {
2617
+ const sources = def.options.map(partPattern);
2618
+ if (sources.every(Boolean))
2619
+ return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
2620
+ }
2621
+ return leafPattern(schema);
2622
+ }
2497
2623
  function handleRefineResult(result, payload, input, inst) {
2498
2624
  if (!result) {
2499
2625
  const _iss = {
@@ -2508,7 +2634,7 @@ function handleRefineResult(result, payload, input, inst) {
2508
2634
  payload.issues.push(issue(_iss));
2509
2635
  }
2510
2636
  }
2511
- var $ZodType, toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues }, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT = 1, URL_UNPARSEABLE = 2, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, CC_SANITIZE, $ZodCreditCard, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, NO_SYMBOL_KEYS, propShapes, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodPreprocess, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom;
2637
+ var $ZodType, toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value }, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT = 1, URL_UNPARSEABLE = 2, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, CC_SANITIZE, $ZodCreditCard, $ZodIBAN, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodPreprocess, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom;
2512
2638
  var init_schemas = __esm(() => {
2513
2639
  init_checks();
2514
2640
  init_core();
@@ -2627,7 +2753,7 @@ var init_schemas = __esm(() => {
2627
2753
  });
2628
2754
  $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
2629
2755
  $ZodType.init(inst, def);
2630
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
2756
+ inst._zod.pattern = def.pattern ?? anyString;
2631
2757
  inst._zod.parse = (payload, _) => {
2632
2758
  if (def.coerce)
2633
2759
  try {
@@ -2682,7 +2808,7 @@ var init_schemas = __esm(() => {
2682
2808
  inst._zod.check = (payload) => {
2683
2809
  try {
2684
2810
  const trimmed = payload.value.trim();
2685
- const url = parseURLObject(trimmed, def);
2811
+ const url = validateURL(trimmed, def);
2686
2812
  if (url === URL_BAD_FORMAT) {
2687
2813
  payload.issues.push({
2688
2814
  code: "invalid_format",
@@ -2704,6 +2830,10 @@ var init_schemas = __esm(() => {
2704
2830
  });
2705
2831
  return;
2706
2832
  }
2833
+ if (url === true) {
2834
+ payload.value = stripTabAndNewline(trimmed);
2835
+ return;
2836
+ }
2707
2837
  if (def.hostname && !urlHostnameOk(url, def.hostname)) {
2708
2838
  payload.issues.push({
2709
2839
  code: "invalid_format",
@@ -2772,12 +2902,6 @@ var init_schemas = __esm(() => {
2772
2902
  $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
2773
2903
  def.pattern ?? (def.pattern = datetime(def));
2774
2904
  $ZodStringFormat.init(inst, def);
2775
- if (def.local || def.precision === -1) {
2776
- inst._zod.bag.laxFormat = true;
2777
- inst._zod.onattach.push((s) => {
2778
- s._zod.bag.laxFormat = true;
2779
- });
2780
- }
2781
2905
  });
2782
2906
  $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
2783
2907
  def.pattern ?? (def.pattern = date);
@@ -2794,13 +2918,11 @@ var init_schemas = __esm(() => {
2794
2918
  $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
2795
2919
  def.pattern ?? (def.pattern = ipv4);
2796
2920
  $ZodStringFormat.init(inst, def);
2797
- inst._zod.bag.format = `ipv4`;
2798
2921
  });
2799
2922
  ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
2800
2923
  $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
2801
2924
  def.pattern ?? (def.pattern = ipv6);
2802
2925
  $ZodStringFormat.init(inst, def);
2803
- inst._zod.bag.format = `ipv6`;
2804
2926
  inst._zod.check = (payload) => {
2805
2927
  if (!isValidIPv6(payload.value)) {
2806
2928
  payload.issues.push({
@@ -2816,7 +2938,6 @@ var init_schemas = __esm(() => {
2816
2938
  $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
2817
2939
  def.pattern ?? (def.pattern = mac(def.delimiter));
2818
2940
  $ZodStringFormat.init(inst, def);
2819
- inst._zod.bag.format = `mac`;
2820
2941
  });
2821
2942
  $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
2822
2943
  def.pattern ?? (def.pattern = cidrv4);
@@ -2837,10 +2958,10 @@ var init_schemas = __esm(() => {
2837
2958
  }
2838
2959
  };
2839
2960
  });
2961
+ base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
2840
2962
  $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
2841
- def.pattern ?? (def.pattern = base64);
2963
+ def.pattern ?? (def.pattern = base64Charset);
2842
2964
  $ZodStringFormat.init(inst, def);
2843
- inst._zod.bag.contentEncoding = "base64";
2844
2965
  inst._zod.check = (payload) => {
2845
2966
  if (isValidBase64(payload.value))
2846
2967
  return;
@@ -2853,10 +2974,10 @@ var init_schemas = __esm(() => {
2853
2974
  });
2854
2975
  };
2855
2976
  });
2977
+ base64urlCharset = /^[A-Za-z0-9_-]*$/;
2856
2978
  $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
2857
- def.pattern ?? (def.pattern = base64url);
2979
+ def.pattern ?? (def.pattern = base64urlCharset);
2858
2980
  $ZodStringFormat.init(inst, def);
2859
- inst._zod.bag.contentEncoding = "base64url";
2860
2981
  inst._zod.check = (payload) => {
2861
2982
  if (isValidBase64URL(payload.value))
2862
2983
  return;
@@ -2889,6 +3010,21 @@ var init_schemas = __esm(() => {
2889
3010
  });
2890
3011
  };
2891
3012
  });
3013
+ $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
3014
+ def.pattern ?? (def.pattern = iban);
3015
+ $ZodStringFormat.init(inst, def);
3016
+ inst._zod.check = (payload) => {
3017
+ if (isValidIBAN(payload.value))
3018
+ return;
3019
+ payload.issues.push({
3020
+ code: "invalid_format",
3021
+ format: "iban",
3022
+ input: payload.value,
3023
+ inst,
3024
+ continue: !def.abort
3025
+ });
3026
+ };
3027
+ });
2892
3028
  $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
2893
3029
  $ZodStringFormat.init(inst, def);
2894
3030
  inst._zod.check = (payload) => {
@@ -2919,7 +3055,7 @@ var init_schemas = __esm(() => {
2919
3055
  });
2920
3056
  $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
2921
3057
  $ZodType.init(inst, def);
2922
- inst._zod.pattern = inst._zod.bag.pattern ?? number;
3058
+ inst._zod.pattern = number;
2923
3059
  inst._zod.parse = (payload, _ctx) => {
2924
3060
  if (def.coerce)
2925
3061
  try {
@@ -3111,6 +3247,7 @@ var init_schemas = __esm(() => {
3111
3247
  }
3112
3248
  payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
3113
3249
  const proms = [];
3250
+ const abortEarly = ctx?.abortEarly;
3114
3251
  for (let i = 0;i < input.length; i++) {
3115
3252
  const item = input[i];
3116
3253
  const result = def.element._zod.run({
@@ -3121,6 +3258,8 @@ var init_schemas = __esm(() => {
3121
3258
  proms.push(result.then((result) => handleArrayResult(result, payload, i)));
3122
3259
  } else {
3123
3260
  handleArrayResult(result, payload, i);
3261
+ if (abortEarly && result.issues.length !== 0 && aborted(result))
3262
+ break;
3124
3263
  }
3125
3264
  }
3126
3265
  if (proms.length) {
@@ -3130,23 +3269,19 @@ var init_schemas = __esm(() => {
3130
3269
  };
3131
3270
  });
3132
3271
  NO_SYMBOL_KEYS = [];
3133
- propShapes = new WeakMap;
3134
3272
  $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3135
3273
  $ZodType.init(inst, def);
3136
3274
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
3137
- if (!desc?.get) {
3138
- const sh = def.shape;
3139
- propShapes.set(def, sh);
3140
- Object.defineProperty(def, "shape", {
3141
- get: () => {
3142
- const newSh = { ...sh };
3143
- Object.defineProperty(def, "shape", {
3144
- value: newSh
3145
- });
3146
- propShapes.set(def, newSh);
3147
- return newSh;
3148
- }
3149
- });
3275
+ const sh = desc?.get ? desc.get.raw : def.shape ?? {};
3276
+ if (sh) {
3277
+ const get = () => {
3278
+ const newSh = { ...sh };
3279
+ Object.defineProperty(def, "shape", { value: newSh });
3280
+ get.raw = newSh;
3281
+ return newSh;
3282
+ };
3283
+ get.raw = sh;
3284
+ Object.defineProperty(def, "shape", { get });
3150
3285
  }
3151
3286
  const _normalized = cached(() => normalizeDef(def));
3152
3287
  defineLazyInternal(inst, "propValues", (zod) => {
@@ -3186,7 +3321,14 @@ var init_schemas = __esm(() => {
3186
3321
  payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
3187
3322
  const proms = [];
3188
3323
  const shape = value.shape;
3324
+ const abortEarly = ctx?.abortEarly;
3325
+ let seen = payload.issues.length;
3189
3326
  for (const key of value.allKeys) {
3327
+ if (abortEarly && payload.issues.length !== seen) {
3328
+ if (aborted(payload, seen))
3329
+ break;
3330
+ seen = payload.issues.length;
3331
+ }
3190
3332
  if (key === "__proto__")
3191
3333
  continue;
3192
3334
  const el = shape[key];
@@ -3202,7 +3344,7 @@ var init_schemas = __esm(() => {
3202
3344
  if (!catchall) {
3203
3345
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
3204
3346
  }
3205
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
3347
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
3206
3348
  };
3207
3349
  });
3208
3350
  $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -3216,10 +3358,16 @@ var init_schemas = __esm(() => {
3216
3358
  const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
3217
3359
  const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
3218
3360
  const prefixStr = (id, k) => `
3361
+ let ${id}_ab = false;
3219
3362
  for (let i = 0; i < ${id}.issues.length; i++) {
3220
3363
  const iss = ${id}.issues[i];
3221
3364
  iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
3222
3365
  payload.issues.push(iss);
3366
+ if (iss.continue !== true) ${id}_ab = true;
3367
+ }
3368
+ if (${id}_ab && ctx && ctx.abortEarly) {
3369
+ payload.value = newResult;
3370
+ return payload;
3223
3371
  }`;
3224
3372
  doc.write(`const input = payload.value;`);
3225
3373
  const ids = Object.create(null);
@@ -3265,6 +3413,10 @@ var init_schemas = __esm(() => {
3265
3413
  input: undefined,
3266
3414
  path: [${k}]
3267
3415
  });
3416
+ if (ctx && ctx.abortEarly) {
3417
+ payload.value = newResult;
3418
+ return payload;
3419
+ }
3268
3420
  }
3269
3421
 
3270
3422
  if (${id}_present) {
@@ -3276,16 +3428,16 @@ var init_schemas = __esm(() => {
3276
3428
  doc.write(`
3277
3429
  if (${id}.issues.length) {${prefixStr(id, k)}
3278
3430
  }
3279
-
3280
- if (${id}.value === undefined) {
3281
- if (${isPresent}) {
3282
- newResult[${k}] = undefined;
3283
- }
3284
- } else {
3431
+ `);
3432
+ if (optin === "defaulted") {
3433
+ doc.write(`newResult[${k}] = ${id}.value;`);
3434
+ } else {
3435
+ doc.write(`
3436
+ if (${id}.value !== undefined || ${isPresent}) {
3285
3437
  newResult[${k}] = ${id}.value;
3286
3438
  }
3287
-
3288
3439
  `);
3440
+ }
3289
3441
  }
3290
3442
  }
3291
3443
  doc.write(`payload.value = newResult;`);
@@ -3317,7 +3469,7 @@ var init_schemas = __esm(() => {
3317
3469
  payload = fastpass(payload, ctx);
3318
3470
  if (!catchall)
3319
3471
  return payload;
3320
- return handleCatchall([], input, payload, ctx, value, inst);
3472
+ return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
3321
3473
  }
3322
3474
  return superParse(payload, ctx);
3323
3475
  };
@@ -3402,10 +3554,13 @@ var init_schemas = __esm(() => {
3402
3554
  const _super = inst._zod.parse;
3403
3555
  defineLazyInternal(inst, "propValues", (zod) => {
3404
3556
  const propValues = {};
3557
+ let undefinedCount = 0;
3405
3558
  for (const option of zod.def.options) {
3406
3559
  const pv = option._zod.propValues;
3407
3560
  if (!pv || Object.keys(pv).length === 0)
3408
3561
  throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
3562
+ if (pv[zod.def.discriminator]?.has(undefined))
3563
+ undefinedCount++;
3409
3564
  for (const [k, v] of Object.entries(pv)) {
3410
3565
  if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
3411
3566
  assignProp(propValues, k, new Set);
@@ -3415,30 +3570,17 @@ var init_schemas = __esm(() => {
3415
3570
  }
3416
3571
  }
3417
3572
  }
3573
+ if (!zod.def.unionFallback && undefinedCount > 1)
3574
+ propValues[zod.def.discriminator]?.delete(undefined);
3418
3575
  return propValues;
3419
3576
  });
3420
3577
  def.options.forEach((option, i) => {
3421
- const propShape = propShapes.get(option._zod.def);
3578
+ const propShape = rawShape(option._zod.def);
3422
3579
  if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
3423
3580
  throw new Error(`Invalid discriminated union option at index "${i}"`);
3424
3581
  }
3425
3582
  });
3426
- const disc = cached(() => {
3427
- const opts = def.options;
3428
- const map = new Map;
3429
- for (const o of opts) {
3430
- const values = o._zod.propValues?.[def.discriminator];
3431
- if (!values || values.size === 0)
3432
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
3433
- for (const v of values) {
3434
- if (map.has(v)) {
3435
- throw new Error(`Duplicate discriminator value "${String(v)}"`);
3436
- }
3437
- map.set(v, o);
3438
- }
3439
- }
3440
- return map;
3441
- });
3583
+ const disc = cached(() => discriminatorMap(def));
3442
3584
  inst._zod.parse = (payload, ctx) => {
3443
3585
  const input = payload.value;
3444
3586
  if (!isObject(input)) {
@@ -3450,8 +3592,9 @@ var init_schemas = __esm(() => {
3450
3592
  });
3451
3593
  return payload;
3452
3594
  }
3453
- const opt = disc.value.get(input?.[def.discriminator]);
3454
- if (opt) {
3595
+ const value = input?.[def.discriminator];
3596
+ const opt = disc.value.get(value);
3597
+ if (opt && (value !== undefined || ctx.direction !== "backward")) {
3455
3598
  return opt._zod.run(payload, ctx);
3456
3599
  }
3457
3600
  if (def.unionFallback || ctx.direction === "backward") {
@@ -3462,7 +3605,7 @@ var init_schemas = __esm(() => {
3462
3605
  errors: [],
3463
3606
  note: "No matching discriminator",
3464
3607
  discriminator: def.discriminator,
3465
- options: Array.from(disc.value.keys()),
3608
+ options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
3466
3609
  input,
3467
3610
  path: [def.discriminator],
3468
3611
  inst
@@ -3529,6 +3672,8 @@ var init_schemas = __esm(() => {
3529
3672
  }
3530
3673
  }
3531
3674
  const itemResults = new Array(items.length);
3675
+ const abortEarly = def.rest ? ctx?.abortEarly : undefined;
3676
+ let itemAborted = false;
3532
3677
  for (let i = 0;i < items.length; i++) {
3533
3678
  const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
3534
3679
  if (r instanceof Promise) {
@@ -3537,12 +3682,20 @@ var init_schemas = __esm(() => {
3537
3682
  }));
3538
3683
  } else {
3539
3684
  itemResults[i] = r;
3685
+ if (abortEarly && !itemAborted && r.issues.length)
3686
+ itemAborted = aborted(r);
3540
3687
  }
3541
3688
  }
3542
- if (def.rest) {
3689
+ if (def.rest && !itemAborted) {
3543
3690
  let i = items.length - 1;
3544
3691
  const rest = input.slice(items.length);
3692
+ let seen = payload.issues.length;
3545
3693
  for (const el of rest) {
3694
+ if (abortEarly && payload.issues.length !== seen) {
3695
+ if (aborted(payload, seen))
3696
+ break;
3697
+ seen = payload.issues.length;
3698
+ }
3546
3699
  i++;
3547
3700
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
3548
3701
  if (result instanceof Promise) {
@@ -3730,7 +3883,14 @@ var init_schemas = __esm(() => {
3730
3883
  }
3731
3884
  const proms = [];
3732
3885
  payload.value = memo ? memo.alloc(inst, payload, new Map, ctx) : new Map;
3886
+ const abortEarly = ctx?.abortEarly;
3887
+ let seen = payload.issues.length;
3733
3888
  for (const [key, value] of input) {
3889
+ if (abortEarly && payload.issues.length !== seen) {
3890
+ if (aborted(payload, seen))
3891
+ break;
3892
+ seen = payload.issues.length;
3893
+ }
3734
3894
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3735
3895
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
3736
3896
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
@@ -3763,7 +3923,14 @@ var init_schemas = __esm(() => {
3763
3923
  }
3764
3924
  const proms = [];
3765
3925
  payload.value = memo ? memo.alloc(inst, payload, new Set, ctx) : new Set;
3926
+ const abortEarly = ctx?.abortEarly;
3927
+ let seen = payload.issues.length;
3766
3928
  for (const item of input) {
3929
+ if (abortEarly && payload.issues.length !== seen) {
3930
+ if (aborted(payload, seen))
3931
+ break;
3932
+ seen = payload.issues.length;
3933
+ }
3767
3934
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
3768
3935
  if (result instanceof Promise) {
3769
3936
  proms.push(result.then((result) => handleSetResult(result, payload)));
@@ -3780,8 +3947,10 @@ var init_schemas = __esm(() => {
3780
3947
  const values = getEnumValues(def.entries);
3781
3948
  const valuesSet = new Set(values);
3782
3949
  inst._zod.values = valuesSet;
3783
- const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
3784
- inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
3950
+ defineLazyInternal(inst, "pattern", (zod) => {
3951
+ const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
3952
+ return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
3953
+ });
3785
3954
  inst._zod.parse = (payload, _ctx) => {
3786
3955
  const input = payload.value;
3787
3956
  if (valuesSet.has(input)) {
@@ -3800,7 +3969,10 @@ var init_schemas = __esm(() => {
3800
3969
  $ZodType.init(inst, def);
3801
3970
  const values = new Set(def.values);
3802
3971
  inst._zod.values = values;
3803
- inst._zod.pattern = new RegExp(def.values.length ? `^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
3972
+ defineLazyInternal(inst, "pattern", (zod) => {
3973
+ const vals = zod.def.values;
3974
+ return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
3975
+ });
3804
3976
  inst._zod.parse = (payload, _ctx) => {
3805
3977
  const input = payload.value;
3806
3978
  if (values.has(input)) {
@@ -4066,15 +4238,11 @@ var init_schemas = __esm(() => {
4066
4238
  const regexParts = [];
4067
4239
  for (const part of def.parts) {
4068
4240
  if (typeof part === "object" && part !== null) {
4069
- if (!part._zod.pattern) {
4241
+ const source = partPattern(part);
4242
+ if (!source) {
4070
4243
  throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
4071
4244
  }
4072
- const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
4073
- if (!source)
4074
- throw new Error(`Invalid template literal part: ${part._zod.traits}`);
4075
- const start = source.startsWith("^") ? 1 : 0;
4076
- const end = source.endsWith("$") ? source.length - 1 : source.length;
4077
- regexParts.push(source.slice(start, end));
4245
+ regexParts.push(cleanRegex(source));
4078
4246
  } else if (part === null || primitiveTypes.has(typeof part)) {
4079
4247
  regexParts.push(escapeRegex(`${part}`));
4080
4248
  } else {
@@ -4224,7 +4392,7 @@ var init_schemas = __esm(() => {
4224
4392
  });
4225
4393
  });
4226
4394
 
4227
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/compile.js
4395
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/compile.js
4228
4396
  function compileValidator(schema, parser) {
4229
4397
  try {
4230
4398
  return compileFn(schema, { assertOnly: true });
@@ -4235,38 +4403,46 @@ function compileValidator(schema, parser) {
4235
4403
  function compile(schema, options) {
4236
4404
  try {
4237
4405
  const parser = compileFn(schema);
4238
- const clone2 = clone(schema);
4239
- const liveRun = schema._zod.run;
4240
- const originalRun = liveRun.__originalRun ?? liveRun;
4241
- const wrapped = (payload, ctx) => {
4242
- if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
4243
- return originalRun(payload, ctx);
4244
- }
4245
- if (ctx && isBackEdge(ctx, payload.value)) {
4246
- return originalRun(payload, ctx);
4247
- }
4248
- const out = parser(payload.value);
4249
- if (out !== INVALID) {
4250
- payload.value = out;
4251
- return payload;
4252
- }
4253
- if (ctx)
4254
- ctx[FALLBACK_FLAG] = true;
4255
- return originalRun(payload, ctx);
4256
- };
4257
- wrapped.__originalRun = originalRun;
4258
- clone2._zod.bag.fallbackRun = originalRun;
4259
- clone2._zod.bag.validator = compileValidator(schema, parser);
4260
- clone2._zod.run = wrapped;
4261
- if (!liveRun.__originalRun)
4262
- installCompiledUserMethods(clone2, schema, parser);
4263
- return clone2;
4406
+ const clone = withParser(schema, parser);
4407
+ clone._zod.bag.validator = compileValidator(schema, parser);
4408
+ return clone;
4264
4409
  } catch (err) {
4265
4410
  if (options?.strict)
4266
4411
  throw err;
4267
4412
  return schema;
4268
4413
  }
4269
4414
  }
4415
+ function withParser(schema, parser) {
4416
+ if (isRecursiveSchema(schema)) {
4417
+ throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
4418
+ }
4419
+ const clone2 = clone(schema);
4420
+ const liveRun = schema._zod.run;
4421
+ const originalRun = liveRun.__originalRun ?? liveRun;
4422
+ const wrapped = (payload, ctx) => {
4423
+ if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
4424
+ return originalRun(payload, ctx);
4425
+ }
4426
+ if (ctx && isBackEdge(ctx, payload.value)) {
4427
+ return originalRun(payload, ctx);
4428
+ }
4429
+ const out = parser(payload.value);
4430
+ if (out !== INVALID) {
4431
+ payload.value = out;
4432
+ return payload;
4433
+ }
4434
+ if (ctx)
4435
+ ctx[FALLBACK_FLAG] = true;
4436
+ return originalRun(payload, ctx);
4437
+ };
4438
+ wrapped.__originalRun = originalRun;
4439
+ clone2._zod.bag.fallbackRun = originalRun;
4440
+ clone2._zod.bag.validator = parser;
4441
+ clone2._zod.run = wrapped;
4442
+ if (!liveRun.__originalRun)
4443
+ installCompiledUserMethods(clone2, schema, parser);
4444
+ return clone2;
4445
+ }
4270
4446
  function installCompiledUserMethods(target, source, parser) {
4271
4447
  const targetAny = target;
4272
4448
  const sourceAny = source;
@@ -4302,7 +4478,8 @@ function compileFn(schema, options) {
4302
4478
  const ctx = {
4303
4479
  constants: new Map,
4304
4480
  constantCounter: 0,
4305
- varCounter: 0
4481
+ varCounter: 0,
4482
+ definite: true
4306
4483
  };
4307
4484
  const doc = new Doc(["input"]);
4308
4485
  const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
@@ -4327,6 +4504,7 @@ ${code}
4327
4504
  if (options?.debug) {
4328
4505
  fn.code = fullCode;
4329
4506
  }
4507
+ fn.definite = ctx.definite;
4330
4508
  return fn;
4331
4509
  }
4332
4510
  function addConstant(ctx, value) {
@@ -4338,6 +4516,10 @@ function addConstant(ctx, value) {
4338
4516
  ctx.constants.set(name, value);
4339
4517
  return name;
4340
4518
  }
4519
+ function addUserConstant(ctx, fn) {
4520
+ ctx.definite = false;
4521
+ return addConstant(ctx, fn);
4522
+ }
4341
4523
  function newVar(ctx) {
4342
4524
  return `v${ctx.varCounter++}`;
4343
4525
  }
@@ -4370,6 +4552,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
4370
4552
  }
4371
4553
  }
4372
4554
  function emitRuntimeIsland(doc, ctx, schema, accessor) {
4555
+ ctx.definite = false;
4373
4556
  const schemaConst = addConstant(ctx, schema);
4374
4557
  const runConst = addConstant(ctx, runtimeRun);
4375
4558
  const outVar = newVar(ctx);
@@ -4442,6 +4625,9 @@ function generateChecks(doc, ctx, schema, accessor) {
4442
4625
  case "property":
4443
4626
  generatePropertyCheck(doc, ctx, def, currentAccessor);
4444
4627
  break;
4628
+ case "properties":
4629
+ generatePropertiesChecks(doc, ctx, def, currentAccessor);
4630
+ break;
4445
4631
  case "overwrite": {
4446
4632
  const newAccessor = newVar(ctx);
4447
4633
  generateOverwriteCheck(doc, ctx, check, currentAccessor, newAccessor);
@@ -4547,6 +4733,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
4547
4733
  doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
4548
4734
  }
4549
4735
  }
4736
+ function generatePropertiesChecks(doc, ctx, def, accessor) {
4737
+ if (def.when) {
4738
+ throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
4739
+ }
4740
+ doc.write(`if (${accessor} == null) return INVALID;`);
4741
+ const shape = def.shape;
4742
+ for (const key of Reflect.ownKeys(shape)) {
4743
+ const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
4744
+ const inputVar = newVar(ctx);
4745
+ doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
4746
+ compileChild(doc, ctx, shape[key], inputVar, false);
4747
+ }
4748
+ }
4550
4749
  function generatePropertyCheck(doc, ctx, def, accessor) {
4551
4750
  const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
4552
4751
  generateCheck(doc, ctx, def.schema, propAccessor);
@@ -4574,7 +4773,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
4574
4773
  if (isAsyncFunction(def.fn)) {
4575
4774
  throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
4576
4775
  }
4577
- const fnConst = addConstant(ctx, def.fn);
4776
+ const fnConst = addUserConstant(ctx, def.fn);
4578
4777
  const throwAsyncConst = addConstant(ctx, throwAsync);
4579
4778
  const resVar = newVar(ctx);
4580
4779
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -4594,7 +4793,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
4594
4793
  throwAsync();
4595
4794
  return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
4596
4795
  };
4597
- const helperConst = addConstant(ctx, helperFn);
4796
+ const helperConst = addUserConstant(ctx, helperFn);
4598
4797
  const outVar = newVar(ctx);
4599
4798
  doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
4600
4799
  doc.write(`if (${outVar} === INVALID) return INVALID;`);
@@ -4602,7 +4801,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
4602
4801
  }
4603
4802
  throw new ZodCompileUnsupportedError("custom check without a predicate or check function");
4604
4803
  }
4605
- function generateStringFormatCheck(doc, ctx, def, accessor) {
4804
+ function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
4606
4805
  const fmt = def.format;
4607
4806
  if (fmt === "base64") {
4608
4807
  const validator = addConstant(ctx, isValidBase64);
@@ -4635,9 +4834,14 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
4635
4834
  doc.write(`if (!${validator}(${accessor})) return INVALID;`);
4636
4835
  return accessor;
4637
4836
  }
4837
+ if (fmt === "iban") {
4838
+ const validator = addConstant(ctx, isValidIBAN);
4839
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
4840
+ return accessor;
4841
+ }
4638
4842
  const formatDef = def;
4639
4843
  if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== undefined || formatDef.protocol !== undefined) {
4640
- const parseConst = addConstant(ctx, parseURLObject);
4844
+ const parseConst = addConstant(ctx, validateURL);
4641
4845
  const defConst = addConstant(ctx, def);
4642
4846
  const trimVar = newVar(ctx);
4643
4847
  const urlVar = newVar(ctx);
@@ -4652,6 +4856,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
4652
4856
  const protocolConst = addConstant(ctx, urlProtocolOk);
4653
4857
  doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
4654
4858
  }
4859
+ if (!needsValue)
4860
+ return null;
4655
4861
  const outputVar = newVar(ctx);
4656
4862
  const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
4657
4863
  doc.write(`const ${outputVar} = ${outputExpr};`);
@@ -4710,7 +4916,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
4710
4916
  let typeAccessor;
4711
4917
  switch (type) {
4712
4918
  case "string":
4713
- typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
4919
+ typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
4714
4920
  break;
4715
4921
  case "number":
4716
4922
  typeAccessor = generateNumberCheck(doc, schema, accessor);
@@ -4830,12 +5036,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
4830
5036
  return null;
4831
5037
  return generateChecks(doc, ctx, schema, typeAccessor);
4832
5038
  }
4833
- function generateStringCheck(doc, ctx, schema, accessor) {
5039
+ function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
4834
5040
  doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
4835
5041
  const def = schema._zod.def;
4836
5042
  if (def.format === undefined)
4837
5043
  return accessor;
4838
- return generateStringFormatCheck(doc, ctx, def, accessor);
5044
+ return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
4839
5045
  }
4840
5046
  function generateNumberCheck(doc, schema, accessor) {
4841
5047
  doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
@@ -4953,7 +5159,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
4953
5159
  }
4954
5160
  }
4955
5161
  const outputVar = newVar(ctx);
4956
- const hasConditionalKeys = allKeys.some((k) => mayOutputUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
5162
+ const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
4957
5163
  if (!buildsValue) {
4958
5164
  if (unknownKeysMode === "schema") {
4959
5165
  const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
@@ -4980,7 +5186,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
4980
5186
  const out = propOutputs.get(k);
4981
5187
  if (dropsWhenAbsent(propShape[k])) {
4982
5188
  doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
4983
- } else if (mayOutputUndefined(propShape[k])) {
5189
+ } else if (mayOmitUndefined(propShape[k])) {
4984
5190
  doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
4985
5191
  } else {
4986
5192
  doc.write(`${outputVar}[${kx}] = ${out};`);
@@ -5113,6 +5319,9 @@ function fastPathAcceptsAbsence(schema) {
5113
5319
  function dropsWhenAbsent(schema) {
5114
5320
  return schema._zod.optin === "optional" && schema._zod.optout === "optional";
5115
5321
  }
5322
+ function mayOmitUndefined(schema) {
5323
+ return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
5324
+ }
5116
5325
  function mayOutputUndefined(schema) {
5117
5326
  const def = schema._zod.def;
5118
5327
  switch (def.type) {
@@ -5455,6 +5664,7 @@ function literalEquality(ctx, accessor, value) {
5455
5664
  }
5456
5665
  function generateIntersectionCheck(doc, ctx, schema, accessor) {
5457
5666
  const def = schema._zod.def;
5667
+ ctx.definite = false;
5458
5668
  const leftOutput = compileChild(doc, ctx, def.left, accessor);
5459
5669
  const rightOutput = compileChild(doc, ctx, def.right, accessor);
5460
5670
  const mergeConst = addConstant(ctx, mergeValues);
@@ -5508,14 +5718,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
5508
5718
  const keyIsBareString = keyDef.type === "string" && keyDef.format === undefined && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
5509
5719
  if (!keyIsBareString) {
5510
5720
  const isLoose = def.mode === "loose";
5511
- const keyFast = addConstant(ctx, compileFn(def.keyType));
5721
+ const keyFn = compileFn(def.keyType);
5722
+ if (keyFn.definite === false)
5723
+ ctx.definite = false;
5724
+ const keyFast = addConstant(ctx, keyFn);
5512
5725
  const numericConst = addConstant(ctx, number);
5513
- const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
5514
5726
  const outKeyVar = newVar(ctx);
5515
- doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
5516
- doc.indented((d) => {
5517
- d.write(`if (${kVar} === "__proto__") continue;`);
5518
- d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
5727
+ emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
5519
5728
  d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
5520
5729
  d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
5521
5730
  if (isLoose) {
@@ -5529,21 +5738,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
5529
5738
  const valOutput = compileChild(d, ctx, def.valueType, valueVar);
5530
5739
  d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
5531
5740
  });
5532
- doc.write(`}`);
5533
5741
  return outputVar;
5534
5742
  }
5535
- const propIsEnumerable = addConstant(ctx, Object.prototype.propertyIsEnumerable);
5536
- doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
5537
- doc.indented((d) => {
5538
- d.write(`if (${kVar} === "__proto__") continue;`);
5539
- d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
5540
- d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
5743
+ emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
5541
5744
  d.write(`const ${valVar} = ${accessor}[${kVar}];`);
5542
5745
  const valOutput = compileChild(d, ctx, def.valueType, valVar);
5543
5746
  d.write(`${outputVar}[${kVar}] = ${valOutput};`);
5747
+ }, `return INVALID;`);
5748
+ return outputVar;
5749
+ }
5750
+ function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
5751
+ const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
5752
+ const symsVar = newVar(ctx);
5753
+ const keysVar = newVar(ctx);
5754
+ const iVar = newVar(ctx);
5755
+ doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
5756
+ doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
5757
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
5758
+ doc.indented((d) => {
5759
+ d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
5760
+ d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
5761
+ body(d);
5762
+ });
5763
+ doc.write(`}`);
5764
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
5765
+ doc.indented((d) => {
5766
+ d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
5767
+ d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
5768
+ if (onSymbol)
5769
+ d.write(onSymbol);
5770
+ else
5771
+ body(d);
5544
5772
  });
5545
5773
  doc.write(`}`);
5546
- return outputVar;
5547
5774
  }
5548
5775
  function literalPropertyKey(ctx, key) {
5549
5776
  if (typeof key === "string")
@@ -5596,7 +5823,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
5596
5823
  }
5597
5824
  function generateLazyCheck(doc, ctx, schema, accessor) {
5598
5825
  const def = schema._zod.def;
5599
- const getterConst = addConstant(ctx, def.getter);
5826
+ const getterConst = addUserConstant(ctx, def.getter);
5600
5827
  const cacheConst = addConstant(ctx, { parser: null });
5601
5828
  doc.write(`if (!${cacheConst}.parser) {`);
5602
5829
  doc.indented((d) => {
@@ -5629,7 +5856,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
5629
5856
  return INVALID;
5630
5857
  return fakePayload.issues.length === 0 ? result : INVALID;
5631
5858
  };
5632
- const helperConst = addConstant(ctx, helperFn);
5859
+ const helperConst = addUserConstant(ctx, helperFn);
5633
5860
  const transformedVar = newVar(ctx);
5634
5861
  doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
5635
5862
  doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
@@ -5647,7 +5874,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
5647
5874
  if (isAsyncFunction(def.fn)) {
5648
5875
  throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
5649
5876
  }
5650
- const fnConst = addConstant(ctx, def.fn);
5877
+ const fnConst = addUserConstant(ctx, def.fn);
5651
5878
  const throwAsyncConst = addConstant(ctx, throwAsync);
5652
5879
  const resVar = newVar(ctx);
5653
5880
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -5680,7 +5907,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
5680
5907
  });
5681
5908
  doc.write(`})();`);
5682
5909
  const innerConst = addConstant(ctx, def.innerType);
5683
- const catchConst = addConstant(ctx, def.catchValue);
5910
+ const catchConst = addUserConstant(ctx, def.catchValue);
5684
5911
  const catchHelperConst = addConstant(ctx, runtimeCatch);
5685
5912
  doc.write(`if (${outputVar} === INVALID) {`);
5686
5913
  doc.indented((d) => {
@@ -5704,7 +5931,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
5704
5931
  return INVALID;
5705
5932
  return fakePayload.issues.length === 0 ? result : INVALID;
5706
5933
  };
5707
- const helperConst = addConstant(ctx, helperFn);
5934
+ const helperConst = addUserConstant(ctx, helperFn);
5708
5935
  const outputVar = newVar(ctx);
5709
5936
  doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
5710
5937
  doc.write(`if (${outputVar} === INVALID) return INVALID;`);
@@ -5770,7 +5997,7 @@ var init_compile = __esm(() => {
5770
5997
  ]);
5771
5998
  });
5772
5999
 
5773
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/locales/en.js
6000
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/locales/en.js
5774
6001
  function en_default() {
5775
6002
  return {
5776
6003
  localeError: error()
@@ -5815,7 +6042,9 @@ var error = () => {
5815
6042
  base64url: "base64url-encoded string",
5816
6043
  json_string: "JSON string",
5817
6044
  e164: "E.164 number",
6045
+ currency_code: "currency code",
5818
6046
  credit_card: "credit card number",
6047
+ iban: "IBAN",
5819
6048
  jwt: "JWT",
5820
6049
  template_literal: "input"
5821
6050
  };
@@ -5894,10 +6123,10 @@ var init_en = __esm(() => {
5894
6123
  init_util();
5895
6124
  });
5896
6125
 
5897
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/locales/index.js
6126
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/locales/index.js
5898
6127
  var init_locales = () => {};
5899
6128
 
5900
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/registries.js
6129
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/registries.js
5901
6130
  class $ZodRegistry {
5902
6131
  constructor() {
5903
6132
  this._map = new WeakMap;
@@ -5947,19 +6176,17 @@ var init_registries = __esm(() => {
5947
6176
  globalRegistry = globalThis.__zod_globalRegistry;
5948
6177
  });
5949
6178
 
5950
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/api.js
6179
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/api.js
6180
+ function snapshotChecks(def) {
6181
+ if (def.checks)
6182
+ def.checks = [...def.checks];
6183
+ return def;
6184
+ }
5951
6185
  function _string(Class, params) {
5952
- return new Class({
5953
- type: "string",
5954
- ...normalizeParams(params)
5955
- });
6186
+ return new Class(snapshotChecks({ type: "string", ...normalizeParams(params) }));
5956
6187
  }
5957
6188
  function _coercedString(Class, params) {
5958
- return new Class({
5959
- type: "string",
5960
- coerce: true,
5961
- ...normalizeParams(params)
5962
- });
6189
+ return new Class(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
5963
6190
  }
5964
6191
  function _email(Class, params) {
5965
6192
  return new Class({
@@ -6171,6 +6398,15 @@ function _creditCard(Class, params) {
6171
6398
  ...normalizeParams(params)
6172
6399
  });
6173
6400
  }
6401
+ function _iban(Class, params) {
6402
+ return new Class({
6403
+ type: "string",
6404
+ format: "iban",
6405
+ check: "string_format",
6406
+ abort: false,
6407
+ ...normalizeParams(params)
6408
+ });
6409
+ }
6174
6410
  function _jwt(Class, params) {
6175
6411
  return new Class({
6176
6412
  type: "string",
@@ -6217,19 +6453,10 @@ function _isoDuration(Class, params) {
6217
6453
  });
6218
6454
  }
6219
6455
  function _number(Class, params) {
6220
- return new Class({
6221
- type: "number",
6222
- checks: [],
6223
- ...normalizeParams(params)
6224
- });
6456
+ return new Class(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
6225
6457
  }
6226
6458
  function _coercedNumber(Class, params) {
6227
- return new Class({
6228
- type: "number",
6229
- coerce: true,
6230
- checks: [],
6231
- ...normalizeParams(params)
6232
- });
6459
+ return new Class(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
6233
6460
  }
6234
6461
  function _int(Class, params) {
6235
6462
  return new Class({
@@ -6527,8 +6754,12 @@ function _property(property, schema, params) {
6527
6754
  ...normalizeParams(params)
6528
6755
  });
6529
6756
  }
6530
- function _properties(shape) {
6531
- return Object.entries(shape).map(([property, schema]) => new $ZodCheckProperty({ check: "property", property, schema }));
6757
+ function _properties(shape, params) {
6758
+ return new $ZodCheckProperties({
6759
+ check: "properties",
6760
+ shape,
6761
+ ...normalizeParams(params)
6762
+ });
6532
6763
  }
6533
6764
  function _mime(types, params) {
6534
6765
  return new $ZodCheckMimeType({
@@ -6717,7 +6948,7 @@ var init_api = __esm(() => {
6717
6948
  init_util();
6718
6949
  });
6719
6950
 
6720
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js
6951
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/to-json-schema.js
6721
6952
  function assignProps(target, ...sources) {
6722
6953
  for (const source of sources) {
6723
6954
  for (const key of Reflect.ownKeys(source)) {
@@ -6761,7 +6992,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
6761
6992
  Object.assign(json, result);
6762
6993
  return true;
6763
6994
  }
6764
- function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
6995
+ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
6765
6996
  var _a;
6766
6997
  const def = schema._zod.def;
6767
6998
  const seen = ctx.seen.get(schema);
@@ -6800,7 +7031,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
6800
7031
  if (parent) {
6801
7032
  if (!result.ref)
6802
7033
  result.ref = parent;
6803
- process2(parent, ctx, params);
7034
+ processSchema(parent, ctx, params);
6804
7035
  ctx.seen.get(parent).isParent = true;
6805
7036
  }
6806
7037
  }
@@ -6905,7 +7136,6 @@ function extractDefs(ctx, schema) {
6905
7136
  if (seen.count > 1) {
6906
7137
  if (ctx.reused === "ref") {
6907
7138
  extractToDef(entry);
6908
- continue;
6909
7139
  }
6910
7140
  }
6911
7141
  }
@@ -7228,13 +7458,13 @@ function isTransforming(_schema, _ctx) {
7228
7458
  }
7229
7459
  var FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
7230
7460
  const ctx = initializeContext({ ...params, processors });
7231
- process2(schema, ctx);
7461
+ processSchema(schema, ctx);
7232
7462
  extractDefs(ctx, schema);
7233
7463
  return finalize(ctx, schema);
7234
7464
  }, createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
7235
7465
  const { libraryOptions, target } = params ?? {};
7236
7466
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
7237
- process2(schema, ctx);
7467
+ processSchema(schema, ctx);
7238
7468
  extractDefs(ctx, schema);
7239
7469
  return finalize(ctx, schema);
7240
7470
  };
@@ -7245,7 +7475,35 @@ var init_to_json_schema = __esm(() => {
7245
7475
  UNION_KEYS = ["oneOf", "anyOf"];
7246
7476
  });
7247
7477
 
7248
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.js
7478
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/json-schema-processors.js
7479
+ function aggregateChecks(schema) {
7480
+ const agg = {};
7481
+ const def = schema._zod.def;
7482
+ const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
7483
+ for (const ch of list)
7484
+ contributors[ch._zod.def.check]?.(agg, ch._zod.def);
7485
+ const bag = schema._zod.bag;
7486
+ if (bag.minimum !== undefined)
7487
+ narrowMin(agg, "minimum", bag.minimum);
7488
+ if (bag.exclusiveMinimum !== undefined)
7489
+ narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
7490
+ if (bag.maximum !== undefined)
7491
+ narrowMax(agg, "maximum", bag.maximum);
7492
+ if (bag.exclusiveMaximum !== undefined)
7493
+ narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
7494
+ if (bag.multipleOf !== undefined)
7495
+ addDivisor(agg, bag.multipleOf);
7496
+ if (bag.format !== undefined) {
7497
+ agg.format ?? (agg.format = bag.format);
7498
+ if (bag.format.includes("int"))
7499
+ agg.isInt = true;
7500
+ }
7501
+ if (bag.mime)
7502
+ intersectMime(agg, bag.mime);
7503
+ for (const pattern of bag.patterns ?? [])
7504
+ addPattern(agg, pattern);
7505
+ return agg;
7506
+ }
7249
7507
  function inputOptin(schema) {
7250
7508
  const def = schema._zod.def;
7251
7509
  if (def.type === "pipe" && def.in._zod.traits.has("$ZodTransform")) {
@@ -7338,7 +7596,7 @@ function toJSONSchema(input, params) {
7338
7596
  const defs = {};
7339
7597
  for (const entry of registry._idmap.entries()) {
7340
7598
  const [_, schema] = entry;
7341
- process2(schema, ctx);
7599
+ processSchema(schema, ctx);
7342
7600
  }
7343
7601
  const schemas = {};
7344
7602
  const external = {
@@ -7361,14 +7619,41 @@ function toJSONSchema(input, params) {
7361
7619
  return { schemas };
7362
7620
  }
7363
7621
  const ctx = initializeContext({ ...params, processors: allProcessors });
7364
- process2(input, ctx);
7622
+ processSchema(input, ctx);
7365
7623
  extractDefs(ctx, input);
7366
7624
  return finalize(ctx, input);
7367
7625
  }
7368
- var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7626
+ var narrowMin = (agg, key, value) => {
7627
+ if (agg[key] === undefined || value > agg[key])
7628
+ agg[key] = value;
7629
+ }, narrowMax = (agg, key, value) => {
7630
+ if (agg[key] === undefined || value < agg[key])
7631
+ agg[key] = value;
7632
+ }, narrowBoth = (agg, value) => {
7633
+ narrowMin(agg, "minimum", value);
7634
+ narrowMax(agg, "maximum", value);
7635
+ }, addDivisor = (agg, value) => {
7636
+ agg.multipleOf ?? (agg.multipleOf = []);
7637
+ if (!agg.multipleOf.includes(value))
7638
+ agg.multipleOf.push(value);
7639
+ }, addPattern = (agg, pattern) => {
7640
+ agg.patterns ?? (agg.patterns = new Set);
7641
+ agg.patterns.add(pattern);
7642
+ }, intersectMime = (agg, mime) => {
7643
+ agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
7644
+ }, setFormat = (agg, format) => {
7645
+ agg.format = format;
7646
+ if (format.includes("int"))
7647
+ agg.isInt = true;
7648
+ }, minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum), maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum), formatContributor = (ranges) => (agg, def) => {
7649
+ setFormat(agg, def.format);
7650
+ const [minimum, maximum] = ranges[def.format];
7651
+ narrowMin(agg, "minimum", minimum);
7652
+ narrowMax(agg, "maximum", maximum);
7653
+ }, contributors, formatMap, exactPatterns, exactPattern = (p) => exactPatterns.get(p) ?? p, stringProcessor = (schema, ctx, _json, _params) => {
7369
7654
  const json = _json;
7370
7655
  json.type = "string";
7371
- const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
7656
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
7372
7657
  if (typeof minimum === "number")
7373
7658
  json.minLength = minimum;
7374
7659
  if (typeof maximum === "number")
@@ -7384,7 +7669,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7384
7669
  if (contentEncoding)
7385
7670
  json.contentEncoding = contentEncoding;
7386
7671
  if (patterns && patterns.size > 0) {
7387
- const patternList = [...patterns];
7672
+ const patternList = [...patterns].map(exactPattern);
7388
7673
  if (patternList.length === 1)
7389
7674
  json.pattern = patternList[0].source;
7390
7675
  else if (patternList.length > 1) {
@@ -7398,11 +7683,8 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7398
7683
  }
7399
7684
  }, numberProcessor = (schema, ctx, _json, params) => {
7400
7685
  const json = _json;
7401
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
7402
- if (typeof format === "string" && format.includes("int"))
7403
- json.type = "integer";
7404
- else
7405
- json.type = "number";
7686
+ const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
7687
+ json.type = isInt ? "integer" : "number";
7406
7688
  const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
7407
7689
  const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
7408
7690
  const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
@@ -7426,11 +7708,19 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7426
7708
  } else if (typeof maximum === "number") {
7427
7709
  json.maximum = maximum;
7428
7710
  }
7429
- if (typeof multipleOf === "number") {
7430
- if (Number.isFinite(multipleOf) && multipleOf !== 0)
7431
- json.multipleOf = Math.abs(multipleOf);
7432
- else
7433
- handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
7711
+ if (multipleOf) {
7712
+ const divisors = new Set;
7713
+ for (const divisor of multipleOf) {
7714
+ if (Number.isFinite(divisor) && divisor !== 0)
7715
+ divisors.add(Math.abs(divisor));
7716
+ else
7717
+ handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
7718
+ }
7719
+ const [first, ...rest] = divisors;
7720
+ if (first !== undefined)
7721
+ json.multipleOf = first;
7722
+ if (rest.length)
7723
+ json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
7434
7724
  }
7435
7725
  }, booleanProcessor = (_schema, _ctx, json, _params) => {
7436
7726
  json.type = "boolean";
@@ -7515,27 +7805,22 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7515
7805
  _json.pattern = pattern.source;
7516
7806
  }, fileProcessor = (schema, _ctx, json, _params) => {
7517
7807
  const _json = json;
7518
- const file = {
7519
- type: "string",
7520
- format: "binary",
7521
- contentEncoding: "binary"
7522
- };
7523
- const { minimum, maximum, mime } = schema._zod.bag;
7808
+ _json.type = "string";
7809
+ _json.format = "binary";
7810
+ _json.contentEncoding = "binary";
7811
+ const { minimum, maximum, mime } = aggregateChecks(schema);
7524
7812
  if (minimum !== undefined)
7525
- file.minLength = minimum;
7813
+ _json.minLength = minimum;
7526
7814
  if (maximum !== undefined)
7527
- file.maxLength = maximum;
7528
- if (mime) {
7529
- if (mime.length === 1) {
7530
- file.contentMediaType = mime[0];
7531
- Object.assign(_json, file);
7532
- } else {
7533
- Object.assign(_json, file);
7534
- _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
7535
- }
7536
- } else {
7537
- Object.assign(_json, file);
7538
- }
7815
+ _json.maxLength = maximum;
7816
+ if (!mime)
7817
+ return;
7818
+ if (mime.length === 0)
7819
+ _json.not = {};
7820
+ else if (mime.length === 1)
7821
+ _json.contentMediaType = mime[0];
7822
+ else
7823
+ _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
7539
7824
  }, successProcessor = (_schema, _ctx, json, _params) => {
7540
7825
  json.type = "boolean";
7541
7826
  }, customProcessor = (schema, ctx, json, params) => {
@@ -7551,13 +7836,13 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7551
7836
  }, arrayProcessor = (schema, ctx, _json, params) => {
7552
7837
  const json = _json;
7553
7838
  const def = schema._zod.def;
7554
- const { minimum, maximum } = schema._zod.bag;
7839
+ const { minimum, maximum } = aggregateChecks(schema);
7555
7840
  if (typeof minimum === "number")
7556
7841
  json.minItems = minimum;
7557
7842
  if (typeof maximum === "number")
7558
7843
  json.maxItems = maximum;
7559
7844
  json.type = "array";
7560
- json.items = process2(def.element, ctx, {
7845
+ json.items = processSchema(def.element, ctx, {
7561
7846
  ...params,
7562
7847
  path: [...params.path, "items"]
7563
7848
  });
@@ -7572,22 +7857,20 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7572
7857
  json.type = "object";
7573
7858
  json.properties = {};
7574
7859
  for (const key in shape) {
7575
- assignProp(json.properties, key, process2(shape[key], ctx, {
7860
+ assignProp(json.properties, key, processSchema(shape[key], ctx, {
7576
7861
  ...params,
7577
7862
  path: [...params.path, "properties", key]
7578
7863
  }));
7579
7864
  }
7580
- const allKeys = new Set(Object.keys(shape));
7581
- const requiredKeys = new Set([...allKeys].filter((key) => {
7865
+ const requiredKeys = [];
7866
+ for (const key of Object.keys(shape)) {
7582
7867
  const field = def.shape[key];
7583
- if (ctx.io === "input") {
7584
- return inputOptin(field) === undefined;
7585
- } else {
7586
- return field._zod.optout === undefined;
7868
+ if (ctx.io === "input" ? inputOptin(field) === undefined : field._zod.optout === undefined) {
7869
+ requiredKeys.push(key);
7587
7870
  }
7588
- }));
7589
- if (requiredKeys.size > 0) {
7590
- json.required = Array.from(requiredKeys);
7871
+ }
7872
+ if (requiredKeys.length > 0) {
7873
+ json.required = requiredKeys;
7591
7874
  }
7592
7875
  if (def.catchall?._zod.def.type === "never") {
7593
7876
  json.additionalProperties = false;
@@ -7595,7 +7878,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7595
7878
  if (ctx.io === "output")
7596
7879
  json.additionalProperties = false;
7597
7880
  } else if (def.catchall) {
7598
- json.additionalProperties = process2(def.catchall, ctx, {
7881
+ json.additionalProperties = processSchema(def.catchall, ctx, {
7599
7882
  ...params,
7600
7883
  path: [...params.path, "additionalProperties"]
7601
7884
  });
@@ -7603,7 +7886,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7603
7886
  }, unionProcessor = (schema, ctx, json, params) => {
7604
7887
  const def = schema._zod.def;
7605
7888
  const isExclusive = def.inclusive === false;
7606
- const options = def.options.map((x, i) => process2(x, ctx, {
7889
+ const options = def.options.map((x, i) => processSchema(x, ctx, {
7607
7890
  ...params,
7608
7891
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
7609
7892
  }));
@@ -7614,11 +7897,11 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7614
7897
  }
7615
7898
  }, intersectionProcessor = (schema, ctx, json, params) => {
7616
7899
  const def = schema._zod.def;
7617
- const a = process2(def.left, ctx, {
7900
+ const a = processSchema(def.left, ctx, {
7618
7901
  ...params,
7619
7902
  path: [...params.path, "allOf", 0]
7620
7903
  });
7621
- const b = process2(def.right, ctx, {
7904
+ const b = processSchema(def.right, ctx, {
7622
7905
  ...params,
7623
7906
  path: [...params.path, "allOf", 1]
7624
7907
  });
@@ -7635,11 +7918,11 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7635
7918
  json.type = "array";
7636
7919
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7637
7920
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7638
- const prefixItems = def.items.map((x, i) => process2(x, ctx, {
7921
+ const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
7639
7922
  ...params,
7640
7923
  path: [...params.path, prefixPath, i]
7641
7924
  }));
7642
- const rest = def.rest ? process2(def.rest, ctx, {
7925
+ const rest = def.rest ? processSchema(def.rest, ctx, {
7643
7926
  ...params,
7644
7927
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
7645
7928
  }) : null;
@@ -7687,7 +7970,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7687
7970
  if (isClosed)
7688
7971
  json.maxItems = maxItems;
7689
7972
  }
7690
- const { minimum, maximum } = schema._zod.bag;
7973
+ const { minimum, maximum } = aggregateChecks(schema);
7691
7974
  if (typeof minimum === "number")
7692
7975
  json.minItems = minimum;
7693
7976
  if (typeof maximum === "number")
@@ -7697,20 +7980,19 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7697
7980
  const def = schema._zod.def;
7698
7981
  json.type = "object";
7699
7982
  const keyType = def.keyType;
7700
- const keyBag = keyType._zod.bag;
7701
- const patterns = keyBag?.patterns;
7983
+ const patterns = aggregateChecks(keyType).patterns;
7702
7984
  if (def.mode === "loose" && patterns && patterns.size > 0) {
7703
- const valueSchema = process2(def.valueType, ctx, {
7985
+ const valueSchema = processSchema(def.valueType, ctx, {
7704
7986
  ...params,
7705
7987
  path: [...params.path, "patternProperties", "*"]
7706
7988
  });
7707
7989
  json.patternProperties = {};
7708
7990
  for (const pattern of patterns) {
7709
- assignProp(json.patternProperties, pattern.source, valueSchema);
7991
+ assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
7710
7992
  }
7711
7993
  } else {
7712
7994
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
7713
- json.propertyNames = process2(def.keyType, ctx, {
7995
+ json.propertyNames = processSchema(def.keyType, ctx, {
7714
7996
  ...params,
7715
7997
  path: [...params.path, "propertyNames"]
7716
7998
  });
@@ -7722,7 +8004,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7722
8004
  }
7723
8005
  pending.push(schema);
7724
8006
  }
7725
- json.additionalProperties = process2(def.valueType, ctx, {
8007
+ json.additionalProperties = processSchema(def.valueType, ctx, {
7726
8008
  ...params,
7727
8009
  path: [...params.path, "additionalProperties"]
7728
8010
  });
@@ -7737,7 +8019,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7737
8019
  }
7738
8020
  }, nullableProcessor = (schema, ctx, json, params) => {
7739
8021
  const def = schema._zod.def;
7740
- const inner = process2(def.innerType, ctx, params);
8022
+ const inner = processSchema(def.innerType, ctx, params);
7741
8023
  const seen = ctx.seen.get(schema);
7742
8024
  if (ctx.target === "openapi-3.0") {
7743
8025
  seen.ref = def.innerType;
@@ -7747,12 +8029,12 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7747
8029
  }
7748
8030
  }, nonoptionalProcessor = (schema, ctx, _json, params) => {
7749
8031
  const def = schema._zod.def;
7750
- process2(def.innerType, ctx, params);
8032
+ processSchema(def.innerType, ctx, params);
7751
8033
  const seen = ctx.seen.get(schema);
7752
8034
  seen.ref = def.innerType;
7753
8035
  }, UNREPRESENTABLE_DEFAULT, defaultProcessor = (schema, ctx, json, params) => {
7754
8036
  const def = schema._zod.def;
7755
- process2(def.innerType, ctx, params);
8037
+ processSchema(def.innerType, ctx, params);
7756
8038
  const seen = ctx.seen.get(schema);
7757
8039
  seen.ref = def.innerType;
7758
8040
  const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
@@ -7760,7 +8042,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7760
8042
  json.default = value;
7761
8043
  }, prefaultProcessor = (schema, ctx, json, params) => {
7762
8044
  const def = schema._zod.def;
7763
- process2(def.innerType, ctx, params);
8045
+ processSchema(def.innerType, ctx, params);
7764
8046
  const seen = ctx.seen.get(schema);
7765
8047
  seen.ref = def.innerType;
7766
8048
  if (ctx.io !== "input")
@@ -7770,7 +8052,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7770
8052
  json._prefault = value;
7771
8053
  }, catchProcessor = (schema, ctx, json, params) => {
7772
8054
  const def = schema._zod.def;
7773
- process2(def.innerType, ctx, params);
8055
+ processSchema(def.innerType, ctx, params);
7774
8056
  const seen = ctx.seen.get(schema);
7775
8057
  seen.ref = def.innerType;
7776
8058
  let catchValue;
@@ -7785,35 +8067,59 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
7785
8067
  const def = schema._zod.def;
7786
8068
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
7787
8069
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
7788
- process2(innerType, ctx, params);
8070
+ processSchema(innerType, ctx, params);
7789
8071
  const seen = ctx.seen.get(schema);
7790
8072
  seen.ref = innerType;
7791
8073
  }, readonlyProcessor = (schema, ctx, json, params) => {
7792
8074
  const def = schema._zod.def;
7793
- process2(def.innerType, ctx, params);
8075
+ processSchema(def.innerType, ctx, params);
7794
8076
  const seen = ctx.seen.get(schema);
7795
8077
  seen.ref = def.innerType;
7796
8078
  json.readOnly = true;
7797
8079
  }, promiseProcessor = (schema, ctx, _json, params) => {
7798
8080
  const def = schema._zod.def;
7799
- process2(def.innerType, ctx, params);
8081
+ processSchema(def.innerType, ctx, params);
7800
8082
  const seen = ctx.seen.get(schema);
7801
8083
  seen.ref = def.innerType;
7802
8084
  }, optionalProcessor = (schema, ctx, _json, params) => {
7803
8085
  const def = schema._zod.def;
7804
- process2(def.innerType, ctx, params);
8086
+ processSchema(def.innerType, ctx, params);
7805
8087
  const seen = ctx.seen.get(schema);
7806
8088
  seen.ref = def.innerType;
7807
8089
  }, lazyProcessor = (schema, ctx, _json, params) => {
7808
8090
  const innerType = schema._zod.innerType;
7809
- process2(innerType, ctx, params);
8091
+ processSchema(innerType, ctx, params);
7810
8092
  const seen = ctx.seen.get(schema);
7811
8093
  seen.ref = innerType;
7812
8094
  }, allProcessors;
7813
8095
  var init_json_schema_processors = __esm(() => {
7814
8096
  init_regexes();
8097
+ init_schemas();
7815
8098
  init_to_json_schema();
7816
8099
  init_util();
8100
+ contributors = {
8101
+ greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
8102
+ less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
8103
+ multiple_of: (agg, def) => addDivisor(agg, def.value),
8104
+ number_format: formatContributor(NUMBER_FORMAT_RANGES),
8105
+ bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
8106
+ min_length: minContributor,
8107
+ max_length: maxContributor,
8108
+ length_equals: (agg, def) => narrowBoth(agg, def.length),
8109
+ min_size: minContributor,
8110
+ max_size: maxContributor,
8111
+ size_equals: (agg, def) => narrowBoth(agg, def.size),
8112
+ string_format: (agg, def) => {
8113
+ setFormat(agg, def.format);
8114
+ if (def.pattern)
8115
+ addPattern(agg, def.pattern);
8116
+ if (def.format === "base64" || def.format === "base64url")
8117
+ agg.contentEncoding = def.format;
8118
+ if (def.local || def.precision === -1)
8119
+ agg.laxFormat = true;
8120
+ },
8121
+ mime_type: (agg, def) => intersectMime(agg, def.mime)
8122
+ };
7817
8123
  formatMap = {
7818
8124
  guid: "uuid",
7819
8125
  url: "uri",
@@ -7821,6 +8127,10 @@ var init_json_schema_processors = __esm(() => {
7821
8127
  json_string: "json-string",
7822
8128
  regex: ""
7823
8129
  };
8130
+ exactPatterns = new Map([
8131
+ [base64Charset, base64],
8132
+ [base64urlCharset, base64url]
8133
+ ]);
7824
8134
  pendingRecords = new WeakMap;
7825
8135
  UNREPRESENTABLE_DEFAULT = Symbol();
7826
8136
  allProcessors = {
@@ -7866,10 +8176,10 @@ var init_json_schema_processors = __esm(() => {
7866
8176
  };
7867
8177
  });
7868
8178
 
7869
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/json-schema.js
8179
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/json-schema.js
7870
8180
  var init_json_schema = () => {};
7871
8181
 
7872
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/index.js
8182
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/core/index.js
7873
8183
  var init_core2 = __esm(() => {
7874
8184
  init_util();
7875
8185
  init_regexes();
@@ -7888,7 +8198,7 @@ var init_core2 = __esm(() => {
7888
8198
  init_to_json_schema();
7889
8199
  });
7890
8200
 
7891
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/checks.js
8201
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/checks.js
7892
8202
  var exports_checks2 = {};
7893
8203
  __exportGetters(exports_checks2, {
7894
8204
  endsWith: () => _endsWith,
@@ -7926,7 +8236,7 @@ var init_checks2 = __esm(() => {
7926
8236
  init_core2();
7927
8237
  });
7928
8238
 
7929
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/errors.js
8239
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/errors.js
7930
8240
  function _lazyMethod(proto, key, make) {
7931
8241
  Object.defineProperty(proto, key, {
7932
8242
  configurable: true,
@@ -7977,15 +8287,16 @@ var init_errors2 = __esm(() => {
7977
8287
  });
7978
8288
  });
7979
8289
 
7980
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/parse.js
7981
- var parse3, parseAsync2, safeParse2, safeParseAsync2, encode, decode, encodeAsync, decodeAsync, safeEncode, safeDecode, safeEncodeAsync, safeDecodeAsync;
8290
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/parse.js
8291
+ var parse3, parseAsync2, safeParse, safeParseAsync, encode, decode, encodeAsync, decodeAsync, safeEncode, safeDecode, safeEncodeAsync, safeDecodeAsync;
7982
8292
  var init_parse2 = __esm(() => {
7983
8293
  init_core2();
7984
8294
  init_errors2();
8295
+ init_core2();
7985
8296
  parse3 = /* @__PURE__ */ _parse(ZodRealError);
7986
8297
  parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
7987
- safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
7988
- safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
8298
+ safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
8299
+ safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
7989
8300
  encode = /* @__PURE__ */ _encode(ZodRealError);
7990
8301
  decode = /* @__PURE__ */ _decode(ZodRealError);
7991
8302
  encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
@@ -7996,7 +8307,7 @@ var init_parse2 = __esm(() => {
7996
8307
  safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
7997
8308
  });
7998
8309
 
7999
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
8310
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/schemas.js
8000
8311
  var exports_schemas2 = {};
8001
8312
  __exportGetters(exports_schemas2, {
8002
8313
  ZodAny: () => ZodAny,
@@ -8026,12 +8337,14 @@ __exportGetters(exports_schemas2, {
8026
8337
  ZodFile: () => ZodFile,
8027
8338
  ZodFunction: () => ZodFunction,
8028
8339
  ZodGUID: () => ZodGUID,
8340
+ ZodIBAN: () => ZodIBAN,
8029
8341
  ZodIPv4: () => ZodIPv4,
8030
8342
  ZodIPv6: () => ZodIPv6,
8031
8343
  ZodISODate: () => ZodISODate,
8032
8344
  ZodISODateTime: () => ZodISODateTime,
8033
8345
  ZodISODuration: () => ZodISODuration,
8034
8346
  ZodISOTime: () => ZodISOTime,
8347
+ ZodInstanceOf: () => ZodInstanceOf,
8035
8348
  ZodIntersection: () => ZodIntersection,
8036
8349
  ZodJWT: () => ZodJWT,
8037
8350
  ZodKSUID: () => ZodKSUID,
@@ -8090,6 +8403,7 @@ __exportGetters(exports_schemas2, {
8090
8403
  creditCard: () => creditCard2,
8091
8404
  cuid: () => cuid3,
8092
8405
  cuid2: () => cuid22,
8406
+ currencyCode: () => currencyCode2,
8093
8407
  custom: () => custom,
8094
8408
  date: () => date2,
8095
8409
  describe: () => describe2,
@@ -8108,6 +8422,7 @@ __exportGetters(exports_schemas2, {
8108
8422
  hex: () => hex2,
8109
8423
  hostname: () => hostname2,
8110
8424
  httpUrl: () => httpUrl,
8425
+ iban: () => iban2,
8111
8426
  instanceof: () => _instanceof,
8112
8427
  int: () => int,
8113
8428
  int32: () => int32,
@@ -8259,6 +8574,9 @@ function e1642(params) {
8259
8574
  function creditCard2(params) {
8260
8575
  return _creditCard(ZodCreditCard, params);
8261
8576
  }
8577
+ function iban2(params) {
8578
+ return _iban(ZodIBAN, params);
8579
+ }
8262
8580
  function jwt(params) {
8263
8581
  return _jwt(ZodJWT, params);
8264
8582
  }
@@ -8271,6 +8589,9 @@ function hostname2(_params) {
8271
8589
  function hex2(_params) {
8272
8590
  return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
8273
8591
  }
8592
+ function currencyCode2(_params) {
8593
+ return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
8594
+ }
8274
8595
  function hash(alg, params) {
8275
8596
  const enc = params?.enc ?? "hex";
8276
8597
  const format = `${alg}_${enc}`;
@@ -8622,7 +8943,7 @@ function superRefine(fn, params) {
8622
8943
  return _superRefine(fn, params);
8623
8944
  }
8624
8945
  function _instanceof(cls, params = {}) {
8625
- const inst = new ZodCustom({
8946
+ const inst = new ZodInstanceOf({
8626
8947
  type: "custom",
8627
8948
  check: "custom",
8628
8949
  fn: (data) => data instanceof cls,
@@ -8656,7 +8977,7 @@ function preprocess(fn, schema) {
8656
8977
  out: schema
8657
8978
  });
8658
8979
  }
8659
- var ZodType, _ZodString, ZodString, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodCreditCard, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodXor, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodCodec, ZodPreprocess, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodFunction, ZodCustom, describe2, meta2, stringbool = (...args) => _stringbool({
8980
+ var ZodType, _ZodString, ZodString, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodCreditCard, ZodIBAN, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodXor, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodCodec, ZodPreprocess, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodFunction, ZodCustom, describe2, meta2, ZodInstanceOf, stringbool = (...args) => _stringbool({
8660
8981
  Codec: ZodCodec,
8661
8982
  Boolean: ZodBoolean,
8662
8983
  String: ZodString
@@ -8665,6 +8986,7 @@ var init_schemas2 = __esm(() => {
8665
8986
  init_core2();
8666
8987
  init_core2();
8667
8988
  init_json_schema_processors();
8989
+ init_regexes();
8668
8990
  init_to_json_schema();
8669
8991
  init_en();
8670
8992
  init_checks2();
@@ -8789,10 +9111,10 @@ var init_schemas2 = __esm(() => {
8789
9111
  return await parseAsync2(this, data, params, { callee: _parseAsync });
8790
9112
  },
8791
9113
  safeParse(data, params) {
8792
- return safeParse2(this, data, params);
9114
+ return safeParse(this, data, params);
8793
9115
  },
8794
9116
  async safeParseAsync(data, params) {
8795
- return safeParseAsync2(this, data, params);
9117
+ return safeParseAsync(this, data, params);
8796
9118
  },
8797
9119
  get spa() {
8798
9120
  return this?.safeParseAsync;
@@ -8800,6 +9122,12 @@ var init_schemas2 = __esm(() => {
8800
9122
  set spa(value) {
8801
9123
  own(this, "spa", value);
8802
9124
  },
9125
+ validate(data, params) {
9126
+ return validate(this, data, params);
9127
+ },
9128
+ validateAsync(data, params) {
9129
+ return validateAsync(this, data, params);
9130
+ },
8803
9131
  encode: function _encode(data, params) {
8804
9132
  return encode(this, data, params, { callee: _encode });
8805
9133
  },
@@ -8838,10 +9166,10 @@ var init_schemas2 = __esm(() => {
8838
9166
  $ZodString.init(inst, def);
8839
9167
  ZodType.init(inst, def);
8840
9168
  inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
8841
- const bag = inst._zod.bag;
8842
- inst.format = bag.format ?? null;
8843
- inst.minLength = bag.minimum ?? null;
8844
- inst.maxLength = bag.maximum ?? null;
9169
+ }, /* @__PURE__ */ derived({
9170
+ format: (inst) => aggregateChecks(inst).format ?? null,
9171
+ minLength: (inst) => aggregateChecks(inst).minimum ?? null,
9172
+ maxLength: (inst) => aggregateChecks(inst).maximum ?? null
8845
9173
  }, {
8846
9174
  regex(...args) {
8847
9175
  return this.check(_regex(...args));
@@ -8888,7 +9216,7 @@ var init_schemas2 = __esm(() => {
8888
9216
  slugify() {
8889
9217
  return this.check(_slugify());
8890
9218
  }
8891
- });
9219
+ }));
8892
9220
  ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
8893
9221
  $ZodString.init(inst, def);
8894
9222
  _ZodString.init(inst, def);
@@ -9072,6 +9400,10 @@ var init_schemas2 = __esm(() => {
9072
9400
  $ZodCreditCard.init(inst, def);
9073
9401
  ZodStringFormat.init(inst, def);
9074
9402
  });
9403
+ ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
9404
+ $ZodIBAN.init(inst, def);
9405
+ ZodStringFormat.init(inst, def);
9406
+ });
9075
9407
  ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
9076
9408
  $ZodJWT.init(inst, def);
9077
9409
  ZodStringFormat.init(inst, def);
@@ -9084,12 +9416,21 @@ var init_schemas2 = __esm(() => {
9084
9416
  $ZodNumber.init(inst, def);
9085
9417
  ZodType.init(inst, def);
9086
9418
  inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
9087
- const bag = inst._zod.bag;
9088
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
9089
- inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
9090
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
9091
9419
  inst.isFinite = true;
9092
- inst.format = bag.format ?? null;
9420
+ }, /* @__PURE__ */ derived({
9421
+ minValue: (inst) => {
9422
+ const { minimum, exclusiveMinimum } = aggregateChecks(inst);
9423
+ return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
9424
+ },
9425
+ maxValue: (inst) => {
9426
+ const { maximum, exclusiveMaximum } = aggregateChecks(inst);
9427
+ return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
9428
+ },
9429
+ isInt: (inst) => {
9430
+ const { isInt, multipleOf } = aggregateChecks(inst);
9431
+ return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
9432
+ },
9433
+ format: (inst) => aggregateChecks(inst).format ?? null
9093
9434
  }, {
9094
9435
  gt(value, params) {
9095
9436
  return this.check(_gt(value, params));
@@ -9136,7 +9477,7 @@ var init_schemas2 = __esm(() => {
9136
9477
  finite() {
9137
9478
  return this;
9138
9479
  }
9139
- });
9480
+ }));
9140
9481
  ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
9141
9482
  $ZodNumberFormat.init(inst, def);
9142
9483
  ZodNumber.init(inst, def);
@@ -9150,10 +9491,10 @@ var init_schemas2 = __esm(() => {
9150
9491
  $ZodBigInt.init(inst, def);
9151
9492
  ZodType.init(inst, def);
9152
9493
  inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
9153
- const bag = inst._zod.bag;
9154
- inst.minValue = bag.minimum ?? null;
9155
- inst.maxValue = bag.maximum ?? null;
9156
- inst.format = bag.format ?? null;
9494
+ }, /* @__PURE__ */ derived({
9495
+ minValue: (inst) => aggregateChecks(inst).minimum ?? null,
9496
+ maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
9497
+ format: (inst) => aggregateChecks(inst).format ?? null
9157
9498
  }, {
9158
9499
  gte(value, params) {
9159
9500
  return this.check(_gte(value, params));
@@ -9188,7 +9529,7 @@ var init_schemas2 = __esm(() => {
9188
9529
  multipleOf(value, params) {
9189
9530
  return this.check(_multipleOf(value, params));
9190
9531
  }
9191
- });
9532
+ }));
9192
9533
  ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => {
9193
9534
  $ZodBigIntFormat.init(inst, def);
9194
9535
  ZodBigInt.init(inst, def);
@@ -9234,10 +9575,16 @@ var init_schemas2 = __esm(() => {
9234
9575
  inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
9235
9576
  inst.min = (value, params) => inst.check(_gte(value, params));
9236
9577
  inst.max = (value, params) => inst.check(_lte(value, params));
9237
- const c = inst._zod.bag;
9238
- inst.minDate = c.minimum ? new Date(c.minimum) : null;
9239
- inst.maxDate = c.maximum ? new Date(c.maximum) : null;
9240
- });
9578
+ }, /* @__PURE__ */ derived({
9579
+ minDate: (inst) => {
9580
+ const { minimum } = aggregateChecks(inst);
9581
+ return minimum ? new Date(minimum) : null;
9582
+ },
9583
+ maxDate: (inst) => {
9584
+ const { maximum } = aggregateChecks(inst);
9585
+ return maximum ? new Date(maximum) : null;
9586
+ }
9587
+ }, {}));
9241
9588
  ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
9242
9589
  _ensureDefaultMemoizer();
9243
9590
  $ZodArray.init(inst, def);
@@ -9272,19 +9619,19 @@ var init_schemas2 = __esm(() => {
9272
9619
  return _enum(Object.keys(this._zod.def.shape));
9273
9620
  },
9274
9621
  catchall(catchall) {
9275
- return this.clone({ ...this._zod.def, catchall });
9622
+ return this.clone(mergeDefs(this._zod.def, { catchall }));
9276
9623
  },
9277
9624
  passthrough() {
9278
- return this.clone({ ...this._zod.def, catchall: unknown() });
9625
+ return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
9279
9626
  },
9280
9627
  loose() {
9281
- return this.clone({ ...this._zod.def, catchall: unknown() });
9628
+ return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
9282
9629
  },
9283
9630
  strict() {
9284
- return this.clone({ ...this._zod.def, catchall: never() });
9631
+ return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
9285
9632
  },
9286
9633
  strip() {
9287
- return this.clone({ ...this._zod.def, catchall: undefined });
9634
+ return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
9288
9635
  },
9289
9636
  extend(incoming) {
9290
9637
  return extend(this, incoming);
@@ -9389,7 +9736,7 @@ var init_schemas2 = __esm(() => {
9389
9736
  ZodType.init(inst, def);
9390
9737
  inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
9391
9738
  inst.enum = def.entries;
9392
- inst.options = Object.values(def.entries);
9739
+ inst.options = [...inst._zod.values];
9393
9740
  const keys = new Set(Object.keys(def.entries));
9394
9741
  inst.extract = (values, params) => {
9395
9742
  const newEntries = {};
@@ -9583,9 +9930,16 @@ var init_schemas2 = __esm(() => {
9583
9930
  });
9584
9931
  describe2 = describe;
9585
9932
  meta2 = meta;
9933
+ ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
9934
+ ZodCustom.init(inst, def);
9935
+ }, {
9936
+ properties(shape, params) {
9937
+ return this.check(_properties(shape, params));
9938
+ }
9939
+ });
9586
9940
  });
9587
9941
 
9588
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/compat.js
9942
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/compat.js
9589
9943
  var ZodIssueCode, ZodFirstPartyTypeKind;
9590
9944
  var init_compat = __esm(() => {
9591
9945
  ZodIssueCode = {
@@ -9604,7 +9958,7 @@ var init_compat = __esm(() => {
9604
9958
  (function(ZodFirstPartyTypeKind) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
9605
9959
  });
9606
9960
 
9607
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/iso.js
9961
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/iso.js
9608
9962
  var exports_iso = {};
9609
9963
  __exportGetters(exports_iso, {
9610
9964
  ZodISODate: () => ZodISODate,
@@ -9634,7 +9988,7 @@ var init_iso = __esm(() => {
9634
9988
  init_schemas2();
9635
9989
  });
9636
9990
 
9637
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/from-json-schema.js
9991
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/from-json-schema.js
9638
9992
  function detectVersion(schema, defaultTarget) {
9639
9993
  const $schema = schema.$schema;
9640
9994
  if ($schema === "https://json-schema.org/draft/2020-12/schema") {
@@ -9672,27 +10026,162 @@ function resolveRef(ref, ctx) {
9672
10026
  }
9673
10027
  throw new Error(`Reference not found: ${ref}`);
9674
10028
  }
9675
- function checkPropertyNames(objectSchema, keySchema) {
10029
+ function checkObjectGuards(objectSchema, guards) {
9676
10030
  const guard = z.transform((value) => value).check((payload) => {
9677
10031
  const value = payload.value;
9678
10032
  if (typeof value !== "object" || value === null || Array.isArray(value))
9679
10033
  return;
9680
- for (const key of Object.getOwnPropertyNames(value)) {
9681
- const result = keySchema.safeParse(key);
9682
- if (result.success)
9683
- continue;
10034
+ const keys = Object.getOwnPropertyNames(value);
10035
+ if (guards.minProperties !== undefined && keys.length < guards.minProperties) {
9684
10036
  payload.issues.push({
9685
- code: "invalid_key",
9686
- origin: "record",
9687
- issues: result.error.issues,
9688
- input: key,
9689
- path: [key],
10037
+ origin: "object",
10038
+ code: "too_small",
10039
+ minimum: guards.minProperties,
10040
+ inclusive: true,
10041
+ message: `Too small: expected object to have >=${guards.minProperties} properties`,
10042
+ input: value,
10043
+ inst: objectSchema,
9690
10044
  continue: true
9691
10045
  });
9692
10046
  }
10047
+ if (guards.maxProperties !== undefined && keys.length > guards.maxProperties) {
10048
+ payload.issues.push({
10049
+ origin: "object",
10050
+ code: "too_big",
10051
+ maximum: guards.maxProperties,
10052
+ inclusive: true,
10053
+ message: `Too big: expected object to have <=${guards.maxProperties} properties`,
10054
+ input: value,
10055
+ inst: objectSchema,
10056
+ continue: true
10057
+ });
10058
+ }
10059
+ if (guards.keySchema) {
10060
+ for (const key of keys) {
10061
+ const result = guards.keySchema.safeParse(key);
10062
+ if (result.success)
10063
+ continue;
10064
+ payload.issues.push({
10065
+ code: "invalid_key",
10066
+ origin: "record",
10067
+ issues: result.error.issues,
10068
+ input: key,
10069
+ path: [key],
10070
+ continue: true
10071
+ });
10072
+ }
10073
+ }
9693
10074
  });
9694
10075
  return guard.pipe(objectSchema);
9695
10076
  }
10077
+ function canonicalKey(value, seen) {
10078
+ if (value === null)
10079
+ return "z";
10080
+ const type = typeof value;
10081
+ if (type !== "object") {
10082
+ if (type === "number" && Number.isNaN(value))
10083
+ return null;
10084
+ const raw = String(value);
10085
+ return `${type[0]}${raw.length}:${raw}`;
10086
+ }
10087
+ if (seen.has(value))
10088
+ return null;
10089
+ seen.add(value);
10090
+ try {
10091
+ if (Array.isArray(value)) {
10092
+ const parts = [];
10093
+ for (const item of value) {
10094
+ const key = canonicalKey(item, seen);
10095
+ if (key === null)
10096
+ return null;
10097
+ parts.push(key);
10098
+ }
10099
+ return `a${parts.length}:[${parts.join(",")}]`;
10100
+ }
10101
+ const keys = Object.keys(value).sort();
10102
+ const parts = [];
10103
+ for (const k of keys) {
10104
+ const key = canonicalKey(value[k], seen);
10105
+ if (key === null)
10106
+ return null;
10107
+ parts.push(`${k.length}:${k}=${key}`);
10108
+ }
10109
+ return `o${parts.length}:{${parts.join(",")}}`;
10110
+ } finally {
10111
+ seen.delete(value);
10112
+ }
10113
+ }
10114
+ function containsRef(value) {
10115
+ if (typeof value !== "object" || value === null)
10116
+ return false;
10117
+ if (Array.isArray(value))
10118
+ return value.some(containsRef);
10119
+ if (typeof value.$ref === "string")
10120
+ return true;
10121
+ return Object.entries(value).some(([key, sub]) => {
10122
+ if (SCHEMA_KEYWORDS.has(key))
10123
+ return containsRef(sub);
10124
+ if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
10125
+ return false;
10126
+ return Object.values(sub).some(containsRef);
10127
+ });
10128
+ }
10129
+ function plural(n) {
10130
+ return n === 1 ? "element" : "elements";
10131
+ }
10132
+ function checkArrayGuards(arraySchema, guards) {
10133
+ const guard = z.transform((value) => value).check((payload) => {
10134
+ const items = payload.value;
10135
+ if (!Array.isArray(items))
10136
+ return;
10137
+ if (guards.uniqueItems === true) {
10138
+ const firstSeen = new Map;
10139
+ for (let i = 0;i < items.length; i++) {
10140
+ const key = canonicalKey(items[i], new Set);
10141
+ if (key === null)
10142
+ continue;
10143
+ const first = firstSeen.get(key);
10144
+ if (first === undefined) {
10145
+ firstSeen.set(key, i);
10146
+ continue;
10147
+ }
10148
+ payload.issues.push({
10149
+ code: "custom",
10150
+ message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
10151
+ input: items,
10152
+ path: [i],
10153
+ continue: true
10154
+ });
10155
+ }
10156
+ }
10157
+ if (guards.containsSchema) {
10158
+ const minContains = guards.minContains ?? 1;
10159
+ const ceiling = guards.maxContains !== undefined ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
10160
+ let matches = 0;
10161
+ for (const item of items) {
10162
+ if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
10163
+ break;
10164
+ }
10165
+ if (matches < minContains) {
10166
+ payload.issues.push({
10167
+ code: "custom",
10168
+ message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
10169
+ input: items,
10170
+ continue: true
10171
+ });
10172
+ }
10173
+ if (guards.maxContains !== undefined && matches > guards.maxContains) {
10174
+ payload.issues.push({
10175
+ code: "custom",
10176
+ message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
10177
+ input: items,
10178
+ continue: true
10179
+ });
10180
+ }
10181
+ }
10182
+ });
10183
+ return guard.pipe(arraySchema);
10184
+ }
9696
10185
  function getTupleRest(restSchema, ctx) {
9697
10186
  if (restSchema === false) {
9698
10187
  return;
@@ -9821,6 +10310,8 @@ function convertBaseSchema(schema, ctx) {
9821
10310
  stringSchema = stringSchema.check(z.e164());
9822
10311
  } else if (format === "credit_card") {
9823
10312
  stringSchema = stringSchema.check(z.creditCard());
10313
+ } else if (format === "iban") {
10314
+ stringSchema = stringSchema.check(z.iban());
9824
10315
  } else if (format === "jwt") {
9825
10316
  stringSchema = stringSchema.check(z.jwt());
9826
10317
  } else if (format === "emoji") {
@@ -9953,9 +10444,16 @@ function convertBaseSchema(schema, ctx) {
9953
10444
  zodSchema = objectSchema.passthrough();
9954
10445
  }
9955
10446
  }
9956
- if (schema.propertyNames !== undefined && schema.propertyNames !== true) {
9957
- const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
9958
- zodSchema = checkPropertyNames(zodSchema, convertSchema(keyJSONSchema, ctx));
10447
+ const hasKeyGuard = schema.propertyNames !== undefined && schema.propertyNames !== true;
10448
+ const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : undefined;
10449
+ const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : undefined;
10450
+ if (hasKeyGuard || minProperties !== undefined || maxProperties !== undefined) {
10451
+ let keySchema;
10452
+ if (hasKeyGuard) {
10453
+ const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
10454
+ keySchema = convertSchema(keyJSONSchema, ctx);
10455
+ }
10456
+ zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
9959
10457
  }
9960
10458
  break;
9961
10459
  }
@@ -10001,6 +10499,14 @@ function convertBaseSchema(schema, ctx) {
10001
10499
  } else {
10002
10500
  zodSchema = z.array(z.any());
10003
10501
  }
10502
+ if (schema.uniqueItems === true || schema.contains !== undefined) {
10503
+ zodSchema = checkArrayGuards(zodSchema, {
10504
+ uniqueItems: schema.uniqueItems === true,
10505
+ containsSchema: schema.contains !== undefined ? convertSchema(schema.contains, ctx) : undefined,
10506
+ minContains: typeof schema.minContains === "number" ? schema.minContains : undefined,
10507
+ maxContains: typeof schema.maxContains === "number" ? schema.maxContains : undefined
10508
+ });
10509
+ }
10004
10510
  break;
10005
10511
  }
10006
10512
  default:
@@ -10058,8 +10564,23 @@ function convertSchema(schema, ctx) {
10058
10564
  extraMeta[key] = schema[key];
10059
10565
  }
10060
10566
  }
10061
- if (schema.propertyNames !== undefined && schema.type === "object" && schema.$ref === undefined) {
10062
- extraMeta.propertyNames = schema.propertyNames;
10567
+ if (schema.type === "object" && schema.$ref === undefined) {
10568
+ if (schema.propertyNames !== undefined && !containsRef(schema.propertyNames)) {
10569
+ extraMeta.propertyNames = schema.propertyNames;
10570
+ }
10571
+ for (const key of ["minProperties", "maxProperties"]) {
10572
+ if (schema[key] !== undefined)
10573
+ extraMeta[key] = schema[key];
10574
+ }
10575
+ }
10576
+ if (schema.type === "array" && schema.$ref === undefined) {
10577
+ if (schema.contains !== undefined && !containsRef(schema.contains)) {
10578
+ extraMeta.contains = schema.contains;
10579
+ }
10580
+ for (const key of ["uniqueItems", "minContains", "maxContains"]) {
10581
+ if (schema[key] !== undefined)
10582
+ extraMeta[key] = schema[key];
10583
+ }
10063
10584
  }
10064
10585
  for (const key of Object.keys(schema)) {
10065
10586
  if (!RECOGNIZED_KEYS.has(key)) {
@@ -10096,7 +10617,7 @@ function fromJSONSchema(schema, params) {
10096
10617
  };
10097
10618
  return convertSchema(normalized, ctx);
10098
10619
  }
10099
- var z, RECOGNIZED_KEYS, fullTime;
10620
+ var z, RECOGNIZED_KEYS, SCHEMA_KEYWORDS, SCHEMA_MAP_KEYWORDS, fullTime;
10100
10621
  var init_from_json_schema = __esm(() => {
10101
10622
  init_registries();
10102
10623
  init_util();
@@ -10167,10 +10688,36 @@ var init_from_json_schema = __esm(() => {
10167
10688
  "nullable",
10168
10689
  "readOnly"
10169
10690
  ]);
10691
+ SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
10692
+ "items",
10693
+ "prefixItems",
10694
+ "additionalItems",
10695
+ "additionalProperties",
10696
+ "contains",
10697
+ "propertyNames",
10698
+ "not",
10699
+ "if",
10700
+ "then",
10701
+ "else",
10702
+ "allOf",
10703
+ "anyOf",
10704
+ "oneOf",
10705
+ "unevaluatedItems",
10706
+ "unevaluatedProperties",
10707
+ "contentSchema"
10708
+ ]);
10709
+ SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
10710
+ "properties",
10711
+ "patternProperties",
10712
+ "dependentSchemas",
10713
+ "dependencies",
10714
+ "$defs",
10715
+ "definitions"
10716
+ ]);
10170
10717
  fullTime = /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;
10171
10718
  });
10172
10719
 
10173
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/coerce.js
10720
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/coerce.js
10174
10721
  var exports_coerce = {};
10175
10722
  __exportGetters(exports_coerce, {
10176
10723
  bigint: () => bigint3,
@@ -10199,7 +10746,7 @@ var init_coerce = __esm(() => {
10199
10746
  init_schemas2();
10200
10747
  });
10201
10748
 
10202
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/external.js
10749
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/external.js
10203
10750
  var init_external = __esm(() => {
10204
10751
  init_core2();
10205
10752
  init_core2();
@@ -17244,12 +17791,12 @@ var init_chunk_BRhqBsOc = __esm(() => {
17244
17791
  __hasOwnProp2 = Object.prototype.hasOwnProperty;
17245
17792
  });
17246
17793
 
17247
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/index.js
17794
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/classic/index.js
17248
17795
  var init_classic = __esm(() => {
17249
17796
  init_external();
17250
17797
  });
17251
17798
 
17252
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/index.js
17799
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/v4/index.js
17253
17800
  var init_v4 = __esm(() => {
17254
17801
  init_classic();
17255
17802
  });
@@ -25567,7 +26114,7 @@ function createFetchWithInit(baseFetch = fetch, baseInit) {
25567
26114
  };
25568
26115
  }
25569
26116
  function parseSchema(schema, data) {
25570
- return safeParse2(schema, data);
26117
+ return safeParse(schema, data);
25571
26118
  }
25572
26119
  function isZodV4Schema(v) {
25573
26120
  return typeof v === "object" && v !== null && "_zod" in v;
@@ -32652,7 +33199,7 @@ var init_dist = __esm(() => {
32652
33199
  init_shimsNode();
32653
33200
  });
32654
33201
 
32655
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/compile.js
33202
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/compile.js
32656
33203
  init_compile();
32657
33204
  init_core2();
32658
33205
  var compiling = false;
@@ -32687,7 +33234,7 @@ globalConfig.postProcessor = (inst) => {
32687
33234
  inst._zod.run = shim;
32688
33235
  };
32689
33236
 
32690
- // ../../node_modules/.bun/zod@4.5.4/node_modules/zod/index.js
33237
+ // ../../node_modules/.bun/zod@4.6.4/node_modules/zod/index.js
32691
33238
  init_external();
32692
33239
  init_external();
32693
33240
  // ../../node_modules/.bun/incur@0.5.1/node_modules/incur/dist/Cli.js
@@ -41359,7 +41906,7 @@ var WEBHOOK_MANIFEST_VERSION = Webhook.MANIFEST_VERSION;
41359
41906
  // ../sdk/package.json
41360
41907
  var package_default = {
41361
41908
  name: "@settlemint/dalp-sdk",
41362
- version: "3.1.19-main.34838212554",
41909
+ version: "3.1.19-main.34862433650",
41363
41910
  private: false,
41364
41911
  description: "Fully typed SDK for the DALP tokenization platform API",
41365
41912
  homepage: "https://settlemint.com",
@@ -41482,16 +42029,16 @@ var package_default = {
41482
42029
  "@tanstack/react-query": "5.102.8",
41483
42030
  "@tools/typescript-config": "workspace:*",
41484
42031
  "@tools/vitest-config": "workspace:*",
41485
- "@types/bun": "catalog:toolchain",
41486
- effect: "catalog:effect",
42032
+ "@types/bun": "1.4.0",
42033
+ effect: "4.0.0-rc.115",
41487
42034
  publint: "0.3.24",
41488
42035
  typescript: "7.0.2",
41489
- vitest: "catalog:toolchain",
41490
- zod: "4.5.4"
42036
+ vitest: "5.0.0",
42037
+ zod: "4.6.4"
41491
42038
  },
41492
42039
  peerDependencies: {
41493
42040
  "@tanstack/react-query": "^5.101.4",
41494
- effect: "^4.0.0-rc.112",
42041
+ effect: "^4.0.0-rc.115",
41495
42042
  zod: "^4.5.4"
41496
42043
  },
41497
42044
  peerDependenciesMeta: {
@@ -113384,7 +113931,7 @@ async function runCommand(context, operation, errorContext = UNKNOWN_COMMAND_ERR
113384
113931
  // package.json
113385
113932
  var package_default2 = {
113386
113933
  name: "@settlemint/dalp-cli",
113387
- version: "3.1.19-main.34838212554",
113934
+ version: "3.1.19-main.34862433650",
113388
113935
  private: false,
113389
113936
  description: "CLI for the Digital Asset Lifecycle Platform \u2014 manage tokens, identities, compliance, and more from the command line.",
113390
113937
  homepage: "https://settlemint.com",
@@ -113431,16 +113978,16 @@ var package_default2 = {
113431
113978
  dependencies: {
113432
113979
  "@settlemint/dalp-sdk": "workspace:*",
113433
113980
  incur: "0.5.1",
113434
- zod: "4.5.4"
113981
+ zod: "4.6.4"
113435
113982
  },
113436
113983
  devDependencies: {
113437
113984
  "@arethetypeswrong/cli": "0.18.5",
113438
113985
  "@dapi/server": "workspace:*",
113439
113986
  "@tools/typescript-config": "workspace:*",
113440
113987
  "@tools/vitest-config": "workspace:*",
113441
- "@types/bun": "catalog:toolchain",
113988
+ "@types/bun": "1.4.0",
113442
113989
  publint: "0.3.24",
113443
- vitest: "catalog:toolchain"
113990
+ vitest: "5.0.0"
113444
113991
  },
113445
113992
  engines: {
113446
113993
  bun: ">=1.4.1"
@@ -114708,4 +115255,4 @@ if (false) {}
114708
115255
  // src/bin.ts
114709
115256
  await cli.serve();
114710
115257
 
114711
- //# debugId=A251A3D655C18CD364756E2164756E21
115258
+ //# debugId=937D4A8343E98C6564756E2164756E21