@fro.bot/systematic 3.18.0 → 3.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pi.js CHANGED
@@ -3549,7 +3549,7 @@ var BUNDLED_SKILL_NAMES = [
3549
3549
  "writing-skills"
3550
3550
  ];
3551
3551
 
3552
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/util.js
3552
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/util.js
3553
3553
  function getEnumValues(entries) {
3554
3554
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
3555
3555
  const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -3563,18 +3563,23 @@ function jsonStringifyReplacer(_, value) {
3563
3563
  return value.toString();
3564
3564
  return value;
3565
3565
  }
3566
- function cached(getter) {
3567
- const set = false;
3568
- return {
3569
- get value() {
3570
- if (!set) {
3571
- const value = getter();
3572
- Object.defineProperty(this, "value", { value });
3573
- return value;
3574
- }
3575
- throw new Error("cached value already set");
3566
+
3567
+ class Cached {
3568
+ constructor(getter) {
3569
+ this._getter = getter;
3570
+ this._value = undefined;
3571
+ }
3572
+ get value() {
3573
+ const getter = this._getter;
3574
+ if (getter !== undefined) {
3575
+ this._value = getter();
3576
+ this._getter = undefined;
3576
3577
  }
3577
- };
3578
+ return this._value;
3579
+ }
3580
+ }
3581
+ function cached(getter) {
3582
+ return new Cached(getter);
3578
3583
  }
3579
3584
  function nullish(input) {
3580
3585
  return input === null || input === undefined;
@@ -3600,6 +3605,56 @@ function assignProp(target, prop, value) {
3600
3605
  configurable: true
3601
3606
  });
3602
3607
  }
3608
+ function rawShape(def) {
3609
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
3610
+ return desc?.get ? desc.get.raw : desc?.value;
3611
+ }
3612
+ function sourceShape(schema) {
3613
+ return rawShape(schema._zod.def) ?? schema._zod.def.shape;
3614
+ }
3615
+ function deferProp(target, key, getter) {
3616
+ Object.defineProperty(target, key, {
3617
+ get() {
3618
+ const value = getter();
3619
+ assignProp(this, key, value);
3620
+ return value;
3621
+ },
3622
+ enumerable: true,
3623
+ configurable: true
3624
+ });
3625
+ }
3626
+ function putProp(target, key, value) {
3627
+ if (key in target)
3628
+ assignProp(target, key, value);
3629
+ else
3630
+ target[key] = value;
3631
+ }
3632
+ function mirrorShape(target, source, keys, wrap) {
3633
+ const raw = sourceShape(source);
3634
+ for (const key of keys) {
3635
+ const desc = Object.getOwnPropertyDescriptor(raw, key);
3636
+ if (!desc.enumerable)
3637
+ continue;
3638
+ if (desc.get) {
3639
+ deferProp(target, key, () => {
3640
+ const value = source._zod.def.shape[key];
3641
+ return wrap ? wrap(value, key) : value;
3642
+ });
3643
+ } else
3644
+ putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
3645
+ }
3646
+ }
3647
+ function mirrorProps(target, source) {
3648
+ for (const key of Reflect.ownKeys(source)) {
3649
+ const desc = Object.getOwnPropertyDescriptor(source, key);
3650
+ if (!desc.enumerable)
3651
+ continue;
3652
+ if (desc.get)
3653
+ deferProp(target, key, () => source[key]);
3654
+ else
3655
+ putProp(target, key, desc.value);
3656
+ }
3657
+ }
3603
3658
  function mergeDefs(...defs) {
3604
3659
  const mergedDescriptors = {};
3605
3660
  for (const def of defs) {
@@ -3705,6 +3760,10 @@ var NUMBER_FORMAT_RANGES = /* @__PURE__ */ (() => ({
3705
3760
  float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000],
3706
3761
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
3707
3762
  }))();
3763
+ var BIGINT_FORMAT_RANGES = {
3764
+ int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
3765
+ uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
3766
+ };
3708
3767
  function pick(schema, mask) {
3709
3768
  const currDef = schema._zod.def;
3710
3769
  const checks = currDef.checks;
@@ -3712,23 +3771,21 @@ function pick(schema, mask) {
3712
3771
  if (hasChecks) {
3713
3772
  throw new Error(".pick() cannot be used on object schemas containing refinements");
3714
3773
  }
3715
- const def = mergeDefs(schema._zod.def, {
3716
- get shape() {
3717
- const newShape = {};
3718
- for (const key of Reflect.ownKeys(mask)) {
3719
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
3720
- throw new Error(`Unrecognized key: "${String(key)}"`);
3721
- }
3722
- if (!mask[key])
3723
- continue;
3724
- assignProp(newShape, key, currDef.shape[key]);
3725
- }
3726
- assignProp(this, "shape", newShape);
3727
- return newShape;
3728
- },
3729
- checks: []
3730
- });
3731
- return clone(schema, def);
3774
+ const newShape = {};
3775
+ mirrorShape(newShape, schema, maskedKeys(schema, mask));
3776
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
3777
+ }
3778
+ function maskedKeys(schema, mask) {
3779
+ const raw = sourceShape(schema);
3780
+ const keys = [];
3781
+ for (const key of Reflect.ownKeys(mask)) {
3782
+ if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
3783
+ throw new Error(`Unrecognized key: "${String(key)}"`);
3784
+ }
3785
+ if (mask[key])
3786
+ keys.push(key);
3787
+ }
3788
+ return keys;
3732
3789
  }
3733
3790
  function omit(schema, mask) {
3734
3791
  const currDef = schema._zod.def;
@@ -3737,23 +3794,10 @@ function omit(schema, mask) {
3737
3794
  if (hasChecks) {
3738
3795
  throw new Error(".omit() cannot be used on object schemas containing refinements");
3739
3796
  }
3740
- const def = mergeDefs(schema._zod.def, {
3741
- get shape() {
3742
- const newShape = { ...schema._zod.def.shape };
3743
- for (const key of Reflect.ownKeys(mask)) {
3744
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
3745
- throw new Error(`Unrecognized key: "${String(key)}"`);
3746
- }
3747
- if (!mask[key])
3748
- continue;
3749
- delete newShape[key];
3750
- }
3751
- assignProp(this, "shape", newShape);
3752
- return newShape;
3753
- },
3754
- checks: []
3755
- });
3756
- return clone(schema, def);
3797
+ const omitted = new Set(maskedKeys(schema, mask));
3798
+ const newShape = {};
3799
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
3800
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
3757
3801
  }
3758
3802
  function extend(schema, shape) {
3759
3803
  if (!isPlainObject(shape)) {
@@ -3762,34 +3806,26 @@ function extend(schema, shape) {
3762
3806
  const checks = schema._zod.def.checks;
3763
3807
  const hasChecks = checks && checks.length > 0;
3764
3808
  if (hasChecks) {
3765
- const existingShape = schema._zod.def.shape;
3809
+ const existingShape = sourceShape(schema);
3766
3810
  for (const key of Reflect.ownKeys(shape)) {
3767
3811
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
3768
3812
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
3769
3813
  }
3770
3814
  }
3771
3815
  }
3772
- const def = mergeDefs(schema._zod.def, {
3773
- get shape() {
3774
- const _shape = { ...schema._zod.def.shape, ...shape };
3775
- assignProp(this, "shape", _shape);
3776
- return _shape;
3777
- }
3778
- });
3779
- return clone(schema, def);
3816
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
3817
+ }
3818
+ function extended(schema, shape) {
3819
+ const newShape = {};
3820
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
3821
+ mirrorProps(newShape, shape);
3822
+ return newShape;
3780
3823
  }
3781
3824
  function safeExtend(schema, shape) {
3782
3825
  if (!isPlainObject(shape)) {
3783
3826
  throw new Error("Invalid input to safeExtend: expected a plain object");
3784
3827
  }
3785
- const def = mergeDefs(schema._zod.def, {
3786
- get shape() {
3787
- const _shape = { ...schema._zod.def.shape, ...shape };
3788
- assignProp(this, "shape", _shape);
3789
- return _shape;
3790
- }
3791
- });
3792
- return clone(schema, def);
3828
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
3793
3829
  }
3794
3830
  function merge2(a, b) {
3795
3831
  if (!b?._zod?.def) {
@@ -3798,12 +3834,11 @@ function merge2(a, b) {
3798
3834
  if (a._zod.def.checks?.length) {
3799
3835
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
3800
3836
  }
3837
+ const newShape = {};
3838
+ mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
3839
+ mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
3801
3840
  const def = mergeDefs(a._zod.def, {
3802
- get shape() {
3803
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
3804
- assignProp(this, "shape", _shape);
3805
- return _shape;
3806
- },
3841
+ shape: newShape,
3807
3842
  get catchall() {
3808
3843
  return b._zod.def.catchall;
3809
3844
  },
@@ -3818,67 +3853,16 @@ function partial(Class, schema, mask, name = "partial") {
3818
3853
  if (hasChecks) {
3819
3854
  throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
3820
3855
  }
3821
- const def = mergeDefs(schema._zod.def, {
3822
- get shape() {
3823
- const oldShape = schema._zod.def.shape;
3824
- const shape = { ...oldShape };
3825
- if (mask) {
3826
- for (const key of Reflect.ownKeys(mask)) {
3827
- if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
3828
- throw new Error(`Unrecognized key: "${String(key)}"`);
3829
- }
3830
- if (!mask[key])
3831
- continue;
3832
- shape[key] = Class ? new Class({
3833
- type: "optional",
3834
- innerType: oldShape[key]
3835
- }) : oldShape[key];
3836
- }
3837
- } else {
3838
- for (const key of Reflect.ownKeys(oldShape)) {
3839
- shape[key] = Class ? new Class({
3840
- type: "optional",
3841
- innerType: oldShape[key]
3842
- }) : oldShape[key];
3843
- }
3844
- }
3845
- assignProp(this, "shape", shape);
3846
- return shape;
3847
- },
3848
- checks: []
3849
- });
3850
- return clone(schema, def);
3856
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
3857
+ const newShape = {};
3858
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })));
3859
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
3851
3860
  }
3852
3861
  function required(Class, schema, mask) {
3853
- const def = mergeDefs(schema._zod.def, {
3854
- get shape() {
3855
- const oldShape = schema._zod.def.shape;
3856
- const shape = { ...oldShape };
3857
- if (mask) {
3858
- for (const key of Reflect.ownKeys(mask)) {
3859
- if (!Object.prototype.hasOwnProperty.call(shape, key)) {
3860
- throw new Error(`Unrecognized key: "${String(key)}"`);
3861
- }
3862
- if (!mask[key])
3863
- continue;
3864
- shape[key] = new Class({
3865
- type: "nonoptional",
3866
- innerType: oldShape[key]
3867
- });
3868
- }
3869
- } else {
3870
- for (const key of Reflect.ownKeys(oldShape)) {
3871
- shape[key] = new Class({
3872
- type: "nonoptional",
3873
- innerType: oldShape[key]
3874
- });
3875
- }
3876
- }
3877
- assignProp(this, "shape", shape);
3878
- return shape;
3879
- }
3880
- });
3881
- return clone(schema, def);
3862
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
3863
+ const newShape = {};
3864
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
3865
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
3882
3866
  }
3883
3867
  function aborted(x, startIndex = 0) {
3884
3868
  if (x.aborted === true)
@@ -3928,13 +3912,18 @@ function finalizeIssue(iss, ctx, config) {
3928
3912
  }
3929
3913
  const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
3930
3914
  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";
3931
- const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
3932
- rest.path ?? (rest.path = []);
3933
- rest.message = message;
3915
+ const full = {};
3916
+ for (const k of Object.keys(iss)) {
3917
+ if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
3918
+ continue;
3919
+ full[k] = iss[k];
3920
+ }
3921
+ full.path ?? (full.path = []);
3922
+ full.message = message;
3934
3923
  if (ctx?.reportInput) {
3935
- rest.input = _input;
3924
+ full.input = iss.input;
3936
3925
  }
3937
- return rest;
3926
+ return full;
3938
3927
  }
3939
3928
  var highSurrogate = /[\uD800-\uDBFF]/;
3940
3929
  function codePointLength(str) {
@@ -3998,6 +3987,9 @@ function members(proto, table) {
3998
3987
  else
3999
3988
  defineBound(proto, key, desc.value);
4000
3989
  }
3990
+ for (const sym of Object.getOwnPropertySymbols(table)) {
3991
+ defineBound(proto, sym, table[sym]);
3992
+ }
4001
3993
  }
4002
3994
  function own(inst, key, value, enumerable = true) {
4003
3995
  Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
@@ -4006,6 +3998,22 @@ function own(inst, key, value, enumerable = true) {
4006
3998
  function hide(inst, key, value) {
4007
3999
  return own(inst, key, value, false);
4008
4000
  }
4001
+ function derived(computes, table) {
4002
+ for (const key in computes) {
4003
+ const compute = computes[key];
4004
+ Object.defineProperty(table, key, {
4005
+ configurable: true,
4006
+ enumerable: true,
4007
+ get() {
4008
+ return own(this, key, compute(this));
4009
+ },
4010
+ set(value) {
4011
+ own(this, key, value);
4012
+ }
4013
+ });
4014
+ }
4015
+ return table;
4016
+ }
4009
4017
  function defineBound(proto, key, fn) {
4010
4018
  Object.defineProperty(proto, key, {
4011
4019
  configurable: true,
@@ -4087,7 +4095,7 @@ function constantCatch(value) {
4087
4095
  return fn;
4088
4096
  }
4089
4097
 
4090
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/core.js
4098
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/core.js
4091
4099
  var _a;
4092
4100
  var _zodDesc = { value: undefined, enumerable: false };
4093
4101
  var _E = "captureStackTrace" in Error ? Error : null;
@@ -4206,7 +4214,7 @@ function config(newConfig) {
4206
4214
  Object.assign(globalConfig, newConfig);
4207
4215
  return globalConfig;
4208
4216
  }
4209
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/errors.js
4217
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/errors.js
4210
4218
  function _getMessage() {
4211
4219
  const internals = this._zod;
4212
4220
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -4221,16 +4229,12 @@ var _messageDesc = {
4221
4229
  enumerable: true,
4222
4230
  configurable: true
4223
4231
  };
4224
- var _zodDesc2 = { value: undefined, enumerable: false };
4225
4232
  var _issuesDesc = { value: undefined, enumerable: false };
4226
4233
  var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4227
4234
  var initializer = (inst, def) => {
4228
4235
  inst.name = "$ZodError";
4229
- _zodDesc2.value = inst._zod;
4230
- Object.defineProperty(inst, "_zod", _zodDesc2);
4231
4236
  _issuesDesc.value = def;
4232
4237
  Object.defineProperty(inst, "issues", _issuesDesc);
4233
- _zodDesc2.value = undefined;
4234
4238
  _issuesDesc.value = undefined;
4235
4239
  Object.defineProperty(inst, "message", _messageDesc);
4236
4240
  const proto = Object.getPrototypeOf(inst);
@@ -4325,7 +4329,7 @@ function formatError(error, mapper = (issue) => issue.message) {
4325
4329
  return fieldErrors;
4326
4330
  }
4327
4331
 
4328
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/parse.js
4332
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/parse.js
4329
4333
  function finalizeParams(callee, params) {
4330
4334
  return { callee: params?.callee ?? callee, Err: params?.Err };
4331
4335
  }
@@ -4366,23 +4370,68 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
4366
4370
  if (result instanceof Promise) {
4367
4371
  throw new $ZodAsyncError;
4368
4372
  }
4369
- return result.issues.length ? {
4370
- success: false,
4371
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4372
- } : { success: true, data: result.value };
4373
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
4373
4374
  };
4374
- var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
4375
+ function failure(Err, issues, ctx) {
4376
+ let error;
4377
+ return {
4378
+ success: false,
4379
+ get error() {
4380
+ if (!error) {
4381
+ error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
4382
+ issues = undefined;
4383
+ ctx = undefined;
4384
+ }
4385
+ return error;
4386
+ },
4387
+ set error(e) {
4388
+ error = e;
4389
+ issues = undefined;
4390
+ ctx = undefined;
4391
+ }
4392
+ };
4393
+ }
4375
4394
  var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
4376
4395
  const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
4377
4396
  let result = schema._zod.run({ value, issues: [] }, ctx);
4378
4397
  if (result instanceof Promise)
4379
4398
  result = await result;
4380
- return result.issues.length ? {
4381
- success: false,
4382
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4383
- } : { success: true, data: result.value };
4399
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
4400
+ };
4401
+ var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
4402
+ var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
4403
+ var validate = (schema, value, _ctx) => {
4404
+ const validator = schema._zod.bag.validator;
4405
+ if (validator !== undefined) {
4406
+ if (validator(value) !== COMPILE_INVALID)
4407
+ return true;
4408
+ if (validator.definite === true && _ctx === undefined)
4409
+ return false;
4410
+ }
4411
+ return validateFallback(schema, value, _ctx);
4412
+ };
4413
+ function validateFallback(schema, value, _ctx) {
4414
+ const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
4415
+ const fallbackRun = schema._zod.bag.fallbackRun;
4416
+ let result;
4417
+ if (fallbackRun) {
4418
+ ctx[COMPILE_FALLBACK] = true;
4419
+ result = fallbackRun({ value, issues: [] }, ctx);
4420
+ } else {
4421
+ result = schema._zod.run({ value, issues: [] }, ctx);
4422
+ }
4423
+ if (result instanceof Promise) {
4424
+ throw new $ZodAsyncError;
4425
+ }
4426
+ return result.issues.length === 0;
4427
+ }
4428
+ var validateAsync = async (schema, value, _ctx) => {
4429
+ const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
4430
+ let result = schema._zod.run({ value, issues: [] }, ctx);
4431
+ if (result instanceof Promise)
4432
+ result = await result;
4433
+ return result.issues.length === 0;
4384
4434
  };
4385
- var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
4386
4435
  var _encode = (_Err) => {
4387
4436
  const parse = _parse(_Err);
4388
4437
  const fn = (schema, value, _ctx, _params) => {
@@ -4427,7 +4476,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
4427
4476
  var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
4428
4477
  return _safeParseAsync(_Err)(schema, value, _ctx);
4429
4478
  };
4430
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/regexes.js
4479
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/regexes.js
4431
4480
  var cuid = /^[cC][0-9a-z]{6,}$/;
4432
4481
  var cuid2 = /^[0-9a-z]+$/;
4433
4482
  var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
@@ -4444,8 +4493,8 @@ var uuid = (version) => {
4444
4493
  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)$/;
4445
4494
  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})$`);
4446
4495
  };
4447
- var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
4448
- var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
4496
+ var email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
4497
+ var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
4449
4498
  function emoji() {
4450
4499
  return new RegExp(_emoji, "u");
4451
4500
  }
@@ -4454,7 +4503,7 @@ var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|(
4454
4503
  var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
4455
4504
  var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
4456
4505
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
4457
- var base64url = /^[A-Za-z0-9_-]*$/;
4506
+ var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
4458
4507
  var httpProtocol = /^https?$/;
4459
4508
  var e164 = /^\+[1-9]\d{6,14}$/;
4460
4509
  var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
@@ -4478,17 +4527,14 @@ function datetime(args) {
4478
4527
  const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
4479
4528
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
4480
4529
  }
4481
- var string = (params) => {
4482
- const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
4483
- return new RegExp(`^${regex}$`);
4484
- };
4530
+ var anyString = /^[\s\S]{0,}$/;
4485
4531
  var integer = /^-?\d+$/;
4486
4532
  var number = /^-?\d+(?:\.\d+)?$/;
4487
4533
  var boolean = /^(?:true|false)$/i;
4488
4534
  var lowercase = /^[^A-Z]*$/;
4489
4535
  var uppercase = /^[^a-z]*$/;
4490
4536
 
4491
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/checks.js
4537
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/checks.js
4492
4538
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
4493
4539
  var _a;
4494
4540
  inst._zod ?? (inst._zod = {});
@@ -4507,16 +4553,6 @@ var numericOriginMap = {
4507
4553
  var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
4508
4554
  $ZodCheck.init(inst, def);
4509
4555
  const origin = numericOriginMap[typeof def.value];
4510
- inst._zod.onattach.push((inst) => {
4511
- const bag = inst._zod.bag;
4512
- const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
4513
- if (def.value < curr) {
4514
- if (def.inclusive)
4515
- bag.maximum = def.value;
4516
- else
4517
- bag.exclusiveMaximum = def.value;
4518
- }
4519
- });
4520
4556
  inst._zod.check = (payload) => {
4521
4557
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
4522
4558
  return;
@@ -4535,16 +4571,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
4535
4571
  var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
4536
4572
  $ZodCheck.init(inst, def);
4537
4573
  const origin = numericOriginMap[typeof def.value];
4538
- inst._zod.onattach.push((inst) => {
4539
- const bag = inst._zod.bag;
4540
- const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
4541
- if (def.value > curr) {
4542
- if (def.inclusive)
4543
- bag.minimum = def.value;
4544
- else
4545
- bag.exclusiveMinimum = def.value;
4546
- }
4547
- });
4548
4574
  inst._zod.check = (payload) => {
4549
4575
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
4550
4576
  return;
@@ -4562,10 +4588,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
4562
4588
  });
4563
4589
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
4564
4590
  $ZodCheck.init(inst, def);
4565
- inst._zod.onattach.push((inst) => {
4566
- var _a;
4567
- (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
4568
- });
4569
4591
  inst._zod.check = (payload) => {
4570
4592
  if (typeof payload.value !== typeof def.value)
4571
4593
  throw new Error("Cannot mix number and bigint in multiple_of check.");
@@ -4588,14 +4610,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
4588
4610
  const isInt = def.format?.includes("int");
4589
4611
  const origin = isInt ? "int" : "number";
4590
4612
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
4591
- inst._zod.onattach.push((inst) => {
4592
- const bag = inst._zod.bag;
4593
- bag.format = def.format;
4594
- bag.minimum = minimum;
4595
- bag.maximum = maximum;
4596
- if (isInt)
4597
- bag.pattern = integer;
4598
- });
4599
4613
  inst._zod.check = (payload) => {
4600
4614
  const input = payload.value;
4601
4615
  if (isInt) {
@@ -4665,11 +4679,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
4665
4679
  var _a;
4666
4680
  $ZodCheck.init(inst, def);
4667
4681
  (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
4668
- inst._zod.onattach.push((inst) => {
4669
- const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
4670
- if (def.maximum < curr)
4671
- inst._zod.bag.maximum = def.maximum;
4672
- });
4673
4682
  inst._zod.check = (payload) => {
4674
4683
  const input = payload.value;
4675
4684
  const units = input.length;
@@ -4692,11 +4701,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
4692
4701
  var _a;
4693
4702
  $ZodCheck.init(inst, def);
4694
4703
  (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
4695
- inst._zod.onattach.push((inst) => {
4696
- const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
4697
- if (def.minimum > curr)
4698
- inst._zod.bag.minimum = def.minimum;
4699
- });
4700
4704
  inst._zod.check = (payload) => {
4701
4705
  const input = payload.value;
4702
4706
  const units = input.length;
@@ -4719,12 +4723,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
4719
4723
  var _a;
4720
4724
  $ZodCheck.init(inst, def);
4721
4725
  (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
4722
- inst._zod.onattach.push((inst) => {
4723
- const bag = inst._zod.bag;
4724
- bag.minimum = def.length;
4725
- bag.maximum = def.length;
4726
- bag.length = def.length;
4727
- });
4728
4726
  inst._zod.check = (payload) => {
4729
4727
  const input = payload.value;
4730
4728
  const units = input.length;
@@ -4747,14 +4745,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
4747
4745
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
4748
4746
  var _a, _b;
4749
4747
  $ZodCheck.init(inst, def);
4750
- inst._zod.onattach.push((inst) => {
4751
- const bag = inst._zod.bag;
4752
- bag.format = def.format;
4753
- if (def.pattern) {
4754
- bag.patterns ?? (bag.patterns = new Set);
4755
- bag.patterns.add(def.pattern);
4756
- }
4757
- });
4758
4748
  if (def.pattern)
4759
4749
  (_a = inst._zod).check ?? (_a.check = (payload) => {
4760
4750
  def.pattern.lastIndex = 0;
@@ -4803,11 +4793,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
4803
4793
  const escapedRegex = escapeRegex(def.includes);
4804
4794
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
4805
4795
  def.pattern = pattern;
4806
- inst._zod.onattach.push((inst) => {
4807
- const bag = inst._zod.bag;
4808
- bag.patterns ?? (bag.patterns = new Set);
4809
- bag.patterns.add(pattern);
4810
- });
4811
4796
  inst._zod.check = (payload) => {
4812
4797
  if (payload.value.includes(def.includes, def.position))
4813
4798
  return;
@@ -4826,11 +4811,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
4826
4811
  $ZodCheck.init(inst, def);
4827
4812
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
4828
4813
  def.pattern ?? (def.pattern = pattern);
4829
- inst._zod.onattach.push((inst) => {
4830
- const bag = inst._zod.bag;
4831
- bag.patterns ?? (bag.patterns = new Set);
4832
- bag.patterns.add(pattern);
4833
- });
4834
4814
  inst._zod.check = (payload) => {
4835
4815
  if (payload.value.startsWith(def.prefix))
4836
4816
  return;
@@ -4849,11 +4829,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
4849
4829
  $ZodCheck.init(inst, def);
4850
4830
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
4851
4831
  def.pattern ?? (def.pattern = pattern);
4852
- inst._zod.onattach.push((inst) => {
4853
- const bag = inst._zod.bag;
4854
- bag.patterns ?? (bag.patterns = new Set);
4855
- bag.patterns.add(pattern);
4856
- });
4857
4832
  inst._zod.check = (payload) => {
4858
4833
  if (payload.value.endsWith(def.suffix))
4859
4834
  return;
@@ -4875,7 +4850,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
4875
4850
  };
4876
4851
  });
4877
4852
 
4878
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/doc.js
4853
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/doc.js
4879
4854
  class Doc {
4880
4855
  constructor(args = [], closed = {}) {
4881
4856
  this.content = [];
@@ -4885,8 +4860,11 @@ class Doc {
4885
4860
  }
4886
4861
  indented(fn) {
4887
4862
  this.indent += 1;
4888
- fn(this);
4889
- this.indent -= 1;
4863
+ try {
4864
+ fn(this);
4865
+ } finally {
4866
+ this.indent -= 1;
4867
+ }
4890
4868
  }
4891
4869
  write(arg) {
4892
4870
  if (typeof arg === "function") {
@@ -4914,14 +4892,14 @@ ${content.join(`
4914
4892
  }
4915
4893
  }
4916
4894
 
4917
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/versions.js
4895
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/versions.js
4918
4896
  var version = {
4919
4897
  major: 4,
4920
- minor: 5,
4921
- patch: 4
4898
+ minor: 6,
4899
+ patch: 1
4922
4900
  };
4923
4901
 
4924
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/schemas.js
4902
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/schemas.js
4925
4903
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
4926
4904
  var _a;
4927
4905
  inst ?? (inst = {});
@@ -5030,15 +5008,21 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
5030
5008
  own(this, "~standard", value);
5031
5009
  }
5032
5010
  });
5033
- var toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
5011
+ var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
5012
+ async function validateAsync2(inst, value) {
5013
+ const ctx = { async: true };
5014
+ return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
5015
+ }
5034
5016
  function standardProps(inst) {
5035
5017
  return {
5036
5018
  validate: (value) => {
5019
+ const ctx = { async: false };
5037
5020
  try {
5038
- return toStandardResult(safeParse(inst, value));
5039
- } catch (_) {
5040
- return safeParseAsync(inst, value).then(toStandardResult);
5041
- }
5021
+ const r = inst._zod.run({ value, issues: [] }, ctx);
5022
+ if (!(r instanceof Promise))
5023
+ return toStandardResult(r, ctx);
5024
+ } catch (_) {}
5025
+ return validateAsync2(inst, value);
5042
5026
  },
5043
5027
  vendor: "zod",
5044
5028
  version: 1
@@ -5046,7 +5030,7 @@ function standardProps(inst) {
5046
5030
  }
5047
5031
  var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
5048
5032
  $ZodType.init(inst, def);
5049
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
5033
+ inst._zod.pattern = def.pattern ?? anyString;
5050
5034
  inst._zod.parse = (payload, _) => {
5051
5035
  if (def.coerce)
5052
5036
  try {
@@ -5214,12 +5198,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
5214
5198
  var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
5215
5199
  def.pattern ?? (def.pattern = datetime(def));
5216
5200
  $ZodStringFormat.init(inst, def);
5217
- if (def.local || def.precision === -1) {
5218
- inst._zod.bag.laxFormat = true;
5219
- inst._zod.onattach.push((s) => {
5220
- s._zod.bag.laxFormat = true;
5221
- });
5222
- }
5223
5201
  });
5224
5202
  var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
5225
5203
  def.pattern ?? (def.pattern = date);
@@ -5236,7 +5214,6 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
5236
5214
  var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
5237
5215
  def.pattern ?? (def.pattern = ipv4);
5238
5216
  $ZodStringFormat.init(inst, def);
5239
- inst._zod.bag.format = `ipv4`;
5240
5217
  });
5241
5218
  var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
5242
5219
  function isValidIPv6(value) {
@@ -5252,7 +5229,6 @@ function isValidIPv6(value) {
5252
5229
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
5253
5230
  def.pattern ?? (def.pattern = ipv6);
5254
5231
  $ZodStringFormat.init(inst, def);
5255
- inst._zod.bag.format = `ipv6`;
5256
5232
  inst._zod.check = (payload) => {
5257
5233
  if (!isValidIPv6(payload.value)) {
5258
5234
  payload.issues.push({
@@ -5312,10 +5288,10 @@ function isValidBase64(data) {
5312
5288
  return false;
5313
5289
  }
5314
5290
  }
5291
+ var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
5315
5292
  var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
5316
- def.pattern ?? (def.pattern = base64);
5293
+ def.pattern ?? (def.pattern = base64Charset);
5317
5294
  $ZodStringFormat.init(inst, def);
5318
- inst._zod.bag.contentEncoding = "base64";
5319
5295
  inst._zod.check = (payload) => {
5320
5296
  if (isValidBase64(payload.value))
5321
5297
  return;
@@ -5328,17 +5304,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
5328
5304
  });
5329
5305
  };
5330
5306
  });
5307
+ var base64urlCharset = /^[A-Za-z0-9_-]*$/;
5331
5308
  function isValidBase64URL(data) {
5332
- if (!base64url.test(data))
5309
+ if (!base64urlCharset.test(data))
5333
5310
  return false;
5334
5311
  const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
5335
5312
  const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
5336
5313
  return isValidBase64(padded);
5337
5314
  }
5338
5315
  var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
5339
- def.pattern ?? (def.pattern = base64url);
5316
+ def.pattern ?? (def.pattern = base64urlCharset);
5340
5317
  $ZodStringFormat.init(inst, def);
5341
- inst._zod.bag.contentEncoding = "base64url";
5342
5318
  inst._zod.check = (payload) => {
5343
5319
  if (isValidBase64URL(payload.value))
5344
5320
  return;
@@ -5391,7 +5367,7 @@ var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
5391
5367
  });
5392
5368
  var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
5393
5369
  $ZodType.init(inst, def);
5394
- inst._zod.pattern = inst._zod.bag.pattern ?? number;
5370
+ inst._zod.pattern = number;
5395
5371
  inst._zod.parse = (payload, _ctx) => {
5396
5372
  if (def.coerce)
5397
5373
  try {
@@ -5475,6 +5451,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
5475
5451
  }
5476
5452
  payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
5477
5453
  const proms = [];
5454
+ const abortEarly = ctx?.abortEarly;
5478
5455
  for (let i = 0;i < input.length; i++) {
5479
5456
  const item = input[i];
5480
5457
  const result = def.element._zod.run({
@@ -5485,6 +5462,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
5485
5462
  proms.push(result.then((result) => handleArrayResult(result, payload, i)));
5486
5463
  } else {
5487
5464
  handleArrayResult(result, payload, i);
5465
+ if (abortEarly && result.issues.length !== 0 && aborted(result))
5466
+ break;
5488
5467
  }
5489
5468
  }
5490
5469
  if (proms.length) {
@@ -5545,14 +5524,20 @@ function normalizeDef(def) {
5545
5524
  optionalKeys: new Set(okeys)
5546
5525
  };
5547
5526
  }
5548
- function handleCatchall(proms, input, payload, ctx, def, inst) {
5527
+ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
5549
5528
  const unrecognized = [];
5550
5529
  const keySet = def.keySet;
5551
5530
  const _catchall = def.catchall._zod;
5552
5531
  const t = _catchall.def.type;
5553
5532
  const optin = _catchall.optin;
5554
5533
  const optout = _catchall.optout;
5534
+ let seen = 0;
5555
5535
  for (const key in input) {
5536
+ if (abortEarly && payload.issues.length !== seen) {
5537
+ if (aborted(payload, seen))
5538
+ break;
5539
+ seen = payload.issues.length;
5540
+ }
5556
5541
  if (keySet.has(key))
5557
5542
  continue;
5558
5543
  if (key === "__proto__") {
@@ -5586,23 +5571,19 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
5586
5571
  return payload;
5587
5572
  });
5588
5573
  }
5589
- var propShapes = new WeakMap;
5590
5574
  var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
5591
5575
  $ZodType.init(inst, def);
5592
5576
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
5593
- if (!desc?.get) {
5594
- const sh = def.shape;
5595
- propShapes.set(def, sh);
5596
- Object.defineProperty(def, "shape", {
5597
- get: () => {
5598
- const newSh = { ...sh };
5599
- Object.defineProperty(def, "shape", {
5600
- value: newSh
5601
- });
5602
- propShapes.set(def, newSh);
5603
- return newSh;
5604
- }
5605
- });
5577
+ const sh = desc?.get ? desc.get.raw : def.shape ?? {};
5578
+ if (sh) {
5579
+ const get = () => {
5580
+ const newSh = { ...sh };
5581
+ Object.defineProperty(def, "shape", { value: newSh });
5582
+ get.raw = newSh;
5583
+ return newSh;
5584
+ };
5585
+ get.raw = sh;
5586
+ Object.defineProperty(def, "shape", { get });
5606
5587
  }
5607
5588
  const _normalized = cached(() => normalizeDef(def));
5608
5589
  defineLazyInternal(inst, "propValues", (zod) => {
@@ -5642,7 +5623,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
5642
5623
  payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
5643
5624
  const proms = [];
5644
5625
  const shape = value.shape;
5626
+ const abortEarly = ctx?.abortEarly;
5627
+ let seen = payload.issues.length;
5645
5628
  for (const key of value.allKeys) {
5629
+ if (abortEarly && payload.issues.length !== seen) {
5630
+ if (aborted(payload, seen))
5631
+ break;
5632
+ seen = payload.issues.length;
5633
+ }
5646
5634
  if (key === "__proto__")
5647
5635
  continue;
5648
5636
  const el = shape[key];
@@ -5658,7 +5646,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
5658
5646
  if (!catchall) {
5659
5647
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
5660
5648
  }
5661
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
5649
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
5662
5650
  };
5663
5651
  });
5664
5652
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -5672,10 +5660,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
5672
5660
  const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
5673
5661
  const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
5674
5662
  const prefixStr = (id, k) => `
5663
+ let ${id}_ab = false;
5675
5664
  for (let i = 0; i < ${id}.issues.length; i++) {
5676
5665
  const iss = ${id}.issues[i];
5677
5666
  iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
5678
5667
  payload.issues.push(iss);
5668
+ if (iss.continue !== true) ${id}_ab = true;
5669
+ }
5670
+ if (${id}_ab && ctx && ctx.abortEarly) {
5671
+ payload.value = newResult;
5672
+ return payload;
5679
5673
  }`;
5680
5674
  doc.write(`const input = payload.value;`);
5681
5675
  const ids = Object.create(null);
@@ -5721,6 +5715,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
5721
5715
  input: undefined,
5722
5716
  path: [${k}]
5723
5717
  });
5718
+ if (ctx && ctx.abortEarly) {
5719
+ payload.value = newResult;
5720
+ return payload;
5721
+ }
5724
5722
  }
5725
5723
 
5726
5724
  if (${id}_present) {
@@ -5773,7 +5771,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
5773
5771
  payload = fastpass(payload, ctx);
5774
5772
  if (!catchall)
5775
5773
  return payload;
5776
- return handleCatchall([], input, payload, ctx, value, inst);
5774
+ return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
5777
5775
  }
5778
5776
  return superParse(payload, ctx);
5779
5777
  };
@@ -6117,8 +6115,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
6117
6115
  const values = getEnumValues(def.entries);
6118
6116
  const valuesSet = new Set(values);
6119
6117
  inst._zod.values = valuesSet;
6120
- const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
6121
- inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
6118
+ defineLazyInternal(inst, "pattern", (zod) => {
6119
+ const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
6120
+ return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
6121
+ });
6122
6122
  inst._zod.parse = (payload, _ctx) => {
6123
6123
  const input = payload.value;
6124
6124
  if (valuesSet.has(input)) {
@@ -6137,7 +6137,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
6137
6137
  $ZodType.init(inst, def);
6138
6138
  const values = new Set(def.values);
6139
6139
  inst._zod.values = values;
6140
- 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]$");
6140
+ defineLazyInternal(inst, "pattern", (zod) => {
6141
+ const vals = zod.def.values;
6142
+ return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
6143
+ });
6141
6144
  inst._zod.parse = (payload, _ctx) => {
6142
6145
  const input = payload.value;
6143
6146
  if (values.has(input)) {
@@ -6405,7 +6408,62 @@ function handleRefineResult(result, payload, input, inst) {
6405
6408
  payload.issues.push(issue(_iss));
6406
6409
  }
6407
6410
  }
6408
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/memoizer.js
6411
+ function handlePropertiesResult(result, payload, key) {
6412
+ if (result.issues.length) {
6413
+ payload.issues.push(...prefixIssues(key, result.issues));
6414
+ }
6415
+ }
6416
+ var $ZodProperties = /* @__PURE__ */ $constructor("$ZodProperties", (inst, def) => {
6417
+ $ZodType.init(inst, def);
6418
+ $ZodCheck.init(inst, def);
6419
+ const memo = globalConfig.memoizer;
6420
+ memo?.attach(inst);
6421
+ let entries;
6422
+ const runShape = (payload, ctx) => {
6423
+ entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
6424
+ const input = payload.value;
6425
+ let proms;
6426
+ for (const [key, schema] of entries) {
6427
+ const result = schema._zod.run({ value: input[key], issues: [] }, ctx);
6428
+ if (result instanceof Promise) {
6429
+ proms ?? (proms = []);
6430
+ proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
6431
+ } else {
6432
+ handlePropertiesResult(result, payload, key);
6433
+ }
6434
+ }
6435
+ if (proms)
6436
+ return Promise.all(proms).then(() => {
6437
+ return;
6438
+ });
6439
+ return;
6440
+ };
6441
+ inst._zod.parse = (payload, ctx) => {
6442
+ const input = payload.value;
6443
+ if (input === null || typeof input !== "object" && typeof input !== "function") {
6444
+ payload.issues.push({ expected: "object", code: "invalid_type", input, inst });
6445
+ return payload;
6446
+ }
6447
+ if (ctx.direction === "backward")
6448
+ ctx = { ...ctx, direction: "forward" };
6449
+ if (memo)
6450
+ memo.alloc(inst, payload, input, ctx);
6451
+ const result = runShape(payload, ctx);
6452
+ return result instanceof Promise ? result.then(() => payload) : payload;
6453
+ };
6454
+ inst._zod.check = (payload) => {
6455
+ if (payload.value == null) {
6456
+ payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
6457
+ return;
6458
+ }
6459
+ return runShape(payload, {});
6460
+ };
6461
+ }, {
6462
+ *[Symbol.iterator]() {
6463
+ yield this;
6464
+ }
6465
+ });
6466
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/memoizer.js
6409
6467
  class $ZodCyclicError extends Error {
6410
6468
  constructor() {
6411
6469
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -6414,31 +6472,59 @@ class $ZodCyclicError extends Error {
6414
6472
  }
6415
6473
  var STATE = "~memo";
6416
6474
  var NO_ISSUES = [];
6475
+ function isRef(value) {
6476
+ return value !== null && (typeof value === "object" || typeof value === "function");
6477
+ }
6417
6478
  function cloneIssues(issues) {
6418
6479
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
6419
6480
  }
6420
6481
  var recursive = /* @__PURE__ */ new WeakMap;
6421
- function isRecursive(inst, stack) {
6482
+ var NONE = 0;
6483
+ var ASSUMED = 1;
6484
+ var PROVEN = 2;
6485
+ function isRecursive(inst, stack, resolve) {
6422
6486
  const cached = recursive.get(inst);
6423
6487
  if (cached !== undefined)
6424
- return cached;
6488
+ return cached ? PROVEN : NONE;
6425
6489
  if (stack.has(inst))
6426
- return true;
6490
+ return PROVEN;
6427
6491
  stack.add(inst);
6428
- let result = false;
6492
+ let result = NONE;
6429
6493
  const check = (child) => {
6430
- if (!result && child?._zod && isRecursive(child, stack))
6431
- result = true;
6494
+ if (result !== PROVEN && child?._zod) {
6495
+ const answer = isRecursive(child, stack, resolve);
6496
+ if (answer > result)
6497
+ result = answer;
6498
+ }
6499
+ };
6500
+ const shape = (sh, spread) => {
6501
+ let answer = NONE;
6502
+ for (const key of Reflect.ownKeys(sh)) {
6503
+ const desc = Object.getOwnPropertyDescriptor(sh, key);
6504
+ if (spread && !desc.enumerable)
6505
+ continue;
6506
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
6507
+ if (child > answer)
6508
+ answer = child;
6509
+ }
6510
+ return answer;
6511
+ };
6512
+ const merge = (answer) => {
6513
+ if (answer > result)
6514
+ result = answer;
6432
6515
  };
6433
6516
  const def = inst._zod.def;
6434
6517
  const kind = def.type;
6435
6518
  switch (kind) {
6436
6519
  case "object": {
6437
- for (const key of Reflect.ownKeys(def.shape))
6438
- check(def.shape[key]);
6520
+ const raw = rawShape(def);
6521
+ merge(raw ? shape(raw, true) : ASSUMED);
6439
6522
  check(def.catchall);
6440
6523
  break;
6441
6524
  }
6525
+ case "properties":
6526
+ merge(shape(def.shape, false));
6527
+ break;
6442
6528
  case "array":
6443
6529
  check(def.element);
6444
6530
  break;
@@ -6482,9 +6568,11 @@ function isRecursive(inst, stack) {
6482
6568
  check(def.input);
6483
6569
  check(def.output);
6484
6570
  break;
6485
- case "lazy":
6486
- check(inst._zod.innerType);
6571
+ case "lazy": {
6572
+ const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
6573
+ merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
6487
6574
  break;
6575
+ }
6488
6576
  case "template_literal":
6489
6577
  case "string":
6490
6578
  case "number":
@@ -6523,13 +6611,17 @@ function isRecursive(inst, stack) {
6523
6611
  }
6524
6612
  }
6525
6613
  stack.delete(inst);
6526
- recursive.set(inst, result);
6527
- return result;
6614
+ return settle(inst, result);
6615
+ }
6616
+ function settle(inst, answer) {
6617
+ if (answer !== ASSUMED)
6618
+ recursive.set(inst, answer === PROVEN);
6619
+ return answer;
6528
6620
  }
6529
6621
  function bucketFor(state, inst) {
6530
6622
  let bucket = state.buckets.get(inst);
6531
6623
  if (!bucket) {
6532
- bucket = new Map;
6624
+ bucket = new WeakMap;
6533
6625
  state.buckets.set(inst, bucket);
6534
6626
  }
6535
6627
  return bucket;
@@ -6565,6 +6657,7 @@ var memo = {
6565
6657
  attach(inst) {
6566
6658
  var _a;
6567
6659
  let isRecursiveInst;
6660
+ let rechecked = false;
6568
6661
  let lastCtx;
6569
6662
  let lastBucket;
6570
6663
  (_a = inst._zod).deferred ?? (_a.deferred = []);
@@ -6572,20 +6665,24 @@ var memo = {
6572
6665
  const base = inst._zod.parse;
6573
6666
  const wrapped = (payload, ctx) => {
6574
6667
  if (isRecursiveInst === undefined) {
6575
- isRecursiveInst = isRecursive(inst, new Set);
6576
- if (!isRecursiveInst) {
6668
+ const walked = isRecursive(inst, new Set, false);
6669
+ if (walked === NONE) {
6577
6670
  inst._zod.parse = base;
6578
6671
  if (inst._zod.run === wrapped)
6579
6672
  inst._zod.run = base;
6580
6673
  return base(payload, ctx);
6581
6674
  }
6675
+ if (walked === PROVEN || rechecked)
6676
+ isRecursiveInst = true;
6677
+ else
6678
+ rechecked = true;
6582
6679
  }
6583
6680
  const input = payload.value;
6584
- if (input === null || typeof input !== "object")
6681
+ if (!isRef(input))
6585
6682
  return base(payload, ctx);
6586
6683
  let state = ctx[STATE];
6587
6684
  if (!state) {
6588
- state = { buckets: new Map, backEdges: undefined };
6685
+ state = { buckets: new WeakMap, backEdges: undefined };
6589
6686
  ctx[STATE] = state;
6590
6687
  }
6591
6688
  let bucket;
@@ -6604,7 +6701,7 @@ var memo = {
6604
6701
  payload.issues.push(...cloneIssues(hit.issues));
6605
6702
  } else {
6606
6703
  payload.memo = true;
6607
- state.backEdges ?? (state.backEdges = new Set);
6704
+ state.backEdges ?? (state.backEdges = new WeakSet);
6608
6705
  state.backEdges.add(hit.value);
6609
6706
  }
6610
6707
  return payload;
@@ -6636,9 +6733,9 @@ function memoizer() {
6636
6733
  }
6637
6734
  function isBackEdge(ctx, value) {
6638
6735
  const backEdges = ctx[STATE]?.backEdges;
6639
- return backEdges !== undefined && value !== null && typeof value === "object" && backEdges.has(value);
6736
+ return backEdges !== undefined && isRef(value) && backEdges.has(value);
6640
6737
  }
6641
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/locales/en.js
6738
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/locales/en.js
6642
6739
  var error = () => {
6643
6740
  const Sizable = {
6644
6741
  string: { unit: "characters", verb: "to have" },
@@ -6679,6 +6776,7 @@ var error = () => {
6679
6776
  json_string: "JSON string",
6680
6777
  e164: "E.164 number",
6681
6778
  credit_card: "credit card number",
6779
+ iban: "IBAN",
6682
6780
  jwt: "JWT",
6683
6781
  template_literal: "input"
6684
6782
  };
@@ -6758,7 +6856,7 @@ function en_default() {
6758
6856
  localeError: error()
6759
6857
  };
6760
6858
  }
6761
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/registries.js
6859
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/registries.js
6762
6860
  var _a2;
6763
6861
  class $ZodRegistry {
6764
6862
  constructor() {
@@ -6805,7 +6903,7 @@ function registry() {
6805
6903
  }
6806
6904
  (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
6807
6905
  var globalRegistry = globalThis.__zod_globalRegistry;
6808
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/api.js
6906
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/api.js
6809
6907
  function _string(Class, params) {
6810
6908
  return new Class({
6811
6909
  type: "string",
@@ -7255,7 +7353,7 @@ function _check(fn, params) {
7255
7353
  ch._zod.check = fn;
7256
7354
  return ch;
7257
7355
  }
7258
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js
7356
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/to-json-schema.js
7259
7357
  function assignProps(target, ...sources) {
7260
7358
  for (const source of sources) {
7261
7359
  for (const key of Reflect.ownKeys(source)) {
@@ -7299,7 +7397,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
7299
7397
  Object.assign(json, result);
7300
7398
  return true;
7301
7399
  }
7302
- function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
7400
+ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
7303
7401
  var _a;
7304
7402
  const def = schema._zod.def;
7305
7403
  const seen = ctx.seen.get(schema);
@@ -7338,7 +7436,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
7338
7436
  if (parent) {
7339
7437
  if (!result.ref)
7340
7438
  result.ref = parent;
7341
- process2(parent, ctx, params);
7439
+ processSchema(parent, ctx, params);
7342
7440
  ctx.seen.get(parent).isParent = true;
7343
7441
  }
7344
7442
  }
@@ -7443,7 +7541,6 @@ function extractDefs(ctx, schema) {
7443
7541
  if (seen.count > 1) {
7444
7542
  if (ctx.reused === "ref") {
7445
7543
  extractToDef(entry);
7446
- continue;
7447
7544
  }
7448
7545
  }
7449
7546
  }
@@ -7768,18 +7865,106 @@ function isTransforming(_schema, _ctx) {
7768
7865
  }
7769
7866
  var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
7770
7867
  const ctx = initializeContext({ ...params, processors });
7771
- process2(schema, ctx);
7868
+ processSchema(schema, ctx);
7772
7869
  extractDefs(ctx, schema);
7773
7870
  return finalize(ctx, schema);
7774
7871
  };
7775
7872
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
7776
7873
  const { libraryOptions, target } = params ?? {};
7777
7874
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
7778
- process2(schema, ctx);
7875
+ processSchema(schema, ctx);
7779
7876
  extractDefs(ctx, schema);
7780
7877
  return finalize(ctx, schema);
7781
7878
  };
7782
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.js
7879
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/json-schema-processors.js
7880
+ var narrowMin = (agg, key, value) => {
7881
+ if (agg[key] === undefined || value > agg[key])
7882
+ agg[key] = value;
7883
+ };
7884
+ var narrowMax = (agg, key, value) => {
7885
+ if (agg[key] === undefined || value < agg[key])
7886
+ agg[key] = value;
7887
+ };
7888
+ var narrowBoth = (agg, value) => {
7889
+ narrowMin(agg, "minimum", value);
7890
+ narrowMax(agg, "maximum", value);
7891
+ };
7892
+ var addDivisor = (agg, value) => {
7893
+ agg.multipleOf ?? (agg.multipleOf = []);
7894
+ if (!agg.multipleOf.includes(value))
7895
+ agg.multipleOf.push(value);
7896
+ };
7897
+ var addPattern = (agg, pattern) => {
7898
+ agg.patterns ?? (agg.patterns = new Set);
7899
+ agg.patterns.add(pattern);
7900
+ };
7901
+ var intersectMime = (agg, mime) => {
7902
+ agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
7903
+ };
7904
+ var setFormat = (agg, format) => {
7905
+ agg.format = format;
7906
+ if (format.includes("int"))
7907
+ agg.isInt = true;
7908
+ };
7909
+ var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
7910
+ var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
7911
+ var formatContributor = (ranges) => (agg, def) => {
7912
+ setFormat(agg, def.format);
7913
+ const [minimum, maximum] = ranges[def.format];
7914
+ narrowMin(agg, "minimum", minimum);
7915
+ narrowMax(agg, "maximum", maximum);
7916
+ };
7917
+ var contributors = {
7918
+ greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
7919
+ less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
7920
+ multiple_of: (agg, def) => addDivisor(agg, def.value),
7921
+ number_format: formatContributor(NUMBER_FORMAT_RANGES),
7922
+ bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
7923
+ min_length: minContributor,
7924
+ max_length: maxContributor,
7925
+ length_equals: (agg, def) => narrowBoth(agg, def.length),
7926
+ min_size: minContributor,
7927
+ max_size: maxContributor,
7928
+ size_equals: (agg, def) => narrowBoth(agg, def.size),
7929
+ string_format: (agg, def) => {
7930
+ setFormat(agg, def.format);
7931
+ if (def.pattern)
7932
+ addPattern(agg, def.pattern);
7933
+ if (def.format === "base64" || def.format === "base64url")
7934
+ agg.contentEncoding = def.format;
7935
+ if (def.local || def.precision === -1)
7936
+ agg.laxFormat = true;
7937
+ },
7938
+ mime_type: (agg, def) => intersectMime(agg, def.mime)
7939
+ };
7940
+ function aggregateChecks(schema) {
7941
+ const agg = {};
7942
+ const def = schema._zod.def;
7943
+ const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
7944
+ for (const ch of list)
7945
+ contributors[ch._zod.def.check]?.(agg, ch._zod.def);
7946
+ const bag = schema._zod.bag;
7947
+ if (bag.minimum !== undefined)
7948
+ narrowMin(agg, "minimum", bag.minimum);
7949
+ if (bag.exclusiveMinimum !== undefined)
7950
+ narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
7951
+ if (bag.maximum !== undefined)
7952
+ narrowMax(agg, "maximum", bag.maximum);
7953
+ if (bag.exclusiveMaximum !== undefined)
7954
+ narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
7955
+ if (bag.multipleOf !== undefined)
7956
+ addDivisor(agg, bag.multipleOf);
7957
+ if (bag.format !== undefined) {
7958
+ agg.format ?? (agg.format = bag.format);
7959
+ if (bag.format.includes("int"))
7960
+ agg.isInt = true;
7961
+ }
7962
+ if (bag.mime)
7963
+ intersectMime(agg, bag.mime);
7964
+ for (const pattern of bag.patterns ?? [])
7965
+ addPattern(agg, pattern);
7966
+ return agg;
7967
+ }
7783
7968
  var formatMap = {
7784
7969
  guid: "uuid",
7785
7970
  url: "uri",
@@ -7787,10 +7972,15 @@ var formatMap = {
7787
7972
  json_string: "json-string",
7788
7973
  regex: ""
7789
7974
  };
7975
+ var exactPatterns = new Map([
7976
+ [base64Charset, base64],
7977
+ [base64urlCharset, base64url]
7978
+ ]);
7979
+ var exactPattern = (p) => exactPatterns.get(p) ?? p;
7790
7980
  var stringProcessor = (schema, ctx, _json, _params) => {
7791
7981
  const json = _json;
7792
7982
  json.type = "string";
7793
- const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
7983
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
7794
7984
  if (typeof minimum === "number")
7795
7985
  json.minLength = minimum;
7796
7986
  if (typeof maximum === "number")
@@ -7806,7 +7996,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
7806
7996
  if (contentEncoding)
7807
7997
  json.contentEncoding = contentEncoding;
7808
7998
  if (patterns && patterns.size > 0) {
7809
- const patternList = [...patterns];
7999
+ const patternList = [...patterns].map(exactPattern);
7810
8000
  if (patternList.length === 1)
7811
8001
  json.pattern = patternList[0].source;
7812
8002
  else if (patternList.length > 1) {
@@ -7821,11 +8011,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
7821
8011
  };
7822
8012
  var numberProcessor = (schema, ctx, _json, params) => {
7823
8013
  const json = _json;
7824
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
7825
- if (typeof format === "string" && format.includes("int"))
7826
- json.type = "integer";
7827
- else
7828
- json.type = "number";
8014
+ const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
8015
+ json.type = isInt ? "integer" : "number";
7829
8016
  const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
7830
8017
  const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
7831
8018
  const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
@@ -7849,11 +8036,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
7849
8036
  } else if (typeof maximum === "number") {
7850
8037
  json.maximum = maximum;
7851
8038
  }
7852
- if (typeof multipleOf === "number") {
7853
- if (Number.isFinite(multipleOf) && multipleOf !== 0)
7854
- json.multipleOf = Math.abs(multipleOf);
7855
- else
7856
- handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
8039
+ if (multipleOf) {
8040
+ const divisors = new Set;
8041
+ for (const divisor of multipleOf) {
8042
+ if (Number.isFinite(divisor) && divisor !== 0)
8043
+ divisors.add(Math.abs(divisor));
8044
+ else
8045
+ handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
8046
+ }
8047
+ const [first, ...rest] = divisors;
8048
+ if (first !== undefined)
8049
+ json.multipleOf = first;
8050
+ if (rest.length)
8051
+ json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
7857
8052
  }
7858
8053
  };
7859
8054
  var booleanProcessor = (_schema, _ctx, json, _params) => {
@@ -7924,13 +8119,13 @@ var transformProcessor = (schema, ctx, json, params) => {
7924
8119
  var arrayProcessor = (schema, ctx, _json, params) => {
7925
8120
  const json = _json;
7926
8121
  const def = schema._zod.def;
7927
- const { minimum, maximum } = schema._zod.bag;
8122
+ const { minimum, maximum } = aggregateChecks(schema);
7928
8123
  if (typeof minimum === "number")
7929
8124
  json.minItems = minimum;
7930
8125
  if (typeof maximum === "number")
7931
8126
  json.maxItems = maximum;
7932
8127
  json.type = "array";
7933
- json.items = process2(def.element, ctx, {
8128
+ json.items = processSchema(def.element, ctx, {
7934
8129
  ...params,
7935
8130
  path: [...params.path, "items"]
7936
8131
  });
@@ -7956,7 +8151,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
7956
8151
  json.type = "object";
7957
8152
  json.properties = {};
7958
8153
  for (const key in shape) {
7959
- assignProp(json.properties, key, process2(shape[key], ctx, {
8154
+ assignProp(json.properties, key, processSchema(shape[key], ctx, {
7960
8155
  ...params,
7961
8156
  path: [...params.path, "properties", key]
7962
8157
  }));
@@ -7979,7 +8174,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
7979
8174
  if (ctx.io === "output")
7980
8175
  json.additionalProperties = false;
7981
8176
  } else if (def.catchall) {
7982
- json.additionalProperties = process2(def.catchall, ctx, {
8177
+ json.additionalProperties = processSchema(def.catchall, ctx, {
7983
8178
  ...params,
7984
8179
  path: [...params.path, "additionalProperties"]
7985
8180
  });
@@ -7988,7 +8183,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
7988
8183
  var unionProcessor = (schema, ctx, json, params) => {
7989
8184
  const def = schema._zod.def;
7990
8185
  const isExclusive = def.inclusive === false;
7991
- const options = def.options.map((x, i) => process2(x, ctx, {
8186
+ const options = def.options.map((x, i) => processSchema(x, ctx, {
7992
8187
  ...params,
7993
8188
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
7994
8189
  }));
@@ -8000,11 +8195,11 @@ var unionProcessor = (schema, ctx, json, params) => {
8000
8195
  };
8001
8196
  var intersectionProcessor = (schema, ctx, json, params) => {
8002
8197
  const def = schema._zod.def;
8003
- const a = process2(def.left, ctx, {
8198
+ const a = processSchema(def.left, ctx, {
8004
8199
  ...params,
8005
8200
  path: [...params.path, "allOf", 0]
8006
8201
  });
8007
- const b = process2(def.right, ctx, {
8202
+ const b = processSchema(def.right, ctx, {
8008
8203
  ...params,
8009
8204
  path: [...params.path, "allOf", 1]
8010
8205
  });
@@ -8084,20 +8279,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
8084
8279
  const def = schema._zod.def;
8085
8280
  json.type = "object";
8086
8281
  const keyType = def.keyType;
8087
- const keyBag = keyType._zod.bag;
8088
- const patterns = keyBag?.patterns;
8282
+ const patterns = aggregateChecks(keyType).patterns;
8089
8283
  if (def.mode === "loose" && patterns && patterns.size > 0) {
8090
- const valueSchema = process2(def.valueType, ctx, {
8284
+ const valueSchema = processSchema(def.valueType, ctx, {
8091
8285
  ...params,
8092
8286
  path: [...params.path, "patternProperties", "*"]
8093
8287
  });
8094
8288
  json.patternProperties = {};
8095
8289
  for (const pattern of patterns) {
8096
- assignProp(json.patternProperties, pattern.source, valueSchema);
8290
+ assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
8097
8291
  }
8098
8292
  } else {
8099
8293
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
8100
- json.propertyNames = process2(def.keyType, ctx, {
8294
+ json.propertyNames = processSchema(def.keyType, ctx, {
8101
8295
  ...params,
8102
8296
  path: [...params.path, "propertyNames"]
8103
8297
  });
@@ -8109,7 +8303,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
8109
8303
  }
8110
8304
  pending.push(schema);
8111
8305
  }
8112
- json.additionalProperties = process2(def.valueType, ctx, {
8306
+ json.additionalProperties = processSchema(def.valueType, ctx, {
8113
8307
  ...params,
8114
8308
  path: [...params.path, "additionalProperties"]
8115
8309
  });
@@ -8125,7 +8319,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
8125
8319
  };
8126
8320
  var nullableProcessor = (schema, ctx, json, params) => {
8127
8321
  const def = schema._zod.def;
8128
- const inner = process2(def.innerType, ctx, params);
8322
+ const inner = processSchema(def.innerType, ctx, params);
8129
8323
  const seen = ctx.seen.get(schema);
8130
8324
  if (ctx.target === "openapi-3.0") {
8131
8325
  seen.ref = def.innerType;
@@ -8136,7 +8330,7 @@ var nullableProcessor = (schema, ctx, json, params) => {
8136
8330
  };
8137
8331
  var nonoptionalProcessor = (schema, ctx, _json, params) => {
8138
8332
  const def = schema._zod.def;
8139
- process2(def.innerType, ctx, params);
8333
+ processSchema(def.innerType, ctx, params);
8140
8334
  const seen = ctx.seen.get(schema);
8141
8335
  seen.ref = def.innerType;
8142
8336
  };
@@ -8156,7 +8350,7 @@ function serializeDefaultValue(value, schema, ctx, json, params) {
8156
8350
  }
8157
8351
  var defaultProcessor = (schema, ctx, json, params) => {
8158
8352
  const def = schema._zod.def;
8159
- process2(def.innerType, ctx, params);
8353
+ processSchema(def.innerType, ctx, params);
8160
8354
  const seen = ctx.seen.get(schema);
8161
8355
  seen.ref = def.innerType;
8162
8356
  const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
@@ -8165,7 +8359,7 @@ var defaultProcessor = (schema, ctx, json, params) => {
8165
8359
  };
8166
8360
  var prefaultProcessor = (schema, ctx, json, params) => {
8167
8361
  const def = schema._zod.def;
8168
- process2(def.innerType, ctx, params);
8362
+ processSchema(def.innerType, ctx, params);
8169
8363
  const seen = ctx.seen.get(schema);
8170
8364
  seen.ref = def.innerType;
8171
8365
  if (ctx.io !== "input")
@@ -8176,7 +8370,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
8176
8370
  };
8177
8371
  var catchProcessor = (schema, ctx, json, params) => {
8178
8372
  const def = schema._zod.def;
8179
- process2(def.innerType, ctx, params);
8373
+ processSchema(def.innerType, ctx, params);
8180
8374
  const seen = ctx.seen.get(schema);
8181
8375
  seen.ref = def.innerType;
8182
8376
  let catchValue;
@@ -8192,24 +8386,24 @@ var pipeProcessor = (schema, ctx, _json, params) => {
8192
8386
  const def = schema._zod.def;
8193
8387
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
8194
8388
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
8195
- process2(innerType, ctx, params);
8389
+ processSchema(innerType, ctx, params);
8196
8390
  const seen = ctx.seen.get(schema);
8197
8391
  seen.ref = innerType;
8198
8392
  };
8199
8393
  var readonlyProcessor = (schema, ctx, json, params) => {
8200
8394
  const def = schema._zod.def;
8201
- process2(def.innerType, ctx, params);
8395
+ processSchema(def.innerType, ctx, params);
8202
8396
  const seen = ctx.seen.get(schema);
8203
8397
  seen.ref = def.innerType;
8204
8398
  json.readOnly = true;
8205
8399
  };
8206
8400
  var optionalProcessor = (schema, ctx, _json, params) => {
8207
8401
  const def = schema._zod.def;
8208
- process2(def.innerType, ctx, params);
8402
+ processSchema(def.innerType, ctx, params);
8209
8403
  const seen = ctx.seen.get(schema);
8210
8404
  seen.ref = def.innerType;
8211
8405
  };
8212
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/errors.js
8406
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/classic/errors.js
8213
8407
  var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
8214
8408
  function _lazyMethod(proto, key, make) {
8215
8409
  Object.defineProperty(proto, key, {
@@ -8254,11 +8448,11 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefi
8254
8448
  Parent: Error
8255
8449
  });
8256
8450
 
8257
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/parse.js
8258
- var parse3 = /* @__PURE__ */ _parse(ZodRealError);
8259
- var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
8260
- var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
8261
- var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
8451
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/classic/parse.js
8452
+ var parse2 = /* @__PURE__ */ _parse(ZodRealError);
8453
+ var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
8454
+ var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
8455
+ var safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
8262
8456
  var encode = /* @__PURE__ */ _encode(ZodRealError);
8263
8457
  var decode = /* @__PURE__ */ _decode(ZodRealError);
8264
8458
  var encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
@@ -8268,7 +8462,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
8268
8462
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
8269
8463
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
8270
8464
 
8271
- // node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
8465
+ // node_modules/.bun/zod@4.6.1/node_modules/zod/v4/classic/schemas.js
8272
8466
  function _ensureDefaultLocale() {
8273
8467
  if (!globalConfig.localeError)
8274
8468
  config(en_default());
@@ -8391,16 +8585,16 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
8391
8585
  own(this, "~standard", value);
8392
8586
  },
8393
8587
  parse: function _parse(data, params) {
8394
- return parse3(this, data, params, { callee: _parse });
8588
+ return parse2(this, data, params, { callee: _parse });
8395
8589
  },
8396
8590
  parseAsync: async function _parseAsync(data, params) {
8397
- return await parseAsync2(this, data, params, { callee: _parseAsync });
8591
+ return await parseAsync(this, data, params, { callee: _parseAsync });
8398
8592
  },
8399
8593
  safeParse(data, params) {
8400
- return safeParse2(this, data, params);
8594
+ return safeParse(this, data, params);
8401
8595
  },
8402
8596
  async safeParseAsync(data, params) {
8403
- return safeParseAsync2(this, data, params);
8597
+ return safeParseAsync(this, data, params);
8404
8598
  },
8405
8599
  get spa() {
8406
8600
  return this?.safeParseAsync;
@@ -8408,6 +8602,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
8408
8602
  set spa(value) {
8409
8603
  own(this, "spa", value);
8410
8604
  },
8605
+ validate(data, params) {
8606
+ return validate(this, data, params);
8607
+ },
8608
+ validateAsync(data, params) {
8609
+ return validateAsync(this, data, params);
8610
+ },
8411
8611
  encode: function _encode(data, params) {
8412
8612
  return encode(this, data, params, { callee: _encode });
8413
8613
  },
@@ -8446,10 +8646,10 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
8446
8646
  $ZodString.init(inst, def);
8447
8647
  ZodType.init(inst, def);
8448
8648
  inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
8449
- const bag = inst._zod.bag;
8450
- inst.format = bag.format ?? null;
8451
- inst.minLength = bag.minimum ?? null;
8452
- inst.maxLength = bag.maximum ?? null;
8649
+ }, /* @__PURE__ */ derived({
8650
+ format: (inst) => aggregateChecks(inst).format ?? null,
8651
+ minLength: (inst) => aggregateChecks(inst).minimum ?? null,
8652
+ maxLength: (inst) => aggregateChecks(inst).maximum ?? null
8453
8653
  }, {
8454
8654
  regex(...args) {
8455
8655
  return this.check(_regex(...args));
@@ -8496,7 +8696,7 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
8496
8696
  slugify() {
8497
8697
  return this.check(_slugify());
8498
8698
  }
8499
- });
8699
+ }));
8500
8700
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
8501
8701
  $ZodString.init(inst, def);
8502
8702
  _ZodString.init(inst, def);
@@ -8683,12 +8883,21 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
8683
8883
  $ZodNumber.init(inst, def);
8684
8884
  ZodType.init(inst, def);
8685
8885
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
8686
- const bag = inst._zod.bag;
8687
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
8688
- inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
8689
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
8690
8886
  inst.isFinite = true;
8691
- inst.format = bag.format ?? null;
8887
+ }, /* @__PURE__ */ derived({
8888
+ minValue: (inst) => {
8889
+ const { minimum, exclusiveMinimum } = aggregateChecks(inst);
8890
+ return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
8891
+ },
8892
+ maxValue: (inst) => {
8893
+ const { maximum, exclusiveMaximum } = aggregateChecks(inst);
8894
+ return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
8895
+ },
8896
+ isInt: (inst) => {
8897
+ const { isInt, multipleOf } = aggregateChecks(inst);
8898
+ return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
8899
+ },
8900
+ format: (inst) => aggregateChecks(inst).format ?? null
8692
8901
  }, {
8693
8902
  gt(value, params) {
8694
8903
  return this.check(_gt(value, params));
@@ -8735,7 +8944,7 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
8735
8944
  finite() {
8736
8945
  return this;
8737
8946
  }
8738
- });
8947
+ }));
8739
8948
  function number2(params) {
8740
8949
  return _number(ZodNumber, params);
8741
8950
  }
@@ -8807,19 +9016,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
8807
9016
  return _enum(Object.keys(this._zod.def.shape));
8808
9017
  },
8809
9018
  catchall(catchall) {
8810
- return this.clone({ ...this._zod.def, catchall });
9019
+ return this.clone(mergeDefs(this._zod.def, { catchall }));
8811
9020
  },
8812
9021
  passthrough() {
8813
- return this.clone({ ...this._zod.def, catchall: unknown() });
9022
+ return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
8814
9023
  },
8815
9024
  loose() {
8816
- return this.clone({ ...this._zod.def, catchall: unknown() });
9025
+ return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
8817
9026
  },
8818
9027
  strict() {
8819
- return this.clone({ ...this._zod.def, catchall: never() });
9028
+ return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
8820
9029
  },
8821
9030
  strip() {
8822
- return this.clone({ ...this._zod.def, catchall: undefined });
9031
+ return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
8823
9032
  },
8824
9033
  extend(incoming) {
8825
9034
  return extend(this, incoming);
@@ -8908,7 +9117,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
8908
9117
  ZodType.init(inst, def);
8909
9118
  inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
8910
9119
  inst.enum = def.entries;
8911
- inst.options = Object.values(def.entries);
9120
+ inst.options = [...inst._zod.values];
8912
9121
  const keys = new Set(Object.keys(def.entries));
8913
9122
  inst.extract = (values, params) => {
8914
9123
  const newEntries = {};