dsh-autotier 0.2.18 → 0.2.20
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/CHANGELOG.md +12 -0
- package/README-es.md +199 -78
- package/README-hi.md +203 -80
- package/README-pt.md +201 -80
- package/README-zh.md +172 -52
- package/README.md +204 -84
- package/docs/assets/dsh-autotier-flow.svg +19 -0
- package/lib/client.js +583 -357
- package/lib/client.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/typert.host.js +1 -1
- package/lib/{wire-BxsY8BiN.js → wire-DHFKQqYR.js} +583 -357
- package/package.json +11 -11
package/lib/client.js
CHANGED
|
@@ -559,7 +559,7 @@ window.__ModuleLoader__.load({
|
|
|
559
559
|
unknownAgent: "The current session is not registered with the routing service, so its mode cannot change yet."
|
|
560
560
|
};
|
|
561
561
|
//#endregion
|
|
562
|
-
//#region node_modules/.pnpm/zod@4.
|
|
562
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
563
563
|
function getEnumValues(entries) {
|
|
564
564
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
565
565
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -571,14 +571,22 @@ window.__ModuleLoader__.load({
|
|
|
571
571
|
if (typeof value === "bigint") return value.toString();
|
|
572
572
|
return value;
|
|
573
573
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
574
|
+
var Cached = class {
|
|
575
|
+
constructor(getter) {
|
|
576
|
+
this._getter = getter;
|
|
577
|
+
this._value = void 0;
|
|
578
|
+
}
|
|
579
|
+
get value() {
|
|
580
|
+
const getter = this._getter;
|
|
581
|
+
if (getter !== void 0) {
|
|
582
|
+
this._value = getter();
|
|
583
|
+
this._getter = void 0;
|
|
580
584
|
}
|
|
581
|
-
|
|
585
|
+
return this._value;
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
function cached(getter) {
|
|
589
|
+
return new Cached(getter);
|
|
582
590
|
}
|
|
583
591
|
function nullish(input) {
|
|
584
592
|
return input === null || input === void 0;
|
|
@@ -603,6 +611,58 @@ window.__ModuleLoader__.load({
|
|
|
603
611
|
configurable: true
|
|
604
612
|
});
|
|
605
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
|
|
616
|
+
*
|
|
617
|
+
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
|
|
618
|
+
*/
|
|
619
|
+
function rawShape(def) {
|
|
620
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
621
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
622
|
+
}
|
|
623
|
+
function sourceShape(schema) {
|
|
624
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
625
|
+
}
|
|
626
|
+
function deferProp(target, key, getter) {
|
|
627
|
+
Object.defineProperty(target, key, {
|
|
628
|
+
get() {
|
|
629
|
+
const value = getter();
|
|
630
|
+
assignProp(this, key, value);
|
|
631
|
+
return value;
|
|
632
|
+
},
|
|
633
|
+
enumerable: true,
|
|
634
|
+
configurable: true
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
function putProp(target, key, value) {
|
|
638
|
+
if (key in target) assignProp(target, key, value);
|
|
639
|
+
else target[key] = value;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
|
|
643
|
+
*
|
|
644
|
+
* A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
|
|
645
|
+
*/
|
|
646
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
647
|
+
const raw = sourceShape(source);
|
|
648
|
+
for (const key of keys) {
|
|
649
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
650
|
+
if (!desc.enumerable) continue;
|
|
651
|
+
if (desc.get) deferProp(target, key, () => {
|
|
652
|
+
const value = source._zod.def.shape[key];
|
|
653
|
+
return wrap ? wrap(value, key) : value;
|
|
654
|
+
});
|
|
655
|
+
else putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function mirrorProps(target, source) {
|
|
659
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
660
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
661
|
+
if (!desc.enumerable) continue;
|
|
662
|
+
if (desc.get) deferProp(target, key, () => source[key]);
|
|
663
|
+
else putProp(target, key, desc.value);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
606
666
|
function mergeDefs(...defs) {
|
|
607
667
|
const mergedDescriptors = {};
|
|
608
668
|
for (const def of defs) {
|
|
@@ -693,39 +753,39 @@ window.__ModuleLoader__.load({
|
|
|
693
753
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
694
754
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
695
755
|
}))();
|
|
756
|
+
const BIGINT_FORMAT_RANGES = {
|
|
757
|
+
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
|
|
758
|
+
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
|
|
759
|
+
};
|
|
696
760
|
function pick(schema, mask) {
|
|
697
761
|
const currDef = schema._zod.def;
|
|
698
762
|
const checks = currDef.checks;
|
|
699
763
|
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
705
|
-
if (!mask[key]) continue;
|
|
706
|
-
assignProp(newShape, key, currDef.shape[key]);
|
|
707
|
-
}
|
|
708
|
-
assignProp(this, "shape", newShape);
|
|
709
|
-
return newShape;
|
|
710
|
-
},
|
|
764
|
+
const newShape = {};
|
|
765
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
766
|
+
return clone(schema, mergeDefs(currDef, {
|
|
767
|
+
shape: newShape,
|
|
711
768
|
checks: []
|
|
712
769
|
}));
|
|
713
770
|
}
|
|
771
|
+
function maskedKeys(schema, mask) {
|
|
772
|
+
const raw = sourceShape(schema);
|
|
773
|
+
const keys = [];
|
|
774
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
775
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
776
|
+
if (mask[key]) keys.push(key);
|
|
777
|
+
}
|
|
778
|
+
return keys;
|
|
779
|
+
}
|
|
714
780
|
function omit(schema, mask) {
|
|
715
781
|
const currDef = schema._zod.def;
|
|
716
782
|
const checks = currDef.checks;
|
|
717
783
|
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
if (!mask[key]) continue;
|
|
724
|
-
delete newShape[key];
|
|
725
|
-
}
|
|
726
|
-
assignProp(this, "shape", newShape);
|
|
727
|
-
return newShape;
|
|
728
|
-
},
|
|
784
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
785
|
+
const newShape = {};
|
|
786
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
787
|
+
return clone(schema, mergeDefs(currDef, {
|
|
788
|
+
shape: newShape,
|
|
729
789
|
checks: []
|
|
730
790
|
}));
|
|
731
791
|
}
|
|
@@ -733,41 +793,29 @@ window.__ModuleLoader__.load({
|
|
|
733
793
|
if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
734
794
|
const checks = schema._zod.def.checks;
|
|
735
795
|
if (checks && checks.length > 0) {
|
|
736
|
-
const existingShape = schema
|
|
796
|
+
const existingShape = sourceShape(schema);
|
|
737
797
|
for (const key of Reflect.ownKeys(shape)) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
738
798
|
}
|
|
739
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
} }));
|
|
799
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
800
|
+
}
|
|
801
|
+
function extended(schema, shape) {
|
|
802
|
+
const newShape = {};
|
|
803
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
804
|
+
mirrorProps(newShape, shape);
|
|
805
|
+
return newShape;
|
|
747
806
|
}
|
|
748
807
|
function safeExtend(schema, shape) {
|
|
749
808
|
if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
750
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
751
|
-
const _shape = {
|
|
752
|
-
...schema._zod.def.shape,
|
|
753
|
-
...shape
|
|
754
|
-
};
|
|
755
|
-
assignProp(this, "shape", _shape);
|
|
756
|
-
return _shape;
|
|
757
|
-
} }));
|
|
809
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
758
810
|
}
|
|
759
811
|
function merge(a, b) {
|
|
760
812
|
if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
761
813
|
if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
814
|
+
const newShape = {};
|
|
815
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
816
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
762
817
|
return clone(a, mergeDefs(a._zod.def, {
|
|
763
|
-
|
|
764
|
-
const _shape = {
|
|
765
|
-
...a._zod.def.shape,
|
|
766
|
-
...b._zod.def.shape
|
|
767
|
-
};
|
|
768
|
-
assignProp(this, "shape", _shape);
|
|
769
|
-
return _shape;
|
|
770
|
-
},
|
|
818
|
+
shape: newShape,
|
|
771
819
|
get catchall() {
|
|
772
820
|
return b._zod.def.catchall;
|
|
773
821
|
},
|
|
@@ -777,47 +825,25 @@ window.__ModuleLoader__.load({
|
|
|
777
825
|
function partial(Class, schema, mask, name = "partial") {
|
|
778
826
|
const checks = schema._zod.def.checks;
|
|
779
827
|
if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
828
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
829
|
+
const newShape = {};
|
|
830
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({
|
|
831
|
+
type: "optional",
|
|
832
|
+
innerType: value
|
|
833
|
+
})));
|
|
780
834
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
781
|
-
|
|
782
|
-
const oldShape = schema._zod.def.shape;
|
|
783
|
-
const shape = { ...oldShape };
|
|
784
|
-
if (mask) for (const key of Reflect.ownKeys(mask)) {
|
|
785
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
786
|
-
if (!mask[key]) continue;
|
|
787
|
-
shape[key] = Class ? new Class({
|
|
788
|
-
type: "optional",
|
|
789
|
-
innerType: oldShape[key]
|
|
790
|
-
}) : oldShape[key];
|
|
791
|
-
}
|
|
792
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = Class ? new Class({
|
|
793
|
-
type: "optional",
|
|
794
|
-
innerType: oldShape[key]
|
|
795
|
-
}) : oldShape[key];
|
|
796
|
-
assignProp(this, "shape", shape);
|
|
797
|
-
return shape;
|
|
798
|
-
},
|
|
835
|
+
shape: newShape,
|
|
799
836
|
checks: []
|
|
800
837
|
}));
|
|
801
838
|
}
|
|
802
839
|
function required(Class, schema, mask) {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
type: "nonoptional",
|
|
811
|
-
innerType: oldShape[key]
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = new Class({
|
|
815
|
-
type: "nonoptional",
|
|
816
|
-
innerType: oldShape[key]
|
|
817
|
-
});
|
|
818
|
-
assignProp(this, "shape", shape);
|
|
819
|
-
return shape;
|
|
820
|
-
} }));
|
|
840
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
841
|
+
const newShape = {};
|
|
842
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({
|
|
843
|
+
type: "nonoptional",
|
|
844
|
+
innerType: value
|
|
845
|
+
}));
|
|
846
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
821
847
|
}
|
|
822
848
|
function aborted(x, startIndex = 0) {
|
|
823
849
|
if (x.aborted === true) return true;
|
|
@@ -840,6 +866,17 @@ window.__ModuleLoader__.load({
|
|
|
840
866
|
function unwrapMessage(message) {
|
|
841
867
|
return typeof message === "string" ? message : message?.message;
|
|
842
868
|
}
|
|
869
|
+
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
|
|
870
|
+
function sizeCaps(defChecks) {
|
|
871
|
+
const caps = [];
|
|
872
|
+
for (const ch of defChecks ?? []) {
|
|
873
|
+
const d = ch._zod.def;
|
|
874
|
+
if (!/_(length|size)$|_equals$/.test(d.check)) break;
|
|
875
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
876
|
+
if (max >= 0) caps.push([max, ch]);
|
|
877
|
+
}
|
|
878
|
+
return caps;
|
|
879
|
+
}
|
|
843
880
|
function attachSchema(issues, start, inst) {
|
|
844
881
|
var _a;
|
|
845
882
|
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
@@ -853,11 +890,15 @@ window.__ModuleLoader__.load({
|
|
|
853
890
|
}
|
|
854
891
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
855
892
|
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";
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
893
|
+
const full = {};
|
|
894
|
+
for (const k of Object.keys(iss)) {
|
|
895
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
896
|
+
full[k] = iss[k];
|
|
897
|
+
}
|
|
898
|
+
full.path ?? (full.path = []);
|
|
899
|
+
full.message = message;
|
|
900
|
+
if (ctx?.reportInput) full.input = iss.input;
|
|
901
|
+
return full;
|
|
861
902
|
}
|
|
862
903
|
const highSurrogate = /[\uD800-\uDBFF]/;
|
|
863
904
|
function codePointLength(str) {
|
|
@@ -927,6 +968,24 @@ window.__ModuleLoader__.load({
|
|
|
927
968
|
function hide(inst, key, value) {
|
|
928
969
|
return own(inst, key, value, false);
|
|
929
970
|
}
|
|
971
|
+
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
972
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
973
|
+
function derived(computes, table) {
|
|
974
|
+
for (const key in computes) {
|
|
975
|
+
const compute = computes[key];
|
|
976
|
+
Object.defineProperty(table, key, {
|
|
977
|
+
configurable: true,
|
|
978
|
+
enumerable: true,
|
|
979
|
+
get() {
|
|
980
|
+
return own(this, key, compute(this));
|
|
981
|
+
},
|
|
982
|
+
set(value) {
|
|
983
|
+
own(this, key, value);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
return table;
|
|
988
|
+
}
|
|
930
989
|
function defineBound(proto, key, fn) {
|
|
931
990
|
Object.defineProperty(proto, key, {
|
|
932
991
|
configurable: true,
|
|
@@ -1035,9 +1094,9 @@ window.__ModuleLoader__.load({
|
|
|
1035
1094
|
return fn;
|
|
1036
1095
|
}
|
|
1037
1096
|
//#endregion
|
|
1038
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1097
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.js
|
|
1039
1098
|
var _a$1;
|
|
1040
|
-
const _zodDesc
|
|
1099
|
+
const _zodDesc = {
|
|
1041
1100
|
value: void 0,
|
|
1042
1101
|
enumerable: false
|
|
1043
1102
|
};
|
|
@@ -1062,6 +1121,7 @@ window.__ModuleLoader__.load({
|
|
|
1062
1121
|
}
|
|
1063
1122
|
return new Definition();
|
|
1064
1123
|
}
|
|
1124
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1065
1125
|
function $constructor(name, initializer, proto, params) {
|
|
1066
1126
|
const zodProto = {};
|
|
1067
1127
|
function Internals(def) {
|
|
@@ -1074,14 +1134,13 @@ window.__ModuleLoader__.load({
|
|
|
1074
1134
|
const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
|
|
1075
1135
|
function init(inst, def) {
|
|
1076
1136
|
if (!inst._zod) {
|
|
1077
|
-
_zodDesc
|
|
1137
|
+
_zodDesc.value = new Internals(def);
|
|
1078
1138
|
try {
|
|
1079
|
-
Object.defineProperty(inst, "_zod", _zodDesc
|
|
1139
|
+
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
1080
1140
|
} finally {
|
|
1081
|
-
_zodDesc
|
|
1141
|
+
_zodDesc.value = void 0;
|
|
1082
1142
|
}
|
|
1083
|
-
}
|
|
1084
|
-
if (inst._zod.traits.has(name)) return;
|
|
1143
|
+
} else if (inst._zod.traits.has(name)) return;
|
|
1085
1144
|
inst._zod.traits.add(name);
|
|
1086
1145
|
initializer(inst, def);
|
|
1087
1146
|
if (initialized) {
|
|
@@ -1142,7 +1201,7 @@ window.__ModuleLoader__.load({
|
|
|
1142
1201
|
return globalConfig;
|
|
1143
1202
|
}
|
|
1144
1203
|
//#endregion
|
|
1145
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1204
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.js
|
|
1146
1205
|
function _getMessage() {
|
|
1147
1206
|
const internals = this._zod;
|
|
1148
1207
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -1157,10 +1216,6 @@ window.__ModuleLoader__.load({
|
|
|
1157
1216
|
enumerable: true,
|
|
1158
1217
|
configurable: true
|
|
1159
1218
|
};
|
|
1160
|
-
const _zodDesc = {
|
|
1161
|
-
value: void 0,
|
|
1162
|
-
enumerable: false
|
|
1163
|
-
};
|
|
1164
1219
|
const _issuesDesc = {
|
|
1165
1220
|
value: void 0,
|
|
1166
1221
|
enumerable: false
|
|
@@ -1168,11 +1223,8 @@ window.__ModuleLoader__.load({
|
|
|
1168
1223
|
const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
1169
1224
|
const initializer$1 = (inst, def) => {
|
|
1170
1225
|
inst.name = "$ZodError";
|
|
1171
|
-
_zodDesc.value = inst._zod;
|
|
1172
|
-
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
1173
1226
|
_issuesDesc.value = def;
|
|
1174
1227
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
1175
|
-
_zodDesc.value = void 0;
|
|
1176
1228
|
_issuesDesc.value = void 0;
|
|
1177
1229
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
1178
1230
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -1200,8 +1252,7 @@ window.__ModuleLoader__.load({
|
|
|
1200
1252
|
});
|
|
1201
1253
|
}
|
|
1202
1254
|
};
|
|
1203
|
-
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
1204
|
-
const $ZodRealError = $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
1255
|
+
const $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer$1);
|
|
1205
1256
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
1206
1257
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
1207
1258
|
* "__proto__" would hit the setter instead of creating a key. */
|
|
@@ -1265,7 +1316,7 @@ window.__ModuleLoader__.load({
|
|
|
1265
1316
|
return fieldErrors;
|
|
1266
1317
|
}
|
|
1267
1318
|
//#endregion
|
|
1268
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1319
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.js
|
|
1269
1320
|
function finalizeParams(callee, params) {
|
|
1270
1321
|
return {
|
|
1271
1322
|
callee: params?.callee ?? callee,
|
|
@@ -1322,15 +1373,30 @@ window.__ModuleLoader__.load({
|
|
|
1322
1373
|
issues: []
|
|
1323
1374
|
}, ctx);
|
|
1324
1375
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
1325
|
-
return result.issues.length ? {
|
|
1326
|
-
success: false,
|
|
1327
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1328
|
-
} : {
|
|
1376
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
1329
1377
|
success: true,
|
|
1330
1378
|
data: result.value
|
|
1331
1379
|
};
|
|
1332
1380
|
};
|
|
1333
|
-
|
|
1381
|
+
function failure(Err, issues, ctx) {
|
|
1382
|
+
let error;
|
|
1383
|
+
return {
|
|
1384
|
+
success: false,
|
|
1385
|
+
get error() {
|
|
1386
|
+
if (!error) {
|
|
1387
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
1388
|
+
issues = void 0;
|
|
1389
|
+
ctx = void 0;
|
|
1390
|
+
}
|
|
1391
|
+
return error;
|
|
1392
|
+
},
|
|
1393
|
+
set error(e) {
|
|
1394
|
+
error = e;
|
|
1395
|
+
issues = void 0;
|
|
1396
|
+
ctx = void 0;
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1334
1400
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1335
1401
|
const ctx = _ctx ? {
|
|
1336
1402
|
..._ctx,
|
|
@@ -1341,15 +1407,61 @@ window.__ModuleLoader__.load({
|
|
|
1341
1407
|
issues: []
|
|
1342
1408
|
}, ctx);
|
|
1343
1409
|
if (result instanceof Promise) result = await result;
|
|
1344
|
-
return result.issues.length ? {
|
|
1345
|
-
success: false,
|
|
1346
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1347
|
-
} : {
|
|
1410
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
1348
1411
|
success: true,
|
|
1349
1412
|
data: result.value
|
|
1350
1413
|
};
|
|
1351
1414
|
};
|
|
1352
|
-
const
|
|
1415
|
+
const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
1416
|
+
const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
1417
|
+
const validate = ((schema, value, _ctx) => {
|
|
1418
|
+
const validator = schema._zod.bag.validator;
|
|
1419
|
+
if (validator !== void 0) {
|
|
1420
|
+
if (validator(value) !== COMPILE_INVALID) return true;
|
|
1421
|
+
if (validator.definite === true && _ctx === void 0) return false;
|
|
1422
|
+
}
|
|
1423
|
+
return validateFallback(schema, value, _ctx);
|
|
1424
|
+
});
|
|
1425
|
+
function validateFallback(schema, value, _ctx) {
|
|
1426
|
+
const ctx = _ctx ? {
|
|
1427
|
+
..._ctx,
|
|
1428
|
+
async: false,
|
|
1429
|
+
abortEarly: true
|
|
1430
|
+
} : {
|
|
1431
|
+
async: false,
|
|
1432
|
+
abortEarly: true
|
|
1433
|
+
};
|
|
1434
|
+
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
1435
|
+
let result;
|
|
1436
|
+
if (fallbackRun) {
|
|
1437
|
+
ctx[COMPILE_FALLBACK] = true;
|
|
1438
|
+
result = fallbackRun({
|
|
1439
|
+
value,
|
|
1440
|
+
issues: []
|
|
1441
|
+
}, ctx);
|
|
1442
|
+
} else result = schema._zod.run({
|
|
1443
|
+
value,
|
|
1444
|
+
issues: []
|
|
1445
|
+
}, ctx);
|
|
1446
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
1447
|
+
return result.issues.length === 0;
|
|
1448
|
+
}
|
|
1449
|
+
const validateAsync$1 = async (schema, value, _ctx) => {
|
|
1450
|
+
const ctx = _ctx ? {
|
|
1451
|
+
..._ctx,
|
|
1452
|
+
async: true,
|
|
1453
|
+
abortEarly: true
|
|
1454
|
+
} : {
|
|
1455
|
+
async: true,
|
|
1456
|
+
abortEarly: true
|
|
1457
|
+
};
|
|
1458
|
+
let result = schema._zod.run({
|
|
1459
|
+
value,
|
|
1460
|
+
issues: []
|
|
1461
|
+
}, ctx);
|
|
1462
|
+
if (result instanceof Promise) result = await result;
|
|
1463
|
+
return result.issues.length === 0;
|
|
1464
|
+
};
|
|
1353
1465
|
const _encode = (_Err) => {
|
|
1354
1466
|
const parse = _parse(_Err);
|
|
1355
1467
|
const fn = (schema, value, _ctx, _params) => {
|
|
@@ -1407,7 +1519,7 @@ window.__ModuleLoader__.load({
|
|
|
1407
1519
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1408
1520
|
};
|
|
1409
1521
|
//#endregion
|
|
1410
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1522
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.js
|
|
1411
1523
|
/**
|
|
1412
1524
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
1413
1525
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -1434,8 +1546,8 @@ window.__ModuleLoader__.load({
|
|
|
1434
1546
|
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})$`);
|
|
1435
1547
|
};
|
|
1436
1548
|
/** Practical email validation */
|
|
1437
|
-
const email = /^(
|
|
1438
|
-
const _emoji$1 = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1549
|
+
const 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,}$/;
|
|
1550
|
+
const _emoji$1 = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1439
1551
|
function emoji() {
|
|
1440
1552
|
return new RegExp(_emoji$1, "u");
|
|
1441
1553
|
}
|
|
@@ -1444,7 +1556,7 @@ window.__ModuleLoader__.load({
|
|
|
1444
1556
|
const 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])$/;
|
|
1445
1557
|
const 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])$/;
|
|
1446
1558
|
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
1447
|
-
const base64url = /^[A-Za-z0-9_-]
|
|
1559
|
+
const base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
1448
1560
|
const httpProtocol = /^https?$/;
|
|
1449
1561
|
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
1450
1562
|
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
@@ -1472,17 +1584,13 @@ window.__ModuleLoader__.load({
|
|
|
1472
1584
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
1473
1585
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
1474
1586
|
}
|
|
1475
|
-
const
|
|
1476
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
1477
|
-
return new RegExp(`^${regex}$`);
|
|
1478
|
-
};
|
|
1479
|
-
const integer = /^-?\d+$/;
|
|
1587
|
+
const anyString = /^[\s\S]{0,}$/;
|
|
1480
1588
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
1481
1589
|
const boolean$1 = /^(?:true|false)$/i;
|
|
1482
1590
|
const lowercase = /^[^A-Z]*$/;
|
|
1483
1591
|
const uppercase = /^[^a-z]*$/;
|
|
1484
1592
|
//#endregion
|
|
1485
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1593
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.js
|
|
1486
1594
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1487
1595
|
var _a;
|
|
1488
1596
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1502,14 +1610,6 @@ window.__ModuleLoader__.load({
|
|
|
1502
1610
|
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
1503
1611
|
$ZodCheck.init(inst, def);
|
|
1504
1612
|
const origin = numericOriginMap[typeof def.value];
|
|
1505
|
-
inst._zod.onattach.push((inst) => {
|
|
1506
|
-
const bag = inst._zod.bag;
|
|
1507
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
1508
|
-
if (def.value < curr) {
|
|
1509
|
-
if (def.inclusive) bag.maximum = def.value;
|
|
1510
|
-
else bag.exclusiveMaximum = def.value;
|
|
1511
|
-
}
|
|
1512
|
-
});
|
|
1513
1613
|
inst._zod.check = (payload) => {
|
|
1514
1614
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
1515
1615
|
payload.issues.push({
|
|
@@ -1526,14 +1626,6 @@ window.__ModuleLoader__.load({
|
|
|
1526
1626
|
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
1527
1627
|
$ZodCheck.init(inst, def);
|
|
1528
1628
|
const origin = numericOriginMap[typeof def.value];
|
|
1529
|
-
inst._zod.onattach.push((inst) => {
|
|
1530
|
-
const bag = inst._zod.bag;
|
|
1531
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
1532
|
-
if (def.value > curr) {
|
|
1533
|
-
if (def.inclusive) bag.minimum = def.value;
|
|
1534
|
-
else bag.exclusiveMinimum = def.value;
|
|
1535
|
-
}
|
|
1536
|
-
});
|
|
1537
1629
|
inst._zod.check = (payload) => {
|
|
1538
1630
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
1539
1631
|
payload.issues.push({
|
|
@@ -1549,10 +1641,6 @@ window.__ModuleLoader__.load({
|
|
|
1549
1641
|
});
|
|
1550
1642
|
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1551
1643
|
$ZodCheck.init(inst, def);
|
|
1552
|
-
inst._zod.onattach.push((inst) => {
|
|
1553
|
-
var _a;
|
|
1554
|
-
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
1555
|
-
});
|
|
1556
1644
|
inst._zod.check = (payload) => {
|
|
1557
1645
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1558
1646
|
if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
@@ -1572,13 +1660,6 @@ window.__ModuleLoader__.load({
|
|
|
1572
1660
|
const isInt = def.format?.includes("int");
|
|
1573
1661
|
const origin = isInt ? "int" : "number";
|
|
1574
1662
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
1575
|
-
inst._zod.onattach.push((inst) => {
|
|
1576
|
-
const bag = inst._zod.bag;
|
|
1577
|
-
bag.format = def.format;
|
|
1578
|
-
bag.minimum = minimum;
|
|
1579
|
-
bag.maximum = maximum;
|
|
1580
|
-
if (isInt) bag.pattern = integer;
|
|
1581
|
-
});
|
|
1582
1663
|
inst._zod.check = (payload) => {
|
|
1583
1664
|
const input = payload.value;
|
|
1584
1665
|
if (isInt) {
|
|
@@ -1641,10 +1722,6 @@ window.__ModuleLoader__.load({
|
|
|
1641
1722
|
var _a;
|
|
1642
1723
|
$ZodCheck.init(inst, def);
|
|
1643
1724
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1644
|
-
inst._zod.onattach.push((inst) => {
|
|
1645
|
-
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1646
|
-
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
1647
|
-
});
|
|
1648
1725
|
inst._zod.check = (payload) => {
|
|
1649
1726
|
const input = payload.value;
|
|
1650
1727
|
const units = input.length;
|
|
@@ -1665,10 +1742,6 @@ window.__ModuleLoader__.load({
|
|
|
1665
1742
|
var _a;
|
|
1666
1743
|
$ZodCheck.init(inst, def);
|
|
1667
1744
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1668
|
-
inst._zod.onattach.push((inst) => {
|
|
1669
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1670
|
-
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
1671
|
-
});
|
|
1672
1745
|
inst._zod.check = (payload) => {
|
|
1673
1746
|
const input = payload.value;
|
|
1674
1747
|
const units = input.length;
|
|
@@ -1689,12 +1762,6 @@ window.__ModuleLoader__.load({
|
|
|
1689
1762
|
var _a;
|
|
1690
1763
|
$ZodCheck.init(inst, def);
|
|
1691
1764
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1692
|
-
inst._zod.onattach.push((inst) => {
|
|
1693
|
-
const bag = inst._zod.bag;
|
|
1694
|
-
bag.minimum = def.length;
|
|
1695
|
-
bag.maximum = def.length;
|
|
1696
|
-
bag.length = def.length;
|
|
1697
|
-
});
|
|
1698
1765
|
inst._zod.check = (payload) => {
|
|
1699
1766
|
const input = payload.value;
|
|
1700
1767
|
const units = input.length;
|
|
@@ -1722,14 +1789,6 @@ window.__ModuleLoader__.load({
|
|
|
1722
1789
|
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1723
1790
|
var _a, _b;
|
|
1724
1791
|
$ZodCheck.init(inst, def);
|
|
1725
|
-
inst._zod.onattach.push((inst) => {
|
|
1726
|
-
const bag = inst._zod.bag;
|
|
1727
|
-
bag.format = def.format;
|
|
1728
|
-
if (def.pattern) {
|
|
1729
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1730
|
-
bag.patterns.add(def.pattern);
|
|
1731
|
-
}
|
|
1732
|
-
});
|
|
1733
1792
|
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1734
1793
|
def.pattern.lastIndex = 0;
|
|
1735
1794
|
if (def.pattern.test(payload.value)) return;
|
|
@@ -1772,13 +1831,7 @@ window.__ModuleLoader__.load({
|
|
|
1772
1831
|
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
1773
1832
|
$ZodCheck.init(inst, def);
|
|
1774
1833
|
const escapedRegex = escapeRegex(def.includes);
|
|
1775
|
-
|
|
1776
|
-
def.pattern = pattern;
|
|
1777
|
-
inst._zod.onattach.push((inst) => {
|
|
1778
|
-
const bag = inst._zod.bag;
|
|
1779
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1780
|
-
bag.patterns.add(pattern);
|
|
1781
|
-
});
|
|
1834
|
+
def.pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
1782
1835
|
inst._zod.check = (payload) => {
|
|
1783
1836
|
if (payload.value.includes(def.includes, def.position)) return;
|
|
1784
1837
|
payload.issues.push({
|
|
@@ -1796,11 +1849,6 @@ window.__ModuleLoader__.load({
|
|
|
1796
1849
|
$ZodCheck.init(inst, def);
|
|
1797
1850
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1798
1851
|
def.pattern ?? (def.pattern = pattern);
|
|
1799
|
-
inst._zod.onattach.push((inst) => {
|
|
1800
|
-
const bag = inst._zod.bag;
|
|
1801
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1802
|
-
bag.patterns.add(pattern);
|
|
1803
|
-
});
|
|
1804
1852
|
inst._zod.check = (payload) => {
|
|
1805
1853
|
if (payload.value.startsWith(def.prefix)) return;
|
|
1806
1854
|
payload.issues.push({
|
|
@@ -1818,11 +1866,6 @@ window.__ModuleLoader__.load({
|
|
|
1818
1866
|
$ZodCheck.init(inst, def);
|
|
1819
1867
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1820
1868
|
def.pattern ?? (def.pattern = pattern);
|
|
1821
|
-
inst._zod.onattach.push((inst) => {
|
|
1822
|
-
const bag = inst._zod.bag;
|
|
1823
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1824
|
-
bag.patterns.add(pattern);
|
|
1825
|
-
});
|
|
1826
1869
|
inst._zod.check = (payload) => {
|
|
1827
1870
|
if (payload.value.endsWith(def.suffix)) return;
|
|
1828
1871
|
payload.issues.push({
|
|
@@ -1843,7 +1886,7 @@ window.__ModuleLoader__.load({
|
|
|
1843
1886
|
};
|
|
1844
1887
|
});
|
|
1845
1888
|
//#endregion
|
|
1846
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1889
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.js
|
|
1847
1890
|
var Doc = class {
|
|
1848
1891
|
constructor(args = [], closed = {}) {
|
|
1849
1892
|
this.content = [];
|
|
@@ -1853,8 +1896,11 @@ window.__ModuleLoader__.load({
|
|
|
1853
1896
|
}
|
|
1854
1897
|
indented(fn) {
|
|
1855
1898
|
this.indent += 1;
|
|
1856
|
-
|
|
1857
|
-
|
|
1899
|
+
try {
|
|
1900
|
+
fn(this);
|
|
1901
|
+
} finally {
|
|
1902
|
+
this.indent -= 1;
|
|
1903
|
+
}
|
|
1858
1904
|
}
|
|
1859
1905
|
write(arg) {
|
|
1860
1906
|
if (typeof arg === "function") {
|
|
@@ -1874,14 +1920,14 @@ window.__ModuleLoader__.load({
|
|
|
1874
1920
|
}
|
|
1875
1921
|
};
|
|
1876
1922
|
//#endregion
|
|
1877
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1923
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.js
|
|
1878
1924
|
const version = {
|
|
1879
1925
|
major: 4,
|
|
1880
|
-
minor:
|
|
1881
|
-
patch:
|
|
1926
|
+
minor: 6,
|
|
1927
|
+
patch: 7
|
|
1882
1928
|
};
|
|
1883
1929
|
//#endregion
|
|
1884
|
-
//#region node_modules/.pnpm/zod@4.
|
|
1930
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.js
|
|
1885
1931
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1886
1932
|
var _a;
|
|
1887
1933
|
inst ?? (inst = {});
|
|
@@ -1970,15 +2016,26 @@ window.__ModuleLoader__.load({
|
|
|
1970
2016
|
}
|
|
1971
2017
|
});
|
|
1972
2018
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
1973
|
-
const toStandardResult = (r) => r.
|
|
2019
|
+
const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
2020
|
+
async function validateAsync(inst, value) {
|
|
2021
|
+
const ctx = { async: true };
|
|
2022
|
+
return toStandardResult(await inst._zod.run({
|
|
2023
|
+
value,
|
|
2024
|
+
issues: []
|
|
2025
|
+
}, ctx), ctx);
|
|
2026
|
+
}
|
|
1974
2027
|
function standardProps(inst) {
|
|
1975
2028
|
return {
|
|
1976
2029
|
validate: (value) => {
|
|
2030
|
+
const ctx = { async: false };
|
|
1977
2031
|
try {
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
2032
|
+
const r = inst._zod.run({
|
|
2033
|
+
value,
|
|
2034
|
+
issues: []
|
|
2035
|
+
}, ctx);
|
|
2036
|
+
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
2037
|
+
} catch (_) {}
|
|
2038
|
+
return validateAsync(inst, value);
|
|
1982
2039
|
},
|
|
1983
2040
|
vendor: "zod",
|
|
1984
2041
|
version: 1
|
|
@@ -1986,7 +2043,7 @@ window.__ModuleLoader__.load({
|
|
|
1986
2043
|
}
|
|
1987
2044
|
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
1988
2045
|
$ZodType.init(inst, def);
|
|
1989
|
-
inst._zod.pattern =
|
|
2046
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
1990
2047
|
inst._zod.parse = (payload, _) => {
|
|
1991
2048
|
if (def.coerce) try {
|
|
1992
2049
|
payload.value = String(payload.value);
|
|
@@ -2030,10 +2087,27 @@ window.__ModuleLoader__.load({
|
|
|
2030
2087
|
def.pattern ?? (def.pattern = email);
|
|
2031
2088
|
$ZodStringFormat.init(inst, def);
|
|
2032
2089
|
});
|
|
2033
|
-
|
|
2090
|
+
function canParseURL(input) {
|
|
2091
|
+
try {
|
|
2092
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
|
|
2093
|
+
new URL(input);
|
|
2094
|
+
return true;
|
|
2095
|
+
} catch {
|
|
2096
|
+
return false;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
function validateURL(trimmed, def) {
|
|
2100
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
|
|
2101
|
+
return parseURLObject(trimmed, def);
|
|
2102
|
+
}
|
|
2103
|
+
/** Parses a URL while preserving the non-normalizing HTTP guard. */
|
|
2034
2104
|
function parseURLObject(trimmed, def) {
|
|
2035
2105
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
|
|
2036
2106
|
try {
|
|
2107
|
+
if (typeof URL !== "undefined") {
|
|
2108
|
+
const URLStatic = URL;
|
|
2109
|
+
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
|
|
2110
|
+
}
|
|
2037
2111
|
return new URL(trimmed);
|
|
2038
2112
|
} catch {
|
|
2039
2113
|
return 2;
|
|
@@ -2057,7 +2131,7 @@ window.__ModuleLoader__.load({
|
|
|
2057
2131
|
inst._zod.check = (payload) => {
|
|
2058
2132
|
try {
|
|
2059
2133
|
const trimmed = payload.value.trim();
|
|
2060
|
-
const url =
|
|
2134
|
+
const url = validateURL(trimmed, def);
|
|
2061
2135
|
if (url === 1) {
|
|
2062
2136
|
payload.issues.push({
|
|
2063
2137
|
code: "invalid_format",
|
|
@@ -2079,6 +2153,10 @@ window.__ModuleLoader__.load({
|
|
|
2079
2153
|
});
|
|
2080
2154
|
return;
|
|
2081
2155
|
}
|
|
2156
|
+
if (url === true) {
|
|
2157
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
2158
|
+
return;
|
|
2159
|
+
}
|
|
2082
2160
|
if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
|
|
2083
2161
|
code: "invalid_format",
|
|
2084
2162
|
format: "url",
|
|
@@ -2147,12 +2225,6 @@ window.__ModuleLoader__.load({
|
|
|
2147
2225
|
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
2148
2226
|
def.pattern ?? (def.pattern = datetime(def));
|
|
2149
2227
|
$ZodStringFormat.init(inst, def);
|
|
2150
|
-
if (def.local || def.precision === -1) {
|
|
2151
|
-
inst._zod.bag.laxFormat = true;
|
|
2152
|
-
inst._zod.onattach.push((s) => {
|
|
2153
|
-
s._zod.bag.laxFormat = true;
|
|
2154
|
-
});
|
|
2155
|
-
}
|
|
2156
2228
|
});
|
|
2157
2229
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
2158
2230
|
def.pattern ?? (def.pattern = date);
|
|
@@ -2169,23 +2241,16 @@ window.__ModuleLoader__.load({
|
|
|
2169
2241
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
2170
2242
|
def.pattern ?? (def.pattern = ipv4);
|
|
2171
2243
|
$ZodStringFormat.init(inst, def);
|
|
2172
|
-
inst._zod.bag.format = `ipv4`;
|
|
2173
2244
|
});
|
|
2174
2245
|
/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
|
|
2175
2246
|
const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
2176
2247
|
function isValidIPv6(value) {
|
|
2177
2248
|
if (!ipv6Alphabet.test(value)) return false;
|
|
2178
|
-
|
|
2179
|
-
new URL(`http://[${value}]`);
|
|
2180
|
-
return true;
|
|
2181
|
-
} catch {
|
|
2182
|
-
return false;
|
|
2183
|
-
}
|
|
2249
|
+
return canParseURL(`http://[${value}]`);
|
|
2184
2250
|
}
|
|
2185
2251
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
2186
2252
|
def.pattern ?? (def.pattern = ipv6);
|
|
2187
2253
|
$ZodStringFormat.init(inst, def);
|
|
2188
|
-
inst._zod.bag.format = `ipv6`;
|
|
2189
2254
|
inst._zod.check = (payload) => {
|
|
2190
2255
|
if (!isValidIPv6(payload.value)) payload.issues.push({
|
|
2191
2256
|
code: "invalid_format",
|
|
@@ -2234,10 +2299,10 @@ window.__ModuleLoader__.load({
|
|
|
2234
2299
|
return false;
|
|
2235
2300
|
}
|
|
2236
2301
|
}
|
|
2302
|
+
const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
2237
2303
|
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
2238
|
-
def.pattern ?? (def.pattern =
|
|
2304
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
2239
2305
|
$ZodStringFormat.init(inst, def);
|
|
2240
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
2241
2306
|
inst._zod.check = (payload) => {
|
|
2242
2307
|
if (isValidBase64(payload.value)) return;
|
|
2243
2308
|
payload.issues.push({
|
|
@@ -2249,15 +2314,15 @@ window.__ModuleLoader__.load({
|
|
|
2249
2314
|
});
|
|
2250
2315
|
};
|
|
2251
2316
|
});
|
|
2317
|
+
const base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
2252
2318
|
function isValidBase64URL(data) {
|
|
2253
|
-
if (!
|
|
2319
|
+
if (!base64urlCharset.test(data)) return false;
|
|
2254
2320
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
2255
2321
|
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
2256
2322
|
}
|
|
2257
2323
|
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
2258
|
-
def.pattern ?? (def.pattern =
|
|
2324
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
2259
2325
|
$ZodStringFormat.init(inst, def);
|
|
2260
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
2261
2326
|
inst._zod.check = (payload) => {
|
|
2262
2327
|
if (isValidBase64URL(payload.value)) return;
|
|
2263
2328
|
payload.issues.push({
|
|
@@ -2303,7 +2368,7 @@ window.__ModuleLoader__.load({
|
|
|
2303
2368
|
});
|
|
2304
2369
|
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
2305
2370
|
$ZodType.init(inst, def);
|
|
2306
|
-
inst._zod.pattern =
|
|
2371
|
+
inst._zod.pattern = number$1;
|
|
2307
2372
|
inst._zod.parse = (payload, _ctx) => {
|
|
2308
2373
|
if (def.coerce) try {
|
|
2309
2374
|
payload.value = Number(payload.value);
|
|
@@ -2359,6 +2424,26 @@ window.__ModuleLoader__.load({
|
|
|
2359
2424
|
return payload;
|
|
2360
2425
|
};
|
|
2361
2426
|
});
|
|
2427
|
+
function capSize(inst, size) {
|
|
2428
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
2429
|
+
if (!caps.length) return;
|
|
2430
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
2431
|
+
const parse = inst._zod.parse;
|
|
2432
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2433
|
+
const n = size(payload.value);
|
|
2434
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
2435
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
|
|
2436
|
+
const start = payload.issues.length;
|
|
2437
|
+
ch._zod.check(payload);
|
|
2438
|
+
payload.issues[start].continue = false;
|
|
2439
|
+
attachSchema(payload.issues, start, inst);
|
|
2440
|
+
return payload;
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
return parse(payload, ctx);
|
|
2444
|
+
};
|
|
2445
|
+
}
|
|
2446
|
+
const arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
2362
2447
|
function handleArrayResult(result, final, index) {
|
|
2363
2448
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
2364
2449
|
final.value[index] = result.value;
|
|
@@ -2380,6 +2465,7 @@ window.__ModuleLoader__.load({
|
|
|
2380
2465
|
}
|
|
2381
2466
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
2382
2467
|
const proms = [];
|
|
2468
|
+
const abortEarly = ctx?.abortEarly;
|
|
2383
2469
|
for (let i = 0; i < input.length; i++) {
|
|
2384
2470
|
const item = input[i];
|
|
2385
2471
|
const result = def.element._zod.run({
|
|
@@ -2387,11 +2473,15 @@ window.__ModuleLoader__.load({
|
|
|
2387
2473
|
issues: []
|
|
2388
2474
|
}, ctx);
|
|
2389
2475
|
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
2390
|
-
else
|
|
2476
|
+
else {
|
|
2477
|
+
handleArrayResult(result, payload, i);
|
|
2478
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
|
|
2479
|
+
}
|
|
2391
2480
|
}
|
|
2392
2481
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2393
2482
|
return payload;
|
|
2394
2483
|
};
|
|
2484
|
+
capSize(inst, arraySize);
|
|
2395
2485
|
});
|
|
2396
2486
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2397
2487
|
const isPresent = key in input;
|
|
@@ -2411,7 +2501,7 @@ window.__ModuleLoader__.load({
|
|
|
2411
2501
|
return;
|
|
2412
2502
|
}
|
|
2413
2503
|
if (result.value === void 0) {
|
|
2414
|
-
if (isPresent) final.value[key] = void 0;
|
|
2504
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) final.value[key] = void 0;
|
|
2415
2505
|
} else final.value[key] = result.value;
|
|
2416
2506
|
}
|
|
2417
2507
|
const NO_SYMBOL_KEYS = [];
|
|
@@ -2431,14 +2521,19 @@ window.__ModuleLoader__.load({
|
|
|
2431
2521
|
optionalKeys: new Set(okeys)
|
|
2432
2522
|
};
|
|
2433
2523
|
}
|
|
2434
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
2524
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
2435
2525
|
const unrecognized = [];
|
|
2436
2526
|
const keySet = def.keySet;
|
|
2437
2527
|
const _catchall = def.catchall._zod;
|
|
2438
2528
|
const t = _catchall.def.type;
|
|
2439
2529
|
const optin = _catchall.optin;
|
|
2440
2530
|
const optout = _catchall.optout;
|
|
2531
|
+
let seen = 0;
|
|
2441
2532
|
for (const key in input) {
|
|
2533
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2534
|
+
if (aborted(payload, seen)) break;
|
|
2535
|
+
seen = payload.issues.length;
|
|
2536
|
+
}
|
|
2442
2537
|
if (keySet.has(key)) continue;
|
|
2443
2538
|
if (key === "__proto__") {
|
|
2444
2539
|
if (t === "never") unrecognized.push(key);
|
|
@@ -2467,18 +2562,19 @@ window.__ModuleLoader__.load({
|
|
|
2467
2562
|
return payload;
|
|
2468
2563
|
});
|
|
2469
2564
|
}
|
|
2470
|
-
const propShapes = /* @__PURE__ */ new WeakMap();
|
|
2471
2565
|
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
2472
2566
|
$ZodType.init(inst, def);
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2567
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2568
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
2569
|
+
if (sh) {
|
|
2570
|
+
const get = () => {
|
|
2477
2571
|
const newSh = { ...sh };
|
|
2478
2572
|
Object.defineProperty(def, "shape", { value: newSh });
|
|
2479
|
-
|
|
2573
|
+
get.raw = newSh;
|
|
2480
2574
|
return newSh;
|
|
2481
|
-
}
|
|
2575
|
+
};
|
|
2576
|
+
get.raw = sh;
|
|
2577
|
+
Object.defineProperty(def, "shape", { get });
|
|
2482
2578
|
}
|
|
2483
2579
|
const _normalized = cached(() => normalizeDef(def));
|
|
2484
2580
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -2514,7 +2610,13 @@ window.__ModuleLoader__.load({
|
|
|
2514
2610
|
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2515
2611
|
const proms = [];
|
|
2516
2612
|
const shape = value.shape;
|
|
2613
|
+
const abortEarly = ctx?.abortEarly;
|
|
2614
|
+
let seen = payload.issues.length;
|
|
2517
2615
|
for (const key of value.allKeys) {
|
|
2616
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2617
|
+
if (aborted(payload, seen)) break;
|
|
2618
|
+
seen = payload.issues.length;
|
|
2619
|
+
}
|
|
2518
2620
|
if (key === "__proto__") continue;
|
|
2519
2621
|
const el = shape[key];
|
|
2520
2622
|
const optin = el._zod.optin;
|
|
@@ -2527,7 +2629,7 @@ window.__ModuleLoader__.load({
|
|
|
2527
2629
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
2528
2630
|
}
|
|
2529
2631
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2530
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
2632
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
2531
2633
|
};
|
|
2532
2634
|
});
|
|
2533
2635
|
const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -2546,10 +2648,16 @@ window.__ModuleLoader__.load({
|
|
|
2546
2648
|
});
|
|
2547
2649
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
2548
2650
|
const prefixStr = (id, k) => `
|
|
2651
|
+
let ${id}_ab = false;
|
|
2549
2652
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
2550
2653
|
const iss = ${id}.issues[i];
|
|
2551
2654
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
2552
2655
|
payload.issues.push(iss);
|
|
2656
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
2657
|
+
}
|
|
2658
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
2659
|
+
payload.value = newResult;
|
|
2660
|
+
return payload;
|
|
2553
2661
|
}`;
|
|
2554
2662
|
doc.write(`const input = payload.value;`);
|
|
2555
2663
|
const ids = Object.create(null);
|
|
@@ -2591,6 +2699,10 @@ window.__ModuleLoader__.load({
|
|
|
2591
2699
|
input: undefined,
|
|
2592
2700
|
path: [${k}]
|
|
2593
2701
|
});
|
|
2702
|
+
if (ctx && ctx.abortEarly) {
|
|
2703
|
+
payload.value = newResult;
|
|
2704
|
+
return payload;
|
|
2705
|
+
}
|
|
2594
2706
|
}
|
|
2595
2707
|
|
|
2596
2708
|
if (${id}_present) {
|
|
@@ -2598,19 +2710,18 @@ window.__ModuleLoader__.load({
|
|
|
2598
2710
|
}
|
|
2599
2711
|
|
|
2600
2712
|
`);
|
|
2601
|
-
else
|
|
2713
|
+
else {
|
|
2714
|
+
doc.write(`
|
|
2602
2715
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
2603
2716
|
}
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
}
|
|
2609
|
-
} else {
|
|
2717
|
+
`);
|
|
2718
|
+
if (optin === "defaulted") doc.write(`newResult[${k}] = ${id}.value;`);
|
|
2719
|
+
else doc.write(`
|
|
2720
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
2610
2721
|
newResult[${k}] = ${id}.value;
|
|
2611
2722
|
}
|
|
2612
|
-
|
|
2613
2723
|
`);
|
|
2724
|
+
}
|
|
2614
2725
|
}
|
|
2615
2726
|
doc.write(`payload.value = newResult;`);
|
|
2616
2727
|
doc.write(`return payload;`);
|
|
@@ -2638,7 +2749,7 @@ window.__ModuleLoader__.load({
|
|
|
2638
2749
|
if (!fastpass) fastpass = generateFastpass(def.shape);
|
|
2639
2750
|
payload = fastpass(payload, ctx);
|
|
2640
2751
|
if (!catchall) return payload;
|
|
2641
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
2752
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
2642
2753
|
}
|
|
2643
2754
|
return superParse(payload, ctx);
|
|
2644
2755
|
};
|
|
@@ -2817,8 +2928,10 @@ window.__ModuleLoader__.load({
|
|
|
2817
2928
|
const values = getEnumValues(def.entries);
|
|
2818
2929
|
const valuesSet = new Set(values);
|
|
2819
2930
|
inst._zod.values = valuesSet;
|
|
2820
|
-
|
|
2821
|
-
|
|
2931
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2932
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
2933
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
2934
|
+
});
|
|
2822
2935
|
inst._zod.parse = (payload, _ctx) => {
|
|
2823
2936
|
const input = payload.value;
|
|
2824
2937
|
if (valuesSet.has(input)) return payload;
|
|
@@ -3053,7 +3166,7 @@ window.__ModuleLoader__.load({
|
|
|
3053
3166
|
}
|
|
3054
3167
|
}
|
|
3055
3168
|
//#endregion
|
|
3056
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3169
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
|
|
3057
3170
|
var $ZodCyclicError = class extends Error {
|
|
3058
3171
|
constructor() {
|
|
3059
3172
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3063,6 +3176,9 @@ window.__ModuleLoader__.load({
|
|
|
3063
3176
|
/** Keyed off the context object every schema in one parse call already shares. */
|
|
3064
3177
|
const STATE = "~memo";
|
|
3065
3178
|
const NO_ISSUES = [];
|
|
3179
|
+
function isRef(value) {
|
|
3180
|
+
return value !== null && typeof value === "object";
|
|
3181
|
+
}
|
|
3066
3182
|
function cloneIssues(issues) {
|
|
3067
3183
|
return issues.map((iss) => iss.path ? {
|
|
3068
3184
|
...iss,
|
|
@@ -3070,22 +3186,44 @@ window.__ModuleLoader__.load({
|
|
|
3070
3186
|
} : { ...iss });
|
|
3071
3187
|
}
|
|
3072
3188
|
const recursive = /*@__PURE__*/ new WeakMap();
|
|
3189
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
3190
|
+
const NONE = 0;
|
|
3191
|
+
const ASSUMED = 1;
|
|
3192
|
+
const PROVEN = 2;
|
|
3073
3193
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
3074
|
-
function isRecursive(inst, stack) {
|
|
3194
|
+
function isRecursive(inst, stack, resolve) {
|
|
3075
3195
|
const cached = recursive.get(inst);
|
|
3076
|
-
if (cached !== void 0) return cached;
|
|
3077
|
-
if (stack.has(inst)) return
|
|
3196
|
+
if (cached !== void 0) return cached ? PROVEN : NONE;
|
|
3197
|
+
if (stack.has(inst)) return PROVEN;
|
|
3078
3198
|
stack.add(inst);
|
|
3079
|
-
let result =
|
|
3199
|
+
let result = NONE;
|
|
3080
3200
|
const check = (child) => {
|
|
3081
|
-
if (
|
|
3201
|
+
if (result !== PROVEN && child?._zod) {
|
|
3202
|
+
const answer = isRecursive(child, stack, resolve);
|
|
3203
|
+
if (answer > result) result = answer;
|
|
3204
|
+
}
|
|
3205
|
+
};
|
|
3206
|
+
const shape = (sh, spread) => {
|
|
3207
|
+
let answer = NONE;
|
|
3208
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
3209
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
3210
|
+
if (spread && !desc.enumerable) continue;
|
|
3211
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
3212
|
+
if (child > answer) answer = child;
|
|
3213
|
+
}
|
|
3214
|
+
return answer;
|
|
3215
|
+
};
|
|
3216
|
+
const merge = (answer) => {
|
|
3217
|
+
if (answer > result) result = answer;
|
|
3082
3218
|
};
|
|
3083
3219
|
const def = inst._zod.def;
|
|
3084
3220
|
switch (def.type) {
|
|
3085
|
-
case "object":
|
|
3086
|
-
|
|
3221
|
+
case "object": {
|
|
3222
|
+
const raw = rawShape(def);
|
|
3223
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
3087
3224
|
check(def.catchall);
|
|
3088
3225
|
break;
|
|
3226
|
+
}
|
|
3089
3227
|
case "array":
|
|
3090
3228
|
check(def.element);
|
|
3091
3229
|
break;
|
|
@@ -3127,9 +3265,11 @@ window.__ModuleLoader__.load({
|
|
|
3127
3265
|
check(def.input);
|
|
3128
3266
|
check(def.output);
|
|
3129
3267
|
break;
|
|
3130
|
-
case "lazy":
|
|
3131
|
-
|
|
3268
|
+
case "lazy": {
|
|
3269
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
3270
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
3132
3271
|
break;
|
|
3272
|
+
}
|
|
3133
3273
|
case "template_literal":
|
|
3134
3274
|
case "string":
|
|
3135
3275
|
case "number":
|
|
@@ -3160,13 +3300,17 @@ window.__ModuleLoader__.load({
|
|
|
3160
3300
|
}
|
|
3161
3301
|
}
|
|
3162
3302
|
stack.delete(inst);
|
|
3163
|
-
|
|
3164
|
-
|
|
3303
|
+
return settle(inst, result);
|
|
3304
|
+
}
|
|
3305
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
3306
|
+
function settle(inst, answer) {
|
|
3307
|
+
if (answer !== ASSUMED) recursive.set(inst, answer === PROVEN);
|
|
3308
|
+
return answer;
|
|
3165
3309
|
}
|
|
3166
3310
|
function bucketFor(state, inst) {
|
|
3167
3311
|
let bucket = state.buckets.get(inst);
|
|
3168
3312
|
if (!bucket) {
|
|
3169
|
-
bucket = /* @__PURE__ */ new
|
|
3313
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
3170
3314
|
state.buckets.set(inst, bucket);
|
|
3171
3315
|
}
|
|
3172
3316
|
return bucket;
|
|
@@ -3202,6 +3346,7 @@ window.__ModuleLoader__.load({
|
|
|
3202
3346
|
attach(inst) {
|
|
3203
3347
|
var _a;
|
|
3204
3348
|
let isRecursiveInst;
|
|
3349
|
+
let rechecked = false;
|
|
3205
3350
|
let lastCtx;
|
|
3206
3351
|
let lastBucket;
|
|
3207
3352
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -3209,19 +3354,21 @@ window.__ModuleLoader__.load({
|
|
|
3209
3354
|
const base = inst._zod.parse;
|
|
3210
3355
|
const wrapped = (payload, ctx) => {
|
|
3211
3356
|
if (isRecursiveInst === void 0) {
|
|
3212
|
-
|
|
3213
|
-
if (
|
|
3357
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
3358
|
+
if (walked === NONE) {
|
|
3214
3359
|
inst._zod.parse = base;
|
|
3215
3360
|
if (inst._zod.run === wrapped) inst._zod.run = base;
|
|
3216
3361
|
return base(payload, ctx);
|
|
3217
3362
|
}
|
|
3363
|
+
if (walked === PROVEN || rechecked) isRecursiveInst = true;
|
|
3364
|
+
else rechecked = true;
|
|
3218
3365
|
}
|
|
3219
3366
|
const input = payload.value;
|
|
3220
|
-
if (input
|
|
3367
|
+
if (!isRef(input)) return base(payload, ctx);
|
|
3221
3368
|
let state = ctx[STATE];
|
|
3222
3369
|
if (!state) {
|
|
3223
3370
|
state = {
|
|
3224
|
-
buckets: /* @__PURE__ */ new
|
|
3371
|
+
buckets: /* @__PURE__ */ new WeakMap(),
|
|
3225
3372
|
backEdges: void 0
|
|
3226
3373
|
};
|
|
3227
3374
|
ctx[STATE] = state;
|
|
@@ -3240,7 +3387,7 @@ window.__ModuleLoader__.load({
|
|
|
3240
3387
|
if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
|
|
3241
3388
|
} else {
|
|
3242
3389
|
payload.memo = true;
|
|
3243
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
3390
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
3244
3391
|
state.backEdges.add(hit.value);
|
|
3245
3392
|
}
|
|
3246
3393
|
return payload;
|
|
@@ -3269,10 +3416,10 @@ window.__ModuleLoader__.load({
|
|
|
3269
3416
|
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
3270
3417
|
function isBackEdge(ctx, value) {
|
|
3271
3418
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3272
|
-
return backEdges !== void 0 && value
|
|
3419
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3273
3420
|
}
|
|
3274
3421
|
//#endregion
|
|
3275
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3422
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.js
|
|
3276
3423
|
const error = () => {
|
|
3277
3424
|
const Sizable = {
|
|
3278
3425
|
string: {
|
|
@@ -3327,7 +3474,9 @@ window.__ModuleLoader__.load({
|
|
|
3327
3474
|
base64url: "base64url-encoded string",
|
|
3328
3475
|
json_string: "JSON string",
|
|
3329
3476
|
e164: "E.164 number",
|
|
3477
|
+
currency_code: "currency code",
|
|
3330
3478
|
credit_card: "credit card number",
|
|
3479
|
+
iban: "IBAN",
|
|
3331
3480
|
jwt: "JWT",
|
|
3332
3481
|
template_literal: "input"
|
|
3333
3482
|
};
|
|
@@ -3378,7 +3527,7 @@ window.__ModuleLoader__.load({
|
|
|
3378
3527
|
return { localeError: error() };
|
|
3379
3528
|
}
|
|
3380
3529
|
//#endregion
|
|
3381
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3530
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.js
|
|
3382
3531
|
var _a;
|
|
3383
3532
|
var $ZodRegistry = class {
|
|
3384
3533
|
constructor() {
|
|
@@ -3425,13 +3574,17 @@ window.__ModuleLoader__.load({
|
|
|
3425
3574
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3426
3575
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3427
3576
|
//#endregion
|
|
3428
|
-
//#region node_modules/.pnpm/zod@4.
|
|
3577
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.js
|
|
3578
|
+
function snapshotChecks(def) {
|
|
3579
|
+
if (def.checks) def.checks = [...def.checks];
|
|
3580
|
+
return def;
|
|
3581
|
+
}
|
|
3429
3582
|
// @__NO_SIDE_EFFECTS__
|
|
3430
3583
|
function _string(Class, params) {
|
|
3431
|
-
return new Class({
|
|
3584
|
+
return new Class(snapshotChecks({
|
|
3432
3585
|
type: "string",
|
|
3433
3586
|
...normalizeParams(params)
|
|
3434
|
-
});
|
|
3587
|
+
}));
|
|
3435
3588
|
}
|
|
3436
3589
|
// @__NO_SIDE_EFFECTS__
|
|
3437
3590
|
function _email(Class, params) {
|
|
@@ -3703,11 +3856,11 @@ window.__ModuleLoader__.load({
|
|
|
3703
3856
|
}
|
|
3704
3857
|
// @__NO_SIDE_EFFECTS__
|
|
3705
3858
|
function _number(Class, params) {
|
|
3706
|
-
return new Class({
|
|
3859
|
+
return new Class(snapshotChecks({
|
|
3707
3860
|
type: "number",
|
|
3708
3861
|
checks: [],
|
|
3709
3862
|
...normalizeParams(params)
|
|
3710
|
-
});
|
|
3863
|
+
}));
|
|
3711
3864
|
}
|
|
3712
3865
|
// @__NO_SIDE_EFFECTS__
|
|
3713
3866
|
function _int(Class, params) {
|
|
@@ -3930,7 +4083,7 @@ window.__ModuleLoader__.load({
|
|
|
3930
4083
|
return ch;
|
|
3931
4084
|
}
|
|
3932
4085
|
//#endregion
|
|
3933
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4086
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
|
|
3934
4087
|
function assignProps(target, ...sources) {
|
|
3935
4088
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
3936
4089
|
return target;
|
|
@@ -3973,7 +4126,7 @@ window.__ModuleLoader__.load({
|
|
|
3973
4126
|
Object.assign(json, result);
|
|
3974
4127
|
return true;
|
|
3975
4128
|
}
|
|
3976
|
-
function
|
|
4129
|
+
function processSchema(schema, ctx, _params = {
|
|
3977
4130
|
path: [],
|
|
3978
4131
|
schemaPath: []
|
|
3979
4132
|
}) {
|
|
@@ -4012,7 +4165,7 @@ window.__ModuleLoader__.load({
|
|
|
4012
4165
|
const parent = schema._zod.parent;
|
|
4013
4166
|
if (parent) {
|
|
4014
4167
|
if (!result.ref) result.ref = parent;
|
|
4015
|
-
|
|
4168
|
+
processSchema(parent, ctx, params);
|
|
4016
4169
|
ctx.seen.get(parent).isParent = true;
|
|
4017
4170
|
}
|
|
4018
4171
|
}
|
|
@@ -4102,10 +4255,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4102
4255
|
continue;
|
|
4103
4256
|
}
|
|
4104
4257
|
if (seen.count > 1) {
|
|
4105
|
-
if (ctx.reused === "ref")
|
|
4106
|
-
extractToDef(entry);
|
|
4107
|
-
continue;
|
|
4108
|
-
}
|
|
4258
|
+
if (ctx.reused === "ref") extractToDef(entry);
|
|
4109
4259
|
}
|
|
4110
4260
|
}
|
|
4111
4261
|
if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
|
|
@@ -4360,7 +4510,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4360
4510
|
...params,
|
|
4361
4511
|
processors
|
|
4362
4512
|
});
|
|
4363
|
-
|
|
4513
|
+
processSchema(schema, ctx);
|
|
4364
4514
|
extractDefs(ctx, schema);
|
|
4365
4515
|
return finalize(ctx, schema);
|
|
4366
4516
|
};
|
|
@@ -4372,12 +4522,84 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4372
4522
|
io,
|
|
4373
4523
|
processors
|
|
4374
4524
|
});
|
|
4375
|
-
|
|
4525
|
+
processSchema(schema, ctx);
|
|
4376
4526
|
extractDefs(ctx, schema);
|
|
4377
4527
|
return finalize(ctx, schema);
|
|
4378
4528
|
};
|
|
4379
4529
|
//#endregion
|
|
4380
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4530
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
|
|
4531
|
+
const narrowMin = (agg, key, value) => {
|
|
4532
|
+
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4533
|
+
};
|
|
4534
|
+
const narrowMax = (agg, key, value) => {
|
|
4535
|
+
if (agg[key] === void 0 || value < agg[key]) agg[key] = value;
|
|
4536
|
+
};
|
|
4537
|
+
const narrowBoth = (agg, value) => {
|
|
4538
|
+
narrowMin(agg, "minimum", value);
|
|
4539
|
+
narrowMax(agg, "maximum", value);
|
|
4540
|
+
};
|
|
4541
|
+
const addDivisor = (agg, value) => {
|
|
4542
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
4543
|
+
if (!agg.multipleOf.includes(value)) agg.multipleOf.push(value);
|
|
4544
|
+
};
|
|
4545
|
+
const addPattern = (agg, pattern) => {
|
|
4546
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
4547
|
+
agg.patterns.add(pattern);
|
|
4548
|
+
};
|
|
4549
|
+
const intersectMime = (agg, mime) => {
|
|
4550
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
4551
|
+
};
|
|
4552
|
+
const setFormat = (agg, format) => {
|
|
4553
|
+
agg.format = format;
|
|
4554
|
+
if (format.includes("int")) agg.isInt = true;
|
|
4555
|
+
};
|
|
4556
|
+
const minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
4557
|
+
const maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
4558
|
+
const formatContributor = (ranges) => (agg, def) => {
|
|
4559
|
+
setFormat(agg, def.format);
|
|
4560
|
+
const [minimum, maximum] = ranges[def.format];
|
|
4561
|
+
narrowMin(agg, "minimum", minimum);
|
|
4562
|
+
narrowMax(agg, "maximum", maximum);
|
|
4563
|
+
};
|
|
4564
|
+
const contributors = {
|
|
4565
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
4566
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
4567
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
4568
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
4569
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
4570
|
+
min_length: minContributor,
|
|
4571
|
+
max_length: maxContributor,
|
|
4572
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
4573
|
+
min_size: minContributor,
|
|
4574
|
+
max_size: maxContributor,
|
|
4575
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
4576
|
+
string_format: (agg, def) => {
|
|
4577
|
+
setFormat(agg, def.format);
|
|
4578
|
+
if (def.pattern) addPattern(agg, def.pattern);
|
|
4579
|
+
if (def.format === "base64" || def.format === "base64url") agg.contentEncoding = def.format;
|
|
4580
|
+
if (def.local || def.precision === -1) agg.laxFormat = true;
|
|
4581
|
+
},
|
|
4582
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
4583
|
+
};
|
|
4584
|
+
function aggregateChecks(schema) {
|
|
4585
|
+
const agg = {};
|
|
4586
|
+
const def = schema._zod.def;
|
|
4587
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
4588
|
+
for (const ch of list) contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
4589
|
+
const bag = schema._zod.bag;
|
|
4590
|
+
if (bag.minimum !== void 0) narrowMin(agg, "minimum", bag.minimum);
|
|
4591
|
+
if (bag.exclusiveMinimum !== void 0) narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
4592
|
+
if (bag.maximum !== void 0) narrowMax(agg, "maximum", bag.maximum);
|
|
4593
|
+
if (bag.exclusiveMaximum !== void 0) narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
4594
|
+
if (bag.multipleOf !== void 0) addDivisor(agg, bag.multipleOf);
|
|
4595
|
+
if (bag.format !== void 0) {
|
|
4596
|
+
agg.format ?? (agg.format = bag.format);
|
|
4597
|
+
if (bag.format.includes("int")) agg.isInt = true;
|
|
4598
|
+
}
|
|
4599
|
+
if (bag.mime) intersectMime(agg, bag.mime);
|
|
4600
|
+
for (const pattern of bag.patterns ?? []) addPattern(agg, pattern);
|
|
4601
|
+
return agg;
|
|
4602
|
+
}
|
|
4381
4603
|
const formatMap = {
|
|
4382
4604
|
guid: "uuid",
|
|
4383
4605
|
url: "uri",
|
|
@@ -4385,10 +4607,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4385
4607
|
json_string: "json-string",
|
|
4386
4608
|
regex: ""
|
|
4387
4609
|
};
|
|
4610
|
+
const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
|
|
4611
|
+
const exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
4388
4612
|
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
4389
4613
|
const json = _json;
|
|
4390
4614
|
json.type = "string";
|
|
4391
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
4615
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
4392
4616
|
if (typeof minimum === "number") json.minLength = minimum;
|
|
4393
4617
|
if (typeof maximum === "number") json.maxLength = maximum;
|
|
4394
4618
|
if (format) {
|
|
@@ -4398,7 +4622,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4398
4622
|
}
|
|
4399
4623
|
if (contentEncoding) json.contentEncoding = contentEncoding;
|
|
4400
4624
|
if (patterns && patterns.size > 0) {
|
|
4401
|
-
const patternList = [...patterns];
|
|
4625
|
+
const patternList = [...patterns].map(exactPattern);
|
|
4402
4626
|
if (patternList.length === 1) json.pattern = patternList[0].source;
|
|
4403
4627
|
else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
|
|
4404
4628
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
@@ -4408,9 +4632,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4408
4632
|
};
|
|
4409
4633
|
const numberProcessor = (schema, ctx, _json, params) => {
|
|
4410
4634
|
const json = _json;
|
|
4411
|
-
const { minimum, maximum,
|
|
4412
|
-
|
|
4413
|
-
else json.type = "number";
|
|
4635
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
4636
|
+
json.type = isInt ? "integer" : "number";
|
|
4414
4637
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
4415
4638
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
4416
4639
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -4426,9 +4649,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4426
4649
|
json.exclusiveMaximum = true;
|
|
4427
4650
|
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
4428
4651
|
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
4429
|
-
if (
|
|
4430
|
-
|
|
4431
|
-
|
|
4652
|
+
if (multipleOf) {
|
|
4653
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
4654
|
+
for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
|
|
4655
|
+
else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
4656
|
+
const [first, ...rest] = divisors;
|
|
4657
|
+
if (first !== void 0) json.multipleOf = first;
|
|
4658
|
+
if (rest.length) json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
4432
4659
|
}
|
|
4433
4660
|
};
|
|
4434
4661
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
@@ -4457,11 +4684,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4457
4684
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
4458
4685
|
const json = _json;
|
|
4459
4686
|
const def = schema._zod.def;
|
|
4460
|
-
const { minimum, maximum } = schema
|
|
4687
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
4461
4688
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
4462
4689
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
4463
4690
|
json.type = "array";
|
|
4464
|
-
json.items =
|
|
4691
|
+
json.items = processSchema(def.element, ctx, {
|
|
4465
4692
|
...params,
|
|
4466
4693
|
path: [...params.path, "items"]
|
|
4467
4694
|
});
|
|
@@ -4479,7 +4706,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4479
4706
|
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
4480
4707
|
json.type = "object";
|
|
4481
4708
|
json.properties = {};
|
|
4482
|
-
for (const key in shape) assignProp(json.properties, key,
|
|
4709
|
+
for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
4483
4710
|
...params,
|
|
4484
4711
|
path: [
|
|
4485
4712
|
...params.path,
|
|
@@ -4487,17 +4714,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4487
4714
|
key
|
|
4488
4715
|
]
|
|
4489
4716
|
}));
|
|
4490
|
-
const
|
|
4491
|
-
const
|
|
4717
|
+
const requiredKeys = [];
|
|
4718
|
+
for (const key of Object.keys(shape)) {
|
|
4492
4719
|
const field = def.shape[key];
|
|
4493
|
-
if (ctx.io === "input"
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
|
|
4720
|
+
if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) requiredKeys.push(key);
|
|
4721
|
+
}
|
|
4722
|
+
if (requiredKeys.length > 0) json.required = requiredKeys;
|
|
4497
4723
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
4498
4724
|
else if (!def.catchall) {
|
|
4499
4725
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
4500
|
-
} else if (def.catchall) json.additionalProperties =
|
|
4726
|
+
} else if (def.catchall) json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
4501
4727
|
...params,
|
|
4502
4728
|
path: [...params.path, "additionalProperties"]
|
|
4503
4729
|
});
|
|
@@ -4505,7 +4731,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4505
4731
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
4506
4732
|
const def = schema._zod.def;
|
|
4507
4733
|
const isExclusive = def.inclusive === false;
|
|
4508
|
-
const options = def.options.map((x, i) =>
|
|
4734
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
4509
4735
|
...params,
|
|
4510
4736
|
path: [
|
|
4511
4737
|
...params.path,
|
|
@@ -4518,7 +4744,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4518
4744
|
};
|
|
4519
4745
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
4520
4746
|
const def = schema._zod.def;
|
|
4521
|
-
const a =
|
|
4747
|
+
const a = processSchema(def.left, ctx, {
|
|
4522
4748
|
...params,
|
|
4523
4749
|
path: [
|
|
4524
4750
|
...params.path,
|
|
@@ -4526,7 +4752,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4526
4752
|
0
|
|
4527
4753
|
]
|
|
4528
4754
|
});
|
|
4529
|
-
const b =
|
|
4755
|
+
const b = processSchema(def.right, ctx, {
|
|
4530
4756
|
...params,
|
|
4531
4757
|
path: [
|
|
4532
4758
|
...params.path,
|
|
@@ -4541,7 +4767,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4541
4767
|
};
|
|
4542
4768
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
4543
4769
|
const def = schema._zod.def;
|
|
4544
|
-
const inner =
|
|
4770
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
4545
4771
|
const seen = ctx.seen.get(schema);
|
|
4546
4772
|
if (ctx.target === "openapi-3.0") {
|
|
4547
4773
|
seen.ref = def.innerType;
|
|
@@ -4550,7 +4776,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4550
4776
|
};
|
|
4551
4777
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
4552
4778
|
const def = schema._zod.def;
|
|
4553
|
-
|
|
4779
|
+
processSchema(def.innerType, ctx, params);
|
|
4554
4780
|
const seen = ctx.seen.get(schema);
|
|
4555
4781
|
seen.ref = def.innerType;
|
|
4556
4782
|
};
|
|
@@ -4571,7 +4797,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4571
4797
|
}
|
|
4572
4798
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
4573
4799
|
const def = schema._zod.def;
|
|
4574
|
-
|
|
4800
|
+
processSchema(def.innerType, ctx, params);
|
|
4575
4801
|
const seen = ctx.seen.get(schema);
|
|
4576
4802
|
seen.ref = def.innerType;
|
|
4577
4803
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -4579,7 +4805,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4579
4805
|
};
|
|
4580
4806
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
4581
4807
|
const def = schema._zod.def;
|
|
4582
|
-
|
|
4808
|
+
processSchema(def.innerType, ctx, params);
|
|
4583
4809
|
const seen = ctx.seen.get(schema);
|
|
4584
4810
|
seen.ref = def.innerType;
|
|
4585
4811
|
if (ctx.io !== "input") return;
|
|
@@ -4588,7 +4814,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4588
4814
|
};
|
|
4589
4815
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
4590
4816
|
const def = schema._zod.def;
|
|
4591
|
-
|
|
4817
|
+
processSchema(def.innerType, ctx, params);
|
|
4592
4818
|
const seen = ctx.seen.get(schema);
|
|
4593
4819
|
seen.ref = def.innerType;
|
|
4594
4820
|
let catchValue;
|
|
@@ -4604,25 +4830,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4604
4830
|
const def = schema._zod.def;
|
|
4605
4831
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
4606
4832
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
4607
|
-
|
|
4833
|
+
processSchema(innerType, ctx, params);
|
|
4608
4834
|
const seen = ctx.seen.get(schema);
|
|
4609
4835
|
seen.ref = innerType;
|
|
4610
4836
|
};
|
|
4611
4837
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
4612
4838
|
const def = schema._zod.def;
|
|
4613
|
-
|
|
4839
|
+
processSchema(def.innerType, ctx, params);
|
|
4614
4840
|
const seen = ctx.seen.get(schema);
|
|
4615
4841
|
seen.ref = def.innerType;
|
|
4616
4842
|
json.readOnly = true;
|
|
4617
4843
|
};
|
|
4618
4844
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
4619
4845
|
const def = schema._zod.def;
|
|
4620
|
-
|
|
4846
|
+
processSchema(def.innerType, ctx, params);
|
|
4621
4847
|
const seen = ctx.seen.get(schema);
|
|
4622
4848
|
seen.ref = def.innerType;
|
|
4623
4849
|
};
|
|
4624
4850
|
//#endregion
|
|
4625
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4851
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
4626
4852
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4627
4853
|
function _lazyMethod(proto, key, make) {
|
|
4628
4854
|
Object.defineProperty(proto, key, {
|
|
@@ -4672,7 +4898,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4672
4898
|
};
|
|
4673
4899
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4674
4900
|
//#endregion
|
|
4675
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4901
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
4676
4902
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
4677
4903
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
4678
4904
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -4686,7 +4912,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4686
4912
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4687
4913
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4688
4914
|
//#endregion
|
|
4689
|
-
//#region node_modules/.pnpm/zod@4.
|
|
4915
|
+
//#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
4690
4916
|
function _ensureDefaultLocale() {
|
|
4691
4917
|
if (!globalConfig.localeError) config(en_default());
|
|
4692
4918
|
}
|
|
@@ -4822,6 +5048,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4822
5048
|
set spa(value) {
|
|
4823
5049
|
own(this, "spa", value);
|
|
4824
5050
|
},
|
|
5051
|
+
validate(data, params) {
|
|
5052
|
+
return validate(this, data, params);
|
|
5053
|
+
},
|
|
5054
|
+
validateAsync(data, params) {
|
|
5055
|
+
return validateAsync$1(this, data, params);
|
|
5056
|
+
},
|
|
4825
5057
|
encode: function _encode(data, params) {
|
|
4826
5058
|
return encode(this, data, params, { callee: _encode });
|
|
4827
5059
|
},
|
|
@@ -4861,10 +5093,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4861
5093
|
$ZodString.init(inst, def);
|
|
4862
5094
|
ZodType.init(inst, def);
|
|
4863
5095
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
5096
|
+
}, /*@__PURE__*/ derived({
|
|
5097
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
5098
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
5099
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
4868
5100
|
}, {
|
|
4869
5101
|
regex(...args) {
|
|
4870
5102
|
return this.check(/* @__PURE__ */ _regex(...args));
|
|
@@ -4911,7 +5143,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4911
5143
|
slugify() {
|
|
4912
5144
|
return this.check(/* @__PURE__ */ _slugify());
|
|
4913
5145
|
}
|
|
4914
|
-
});
|
|
5146
|
+
}));
|
|
4915
5147
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
4916
5148
|
$ZodString.init(inst, def);
|
|
4917
5149
|
_ZodString.init(inst, def);
|
|
@@ -5103,12 +5335,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5103
5335
|
$ZodNumber.init(inst, def);
|
|
5104
5336
|
ZodType.init(inst, def);
|
|
5105
5337
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
5106
|
-
const bag = inst._zod.bag;
|
|
5107
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
5108
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
5109
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
5110
5338
|
inst.isFinite = true;
|
|
5111
|
-
|
|
5339
|
+
}, /*@__PURE__*/ derived({
|
|
5340
|
+
minValue: (inst) => {
|
|
5341
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
5342
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
5343
|
+
},
|
|
5344
|
+
maxValue: (inst) => {
|
|
5345
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
5346
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
5347
|
+
},
|
|
5348
|
+
isInt: (inst) => {
|
|
5349
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
5350
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
5351
|
+
},
|
|
5352
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
5112
5353
|
}, {
|
|
5113
5354
|
gt(value, params) {
|
|
5114
5355
|
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
@@ -5155,7 +5396,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5155
5396
|
finite() {
|
|
5156
5397
|
return this;
|
|
5157
5398
|
}
|
|
5158
|
-
});
|
|
5399
|
+
}));
|
|
5159
5400
|
function number(params) {
|
|
5160
5401
|
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
5161
5402
|
}
|
|
@@ -5227,34 +5468,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5227
5468
|
return _enum(Object.keys(this._zod.def.shape));
|
|
5228
5469
|
},
|
|
5229
5470
|
catchall(catchall) {
|
|
5230
|
-
return this.clone({
|
|
5231
|
-
...this._zod.def,
|
|
5232
|
-
catchall
|
|
5233
|
-
});
|
|
5471
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
5234
5472
|
},
|
|
5235
5473
|
passthrough() {
|
|
5236
|
-
return this.clone({
|
|
5237
|
-
...this._zod.def,
|
|
5238
|
-
catchall: unknown()
|
|
5239
|
-
});
|
|
5474
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5240
5475
|
},
|
|
5241
5476
|
loose() {
|
|
5242
|
-
return this.clone({
|
|
5243
|
-
...this._zod.def,
|
|
5244
|
-
catchall: unknown()
|
|
5245
|
-
});
|
|
5477
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
5246
5478
|
},
|
|
5247
5479
|
strict() {
|
|
5248
|
-
return this.clone({
|
|
5249
|
-
...this._zod.def,
|
|
5250
|
-
catchall: never()
|
|
5251
|
-
});
|
|
5480
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
5252
5481
|
},
|
|
5253
5482
|
strip() {
|
|
5254
|
-
return this.clone({
|
|
5255
|
-
...this._zod.def,
|
|
5256
|
-
catchall: void 0
|
|
5257
|
-
});
|
|
5483
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
5258
5484
|
},
|
|
5259
5485
|
extend(incoming) {
|
|
5260
5486
|
return extend(this, incoming);
|
|
@@ -5319,7 +5545,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5319
5545
|
ZodType.init(inst, def);
|
|
5320
5546
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
5321
5547
|
inst.enum = def.entries;
|
|
5322
|
-
inst.options =
|
|
5548
|
+
inst.options = [...inst._zod.values];
|
|
5323
5549
|
const keys = new Set(Object.keys(def.entries));
|
|
5324
5550
|
inst.extract = (values, params) => {
|
|
5325
5551
|
const newEntries = {};
|